1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533 |
- (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=23)}([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, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */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 c}),r.d(t,"__metadata",function(){return l}),r.d(t,"__awaiter",function(){return u}),r.d(t,"__generator",function(){return h}),r.d(t,"__exportStar",function(){return d}),r.d(t,"__values",function(){return f}),r.d(t,"__read",function(){return p}),r.d(t,"__spread",function(){return g}),r.d(t,"__await",function(){return m}),r.d(t,"__asyncGenerator",function(){return _}),r.d(t,"__asyncDelegator",function(){return v}),r.d(t,"__asyncValues",function(){return A}),r.d(t,"__makeTemplateObject",function(){return y}),r.d(t,"__importStar",function(){return b}),r.d(t,"__importDefault",function(){return T});
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation. All rights reserved.
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of the
- License at http://www.apache.org/licenses/LICENSE-2.0
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
- MERCHANTABLITY OR NON-INFRINGEMENT.
- See the Apache Version 2.0 License for specific language governing permissions
- and limitations under the License.
- ***************************************************************************** */
- 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&&(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 c(e,t){return function(r,n){t(r,n,e)}}function l(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{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,a)}c((n=n.apply(e,t||[])).next())})}function h(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])}}}function d(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function f(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function p(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(p(arguments[t]));return e}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function _(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 m?Promise.resolve(r.value.v).then(c,l):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function v(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:m(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=f(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 y(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function b(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function T(e){return e&&e.__esModule?e:{default:e}}},"../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:!0,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:!0,configurable:!0}),e.HasSpecificTrigger=function(t){for(var r in e.Triggers){if(e.Triggers.hasOwnProperty(r))if(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 s});var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),s=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 i.Color3?e.r+", "+e.g+", "+e.b:e instanceof i.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}();o._TypeStore.RegisteredTypes["BABYLON.Action"]=s},"./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,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 p});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ./condition */"./Actions/condition.ts"),s=r(/*! ./action */"./Actions/action.ts"),a=r(/*! ./directActions */"./Actions/directActions.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ../Misc/logger */"./Misc/logger.ts"),u=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),h=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),d=r(/*! ./abstractActionManager */"./Actions/abstractActionManager.ts"),f=r(/*! ../Engines/constants */"./Engines/constants.ts"),p=function(e){function t(t){var r=e.call(this)||this;return r._scene=t||c.EngineStore.LastCreatedScene,t.actionManagers.push(r),r}return 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:!0,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:!0,configurable:!0}),t.prototype.registerAction=function(e){return e.trigger===t.OnEveryFrameTrigger&&this.getScene().actionManager!==this?(l.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(s.Action._GetTargetProperty(o.parameter));else{var a={};u.DeepCopier.DeepCopy(o.parameter,a,["mesh"]),o.parameter&&o.parameter.mesh&&(a._meshId=o.parameter.mesh.id),i.properties.push({name:"parameter",targetType:null,value:a})}this.actions[n].serialize(i),r.children.push(i)}return r},t.Parse=function(e,r,n){var s=new t(n);null===r?n.actionManager=s:r.actionManager=s;for(var c=function(e,t,r,n){if(null===n){var o=parseFloat(t);return"true"===t||"false"===t?"true"===t:isNaN(o)?t:o}for(var s=n.split("."),a=t.split(","),c=0;c<s.length;c++)r=r[s[c]];if("boolean"==typeof r)return"true"===a[0];if("string"==typeof r)return a[0];var l=new Array;for(c=0;c<a.length;c++)l.push(parseFloat(a[c]));return r instanceof i.Vector3?i.Vector3.FromArray(l):r instanceof i.Vector4?i.Vector4.FromArray(l):r instanceof i.Color3?i.Color3.FromArray(l):r instanceof i.Color4?i.Color4.FromArray(l):parseFloat(a[0])},l=function(e,r,i,u,d){if(void 0===d&&(d=null),!e.detached){var f=new Array,p=null,g=null,m=e.combine&&e.combine.length>0;if(2===e.type?f.push(s):f.push(r),m){for(var _=new Array,v=0;v<e.combine.length;v++)l(e.combine[v],t.NothingTrigger,i,u,_);f.push(_)}else for(var A=0;A<e.properties.length;A++){var y=e.properties[A].value,b=e.properties[A].name,T=e.properties[A].targetType;"target"===b?y=p=null!==T&&"SceneProperties"===T?n:n.getNodeByName(y):"parent"===b?y=n.getNodeByName(y):"sound"===b?n.getSoundByName&&(y=n.getSoundByName(y)):"propertyPath"!==b?y=2===e.type&&"operator"===b?o.ValueCondition[y]:c(0,y,p,"value"===b?g:null):g=y,f.push(y)}if(null===d?f.push(i):f.push(null),"InterpolateValueAction"===e.name){var E=f[f.length-2];f[f.length-1]=E,f[f.length-2]=i}var x=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(x instanceof o.Condition&&null!==i){var C=new a.DoNothingAction(r,i);u?u.then(C):s.registerAction(C),u=C}null===d?x instanceof o.Condition?(i=x,x=u):(i=null,u?u.then(x):s.registerAction(x)):d.push(x);for(A=0;A<e.children.length;A++)l(e.children[A],r,i,x,null)}},u=0;u<e.children.length;u++){var d,f=e.children[u];if(f.properties.length>0){var p=f.properties[0].value,g=null===f.properties[0].targetType?p:n.getMeshByName(p);g._meshId&&(g.mesh=n.getMeshByID(g._meshId)),d={trigger:t[f.name],parameter:g}}else d=t[f.name];for(var m=0;m<f.children.length;m++)f.detached||l(f.children[m],d,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=f.Constants.ACTION_NothingTrigger,t.OnPickTrigger=f.Constants.ACTION_OnPickTrigger,t.OnLeftPickTrigger=f.Constants.ACTION_OnLeftPickTrigger,t.OnRightPickTrigger=f.Constants.ACTION_OnRightPickTrigger,t.OnCenterPickTrigger=f.Constants.ACTION_OnCenterPickTrigger,t.OnPickDownTrigger=f.Constants.ACTION_OnPickDownTrigger,t.OnDoublePickTrigger=f.Constants.ACTION_OnDoublePickTrigger,t.OnPickUpTrigger=f.Constants.ACTION_OnPickUpTrigger,t.OnPickOutTrigger=f.Constants.ACTION_OnPickOutTrigger,t.OnLongPressTrigger=f.Constants.ACTION_OnLongPressTrigger,t.OnPointerOverTrigger=f.Constants.ACTION_OnPointerOverTrigger,t.OnPointerOutTrigger=f.Constants.ACTION_OnPointerOutTrigger,t.OnEveryFrameTrigger=f.Constants.ACTION_OnEveryFrameTrigger,t.OnIntersectionEnterTrigger=f.Constants.ACTION_OnIntersectionEnterTrigger,t.OnIntersectionExitTrigger=f.Constants.ACTION_OnIntersectionExitTrigger,t.OnKeyDownTrigger=f.Constants.ACTION_OnKeyDownTrigger,t.OnKeyUpTrigger=15,t}(d.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 c}),r.d(t,"StateCondition",function(){return l});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 n.__extends(t,e),Object.defineProperty(t,"IsEqual",{get:function(){return t._IsEqual},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IsDifferent",{get:function(){return t._IsDifferent},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IsGreater",{get:function(){return t._IsGreater},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IsLesser",{get:function(){return t._IsLesser},enumerable:!0,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),c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n}return n.__extends(t,e),t.prototype.isValid=function(){return this.predicate()},t}(s),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.value=n,i._target=r,i}return 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"]=c,o._TypeStore.RegisteredTypes["BABYLON.StateCondition"]=l},"./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 l}),r.d(t,"SetStateAction",function(){return u}),r.d(t,"SetValueAction",function(){return h}),r.d(t,"IncrementValueAction",function(){return d}),r.d(t,"PlayAnimationAction",function(){return f}),r.d(t,"StopAnimationAction",function(){return p}),r.d(t,"DoNothingAction",function(){return g}),r.d(t,"CombineAction",function(){return m}),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 */"./Maths/math.ts"),s=r(/*! ./action */"./Actions/action.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),l=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 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 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),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 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),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 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 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 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),g=function(e){function t(t,r){return void 0===t&&(t=a.Constants.ACTION_NothingTrigger),e.call(this,t,r)||this}return 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),m=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return i.children=r,i}return 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 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 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);c._TypeStore.RegisteredTypes["BABYLON.SetParentAction"]=v,c._TypeStore.RegisteredTypes["BABYLON.ExecuteCodeAction"]=_,c._TypeStore.RegisteredTypes["BABYLON.DoNothingAction"]=g,c._TypeStore.RegisteredTypes["BABYLON.StopAnimationAction"]=p,c._TypeStore.RegisteredTypes["BABYLON.PlayAnimationAction"]=f,c._TypeStore.RegisteredTypes["BABYLON.IncrementValueAction"]=d,c._TypeStore.RegisteredTypes["BABYLON.SetValueAction"]=h,c._TypeStore.RegisteredTypes["BABYLON.SetStateAction"]=u,c._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 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 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: 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(/*! ./action */"./Actions/action.ts");r.d(t,"Action",function(){return n.Action});var i=r(/*! ./actionEvent */"./Actions/actionEvent.ts");r.d(t,"ActionEvent",function(){return i.ActionEvent});var o=r(/*! ./actionManager */"./Actions/actionManager.ts");r.d(t,"ActionManager",function(){return o.ActionManager});var s=r(/*! ./condition */"./Actions/condition.ts");r.d(t,"Condition",function(){return s.Condition}),r.d(t,"ValueCondition",function(){return s.ValueCondition}),r.d(t,"PredicateCondition",function(){return s.PredicateCondition}),r.d(t,"StateCondition",function(){return s.StateCondition});var a=r(/*! ./directActions */"./Actions/directActions.ts");r.d(t,"SwitchBooleanAction",function(){return a.SwitchBooleanAction}),r.d(t,"SetStateAction",function(){return a.SetStateAction}),r.d(t,"SetValueAction",function(){return a.SetValueAction}),r.d(t,"IncrementValueAction",function(){return a.IncrementValueAction}),r.d(t,"PlayAnimationAction",function(){return a.PlayAnimationAction}),r.d(t,"StopAnimationAction",function(){return a.StopAnimationAction}),r.d(t,"DoNothingAction",function(){return a.DoNothingAction}),r.d(t,"CombineAction",function(){return a.CombineAction}),r.d(t,"ExecuteCodeAction",function(){return a.ExecuteCodeAction}),r.d(t,"SetParentAction",function(){return a.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 l=r(/*! ./interpolateValueAction */"./Actions/interpolateValueAction.ts");r.d(t,"InterpolateValueAction",function(){return l.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 u});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 */"./Maths/math.ts"),c=r(/*! ../Animations/animation */"./Animations/animation.ts"),l=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),u=function(e){function t(t,r,n,i,o,a,c,l){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=c,u.onInterpolationDone=l,u._target=u._effectiveTarget=r,u}return 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 a.Vector3)e=c.Animation.ANIMATIONTYPE_VECTOR3;else if(this.value instanceof a.Matrix)e=c.Animation.ANIMATIONTYPE_MATRIX;else{if(!(this.value instanceof a.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);l._TypeStore.RegisteredTypes["BABYLON.InterpolateValueAction"]=u},"./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 */"./Maths/math.ts"),c=r(/*! ../Misc/precisionDate */"./Misc/precisionDate.ts"),l=r(/*! ../Bones/bone */"./Bones/bone.ts"),u=function(){function e(e,t,r,n,i,s,a,c,l){void 0===r&&(r=0),void 0===n&&(n=100),void 0===i&&(i=!1),void 0===s&&(s=1),this.target=t,this.fromFrame=r,this.toFrame=n,this.loopAnimation=i,this.onAnimationEnd=a,this.onAnimationLoop=l,this._localDelayOffset=null,this._pausedDelay=null,this._runtimeAnimations=new Array,this._paused=!1,this._speedRatio=1,this._weight=-1,this.disposeOnEnd=!0,this.animationStarted=!1,this.onAnimationEndObservable=new o.Observable,this.onAnimationLoopObservable=new o.Observable,this._scene=e,c&&this.appendAnimations(t,c),this._speedRatio=s,e._activeAnimatables.push(this)}return Object.defineProperty(e.prototype,"syncRoot",{get:function(){return this._syncRoot},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"masterFrame",{get:function(){return 0===this._runtimeAnimations.length?0:this._runtimeAnimations[0].currentFrame},enumerable:!0,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:!0,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:!0,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=0;r<t.length;r++){var n=t[r];this._runtimeAnimations.push(new i.RuntimeAnimation(e,n,this._scene,this))}},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=1e3*(e-t[0].currentFrame)/(r*this.speedRatio);null===this._localDelayOffset&&(this._localDelayOffset=0),this._localDelayOffset-=n}for(var i=0;i<t.length;i++)t[i].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){var t=this;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 r,n=!1,i=this._runtimeAnimations;for(r=0;r<i.length;r++){var o=i[r].animate(e-this._localDelayOffset,this.fromFrame,this.toFrame,this.loopAnimation,this._speedRatio,this._weight,function(){t.onAnimationLoopObservable.notifyObservers(t),t.onAnimationLoop&&t.onAnimationLoop()});n=n||o}if(this.animationStarted=n,!n){if(this.disposeOnEnd)for(r=this._scene._activeAnimatables.indexOf(this),this._scene._activeAnimatables.splice(r,1),r=0;r<i.length;r++)i[r].dispose();this._raiseOnAnimationEnd(),this.disposeOnEnd&&(this.onAnimationEnd=null,this.onAnimationLoop=null,this.onAnimationLoopObservable.clear(),this.onAnimationEndObservable.clear())}return n},e}();s.Scene.prototype._animate=function(){if(this.animationsEnabled&&0!==this._activeAnimatables.length){var e=c.PrecisionDate.Now;if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=e}var t=this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale;this._animationTime+=t,this._animationTimeLast=e;for(var r=0;r<this._activeAnimatables.length;r++)this._activeAnimatables[r]._animate(this._animationTime);this._processLateAnimationBindings()}},s.Scene.prototype.beginWeightedAnimation=function(e,t,r,n,i,o,s,a,c,l){void 0===n&&(n=1),void 0===o&&(o=1);var u=this.beginAnimation(e,t,r,i,o,s,a,!1,c,l);return u.weight=n,u},s.Scene.prototype.beginAnimation=function(e,t,r,n,i,o,s,a,c,l){void 0===i&&(i=1),void 0===a&&(a=!0),t>r&&i>0&&(i*=-1),a&&this.stopAnimation(e,void 0,c),s||(s=new u(this,e,t,r,n,i,o,void 0,l));var h=!c||c(e);if(e.animations&&h&&s.appendAnimations(e,e.animations),e.getAnimatables)for(var d=e.getAnimatables(),f=0;f<d.length;f++)this.beginAnimation(d[f],t,r,n,i,o,s,a,c,l);return s.reset(),s},s.Scene.prototype.beginHierarchyAnimation=function(e,t,r,n,i,o,s,a,c,l,u){void 0===o&&(o=1),void 0===c&&(c=!0);var h=e.getDescendants(t),d=[];d.push(this.beginAnimation(e,r,n,i,o,s,a,c,l));for(var f=0,p=h;f<p.length;f++){var g=p[f];d.push(this.beginAnimation(g,r,n,i,o,s,a,c,l))}return d},s.Scene.prototype.beginDirectAnimation=function(e,t,r,n,i,o,s,a){return void 0===o&&(o=1),new u(this,e,r,n,i,o,s,t,a)},s.Scene.prototype.beginDirectHierarchyAnimation=function(e,t,r,n,i,o,s,a,c){var l=e.getDescendants(t),u=[];u.push(this.beginDirectAnimation(e,r,n,i,o,s,a,c));for(var h=0,d=l;h<d.length;h++){var f=d[h];u.push(this.beginDirectAnimation(f,r,n,i,o,s,a,c))}return u},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,animations:[],originalValue:t}),r._lateAnimationHolders[e.targetPath].animations.push(e),r._lateAnimationHolders[e.targetPath].totalWeight+=e.weight},s.Scene.prototype._processLateAnimationBindingsForMatrices=function(e){var t=1,r=a.Tmp.Vector3[0],n=a.Tmp.Vector3[1],i=a.Tmp.Quaternion[0],o=0,s=e.animations[0],c=e.originalValue,l=1;if(e.totalWeight<1)c.decompose(n,i,r),l=1-e.totalWeight;else if(o=1,t=e.totalWeight,s.currentValue.decompose(n,i,r),1==(l=s.weight/t))return s.currentValue;n.scaleInPlace(l),r.scaleInPlace(l),i.scaleInPlace(l);for(var u=o;u<e.animations.length;u++){var h=e.animations[u],d=(l=h.weight/t,a.Tmp.Vector3[2]),f=a.Tmp.Vector3[3],p=a.Tmp.Quaternion[1];h.currentValue.decompose(f,p,d),f.scaleAndAddToRef(l,n),p.scaleAndAddToRef(l,i),d.scaleAndAddToRef(l,r)}return a.Matrix.ComposeToRef(n,i,r,s._workValue),s._workValue},s.Scene.prototype._processLateAnimationBindingsForQuaternions=function(e,t){var r=e.animations[0],n=e.originalValue;if(1===e.animations.length)return a.Quaternion.SlerpToRef(n,r.currentValue,Math.min(1,e.totalWeight),t),t;var i,o,s=1;if(e.totalWeight<1){var c=1-e.totalWeight;o=[],(i=[]).push(n),o.push(c)}else{if(2===e.animations.length)return a.Quaternion.SlerpToRef(e.animations[0].currentValue,e.animations[1].currentValue,e.animations[1].weight/e.totalWeight,t),t;i=[],o=[],s=e.totalWeight}for(var l=0;l<e.animations.length;l++){var u=e.animations[l];i.push(u.currentValue),o.push(u.weight/s)}for(var h=0,d=null,f=0;f<i.length;)d?(h+=o[f],a.Quaternion.SlerpToRef(d,i[f],o[f]/h,d),f++):(a.Quaternion.SlerpToRef(i[f],i[f+1],o[f+1]/(o[f]+o[f+1]),t),d=t,h=o[f]+o[f+1],f+=2);return d},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,c=n.Animation.AllowMatrixDecomposeForInterpolation&&s.m,l=t[r];if(c)l=this._processLateAnimationBindingsForMatrices(i);else if(void 0!==s.w)l=this._processLateAnimationBindingsForQuaternions(i,l||a.Quaternion.Identity());else{var u=0,h=1;if(i.totalWeight<1)l=s.scale?s.scale(1-i.totalWeight):s*(1-i.totalWeight);else{h=i.totalWeight;var d=o.weight/h;l=1!==d?o.currentValue.scale?o.currentValue.scale(d):o.currentValue*d:o.currentValue,u=1}for(var f=u;f<i.animations.length;f++){var p=i.animations[f],g=p.weight/h;p.currentValue.scaleAndAddToRef?p.currentValue.scaleAndAddToRef(g,l):l+=p.currentValue*g}}t[r]=l}t._lateAnimationHolders={}}this._registeredForLateAnimationBindings.reset()}},l.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,c,l,u=s.from,h=s.to,d=e.animations[0].getKeys(),f=e.length,p=e.getParent(),g=this.getParent(),m=i&&p&&f&&this.length&&f!==this.length,_=m&&g&&p?g.length/p.length:1,v=i&&!g&&o&&(1!==o.x||1!==o.y||1!==o.z),A=this.animations[0].getKeys(),y=0,b=d.length;y<b;y++)(a=d[y]).frame>=u&&a.frame<=h&&(i?(l=a.value.clone(),m?(c=l.getTranslation(),l.setTranslation(c.scaleInPlace(_))):v&&o?(c=l.getTranslation(),l.setTranslation(c.multiplyInPlace(o))):l=a.value):l=a.value,A.push({frame:a.frame+r,value:l}));return this.animations[0].createRange(t,u+r,h+r),!0}},"./Animations/animation.ts":
- /*!*********************************!*\
- !*** ./Animations/animation.ts ***!
- \*********************************/
- /*! exports provided: Animation */function(e,t,r){"use strict";r.r(t),r.d(t,"Animation",function(){return u});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),o=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=r(/*! ./animationKey */"./Animations/animationKey.ts"),c=r(/*! ./animationRange */"./Animations/animationRange.ts"),l=r(/*! ../node */"./node.ts"),u=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,i,o,s,a,c,l){var u=void 0;if(!isNaN(parseFloat(s))&&isFinite(s)?u=e.ANIMATIONTYPE_FLOAT:s instanceof n.Quaternion?u=e.ANIMATIONTYPE_QUATERNION:s instanceof n.Vector3?u=e.ANIMATIONTYPE_VECTOR3:s instanceof n.Vector2?u=e.ANIMATIONTYPE_VECTOR2:s instanceof n.Color3?u=e.ANIMATIONTYPE_COLOR3:s instanceof n.Size&&(u=e.ANIMATIONTYPE_SIZE),null==u)return null;var h=new e(t,r,i,u,c),d=[{frame:0,value:s},{frame:o,value:a}];return h.setKeys(d),void 0!==l&&h.setEasingFunction(l),h},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,c,l,u){var h=e._PrepareAnimation(t,n,i,o,s,a,c,l);return h?r.getScene().beginDirectAnimation(r,[h],0,o,1===h.loopMode,1,u):null},e.CreateAndStartHierarchyAnimation=function(t,r,n,i,o,s,a,c,l,u,h){var d=e._PrepareAnimation(t,i,o,s,a,c,l,u);return d?r.getScene().beginDirectHierarchyAnimation(r,n,[d],0,s,1===d.loopMode,1,h):null},e.CreateMergeAndStartAnimation=function(t,r,n,i,o,s,a,c,l,u){var h=e._PrepareAnimation(t,n,i,o,s,a,c,l);return h?(r.animations.push(h),r.getScene().beginAnimation(r,0,o,1===h.loopMode,1,u)):null},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 c=i*(s/1e3);o.setKeys([{frame:0,value:r[e].clone?r[e].clone():r[e]},{frame:c,value:t}]),r.animations||(r.animations=[]),r.animations.push(o);var l=n.beginAnimation(r,0,c,!1);return l.onAnimationEnd=a,l},Object.defineProperty(e.prototype,"runtimeAnimations",{get:function(){return this._runtimeAnimations},enumerable:!0,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:!0,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)},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 i.Scalar.Lerp(e,t,r)},e.prototype.floatInterpolateFunctionWithTangents=function(e,t,r,n,o){return i.Scalar.Hermite(e,t,r,n,o)},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 n.Size.Lerp(e,t,r)},e.prototype.color3InterpolateFunction=function(e,t,r){return n.Color3.Lerp(e,t,r)},e.prototype._getKeyValue=function(e){return"function"==typeof e?e():e},e.prototype._interpolate=function(t,r,n,i,o,s){if(i===e.ANIMATIONLOOPMODE_CONSTANT&&r>0)return s.clone?s.clone():s;var c=this.getKeys();if(1===c.length)return this._getKeyValue(c[0].value);var l=Math.max(0,Math.min(c.length-1,Math.floor(c.length*(t-c[0].frame)/(c[c.length-1].frame-c[0].frame))-1));if(c[l].frame>=t)for(;l-1>=0&&c[l].frame>=t;)l--;for(var u=l;u<c.length;u++){var h=c[u+1];if(h.frame>=t){var d=c[u],f=this._getKeyValue(d.value);if(d.interpolation===a.AnimationKeyInterpolation.STEP)return f;var p=this._getKeyValue(h.value),g=void 0!==d.outTangent&&void 0!==h.inTangent,m=h.frame-d.frame,_=(t-d.frame)/m,v=this.getEasingFunction();switch(null!=v&&(_=v.ease(_)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var A=g?this.floatInterpolateFunctionWithTangents(f,d.outTangent*m,p,h.inTangent*m,_):this.floatInterpolateFunction(f,p,_);switch(i){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return A;case e.ANIMATIONLOOPMODE_RELATIVE:return o*r+A}break;case e.ANIMATIONTYPE_QUATERNION:var y=g?this.quaternionInterpolateFunctionWithTangents(f,d.outTangent.scale(m),p,h.inTangent.scale(m),_):this.quaternionInterpolateFunction(f,p,_);switch(i){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return y;case e.ANIMATIONLOOPMODE_RELATIVE:return y.addInPlace(o.scale(r))}return y;case e.ANIMATIONTYPE_VECTOR3:var b=g?this.vector3InterpolateFunctionWithTangents(f,d.outTangent.scale(m),p,h.inTangent.scale(m),_):this.vector3InterpolateFunction(f,p,_);switch(i){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return b;case e.ANIMATIONLOOPMODE_RELATIVE:return b.add(o.scale(r))}case e.ANIMATIONTYPE_VECTOR2:var T=g?this.vector2InterpolateFunctionWithTangents(f,d.outTangent.scale(m),p,h.inTangent.scale(m),_):this.vector2InterpolateFunction(f,p,_);switch(i){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return T;case e.ANIMATIONLOOPMODE_RELATIVE:return T.add(o.scale(r))}case e.ANIMATIONTYPE_SIZE:switch(i){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(f,p,_);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(f,p,_).add(o.scale(r))}case e.ANIMATIONTYPE_COLOR3:switch(i){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(f,p,_);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(f,p,_).add(o.scale(r))}case e.ANIMATIONTYPE_MATRIX:switch(i){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:if(e.AllowMatricesInterpolation)return this.matrixInterpolateFunction(f,p,_,n);case e.ANIMATIONLOOPMODE_RELATIVE:return f}}break}}return this._getKeyValue(c[c.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:s.values=o.value.asArray()}t.keys.push(s)}for(var a in t.ranges=[],this._ranges){var c=this._ranges[a];if(c){var l={};l.name=a,l.from=c.from,l.to=c.to,t.ranges.push(l)}}return t},Object.defineProperty(e,"ANIMATIONTYPE_FLOAT",{get:function(){return e._ANIMATIONTYPE_FLOAT},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONTYPE_VECTOR3",{get:function(){return e._ANIMATIONTYPE_VECTOR3},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONTYPE_VECTOR2",{get:function(){return e._ANIMATIONTYPE_VECTOR2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONTYPE_SIZE",{get:function(){return e._ANIMATIONTYPE_SIZE},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONTYPE_QUATERNION",{get:function(){return e._ANIMATIONTYPE_QUATERNION},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONTYPE_MATRIX",{get:function(){return e._ANIMATIONTYPE_MATRIX},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONTYPE_COLOR3",{get:function(){return e._ANIMATIONTYPE_COLOR3},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONLOOPMODE_RELATIVE",{get:function(){return e._ANIMATIONLOOPMODE_RELATIVE},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONLOOPMODE_CYCLE",{get:function(){return e._ANIMATIONLOOPMODE_CYCLE},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ANIMATIONLOOPMODE_CONSTANT",{get:function(){return e._ANIMATIONLOOPMODE_CONSTANT},enumerable:!0,configurable:!0}),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,i,o=new e(t.name,t.property,t.framePerSecond,t.dataType,t.loopBehavior),s=t.dataType,a=[];for(t.enableBlending&&(o.enableBlending=t.enableBlending),t.blendingSpeed&&(o.blendingSpeed=t.blendingSpeed),i=0;i<t.keys.length;i++){var c,l,u=t.keys[i];switch(s){case e.ANIMATIONTYPE_FLOAT:r=u.values[0],u.values.length>=1&&(c=u.values[1]),u.values.length>=2&&(l=u.values[2]);break;case e.ANIMATIONTYPE_QUATERNION:if(r=n.Quaternion.FromArray(u.values),u.values.length>=8){var h=n.Quaternion.FromArray(u.values.slice(4,8));h.equals(n.Quaternion.Zero())||(c=h)}if(u.values.length>=12){var d=n.Quaternion.FromArray(u.values.slice(8,12));d.equals(n.Quaternion.Zero())||(l=d)}break;case e.ANIMATIONTYPE_MATRIX:r=n.Matrix.FromArray(u.values);break;case e.ANIMATIONTYPE_COLOR3:r=n.Color3.FromArray(u.values);break;case e.ANIMATIONTYPE_VECTOR3:default:r=n.Vector3.FromArray(u.values)}var f={};f.frame=u.frame,f.value=r,null!=c&&(f.inTangent=c),null!=l&&(f.outTangent=l),a.push(f)}if(o.setKeys(a),t.ranges)for(i=0;i<t.ranges.length;i++)r=t.ranges[i],o.createRange(r.name,r.from,r.to);return o},e.AppendSerializedAnimations=function(e,t){o.SerializationHelper.AppendSerializedAnimations(e,t)},e.AllowMatricesInterpolation=!1,e.AllowMatrixDecomposeForInterpolation=!0,e._ANIMATIONTYPE_FLOAT=0,e._ANIMATIONTYPE_VECTOR3=1,e._ANIMATIONTYPE_QUATERNION=2,e._ANIMATIONTYPE_MATRIX=3,e._ANIMATIONTYPE_COLOR3=4,e._ANIMATIONTYPE_VECTOR2=5,e._ANIMATIONTYPE_SIZE=6,e._ANIMATIONLOOPMODE_RELATIVE=0,e._ANIMATIONLOOPMODE_CYCLE=1,e._ANIMATIONLOOPMODE_CONSTANT=2,e}();s._TypeStore.RegisteredTypes["BABYLON.Animation"]=u,l.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=function(){return function(){}}(),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.onAnimationEndObservable=new i.Observable,this.onAnimationLoopObservable=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.animationGroups.push(this)}return Object.defineProperty(e.prototype,"from",{get:function(){return this._from},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"to",{get:function(){return this._to},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStarted",{get:function(){return this._isStarted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._isStarted&&!this._isPaused},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"targetedAnimations",{get:function(){return this._targetedAnimations},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animatables",{get:function(){return this._animatables},enumerable:!0,configurable:!0}),e.prototype.addTargetedAnimation=function(e,t){var r={animation:e,target:t},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)}if(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.start=function(e,t,r,n){var i=this;if(void 0===e&&(e=!1),void 0===t&&(t=1),this._isStarted||0===this._targetedAnimations.length)return this;for(var o=function(o){var a=s._scene.beginDirectAnimation(o.target,[o.animation],void 0!==r?r:s._from,void 0!==n?n:s._to,e,t);a.onAnimationEnd=function(){i.onAnimationEndObservable.notifyObservers(o),i._checkAnimationGroupEnded(a)},a.onAnimationLoop=function(){i.onAnimationLoopObservable.notifyObservers(o)},s._animatables.push(a)},s=this,a=0,c=this._targetedAnimations;a<c.length;a++){o(c[a])}return this._speedRatio=t,void 0!==r&&void 0!==n&&r>n&&this._speedRatio>0&&(this._speedRatio=-t),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){if(this.isStarted&&this._animatables.length===this._targetedAnimations.length){if(void 0!==e)for(var t=0;t<this._animatables.length;t++){this._animatables[t].loopAnimation=e}this.restart()}else this.stop(),this.start(e,this._speedRatio);return 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()},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.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),c=s.targetId;if("influence"===s.animation.property){var l=r.getMorphTargetById(c);l&&i.addTargetedAnimation(a,l)}else{var u=r.getNodeByID(c);null!=u&&i.addTargetedAnimation(a,u)}}return null!==t.from&&null!==t.from&&i.normalize(t.from,t.to),i},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(){return 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 c}),r.d(t,"CubicEase",function(){return l}),r.d(t,"ElasticEase",function(){return u}),r.d(t,"ExponentialEase",function(){return h}),r.d(t,"PowerEase",function(){return d}),r.d(t,"QuadraticEase",function(){return f}),r.d(t,"QuarticEase",function(){return p}),r.d(t,"QuinticEase",function(){return g}),r.d(t,"SineEase",function(){return m}),r.d(t,"BezierCurveEase",function(){return _});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.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 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 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),c=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 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),c=Math.floor(a),l=c+1,u=(1-Math.pow(r,c))/(i*o),h=.5*(u+(1-Math.pow(r,l))/(i*o)),d=e-h,f=h-u;return-Math.pow(1/r,t-c)/(f*f)*(d-f)*(d+f)},t}(o),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return 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 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),h=function(e){function t(t){void 0===t&&(t=2);var r=e.call(this)||this;return r.exponent=t,r}return 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),d=function(e){function t(t){void 0===t&&(t=2);var r=e.call(this)||this;return r.power=t,r}return 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 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 n.__extends(t,e),t.prototype.easeInCore=function(e){return e*e*e*e},t}(o),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.easeInCore=function(e){return e*e*e*e*e},t}(o),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return 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 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 ***!
- \*****************************/
- /*! exports provided: Animatable, Animation, TargetedAnimation, AnimationGroup, AnimationPropertiesOverride, EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase, RuntimeAnimation, AnimationEvent, AnimationKeyInterpolation, AnimationRange */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,"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 c=r(/*! ./runtimeAnimation */"./Animations/runtimeAnimation.ts");r.d(t,"RuntimeAnimation",function(){return c.RuntimeAnimation});var l=r(/*! ./animationEvent */"./Animations/animationEvent.ts");r.d(t,"AnimationEvent",function(){return l.AnimationEvent});var u=r(/*! ./animationKey */"./Animations/animationKey.ts");r.d(t,"AnimationKeyInterpolation",function(){return u.AnimationKeyInterpolation});var h=r(/*! ./animationRange */"./Animations/animationRange.ts");r.d(t,"AnimationRange",function(){return h.AnimationRange})},"./Animations/runtimeAnimation.ts":
- /*!****************************************!*\
- !*** ./Animations/runtimeAnimation.ts ***!
- \****************************************/
- /*! exports provided: RuntimeAnimation */function(e,t,r){"use strict";r.r(t),r.d(t,"RuntimeAnimation",function(){return u});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ./animation */"./Animations/animation.ts"),o=Object.freeze(new n.Quaternion(0,0,0,0)),s=Object.freeze(n.Vector3.Zero()),a=Object.freeze(n.Vector2.Zero()),c=Object.freeze(n.Size.Zero()),l=Object.freeze(n.Color3.Black()),u=function(){function e(e,t,r,n){var i=this;this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._targetPath="",this._weight=1,this._ratioOffset=0,this._previousDelay=0,this._previousRatio=0,this._animation=t,this._target=e,this._scene=r,this._host=n,t._runtimeAnimations.push(this);var o=t.getEvents();o&&o.length>0&&o.forEach(function(e){i._events.push(e._clone())})}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._activeTarget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!0,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._originalValue[t],-1),t++}else void 0!==this._originalValue[0]&&this._setValue(this._target,this._originalValue[0],-1);this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0,this._originalValue=new Array;for(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._interpolate=function(e,t,r,o,s){return this._currentFrame=e,this._animation.dataType!==i.Animation.ANIMATIONTYPE_MATRIX||this._workValue||(this._workValue=n.Matrix.Zero()),this._animation._interpolate(e,t,this._workValue,r,o,s)},e.prototype.setValue=function(e,t){if(void 0===t&&(t=1),this._target instanceof Array)for(var r=0,n=0,i=this._target;n<i.length;n++){var o=i[n];this._setValue(o,e,t,r),r++}else this._setValue(this._target,e,t)},e.prototype._setValue=function(e,t,r,o){var s,a;void 0===o&&(o=0);var c=this._animation.targetPropertyPath;if(c.length>1){for(var l=e[c[0]],u=1;u<c.length-1;u++)l=l[c[u]];s=c[c.length-1],a=l}else s=c[0],a=e;if(this._targetPath=s,this._activeTarget=a,this._weight=r,void 0===this._originalValue[o]){var h=void 0;(h=a.getRestPose&&"_matrix"===s?a.getRestPose():a[s])&&h.clone?this._originalValue[o]=h.clone():this._originalValue[o]=h}if((e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending)&&this._blendingFactor<=1){if(!this._originalBlendValue)(h=a[s]).clone?this._originalBlendValue=h.clone():this._originalBlendValue=h;this._originalBlendValue.m?i.Animation.AllowMatrixDecomposeForInterpolation?this._currentValue?n.Matrix.DecomposeLerpToRef(this._originalBlendValue,t,this._blendingFactor,this._currentValue):this._currentValue=n.Matrix.DecomposeLerp(this._originalBlendValue,t,this._blendingFactor):this._currentValue?n.Matrix.LerpToRef(this._originalBlendValue,t,this._blendingFactor,this._currentValue):this._currentValue=n.Matrix.Lerp(this._originalBlendValue,t,this._blendingFactor):this._currentValue=i.Animation._UniversalLerp(this._originalBlendValue,t,this._blendingFactor);var d=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=d}else this._currentValue=t;-1!==r?this._scene._registerTargetForLateAnimationBinding(this,this._originalValue[o]):a[s]=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._interpolate(e,0,this._getCorrectLoopMode());this.setValue(r,-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,u,h,d){void 0===h&&(h=-1);var f=this._animation.targetPropertyPath;if(!f||f.length<1)return this._stopped=!0,!1;var p=!0,g=this._animation.getKeys(),m=g[0].frame,_=g[g.length-1].frame;if(0!==m){var v={frame:0,value:g[0].value};g.splice(0,0,v)}(t<m||t>_)&&(t=m),(r<m||r>_)&&(r=_);var A,y=r-t,b=e*(this._animation.framePerSecond*u)/1e3+this._ratioOffset,T=0;if(this._previousDelay=e,this._previousRatio=b,(r>t&&b>=y||t>r&&b<=y)&&!n)p=!1,T=this._animation._getKeyValue(g[g.length-1].value);else if(this._getCorrectLoopMode()!==i.Animation.ANIMATIONLOOPMODE_CYCLE){var E=r.toString()+t.toString();if(!this._offsetsCache[E]){var x=this._interpolate(t,0,i.Animation.ANIMATIONLOOPMODE_CYCLE),C=this._interpolate(r,0,i.Animation.ANIMATIONLOOPMODE_CYCLE);switch(this._animation.dataType){case i.Animation.ANIMATIONTYPE_FLOAT:this._offsetsCache[E]=C-x;break;case i.Animation.ANIMATIONTYPE_QUATERNION:this._offsetsCache[E]=C.subtract(x);break;case i.Animation.ANIMATIONTYPE_VECTOR3:this._offsetsCache[E]=C.subtract(x);case i.Animation.ANIMATIONTYPE_VECTOR2:this._offsetsCache[E]=C.subtract(x);case i.Animation.ANIMATIONTYPE_SIZE:this._offsetsCache[E]=C.subtract(x);case i.Animation.ANIMATIONTYPE_COLOR3:this._offsetsCache[E]=C.subtract(x)}this._highLimitsCache[E]=C}T=this._highLimitsCache[E],A=this._offsetsCache[E]}if(void 0===A)switch(this._animation.dataType){case i.Animation.ANIMATIONTYPE_FLOAT:A=0;break;case i.Animation.ANIMATIONTYPE_QUATERNION:A=o;break;case i.Animation.ANIMATIONTYPE_VECTOR3:A=s;break;case i.Animation.ANIMATIONTYPE_VECTOR2:A=a;break;case i.Animation.ANIMATIONTYPE_SIZE:A=c;break;case i.Animation.ANIMATIONTYPE_COLOR3:A=l}var P=p&&0!==y?t+b%y:r;if(this._host&&this._host.syncRoot){var M=this._host.syncRoot;P=t+(r-t)*((M.masterFrame-M.fromFrame)/(M.toFrame-M.fromFrame))}var S=this._events;if(y>0&&this.currentFrame>P||y<0&&this.currentFrame<P){d&&d();for(var R=0;R<S.length;R++)S[R].onlyOnce||(S[R].isDone=!1)}var O=0===y?0:b/y>>0,I=this._interpolate(P,O,this._getCorrectLoopMode(),A,T);this.setValue(I,h);for(R=0;R<S.length;R++)if(y>0&&P>=S[R].frame&&S[R].frame>=t||y<0&&P<=S[R].frame&&S[R].frame<=t){var D=S[R];D.isDone||(D.onlyOnce&&(S.splice(R,1),R--),D.isDone=!0,D.action(P))}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){void 0===e&&(e=null);var t=this;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:!0,configurable:!0}),e.prototype.lock=function(){this._triggerSuspendedState()},e.prototype.unlock=function(){this._triggerRunningState()},e.prototype._resumeAudioContext=function(){var e;return 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()}).catch(function(){e._tryToRun=!1,e.unlocked=!1}),this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this))},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=document.createElement("style");t.appendChild(document.createTextNode(".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url(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); 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) }")),document.getElementsByTagName("head")[0].appendChild(t),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 l});var n=r(/*! ./sound */"./Audio/sound.ts"),i=r(/*! ./soundTrack */"./Audio/soundTrack.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../Maths/math */"./Maths/math.ts"),a=r(/*! ../sceneComponent */"./sceneComponent.ts"),c=r(/*! ../scene */"./scene.ts");r(/*! ../abstractScene */"./abstractScene.ts").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 c=0,l=e.sounds.length;c<l;c++){var u=e.sounds[c];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(c.Scene.prototype,"mainSoundTrack",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new l(this),this._addComponent(e)),this._mainSoundTrack||(this._mainSoundTrack=new i.SoundTrack(this,{mainTrack:!0})),this._mainSoundTrack},enumerable:!0,configurable:!0}),c.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(c.Scene.prototype,"audioEnabled",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new l(this),this._addComponent(e)),e.audioEnabled},set:function(e){var t=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);t||(t=new l(this),this._addComponent(t)),e?t.enableAudio():t.disableAudio()},enumerable:!0,configurable:!0}),Object.defineProperty(c.Scene.prototype,"headphone",{get:function(){var e=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);return e||(e=new l(this),this._addComponent(e)),e.headphone},set:function(e){var t=this._getComponent(a.SceneComponentConstants.NAME_AUDIO);t||(t=new l(this),this._addComponent(t)),e?t.switchAudioModeForHeadphones():t.switchAudioModeForNormalSpeakers()},enumerable:!0,configurable:!0});var l=function(){function e(e){this.name=a.SceneComponentConstants.NAME_AUDIO,this._audioEnabled=!0,this._headphone=!1,this.scene=e,e.soundTracks=new Array,e.sounds=new Array}return Object.defineProperty(e.prototype,"audioEnabled",{get:function(){return this._audioEnabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headphone",{get:function(){return this._headphone},enumerable:!0,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,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,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=this.scene;if(this._audioEnabled&&e._mainSoundTrack&&e.soundTracks&&(0!==e._mainSoundTrack.soundCollection.length||1!==e.soundTracks.length)){var t,r=o.Engine.audioEngine;if((t=e.activeCameras.length>0?e.activeCameras[0]:e.activeCamera)&&r.audioContext){r.audioContext.listener.setPosition(t.position.x,t.position.y,t.position.z),t.rigCameras&&t.rigCameras.length>0&&(t=t.rigCameras[0]);var n,i=s.Matrix.Invert(t.getViewMatrix()),a=s.Vector3.TransformNormal(new s.Vector3(0,0,-1),i);for(a.normalize(),isNaN(a.x)||isNaN(a.y)||isNaN(a.z)||r.audioContext.listener.setOrientation(a.x,a.y,a.z,0,1,0),n=0;n<e.mainSoundTrack.soundCollection.length;n++){var c=e.mainSoundTrack.soundCollection[n];c.useCustomAttenuation&&c.updateDistanceFromListener()}if(e.soundTracks)for(n=0;n<e.soundTracks.length;n++)for(var l=0;l<e.soundTracks[n].soundCollection.length;l++)(c=e.soundTracks[n].soundCollection[l]).useCustomAttenuation&&c.updateDistanceFromListener()}}},e}();n.Sound._SceneComponentInitialization=function(e){var t=e._getComponent(a.SceneComponentConstants.NAME_AUDIO);t||(t=new l(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 c=r(/*! ./weightedsound */"./Audio/weightedsound.ts");r.d(t,"WeightedSound",function(){return c.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 l});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ../Misc/logger */"./Misc/logger.ts"),c=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),l=function(){function e(t,r,c,l,u){void 0===l&&(l=null);var h=this;if(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.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=c,e._SceneComponentInitialization(c),this._readyToPlayCallback=l,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=u.spatialSound||!1,this.maxDistance=u.maxDistance||100,this.useCustomAttenuation=u.useCustomAttenuation||!1,this.rolloffFactor=u.rolloffFactor||1,this.refDistance=u.refDistance||1,this.distanceModel=u.distanceModel||"linear",this._playbackRate=u.playbackRate||1,this._streaming=u.streaming||!1),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 d=!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 f=[],p=!1;switch(this._urlType){case"MediaStream":this._streaming=!0,this._isReadyToPlay=!0,this._streamingSource=s.Engine.audioEngine.audioContext.createMediaElementSource(r),this.autoplay&&this.play(),this._readyToPlayCallback&&this._readyToPlayCallback();break;case"ArrayBuffer":r.byteLength>0&&(p=!0,this._soundLoaded(r));break;case"String":f.push(r);case"Array":0===f.length&&(f=r);for(var g=0;g<f.length;g++){var m=f[g];if(-1!==m.indexOf(".mp3",m.length-4)&&s.Engine.audioEngine.isMP3supported&&(p=!0),-1!==m.indexOf(".ogg",m.length-4)&&s.Engine.audioEngine.isOGGsupported&&(p=!0),-1!==m.indexOf(".wav",m.length-4)&&(p=!0),-1!==m.indexOf("blob:")&&(p=!0),p){this._streaming?(this._htmlAudioElement=new Audio(m),this._htmlAudioElement.controls=!1,this._htmlAudioElement.loop=this.loop,n.Tools.SetCorsBehavior(m,this._htmlAudioElement),this._htmlAudioElement.preload="auto",this._htmlAudioElement.addEventListener("canplaythrough",function(){h._isReadyToPlay=!0,h.autoplay&&h.play(),h._readyToPlayCallback&&h._readyToPlayCallback()}),document.body.appendChild(this._htmlAudioElement),this._htmlAudioElement.load()):this._scene._loadFile(m,function(e){h._soundLoaded(e)},void 0,!0,!0,function(e){e&&a.Logger.Error("XHR "+e.status+" error on: "+m+"."),a.Logger.Error("Sound creation aborted."),h._scene.mainSoundTrack.RemoveSound(h)});break}}break;default:d=!1}d?p||(this._isReadyToPlay=!0,this._readyToPlayCallback&&window.setTimeout(function(){h._readyToPlayCallback&&h._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(){h._readyToPlayCallback&&h._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(),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){e&&(this.loop=e.loop||this.loop,this.maxDistance=e.maxDistance||this.maxDistance,this.useCustomAttenuation=e.useCustomAttenuation||this.useCustomAttenuation,this.rolloffFactor=e.rolloffFactor||this.rolloffFactor,this.refDistance=e.refDistance||this.refDistance,this.distanceModel=e.distanceModel||this.distanceModel,this._playbackRate=e.playbackRate||this._playbackRate,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()))},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:!0,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:!0,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){var r=this;if(this._isReadyToPlay&&this._scene.audioEnabled&&s.Engine.audioEngine.audioContext)try{this._startOffset<0&&(e=-this._startOffset,this._startOffset=0);var n=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){if(this._streamingSource||(this._streamingSource=s.Engine.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement),this._htmlAudioElement.onended=function(){r._onended()},this._htmlAudioElement.playbackRate=this._playbackRate),this._streamingSource.disconnect(),this._streamingSource.connect(this._inputAudioNode),this._htmlAudioElement)(i=function(){if(s.Engine.audioEngine.unlocked){var e=r._htmlAudioElement.play();void 0!==e&&e.catch(function(e){s.Engine.audioEngine.lock(),(r.loop||r.autoplay)&&s.Engine.audioEngine.onAudioUnlockedObservable.addOnce(function(){i()})})}else(r.loop||r.autoplay)&&s.Engine.audioEngine.onAudioUnlockedObservable.addOnce(function(){i()})})()}else{var i=function(){s.Engine.audioEngine.audioContext&&(r._soundSource=s.Engine.audioEngine.audioContext.createBufferSource(),r._soundSource.buffer=r._audioBuffer,r._soundSource.connect(r._inputAudioNode),r._soundSource.loop=r.loop,r._soundSource.playbackRate.value=r._playbackRate,r._soundSource.onended=function(){r._onended()},n=e?s.Engine.audioEngine.audioContext.currentTime+e:s.Engine.audioEngine.audioContext.currentTime,r._soundSource.start(n,r.isPaused?r._startOffset%r._soundSource.buffer.duration:t||0))};"suspended"===s.Engine.audioEngine.audioContext.state?setTimeout(function(){"suspended"===s.Engine.audioEngine.audioContext.state?(s.Engine.audioEngine.lock(),(r.loop||r.autoplay)&&s.Engine.audioEngine.onAudioUnlockedObservable.addOnce(function(){i()})):i()},500):i()}this._startTime=n,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())),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(e.getBoundingInfo){var t=e;if(this._positionInEmitterSpace)t.worldMatrixFromCache.invertToRef(o.Tmp.Matrix[0]),this.setPosition(o.Tmp.Matrix[0].getTranslation());else{var r=t.getBoundingInfo();this.setPosition(r.boundingSphere.centerWorld)}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()):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.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};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 c,l={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?(c._audioBuffer=i.getAudioBuffer(),c._isReadyToPlay=!0,c.autoplay&&c.play()):window.setTimeout(u,300)};c=new e(a,new ArrayBuffer(0),r,null,l),u()}else c=new e(a,s,r,function(){r._removePendingData(c)},l),r._addPendingData(c);if(t.position){var h=o.Vector3.FromArray(t.position);c.setPosition(h)}if(t.isDirectional&&(c.setDirectionalCone(t.coneInnerAngle||360,t.coneOuterAngle||360,t.coneOuterGain||0),t.localDirectionToMesh)){var d=o.Vector3.FromArray(t.localDirectionToMesh);c.setLocalDirectionToMesh(d)}if(t.connectedMeshId){var f=r.getMeshByID(t.connectedMeshId);f&&c.attachToMesh(f)}return c},e._SceneComponentInitialization=function(e){throw c._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._isMainTrack=!1,this._isInitialized=!1,this._scene=e,this.soundCollection=new Array,this._options=t,!this._isMainTrack&&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._options.mainTrack&&(this._isMainTrack=this._options.mainTrack)),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,c=0;c<this._weights.length;c++)this._weights[c]*=a;this._sounds=t;for(var l=0,u=this._sounds;l<u.length;l++){u[l].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:!0,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:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"zoomStopsAnimation",{get:function(){return this._zoomStopsAnimation},set:function(e){this._zoomStopsAnimation=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationSpeed",{get:function(){return this._idleRotationSpeed},set:function(e){this._idleRotationSpeed=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationWaitTime",{get:function(){return this._idleRotationWaitTime},set:function(e){this._idleRotationWaitTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"idleRotationSpinupTime",{get:function(){return this._idleRotationSpinupTime},set:function(e){this._idleRotationSpinupTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationInProgress",{get:function(){return Math.abs(this._cameraRotationSpeed)>0},enumerable:!0,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:!0,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:!0,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/tools */"./Misc/tools.ts"),s=r(/*! ../../Misc/precisionDate */"./Misc/precisionDate.ts"),a=r(/*! ../../Maths/math */"./Maths/math.ts"),c=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:!0,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return this._mode},set:function(e){this._mode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"radiusScale",{get:function(){return this._radiusScale},set:function(e){this._radiusScale=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"positionScale",{get:function(){return this._positionScale},set:function(e){this._positionScale=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultElevation",{get:function(){return this._defaultElevation},set:function(e){this._defaultElevation=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elevationReturnTime",{get:function(){return this._elevationReturnTime},set:function(e){this._elevationReturnTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elevationReturnWaitTime",{get:function(){return this._elevationReturnWaitTime},set:function(e){this._elevationReturnWaitTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zoomStopsAnimation",{get:function(){return this._zoomStopsAnimation},set:function(e){this._zoomStopsAnimation=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"framingTime",{get:function(){return this._framingTime},set:function(e){this._framingTime=e},enumerable:!0,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 a.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new a.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),s=0;s<e.length;s++){var c=e[s].getHierarchyBoundingVectors(!0);o.Tools.CheckExtends(c.min,n,i),o.Tools.CheckExtends(c.max,n,i)}this.zoomOnBoundingInfo(n,i,t,r)},e.prototype.zoomOnBoundingInfo=function(t,r,n,i){var o,s=this;if(void 0===n&&(n=!1),void 0===i&&(i=null),this._attachedCamera){var l=t.y,u=l+(r.y-l)*this._positionScale,h=r.subtract(t).scale(.5);if(n)o=new a.Vector3(0,u,0);else{var d=t.add(h);o=new a.Vector3(d.x,u,d.z)}this._vectorTransition||(this._vectorTransition=c.Animation.CreateAnimation("target",c.Animation.ANIMATIONTYPE_VECTOR3,60,e.EasingFunction)),this._betaIsAnimating=!0;var f=c.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 g=this._calculateLowerRadiusFromModelBoundingSphere(t,r);this.autoCorrectCameraLimitsAndSensibility&&(this._attachedCamera.lowerRadiusLimit=h.length()+this._attachedCamera.minZ),p=g}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 m=r.subtract(t).length();this._attachedCamera.panningSensibility=5e3/m,this._attachedCamera.wheelPrecision=100/p}this._radiusTransition||(this._radiusTransition=c.Animation.CreateAnimation("radius",c.Animation.ANIMATIONTYPE_FLOAT,60,e.EasingFunction)),(f=c.Animation.TransitionTo("radius",p,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusTransition,this._framingTime,function(){s.stopAllAnimations(),i&&i(),s._attachedCamera&&s._attachedCamera.useInputToRestoreState&&s._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)),c=Math.max(s,a),l=this._attachedCamera;return l?(l.lowerRadiusLimit&&this._mode===e.IgnoreBoundsSizeMode&&(c=c<l.lowerRadiusLimit?l.lowerRadiusLimit:c),l.upperRadiusLimit&&(c=c>l.upperRadiusLimit?l.upperRadiusLimit:c),c):0},e.prototype._maintainCameraAboveGround=function(){var t=this;if(!(this._elevationReturnTime<0)){var r=s.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=c.Animation.CreateAnimation("beta",c.Animation.ANIMATIONTYPE_FLOAT,60,e.EasingFunction));var o=c.Animation.TransitionTo("beta",n,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,function(){t._clearAnimationLocks(),t.stopAllAnimations()});o&&this._animatables.push(o)}}},e.prototype._getFrustumSlope=function(){var e=this._attachedCamera;if(!e)return a.Vector2.Zero();var t=e.getScene().getEngine().getAspectRatio(e),r=Math.tan(e.fov/2),n=r*t;return new a.Vector2(n,r)},e.prototype._clearAnimationLocks=function(){this._betaIsAnimating=!1},e.prototype._applyUserInteraction=function(){this.isUserIsMoving&&(this._lastInteractionTime=s.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:!0,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 */"./Maths/math.ts"),i=function(){return 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: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:!0,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 */"./Maths/math.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:!0,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 */"./Maths/math.ts"),a=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),c=r(/*! ../../Culling/ray */"./Culling/ray.ts"),l=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.detachCameraControls=!0,this.useObjectOrienationForDragging=!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 c.Ray(new s.Vector3,new s.Vector3),this._lastPointerRay={},this._dragDelta=new s.Vector3,this._pointA=new s.Vector3(0,0,0),this._pointB=new s.Vector3(0,0,0),this._pointC=new s.Vector3(0,0,0),this._lineA=new s.Vector3(0,0,0),this._lineB=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,"name",{get:function(){return"PointerDrag"},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t){var r=this;this._scene=t.getScene(),this._attachedNode=t,e._planeScene||(this._debugMode?e._planeScene=this._scene:(e._planeScene=new i.Scene(this._scene.getEngine()),e._planeScene.detachControl(),this._scene.getEngine().scenes.pop(),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);this._pointerObserver=this._scene.onPointerObservable.add(function(t,n){var i;if(r.enabled)if(t.type==a.PointerEventTypes.POINTERDOWN)!r.dragging&&t.pickInfo&&t.pickInfo.hit&&t.pickInfo.pickedMesh&&t.pickInfo.pickedPoint&&t.pickInfo.ray&&(i=t.pickInfo.pickedMesh,r._attachedNode==i||i.isDescendantOf(r._attachedNode))&&r._startDrag(t.event.pointerId,t.pickInfo.ray,t.pickInfo.pickedPoint);else if(t.type==a.PointerEventTypes.POINTERUP)r.currentDraggingPointerID==t.event.pointerId&&r.releaseDrag();else if(t.type==a.PointerEventTypes.POINTERMOVE){var o=t.event.pointerId;r.currentDraggingPointerID===e._AnyMouseID&&o!==e._AnyMouseID&&"mouse"==t.event.pointerType&&(r._lastPointerRay[r.currentDraggingPointerID]&&(r._lastPointerRay[o]=r._lastPointerRay[r.currentDraggingPointerID],delete r._lastPointerRay[r.currentDraggingPointerID]),r.currentDraggingPointerID=o),r._lastPointerRay[o]||(r._lastPointerRay[o]=new c.Ray(new s.Vector3,new s.Vector3)),t.pickInfo&&t.pickInfo.ray&&(r._lastPointerRay[o].origin.copyFrom(t.pickInfo.ray.origin),r._lastPointerRay[o].direction.copyFrom(t.pickInfo.ray.direction),r.currentDraggingPointerID==o&&r.dragging&&r._moveDrag(t.pickInfo.ray))}}),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(function(){r._moving&&r.moveAttached&&(l.PivotTools._RemoveAndStorePivotPoint(r._attachedNode),r._targetPosition.subtractToRef(r._attachedNode.absolutePosition,r._tmpVector),r._tmpVector.scaleInPlace(r.dragDeltaRatio),r._attachedNode.getAbsolutePosition().addToRef(r._tmpVector,r._tmpVector),r.validateDrag(r._tmpVector)&&r._attachedNode.setAbsolutePosition(r._tmpVector),l.PivotTools._RestorePivotPoint(r._attachedNode))})},e.prototype.releaseDrag=function(){this.dragging=!1,this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerID}),this.currentDraggingPointerID=-1,this._moving=!1,this.detachCameraControls&&this._attachedElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera&&this._scene.activeCamera.attachControl(this._attachedElement,!0)},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){l.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.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)),l.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?(s.Vector3.TransformCoordinatesToRef(this._options.dragAxis,this._attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis),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.useObjectOrienationForDragging?s.Vector3.TransformCoordinatesToRef(this._options.dragAxis,this._attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragAxis),this._pointA.addToRef(this._localAxis,this._pointB),e.origin.subtractToRef(this._pointA,this._pointC),this._pointA.addToRef(this._pointC.normalize(),this._pointC),this._pointB.subtractToRef(this._pointA,this._lineA),this._pointC.subtractToRef(this._pointA,this._lineB),s.Vector3.CrossToRef(this._lineA,this._lineB,this._lookAt),s.Vector3.CrossToRef(this._lineA,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.useObjectOrienationForDragging?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 */"./Maths/math.ts"),a=r(/*! ../../Misc/observable */"./Misc/observable.ts"),c=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),l=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.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:!0,configurable:!0}),e.prototype.init=function(){},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;var h=null;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&&(p=e.pickInfo.pickedMesh,r._ownerNode==p||p.isDescendantOf(r._ownerNode))){r._scene.activeCamera&&r._scene.activeCamera.cameraRigMode==c.Camera.RIG_MODE_NONE&&e.pickInfo.ray.origin.copyFrom(r._scene.activeCamera.globalPosition),a=r._ownerNode,l.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._scene.activeCamera&&!r._scene.activeCamera.leftCamera&&(r._scene.activeCamera.inputs.attachedElement?(h=r._scene.activeCamera.inputs.attachedElement,r._scene.activeCamera.detachControl(r._scene.activeCamera.inputs.attachedElement)):h=null),l.PivotTools._RestorePivotPoint(a),r.onDragStartObservable.notifyObservers({})}}else if(e.type==o.PointerEventTypes.POINTERUP)r.currentDraggingPointerID==e.event.pointerId&&(r.dragging=!1,r._moving=!1,r.currentDraggingPointerID=-1,a=null,r._virtualOriginMesh.removeChild(r._virtualDragMesh),r.detachCameraControls&&h&&r._scene.activeCamera&&!r._scene.activeCamera.leftCamera&&r._scene.activeCamera.attachControl(h,!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._scene.activeCamera&&r._scene.activeCamera.cameraRigMode==c.Camera.RIG_MODE_NONE&&(e.pickInfo.ray.origin.copyFrom(r._scene.activeCamera.globalPosition),i=0);var d=e.pickInfo.ray.origin.subtract(u);u.copyFrom(e.pickInfo.ray.origin);var f=-s.Vector3.Dot(d,e.pickInfo.ray.direction);r._virtualOriginMesh.addChild(r._virtualDragMesh),r._virtualDragMesh.position.z-=r._virtualDragMesh.position.z<1?f*r.zDragFactor:f*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 p});var d=new s.Quaternion;this._sceneRenderObserver=t.getScene().onBeforeRenderObservable.add(function(){if(r.dragging&&r._moving&&a){if(l.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))}l.PivotTools._RestorePivotPoint(a)}})},e.prototype.detach=function(){this._scene&&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/index.ts":
- /*!****************************!*\
- !*** ./Behaviors/index.ts ***!
- \****************************/
- /*! exports provided: AutoRotationBehavior, BouncingBehavior, FramingBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./Cameras/index */"./Behaviors/Cameras/index.ts");r.d(t,"AutoRotationBehavior",function(){return n.AutoRotationBehavior}),r.d(t,"BouncingBehavior",function(){return n.BouncingBehavior}),r.d(t,"FramingBehavior",function(){return n.FramingBehavior});var i=r(/*! ./Meshes/index */"./Behaviors/Meshes/index.ts");r.d(t,"AttachToBoxBehavior",function(){return i.AttachToBoxBehavior}),r.d(t,"FadeInOutBehavior",function(){return i.FadeInOutBehavior}),r.d(t,"MultiPointerScaleBehavior",function(){return i.MultiPointerScaleBehavior}),r.d(t,"PointerDragBehavior",function(){return i.PointerDragBehavior}),r.d(t,"SixDofDragBehavior",function(){return i.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 s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),s=function(e){function t(t,r,n,o,s,a,c){void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=null),void 0===c&&(c=null);var l=e.call(this,t,r.getScene(),!1)||this;return l.name=t,l.children=new Array,l.animations=new Array,l._index=null,l._absoluteTransform=new i.Matrix,l._invertedAbsoluteTransform=new i.Matrix,l._scalingDeterminant=1,l._worldTransform=new i.Matrix,l._needToDecompose=!0,l._needToCompose=!1,l._linkedTransformNode=null,l._skeleton=r,l._localMatrix=o?o.clone():i.Matrix.Identity(),l._restPose=s||l._localMatrix.clone(),l._baseMatrix=a||l._localMatrix.clone(),l._index=c,r.bones.push(l),l.setParent(n,!1),(a||o)&&l._updateDifferenceMatrix(),l}return 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:!0,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.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.getWorldMatrix=function(){return this._worldTransform},t.prototype.returnToRest=function(){this.updateMatrix(this._restPose.clone())},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++},Object.defineProperty(t.prototype,"position",{get:function(){return this._decompose(),this._localPosition},set:function(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.getRotation()},set:function(e){this.setRotation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._decompose(),this._localRotation},set:function(e){this.setRotationQuaternion(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this.getScale()},set:function(e){this.setScale(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._skeleton.animationPropertiesOverride},enumerable:!0,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._needToCompose=!1,i.Matrix.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix))},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._childRenderId++,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=i.Space.LOCAL);var o=this.getLocalMatrix();if(r==i.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 a=t._tmpMats[0],c=t._tmpVecs[0];this._parent&&(n&&s?(a.copyFrom(this._parent.getAbsoluteTransform()),a.multiplyToRef(s,a)):a.copyFrom(this._parent.getAbsoluteTransform())),a.setTranslationFromFloats(0,0,0),a.invert(),i.Vector3.TransformCoordinatesToRef(e,a,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=i.Space.LOCAL);var o=this.getLocalMatrix();if(r==i.Space.LOCAL)o.setTranslationFromFloats(e.x,e.y,e.z);else{var s=null;n&&(s=n.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var a=t._tmpMats[0],c=t._tmpVecs[0];this._parent&&(n&&s?(a.copyFrom(this._parent.getAbsoluteTransform()),a.multiplyToRef(s,a)):a.copyFrom(this._parent.getAbsoluteTransform())),a.invert(),i.Vector3.TransformCoordinatesToRef(e,a,c),o.setTranslationFromFloats(c.x,c.y,c.z)}this._markAsDirtyAndDecompose()},t.prototype.setAbsolutePosition=function(e,t){this.setPosition(e,i.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 c=0,l=this.children;c<l.length;c++){var u=(f=l[c]).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 h=0,d=this.children;h<d.length;h++){var f;(f=d[h]).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=i.Space.LOCAL),o===i.Space.LOCAL){var a=t._tmpQuat;return i.Quaternion.RotationYawPitchRollToRef(e,r,n,a),void this.setRotationQuaternion(a,o,s)}var c=t._tmpMats[0];if(this._getNegativeRotationToRef(c,s)){var l=t._tmpMats[1];i.Matrix.RotationYawPitchRollToRef(e,r,n,l),c.multiplyToRef(l,l),this._rotateWithMatrix(l,o,s)}},t.prototype.rotate=function(e,r,n,o){void 0===n&&(n=i.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=i.Space.LOCAL),n===i.Space.LOCAL){var s=t._tmpQuat;return i.Quaternion.RotationAxisToRef(e,r,s),void this.setRotationQuaternion(s,n,o)}var a=t._tmpMats[0];if(this._getNegativeRotationToRef(a,o)){var c=t._tmpMats[1];i.Matrix.RotationAxisToRef(e,r,c),a.multiplyToRef(c,c),this._rotateWithMatrix(c,n,o)}},t.prototype.setRotation=function(e,t,r){void 0===t&&(t=i.Space.LOCAL),this.setYawPitchRoll(e.y,e.x,e.z,t,r)},t.prototype.setRotationQuaternion=function(e,r,n){if(void 0===r&&(r=i.Space.LOCAL),r===i.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=i.Space.LOCAL),r===i.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 a=t._tmpMats[1];a.copyFrom(e),s.multiplyToRef(e,a),this._rotateWithMatrix(a,r,n)}},t.prototype._rotateWithMatrix=function(e,r,n){void 0===r&&(r=i.Space.LOCAL);var o=this.getLocalMatrix(),s=o.m[12],a=o.m[13],c=o.m[14],l=this.getParent(),u=t._tmpMats[3],h=t._tmpMats[4];l&&r==i.Space.WORLD?(n?(u.copyFrom(n.getWorldMatrix()),l.getAbsoluteTransform().multiplyToRef(u,u)):u.copyFrom(l.getAbsoluteTransform()),h.copyFrom(u),h.invert(),o.multiplyToRef(u,o),o.multiplyToRef(e,o),o.multiplyToRef(h,o)):r==i.Space.WORLD&&n?(u.copyFrom(n.getWorldMatrix()),h.copyFrom(u),h.invert(),o.multiplyToRef(u,o),o.multiplyToRef(e,o),o.multiplyToRef(h,o)):o.multiplyToRef(e,o),o.setTranslationFromFloats(s,a,c),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=i.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=i.Space.LOCAL),e==i.Space.LOCAL){var o=this.getLocalMatrix();n.x=o.m[12],n.y=o.m[13],n.z=o.m[14]}else{var s=null;r&&(s=r.getWorldMatrix()),this._skeleton.computeAbsoluteTransforms();var a=t._tmpMats[0];r&&s?(a.copyFrom(this.getAbsoluteTransform()),a.multiplyToRef(s,a)):a=this.getAbsoluteTransform(),n.x=a.m[12],n.y=a.m[13],n.z=a.m[14]}},t.prototype.getAbsolutePosition=function(e){void 0===e&&(e=null);var t=i.Vector3.Zero();return this.getPositionToRef(i.Space.WORLD,e,t),t},t.prototype.getAbsolutePositionToRef=function(e,t){this.getPositionToRef(i.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=i.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=i.Space.LOCAL),void 0===r&&(r=null);var o=t._tmpQuat;this.getRotationQuaternionToRef(e,r,o),o.toEulerAnglesToRef(n)},t.prototype.getRotationQuaternion=function(e,t){void 0===e&&(e=i.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=i.Space.LOCAL),void 0===r&&(r=null),e==i.Space.LOCAL)this._decompose(),n.copyFrom(this._localRotation);else{var o=t._tmpMats[0],s=this.getAbsoluteTransform();r?s.multiplyToRef(r.getWorldMatrix(),o):o.copyFrom(s),o.multiplyAtIndex(0,this._scalingDeterminant),o.multiplyAtIndex(1,this._scalingDeterminant),o.multiplyAtIndex(2,this._scalingDeterminant),o.decompose(void 0,n,void 0)}},t.prototype.getRotationMatrix=function(e,t){void 0===e&&(e=i.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=i.Space.LOCAL),e==i.Space.LOCAL)this.getLocalMatrix().getRotationMatrixToRef(n);else{var o=t._tmpMats[0],s=this.getAbsoluteTransform();r?s.multiplyToRef(r.getWorldMatrix(),o):o.copyFrom(s),o.multiplyAtIndex(0,this._scalingDeterminant),o.multiplyAtIndex(1,this._scalingDeterminant),o.multiplyAtIndex(2,this._scalingDeterminant),o.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}(r(/*! ../node */"./node.ts").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 i});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=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 i=t.getPosition();if(t.getAbsoluteTransform().determinant()>0&&(this._rightHandedSystem=!0,this._bendAxis.x=0,this._bendAxis.y=0,this._bendAxis.z=-1,i.x>i.y&&i.x>i.z&&(this._adjustRoll=.5*Math.PI,this._bendAxis.z=1)),this._bone1.length){var o=this._bone1.getScale(),s=this._bone2.getScale();this._bone1Length=this._bone1.length*o.y*this.mesh.scaling.y,this._bone2Length=this._bone2.length*s.y*this.mesh.scaling.y}else if(this._bone1.children[0]){e.computeWorldMatrix(!0);var a=this._bone2.children[0].getAbsolutePosition(e),c=this._bone2.getAbsolutePosition(e),l=this._bone1.getAbsolutePosition(e);this._bone1Length=n.Vector3.Distance(a,c),this._bone2Length=n.Vector3.Distance(c,l)}this._bone1.getRotationMatrixToRef(n.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:!0,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,i=this.poleTargetPosition,o=e._tmpMats[0],s=e._tmpMats[1];this.targetMesh&&r.copyFrom(this.targetMesh.getAbsolutePosition()),this.poleTargetBone?this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset,this.mesh,i):this.poleTargetMesh&&n.Vector3.TransformCoordinatesToRef(this.poleTargetLocalOffset,this.poleTargetMesh.getWorldMatrix(),i);var a=e._tmpVecs[0],c=e._tmpVecs[1],l=e._tmpVecs[2],u=e._tmpVecs[3],h=e._tmpVecs[4],d=e._tmpQuat;t.getAbsolutePositionToRef(this.mesh,a),i.subtractToRef(a,h),0==h.x&&0==h.y&&0==h.z?h.y=1:h.normalize(),r.subtractToRef(a,u),u.normalize(),n.Vector3.CrossToRef(u,h,c),c.normalize(),n.Vector3.CrossToRef(u,c,l),l.normalize(),n.Matrix.FromXYZAxesToRef(l,u,c,o);var f=this._bone1Length,p=this._bone2Length,g=n.Vector3.Distance(a,r);this._maxReach>0&&(g=Math.min(this._maxReach,g));var m=(p*p+g*g-f*f)/(2*p*g),_=(g*g+f*f-p*p)/(2*g*f);m>1&&(m=1),_>1&&(_=1),m<-1&&(m=-1),_<-1&&(_=-1);var v=Math.acos(m),A=Math.acos(_),y=-v-A;if(this._rightHandedSystem)n.Matrix.RotationYawPitchRollToRef(0,0,this._adjustRoll,s),s.multiplyToRef(o,o),n.Matrix.RotationAxisToRef(this._bendAxis,A,s),s.multiplyToRef(o,o);else{var b=e._tmpVecs[5];b.copyFrom(this._bendAxis),b.x*=-1,n.Matrix.RotationAxisToRef(b,-A,s),s.multiplyToRef(o,o)}this.poleAngle&&(n.Matrix.RotationAxisToRef(u,this.poleAngle,s),o.multiplyToRef(s,o)),this._bone1&&(this.slerpAmount<1?(this._slerping||n.Quaternion.FromRotationMatrixToRef(this._bone1Mat,this._bone1Quat),n.Quaternion.FromRotationMatrixToRef(o,d),n.Quaternion.SlerpToRef(this._bone1Quat,d,this.slerpAmount,this._bone1Quat),y=this._bone2Ang*(1-this.slerpAmount)+y*this.slerpAmount,this._bone1.setRotationQuaternion(this._bone1Quat,n.Space.WORLD,this.mesh),this._slerping=!0):(this._bone1.setRotationMatrix(o,n.Space.WORLD,this.mesh),this._bone1Mat.copyFrom(o),this._slerping=!1)),this._bone2.setAxisAngle(this._bendAxis,y,n.Space.LOCAL),this._bone2Ang=y}},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 o});var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=function(){function e(e,t,r,n){if(this.upAxis=i.Vector3.Up(),this.upAxisSpace=i.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 o=i.Axis.Y,s=i.Axis.X;null!=n.yawAxis&&(o=n.yawAxis.clone()).normalize(),null!=n.pitchAxis&&(s=n.pitchAxis.clone()).normalize();var a=i.Vector3.Cross(s,o);this._transformYawPitch=i.Matrix.Identity(),i.Matrix.FromXYZAxesToRef(s,o,a,this._transformYawPitch),this._transformYawPitchInv=this._transformYawPitch.clone(),this._transformYawPitch.invert()}t.getParent()||this.upAxisSpace!=i.Space.BONE||(this.upAxisSpace=i.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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"minPitch",{get:function(){return this._minPitch},set:function(e){this._minPitch=e,this._minPitchTan=Math.tan(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxPitch",{get:function(){return this._maxPitch},set:function(e){this._maxPitch=e,this._maxPitchTan=Math.tan(e)},enumerable:!0,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,o=e._tmpMats[0],s=e._tmpMats[1],a=this.mesh,c=t.getParent(),l=e._tmpVecs[1];l.copyFrom(this.upAxis),this.upAxisSpace==i.Space.BONE&&c?(this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(l,this._transformYawPitchInv,l),c.getDirectionToRef(l,this.mesh,l)):this.upAxisSpace==i.Space.LOCAL&&(a.getDirectionToRef(l,l),1==a.scaling.x&&1==a.scaling.y&&1==a.scaling.z||l.normalize());var u=!1,h=!1;if(this._maxYaw==Math.PI&&this._minYaw==-Math.PI||(u=!0),this._maxPitch==Math.PI&&this._minPitch==-Math.PI||(h=!0),u||h){var d=e._tmpMats[2],f=e._tmpMats[3];if(this.upAxisSpace==i.Space.BONE&&1==l.y&&c)c.getRotationMatrixToRef(i.Space.WORLD,this.mesh,d);else if(this.upAxisSpace!=i.Space.LOCAL||1!=l.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):a.getDirectionToRef(g,g);var p=i.Vector3.Cross(l,g);p.normalize();var g=i.Vector3.Cross(p,l);i.Matrix.FromXYZAxesToRef(p,l,g,d)}else d.copyFrom(a.getWorldMatrix());d.invertToRef(f);var m=null;if(h){var _=e._tmpVecs[3];n.subtractToRef(r,_),i.Vector3.TransformCoordinatesToRef(_,f,_),m=Math.sqrt(_.x*_.x+_.z*_.z);var v=Math.atan2(_.y,m),A=v;v>this._maxPitch?(_.y=this._maxPitchTan*m,A=this._maxPitch):v<this._minPitch&&(_.y=this._minPitchTan*m,A=this._minPitch),v!=A&&(i.Vector3.TransformCoordinatesToRef(_,d,_),_.addInPlace(r),n=_)}if(u){_=e._tmpVecs[4];n.subtractToRef(r,_),i.Vector3.TransformCoordinatesToRef(_,f,_);var y=Math.atan2(_.x,_.z),b=y;if((y>this._maxYaw||y<this._minYaw)&&(null==m&&(m=Math.sqrt(_.x*_.x+_.z*_.z)),this._yawRange>Math.PI?this._isAngleBetween(y,this._maxYaw,this._midYawConstraint)?(_.z=this._maxYawCos*m,_.x=this._maxYawSin*m,b=this._maxYaw):this._isAngleBetween(y,this._midYawConstraint,this._minYaw)&&(_.z=this._minYawCos*m,_.x=this._minYawSin*m,b=this._minYaw):y>this._maxYaw?(_.z=this._maxYawCos*m,_.x=this._maxYawSin*m,b=this._maxYaw):y<this._minYaw&&(_.z=this._minYawCos*m,_.x=this._minYawSin*m,b=this._minYaw)),this._slerping&&this._yawRange>Math.PI){var T=e._tmpVecs[8];T.copyFrom(i.Axis.Z),this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(T,this._transformYawPitchInv,T);var E=e._tmpMats[4];this._boneQuat.toRotationMatrix(E),this.mesh.getWorldMatrix().multiplyToRef(E,E),i.Vector3.TransformCoordinatesToRef(T,E,T),i.Vector3.TransformCoordinatesToRef(T,f,T);var x=Math.atan2(T.x,T.z);if(this._getAngleBetween(x,y)>this._getAngleBetween(x,this._midYawConstraint)){null==m&&(m=Math.sqrt(_.x*_.x+_.z*_.z));var C=this._getAngleBetween(x,this._maxYaw);this._getAngleBetween(x,this._minYaw)<C?(b=x+.75*Math.PI,_.z=Math.cos(b)*m,_.x=Math.sin(b)*m):(b=x-.75*Math.PI,_.z=Math.cos(b)*m,_.x=Math.sin(b)*m)}}y!=b&&(i.Vector3.TransformCoordinatesToRef(_,d,_),_.addInPlace(r),n=_)}}var P=e._tmpVecs[5],M=e._tmpVecs[6],S=e._tmpVecs[7],R=e._tmpQuat;n.subtractToRef(r,P),P.normalize(),i.Vector3.CrossToRef(l,P,M),M.normalize(),i.Vector3.CrossToRef(P,M,S),S.normalize(),i.Matrix.FromXYZAxesToRef(M,S,P,o),0===M.x&&0===M.y&&0===M.z||0===S.x&&0===S.y&&0===S.z||0===P.x&&0===P.y&&0===P.z||((this.adjustYaw||this.adjustPitch||this.adjustRoll)&&(i.Matrix.RotationYawPitchRollToRef(this.adjustYaw,this.adjustPitch,this.adjustRoll,s),s.multiplyToRef(o,o)),this.slerpAmount<1?(this._slerping||this.bone.getRotationQuaternionToRef(i.Space.WORLD,this.mesh,this._boneQuat),this._transformYawPitch&&this._transformYawPitch.multiplyToRef(o,o),i.Quaternion.FromRotationMatrixToRef(o,R),i.Quaternion.SlerpToRef(this._boneQuat,R,this.slerpAmount,this._boneQuat),this.bone.setRotationQuaternion(this._boneQuat,i.Space.WORLD,this.mesh),this._slerping=!0):(this._transformYawPitch&&this._transformYawPitch.multiplyToRef(o,o),this.bone.setRotationMatrix(o,i.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 */"./Maths/math.ts"),s=r(/*! ../Materials/Textures/rawTexture */"./Materials/Textures/rawTexture.ts"),a=r(/*! ../Animations/animation */"./Animations/animation.ts"),c=r(/*! ../Animations/animationRange */"./Animations/animationRange.ts"),l=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../Engines/constants */"./Engines/constants.ts"),h=r(/*! ../Misc/logger */"./Misc/logger.ts"),d=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.doNotSerialize=!1,this._useTextureToStoreBoneMatrices=!0,this._animationPropertiesOverride=null,this.onBeforeComputeObservable=new i.Observable,this.bones=[],this._scene=r||l.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isUsingTextureForMatrices",{get:function(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones&&!this.needInitialSkinMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uniqueId",{get:function(){return this._uniqueId},enumerable:!0,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(){return 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 c.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]},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={},l=e.bones;for(i=0,n=l.length;i<n;i++)a[l[i].name]=l[i];this.bones.length!==l.length&&(h.Logger.Warn("copyAnimationRange: this rig has "+this.bones.length+" bones, while source as "+l.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 d=this.bones[i].name,f=a[d];f?o=o&&this.bones[i].copyAnimationRange(f,t,s,r,u):(h.Logger.Warn("copyAnimationRange: not same rig, missing source bone "+d),o=!1)}var p=e.getAnimationRange(t);return p&&(this._ranges[t]=new c.AnimationRange(t,p.from+s,p.to+s)),o},e.prototype.returnToRest=function(){for(var e=0;e<this.bones.length;e++)this.bones[e].returnToRest()},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.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],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 c=0;c<this.bones.length;c++){var l=this.bones[c];if(!l.getParent())l.getBaseMatrix().multiplyToRef(a,o.Tmp.Matrix[1]),l._updateDifferenceMatrix(o.Tmp.Matrix[1])}}this._computeTransformMatrices(i._bonesTransformMatrices,a)}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;for(var o=0;o<this.bones.length;o++){var s=this.bones[o],a=null,c=s.getParent();if(c){var l=this.bones.indexOf(c);a=i.bones[l]}var u=new n.Bone(s.name,i,a,s.getBaseMatrix().clone(),s.getRestPose().clone());d.DeepCopier.DeepCopy(s.animations,u.animations)}if(this._ranges)for(var h in i._ranges={},this._ranges){var f=this._ranges[h];f&&(i._ranges[h]=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 c=t.bones[i],l=null;c.parentBoneIndex>-1&&(l=s.bones[c.parentBoneIndex]);var u=c.rest?o.Matrix.FromArray(c.rest):null,h=new n.Bone(c.name,s,l,o.Matrix.FromArray(c.matrix),u);void 0!==c.id&&null!==c.id&&(h.id=c.id),c.length&&(h.length=c.length),c.metadata&&(h.metadata=c.metadata),c.animation&&h.animations.push(a.Animation.Parse(c.animation))}if(t.ranges)for(i=0;i<t.ranges.length;i++){var d=t.ranges[i];s.createAnimationRange(d.name,d.from,d.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,c){var l=o.event,u="touch"===l.pointerType;if(!n.isInVRExclusivePointerMode&&(o.type===s.PointerEventTypes.POINTERMOVE||-1!==r.buttons.indexOf(l.button))){var h=l.srcElement||l.target;if(r._altKey=l.altKey,r._ctrlKey=l.ctrlKey,r._metaKey=l.metaKey,r._shiftKey=l.shiftKey,r._buttonsPressed=l.buttons,n.isPointerLock){var d=l.movementX||l.mozMovementX||l.webkitMovementX||l.msMovementX||0,f=l.movementY||l.mozMovementY||l.webkitMovementY||l.msMovementY||0;r.onTouch(null,d,f),r.pointA=null,r.pointB=null}else if(o.type===s.PointerEventTypes.POINTERDOWN&&h){try{h.setPointerCapture(l.pointerId)}catch(e){}null===r.pointA?r.pointA={x:l.clientX,y:l.clientY,pointerId:l.pointerId,type:l.pointerType}:null===r.pointB&&(r.pointB={x:l.clientX,y:l.clientY,pointerId:l.pointerId,type:l.pointerType}),r.onButtonDown(l),t||(l.preventDefault(),e.focus())}else if(o.type===s.PointerEventTypes.POINTERDOUBLETAP)r.onDoubleTap(l.pointerType);else if(o.type===s.PointerEventTypes.POINTERUP&&h){try{h.releasePointerCapture(l.pointerId)}catch(e){}u||(r.pointB=null),n._badOS?r.pointA=r.pointB=null:r.pointB&&r.pointA&&r.pointA.pointerId==l.pointerId?(r.pointA=r.pointB,r.pointB=null):r.pointA&&r.pointB&&r.pointB.pointerId==l.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(l),t||l.preventDefault()}else if(o.type===s.PointerEventTypes.POINTERMOVE)if(t||l.preventDefault(),r.pointA&&null===r.pointB){d=l.clientX-r.pointA.x,f=l.clientY-r.pointA.y;r.onTouch(r.pointA,d,f),r.pointA.x=l.clientX,r.pointA.y=l.clientY}else if(r.pointA&&r.pointB){var p=r.pointA.pointerId===l.pointerId?r.pointA:r.pointB;p.x=l.clientX,p.y=l.clientY;var g=r.pointA.x-r.pointB.x,m=r.pointA.y-r.pointB.y,_=g*g+m*m,v={x:(r.pointA.x+r.pointB.x)/2,y:(r.pointA.y+r.pointB.y)/2,pointerId:l.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),o.Tools.RegisterTopRootEvents([{name:"blur",handler:this._onLostFocus}])},e.prototype.detachControl=function(e){this._onLostFocus&&o.Tools.UnregisterTopRootEvents([{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(){},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}return 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;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"},n.__decorate([Object(i.serialize)()],e.prototype,"gamepadRotationSensibility",void 0),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"},n.__decorate([Object(i.serialize)()],e.prototype,"keysUp",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysDown",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysLeft",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysRight",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysReset",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"panningSensibility",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"zoomingSensibility",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"useAltToZoom",void 0),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 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.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=i;if(a.wheelDelta)if(r.wheelDeltaPercentage){var c=.01*a.wheelDelta*r.wheelDeltaPercentage*r.camera.radius;o=a.wheelDelta>0?c/(1+r.wheelDeltaPercentage):c*(1+r.wheelDeltaPercentage)}else o=a.wheelDelta/(40*r.wheelPrecision);else o=-(i.deltaY||i.detail)/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"},n.__decorate([Object(i.serialize)()],e.prototype,"wheelPrecision",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"wheelDeltaPercentage",void 0),e}();o.CameraInputTypes.ArcRotateCameraMouseWheelInput=a},"./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.panningSensibility=1e3,t.multiTouchPanning=!0,t.multiTouchPanAndZoom=!0,t.pinchInwards=!0,t._isPanClick=!1,t._twoFingerActivityCount=0,t._isPinching=!1,t}return 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.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,c=o.y-i.y;this.camera.inertialPanningX+=-a/this.panningSensibility,this.camera.inertialPanningY+=c/this.panningSensibility}}else{this._twoFingerActivityCount++;var l=Math.sqrt(r),u=Math.sqrt(n);if(this._isPinching||this._twoFingerActivityCount<20&&Math.abs(u-l)>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;else if(0!==this.panningSensibility&&this.multiTouchPanning&&o&&i){a=o.x-i.x,c=o.y-i.y;this.camera.inertialPanningX+=-a/this.panningSensibility,this.camera.inertialPanningY+=c/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},n.__decorate([Object(i.serialize)()],t.prototype,"buttons",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"angularSensibilityX",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"angularSensibilityY",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"pinchPrecision",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"pinchDeltaPercentage",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"panningSensibility",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"multiTouchPanning",void 0),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 i});var n=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts");r(/*! ../../Cameras/arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts").ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation=function(){return this.add(new i),this};var i=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){this.camera.attachControl(e,t),window.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=i},"./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 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/keyboardEvents */"./Events/keyboardEvents.ts"),a=r(/*! ../../Maths/math */"./Maths/math.ts"),c=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)}},n.__decorate([Object(i.serialize)()],e.prototype,"keysForward",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysBackward",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysUp",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysDown",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysRight",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysLeft",void 0),e}();o.CameraInputTypes.FlyCameraKeyboardInput=c},"./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 */"./Maths/math.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(a.Axis.X,s),c.multiplyInPlace(i)),this.buttonsYaw.some(function(e){return e===r.activeButton})){i=a.Quaternion.RotationAxis(a.Axis.Y,o),c.multiplyInPlace(i);var l=n.bankedTurnLimit+n._trackRoll;if(n.bankedTurn&&-l<n.rotation.z&&n.rotation.z<l){var u=n.bankedTurnMultiplier*-o;i=a.Quaternion.RotationAxis(a.Axis.Z,u),c.multiplyInPlace(i)}}this.buttonsRoll.some(function(e){return e===r.activeButton})&&(i=a.Quaternion.RotationAxis(a.Axis.Z,-o),n._trackRoll-=o,c.multiplyInPlace(i)),c.toEulerAnglesToRef(n.rotation)},n.__decorate([Object(i.serialize)()],e.prototype,"buttons",void 0),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},n.__decorate([Object(o.serialize)()],e.prototype,"keysHeightOffsetIncr",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysHeightOffsetDecr",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierAlt",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierCtrl",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierShift",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRotationOffsetIncr",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRotationOffsetDecr",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierAlt",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierCtrl",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierShift",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRadiusIncr",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRadiusDecr",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRadiusModifierAlt",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRadiusModifierCtrl",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"keysRadiusModifierShift",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"heightSensibility",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"rotationSensibility",void 0),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"},n.__decorate([Object(i.serialize)()],e.prototype,"axisControlRadius",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"axisControlHeight",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"axisControlRotation",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"wheelPrecision",void 0),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 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)}},n.__decorate([Object(i.serialize)()],t.prototype,"angularSensibilityX",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"angularSensibilityY",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"pinchPrecision",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"pinchDeltaPercentage",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisXControlRadius",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisXControlHeight",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisXControlRotation",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisYControlRadius",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisYControlHeight",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisYControlRotation",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisPinchControlRadius",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"axisPinchControlHeight",void 0),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 s});var n=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),i=r(/*! ../../Maths/math */"./Maths/math.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts");r(/*! ../../Cameras/freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts").FreeCameraInputsManager.prototype.addDeviceOrientation=function(){return this.add(new s),this};var s=function(){function e(){var e=this;this._screenOrientationAngle=0,this._screenQuaternion=new i.Quaternion,this._alpha=0,this._beta=0,this._gamma=0,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},this._constantTranform=new i.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this._orientationChanged()}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},set:function(e){this._camera=e,null==this._camera||this._camera.rotationQuaternion||(this._camera.rotationQuaternion=new i.Quaternion)},enumerable:!0,configurable:!0}),e.prototype.attachControl=function(e,t){window.addEventListener("orientationchange",this._orientationChanged),window.addEventListener("deviceorientation",this._deviceOrientation),this._orientationChanged()},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=s},"./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 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(/*! ../../Maths/math */"./Maths/math.ts"),a=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),c=function(){function e(){this.gamepadAngularSensibility=200,this.gamepadMoveSensibility=40,this._cameraTransform=s.Matrix.Identity(),this._deltaTransform=s.Vector3.Zero(),this._vector3=s.Vector3.Zero(),this._vector2=s.Vector2.Zero()}return 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;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 c=50*e._computeLocalCameraSpeed();this._vector3.copyFromFloats(t.x*c,0,-t.y*c),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"},n.__decorate([Object(i.serialize)()],e.prototype,"gamepadAngularSensibility",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"gamepadMoveSensibility",void 0),e}();o.CameraInputTypes.FreeCameraGamepadInput=c},"./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 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/keyboardEvents */"./Events/keyboardEvents.ts"),a=r(/*! ../../Maths/math */"./Maths/math.ts"),c=function(){function e(){this.keysUp=[38],this.keysDown=[40],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===(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)||((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),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"},n.__decorate([Object(i.serialize)()],e.prototype,"keysUp",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysDown",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysLeft",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"keysRight",void 0),e}();o.CameraInputTypes.FreeCameraKeyboardMoveInput=c},"./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 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(e){void 0===e&&(e=!0),this.touchEnabled=e,this.buttons=[0,1,2],this.angularSensibility=2e3,this.previousPosition=null}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===s.PointerEventTypes.POINTERMOVE||-1!==r.buttons.indexOf(o.button))){var a=o.srcElement||o.target;if(i.type===s.PointerEventTypes.POINTERDOWN&&a){try{a.setPointerCapture(o.pointerId)}catch(e){}r.previousPosition={x:o.clientX,y:o.clientY},t||(o.preventDefault(),e.focus())}else if(i.type===s.PointerEventTypes.POINTERUP&&a){try{a.releasePointerCapture(o.pointerId)}catch(e){}r.previousPosition=null,t||o.preventDefault()}else if(i.type===s.PointerEventTypes.POINTERMOVE){if(!r.previousPosition||n.isPointerLock)return;var c=o.clientX-r.previousPosition.x;r.camera.getScene().useRightHandedSystem&&(c*=-1),r.camera.parent&&r.camera.parent._getWorldMatrixDeterminant()<0&&(c*=-1),r.camera.cameraRotation.y+=c/r.angularSensibility;var l=o.clientY-r.previousPosition.y;r.camera.cameraRotation.x+=l/r.angularSensibility,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,s.PointerEventTypes.POINTERDOWN|s.PointerEventTypes.POINTERUP|s.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._observer=null,this._onMouseMove=null,this.previousPosition=null)},e.prototype.getClassName=function(){return"FreeCameraMouseInput"},e.prototype.getSimpleName=function(){return"mouse"},n.__decorate([Object(i.serialize)()],e.prototype,"buttons",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"angularSensibility",void 0),e}();o.CameraInputTypes.FreeCameraMouseInput=a},"./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 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 */"./Maths/math.ts"),c=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"},n.__decorate([Object(i.serialize)()],e.prototype,"touchAngularSensibility",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"touchMoveSensibility",void 0),e}();o.CameraInputTypes.FreeCameraTouchInput=c},"./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 */"./Maths/math.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 c=r(/*! ./flyCameraKeyboardInput */"./Cameras/Inputs/flyCameraKeyboardInput.ts");r.d(t,"FlyCameraKeyboardInput",function(){return c.FlyCameraKeyboardInput});var l=r(/*! ./flyCameraMouseInput */"./Cameras/Inputs/flyCameraMouseInput.ts");r.d(t,"FlyCameraMouseInput",function(){return l.FlyCameraMouseInput});var u=r(/*! ./followCameraKeyboardMoveInput */"./Cameras/Inputs/followCameraKeyboardMoveInput.ts");r.d(t,"FollowCameraKeyboardMoveInput",function(){return u.FollowCameraKeyboardMoveInput});var h=r(/*! ./followCameraMouseWheelInput */"./Cameras/Inputs/followCameraMouseWheelInput.ts");r.d(t,"FollowCameraMouseWheelInput",function(){return h.FollowCameraMouseWheelInput});var d=r(/*! ./followCameraPointersInput */"./Cameras/Inputs/followCameraPointersInput.ts");r.d(t,"FollowCameraPointersInput",function(){return d.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 g=r(/*! ./freeCameraKeyboardMoveInput */"./Cameras/Inputs/freeCameraKeyboardMoveInput.ts");r.d(t,"FreeCameraKeyboardMoveInput",function(){return g.FreeCameraKeyboardMoveInput});var m=r(/*! ./freeCameraMouseInput */"./Cameras/Inputs/freeCameraMouseInput.ts");r.d(t,"FreeCameraMouseInput",function(){return m.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/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(/*! ../../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),o=r(/*! ../../PostProcesses/stereoscopicInterlacePostProcess */"./PostProcesses/stereoscopicInterlacePostProcess.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;e._rigCameras[0]._rigPostProcess=new i.PassPostProcess(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new o.StereoscopicInterlacePostProcess(e.name+"_stereoInterlace",e._rigCameras,t)}},"./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 */"./Maths/math.ts"),o=r(/*! ../../PostProcesses/vrDistortionCorrectionPostProcess */"./PostProcesses/vrDistortionCorrectionPostProcess.ts"),s=r(/*! ../VR/vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),a=r(/*! ../../Misc/logger */"./Misc/logger.ts");n.Camera._setVRRigMode=function(e,t){var r=t.vrCameraMetrics||s.VRCameraMetrics.GetDefault();e._rigCameras[0]._cameraRigParams.vrMetrics=r,e._rigCameras[0].viewport=new i.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 i.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 o.VRMultiviewToSingleview("VRMultiviewToSingleview",e,1)):(a.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 */"./Maths/math.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 i.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 i.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 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(/*! ../../Maths/math */"./Maths/math.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 c(e,0,0,1,s.Vector3.Zero(),r.interaxial_distance,t)}});var c=function(e){function t(t,r,n,o,s,a,c){var l=e.call(this,t,r,n,o,s,c)||this;return l.interaxialDistance=a,l.setCameraRigMode(i.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:a}),l}return 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 c});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 */"./Maths/math.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 c(e,s.Vector3.Zero(),r.interaxial_distance,t)}});var c=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 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 c});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 */"./Maths/math.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 c(e,s.Vector3.Zero(),r.interaxial_distance,t)}});var c=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 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 c});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 */"./Maths/math.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 c(e,s.Vector3.Zero(),r.interaxial_distance,t)}});var c=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 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 c=r(/*! ./stereoscopicFreeCamera */"./Cameras/Stereoscopic/stereoscopicFreeCamera.ts");r.d(t,"StereoscopicFreeCamera",function(){return c.StereoscopicFreeCamera});var l=r(/*! ./stereoscopicGamepadCamera */"./Cameras/Stereoscopic/stereoscopicGamepadCamera.ts");r.d(t,"StereoscopicGamepadCamera",function(){return l.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 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(/*! ../../Maths/math */"./Maths/math.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 c(e,0,0,1,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}});var c=function(e){function t(t,r,n,o,s,a,c,l){var u=e.call(this,t,r,n,o,s,l)||this;return u.interaxialDistance=a,u.isStereoscopicSideBySide=c,u.setCameraRigMode(c?i.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:i.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:a}),u}return 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 c});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 */"./Maths/math.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 c(e,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}});var c=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 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 c});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 */"./Maths/math.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 c(e,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}});var c=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 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 c});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 */"./Maths/math.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 c(e,s.Vector3.Zero(),r.interaxial_distance,r.isStereoscopicSideBySide,t)}});var c=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 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 c=r(/*! ./webVRCamera */"./Cameras/VR/webVRCamera.ts");r.d(t,"WebVRFreeCamera",function(){return c.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 */"./Maths/math.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatioFov",{get:function(){return 2*Math.atan(this.postProcessScaleFactor*this.vScreenSize/(2*this.eyeToScreenDistance))},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftPreViewMatrix",{get:function(){return n.Matrix.Translation(.5*this.interpupillaryDistance,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightPreViewMatrix",{get:function(){return n.Matrix.Translation(-.5*this.interpupillaryDistance,0,0)},enumerable:!0,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 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(/*! ./vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),a=r(/*! ../../Maths/math */"./Maths/math.ts"),c=r(/*! ../../node */"./node.ts");r(/*! ../Inputs/arcRotateCameraVRDeviceOrientationInput */"./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts"),r(/*! ../RigModes/vrRigMode */"./Cameras/RigModes/vrRigMode.ts");c.Node.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new l(e,0,0,1,a.Vector3.Zero(),t)}});var l=function(e){function t(t,r,n,o,a,c,l,u){void 0===l&&(l=!0),void 0===u&&(u=s.VRCameraMetrics.GetDefault());var h=e.call(this,t,r,n,o,a,c)||this;return u.compensateDistortion=l,h.setCameraRigMode(i.Camera.RIG_MODE_VR,{vrCameraMetrics:u}),h.inputs.addVRDeviceOrientation(),h}return 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 l});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 */"./Maths/math.ts"),c=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/vrRigMode */"./Cameras/RigModes/vrRigMode.ts");c.Node.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new l(e,a.Vector3.Zero(),t)}});var l=function(e){function t(t,r,n,o,a){void 0===o&&(o=!0),void 0===a&&(a=s.VRCameraMetrics.GetDefault());var c=e.call(this,t,r,n)||this;return a.compensateDistortion=o,c.setCameraRigMode(i.Camera.RIG_MODE_VR,{vrCameraMetrics:a}),c}return 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 a});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 */"./Maths/math.ts");r(/*! ../../node */"./node.ts").Node.AddNodeConstructor("VRDeviceOrientationGamepadCamera",function(e,t){return function(){return new a(e,s.Vector3.Zero(),t)}});var a=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 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 R}),r.d(t,"VRExperienceHelper",function(){return O});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"),c=r(/*! ../../Cameras/deviceOrientationCamera */"./Cameras/deviceOrientationCamera.ts"),l=r(/*! ../../Cameras/VR/vrDeviceOrientationFreeCamera */"./Cameras/VR/vrDeviceOrientationFreeCamera.ts"),u=r(/*! ../../Cameras/VR/webVRCamera */"./Cameras/VR/webVRCamera.ts"),h=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),d=r(/*! ../../Maths/math */"./Maths/math.ts"),f=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),p=r(/*! ../../Gamepads/Controllers/poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),g=r(/*! ../../Gamepads/Controllers/webVRController */"./Gamepads/Controllers/webVRController.ts"),m=r(/*! ../../Gamepads/xboxGamepad */"./Gamepads/xboxGamepad.ts"),_=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),v=r(/*! ../../Culling/ray */"./Culling/ray.ts"),A=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),y=r(/*! ../../Materials/standardMaterial */"./Materials/standardMaterial.ts"),b=r(/*! ../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),T=r(/*! ../../PostProcesses/imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts"),E=r(/*! ../../Animations/easing */"./Animations/easing.ts"),x=r(/*! ../../Animations/animation */"./Animations/animation.ts"),C=r(/*! ../../Cameras/VR/vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),P=(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"),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=_.Mesh.CreateTorus("gazeTracker",.0035,.0025,20,t,!1),this._gazeTracker.bakeCurrentTransformIntoVertices(),this._gazeTracker.isPickable=!1,this._gazeTracker.isVisible=!1;var n=new y.StandardMaterial("targetMat",t);n.specularColor=d.Color3.Black(),n.emissiveColor=new d.Color3(.7,.7,.7),n.backFaceCulling=!1,this._gazeTracker.material=n}}return e.prototype._getForwardRay=function(e){return new v.Ray(d.Vector3.Zero(),new d.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}()),M=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;i.webVRController=t,i._laserPointer=_.Mesh.CreateCylinder("laserPointer",1,.004,2e-4,20,1,r,!1);var o=new y.StandardMaterial("laserPointerMat",r);if(o.emissiveColor=new d.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 _.Mesh("preloadControllerMesh",r),a=new _.Mesh(p.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 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._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(p.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}(P),S=function(e){function t(t,r){var n=e.call(this,r)||this;return n.getCamera=t,n}return n.__extends(t,e),t.prototype._getForwardRay=function(e){var t=this.getCamera();return t?t.getForwardRay(e):new v.Ray(d.Vector3.Zero(),d.Vector3.Forward())},t}(P),R=function(){return function(){}}(),O=function(){function e(e,t){void 0===t&&(t={});var r=this;if(this.webVROptions=t,this._webVRsupported=!1,this._webVRready=!1,this._webVRrequesting=!1,this._webVRpresenting=!1,this._fullscreenVRpresenting=!1,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._rotationAllowed=!0,this._teleportBackwardsVector=new d.Vector3(0,-1,-1),this._isDefaultTeleportationTarget=!0,this._teleportationFillColor="#444444",this._teleportationBorderColor="#FFFFFF",this._rotationAngle=0,this._haloCenter=new d.Vector3(0,0,0),this._padSensibilityUp=.65,this._padSensibilityDown=.35,this._leftController=null,this._rightController=null,this.onNewMeshSelected=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.requestPointerLockOnFullScreen=!0,this._onResize=function(){r.moveButtonToBottomRight(),r._fullscreenVRpresenting&&r._webVRready&&r.exitVR()},this._onFullscreenChange=function(){var e=document;void 0!==e.fullscreen?r._fullscreenVRpresenting=document.fullscreen:void 0!==e.mozFullScreen?r._fullscreenVRpresenting=e.mozFullScreen:void 0!==e.webkitIsFullScreen?r._fullscreenVRpresenting=e.webkitIsFullScreen:void 0!==e.msIsFullScreen?r._fullscreenVRpresenting=e.msIsFullScreen:void 0!==document.msFullscreenElement&&(r._fullscreenVRpresenting=document.msFullscreenElement),!r._fullscreenVRpresenting&&r._canvas&&(r.exitVR(),r._useCustomVRButton||(r._btnVR.style.top=r._canvas.offsetTop+r._canvas.offsetHeight-70+"px",r._btnVR.style.left=r._canvas.offsetLeft+r._canvas.offsetWidth-100+"px"))},this._cachedAngularSensibility={angularSensibilityX:null,angularSensibilityY:null,angularSensibility:null},this.beforeRender=function(){r._leftController&&r._leftController._activePointer&&r._castRayAndSelectObject(r._leftController),r._rightController&&r._rightController._activePointer&&r._castRayAndSelectObject(r._rightController),r._noControllerIsActive?r._castRayAndSelectObject(r._cameraGazer):r._cameraGazer._gazeTracker.isVisible=!1},this._onNewGamepadConnected=function(e){if(e.type!==f.Gamepad.POSE_ENABLED)e.leftStick&&e.onleftstickchanged(function(e){r._teleportationInitialized&&r.teleportationEnabled&&(!r._leftController&&!r._rightController||r._leftController&&!r._leftController._activePointer&&r._rightController&&!r._rightController._activePointer)&&(r._checkTeleportWithRay(e,r._cameraGazer),r._checkTeleportBackwards(e,r._cameraGazer))}),e.rightStick&&e.onrightstickchanged(function(e){r._teleportationInitialized&&r._checkRotate(e,r._cameraGazer)}),e.type===f.Gamepad.XBOX&&(e.onbuttondown(function(e){r._interactionsEnabled&&e===m.Xbox360Button.A&&r._cameraGazer._selectionPointerDown()}),e.onbuttonup(function(e){r._interactionsEnabled&&e===m.Xbox360Button.A&&r._cameraGazer._selectionPointerUp()}));else{var t=e,n=new M(t,r._scene,r._cameraGazer._gazeTracker);"right"===t.hand||r._leftController&&r._leftController.webVRController!=t?r._rightController=n:r._leftController=n,r._tryEnableInteractionOnController(n)}},this._tryEnableInteractionOnController=function(e){r._interactionsRequested&&!e._interactionsEnabled&&r._enableInteractionOnController(e),r._teleportationRequested&&!e._teleportationEnabled&&r._enableTeleportationOnController(e)},this._onNewGamepadDisconnected=function(e){e instanceof g.WebVRController&&("left"===e.hand&&null!=r._leftController&&(r._leftController.dispose(),r._leftController=null),"right"===e.hand&&null!=r._rightController&&(r._rightController.dispose(),r._rightController=null))},this._workingVector=d.Vector3.Zero(),this._workingQuaternion=d.Quaternion.Identity(),this._workingMatrix=d.Matrix.Identity(),this._scene=e,this._canvas=e.getEngine().getRenderingCanvas(),void 0===t.createFallbackVRDeviceOrientationFreeCamera&&(t.createFallbackVRDeviceOrientationFreeCamera=!0),void 0===t.createDeviceOrientationCamera&&(t.createDeviceOrientationCamera=!0),void 0===t.laserToggle&&(t.laserToggle=!0),void 0===t.defaultHeight&&(t.defaultHeight=1.7),t.useCustomVRButton&&(this._useCustomVRButton=!0,t.customVRButton&&(this._btnVR=t.customVRButton)),t.rayLength&&(this._rayLength=t.rayLength),this._defaultHeight=t.defaultHeight,t.positionScale&&(this._rayLength*=t.positionScale,this._defaultHeight*=t.positionScale),this._hasEnteredVR=!1,this._scene.activeCamera?this._position=this._scene.activeCamera.position.clone():this._position=new d.Vector3(0,this._defaultHeight,0),t.createDeviceOrientationCamera||!this._scene.activeCamera){if(this._deviceOrientationCamera=new c.DeviceOrientationCamera("deviceOrientationVRHelper",this._position.clone(),e),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 n=this._scene.activeCamera;n.rotationQuaternion?this._deviceOrientationCamera.rotationQuaternion.copyFrom(n.rotationQuaternion):this._deviceOrientationCamera.rotationQuaternion.copyFrom(d.Quaternion.RotationYawPitchRoll(n.rotation.y,n.rotation.x,n.rotation.z)),this._deviceOrientationCamera.rotation=n.rotation.clone()}this._scene.activeCamera=this._deviceOrientationCamera,this._canvas&&this._scene.activeCamera.attachControl(this._canvas)}else this._existingCamera=this._scene.activeCamera;if(t.createFallbackVRDeviceOrientationFreeCamera&&(t.useMultiview&&(t.vrDeviceOrientationCameraMetrics||(t.vrDeviceOrientationCameraMetrics=C.VRCameraMetrics.GetDefault()),t.vrDeviceOrientationCameraMetrics.multiviewEnabled=!0),this._vrDeviceOrientationCamera=new l.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 S(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";".babylonVRicon.vrdisplaypresenting { display: none; }";var i=document.createElement("style");i.appendChild(document.createTextNode(".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(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); 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) }.babylonVRicon.vrdisplaypresenting { display: none; }")),document.getElementsByTagName("head")[0].appendChild(i),this.moveButtonToBottomRight()}this._btnVR&&this._btnVR.addEventListener("click",function(){r.isInVRMode?r.exitVR():r.enterVR()}),window.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.isInVRMode&&(r.exitVR(),r._fullscreenVRpresenting&&r._scene.getEngine().exitFullscreen())},h.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),window.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 E.CircleEase,this._circleEase.setEasingMode(E.EasingFunction.EASINGMODE_EASEINOUT),this.webVROptions.floorMeshes&&this.enableTeleportation({floorMeshes:this.webVROptions.floorMeshes})}return Object.defineProperty(e.prototype,"onEnteringVR",{get:function(){return this.onEnteringVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onExitingVR",{get:function(){return this.onExitingVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onControllerMeshLoaded",{get:function(){return this.onControllerMeshLoadedObservable},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftControllerGazeTrackerMesh",{get:function(){return this._leftController?this._leftController._gazeTracker:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightControllerGazeTrackerMesh",{get:function(){return this._rightController?this._rightController._gazeTracker:null},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"deviceOrientationCamera",{get:function(){return this._deviceOrientationCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentVRCamera",{get:function(){return this._webVRready?this._webVRCamera:this._scene.activeCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"webVRCamera",{get:function(){return this._webVRCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vrDeviceOrientationCamera",{get:function(){return this._vrDeviceOrientationCamera},enumerable:!0,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:!0,configurable:!0}),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._webVRpresenting||this._fullscreenVRpresenting},enumerable:!0,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(){this._canvas&&!this._useCustomVRButton&&(this._btnVR.style.top=this._canvas.offsetTop+this._canvas.offsetHeight-70+"px",this._btnVR.style.left=this._canvas.offsetLeft+this._canvas.offsetWidth-100+"px")},e.prototype.displayVRButton=function(){this._useCustomVRButton||this._btnVRDisplayed||(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.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=d.Quaternion.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(),this.vrDeviceOrientationCamera.angularSensibility=2e3),this.webVRCamera){var t=this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y,r=d.Quaternion.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y-t,n=this.webVRCamera.rotationQuaternion.toEulerAngles().y;this.webVRCamera.rotationQuaternion=d.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._canvas&&this._scene.activeCamera.attachControl(this._canvas),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._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._canvas&&this._scene.activeCamera.attachControl(this._canvas),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._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}},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:!0,configurable:!0}),e.prototype.enableInteractions=function(){var e=this;this._interactionsEnabled||(this._interactionsRequested=!0,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:!0,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){if(void 0===e&&(e={}),!this._teleportationInitialized){this._teleportationRequested=!0,this.enableInteractions(),e.floorMeshName&&(this._floorMeshName=e.floorMeshName),e.floorMeshes&&(this._floorMeshesCollection=e.floorMeshes),null!=this._leftController&&this._enableTeleportationOnController(this._leftController),null!=this._rightController&&this._enableTeleportationOnController(this._rightController);var t=new A.ImageProcessingConfiguration;t.vignetteColor=new d.Color4(0,0,0,0),t.vignetteEnabled=!0,this._postProcessMove=new T.ImageProcessingPostProcess("postProcessMove",1,this._webVRCamera,void 0,void 0,void 0,void 0,t),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=d.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,d.Quaternion.RotationYawPitchRollToRef(this._workingVector.y,this._workingVector.x,this._workingVector.z,this._workingQuaternion),this._workingQuaternion.toRotationMatrix(this._workingMatrix),d.Vector3.TransformCoordinatesToRef(this._teleportBackwardsVector,this._workingMatrix,this._workingVector);var i=new v.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===p.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=_.Mesh.CreateGround("teleportationTarget",2,2,2,this._scene),this._teleportationTarget.isPickable=!1;var e=new b.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 y.StandardMaterial("TextPlaneMaterial",this._scene);r.diffuseTexture=e,this._teleportationTarget.material=r;var n=_.Mesh.CreateTorus("torusTeleportation",.75,.1,25,this._scene,!1);n.isPickable=!1,n.parent=this._teleportationTarget;var i=new x.Animation("animationInnerCircle","position.y",30,x.Animation.ANIMATIONTYPE_FLOAT,x.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 E.SineEase;s.setEasingMode(E.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=d.Quaternion.FromRotationMatrix(d.Matrix.RotationY(Math.PI/4*this._rotationAngle)),n=new x.Animation("animationRotation","rotationQuaternion",90,x.Animation.ANIMATIONTYPE_QUATERNION,x.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 x.Animation("animationPP","vignetteWeight",90,x.Animation.ANIMATIONTYPE_FLOAT,x.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 c=new x.Animation("animationPP2","vignetteStretch",90,x.Animation.ANIMATIONTYPE_FLOAT,x.Animation.ANIMATIONLOOPMODE_CONSTANT),l=[];l.push({frame:0,value:0}),l.push({frame:3,value:10}),l.push({frame:6,value:0}),c.setKeys(l),c.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(c),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=d.Vector3.Cross(d.Axis.Y,n),o=d.Vector3.Cross(n,i);d.Vector3.RotationFromAxisToRef(o,n,i,this._teleportationTarget.rotation)}this._teleportationTarget.position.y+=.1}},e.prototype.teleportCamera=function(e){var t=this;if(this.currentVRCamera instanceof s.FreeCamera){this.webVRCamera.leftCamera?(this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition),this._workingVector.subtractInPlace(this.webVRCamera.position),e.subtractToRef(this._workingVector,this._workingVector)):this._workingVector.copyFrom(e),this.isInVRMode?this._workingVector.y+=this.webVRCamera.deviceDistanceToRoomGround()*this._webVRCamera.deviceScaleFactor:this._workingVector.y+=this._defaultHeight,this.onBeforeCameraTeleport.notifyObservers(this._workingVector),this.currentVRCamera.animations=[];var r=new x.Animation("animationCameraTeleportation","position",90,x.Animation.ANIMATIONTYPE_VECTOR3,x.Animation.ANIMATIONLOOPMODE_CONSTANT),n=[{frame:0,value:this.currentVRCamera.position},{frame:11,value:this._workingVector}];r.setKeys(n),r.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(r),this._postProcessMove.animations=[];var i=new x.Animation("animationPP","vignetteWeight",90,x.Animation.ANIMATIONTYPE_FLOAT,x.Animation.ANIMATIONLOOPMODE_CONSTANT),o=[];o.push({frame:0,value:0}),o.push({frame:5,value:8}),o.push({frame:11,value:0}),i.setKeys(o),this._postProcessMove.animations.push(i);var a=new x.Animation("animationPP2","vignetteStretch",90,x.Animation.ANIMATIONTYPE_FLOAT,x.Animation.ANIMATIONLOOPMODE_CONSTANT),c=[];c.push({frame:0,value:0}),c.push({frame:5,value:10}),c.push({frame:11,value:0}),a.setKeys(c),this._postProcessMove.animations.push(a),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,11,!1,1,function(){t._webVRCamera.detachPostProcess(t._postProcessMove)}),this._scene.beginAnimation(this.currentVRCamera,0,11,!1,1,function(){t.onAfterCameraTeleport.notifyObservers(t._workingVector)}),this._hideTeleportationTarget()}},e.prototype._convertNormalToDirectionOfRay=function(e,t){e&&(Math.acos(d.Vector3.Dot(e,t.direction))<Math.PI/2&&e.scaleInPlace(-1));return 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=d.Vector3.Cross(d.Axis.Y,o),c=d.Vector3.Cross(o,a);d.Vector3.RotationFromAxisToRef(c,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(new d.Color3(0,0,1)),this.changeLaserColor(new d.Color3(.2,.2,1)),e._isActionableMesh=!0):(this.changeGazeColor(new d.Color3(.7,.7,.7)),this.changeLaserColor(new d.Color3(.7,.7,.7)),e._isActionableMesh=!1);try{this.onNewMeshSelected.notifyObservers(r.pickedMesh)}catch(e){i.Logger.Warn("Error in your custom logic onNewMeshSelected: "+e)}}else this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,this.changeGazeColor(new d.Color3(.7,.7,.7)),this.changeLaserColor(new d.Color3(.7,.7,.7))}else this._notifySelectedMeshUnselected(e._currentMeshSelected),e._currentMeshSelected=null,this.changeGazeColor(new d.Color3(.7,.7,.7)),this.changeLaserColor(new d.Color3(.7,.7,.7))}},e.prototype._notifySelectedMeshUnselected=function(e){e&&this.onSelectedMeshUnselected.notifyObservers(e)},e.prototype.changeLaserColor=function(e){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.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._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}()},"./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 */"./Maths/math.ts"),c=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),l=r(/*! ../../Gamepads/Controllers/poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),u=r(/*! ../../node */"./node.ts"),h=r(/*! ../../Lights/hemisphericLight */"./Lights/hemisphericLight.ts"),d=r(/*! ../../Misc/logger */"./Misc/logger.ts"),f=r(/*! ../../PostProcesses/vrDistortionCorrectionPostProcess */"./PostProcesses/vrDistortionCorrectionPostProcess.ts");r(/*! ../RigModes/webVRRigMode */"./Cameras/RigModes/webVRRigMode.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 c=e.call(this,t,r,n)||this;c.webVROptions=o,c._vrDevice=null,c.rawPose=null,c._specsVersion="1.1",c._attached=!1,c._descendants=[],c._deviceRoomPosition=a.Vector3.Zero(),c._deviceRoomRotationQuaternion=a.Quaternion.Identity(),c._standingMatrix=null,c.devicePosition=a.Vector3.Zero(),c.deviceRotationQuaternion=a.Quaternion.Identity(),c.deviceScaleFactor=1,c._deviceToWorld=a.Matrix.Identity(),c._worldToDevice=a.Matrix.Identity(),c.controllers=[],c.onControllersAttachedObservable=new i.Observable,c.onControllerMeshLoadedObservable=new i.Observable,c.onPoseUpdatedFromDeviceObservable=new i.Observable,c._poseSet=!1,c.rigParenting=!0,c._defaultHeight=void 0,c._htmlElementAttached=null,c._detachIfAttached=function(){var e=c.getEngine().getVRDevice();e&&!e.isPresenting&&c._htmlElementAttached&&c.detachControl(c._htmlElementAttached)},c._workingVector=a.Vector3.Zero(),c._oneVector=a.Vector3.One(),c._workingMatrix=a.Matrix.Identity(),c._tmpMatrix=new a.Matrix,c._cache.position=a.Vector3.Zero(),o.defaultHeight&&(c._defaultHeight=o.defaultHeight,c.position.y=c._defaultHeight),c.minZ=.1,5===arguments.length&&(c.webVROptions=arguments[4]),null==c.webVROptions.trackPosition&&(c.webVROptions.trackPosition=!0),null==c.webVROptions.controllerMeshes&&(c.webVROptions.controllerMeshes=!0),null==c.webVROptions.defaultLightingOnControllers&&(c.webVROptions.defaultLightingOnControllers=!0),c.rotationQuaternion=new a.Quaternion,c.webVROptions&&c.webVROptions.positionScale&&(c.deviceScaleFactor=c.webVROptions.positionScale);var l=c.getEngine();return c._onVREnabled=function(e){e&&c.initControllers()},l.onVRRequestPresentComplete.add(c._onVREnabled),l.initWebVR().add(function(e){e.vrDisplay&&c._vrDevice!==e.vrDisplay&&(c._vrDevice=e.vrDisplay,c.setCameraRigMode(s.Camera.RIG_MODE_WEBVR,{parentCamera:c,vrDisplay:c._vrDevice,frameData:c._frameData,specs:c._specsVersion}),c._attached&&c.getEngine().enableVR())}),"undefined"!=typeof VRFrameData&&(c._frameData=new VRFrameData),o.useMultiview&&(c.getScene().getEngine().getCaps().multiview?(c._useMultiviewToSingleView=!0,c._rigPostProcess=new f.VRMultiviewToSingleview("VRMultiviewToSingleview",c,1)):(d.Logger.Warn("Multiview is not supported, falling back to standard rendering"),c._useMultiviewToSingleView=!1)),n.onBeforeCameraRenderObservable.add(function(e){e.parent===c&&c.rigParenting&&(c._descendants=c.getDescendants(!0,function(e){var t=c.controllers.some(function(t){return t._mesh===e}),r=-1!==c._rigCameras.indexOf(e);return!t&&!r}),c._descendants.forEach(function(t){t.parent=e}))}),n.onAfterCameraRenderObservable.add(function(e){e.parent===c&&c.rigParenting&&c._descendants.forEach(function(e){e.parent=c})}),c}return 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"rightController",{get:function(){return this._rightController||(this._rightController=this.getControllerByName("right")),this._rightController},enumerable:!0,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&&(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(),window.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===c.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===c.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 h.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===l.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/XR/index.ts":
- /*!*****************************!*\
- !*** ./Cameras/XR/index.ts ***!
- \*****************************/
- /*! exports provided: WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./webXRCamera */"./Cameras/XR/webXRCamera.ts");r.d(t,"WebXRCamera",function(){return n.WebXRCamera});var i=r(/*! ./webXREnterExitUI */"./Cameras/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 */"./Cameras/XR/webXRExperienceHelper.ts");r.d(t,"WebXRState",function(){return o.WebXRState}),r.d(t,"WebXRExperienceHelper",function(){return o.WebXRExperienceHelper});var s=r(/*! ./webXRInput */"./Cameras/XR/webXRInput.ts");r.d(t,"WebXRController",function(){return s.WebXRController}),r.d(t,"WebXRInput",function(){return s.WebXRInput});var a=r(/*! ./webXRManagedOutputCanvas */"./Cameras/XR/webXRManagedOutputCanvas.ts");r.d(t,"WebXRManagedOutputCanvas",function(){return a.WebXRManagedOutputCanvas});var c=r(/*! ./webXRSessionManager */"./Cameras/XR/webXRSessionManager.ts");r.d(t,"WebXRSessionManager",function(){return c.WebXRSessionManager})},"./Cameras/XR/webXRCamera.ts":
- /*!***********************************!*\
- !*** ./Cameras/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 */"./Maths/math.ts"),o=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),s=r(/*! ../../Cameras/freeCamera */"./Cameras/freeCamera.ts"),a=r(/*! ../../Cameras/targetCamera */"./Cameras/targetCamera.ts"),c=function(e){function t(t,r){var n=e.call(this,t,i.Vector3.Zero(),r)||this;return n.minZ=0,n.rotationQuaternion=new i.Quaternion,n.cameraRigMode=o.Camera.RIG_MODE_CUSTOM,n.updateUpVectorFromRotation=!0,n._updateNumberOfRigCameras(1),n}return n.__extends(t,e),t.prototype._updateNumberOfRigCameras=function(e){for(void 0===e&&(e=1);this.rigCameras.length<e;){var t=new a.TargetCamera("view: "+this.rigCameras.length,i.Vector3.Zero(),this.getScene());t.minZ=0,t.parent=this,t.rotationQuaternion=new i.Quaternion,t.updateUpVectorFromRotation=!0,this.rigCameras.push(t)}for(;this.rigCameras.length>e;){var r=this.rigCameras.pop();r&&r.dispose()}},t.prototype._updateForDualEyeDebugging=function(e){void 0===e&&(e=.01),this._updateNumberOfRigCameras(2),this.rigCameras[0].viewport=new i.Viewport(0,0,.5,1),this.rigCameras[0].position.x=-e/2,this.rigCameras[0].outputRenderTarget=null,this.rigCameras[1].viewport=new i.Viewport(.5,0,.5,1),this.rigCameras[1].position.x=e/2,this.rigCameras[1].outputRenderTarget=null},t.prototype.updateFromXRSessionManager=function(e){var r=this;if(!e._currentXRFrame||!e._currentXRFrame.getDevicePose)return!1;var n=e._currentXRFrame.getDevicePose(e._frameOfReference);return!(!n||!n.poseModelMatrix)&&(i.Matrix.FromFloat32ArrayToRefScaled(n.poseModelMatrix,0,1,t._TmpMatrix),this._scene.useRightHandedSystem||t._TmpMatrix.toggleModelMatrixHandInPlace(),t._TmpMatrix.getTranslationToRef(this.position),t._TmpMatrix.getRotationMatrixToRef(t._TmpMatrix),i.Quaternion.FromRotationMatrixToRef(t._TmpMatrix,this.rotationQuaternion),this.computeWorldMatrix(),this._updateNumberOfRigCameras(e._currentXRFrame.views.length),e._currentXRFrame.views.forEach(function(t,o){i.Matrix.FromFloat32ArrayToRefScaled(n.getViewMatrix(t),0,1,r.rigCameras[o]._computedViewMatrix),i.Matrix.FromFloat32ArrayToRefScaled(t.projectionMatrix,0,1,r.rigCameras[o]._projectionMatrix),r._scene.useRightHandedSystem||(r.rigCameras[o]._computedViewMatrix.toggleModelMatrixHandInPlace(),r.rigCameras[o]._projectionMatrix.toggleProjectionMatrixHandInPlace());var s=e._xrSession.baseLayer.getViewport(t),a=e._xrSession.baseLayer.framebufferWidth,c=e._xrSession.baseLayer.framebufferHeight;r.rigCameras[o].viewport.width=s.width/a,r.rigCameras[o].viewport.height=s.height/c,r.rigCameras[o].viewport.x=s.x/a,r.rigCameras[o].viewport.y=s.y/c,r.rigCameras[o].outputRenderTarget=e._sessionRenderTargetTexture}),!0)},t._TmpMatrix=new i.Matrix,t}(s.FreeCamera)},"./Cameras/XR/webXREnterExitUI.ts":
- /*!****************************************!*\
- !*** ./Cameras/XR/webXREnterExitUI.ts ***!
- \****************************************/
- /*! exports provided: WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXREnterExitUIButton",function(){return s}),r.d(t,"WebXREnterExitUIOptions",function(){return a}),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(/*! ./webXRExperienceHelper */"./Cameras/XR/webXRExperienceHelper.ts"),s=function(){function e(e,t){this.element=e,this.initializationOptions=t}return e.prototype.update=function(e){},e}(),a=function(){return function(){}}(),c=function(){function e(e,t){var r=this;if(this.scene=e,this._buttons=[],this._activeButton=null,this.activeButtonChangedObservable=new i.Observable,this._overlay=document.createElement("div"),this._overlay.style.cssText="z-index:11;position: absolute; right: 20px;bottom: 50px;",t.customButtons)this._buttons=t.customButtons;else{var n=document.createElement("button");n.style.cssText="color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-repeat:no-repeat; background-position: center; outline: none;",n.innerText="HMD",this._buttons.push(new s(n,{immersive:!0,outputContext:t.outputCanvasContext})),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",this.element.innerText=e===this?"EXIT":"HMD"};var o=document.createElement("button");o.style.cssText=n.style.cssText,o.innerText="Window",this._buttons.push(new s(o,{immersive:!1,environmentIntegration:!0,outputContext:t.outputCanvasContext})),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",this.element.innerText=e===this?"EXIT":"Window"},this._updateButtons(null)}var a=e.getEngine().getRenderingCanvas();a&&a.parentNode&&(a.parentNode.appendChild(this._overlay),e.onDisposeObservable.addOnce(function(){r.dispose()}))}return e.CreateAsync=function(t,r,i){var s=this,a=new e(t,i),c=a._buttons.map(function(e){return r.supportsSessionAsync(e.initializationOptions)});return r.onStateChangedObservable.add(function(e){e==o.WebXRState.NOT_IN_XR&&a._updateButtons(null)}),Promise.all(c).then(function(e){return e.forEach(function(e,t){e&&(a._overlay.appendChild(a._buttons[t].element),a._buttons[t].element.onclick=function(){return n.__awaiter(s,void 0,void 0,function(){return n.__generator(this,function(e){switch(e.label){case 0:return r.state!=o.WebXRState.IN_XR?[3,2]:(a._updateButtons(null),[4,r.exitXRAsync()]);case 1:return e.sent(),[2];case 2:return r.state!=o.WebXRState.NOT_IN_XR?[3,4]:(a._updateButtons(a._buttons[t]),[4,r.enterXRAsync(a._buttons[t].initializationOptions,"eye-level")]);case 3:e.sent(),e.label=4;case 4:return[2]}})})})}),a})},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.prototype.dispose=function(){var e=this.scene.getEngine().getRenderingCanvas();e&&e.parentNode&&e.parentNode.contains(this._overlay)&&e.parentNode.removeChild(this._overlay),this.activeButtonChangedObservable.clear()},e}()},"./Cameras/XR/webXRExperienceHelper.ts":
- /*!*********************************************!*\
- !*** ./Cameras/XR/webXRExperienceHelper.ts ***!
- \*********************************************/
- /*! exports provided: WebXRState, WebXRExperienceHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRState",function(){return n}),r.d(t,"WebXRExperienceHelper",function(){return l});var n,i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Maths/math */"./Maths/math.ts"),s=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ./webXRSessionManager */"./Cameras/XR/webXRSessionManager.ts"),c=r(/*! ./webXRCamera */"./Cameras/XR/webXRCamera.ts");!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={}));var l=function(){function e(e){this.scene=e,this.state=n.NOT_IN_XR,this.onStateChangedObservable=new i.Observable,this._nonVRCamera=null,this._originalSceneAutoClear=!0,this._supported=!1,this.camera=new c.WebXRCamera("",e),this._sessionManager=new a.WebXRSessionManager(e),this.container=new s.AbstractMesh("",e),this.camera.parent=this.container}return e.prototype._setState=function(e){this.state=e,this.onStateChangedObservable.notifyObservers(this.state)},e.CreateAsync=function(t){var r=new e(t);return r._sessionManager.initializeAsync().then(function(){return r._supported=!0,r}).catch(function(){return r})},e.prototype.exitXRAsync=function(){return this._setState(n.EXITING_XR),this._sessionManager.exitXRAsync()},e.prototype.enterXRAsync=function(e,t){var r=this;if(!this._supported)throw"XR session not supported by this browser";return this._setState(n.ENTERING_XR),this._sessionManager.enterXRAsync(e,t).then(function(){r._originalSceneAutoClear=r.scene.autoClear,r._nonVRCamera=r.scene.activeCamera,r.scene.autoClear=!1,r.scene.activeCamera=r.camera,r._sessionManager.onXRFrameObservable.add(function(){r.camera.updateFromXRSessionManager(r._sessionManager)}),r._sessionManager.onXRSessionEnded.addOnce(function(){r.camera.rigCameras.forEach(function(e){e.outputRenderTarget=null}),r.scene.autoClear=r._originalSceneAutoClear,r.scene.activeCamera=r._nonVRCamera,r._sessionManager.onXRFrameObservable.clear(),r._setState(n.NOT_IN_XR)}),r._setState(n.IN_XR)})},e.prototype.environmentPointHitTestAsync=function(e){return this._sessionManager.environmentPointHitTestAsync(e)},e.prototype.setPositionOfCameraUsingContainer=function(t){this.camera.globalPosition.subtractToRef(t,e._TmpVector),this.container.position.subtractInPlace(e._TmpVector)},e.prototype.rotateCameraByQuaternionUsingContainer=function(e){this.container.rotationQuaternion||(this.container.rotationQuaternion=o.Quaternion.FromEulerVector(this.container.rotation)),this.container.rotationQuaternion.multiplyInPlace(e),this.container.position.rotateByQuaternionAroundPointToRef(e,this.camera.globalPosition,this.container.position)},e.prototype.supportsSessionAsync=function(e){return this._supported?this._sessionManager.supportsSessionAsync(e):Promise.resolve(!1)},e.prototype.dispose=function(){this.camera.dispose(),this.container.dispose(),this.onStateChangedObservable.clear(),this._sessionManager.dispose()},e._TmpVector=new o.Vector3,e}()},"./Cameras/XR/webXRInput.ts":
- /*!**********************************!*\
- !*** ./Cameras/XR/webXRInput.ts ***!
- \**********************************/
- /*! exports provided: WebXRController, WebXRInput */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRController",function(){return o}),r.d(t,"WebXRInput",function(){return s});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),o=function(){function e(e){this.pointer=new i.AbstractMesh("controllerPointer",e)}return e.prototype.dispose=function(){this.grip&&this.grip.dispose(),this.pointer.dispose()},e}(),s=function(){function e(e){var t=this;this.helper=e,this.controllers=[],this._tmpMatrix=new n.Matrix,this._frameObserver=e._sessionManager.onXRFrameObservable.add(function(){if(e._sessionManager._currentXRFrame&&e._sessionManager._currentXRFrame.getDevicePose){var r=e._sessionManager._currentXRFrame;e._sessionManager._xrSession.getInputSources().forEach(function(s,a){var c=r.getInputPose(s,e._sessionManager._frameOfReference);if(c){t.controllers.length<=a&&t.controllers.push(new o(e.container.getScene()));var l=t.controllers[a];c.gripMatrix&&(l.grip||(l.grip=new i.AbstractMesh("controllerGrip",e.container.getScene())),n.Matrix.FromFloat32ArrayToRefScaled(c.gripMatrix,0,1,t._tmpMatrix),l.grip.getScene().useRightHandedSystem||t._tmpMatrix.toggleModelMatrixHandInPlace(),l.grip.rotationQuaternion||(l.grip.rotationQuaternion=new n.Quaternion),t._tmpMatrix.decompose(l.grip.scaling,l.grip.rotationQuaternion,l.grip.position)),n.Matrix.FromFloat32ArrayToRefScaled(c.targetRay.transformMatrix,0,1,t._tmpMatrix),l.pointer.getScene().useRightHandedSystem||t._tmpMatrix.toggleModelMatrixHandInPlace(),l.pointer.rotationQuaternion||(l.pointer.rotationQuaternion=new n.Quaternion),t._tmpMatrix.decompose(l.pointer.scaling,l.pointer.rotationQuaternion,l.pointer.position)}})}})}return e.prototype.dispose=function(){this.controllers.forEach(function(e){e.dispose()}),this.helper._sessionManager.onXRFrameObservable.remove(this._frameObserver)},e}()},"./Cameras/XR/webXRManagedOutputCanvas.ts":
- /*!************************************************!*\
- !*** ./Cameras/XR/webXRManagedOutputCanvas.ts ***!
- \************************************************/
- /*! exports provided: WebXRManagedOutputCanvas */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRManagedOutputCanvas",function(){return i});var n=r(/*! ./webXRExperienceHelper */"./Cameras/XR/webXRExperienceHelper.ts"),i=function(){function e(e,t){var r=this;this._canvas=null,this.canvasContext=null,t||((t=document.createElement("canvas")).style.cssText="position:absolute; bottom:0px;right:0px;z-index:10;width:100%;height:100%;background-color: #000000;"),this._setManagedOutputCanvas(t),e.onStateChangedObservable.add(function(t){t==n.WebXRState.ENTERING_XR?r._addCanvas():e.state==n.WebXRState.NOT_IN_XR&&r._removeCanvas()})}return e.prototype.dispose=function(){this._removeCanvas(),this._setManagedOutputCanvas(null)},e.prototype._setManagedOutputCanvas=function(e){this._removeCanvas(),e?(this._canvas=e,this.canvasContext=this._canvas.getContext("xrpresent")):(this._canvas=null,this.canvasContext=null)},e.prototype._addCanvas=function(){this._canvas&&document.body.appendChild(this._canvas)},e.prototype._removeCanvas=function(){this._canvas&&document.body.contains(this._canvas)&&document.body.removeChild(this._canvas)},e}()},"./Cameras/XR/webXRSessionManager.ts":
- /*!*******************************************!*\
- !*** ./Cameras/XR/webXRSessionManager.ts ***!
- \*******************************************/
- /*! exports provided: WebXRSessionManager */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRSessionManager",function(){return c});var n=r(/*! ../../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Maths/math */"./Maths/math.ts"),s=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),c=function(){function e(e){this.scene=e,this.onXRFrameObservable=new i.Observable,this.onXRSessionEnded=new i.Observable,this._sessionRenderTargetTexture=null,this._tmpMatrix=new o.Matrix}return e.prototype.initializeAsync=function(){var e=this;return n.Logger.Warn("The WebXR APIs are still under development and are subject to change in the future."),this._xrNavigator=navigator,this._xrNavigator.xr?this._xrNavigator.xr.requestDevice().then(function(t){return e._xrDevice=t,e.scene.getEngine()._gl.setCompatibleXRDevice(e._xrDevice)}):Promise.reject("webXR not supported by this browser")},e.prototype.enterXRAsync=function(t,r){var n=this;return this._xrDevice.requestSession(t).then(function(e){return n._xrSession=e,n._xrSession.addEventListener("end",function(){n._sessionRenderTargetTexture=null,n.scene.getEngine().restoreDefaultFramebuffer(),n.scene.getEngine().customAnimationFrameRequester=null,n.onXRSessionEnded.notifyObservers(null),n.scene.getEngine()._renderLoop()},{once:!0}),n._xrSession.baseLayer=new XRWebGLLayer(n._xrSession,n.scene.getEngine()._gl),n._xrSession.requestFrameOfReference(r)}).then(function(t){n._frameOfReference=t,n.scene.getEngine().customAnimationFrameRequester={requestAnimationFrame:n._xrSession.requestAnimationFrame.bind(n._xrSession),renderFunction:function(e,t){n._currentXRFrame=t,n.onXRFrameObservable.notifyObservers(null),n.scene.getEngine()._renderLoop()}},n._sessionRenderTargetTexture=e._CreateRenderTargetTextureFromSession(n._xrSession,n.scene),window.cancelAnimationFrame(n.scene.getEngine()._frameHandler),n.scene.getEngine()._renderLoop()})},e.prototype.exitXRAsync=function(){return this._xrSession.end()},e.prototype.environmentPointHitTestAsync=function(e){var t=this;return new Promise(function(r){var n=new Float32Array([e.origin.x,e.origin.y,e.origin.z]),i=new Float32Array([e.direction.x,e.direction.y,e.direction.z]);t.scene.useRightHandedSystem||(n[2]*=-1,i[2]*=-1),t._xrSession.requestHitTest(n,i,t._frameOfReference).then(function(e){if(e.length>0){o.Matrix.FromFloat32ArrayToRefScaled(e[0].hitMatrix,0,1,t._tmpMatrix);var n=t._tmpMatrix.getTranslation();t.scene.useRightHandedSystem||(n.z*=-1),r(n)}else r(null)}).catch(function(){r(null)})})},e.prototype.supportsSessionAsync=function(e){return this._xrDevice.supportsSession(e).then(function(){return!0}).catch(function(){return!1})},e._CreateRenderTargetTextureFromSession=function(e,t){var r=new s.InternalTexture(t.getEngine(),s.InternalTexture.DATASOURCE_UNKNOWN,!0);r.width=e.baseLayer.framebufferWidth,r.height=e.baseLayer.framebufferHeight,r._framebuffer=e.baseLayer.framebuffer;var n=new a.RenderTargetTexture("XR renderTargetTexture",{width:r.width,height:r.height},t,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0);return n._texture=r,n},e.prototype.dispose=function(){this.onXRFrameObservable.clear(),this.onXRSessionEnded.clear()},e}()},"./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 */"./Maths/math.ts"),a=r(/*! ../node */"./node.ts"),c=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../Behaviors/Cameras/autoRotationBehavior */"./Behaviors/Cameras/autoRotationBehavior.ts"),u=r(/*! ../Behaviors/Cameras/bouncingBehavior */"./Behaviors/Cameras/bouncingBehavior.ts"),h=r(/*! ../Behaviors/Cameras/framingBehavior */"./Behaviors/Cameras/framingBehavior.ts"),d=r(/*! ./camera */"./Cameras/camera.ts"),f=r(/*! ./targetCamera */"./Cameras/targetCamera.ts"),p=r(/*! ../Cameras/arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.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,c,l){void 0===l&&(l=!0);var u=e.call(this,t,s.Vector3.Zero(),c,l)||this;return 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 c=u.upVector;u.allowUpsideDown&&u.beta<0&&(c=(c=c.clone()).negate()),u._computeViewMatrix(u._position,a,c),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 n.__extends(t,e),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},set:function(e){this.setTarget(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this.setPosition(e)},enumerable:!0,configurable:!0}),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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"bouncingBehavior",{get:function(){return this._bouncingBehavior},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"framingBehavior",{get:function(){return this._framingBehavior},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useFramingBehavior",{get:function(){return null!=this._framingBehavior},set:function(e){e!==this.useFramingBehavior&&(e?(this._framingBehavior=new h.FramingBehavior,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoRotationBehavior",{get:function(){return this._autoRotationBehavior},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useAutoRotationBehavior",{get:function(){return null!=this._autoRotationBehavior},set:function(e){e!==this.useAutoRotationBehavior&&(e?(this._autoRotationBehavior=new l.AutoRotationBehavior,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))},enumerable:!0,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(),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.setTarget(this._storedTarget.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)<s.Epsilon&&(this.inertialAlphaOffset=0),Math.abs(this.inertialBetaOffset)<s.Epsilon&&(this.inertialBetaOffset=0),Math.abs(this.inertialRadiusOffset)<this.speed*s.Epsilon&&(this.inertialRadiusOffset=0)}if(0!==this.inertialPanningX||0!==this.inertialPanningY){if(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)if(this.panningDistanceLimit)this._transformedDirection.addInPlace(this._target),s.Vector3.DistanceSquared(this._transformedDirection,this.panningOriginTarget)<=this.panningDistanceLimit*this.panningDistanceLimit&&this._target.copyFrom(this._transformedDirection);else this._target.addInPlace(this._transformedDirection);this.inertialPanningX*=this.panningInertia,this.inertialPanningY*=this.panningInertia,Math.abs(this.inertialPanningX)<this.speed*s.Epsilon&&(this.inertialPanningX=0),Math.abs(this.inertialPanningY)<this.speed*s.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(e){void 0===e&&(e=!0),e&&this.getViewMatrix(),this._position.subtractToRef(this._getTargetPosition(),this._computationVector),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4),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(!1))},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);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){this._tempAxisVector||(this._tempAxisVector=new s.Vector3,this._tempAxisRotationMatrix=new s.Matrix),s.Vector3.CrossToRef(s.Vector3.Up(),this.upVector,this._tempAxisVector),this._tempAxisVector.normalize();var o=Math.acos(s.Vector3.Dot(s.Vector3.UpReadOnly,this.upVector));s.Matrix.RotationAxisToRef(this._tempAxisVector,o,this._tempAxisRotationMatrix),this._tempAxisVector.copyFrom(this._computationVector),s.Vector3.TransformCoordinatesToRef(this._tempAxisVector,this._tempAxisRotationMatrix,this._computationVector)}if(i.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){var a=this.getScene().collisionCoordinator;this._collider||(this._collider=a.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,a.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);var c=this.upVector;this.allowUpsideDown&&n<0&&(c=(c=c.clone()).negate()),this._computeViewMatrix(this._position,i,c),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=c.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=c.Mesh.MinMax(i),n=s.Vector3.Distance(r.min,r.max)}else{r=e,n=e.distance}this._target=c.Mesh.Center(r),t||(this.maxZ=2*n)},t.prototype.createRigCamera=function(e,r){var n=0;switch(this.cameraRigMode){case d.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case d.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case d.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case d.Camera.RIG_MODE_VR:n=this._cameraRigParams.stereoHalfAngle*(0===r?1:-1);break;case d.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},t.prototype._updateRigCameras=function(){var t=this._rigCameras[0],r=this._rigCameras[1];switch(t.beta=r.beta=this.beta,this.cameraRigMode){case d.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case d.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case d.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case d.Camera.RIG_MODE_VR:t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,r.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case d.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"},n.__decorate([Object(i.serialize)()],t.prototype,"alpha",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"beta",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"radius",void 0),n.__decorate([Object(i.serializeAsVector3)("target")],t.prototype,"_target",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"inertialAlphaOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"inertialBetaOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"inertialRadiusOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lowerAlphaLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"upperAlphaLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lowerBetaLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"upperBetaLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lowerRadiusLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"upperRadiusLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"inertialPanningX",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"inertialPanningY",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"pinchToPanMaxDistance",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"panningDistanceLimit",void 0),n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"panningOriginTarget",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"panningInertia",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"zoomOnFactor",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"targetScreenOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"allowUpsideDown",void 0),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 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 p});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"),c=r(/*! ../Maths/math */"./Maths/math.ts"),l=r(/*! ../node */"./node.ts"),u=r(/*! ../Misc/logger */"./Misc/logger.ts"),h=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),d=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),f=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),p=function(e){function t(r,n,i,s){void 0===s&&(s=!0);var l=e.call(this,r,i)||this;return l._position=c.Vector3.Zero(),l.upVector=c.Vector3.Up(),l.orthoLeft=null,l.orthoRight=null,l.orthoBottom=null,l.orthoTop=null,l.fov=.8,l.minZ=1,l.maxZ=1e4,l.inertia=.9,l.mode=t.PERSPECTIVE_CAMERA,l.isIntermediate=!1,l.viewport=new c.Viewport(0,0,1,1),l.layerMask=268435455,l.fovMode=t.FOVMODE_VERTICAL_FIXED,l.cameraRigMode=t.RIG_MODE_NONE,l.customRenderTargets=new Array,l.outputRenderTarget=null,l._useMultiviewToSingleView=!1,l._multiviewTexture=null,l.onViewMatrixChangedObservable=new a.Observable,l.onProjectionMatrixChangedObservable=new a.Observable,l.onAfterCheckInputsObservable=new a.Observable,l.onRestoreStateObservable=new a.Observable,l._rigCameras=new Array,l._webvrViewMatrix=c.Matrix.Identity(),l._skipRendering=!1,l._projectionMatrix=new c.Matrix,l._postProcesses=new Array,l._activeMeshes=new o.SmartArray(256),l._globalPosition=c.Vector3.Zero(),l._computedViewMatrix=c.Matrix.Identity(),l._doNotComputeProjectionMatrix=!1,l._transformMatrix=c.Matrix.Zero(),l._refreshFrustumPlanes=!0,l._isCamera=!0,l._isLeftCamera=!1,l._isRightCamera=!0,l.getScene().addCamera(l),s&&!l.getScene().activeCamera&&(l.getScene().activeCamera=l),l.position=n,l}return n.__extends(t,e),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e},enumerable:!0,configurable:!0}),t.prototype._resizeOrCreateMultiviewTexture=function(e,t){this._multiviewTexture?this._multiviewTexture.getRenderWidth()==e&&this._multiviewTexture.getRenderHeight()==t||(this._multiviewTexture.dispose(),this._multiviewTexture=new f.MultiviewRenderTarget(this.getScene(),{width:e,height:t})):this._multiviewTexture=new f.MultiviewRenderTarget(this.getScene(),{width:e,height:t})},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:!0,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 c.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new c.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:!0,configurable:!0}),Object.defineProperty(t.prototype,"rigPostProcess",{get:function(){return this._rigPostProcess},enumerable:!0,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;if(i)"pass"===i.getEffectName()&&(n.isIntermediate=0===this._postProcesses.length),n._postProcesses=this._postProcesses.slice(0).concat(i),i.markTextureDirty();else 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._worldMatrix:(this.getViewMatrix(),this._worldMatrix)},t.prototype._getViewMatrix=function(){return c.Matrix.Identity()},t.prototype.getViewMatrix=function(e){return!e&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childRenderId=this._currentRenderId,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),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){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 r=this.getEngine(),n=this.getScene();if(this.mode===t.PERSPECTIVE_CAMERA)this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=r.getAspectRatio(this),this.minZ<=0&&(this.minZ=.1),n.useRightHandedSystem?c.Matrix.PerspectiveFovRHToRef(this.fov,r.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED):c.Matrix.PerspectiveFovLHToRef(this.fov,r.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED);else{var i=r.getRenderWidth()/2,o=r.getRenderHeight()/2;n.useRightHandedSystem?c.Matrix.OrthoOffCenterRHToRef(this.orthoLeft||-i,this.orthoRight||i,this.orthoBottom||-o,this.orthoTop||o,this.minZ,this.maxZ,this._projectionMatrix):c.Matrix.OrthoOffCenterLHToRef(this.orthoLeft||-i,this.orthoRight||i,this.orthoBottom||-o,this.orthoTop||o,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=r.getRenderWidth(),this._cache.renderHeight=r.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?c.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=c.Frustum.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)},t.prototype.isInFrustum=function(e){return this._updateFrustumPlanes(),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),d._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:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRightCamera",{get:function(){return this._isRightCamera},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"leftCamera",{get:function(){return this._rigCameras.length<1?null:this._rigCameras[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rightCamera",{get:function(){return this._rigCameras.length<2?null:this._rigCameras[1]},enumerable:!0,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: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 c.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 c.Matrix.Identity()},t.prototype._getWebVRViewMatrix=function(){return c.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=c.Vector3.Zero();return this.getDirectionToRef(e,t),t},t.prototype.getDirectionToRef=function(e,t){c.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=l.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(c.Vector3.FromArray(e.position))),e.target&&s.setTarget&&s.setTarget(c.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 d=e.animations[u],f=h._TypeStore.GetClass("BABYLON.Animation");f&&s.animations.push(f.Parse(d))}l.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 d._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_VR=20,t.RIG_MODE_WEBVR=21,t.RIG_MODE_CUSTOM=22,t.ForceAttachControlToAlwaysPreventDefault=!1,n.__decorate([Object(i.serializeAsVector3)("position")],t.prototype,"_position",void 0),n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"upVector",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"orthoLeft",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"orthoRight",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"orthoBottom",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"orthoTop",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"fov",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"minZ",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"maxZ",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"inertia",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"mode",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"layerMask",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"fovMode",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"cameraRigMode",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"interaxialDistance",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"isStereoscopicSideBySide",void 0),t}(l.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;if(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 a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./freeCamera */"./Cameras/freeCamera.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../node */"./node.ts");r(/*! ./Inputs/freeCameraDeviceOrientationInput */"./Cameras/Inputs/freeCameraDeviceOrientationInput.ts");s.Node.AddNodeConstructor("DeviceOrientationCamera",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._quaternionCache=new o.Quaternion,i.inputs.addDeviceOrientation(),i}return n.__extends(t,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=o.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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ./targetCamera */"./Cameras/targetCamera.ts"),c=r(/*! ./flyCameraInputsManager */"./Cameras/flyCameraInputsManager.ts"),l=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){void 0===r&&(r=null);var n;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 c.FlyCameraInputsManager(a),a.inputs.addKeyboard().addMouse(),a}return 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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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"},n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"ellipsoid",void 0),n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"ellipsoidOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"checkCollisions",void 0),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 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 h});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 */"./Maths/math.ts"),c=r(/*! ../node */"./node.ts"),l=r(/*! ./followCameraInputsManager */"./Cameras/followCameraInputsManager.ts");c.Node.AddNodeConstructor("FollowCamera",function(e,t){return function(){return new u(e,a.Vector3.Zero(),t)}}),c.Node.AddNodeConstructor("ArcFollowCamera",function(e,t){return function(){return new h(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 l.FollowCameraInputsManager(o),o.inputs.addKeyboard().addMouseWheel().addPointers(),o}return 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,c=i.z+Math.cos(n)*this.radius,l=s-this.position.x,u=i.y+this.heightOffset-this.position.y,h=c-this.position.z,d=l*this.cameraAcceleration*2,f=u*this.cameraAcceleration,p=h*this.cameraAcceleration*2;(d>this.maxCameraSpeed||d<-this.maxCameraSpeed)&&(d=d<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+d,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"},n.__decorate([Object(i.serialize)()],t.prototype,"radius",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lowerRadiusLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"upperRadiusLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"rotationOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lowerRotationOffsetLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"upperRotationOffsetLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"heightOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lowerHeightOffsetLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"upperHeightOffsetLimit",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"cameraAcceleration",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"maxCameraSpeed",void 0),n.__decorate([Object(i.serializeAsMeshReference)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(s.TargetCamera),h=function(e){function t(t,r,n,i,o,s){var c=e.call(this,t,a.Vector3.Zero(),s)||this;return c.alpha=r,c.beta=n,c.radius=i,c.target=o,c._cartesianCoordinates=a.Vector3.Zero(),c._follow(),c}return 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 c});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"),c=function(e){function t(t){return e.call(this,t)||this}return 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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ./targetCamera */"./Cameras/targetCamera.ts"),c=r(/*! ./freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts"),l=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){void 0===r&&(r=null);var n;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 c.FreeCameraInputsManager(a),a.inputs.addKeyboard().addMouse(),a}return 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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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"},n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"ellipsoid",void 0),n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"ellipsoidOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"checkCollisions",void 0),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 c});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"),c=function(e){function t(t){return e.call(this,t)||this}return 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.add(new s.FreeCameraMouseInput(e)),this},t.prototype.addTouch=function(){return this.add(new a.FreeCameraTouchInput),this},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 */"./Maths/math.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 n.__extends(t,e),t.prototype.getClassName=function(){return"GamepadCamera"},t}(i.UniversalCamera)},"./Cameras/index.ts":
- /*!**************************!*\
- !*** ./Cameras/index.ts ***!
- \**************************/
- /*! exports provided: CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FollowCameraKeyboardMoveInput, FollowCameraMouseWheelInput, FollowCameraPointersInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, OnAfterEnteringVRObservableEvent, VRExperienceHelper, WebVRFreeCamera, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager */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 c=r(/*! ./freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts");r.d(t,"FreeCameraInputsManager",function(){return c.FreeCameraInputsManager});var l=r(/*! ./touchCamera */"./Cameras/touchCamera.ts");r.d(t,"TouchCamera",function(){return l.TouchCamera});var u=r(/*! ./arcRotateCamera */"./Cameras/arcRotateCamera.ts");r.d(t,"ArcRotateCamera",function(){return u.ArcRotateCamera});var h=r(/*! ./arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts");r.d(t,"ArcRotateCameraInputsManager",function(){return h.ArcRotateCameraInputsManager});var d=r(/*! ./deviceOrientationCamera */"./Cameras/deviceOrientationCamera.ts");r.d(t,"DeviceOrientationCamera",function(){return d.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 g=r(/*! ./followCamera */"./Cameras/followCamera.ts");r.d(t,"FollowCamera",function(){return g.FollowCamera}),r.d(t,"ArcFollowCamera",function(){return g.ArcFollowCamera});var m=r(/*! ./gamepadCamera */"./Cameras/gamepadCamera.ts");r.d(t,"GamepadCamera",function(){return m.GamepadCamera});var _=r(/*! ./Stereoscopic/index */"./Cameras/Stereoscopic/index.ts");r.d(t,"AnaglyphArcRotateCamera",function(){return _.AnaglyphArcRotateCamera}),r.d(t,"AnaglyphFreeCamera",function(){return _.AnaglyphFreeCamera}),r.d(t,"AnaglyphGamepadCamera",function(){return _.AnaglyphGamepadCamera}),r.d(t,"AnaglyphUniversalCamera",function(){return _.AnaglyphUniversalCamera}),r.d(t,"StereoscopicArcRotateCamera",function(){return _.StereoscopicArcRotateCamera}),r.d(t,"StereoscopicFreeCamera",function(){return _.StereoscopicFreeCamera}),r.d(t,"StereoscopicGamepadCamera",function(){return _.StereoscopicGamepadCamera}),r.d(t,"StereoscopicUniversalCamera",function(){return _.StereoscopicUniversalCamera});var v=r(/*! ./universalCamera */"./Cameras/universalCamera.ts");r.d(t,"UniversalCamera",function(){return v.UniversalCamera});var A=r(/*! ./virtualJoysticksCamera */"./Cameras/virtualJoysticksCamera.ts");r.d(t,"VirtualJoysticksCamera",function(){return A.VirtualJoysticksCamera});var y=r(/*! ./VR/index */"./Cameras/VR/index.ts");r.d(t,"VRCameraMetrics",function(){return y.VRCameraMetrics}),r.d(t,"VRDeviceOrientationArcRotateCamera",function(){return y.VRDeviceOrientationArcRotateCamera}),r.d(t,"VRDeviceOrientationFreeCamera",function(){return y.VRDeviceOrientationFreeCamera}),r.d(t,"VRDeviceOrientationGamepadCamera",function(){return y.VRDeviceOrientationGamepadCamera}),r.d(t,"OnAfterEnteringVRObservableEvent",function(){return y.OnAfterEnteringVRObservableEvent}),r.d(t,"VRExperienceHelper",function(){return y.VRExperienceHelper}),r.d(t,"WebVRFreeCamera",function(){return y.WebVRFreeCamera});var b=r(/*! ./XR/index */"./Cameras/XR/index.ts");r.d(t,"WebXRCamera",function(){return b.WebXRCamera}),r.d(t,"WebXREnterExitUIButton",function(){return b.WebXREnterExitUIButton}),r.d(t,"WebXREnterExitUIOptions",function(){return b.WebXREnterExitUIOptions}),r.d(t,"WebXREnterExitUI",function(){return b.WebXREnterExitUI}),r.d(t,"WebXRState",function(){return b.WebXRState}),r.d(t,"WebXRExperienceHelper",function(){return b.WebXRExperienceHelper}),r.d(t,"WebXRController",function(){return b.WebXRController}),r.d(t,"WebXRInput",function(){return b.WebXRInput}),r.d(t,"WebXRManagedOutputCanvas",function(){return b.WebXRManagedOutputCanvas}),r.d(t,"WebXRSessionManager",function(){return b.WebXRSessionManager})},"./Cameras/targetCamera.ts":
- /*!*********************************!*\
- !*** ./Cameras/targetCamera.ts ***!
- \*********************************/
- /*! exports provided: TargetCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"TargetCamera",function(){return a});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 */"./Maths/math.ts"),a=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.cameraDirection=new s.Vector3(0,0,0),o.cameraRotation=new s.Vector2(0,0),o.updateUpVectorFromRotation=!1,o._tmpQuaternion=new s.Quaternion,o.rotation=new s.Vector3(0,0,0),o.speed=2,o.noRotationConstraint=!1,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._globalCurrentTarget=s.Vector3.Zero(),o._globalCurrentUpVector=s.Vector3.Zero(),o._defaultUp=s.Vector3.Up(),o._cachedRotationZ=0,o._cachedQuaternionRotationZ=0,o}return 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+=s.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.Tmp.Matrix[0]),s.Vector3.TransformNormalToRef(this.cameraDirection,s.Tmp.Matrix[0],s.Tmp.Vector3[0]),void this.position.addInPlace(s.Tmp.Vector3[0]);this.position.addInPlace(this.cameraDirection)},t.prototype._checkInputs=function(){var t=this._decideIfNeedsToMove(),r=Math.abs(this.cameraRotation.x)>0||Math.abs(this.cameraRotation.y)>0;if(t&&this._updatePosition(),r){if(this.rotation.x+=this.cameraRotation.x,this.rotation.y+=this.cameraRotation.y,this.rotationQuaternion)this.rotation.lengthSquared()&&s.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion);if(!this.noRotationConstraint){var n=Math.PI/2*.95;this.rotation.x>n&&(this.rotation.x=n),this.rotation.x<-n&&(this.rotation.x=-n)}}t&&(Math.abs(this.cameraDirection.x)<this.speed*s.Epsilon&&(this.cameraDirection.x=0),Math.abs(this.cameraDirection.y)<this.speed*s.Epsilon&&(this.cameraDirection.y=0),Math.abs(this.cameraDirection.z)<this.speed*s.Epsilon&&(this.cameraDirection.z=0),this.cameraDirection.scaleInPlace(this.inertia)),r&&(Math.abs(this.cameraRotation.x)<this.speed*s.Epsilon&&(this.cameraRotation.x=0),Math.abs(this.cameraRotation.y)<this.speed*s.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?s.Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(s.Quaternion.FromEulerVectorToRef(this.rotation,this._tmpQuaternion),s.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.parent){var n=this.parent.getWorldMatrix();s.Vector3.TransformCoordinatesToRef(e,n,this._globalPosition),s.Vector3.TransformCoordinatesToRef(t,n,this._globalCurrentTarget),s.Vector3.TransformNormalToRef(r,n,this._globalCurrentUpVector),this._markSyncedWithParent()}else this._globalPosition.copyFrom(e),this._globalCurrentTarget.copyFrom(t),this._globalCurrentUpVector.copyFrom(r);this.getScene().useRightHandedSystem?s.Matrix.LookAtRHToRef(this._globalPosition,this._globalCurrentTarget,this._globalCurrentUpVector,this._viewMatrix):s.Matrix.LookAtLHToRef(this._globalPosition,this._globalCurrentTarget,this._globalCurrentUpVector,this._viewMatrix)},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 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: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.RotationY(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,n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"rotation",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"speed",void 0),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 */"./Maths/math.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 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:!0,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:!0,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 c});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 */"./Maths/math.ts"),a=r(/*! ./camera */"./Cameras/camera.ts");o.Node.AddNodeConstructor("FreeCamera",function(e,t){return function(){return new c(e,s.Vector3.Zero(),t)}});var c=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;return i.inputs.addGamepad(),i}return 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:!0,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:!0,configurable:!0}),t.prototype.getClassName=function(){return"UniversalCamera"},t}(i.TouchCamera);a.Camera._createDefaultParsedCamera=function(e,t){return new c(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 */"./Maths/math.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 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 s});var n,i=r(/*! ../Maths/math */"./Maths/math.ts"),o=(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),c=(-t+s)/(2*e);if(a>c){var l=c;c=a,a=l}return a>0&&a<i?(n.root=a,n.found=!0,n):c>0&&c<i?(n.root=c,n.found=!0,n):n}),s=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:!0,configurable:!0}),Object.defineProperty(e.prototype,"slidePlaneNormal",{get:function(){return this._slidePlaneNormal},enumerable:!0,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,s,a){var c,l=!1;t||(t=[]),t[e]||(t[e]=new i.Plane(0,0,0,0),t[e].copyFromPoints(r,n,s));var u=t[e];if(a||u.isFrontFacingTo(this._normalizedVelocity,0)){var h=u.signedDistanceTo(this._basePoint),d=i.Vector3.Dot(u.normal,this._velocity);if(0==d){if(Math.abs(h)>=1)return;l=!0,c=0}else{var f=(1-h)/d;if((c=(-1-h)/d)>f){var p=f;f=c,c=p}if(c>1||f<0)return;c<0&&(c=0),c>1&&(c=1)}this._collisionPoint.copyFromFloats(0,0,0);var g=!1,m=1;if(l||(this._basePoint.subtractToRef(u.normal,this._planeIntersectionPoint),this._velocity.scaleToRef(c,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,r,n,s,u.normal)&&(g=!0,m=c,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!g){var _=this._velocity.lengthSquared(),v=_;this._basePoint.subtractToRef(r,this._tempVector);var A=2*i.Vector3.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,b=o(v,A,y,m);b.found&&(m=b.root,g=!0,this._collisionPoint.copyFrom(r)),this._basePoint.subtractToRef(n,this._tempVector),A=2*i.Vector3.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(b=o(v,A,y,m)).found&&(m=b.root,g=!0,this._collisionPoint.copyFrom(n)),this._basePoint.subtractToRef(s,this._tempVector),A=2*i.Vector3.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(b=o(v,A,y,m)).found&&(m=b.root,g=!0,this._collisionPoint.copyFrom(s)),n.subtractToRef(r,this._edge),r.subtractToRef(this._basePoint,this._baseToVertex);var T=this._edge.lengthSquared(),E=i.Vector3.Dot(this._edge,this._velocity),x=i.Vector3.Dot(this._edge,this._baseToVertex);if(v=T*-_+E*E,A=T*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=o(v,A,y,m)).found){var C=(E*b.root-x)/T;C>=0&&C<=1&&(m=b.root,g=!0,this._edge.scaleInPlace(C),r.addToRef(this._edge,this._collisionPoint))}s.subtractToRef(n,this._edge),n.subtractToRef(this._basePoint,this._baseToVertex),T=this._edge.lengthSquared(),E=i.Vector3.Dot(this._edge,this._velocity),x=i.Vector3.Dot(this._edge,this._baseToVertex),v=T*-_+E*E,A=T*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=o(v,A,y,m)).found&&(C=(E*b.root-x)/T)>=0&&C<=1&&(m=b.root,g=!0,this._edge.scaleInPlace(C),n.addToRef(this._edge,this._collisionPoint)),r.subtractToRef(s,this._edge),s.subtractToRef(this._basePoint,this._baseToVertex),T=this._edge.lengthSquared(),E=i.Vector3.Dot(this._edge,this._velocity),x=i.Vector3.Dot(this._edge,this._baseToVertex),v=T*-_+E*E,A=T*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=o(v,A,y,m)).found&&(C=(E*b.root-x)/T)>=0&&C<=1&&(m=b.root,g=!0,this._edge.scaleInPlace(C),s.addToRef(this._edge,this._collisionPoint))}if(g){var P=m*this._velocity.length();(!this.collisionFound||P<this._nearestDistance)&&(this.intersectionPoint?this.intersectionPoint.copyFrom(this._collisionPoint):this.intersectionPoint=this._collisionPoint.clone(),this._nearestDistance=P,this.collisionFound=!0)}}},e.prototype._collide=function(e,t,r,n,i,o,s){for(var a=n;a<i;a+=3){var c=t[r[a]-o],l=t[r[a+1]-o],u=t[r[a+2]-o];this._testTriangle(a,e,u,l,c,s)}},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(i.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 */"./Maths/math.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 c=s?s.collisionMask:r.collisionMask;r._initialize(e,t,a);for(var l=0;l<this._scene.meshes.length;l++){var u=this._scene.meshes[l];u.isEnabled()&&u.checkCollisions&&u.subMeshes&&u!==s&&0!=(c&u.collisionGroup)&&u._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 */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})},"./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(){return function(e,t,r){this.bu=e,this.bv=t,this.distance=r,this.faceId=0,this.subMeshId=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 */"./Maths/math.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.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]),c=n.Vector3.FromArray(s,3*o[3*this.faceId+1]),l=n.Vector3.FromArray(s,3*o[3*this.faceId+2]);a=a.scale(this.bu),c=c.scale(this.bv),l=l.scale(1-this.bu-this.bv),r=new n.Vector3(a.x+c.x+l.x,a.y+c.y+l.y,a.z+c.z+l.z)}else{var u=this.pickedMesh.getVerticesData(i.VertexBuffer.PositionKind),h=n.Vector3.FromArray(u,3*o[3*this.faceId]),d=n.Vector3.FromArray(u,3*o[3*this.faceId+1]),f=n.Vector3.FromArray(u,3*o[3*this.faceId+2]),p=h.subtract(d),g=f.subtract(d);r=n.Vector3.Cross(p,g)}if(e){var m=this.pickedMesh.getWorldMatrix();this.pickedMesh.nonUniformScaling&&(n.Tmp.Matrix[0].copyFrom(m),(m=n.Tmp.Matrix[0]).setTranslationFromFloats(0,0,0),m.invert(),m.transposeToRef(n.Tmp.Matrix[1]),m=n.Tmp.Matrix[1]),r=n.Vector3.TransformNormal(r,m)}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(1-this.bu-this.bv),o=o.scale(this.bu),s=s.scale(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 */"./Maths/math.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"minPoint",{get:function(){return this._minPoint},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxPoint",{get:function(){return this._maxPoint},enumerable:!0,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,c,l){c.blocks=new Array;for(var u=new n.Vector3((r.x-t.x)/2,(r.y-t.y)/2,(r.z-t.z)/2),h=0;h<2;h++)for(var d=0;d<2;d++)for(var f=0;f<2;f++){var p=new e(t.add(u.multiplyByFloats(h,d,f)),t.add(u.multiplyByFloats(h+1,d+1,f+1)),o,s+1,a,l);p.addEntries(i),c.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 l});var n=r(/*! ../../scene */"./scene.ts"),i=r(/*! ../../Maths/math */"./Maths/math.ts"),o=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../../Culling/ray */"./Culling/ray.ts"),a=r(/*! ../../sceneComponent */"./sceneComponent.ts"),c=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 l(this),this._addComponent(r)),this._selectionOctree||(this._selectionOctree=new c.Octree(c.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 l(r),r._addComponent(n)),this._submeshesOctree||(this._submeshesOctree=new c.Octree(c.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 l=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 o});var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=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,c=t.y,l=t.z,u=this.vectors;this.minimum.copyFromFloats(n,o,s),this.maximum.copyFromFloats(a,c,l),u[0].copyFromFloats(n,o,s),u[1].copyFromFloats(a,c,l),u[2].copyFromFloats(a,o,s),u[3].copyFromFloats(n,c,s),u[4].copyFromFloats(n,o,l),u[5].copyFromFloats(a,c,s),u[6].copyFromFloats(n,c,l),u[7].copyFromFloats(a,o,l),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._update(r||i.Matrix.IdentityReadOnly)},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]),c=this.center.addToRef(s,r[2]);return this.reConstruct(a,c,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()){t.copyFrom(this.minimum),r.copyFrom(this.maximum);for(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 c=o[a];i.Vector3.TransformCoordinatesToRef(s[a],e,c),t.minimizeInPlace(c),r.maximizeInPlace(c)}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,o=t.y,s=t.z,a=r.x,c=r.y,l=r.z,u=e.x,h=e.y,d=e.z,f=-i.Epsilon;return!(a-u<f||f>u-n)&&(!(c-h<f||f>h-o)&&!(l-d<f||f>d-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,c=n.y,l=n.z,u=e.x,h=e.y,d=e.z,f=t.x,p=t.y,g=t.z;return!(a<u||i>f)&&(!(c<h||o>p)&&!(l<d||s>g))},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 d});var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=r(/*! ./boundingBox */"./Culling/boundingBox.ts"),a=r(/*! ./boundingSphere */"./Culling/boundingSphere.ts"),c={min:0,max:0},l={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},h=function(e,t,r){return u(e,t,c),u(e,r,l),!(c.min>l.max||l.min>c.max)},d=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:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximum",{get:function(){return this.boundingBox.maximum},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLocked",{get:function(){return this._isLocked},set:function(e){this._isLocked=e},enumerable:!0,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:!0,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!!h(r.directions[0],r,n)&&(!!h(r.directions[1],r,n)&&(!!h(r.directions[2],r,n)&&(!!h(n.directions[0],r,n)&&(!!h(n.directions[1],r,n)&&(!!h(n.directions[2],r,n)&&(!!h(i.Vector3.Cross(r.directions[0],n.directions[0]),r,n)&&(!!h(i.Vector3.Cross(r.directions[0],n.directions[1]),r,n)&&(!!h(i.Vector3.Cross(r.directions[0],n.directions[2]),r,n)&&(!!h(i.Vector3.Cross(r.directions[1],n.directions[0]),r,n)&&(!!h(i.Vector3.Cross(r.directions[1],n.directions[1]),r,n)&&(!!h(i.Vector3.Cross(r.directions[1],n.directions[2]),r,n)&&(!!h(i.Vector3.Cross(r.directions[2],n.directions[0]),r,n)&&(!!h(i.Vector3.Cross(r.directions[2],n.directions[1]),r,n)&&!!h(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 */"./Maths/math.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, Ray, Octree, OctreeBlock, OctreeSceneComponent */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 l});var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),s=r(/*! ../Collisions/intersectionInfo */"./Collisions/intersectionInfo.ts"),a=r(/*! ../scene */"./scene.ts"),c=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),l=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,c=e.TmpVector3[0].copyFromFloats(t.x-n,t.y-n,t.z-n),l=e.TmpVector3[1].copyFromFloats(r.x+n,r.y+n,r.z+n),u=0,h=Number.MAX_VALUE;if(Math.abs(this.direction.x)<1e-7){if(this.origin.x<c.x||this.origin.x>l.x)return!1}else if(i=1/this.direction.x,o=(c.x-this.origin.x)*i,(s=(l.x-this.origin.x)*i)===-1/0&&(s=1/0),o>s&&(a=o,o=s,s=a),(u=Math.max(o,u))>(h=Math.min(s,h)))return!1;if(Math.abs(this.direction.y)<1e-7){if(this.origin.y<c.y||this.origin.y>l.y)return!1}else if(i=1/this.direction.y,o=(c.y-this.origin.y)*i,(s=(l.y-this.origin.y)*i)===-1/0&&(s=1/0),o>s&&(a=o,o=s,s=a),(u=Math.max(o,u))>(h=Math.min(s,h)))return!1;if(Math.abs(this.direction.z)<1e-7){if(this.origin.z<c.z||this.origin.z>l.z)return!1}else if(i=1/this.direction.z,o=(c.z-this.origin.z)*i,(s=(l.z-this.origin.z)*i)===-1/0&&(s=1/0),o>s&&(a=o,o=s,s=a),(u=Math.max(o,u))>(h=Math.min(s,h)))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 c=r*this.direction.x+n*this.direction.y+i*this.direction.z;return!(c<0)&&o-c*c<=a},e.prototype.intersectsTriangle=function(t,r,n){var o=e.TmpVector3[0],a=e.TmpVector3[1],c=e.TmpVector3[2],l=e.TmpVector3[3],u=e.TmpVector3[4];r.subtractToRef(t,o),n.subtractToRef(t,a),i.Vector3.CrossToRef(this.direction,a,c);var h=i.Vector3.Dot(o,c);if(0===h)return null;var d=1/h;this.origin.subtractToRef(t,l);var f=i.Vector3.Dot(l,c)*d;if(f<0||f>1)return null;i.Vector3.CrossToRef(l,o,u);var p=i.Vector3.Dot(this.direction,u)*d;if(p<0||f+p>1)return null;var g=i.Vector3.Dot(a,u)*d;return g>this.length?null:new s.IntersectionInfo(f,p,g)},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.intersectsMesh=function(t,r){var n=i.Tmp.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.Tmp.Vector3[0],a=i.Tmp.Vector3[1],c=i.Tmp.Vector3[2],l=i.Tmp.Vector3[3];r.subtractToRef(t,s),this.direction.scaleToRef(e.rayl,c),o.addToRef(c,a),t.subtractToRef(o,l);var u,h,d,f,p=i.Vector3.Dot(s,s),g=i.Vector3.Dot(s,c),m=i.Vector3.Dot(c,c),_=i.Vector3.Dot(s,l),v=i.Vector3.Dot(c,l),A=p*m-g*g,y=A,b=A;A<e.smallnum?(h=0,y=1,f=v,b=m):(f=p*v-g*_,(h=g*v-m*_)<0?(h=0,f=v,b=m):h>y&&(h=y,f=v+g,b=m)),f<0?(f=0,-_<0?h=0:-_>p?h=y:(h=-_,y=p)):f>b&&(f=b,-_+g<0?h=0:-_+g>p?h=y:(h=-_+g,y=p)),u=Math.abs(h)<e.smallnum?0:h/y,d=Math.abs(f)<e.smallnum?0:f/b;var T=i.Tmp.Vector3[4];c.scaleToRef(d,T);var E=i.Tmp.Vector3[5];s.scaleToRef(u,E),E.addInPlace(l);var x=i.Tmp.Vector3[6];return E.subtractToRef(T,x),d>0&&d<=this.length&&x.lengthSquared()<n*n?E.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 c=i.Tmp.Matrix[0];o.multiplyToRef(s,c),c.multiplyToRef(a,c),c.invert();var l=i.Tmp.Vector3[0];l.x=e/r*2-1,l.y=-(t/n*2-1),l.z=-1;var u=i.Tmp.Vector3[1].copyFromFloats(l.x,l.y,1),h=i.Tmp.Vector3[2],d=i.Tmp.Vector3[3];i.Vector3._UnprojectFromInvertedMatrixToRef(l,c,h),i.Vector3._UnprojectFromInvertedMatrixToRef(u,c,d),this.origin.copyFrom(h),d.subtractToRef(h,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=l.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)throw new Error("Active camera not set");o=this.activeCamera}var c=o.viewport.toGlobal(a.getRenderWidth(),a.getRenderHeight());return e=e/a.getHardwareScalingLevel()-c.x,t=t/a.getHardwareScalingLevel()-(a.getRenderHeight()-c.y-c.height),n.update(e,t,c.width,c.height,r||i.Matrix.IdentityReadOnly,s?i.Matrix.IdentityReadOnly:o.getViewMatrix(),o.getProjectionMatrix()),this},a.Scene.prototype.createPickingRayInCameraSpace=function(e,t,r){var n=l.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()),c=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,c,c,n.getProjectionMatrix()),this},a.Scene.prototype._internalPick=function(e,t,r,n){if(!o.PickingInfo)return null;for(var i=null,s=0;s<this.meshes.length;s++){var a=this.meshes[s];if(t){if(!t(a))continue}else if(!a.isEnabled()||!a.isVisible||!a.isPickable)continue;var c=e(a.getWorldMatrix()),l=a.intersects(c,r,n);if(l&&l.hit&&((r||null==i||!(l.distance>=i.distance))&&(i=l,r)))break}return i||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()),c=s.intersects(a,!1,r);c&&c.hit&&n.push(c)}return n},a.Scene.prototype.pick=function(e,t,r,n,s,a){var c=this;if(!o.PickingInfo)return null;var u=this._internalPick(function(r){return c._tempPickingRay||(c._tempPickingRay=l.Zero()),c.createPickingRayToRef(e,t,r,c._tempPickingRay,s||null),c._tempPickingRay},r,n,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=l.Zero()),l.TransformToRef(e,o._pickWithRayInverseMatrix,o._cachedRayForTransform),o._cachedRayForTransform},t,r,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=l.Zero()),l.TransformToRef(e,n._pickWithRayInverseMatrix,n._cachedRayForTransform),n._cachedRayForTransform},t,r)},c.Camera.prototype.getForwardRay=function(e,t,r){void 0===e&&(e=100),t||(t=this.getWorldMatrix()),r||(r=this.position);var n=this._scene.useRightHandedSystem?new i.Vector3(0,0,-1):new i.Vector3(0,0,1),o=i.Vector3.TransformNormal(n,t),s=i.Vector3.Normalize(o);return new l(r,s,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 s});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),o=r(/*! ../Gizmos/axisDragGizmo */"./Gizmos/axisDragGizmo.ts"),s=function(){function e(t,r,s,a,c,l){if(void 0===r&&(r=1),void 0===s&&(s=2),this._scaleLinesFactor=4,this._instanced=!1,this.scaleLines=1,this.scaleLines=r,!a){var u=new i.StandardMaterial("",t);u.disableLighting=!0,u.emissiveColor=n.Color3.Red().scale(.5),a=o.AxisDragGizmo._CreateArrow(t,u)}if(!c){var h=new i.StandardMaterial("",t);h.disableLighting=!0,h.emissiveColor=n.Color3.Green().scale(.5),c=o.AxisDragGizmo._CreateArrow(t,h)}if(!l){var d=new i.StandardMaterial("",t);d.disableLighting=!0,d.emissiveColor=n.Color3.Blue().scale(.5),l=o.AxisDragGizmo._CreateArrow(t,d)}this._xAxis=a,this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis=c,this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis=l,this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),null!=s&&(e._SetRenderingGroupId(this._xAxis,s),e._SetRenderingGroupId(this._yAxis,s),e._SetRenderingGroupId(this._zAxis,s)),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:!0,configurable:!0}),Object.defineProperty(e.prototype,"yAxis",{get:function(){return this._yAxis},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zAxis",{get:function(){return this._zAxis},enumerable:!0,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 s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Debug/axesViewer */"./Debug/axesViewer.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=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 n.__extends(t,e),t.prototype.update=function(){if(this.mesh&&this.bone){var t=this.bone;t.getAbsolutePositionToRef(this.mesh,this.pos),t.getDirectionToRef(o.Axis.X,this.mesh,this.xaxis),t.getDirectionToRef(o.Axis.Y,this.mesh,this.yaxis),t.getDirectionToRef(o.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: DebugLayer */function(e,t,r){"use strict";r.r(t),r.d(t,"DebugLayer",function(){return c});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(/*! ../scene */"./scene.ts"),a=r(/*! ../Engines/engine */"./Engines/engine.ts");Object.defineProperty(s.Scene.prototype,"debugLayer",{get:function(){return this._debugLayer||(this._debugLayer=new c(this)),this._debugLayer},enumerable:!0,configurable:!0});var c=function(){function e(e){var t=this;this.BJSINSPECTOR=this._getGlobalInspector(),this.onPropertyChangedObservable=new o.Observable,this._scene=e,this._scene.onDisposeObservable.add(function(){t._scene._debugLayer&&t._scene._debugLayer.hide()})}return e.prototype._createInspector=function(e){if(!this.isVisible()){var t=n.__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,t)}},e.prototype.select=function(e,t){this.BJSINSPECTOR&&(this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(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.show=function(t){var r=this;return new Promise(function(n,o){if(void 0===r.BJSINSPECTOR){var s=t&&t.inspectorURL?t.inspectorURL:e.InspectorURL;i.Tools.LoadScript(s,function(){r._createInspector(t),n(r)})}else r._createInspector(t),n(r)})},e.InspectorURL="https://unpkg.com/babylonjs-inspector@"+a.Engine.Version+"/babylon.inspector.bundle.js",e}()},"./Debug/index.ts":
- /*!************************!*\
- !*** ./Debug/index.ts ***!
- \************************/
- /*! exports provided: AxesViewer, BoneAxesViewer, 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,"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 c=r(/*! ./skeletonViewer */"./Debug/skeletonViewer.ts");r.d(t,"SkeletonViewer",function(){return c.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 h});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 */"./Maths/math.ts"),a=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),c=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),l=r(/*! ../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),u=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=function(){function e(e){this._impostors=[],this._meshes=[],this._numMeshes=0,this._debugMeshMeshes=new Array,this._scene=e||a.EngineStore.LastCreatedScene;var t=this._scene.getPhysicsEngine();t&&(this._physicsEnginePlugin=t.getPhysicsPlugin()),this._utilityLayer=new u.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===l.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=s.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._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){if(!this._utilityLayer)return null;var r=null,n=this._utilityLayer.utilityLayerScene;switch(e.type){case l.PhysicsImpostor.BoxImpostor:r=this._getDebugBoxMesh(n),e.getBoxSizeToRef(r.scaling);break;case l.PhysicsImpostor.SphereImpostor:r=this._getDebugSphereMesh(n);var i=e.getRadius();r.scaling.x=2*i,r.scaling.y=2*i,r.scaling.z=2*i;break;case l.PhysicsImpostor.MeshImpostor:t&&(r=this._getDebugMeshMesh(t,n))}return r},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._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 */"./Maths/math.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._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 s});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),o=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),s=function(){function e(e,t,r,i,s){void 0===i&&(i=!0),void 0===s&&(s=1),this.skeleton=e,this.mesh=t,this.autoUpdateBonesMatrices=i,this.renderingGroupId=s,this.color=n.Color3.White(),this._debugLines=new Array,this._isEnabled=!1,this._scene=r,this._utilityLayer=new o.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,e?this._scene.registerBeforeRender(this._renderFunction):this._scene.unregisterBeforeRender(this._renderFunction))},enumerable:!0,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.Tmp.Matrix[0],c=t.getParent();if(a.copyFrom(t.getLocalMatrix()),0!==i||0!==o||0!==s){var l=n.Tmp.Matrix[1];n.Matrix.IdentityToRef(l),l.setTranslationFromFloats(i,o,s),l.multiplyToRef(a,a)}c&&a.multiplyToRef(c.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.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.position,s=r-1;s>=0;s--){var a=e[s],c=a.getParent();if(c){var l=this._debugLines[i];l||(l=[n.Vector3.Zero(),n.Vector3.Zero()],this._debugLines[i]=l),a.getAbsolutePositionToRef(this.mesh,l[0]),c.getAbsolutePositionToRef(this.mesh,l[1]),l[0].subtractInPlace(o),l[1].subtractInPlace(o),i++}}},e.prototype.update=function(){if(this._utilityLayer){this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteTransforms(),void 0===this.skeleton.bones[0].length?this._getLinesForBonesNoLength(this.skeleton.bones,this.mesh.getWorldMatrix()):this._getLinesForBonesWithLength(this.skeleton.bones,this.mesh.getWorldMatrix());var e=this._utilityLayer.utilityLayerScene;this._debugMesh?i.LinesBuilder.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:this._debugMesh},e):(this._debugMesh=i.LinesBuilder.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:null},e),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}()},"./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(){return 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},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.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)}},"./Engines/Extensions/index.ts":
- /*!*************************************!*\
- !*** ./Engines/Extensions/index.ts ***!
- \*************************************/
- /*! exports provided: _OcclusionDataStorage, _forceTransformFeedbackToBundle */function(e,t,r){"use strict";r.r(t);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})},"./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.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_BILINEAR_SAMPLINGMODE=2,e.TEXTURE_TRILINEAR_SAMPLINGMODE=3,e.TEXTURE_NEAREST_NEAREST_MIPLINEAR=1,e.TEXTURE_LINEAR_LINEAR_MIPNEAREST=2,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=8,e.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,e.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,e.TEXTURE_LINEAR_LINEAR=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.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.PARTICLES_BaseAssetsUrl="https://assets.babylonjs.com/particles",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}()},"./Engines/engine.ts":
- /*!***************************!*\
- !*** ./Engines/engine.ts ***!
- \***************************/
- /*! exports provided: InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine */function(e,t,r){"use strict";r.r(t),r.d(t,"InstancingAttributeInfo",function(){return E}),r.d(t,"DepthTextureCreationOptions",function(){return x}),r.d(t,"EngineCapabilities",function(){return C}),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/performanceMonitor */"./Misc/performanceMonitor.ts"),s=r(/*! ../Misc/stringDictionary */"./Misc/stringDictionary.ts"),a=r(/*! ../Misc/promise */"./Misc/promise.ts"),c=r(/*! ../Misc/tools */"./Misc/tools.ts"),l=r(/*! ../Maths/math */"./Maths/math.ts"),u=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),h=r(/*! ../Materials/effect */"./Materials/effect.ts"),d=r(/*! ../Materials/material */"./Materials/material.ts"),f=r(/*! ../Materials/Textures/internalTextureTracker */"./Materials/Textures/internalTextureTracker.ts"),p=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),g=r(/*! ../States/index */"./States/index.ts"),m=r(/*! ./constants */"./Engines/constants.ts"),_=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),v=r(/*! ../Misc/logger */"./Misc/logger.ts"),A=r(/*! ./engineStore */"./Engines/engineStore.ts"),y=r(/*! ../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),b=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),T=function(){return function(){}}(),E=function(){return function(){}}(),x=function(){return function(){}}(),C=function(){return function(){}}(),P=function(){function e(t,r,n,s){void 0===s&&(s=!1);var u=this;this.forcePOTTextures=!1,this.isFullscreen=!1,this.isPointerLock=!1,this.cullBackFaces=!0,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this.enableOfflineSupport=!1,this.disableManifestCheck=!1,this.scenes=new Array,this.onNewSceneAddedObservable=new i.Observable,this.postProcesses=new Array,this.validateShaderPrograms=!1,this.onResizeObservable=new i.Observable,this.onCanvasBlurObservable=new i.Observable,this.onCanvasFocusObservable=new i.Observable,this.onCanvasPointerOutObservable=new i.Observable,this.onBeforeTextureInitObservable=new i.Observable,this._vrDisplay=void 0,this._vrSupported=!1,this._vrExclusivePointerMode=!1,this.disableUniformBuffers=!1,this._uniformBuffers=new Array,this.onBeginFrameObservable=new i.Observable,this.customAnimationFrameRequester=null,this.onEndFrameObservable=new i.Observable,this.onBeforeShaderCompilationObservable=new i.Observable,this.onAfterShaderCompilationObservable=new i.Observable,this._windowIsBackground=!1,this._webGLVersion=1,this._highPrecisionShadersAllowed=!0,this._badOS=!1,this._badDesktopOS=!1,this.disableTextureBindingOptimization=!1,this.onVRDisplayChangedObservable=new i.Observable,this.onVRRequestPresentComplete=new i.Observable,this.onVRRequestPresentStart=new i.Observable,this._colorWrite=!0,this._drawCalls=new c.PerfCounter,this._textureCollisions=new c.PerfCounter,this._renderingQueueLaunched=!1,this._activeRenderLoops=new Array,this._deterministicLockstep=!1,this._lockstepMaxSteps=4,this.onContextLostObservable=new i.Observable,this.onContextRestoredObservable=new i.Observable,this._contextWasLost=!1,this._doNotHandleContextLost=!1,this._performanceMonitor=new o.PerformanceMonitor,this._fps=60,this._deltaTime=0,this.disablePerformanceMonitorInBackground=!1,this._depthCullingState=new g._DepthCullingState,this._stencilState=new g._StencilState,this._alphaState=new g._AlphaState,this._alphaMode=e.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._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._firstBoundInternalTextureTracker=new f.DummyInternalTextureTracker,this._lastBoundInternalTextureTracker=new f.DummyInternalTextureTracker,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._activeRequests=new Array,this._texturesSupported=new Array,this.premultipliedAlpha=!0,this._viewportCached=new l.Vector4(0,0,0,0),this._onVRFullScreenTriggered=function(){if(u._vrDisplay&&u._vrDisplay.isPresenting){u._oldSize=new l.Size(u.getRenderWidth(),u.getRenderHeight()),u._oldHardwareScaleFactor=u.getHardwareScalingLevel();var e=u._vrDisplay.getEyeParameters("left");u.setHardwareScalingLevel(1),u.setSize(2*e.renderWidth,e.renderHeight)}else u.setHardwareScalingLevel(u._oldHardwareScaleFactor),u.setSize(u._oldSize.width,u._oldSize.height)},this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},a.PromisePolyfill.Apply();var h=null;if(e.Instances.push(this),t){if(n=n||{},t.getContext){if(h=t,this._renderingCanvas=h,null!=r&&(n.antialias=r),void 0===n.deterministicLockstep&&(n.deterministicLockstep=!1),void 0===n.lockstepMaxSteps&&(n.lockstepMaxSteps=4),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),this._deterministicLockstep=n.deterministicLockstep,this._lockstepMaxSteps=n.lockstepMaxSteps,this._doNotHandleContextLost=!!n.doNotHandleContextLost,navigator&&navigator.userAgent)for(var d=navigator.userAgent,p=0,m=e.ExceptionList;p<m.length;p++){var A=m[p],y=A.key,b=A.targets;if(d.indexOf(y)>-1){if(A.capture&&A.captureConstraint){var E=A.capture,x=A.captureConstraint,C=new RegExp(E).exec(d);if(C&&C.length>0)if(parseInt(C[C.length-1])>=x)continue}for(var P=0,M=b;P<M.length;P++){switch(M[P]){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"textureBindingOptimization":this.disableTextureBindingOptimization=!0}}}}if(!n.disableWebGL2Support)try{this._gl=h.getContext("webgl2",n)||h.getContext("experimental-webgl2",n),this._gl&&(this._webGLVersion=2,this._gl.deleteQuery||(this._webGLVersion=1))}catch(e){}if(!this._gl){if(!h)throw new Error("The provided canvas is null or undefined.");try{this._gl=h.getContext("webgl",n)||h.getContext("experimental-webgl",n)}catch(e){throw new Error("WebGL not supported")}}if(!this._gl)throw new Error("WebGL not supported");this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._onCanvasFocus=function(){u.onCanvasFocusObservable.notifyObservers(u)},this._onCanvasBlur=function(){u.onCanvasBlurObservable.notifyObservers(u)},h.addEventListener("focus",this._onCanvasFocus),h.addEventListener("blur",this._onCanvasBlur),this._onBlur=function(){u.disablePerformanceMonitorInBackground&&u._performanceMonitor.disable(),u._windowIsBackground=!0},this._onFocus=function(){u.disablePerformanceMonitorInBackground&&u._performanceMonitor.enable(),u._windowIsBackground=!1},this._onCanvasPointerOut=function(e){u.onCanvasPointerOutObservable.notifyObservers(e)},_.DomManagement.IsWindowObjectExist()&&(window.addEventListener("blur",this._onBlur),window.addEventListener("focus",this._onFocus)),h.addEventListener("pointerout",this._onCanvasPointerOut),this._doNotHandleContextLost||(this._onContextLost=function(e){e.preventDefault(),u._contextWasLost=!0,v.Logger.Warn("WebGL context lost."),u.onContextLostObservable.notifyObservers(u)},this._onContextRestored=function(){setTimeout(function(){u._initGLContext(),u._rebuildEffects(),u._rebuildInternalTextures(),u._rebuildBuffers(),u.wipeCaches(!0),v.Logger.Warn("WebGL context successfully restored."),u.onContextRestoredObservable.notifyObservers(u),u._contextWasLost=!1},0)},h.addEventListener("webglcontextlost",this._onContextLost,!1),h.addEventListener("webglcontextrestored",this._onContextRestored,!1)),n.doNotHandleTouchAction||this._disableTouchAction()}else{this._gl=t,this._renderingCanvas=this._gl.canvas,this._gl.renderbufferStorageMultisample&&(this._webGLVersion=2);var S=this._gl.getContextAttributes();S&&(n.stencil=S.stencil)}void 0!==n.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=n.useHighPrecisionFloats);var R=_.DomManagement.IsWindowObjectExist()&&window.devicePixelRatio||1,O=n.limitDeviceRatio||R;if(this._hardwareScalingLevel=s?1/Math.min(O,R):1,this.resize(),this._isStencilEnable=!!n.stencil,this._initGLContext(),h){var I=document;this._onFullscreenChange=function(){void 0!==I.fullscreen?u.isFullscreen=I.fullscreen:void 0!==I.mozFullScreen?u.isFullscreen=I.mozFullScreen:void 0!==I.webkitIsFullScreen?u.isFullscreen=I.webkitIsFullScreen:void 0!==I.msIsFullScreen&&(u.isFullscreen=I.msIsFullScreen),u.isFullscreen&&u._pointerLockRequested&&h&&(h.requestPointerLock=h.requestPointerLock||h.msRequestPointerLock||h.mozRequestPointerLock||h.webkitRequestPointerLock,h.requestPointerLock&&h.requestPointerLock())},document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",this._onFullscreenChange,!1),this._onPointerLockChange=function(){u.isPointerLock=I.mozPointerLockElement===h||I.webkitPointerLockElement===h||I.msPointerLockElement===h||I.pointerLockElement===h},document.addEventListener("pointerlockchange",this._onPointerLockChange,!1),document.addEventListener("mspointerlockchange",this._onPointerLockChange,!1),document.addEventListener("mozpointerlockchange",this._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",this._onPointerLockChange,!1),this._onVRDisplayPointerRestricted=function(){h&&h.requestPointerLock()},this._onVRDisplayPointerUnrestricted=function(){I.exitPointerLock&&I.exitPointerLock()},_.DomManagement.IsWindowObjectExist()&&(window.addEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted,!1),window.addEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted,!1))}!e.audioEngine&&n.audioEngine&&e.AudioEngineFactory&&(e.audioEngine=e.AudioEngineFactory(this.getRenderingCanvas()));for(var D=0;D<this._caps.maxVertexAttribs;D++)this._currentBufferPointers[D]=new T;this._linkTrackers(this._firstBoundInternalTextureTracker,this._lastBoundInternalTextureTracker),n.autoEnableWebVR&&this.initWebVR(),this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),console.log("Babylon.js v"+e.Version+" - "+this.description),this.enableOfflineSupport=void 0!==e.OfflineProviderFactory}}return Object.defineProperty(e,"Instances",{get:function(){return A.EngineStore.Instances},enumerable:!0,configurable:!0}),Object.defineProperty(e,"LastCreatedEngine",{get:function(){return A.EngineStore.LastCreatedEngine},enumerable:!0,configurable:!0}),Object.defineProperty(e,"LastCreatedScene",{get:function(){return A.EngineStore.LastCreatedScene},enumerable:!0,configurable:!0}),e.MarkAllMaterialsAsDirty=function(t,r){for(var n=0;n<e.Instances.length;n++)for(var i=e.Instances[n],o=0;o<i.scenes.length;o++)i.scenes[o].markAllMaterialsAsDirty(t,r)},Object.defineProperty(e,"NpmPackage",{get:function(){return"babylonjs@4.0.0-alpha.32"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"Version",{get:function(){return"4.0.0-alpha.32"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){var e="WebGL"+this.webGLVersion;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ShadersRepository",{get:function(){return h.Effect.ShadersRepository},set:function(e){h.Effect.ShadersRepository=e},enumerable:!0,configurable:!0}),e.DefaultLoadingScreenFactory=function(e){throw b._DevTools.WarnImport("LoadingScreen")},Object.defineProperty(e.prototype,"isInVRExclusivePointerMode",{get:function(){return this._vrExclusivePointerMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"supportsUniformBuffers",{get:function(){return this.webGLVersion>1&&!this.disableUniformBuffers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_shouldUseHighPrecisionShader",{get:function(){return this._caps.highPrecisionShaderSupported&&this._highPrecisionShadersAllowed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needPOTTextures",{get:function(){return this._webGLVersion<2||this.forcePOTTextures},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doNotHandleContextLost",{get:function(){return this._doNotHandleContextLost},set:function(e){this._doNotHandleContextLost=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"performanceMonitor",{get:function(){return this._performanceMonitor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"texturesSupported",{get:function(){return this._texturesSupported},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureFormatInUse",{get:function(){return this._textureFormatInUse},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentViewport",{get:function(){return this._cachedViewport},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture",{get:function(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,e.TEXTUREFORMAT_RGBA,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture3D",{get:function(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,e.TEXTUREFORMAT_RGBA,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture3D},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyCubeTexture",{get:function(){if(!this._emptyCubeTexture){var t=new Uint8Array(4),r=[t,t,t,t,t,t];this._emptyCubeTexture=this.createRawCubeTexture(r,1,e.TEXTUREFORMAT_RGBA,e.TEXTURETYPE_UNSIGNED_INT,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)}return this._emptyCubeTexture},enumerable:!0,configurable:!0}),e.prototype._disableTouchAction=function(){this._renderingCanvas&&(this._renderingCanvas.setAttribute("touch-action","none"),this._renderingCanvas.style.touchAction="none",this._renderingCanvas.style.msTouchAction="none")},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()}h.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.scenes;e<t.length;e++){var r=t[e];r.resetCachedMaterial(),r._rebuildGeometries(),r._rebuildTextures()}for(var n=0,i=this._uniformBuffers;n<i.length;n++){i[n]._rebuild()}},e.prototype._initGLContext=function(){this._caps=new C,this._caps.maxTexturesImageUnits=this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),this._caps.maxCombinedTexturesImageUnits=this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._caps.maxVertexTextureImageUnits=this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this._caps.maxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._caps.maxCubemapTextureSize=this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),this._caps.maxRenderTextureSize=this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),this._caps.maxVertexAttribs=this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),this._caps.maxVaryingVectors=this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),this._caps.maxFragmentUniformVectors=this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),this._caps.maxVertexUniformVectors=this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),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"),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.standardDerivatives=this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),this._caps.astc=this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),this._caps.s3tc=this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),this._caps.pvrtc=this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this._caps.etc1=this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),this._caps.etc2=this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),this._caps.textureAnisotropicFilterExtension=this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.uintIndices=this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),this._caps.fragmentDepthSupported=this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),this._caps.highPrecisionShaderSupported=!1,this._caps.timerQuery=this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),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.colorBufferFloat=this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float"),this._caps.textureFloat=!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloat=!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._webGLVersion>1&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._caps.textureLOD=!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),this._caps.multiview=this._gl.getExtension("WEBGL_multiview"),this._webGLVersion>1)this._caps.drawBuffersExtension=!0;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"]}else this._caps.drawBuffersExtension=!1}if(this._caps.parallelShaderCompile=this._gl.getExtension("KHR_parallel_shader_compile"),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._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)):this._caps.vertexArrayObject=!1}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._caps.astc&&this.texturesSupported.push("-astc.ktx"),this._caps.s3tc&&this.texturesSupported.push("-dxt.ktx"),this._caps.pvrtc&&this.texturesSupported.push("-pvrtc.ktx"),this._caps.etc2&&this.texturesSupported.push("-etc2.ktx"),this._caps.etc1&&this.texturesSupported.push("-etc1.ktx"),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)}this.setDepthBuffer(!0),this.setDepthFunctionToLessOrEqual(),this.setDepthWrite(!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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStencilEnable",{get:function(){return this._isStencilEnable},enumerable:!0,configurable:!0}),e.prototype._prepareWorkingCanvas=function(){if(!this._workingCanvas){this._workingCanvas=document.createElement("canvas");var e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}},e.prototype.resetTextureCache=function(){for(var e in this._boundTexturesCache)if(this._boundTexturesCache.hasOwnProperty(e)){var t=this._boundTexturesCache[e];t&&this._removeDesignatedSlot(t),this._boundTexturesCache[e]=null}if(!this.disableTextureBindingOptimization){this._nextFreeTextureSlots=[];for(var r=0;r<this._maxSimultaneousTextures;r++)this._nextFreeTextureSlots.push(r)}this._currentTextureChannel=-1},e.prototype.isDeterministicLockStep=function(){return this._deterministicLockstep},e.prototype.getLockstepMaxSteps=function(){return this._lockstepMaxSteps},e.prototype.getGlInfo=function(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}},e.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)},e.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},e.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._gl.drawingBufferWidth},e.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._gl.drawingBufferHeight},e.prototype.getRenderingCanvas=function(){return this._renderingCanvas},e.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},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.getDepthFunction=function(){return this._depthCullingState.depthFunc},e.prototype.setDepthFunction=function(e){this._depthCullingState.depthFunc=e},e.prototype.setDepthFunctionToGreater=function(){this._depthCullingState.depthFunc=this._gl.GREATER},e.prototype.setDepthFunctionToGreaterOrEqual=function(){this._depthCullingState.depthFunc=this._gl.GEQUAL},e.prototype.setDepthFunctionToLess=function(){this._depthCullingState.depthFunc=this._gl.LESS},e.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()},e.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)},e.prototype.setDepthFunctionToLessOrEqual=function(){this._depthCullingState.depthFunc=this._gl.LEQUAL},e.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},e.prototype.setStencilBuffer=function(e){this._stencilState.stencilTest=e},e.prototype.getStencilMask=function(){return this._stencilState.stencilMask},e.prototype.setStencilMask=function(e){this._stencilState.stencilMask=e},e.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},e.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},e.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},e.prototype.setStencilFunction=function(e){this._stencilState.stencilFunc=e},e.prototype.setStencilFunctionReference=function(e){this._stencilState.stencilFuncRef=e},e.prototype.setStencilFunctionMask=function(e){this._stencilState.stencilFuncMask=e},e.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},e.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},e.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},e.prototype.setStencilOperationFail=function(e){this._stencilState.stencilOpStencilFail=e},e.prototype.setStencilOperationDepthFail=function(e){this._stencilState.stencilOpDepthFail=e},e.prototype.setStencilOperationPass=function(e){this._stencilState.stencilOpStencilDepthPass=e},e.prototype.setDitheringState=function(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)},e.prototype.setRasterizerState=function(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)},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.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=c.Tools.QueueNewFrame(this.customAnimationFrameRequester.renderFunction||this._bindedRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._vrDisplay&&this._vrDisplay.isPresenting?this._frameHandler=c.Tools.QueueNewFrame(this._bindedRenderFunction,this._vrDisplay):this._frameHandler=c.Tools.QueueNewFrame(this._bindedRenderFunction):this._renderingQueueLaunched=!1},e.prototype.runRenderLoop=function(e){-1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._bindedRenderFunction=this._renderLoop.bind(this),this._frameHandler=c.Tools.QueueNewFrame(this._bindedRenderFunction)))},e.prototype.switchFullscreen=function(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)},e.prototype.enterFullscreen=function(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&c.Tools.RequestFullscreen(this._renderingCanvas))},e.prototype.exitFullscreen=function(){this.isFullscreen&&c.Tools.ExitFullscreen()},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._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.scissorClear=function(e,t,r,n,i){this.enableScissor(e,t,r,n),this.clear(i,!0,!0,!0),this.disableScissor()},e.prototype.enableScissor=function(e,t,r,n){var i=this._gl;i.enable(i.SCISSOR_TEST),i.scissor(e,t,r,n)},e.prototype.disableScissor=function(){var e=this._gl;e.disable(e.SCISSOR_TEST)},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.setDirectViewport=function(e,t,r,n){var i=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,r,n),i},e.prototype.beginFrame=function(){this.onBeginFrameObservable.notifyObservers(this),this._measureFps()},e.prototype.endFrame=function(){if(this._badOS&&this.flushFramebuffer(),this._vrDisplay&&this._vrDisplay.isPresenting)try{this._vrDisplay.submitFrame()}catch(e){c.Tools.Warn("webVR submitFrame has had an unexpected failure: "+e)}this.onEndFrameObservable.notifyObservers(this)},e.prototype.resize=function(){if(!this._vrDisplay||!this._vrDisplay.isPresenting){var e=this._renderingCanvas?this._renderingCanvas.clientWidth:window.innerWidth,t=this._renderingCanvas?this._renderingCanvas.clientHeight:window.innerHeight;this.setSize(e/this._hardwareScalingLevel,t/this._hardwareScalingLevel)}},e.prototype.setSize=function(e,t){if(this._renderingCanvas&&(this._renderingCanvas.width!==e||this._renderingCanvas.height!==t)){this._renderingCanvas.width=e,this._renderingCanvas.height=t;for(var r=0;r<this.scenes.length;r++)for(var n=this.scenes[r],i=0;i<n.cameras.length;i++){n.cameras[i]._currentRenderId=0}this.onResizeObservable.hasObservers&&this.onResizeObservable.notifyObservers(this)}},e.prototype.isVRDevicePresent=function(){return!!this._vrDisplay},e.prototype.getVRDevice=function(){return this._vrDisplay},e.prototype.initWebVR=function(){return this.initWebVRAsync(),this.onVRDisplayChangedObservable},e.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)})};return 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=c.Tools.QueueNewFrame(e._bindedRenderFunction),t()},this._onVrDisplayPresentChange=function(){e._vrExclusivePointerMode=e._vrDisplay&&e._vrDisplay.isPresenting},window.addEventListener("vrdisplayconnect",this._onVrDisplayConnect),window.addEventListener("vrdisplaydisconnect",this._onVrDisplayDisconnect),window.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange)),this._webVRInitPromise=this._webVRInitPromise||this._getVRDisplaysAsync(),this._webVRInitPromise.then(t),this._webVRInitPromise},e.prototype.enableVR=function(){var e=this;if(this._vrDisplay&&!this._vrDisplay.isPresenting){this.onVRRequestPresentStart.notifyObservers(this),this._vrDisplay.requestPresent([{source:this.getRenderingCanvas()}]).then(function(){e.onVRRequestPresentComplete.notifyObservers(!0),e._onVRFullScreenTriggered()}).catch(function(){e.onVRRequestPresentComplete.notifyObservers(!1)})}},e.prototype.disableVR=function(){this._vrDisplay&&this._vrDisplay.isPresenting&&this._vrDisplay.exitPresent().then(this._onVRFullScreenTriggered).catch(this._onVRFullScreenTriggered)},e.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}))})},e.prototype.bindFramebuffer=function(e,t,r,n,i,o,s){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.isCube&&(void 0===t&&(t=0),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+t,e._webGLTexture,s),o&&(o._generateStencilBuffer?a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_CUBE_MAP_POSITIVE_X+t,o._webGLTexture,s):a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_CUBE_MAP_POSITIVE_X+t,o._webGLTexture,s))),this._cachedViewport&&!i?this.setViewport(this._cachedViewport,r,n):(r||(r=e.width,s&&(r/=Math.pow(2,s))),n||(n=e.height,s&&(n/=Math.pow(2,s))),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;e._MSAAFramebuffer&&(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.unBindMultiColorAttachmentFramebuffer=function(e,t,r){void 0===t&&(t=!1),this._currentRenderTarget=null;var n=this._gl;if(e[0]._MSAAFramebuffer){n.bindFramebuffer(n.READ_FRAMEBUFFER,e[0]._MSAAFramebuffer),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,e[0]._framebuffer);var i=e[0]._attachments;i||(i=new Array(e.length),e[0]._attachments=i);for(var o=0;o<e.length;o++){for(var s=e[o],a=0;a<i.length;a++)i[a]=n.NONE;i[o]=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+o:"COLOR_ATTACHMENT"+o+"_WEBGL"],n.readBuffer(i[o]),n.drawBuffers(i),n.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,n.COLOR_BUFFER_BIT,n.NEAREST)}for(o=0;o<i.length;o++)i[o]=n[this.webGLVersion>1?"COLOR_ATTACHMENT"+o:"COLOR_ATTACHMENT"+o+"_WEBGL"];n.drawBuffers(i)}for(o=0;o<e.length;o++){!(s=e[o]).generateMipMaps||t||s.isCube||(this._bindTextureDirectly(n.TEXTURE_2D,s),n.generateMipmap(n.TEXTURE_2D),this._bindTextureDirectly(n.TEXTURE_2D,null))}r&&(e[0]._MSAAFramebuffer&&this.bindUnboundFramebuffer(e[0]._framebuffer),r()),this.bindUnboundFramebuffer(null)},e.prototype.generateMipMapsForCubemap=function(e){if(e.generateMipMaps){var t=this._gl;this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,e,!0),t.generateMipmap(t.TEXTURE_CUBE_MAP),this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,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.createUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");return this.bindUniformBuffer(t),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),t.references=1,t},e.prototype.createDynamicUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");return this.bindUniformBuffer(t),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),t.references=1,t},e.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)},e.prototype._resetVertexBufferBinding=function(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null},e.prototype.createVertexBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create vertex buffer");return this.bindArrayBuffer(t),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(),t.references=1,t},e.prototype.createDynamicVertexBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic vertex buffer");return this.bindArrayBuffer(t),e instanceof Array?this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),this._resetVertexBufferBinding(),t.references=1,t},e.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()},e.prototype.updateDynamicVertexBuffer=function(e,t,r,n){this.bindArrayBuffer(e),void 0===r&&(r=0),void 0===n?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()},e.prototype._resetIndexBufferBinding=function(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null},e.prototype.createIndexBuffer=function(e,t){var r,n=this._gl.createBuffer();if(!n)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);var i=!1;if(e instanceof Uint16Array)r=e;else if(this._caps.uintIndices)if(e instanceof Uint32Array)r=e,i=!0;else{for(var o=0;o<e.length;o++)if(e[o]>65535){i=!0;break}r=i?new Uint32Array(e):new Uint16Array(e)}else r=new Uint16Array(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,r,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=i,n},e.prototype.bindArrayBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ARRAY_BUFFER)},e.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e)},e.prototype.bindUniformBufferBase=function(e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e)},e.prototype.bindUniformBlock=function(e,t,r){var n=this._gl.getUniformBlockIndex(e,t);this._gl.uniformBlockBinding(e,n,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),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],c=!1;a.active?(a.buffer!==e&&(a.buffer=e,c=!0),a.size!==r&&(a.size=r,c=!0),a.type!==n&&(a.type=n,c=!0),a.normalized!==i&&(a.normalized=i,c=!0),a.stride!==o&&(a.stride=o,c=!0),a.offset!==s&&(a.offset=s,c=!0)):(c=!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),(c||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 c=i.getAttributeLocation(a);c>=0&&(this._gl.enableVertexAttribArray(c),this._vertexAttribArraysEnabled[c]=!0,this._vertexAttribPointer(e,c,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._gl.deleteBuffer(e),!0)},e.prototype.createInstancesBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");return t.capacity=e,this.bindArrayBuffer(t),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),t},e.prototype.deleteInstancesBuffer=function(e){this._gl.deleteBuffer(e)},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){for(var n=0,i=0;i<r.length;i++){n+=4*(o=r[i]).attributeSize}for(i=0;i<r.length;i++){var o=r[i];this._vertexAttribArraysEnabled[o.index]||(this._gl.enableVertexAttribArray(o.index),this._vertexAttribArraysEnabled[o.index]=!0),this._vertexAttribPointer(e,o.index,o.attributeSize,o.attribyteType||this._gl.FLOAT,o.normalized||!1,n,o.offset),this._gl.vertexAttribDivisor(o.index,1),this._currentInstanceLocations.push(o.index),this._currentInstanceBuffers.push(e)}}else for(var s=0;s<4;s++){var a=r[s];this._vertexAttribArraysEnabled[a]||(this._gl.enableVertexAttribArray(a),this._vertexAttribArraysEnabled[a]=!0),this._vertexAttribPointer(e,a,4,this._gl.FLOAT,!1,64,16*s),this._gl.vertexAttribDivisor(a,1),this._currentInstanceLocations.push(a),this._currentInstanceBuffers.push(e)}},e.prototype.applyStates=function(){this._depthCullingState.apply(this._gl),this._stencilState.apply(this._gl),this._alphaState.apply(this._gl)},e.prototype.draw=function(e,t,r,n){this.drawElementsType(e?d.Material.TriangleFillMode:d.Material.WireFrameFillMode,t,r,n)},e.prototype.drawPointClouds=function(e,t,r){this.drawArraysType(d.Material.PointFillMode,e,t,r)},e.prototype.drawUnIndexed=function(e,t,r,n){this.drawArraysType(e?d.Material.TriangleFillMode:d.Material.WireFrameFillMode,t,r,n)},e.prototype.drawElementsType=function(e,t,r,n){this.applyStates(),this._drawCalls.addCount(1,!1);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._drawCalls.addCount(1,!1);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 d.Material.TriangleFillMode:return this._gl.TRIANGLES;case d.Material.PointFillMode:return this._gl.POINTS;case d.Material.WireFrameFillMode:return this._gl.LINES;case d.Material.PointListDrawMode:return this._gl.POINTS;case d.Material.LineListDrawMode:return this._gl.LINES;case d.Material.LineLoopDrawMode:return this._gl.LINE_LOOP;case d.Material.LineStripDrawMode:return this._gl.LINE_STRIP;case d.Material.TriangleStripDrawMode:return this._gl.TRIANGLE_STRIP;case d.Material.TriangleFanDrawMode:return this._gl.TRIANGLE_FAN;default:return this._gl.TRIANGLES}},e.prototype._releaseEffect=function(e){this._compiledEffects[e._key]&&(delete this._compiledEffects[e._key],this._deleteProgram(e.getProgram()))},e.prototype._deleteProgram=function(e){e&&(e.__SPECTOR_rebuildProgram=null,e.transformFeedback&&(this.deleteTransformFeedback(e.transformFeedback),e.transformFeedback=null),this._gl.deleteProgram(e))},e.prototype.createEffect=function(e,t,r,n,i,o,s,a,c){var l=(e.vertexElement||e.vertex||e)+"+"+(e.fragmentElement||e.fragment||e)+"@"+(i||t.defines);if(this._compiledEffects[l]){var u=this._compiledEffects[l];return s&&u.isReady()&&s(u),u}var d=new h.Effect(e,t,r,n,this,i,o,s,a,c);return d._key=l,this._compiledEffects[l]=d,d},e.prototype._compileShader=function(e,t,r,n){return this._compileRawShader(n+(r?r+"\n":"")+e,t)},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.");if(r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS)){var i=r.getShaderInfoLog(n);if(i)throw new Error(i)}return n},e.prototype.createRawShaderProgram=function(e,t,r,n){void 0===n&&(n=null),r=r||this._gl;var i=this._compileRawShader(e,"vertex"),o=this._compileRawShader(t,"fragment");return this._createShaderProgram(i,o,r,n)},e.prototype.createShaderProgram=function(e,t,r,n,i){void 0===i&&(i=null),n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);var o=this._webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"",s=this._compileShader(e,"vertex",r,o),a=this._compileShader(t,"fragment",r,o),c=this._createShaderProgram(s,a,n,i);return this.onAfterShaderCompilationObservable.notifyObservers(this),c},e.prototype._createShaderProgram=function(e,t,r,n){void 0===n&&(n=null);var i=r.createProgram();if(!i)throw new Error("Unable to create program");if(r.attachShader(i,e),r.attachShader(i,t),this.webGLVersion>1&&n){var o=this.createTransformFeedback();this.bindTransformFeedback(o),this.setTranformFeedbackVaryings(i,n),i.transformFeedback=o}return r.linkProgram(i),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),i.context=r,i.vertexShader=e,i.fragmentShader=t,this._caps.parallelShaderCompile?i.isParallelCompiled=!0:this._finalizeProgram(i),i},e.prototype._finalizeProgram=function(e){var t,r=e.context,n=e.vertexShader,i=e.fragmentShader;if(!r.getProgramParameter(e,r.LINK_STATUS)&&(t=r.getProgramInfoLog(e)))throw new Error(t);if(this.validateShaderPrograms&&(r.validateProgram(e),!r.getProgramParameter(e,r.VALIDATE_STATUS)&&(t=r.getProgramInfoLog(e))))throw new Error(t);r.deleteShader(n),r.deleteShader(i),e.context=void 0,e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)},e.prototype._isProgramCompiled=function(e){return!e.isParallelCompiled||!!this._gl.getProgramParameter(e,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)&&(this._finalizeProgram(e),!0)},e.prototype._executeWhenProgramIsCompiled=function(e,t){e.isParallelCompiled?e.onCompiled=t:t()},e.prototype.getUniforms=function(e,t){for(var r=new Array,n=0;n<t.length;n++)r.push(this._gl.getUniformLocation(e,t[n]));return r},e.prototype.getAttributes=function(e,t){for(var r=[],n=0;n<t.length;n++)try{r.push(this._gl.getAttribLocation(e,t[n]))}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.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.setFloatArray=function(e,t){e&&this._gl.uniform1fv(e,t)},e.prototype.setFloatArray2=function(e,t){e&&t.length%2==0&&this._gl.uniform2fv(e,t)},e.prototype.setFloatArray3=function(e,t){e&&t.length%3==0&&this._gl.uniform3fv(e,t)},e.prototype.setFloatArray4=function(e,t){e&&t.length%4==0&&this._gl.uniform4fv(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.setMatrix=function(e,t){e&&this._gl.uniformMatrix4fv(e,!1,t.toArray())},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.setInt=function(e,t){e&&this._gl.uniform1i(e,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.setBool=function(e,t){e&&this._gl.uniform1i(e,t)},e.prototype.setFloat4=function(e,t,r,n,i){e&&this._gl.uniform4f(e,t,r,n,i)},e.prototype.setColor3=function(e,t){e&&this._gl.uniform3f(e,t.r,t.g,t.b)},e.prototype.setColor4=function(e,t,r){e&&this._gl.uniform4f(e,t.r,t.g,t.b,r)},e.prototype.setDirectColor4=function(e,t){e&&this._gl.uniform4f(e,t.r,t.g,t.b,t.a)},e.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)},e.prototype.setZOffset=function(e){this._depthCullingState.zOffset=e},e.prototype.getZOffset=function(){return this._depthCullingState.zOffset},e.prototype.setDepthBuffer=function(e){this._depthCullingState.depthTest=e},e.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},e.prototype.setDepthWrite=function(e){this._depthCullingState.depthMask=e},e.prototype.setColorWrite=function(e){this._gl.colorMask(e,e,e,e),this._colorWrite=e},e.prototype.getColorWrite=function(){return this._colorWrite},e.prototype.setAlphaConstants=function(e,t,r,n){this._alphaState.setAlphaBlendConstants(e,t,r,n)},e.prototype.setAlphaMode=function(t,r){if(void 0===r&&(r=!1),this._alphaMode!==t){switch(t){case e.ALPHA_DISABLE:this._alphaState.alphaBlend=!1;break;case e.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 e.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 e.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 e.ALPHA_ONEONE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case e.ALPHA_ADD:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case e.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 e.ALPHA_MULTIPLY:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR,this._gl.ZERO,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case e.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 e.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 e.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}r||this.setDepthWrite(t===e.ALPHA_DISABLE),this._alphaMode=t}},e.prototype.getAlphaMode=function(){return this._alphaMode},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,e&&(this.resetTextureCache(),this._currentProgram=null,this._stencilState.reset(),this._depthCullingState.reset(),this.setDepthFunctionToLessOrEqual(),this._alphaState.reset(),this._unpackFlipYCached=null),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this._unbindVertexArrayObject(),this.bindIndexBuffer(null))},e.prototype.setTextureFormatToUse=function(e){for(var t=0,r=this.texturesSupported.length;t<r;t++)for(var n=0,i=e.length;n<i;n++)if(this._texturesSupported[t]===e[n].toLowerCase())return this._textureFormatInUse=this._texturesSupported[t];return this._textureFormatInUse=null,null},e.prototype._getSamplingParameters=function(t,r){var n=this._gl,i=n.NEAREST,o=n.NEAREST;switch(t){case e.TEXTURE_BILINEAR_SAMPLINGMODE:i=n.LINEAR,o=r?n.LINEAR_MIPMAP_NEAREST:n.LINEAR;break;case e.TEXTURE_TRILINEAR_SAMPLINGMODE:i=n.LINEAR,o=r?n.LINEAR_MIPMAP_LINEAR:n.LINEAR;break;case e.TEXTURE_NEAREST_SAMPLINGMODE:i=n.NEAREST,o=r?n.NEAREST_MIPMAP_LINEAR:n.NEAREST;break;case e.TEXTURE_NEAREST_NEAREST_MIPNEAREST:i=n.NEAREST,o=r?n.NEAREST_MIPMAP_NEAREST:n.NEAREST;break;case e.TEXTURE_NEAREST_LINEAR_MIPNEAREST:i=n.NEAREST,o=r?n.LINEAR_MIPMAP_NEAREST:n.LINEAR;break;case e.TEXTURE_NEAREST_LINEAR_MIPLINEAR:i=n.NEAREST,o=r?n.LINEAR_MIPMAP_LINEAR:n.LINEAR;break;case e.TEXTURE_NEAREST_LINEAR:i=n.NEAREST,o=n.LINEAR;break;case e.TEXTURE_NEAREST_NEAREST:i=n.NEAREST,o=n.NEAREST;break;case e.TEXTURE_LINEAR_NEAREST_MIPNEAREST:i=n.LINEAR,o=r?n.NEAREST_MIPMAP_NEAREST:n.NEAREST;break;case e.TEXTURE_LINEAR_NEAREST_MIPLINEAR:i=n.LINEAR,o=r?n.NEAREST_MIPMAP_LINEAR:n.NEAREST;break;case e.TEXTURE_LINEAR_LINEAR:i=n.LINEAR,o=n.LINEAR;break;case e.TEXTURE_LINEAR_NEAREST:i=n.LINEAR,o=n.NEAREST}return{min:o,mag:i}},e.prototype._partialLoadImg=function(e,t,r,n,i,o){var s;void 0===o&&(o=null);s=c.Tools.LoadImage(e,function(){r[t]=s,r._internalCount++,n&&n._removePendingData(s),6===r._internalCount&&i(r)},function(e,t){n&&n._removePendingData(s),o&&o(e,t)},n?n.offlineProvider:null),n&&n._addPendingData(s)},e.prototype._cascadeLoadImgs=function(e,t,r,n){void 0===n&&(n=null);var i=[];i._internalCount=0;for(var o=0;o<6;o++)this._partialLoadImg(r[o],o,i,e,t,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,n,i,o,s,a,l,u,h,d,f){var g=this;void 0===o&&(o=e.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===s&&(s=null),void 0===a&&(a=null),void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===d&&(d=null),void 0===f&&(f=[]);for(var m=String(t),_="data:"===m.substr(0,5),v="blob:"===m.substr(0,5),A=_&&-1!==m.indexOf(";base64,"),y=u||new p.InternalTexture(this,p.InternalTexture.DATASOURCE_URL),b=m.lastIndexOf("."),T=d||(b>-1?m.substring(b).toLowerCase():""),E=null,x=0,C=e._TextureLoaders;x<C.length;x++){var P=C[x];if(-1===f.indexOf(P)&&P.canLoad(T,this._textureFormatInUse,u,A,!!l)){E=P;break}}E&&(m=E.transformUrl(m,this._textureFormatInUse)),i&&i._addPendingData(y),y.url=m,y.generateMipMaps=!r,y.samplingMode=o,y.invertY=n,this._doNotHandleContextLost||(y._buffer=l);var M=null;s&&!u&&(M=y.onLoadedObservable.add(s)),u||this._internalTexturesCache.push(y);var S=function(e,n){i&&i._removePendingData(y);var s=!1;E&&(E.getFallbackTextureUrl(m,g._textureFormatInUse)&&(s=!0,f.push(E),c.Tools.Warn(E.constructor.name+" failed when trying to load "+y.url+", falling back to the next supported loader"),g.createTexture(t,r,y.invertY,i,o,null,null,l,y,void 0,void 0,f)));s||(M&&y.onLoadedObservable.remove(M),c.Tools.UseFallbackTexture&&g.createTexture(c.Tools.fallbackTexture,r,y.invertY,i,o,null,null,l,y)),a&&a(e||"Unknown error",n)};if(E){var R=function(e){E.loadData(e,y,function(e,t,r,n,s,a){a?S("TextureLoader failed to load data"):g._prepareWebGLTexture(y,i,e,t,y.invertY,!r,n,function(){return s(),!1},o)})};l?R(l):this._loadFile(m,R,void 0,i?i.offlineProvider:void 0,!0,function(e,t){S("Unable to load "+(e&&e.responseURL,t))})}else{var O=function(t){v&&!g._doNotHandleContextLost&&(y._buffer=t),g._prepareWebGLTexture(y,i,t.width,t.height,y.invertY,r,!1,function(r,n,o){var s=g._gl,a=t.width===r&&t.height===n,c=h?g._getInternalFormat(h):".jpg"===T?s.RGB:s.RGBA;if(a)return s.texImage2D(s.TEXTURE_2D,0,c,c,s.UNSIGNED_BYTE,t),!1;var l=g._caps.maxTextureSize;if(t.width>l||t.height>l||null===e._RescalePostProcessFactory)return g._prepareWorkingCanvas(),!(!g._workingCanvas||!g._workingContext)&&(g._workingCanvas.width=r,g._workingCanvas.height=n,g._workingContext.drawImage(t,0,0,t.width,t.height,0,0,r,n),s.texImage2D(s.TEXTURE_2D,0,c,c,s.UNSIGNED_BYTE,g._workingCanvas),y.width=r,y.height=n,!1);var u=new p.InternalTexture(g,p.InternalTexture.DATASOURCE_TEMP);return g._bindTextureDirectly(s.TEXTURE_2D,u,!0),s.texImage2D(s.TEXTURE_2D,0,c,c,s.UNSIGNED_BYTE,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),g._rescaleTexture(u,y,i,c,function(){g._releaseTexture(u),g._bindTextureDirectly(s.TEXTURE_2D,y,!0),o()}),!0},o)};!_||A?l instanceof HTMLImageElement?O(l):c.Tools.LoadImage(m,O,S,i?i.offlineProvider:null):"string"==typeof l||l instanceof ArrayBuffer||l instanceof Blob?c.Tools.LoadImage(l,O,S,i?i.offlineProvider:null):O(l)}return y},e.prototype._rescaleTexture=function(t,r,n,i,o){var s=this,a=this.createRenderTargetTexture({width:r.width,height:r.height},{generateMipMaps:!1,type:e.TEXTURETYPE_UNSIGNED_INT,samplingMode:e.TEXTURE_BILINEAR_SAMPLINGMODE,generateDepthBuffer:!1,generateStencilBuffer:!1});!this._rescalePostProcess&&e._RescalePostProcessFactory&&(this._rescalePostProcess=e._RescalePostProcessFactory(this)),this._rescalePostProcess.getEffect().executeWhenCompiled(function(){s._rescalePostProcess.onApply=function(e){e._bindTexture("textureSampler",t)};var e=n;e||(e=s.scenes[s.scenes.length-1]),e.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()})},e.prototype.updateRawTexture=function(t,r,n,i,o,s){if(void 0===o&&(o=null),void 0===s&&(s=e.TEXTURETYPE_UNSIGNED_INT),t){var a=this._getRGBABufferInternalSizedFormat(s,n),c=this._getInternalFormat(n),l=this._getWebGLTextureType(s);this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===i||!!i),this._doNotHandleContextLost||(t._bufferView=r,t.format=n,t.type=s,t.invertY=i,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&r?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[o],t.width,t.height,0,r):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,t.width,t.height,0,c,l,r),t.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),t.isReady=!0}},e.prototype.createRawTexture=function(t,r,n,i,o,s,a,c,l){void 0===c&&(c=null),void 0===l&&(l=e.TEXTURETYPE_UNSIGNED_INT);var u=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_RAW);u.baseWidth=r,u.baseHeight=n,u.width=r,u.height=n,u.format=i,u.generateMipMaps=o,u.samplingMode=a,u.invertY=s,u._compression=c,u.type=l,this._doNotHandleContextLost||(u._bufferView=t),this.updateRawTexture(u,t,i,s,c,l),this._bindTextureDirectly(this._gl.TEXTURE_2D,u,!0);var h=this._getSamplingParameters(a,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(u),u},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.createDynamicTexture=function(e,t,r,n){var i=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_DYNAMIC);return i.baseWidth=e,i.baseHeight=t,r&&(e=this.needPOTTextures?c.Tools.GetExponentOfTwo(e,this._caps.maxTextureSize):e,t=this.needPOTTextures?c.Tools.GetExponentOfTwo(t,this._caps.maxTextureSize):t),i.width=e,i.height=t,i.isReady=!1,i.generateMipMaps=r,i.samplingMode=n,this.updateTextureSamplingMode(n,i),this._internalTexturesCache.push(i),i},e.prototype.updateTextureSamplingMode=function(e,t){var r=this._getSamplingParameters(e,t.generateMipMaps);t.isCube?(this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_MAG_FILTER,r.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_MIN_FILTER,r.min),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):t.is3D?(this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_MAG_FILTER,r.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_MIN_FILTER,r.min),this._bindTextureDirectly(this._gl.TEXTURE_3D,null)):(this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,r.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,r.min),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),t.samplingMode=e},e.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}},e.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.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=document.createElement("canvas");var i=e._workingCanvas.getContext("2d");if(!i)throw new Error("Unable to get 2d context");e._workingContext=i,e._workingCanvas.width=e.width,e._workingCanvas.height=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}}},e.prototype.updateTextureComparisonFunction=function(t,r){if(1!==this.webGLVersion){var n=this._gl;t.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,t,!0),0===r?(n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_COMPARE_FUNC,e.LEQUAL),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_COMPARE_MODE,n.NONE)):(n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_COMPARE_FUNC,r),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),0===r?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_COMPARE_FUNC,e.LEQUAL),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_COMPARE_MODE,n.NONE)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_COMPARE_FUNC,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),t._comparisonFunction=r}else v.Logger.Error("WebGL 1 does not support texture comparison.")},e.prototype._setupDepthStencilTexture=function(t,r,n,i,o){var s=r.width||r,a=r.height||r;t.baseWidth=s,t.baseHeight=a,t.width=s,t.height=a,t.isReady=!0,t.samples=1,t.generateMipMaps=!1,t._generateDepthBuffer=!0,t._generateStencilBuffer=n,t.samplingMode=i?e.TEXTURE_BILINEAR_SAMPLINGMODE:e.TEXTURE_NEAREST_SAMPLINGMODE,t.type=e.TEXTURETYPE_UNSIGNED_INT,t._comparisonFunction=o;var c=this._gl,l=t.isCube?c.TEXTURE_CUBE_MAP:c.TEXTURE_2D,u=this._getSamplingParameters(t.samplingMode,!1);c.texParameteri(l,c.TEXTURE_MAG_FILTER,u.mag),c.texParameteri(l,c.TEXTURE_MIN_FILTER,u.min),c.texParameteri(l,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(l,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),0===o?(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,e.LEQUAL),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.NONE)):(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,o),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE))},e.prototype.createDepthStencilTexture=function(e,t){if(t.isCube){var r=e.width||e;return this._createDepthStencilCubeTexture(r,t)}return this._createDepthStencilTexture(e,t)},e.prototype._createDepthStencilTexture=function(e,t){var r=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_DEPTHTEXTURE);if(!this._caps.depthTextureExtension)return v.Logger.Error("Depth texture is not supported by your browser or hardware."),r;var i=n.__assign({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),o=this._gl;return this._bindTextureDirectly(o.TEXTURE_2D,r,!0),this._setupDepthStencilTexture(r,e,i.generateStencil,i.bilinearFiltering,i.comparisonFunction),this.webGLVersion>1?i.generateStencil?o.texImage2D(o.TEXTURE_2D,0,o.DEPTH24_STENCIL8,r.width,r.height,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_COMPONENT24,r.width,r.height,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null):i.generateStencil?o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_STENCIL,r.width,r.height,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_COMPONENT,r.width,r.height,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null),this._bindTextureDirectly(o.TEXTURE_2D,null),r},e.prototype._createDepthStencilCubeTexture=function(e,t){var r=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_UNKNOWN);if(r.isCube=!0,1===this.webGLVersion)return v.Logger.Error("Depth cube texture is not supported by WebGL 1."),r;var i=n.__assign({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),o=this._gl;this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,r,!0),this._setupDepthStencilTexture(r,e,i.generateStencil,i.bilinearFiltering,i.comparisonFunction);for(var s=0;s<6;s++)i.generateStencil?o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,o.DEPTH24_STENCIL8,e,e,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,o.DEPTH_COMPONENT24,e,e,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null);return this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),r},e.prototype.setFrameBufferDepthStencilTexture=function(e){var t=e.getInternalTexture();if(t&&t._framebuffer&&e.depthStencilTexture){var r=this._gl,n=e.depthStencilTexture;this.bindUnboundFramebuffer(t._framebuffer),n.isCube?n._generateStencilBuffer?r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_CUBE_MAP_POSITIVE_X,n._webGLTexture,0):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_CUBE_MAP_POSITIVE_X,n._webGLTexture,0):n._generateStencilBuffer?r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,n._webGLTexture,0):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,n._webGLTexture,0),this.bindUnboundFramebuffer(null)}},e.prototype.createRenderTargetTexture=function(t,r){var n=new y.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?e.TEXTURETYPE_UNSIGNED_INT:r.type,n.samplingMode=void 0===r.samplingMode?e.TEXTURE_TRILINEAR_SAMPLINGMODE:r.samplingMode,n.format=void 0===r.format?e.TEXTUREFORMAT_RGBA:r.format):(n.generateMipMaps=r,n.generateDepthBuffer=!0,n.generateStencilBuffer=!1,n.type=e.TEXTURETYPE_UNSIGNED_INT,n.samplingMode=e.TEXTURE_TRILINEAR_SAMPLINGMODE,n.format=e.TEXTUREFORMAT_RGBA),(n.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(n.type!==e.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(n.samplingMode=e.TEXTURE_NEAREST_SAMPLINGMODE);var i=this._gl,o=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_RENDERTARGET);this._bindTextureDirectly(i.TEXTURE_2D,o,!0);var s=t.width||t,a=t.height||t,c=this._getSamplingParameters(n.samplingMode,!!n.generateMipMaps);n.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloat||(n.type=e.TEXTURETYPE_UNSIGNED_INT,v.Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,c.mag),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,c.min),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texImage2D(i.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(n.type,n.format),s,a,0,this._getInternalFormat(n.format),this._getWebGLTextureType(n.type),null);var l=this._currentFramebuffer,u=i.createFramebuffer();return this.bindUnboundFramebuffer(u),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,o._webGLTexture,0),o._depthStencilBuffer=this._setupFramebufferDepthAttachments(!!n.generateStencilBuffer,n.generateDepthBuffer,s,a),n.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(i.TEXTURE_2D,null),i.bindRenderbuffer(i.RENDERBUFFER,null),this.bindUnboundFramebuffer(l),o._framebuffer=u,o.baseWidth=s,o.baseHeight=a,o.width=s,o.height=a,o.isReady=!0,o.samples=1,o.generateMipMaps=!!n.generateMipMaps,o.samplingMode=n.samplingMode,o.type=n.type,o.format=n.format,o._generateDepthBuffer=n.generateDepthBuffer,o._generateStencilBuffer=!!n.generateStencilBuffer,this._internalTexturesCache.push(o),o},e.prototype.createMultipleRenderTarget=function(t,r){var n=!1,i=!0,o=!1,s=!1,a=1,c=e.TEXTURETYPE_UNSIGNED_INT,l=e.TEXTURE_TRILINEAR_SAMPLINGMODE,u=new Array,h=new Array;void 0!==r&&(n=void 0!==r.generateMipMaps&&r.generateMipMaps,i=void 0===r.generateDepthBuffer||r.generateDepthBuffer,o=void 0!==r.generateStencilBuffer&&r.generateStencilBuffer,s=void 0!==r.generateDepthTexture&&r.generateDepthTexture,a=r.textureCount||1,r.types&&(u=r.types),r.samplingModes&&(h=r.samplingModes));var d=this._gl,f=d.createFramebuffer();this.bindUnboundFramebuffer(f);for(var g=t.width||t,m=t.height||t,_=[],A=[],y=this._setupFramebufferDepthAttachments(o,i,g,m),b=0;b<a;b++){var T=h[b]||l,E=u[b]||c;(E!==e.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(E!==e.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(T=e.TEXTURE_NEAREST_SAMPLINGMODE);var x=this._getSamplingParameters(T,n);E!==e.TEXTURETYPE_FLOAT||this._caps.textureFloat||(E=e.TEXTURETYPE_UNSIGNED_INT,v.Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var C=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_MULTIRENDERTARGET),P=d[this.webGLVersion>1?"COLOR_ATTACHMENT"+b:"COLOR_ATTACHMENT"+b+"_WEBGL"];_.push(C),A.push(P),d.activeTexture(d["TEXTURE"+b]),d.bindTexture(d.TEXTURE_2D,C._webGLTexture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,x.mag),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,x.min),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texImage2D(d.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(E),g,m,0,d.RGBA,this._getWebGLTextureType(E),null),d.framebufferTexture2D(d.DRAW_FRAMEBUFFER,P,d.TEXTURE_2D,C._webGLTexture,0),n&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(d.TEXTURE_2D,null),C._framebuffer=f,C._depthStencilBuffer=y,C.baseWidth=g,C.baseHeight=m,C.width=g,C.height=m,C.isReady=!0,C.samples=1,C.generateMipMaps=n,C.samplingMode=T,C.type=E,C._generateDepthBuffer=i,C._generateStencilBuffer=o,C._attachments=A,this._internalTexturesCache.push(C)}if(s&&this._caps.depthTextureExtension){var M=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_MULTIRENDERTARGET);d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,M._webGLTexture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texImage2D(d.TEXTURE_2D,0,this.webGLVersion<2?d.DEPTH_COMPONENT:d.DEPTH_COMPONENT16,g,m,0,d.DEPTH_COMPONENT,d.UNSIGNED_SHORT,null),d.framebufferTexture2D(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.TEXTURE_2D,M._webGLTexture,0),M._framebuffer=f,M.baseWidth=g,M.baseHeight=m,M.width=g,M.height=m,M.isReady=!0,M.samples=1,M.generateMipMaps=n,M.samplingMode=d.NEAREST,M._generateDepthBuffer=i,M._generateStencilBuffer=o,_.push(M),this._internalTexturesCache.push(M)}return d.drawBuffers(A),d.bindRenderbuffer(d.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),this.resetTextureCache(),_},e.prototype._setupFramebufferDepthAttachments=function(e,t,r,n,i){void 0===i&&(i=1);var o=null,s=this._gl;return e?(o=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,o),i>1?s.renderbufferStorageMultisample(s.RENDERBUFFER,i,s.DEPTH24_STENCIL8,r,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,r,n),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,o)):t&&(o=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,o),i>1?s.renderbufferStorageMultisample(s.RENDERBUFFER,i,s.DEPTH_COMPONENT16,r,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,r,n),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,o)),o},e.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,r.getParameter(r.MAX_SAMPLES)),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){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),r.bindRenderbuffer(r.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),t},e.prototype.updateMultipleRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e||0==e.length)return 1;if(e[0].samples===t)return t;var r=this._gl;t=Math.min(t,r.getParameter(r.MAX_SAMPLES)),e[0]._depthStencilBuffer&&(r.deleteRenderbuffer(e[0]._depthStencilBuffer),e[0]._depthStencilBuffer=null),e[0]._MSAAFramebuffer&&(r.deleteFramebuffer(e[0]._MSAAFramebuffer),e[0]._MSAAFramebuffer=null);for(var n=0;n<e.length;n++)e[n]._MSAARenderBuffer&&(r.deleteRenderbuffer(e[n]._MSAARenderBuffer),e[n]._MSAARenderBuffer=null);if(t>1){var i=r.createFramebuffer();if(!i)throw new Error("Unable to create multi sampled framebuffer");this.bindUnboundFramebuffer(i);var o=this._setupFramebufferDepthAttachments(e[0]._generateStencilBuffer,e[0]._generateDepthBuffer,e[0].width,e[0].height,t),s=[];for(n=0;n<e.length;n++){var a=e[n],c=r[this.webGLVersion>1?"COLOR_ATTACHMENT"+n:"COLOR_ATTACHMENT"+n+"_WEBGL"],l=r.createRenderbuffer();if(!l)throw new Error("Unable to create multi sampled framebuffer");r.bindRenderbuffer(r.RENDERBUFFER,l),r.renderbufferStorageMultisample(r.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(a.type),a.width,a.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,c,r.RENDERBUFFER,l),a._MSAAFramebuffer=i,a._MSAARenderBuffer=l,a.samples=t,a._depthStencilBuffer=o,r.bindRenderbuffer(r.RENDERBUFFER,null),s.push(c)}r.drawBuffers(s)}else this.bindUnboundFramebuffer(e[0]._framebuffer);return this.bindUnboundFramebuffer(null),t},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,c=a.TEXTURE_2D;e.isCube&&(c=a.TEXTURE_CUBE_MAP_POSITIVE_X+o),this._gl.compressedTexImage2D(c,s,t,r,n,0,i)},e.prototype._uploadDataToTextureDirectly=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);this._unpackFlipY(e.invertY);var c=i.TEXTURE_2D;e.isCube&&(c=i.TEXTURE_CUBE_MAP_POSITIVE_X+r);var l=Math.round(u.Scalar.Log2(e.width)),h=Math.round(u.Scalar.Log2(e.height)),d=Math.pow(2,Math.max(l-n,0)),f=Math.pow(2,Math.max(h-n,0));i.texImage2D(c,n,a,d,f,0,s,o,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._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),c=e.isCube?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D;this._bindTextureDirectly(c,e,!0),this._unpackFlipY(e.invertY);var l=i.TEXTURE_2D;e.isCube&&(l=i.TEXTURE_CUBE_MAP_POSITIVE_X+r),i.texImage2D(l,n,a,s,o,t),this._bindTextureDirectly(c,null,!0)},e.prototype.createMultiviewRenderTargetTexture=function(e,t){var r=this._gl;if(!this.getCaps().multiview)throw"Multiview is not supported";var n=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_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},e.prototype.bindMultiviewFramebuffer=function(e){var t=this._gl,r=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";r.framebufferTextureMultiviewWEBGL(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,e._colorTextureArray,0,0,2),r.framebufferTextureMultiviewWEBGL(t.DRAW_FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,e._depthStencilTextureArray,0,0,2)},e.prototype.createRenderTargetCubeTexture=function(t,r){var i=n.__assign({generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:e.TEXTURETYPE_UNSIGNED_INT,samplingMode:e.TEXTURE_TRILINEAR_SAMPLINGMODE,format:e.TEXTUREFORMAT_RGBA},r);i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(i.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(i.type!==e.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(i.samplingMode=e.TEXTURE_NEAREST_SAMPLINGMODE);var o=this._gl,s=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_RENDERTARGET);this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,s,!0);var a=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);i.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloat||(i.type=e.TEXTURETYPE_UNSIGNED_INT,v.Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,a.mag),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,a.min),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);for(var c=0;c<6;c++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),t,t,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);var l=o.createFramebuffer();return this.bindUnboundFramebuffer(l),s._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,t,t),i.generateMipMaps&&o.generateMipmap(o.TEXTURE_CUBE_MAP),this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),o.bindRenderbuffer(o.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),s._framebuffer=l,s.width=t,s.height=t,s.isReady=!0,s.isCube=!0,s.samples=1,s.generateMipMaps=i.generateMipMaps,s.samplingMode=i.samplingMode,s.type=i.type,s.format=i.format,s._generateDepthBuffer=i.generateDepthBuffer,s._generateStencilBuffer=i.generateStencilBuffer,this._internalTexturesCache.push(s),s},e.prototype.createCubeTexture=function(t,r,n,i,o,s,a,l,u,h,d,f,g){var m=this;void 0===o&&(o=null),void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=!1),void 0===h&&(h=0),void 0===d&&(d=0),void 0===f&&(f=null),void 0===g&&(g=[]);var _=this._gl,A=f||new p.InternalTexture(this,p.InternalTexture.DATASOURCE_CUBE);A.isCube=!0,A.url=t,A.generateMipMaps=!i,A._lodGenerationScale=h,A._lodGenerationOffset=d,this._doNotHandleContextLost||(A._extension=l,A._files=n);for(var y=t.lastIndexOf("."),b=l||(y>-1?t.substring(y).toLowerCase():""),T=null,E=0,x=e._TextureLoaders;E<x.length;E++){var C=x[E];if(-1===g.indexOf(C)&&C.canLoad(b,this._textureFormatInUse,f,!1,!1)){T=C;break}}if(T){t=T.transformUrl(t,this._textureFormatInUse);var P=function(e){m._bindTextureDirectly(_.TEXTURE_CUBE_MAP,A,!0),T.loadCubeData(e,A,u,o,s)};n&&6===n.length?T.supportCascades?this._cascadeLoadFiles(r,P,n,s):s&&s("Textures type does not support cascades."):this._loadFile(t,P,void 0,void 0,!0,function(e,t){if(T){var c=T.getFallbackTextureUrl(A.url,m._textureFormatInUse);if(v.Logger.Warn(T.constructor.name+" failed when trying to load "+A.url+", falling back to the next supported loader"),c)return g.push(T),void m.createCubeTexture(c,r,n,i,o,s,a,b,u,h,d,A,g)}s&&e&&s(e.status+" "+e.statusText,t)})}else{if(!n)throw new Error("Cannot load cubemap because files were not defined");this._cascadeLoadImgs(r,function(e){var t=m.needPOTTextures?c.Tools.GetExponentOfTwo(e[0].width,m._caps.maxCubemapTextureSize):e[0].width,r=t;if(m._prepareWorkingCanvas(),m._workingCanvas&&m._workingContext){m._workingCanvas.width=t,m._workingCanvas.height=r;var n=[_.TEXTURE_CUBE_MAP_POSITIVE_X,_.TEXTURE_CUBE_MAP_POSITIVE_Y,_.TEXTURE_CUBE_MAP_POSITIVE_Z,_.TEXTURE_CUBE_MAP_NEGATIVE_X,_.TEXTURE_CUBE_MAP_NEGATIVE_Y,_.TEXTURE_CUBE_MAP_NEGATIVE_Z];m._bindTextureDirectly(_.TEXTURE_CUBE_MAP,A,!0),m._unpackFlipY(!1);for(var s=a?m._getInternalFormat(a):m._gl.RGBA,l=0;l<n.length;l++)e[l].width!==t||e[l].height!==r?(m._workingContext.drawImage(e[l],0,0,e[l].width,e[l].height,0,0,t,r),_.texImage2D(n[l],0,s,s,_.UNSIGNED_BYTE,m._workingCanvas)):_.texImage2D(n[l],0,s,s,_.UNSIGNED_BYTE,e[l]);i||_.generateMipmap(_.TEXTURE_CUBE_MAP),m._setCubeMapTextureParams(!i),A.width=t,A.height=r,A.isReady=!0,a&&(A.format=a),A.onLoadedObservable.notifyObservers(A),A.onLoadedObservable.clear(),o&&o()}},n,s)}return this._internalTexturesCache.push(A),A},e.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)},e.prototype.updateRawCubeTexture=function(e,t,r,n,i,o,s){void 0===o&&(o=null),void 0===s&&(s=0),e._bufferViewArray=t,e.format=r,e.type=n,e.invertY=i,e._compression=o;var a=this._gl,l=this._getWebGLTextureType(n),u=this._getInternalFormat(r),h=this._getRGBABufferInternalSizedFormat(n),d=!1;u===a.RGB&&(u=a.RGBA,d=!0),this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===i||!!i),e.width%4!=0&&a.pixelStorei(a.UNPACK_ALIGNMENT,1);for(var f=0;f<6;f++){var p=t[f];o?a.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+f,s,this.getCaps().s3tc[o],e.width,e.height,0,p):(d&&(p=this._convertRGBtoRGBATextureData(p,e.width,e.height,n)),a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+f,s,h,e.width,e.height,0,u,l,p))}(!this.needPOTTextures||c.Tools.IsExponentOfTwo(e.width)&&c.Tools.IsExponentOfTwo(e.height))&&e.generateMipMaps&&0===s&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},e.prototype.createRawCubeTexture=function(t,r,n,i,o,s,a,l){void 0===l&&(l=null);var u=this._gl,h=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_CUBERAW);h.isCube=!0,h.format=n,h.type=i,this._doNotHandleContextLost||(h._bufferViewArray=t);var d=this._getWebGLTextureType(i),f=this._getInternalFormat(n);f===u.RGB&&(f=u.RGBA),d!==u.FLOAT||this._caps.textureFloatLinearFiltering?d!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?d!==u.FLOAT||this._caps.textureFloatRender?d!==u.HALF_FLOAT||this._caps.colorBufferFloat||(o=!1,v.Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(o=!1,v.Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(o=!1,a=e.TEXTURE_NEAREST_SAMPLINGMODE,v.Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(o=!1,a=e.TEXTURE_NEAREST_SAMPLINGMODE,v.Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));var g=r,m=g;h.width=g,h.height=m,!this.needPOTTextures||c.Tools.IsExponentOfTwo(h.width)&&c.Tools.IsExponentOfTwo(h.height)||(o=!1),t&&this.updateRawCubeTexture(h,t,n,i,s,l),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,h,!0),t&&o&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);var _=this._getSamplingParameters(a,o);return u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,_.mag),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,_.min),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,null),h.generateMipMaps=o,h},e.prototype.createRawCubeTextureFromUrl=function(t,r,n,i,o,s,a,c,l,u,h,d){var f=this;void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=e.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===d&&(d=!1);var p=this._gl,g=this.createRawCubeTexture(null,n,i,o,!s,d,h);r._addPendingData(g),g.url=t,this._internalTexturesCache.push(g);return this._loadFile(t,function(e){!function(e){var t=g.width,n=a(e);if(n){if(c){var s=f._getWebGLTextureType(o),u=f._getInternalFormat(i),h=f._getRGBABufferInternalSizedFormat(o),m=!1;u===p.RGB&&(u=p.RGBA,m=!0),f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,g,!0),f._unpackFlipY(!1);for(var _=c(n),v=0;v<_.length;v++)for(var A=t>>v,y=0;y<6;y++){var b=_[v][y];m&&(b=f._convertRGBtoRGBATextureData(b,A,A,o)),p.texImage2D(y,v,h,A,A,0,u,s,b)}f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null)}else f.updateRawCubeTexture(g,n,i,o,d);g.isReady=!0,r._removePendingData(g),l&&l()}}(e)},void 0,r.offlineProvider,!0,function(e,t){r._removePendingData(g),u&&e&&u(e.status+" "+e.statusText,t)}),g},e.prototype.updateRawTexture3D=function(t,r,n,i,o,s){void 0===o&&(o=null),void 0===s&&(s=e.TEXTURETYPE_UNSIGNED_INT);var a=this._getWebGLTextureType(s),c=this._getInternalFormat(n),l=this._getRGBABufferInternalSizedFormat(s,n);this._bindTextureDirectly(this._gl.TEXTURE_3D,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(this._gl.TEXTURE_3D,0,this.getCaps().s3tc[o],t.width,t.height,t.depth,0,r):this._gl.texImage3D(this._gl.TEXTURE_3D,0,l,t.width,t.height,t.depth,0,c,a,r),t.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_3D),this._bindTextureDirectly(this._gl.TEXTURE_3D,null),t.isReady=!0},e.prototype.createRawTexture3D=function(t,r,n,i,o,s,a,c,l,u){void 0===l&&(l=null),void 0===u&&(u=e.TEXTURETYPE_UNSIGNED_INT);var h=new p.InternalTexture(this,p.InternalTexture.DATASOURCE_RAW3D);h.baseWidth=r,h.baseHeight=n,h.baseDepth=i,h.width=r,h.height=n,h.depth=i,h.format=o,h.type=u,h.generateMipMaps=s,h.samplingMode=c,h.is3D=!0,this._doNotHandleContextLost||(h._bufferView=t),this.updateRawTexture3D(h,t,o,a,l,u),this._bindTextureDirectly(this._gl.TEXTURE_3D,h,!0);var d=this._getSamplingParameters(c,s);return this._gl.texParameteri(this._gl.TEXTURE_3D,this._gl.TEXTURE_MAG_FILTER,d.mag),this._gl.texParameteri(this._gl.TEXTURE_3D,this._gl.TEXTURE_MIN_FILTER,d.min),s&&this._gl.generateMipmap(this._gl.TEXTURE_3D),this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._internalTexturesCache.push(h),h},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,u){var h=this;void 0===u&&(u=e.TEXTURE_TRILINEAR_SAMPLINGMODE);var d=this.getCaps().maxTextureSize,f=Math.min(d,this.needPOTTextures?c.Tools.GetExponentOfTwo(n,d):n),p=Math.min(d,this.needPOTTextures?c.Tools.GetExponentOfTwo(i,d):i),g=this._gl;g&&(t._webGLTexture?(this._bindTextureDirectly(g.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(){h._prepareWebGLTextureContinuation(t,r,s,a,u)})||this._prepareWebGLTextureContinuation(t,r,s,a,u)):r&&r._removePendingData(t))},e.prototype._convertRGBtoRGBATextureData=function(t,r,n,i){var o;o=i===e.TEXTURETYPE_FLOAT?new Float32Array(r*n*4):new Uint32Array(r*n*4);for(var s=0;s<r;s++)for(var a=0;a<n;a++){var c=3*(a*r+s),l=4*(a*r+s);o[l+0]=t[c+0],o[l+1]=t[c+1],o[l+2]=t[c+2],o[l+3]=1}return o},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){var t=this._gl;this._releaseFramebufferObjects(e),t.deleteTexture(e._webGLTexture),this.unbindAllTextures();var r=this._internalTexturesCache.indexOf(e);-1!==r&&this._internalTexturesCache.splice(r,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),this.scenes.forEach(function(t){t.postProcesses.forEach(function(t){t._outputTexture==e&&(t._outputTexture=null)}),t.cameras.forEach(function(t){t._postProcesses.forEach(function(t){t&&t._outputTexture==e&&(t._outputTexture=null)})})})},e.prototype.setProgram=function(e){this._currentProgram!==e&&(this._gl.useProgram(e),this._currentProgram=e)},e.prototype.bindSamplers=function(e){this.setProgram(e.getProgram());for(var t=e.getSamplers(),r=0;r<t.length;r++){var n=e.getUniform(t[r]);n&&(this._boundUniforms[r]=n)}this._currentEffect=null},e.prototype._moveBoundTextureOnTop=function(e){this.disableTextureBindingOptimization||this._lastBoundInternalTextureTracker.previous===e||(this._linkTrackers(e.previous,e.next),this._linkTrackers(this._lastBoundInternalTextureTracker.previous,e),this._linkTrackers(e,this._lastBoundInternalTextureTracker))},e.prototype._getCorrectTextureChannel=function(e,t){if(!t)return-1;if(t._initialSlot=e,this.disableTextureBindingOptimization)e!==t._designatedSlot&&this._textureCollisions.addCount(1,!1);else if(e!==t._designatedSlot)return t._designatedSlot>-1?t._designatedSlot:this._nextFreeTextureSlots.length?this._nextFreeTextureSlots[0]:(this._textureCollisions.addCount(1,!1),this._removeDesignatedSlot(this._firstBoundInternalTextureTracker.next));return e},e.prototype._linkTrackers=function(e,t){e.next=t,t.previous=e},e.prototype._removeDesignatedSlot=function(e){var t=e._designatedSlot;return-1===t?-1:(e._designatedSlot=-1,this.disableTextureBindingOptimization?-1:(this._linkTrackers(e.previous,e.next),this._boundTexturesCache[t]=null,this._nextFreeTextureSlots.push(t),t))},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;r&&t&&t._designatedSlot>-1&&(this._activeChannel=t._designatedSlot);var o=this._boundTexturesCache[this._activeChannel],s=t&&t._initialSlot>-1;if(o!==t||n){if(o&&this._removeDesignatedSlot(o),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){if(!this.disableTextureBindingOptimization){var a=this._nextFreeTextureSlots.indexOf(this._activeChannel);a>-1&&this._nextFreeTextureSlots.splice(a,1),this._linkTrackers(this._lastBoundInternalTextureTracker.previous,t),this._linkTrackers(t,this._lastBoundInternalTextureTracker)}t._designatedSlot=this._activeChannel}}else r&&(i=!0,this._activateCurrentTexture());return s&&!r&&this._bindSamplerUniformToChannel(t._initialSlot,this._activeChannel),i},e.prototype._bindTexture=function(e,t){e<0||(t&&(e=this._getCorrectTextureChannel(e,t)),this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,t))},e.prototype.setTextureFromPostProcess=function(e,t){this._bindTexture(e,t?t._textures.data[t._currentRenderTextureInd]:null)},e.prototype.setTextureFromPostProcessOutput=function(e,t){this._bindTexture(e,t?t._outputTexture:null)},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)},e.prototype.setTexture=function(e,t,r){e<0||(t&&(this._boundUniforms[e]=t),this._setTexture(e,r))},e.prototype.setDepthStencilTexture=function(e,t,r){e<0||(t&&(this._boundUniforms[e]=t),r&&r.depthStencilTexture?this._setTexture(e,r,!1,!0):this._setTexture(e,null))},e.prototype._bindSamplerUniformToChannel=function(e,t){var r=this._boundUniforms[e];r._currentState!==t&&(this._gl.uniform1i(r,t),r._currentState=t)},e.prototype._getTextureWrapMode=function(t){switch(t){case e.TEXTURE_WRAP_ADDRESSMODE:return this._gl.REPEAT;case e.TEXTURE_CLAMP_ADDRESSMODE:return this._gl.CLAMP_TO_EDGE;case e.TEXTURE_MIRROR_ADDRESSMODE:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT},e.prototype._setTexture=function(t,r,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=!1),!r)return null!=this._boundTexturesCache[t]&&(this._activeChannel=t,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)),!1;if(r.video)this._activeChannel=t,r.update();else if(r.delayLoadState===e.DELAYLOADSTATE_NOTLOADED)return r.delayLoad(),!1;var o;o=i?r.depthStencilTexture:r.isReady()?r.getInternalTexture():r.isCube?this.emptyCubeTexture:r.is3D?this.emptyTexture3D:this.emptyTexture,n||(t=this._getCorrectTextureChannel(t,o));var s=!0;if(this._boundTexturesCache[t]===o&&(this._moveBoundTextureOnTop(o),n||this._bindSamplerUniformToChannel(o._initialSlot,t),s=!1),this._activeChannel=t,o&&o.isMultiview)s&&this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,o,n);else if(o&&o.is3D)s&&this._bindTextureDirectly(this._gl.TEXTURE_3D,o,n),o&&o._cachedWrapU!==r.wrapU&&(o._cachedWrapU=r.wrapU,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(r.wrapU),o)),o&&o._cachedWrapV!==r.wrapV&&(o._cachedWrapV=r.wrapV,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r.wrapV),o)),o&&o._cachedWrapR!==r.wrapR&&(o._cachedWrapR=r.wrapR,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(r.wrapR),o)),this._setAnisotropicLevel(this._gl.TEXTURE_3D,r);else if(o&&o.isCube){if(s&&this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,o,n),o._cachedCoordinatesMode!==r.coordinatesMode){o._cachedCoordinatesMode=r.coordinatesMode;var a=r.coordinatesMode!==e.TEXTURE_CUBIC_MODE&&r.coordinatesMode!==e.TEXTURE_SKYBOX_MODE?this._gl.REPEAT:this._gl.CLAMP_TO_EDGE;this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_WRAP_S,a,o),this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_WRAP_T,a)}this._setAnisotropicLevel(this._gl.TEXTURE_CUBE_MAP,r)}else s&&this._bindTextureDirectly(this._gl.TEXTURE_2D,o,n),o&&o._cachedWrapU!==r.wrapU&&(o._cachedWrapU=r.wrapU,this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(r.wrapU),o)),o&&o._cachedWrapV!==r.wrapV&&(o._cachedWrapV=r.wrapV,this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r.wrapV),o)),this._setAnisotropicLevel(this._gl.TEXTURE_2D,r);return!0},e.prototype.setTextureArray=function(e,t,r){if(!(e<0)&&t){this._textureUnits&&this._textureUnits.length===r.length||(this._textureUnits=new Int32Array(r.length));for(var n=0;n<r.length;n++)this._textureUnits[n]=this._getCorrectTextureChannel(e+n,r[n].getInternalTexture());this._gl.uniform1iv(t,this._textureUnits);for(var i=0;i<r.length;i++)this._setTexture(this._textureUnits[i],r[i],!0)}},e.prototype._setAnisotropicLevel=function(t,r){var n=r.getInternalTexture();if(n){var i=this._caps.textureAnisotropicFilterExtension,o=r.anisotropicFilteringLevel;n.samplingMode!==e.TEXTURE_LINEAR_LINEAR_MIPNEAREST&&n.samplingMode!==e.TEXTURE_LINEAR_LINEAR_MIPLINEAR&&n.samplingMode!==e.TEXTURE_LINEAR_LINEAR&&(o=1),i&&n._cachedAnisotropicFilteringLevel!==o&&(this._setTextureParameterFloat(t,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o,this._caps.maxAnisotropy),n),n._cachedAnisotropicFilteringLevel=o)}},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.readPixels=function(e,t,r,n){var i=new Uint8Array(n*r*4);return this._gl.readPixels(e,t,r,n,this._gl.RGBA,this._gl.UNSIGNED_BYTE,i),i},e.prototype.addExternalData=function(e,t){return this._externalData||(this._externalData=new s.StringDictionary),this._externalData.add(e,t)},e.prototype.getExternalData=function(e){return this._externalData||(this._externalData=new s.StringDictionary),this._externalData.get(e)},e.prototype.getOrAddExternalDataWithFactory=function(e,t){return this._externalData||(this._externalData=new s.StringDictionary),this._externalData.getOrAddWithFactory(e,t)},e.prototype.removeExternalData=function(e){return this._externalData||(this._externalData=new s.StringDictionary),this._externalData.remove(e)},e.prototype.unbindAllAttributes=function(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(var e=0;e<this._caps.maxVertexAttribs;e++)this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}else{e=0;for(var t=this._vertexAttribArraysEnabled.length;e<t;e++)e>=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||(this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1)}},e.prototype.releaseEffects=function(){for(var e in this._compiledEffects)this._deleteProgram(this._compiledEffects[e]._program);this._compiledEffects={}},e.prototype.dispose=function(){for(this.hideLoadingUI(),this.stopRenderLoop(),this.onNewSceneAddedObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._rescalePostProcess&&this._rescalePostProcess.dispose();this.scenes.length;)this.scenes[0].dispose();1===e.Instances.length&&e.audioEngine&&e.audioEngine.dispose(),this.releaseEffects(),this.unbindAllAttributes(),this._boundUniforms=[],this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.disableVR(),_.DomManagement.IsWindowObjectExist()&&(window.removeEventListener("blur",this._onBlur),window.removeEventListener("focus",this._onFocus),window.removeEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted),window.removeEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted),this._renderingCanvas&&(this._renderingCanvas.removeEventListener("focus",this._onCanvasFocus),this._renderingCanvas.removeEventListener("blur",this._onCanvasBlur),this._renderingCanvas.removeEventListener("pointerout",this._onCanvasPointerOut),this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),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),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));var t=e.Instances.indexOf(this);t>=0&&e.Instances.splice(t,1),this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers=[],this._renderingCanvas=null,this._currentProgram=null,this._bindedRenderFunction=null,this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear(),h.Effect.ResetCache();for(var r=0,n=this._activeRequests;r<n.length;r++){n[r].abort()}},e.prototype.displayLoadingUI=function(){if(_.DomManagement.IsWindowObjectExist()){var e=this.loadingScreen;e&&e.displayLoadingUI()}},e.prototype.hideLoadingUI=function(){if(_.DomManagement.IsWindowObjectExist()){var e=this.loadingScreen;e&&e.hideLoadingUI()}},Object.defineProperty(e.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=e.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){this._loadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadingUIText",{set:function(e){this.loadingScreen.loadingUIText=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadingUIBackgroundColor",{set:function(e){this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!0,configurable:!0}),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.getVertexShaderSource=function(e){var t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null},e.prototype.getFragmentShaderSource=function(e){var t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null},e.prototype.getError=function(){return this._gl.getError()},e.prototype.getFps=function(){return this._fps},e.prototype.getDeltaTime=function(){return this._deltaTime},e.prototype._measureFps=function(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0},e.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(!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 c=void 0!==e.type?this._getWebGLTextureType(e.type):s.UNSIGNED_BYTE;switch(c){case s.UNSIGNED_BYTE:o||(o=new Uint8Array(4*t*r)),c=s.UNSIGNED_BYTE;break;default:o||(o=new Float32Array(4*t*r)),c=s.FLOAT}return s.readPixels(0,0,t,r,s.RGBA,c,o),s.bindFramebuffer(s.FRAMEBUFFER,this._currentFramebuffer),o},e.prototype._canRenderToFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(e.TEXTURETYPE_FLOAT)},e.prototype._canRenderToHalfFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(e.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,c=new Uint8Array(4);t.readPixels(0,0,1,1,s,a,c),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(t){if(1===this._webGLVersion){switch(t){case e.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case e.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT_OES;case e.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE}return this._gl.UNSIGNED_BYTE}switch(t){case e.TEXTURETYPE_BYTE:return this._gl.BYTE;case e.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case e.TEXTURETYPE_SHORT:return this._gl.SHORT;case e.TEXTURETYPE_UNSIGNED_SHORT:return this._gl.UNSIGNED_SHORT;case e.TEXTURETYPE_INT:return this._gl.INT;case e.TEXTURETYPE_UNSIGNED_INTEGER:return this._gl.UNSIGNED_INT;case e.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case e.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT;case e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5;case e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case e.TEXTURETYPE_UNSIGNED_INT_24_8:return this._gl.UNSIGNED_INT_24_8;case e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case e.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(t){var r=this._gl.RGBA;switch(t){case e.TEXTUREFORMAT_ALPHA:r=this._gl.ALPHA;break;case e.TEXTUREFORMAT_LUMINANCE:r=this._gl.LUMINANCE;break;case e.TEXTUREFORMAT_LUMINANCE_ALPHA:r=this._gl.LUMINANCE_ALPHA;break;case e.TEXTUREFORMAT_RED:r=this._gl.RED;break;case e.TEXTUREFORMAT_RG:r=this._gl.RG;break;case e.TEXTUREFORMAT_RGB:r=this._gl.RGB;break;case e.TEXTUREFORMAT_RGBA:r=this._gl.RGBA}if(this._webGLVersion>1)switch(t){case e.TEXTUREFORMAT_RED_INTEGER:r=this._gl.RED_INTEGER;break;case e.TEXTUREFORMAT_RG_INTEGER:r=this._gl.RG_INTEGER;break;case e.TEXTUREFORMAT_RGB_INTEGER:r=this._gl.RGB_INTEGER;break;case e.TEXTUREFORMAT_RGBA_INTEGER:r=this._gl.RGBA_INTEGER}return r},e.prototype._getRGBABufferInternalSizedFormat=function(t,r){if(1===this._webGLVersion){if(void 0!==r)switch(r){case e.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case e.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case e.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA}return this._gl.RGBA}switch(t){case e.TEXTURETYPE_BYTE:switch(r){case e.TEXTUREFORMAT_RED:return this._gl.R8_SNORM;case e.TEXTUREFORMAT_RG:return this._gl.RG8_SNORM;case e.TEXTUREFORMAT_RGB:return this._gl.RGB8_SNORM;case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8I;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case e.TEXTURETYPE_UNSIGNED_BYTE:switch(r){case e.TEXTUREFORMAT_RED:return this._gl.R8;case e.TEXTUREFORMAT_RG:return this._gl.RG8;case e.TEXTUREFORMAT_RGB:return this._gl.RGB8;case e.TEXTUREFORMAT_RGBA:return this._gl.RGBA8;case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8UI;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8UI;default:return this._gl.RGBA8}case e.TEXTURETYPE_SHORT:switch(r){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16I;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16I}case e.TEXTURETYPE_UNSIGNED_SHORT:switch(r){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16UI;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16UI}case e.TEXTURETYPE_INT:switch(r){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32I;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32I}case e.TEXTURETYPE_UNSIGNED_INTEGER:switch(r){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32UI;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32UI}case e.TEXTURETYPE_FLOAT:switch(r){case e.TEXTUREFORMAT_RED:return this._gl.R32F;case e.TEXTUREFORMAT_RG:return this._gl.RG32F;case e.TEXTUREFORMAT_RGB:return this._gl.RGB32F;case e.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA32F}case e.TEXTURETYPE_HALF_FLOAT:switch(r){case e.TEXTUREFORMAT_RED:return this._gl.R16F;case e.TEXTUREFORMAT_RG:return this._gl.RG16F;case e.TEXTUREFORMAT_RGB:return this._gl.RGB16F;case e.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA16F}case e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.RGB565;case e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.R11F_G11F_B10F;case e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.RGB9_E5;case e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.RGBA4;case e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.RGB5_A1;case e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:switch(r){case e.TEXTUREFORMAT_RGBA:return this._gl.RGB10_A2;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return this._gl.RGBA8},e.prototype._getRGBAMultiSampleBufferFormat=function(t){return t===e.TEXTURETYPE_FLOAT?this._gl.RGBA32F:t===e.TEXTURETYPE_HALF_FLOAT?this._gl.RGBA16F:this._gl.RGBA8},e.prototype._loadFile=function(e,t,r,n,i,o){var s=this,a=c.Tools.LoadFile(e,t,r,n,i,o);return this._activeRequests.push(a),a.onCompleteObservable.add(function(e){s._activeRequests.splice(s._activeRequests.indexOf(e),1)}),a},e.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)})})},e.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)})},e.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)},e.isSupported=function(){try{var e=document.createElement("canvas");return null!=(e.getContext("webgl")||e.getContext("experimental-webgl"))&&!!window.WebGLRenderingContext}catch(e){return!1}},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:"Macintosh",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]},{key:"iPhone",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]},{key:"iPad",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]}],e._TextureLoaders=[],e.ALPHA_DISABLE=m.Constants.ALPHA_DISABLE,e.ALPHA_ADD=m.Constants.ALPHA_ADD,e.ALPHA_COMBINE=m.Constants.ALPHA_COMBINE,e.ALPHA_SUBTRACT=m.Constants.ALPHA_SUBTRACT,e.ALPHA_MULTIPLY=m.Constants.ALPHA_MULTIPLY,e.ALPHA_MAXIMIZED=m.Constants.ALPHA_MAXIMIZED,e.ALPHA_ONEONE=m.Constants.ALPHA_ONEONE,e.ALPHA_PREMULTIPLIED=m.Constants.ALPHA_PREMULTIPLIED,e.ALPHA_PREMULTIPLIED_PORTERDUFF=m.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,e.ALPHA_INTERPOLATE=m.Constants.ALPHA_INTERPOLATE,e.ALPHA_SCREENMODE=m.Constants.ALPHA_SCREENMODE,e.DELAYLOADSTATE_NONE=m.Constants.DELAYLOADSTATE_NONE,e.DELAYLOADSTATE_LOADED=m.Constants.DELAYLOADSTATE_LOADED,e.DELAYLOADSTATE_LOADING=m.Constants.DELAYLOADSTATE_LOADING,e.DELAYLOADSTATE_NOTLOADED=m.Constants.DELAYLOADSTATE_NOTLOADED,e.NEVER=m.Constants.NEVER,e.ALWAYS=m.Constants.ALWAYS,e.LESS=m.Constants.LESS,e.EQUAL=m.Constants.EQUAL,e.LEQUAL=m.Constants.LEQUAL,e.GREATER=m.Constants.GREATER,e.GEQUAL=m.Constants.GEQUAL,e.NOTEQUAL=m.Constants.NOTEQUAL,e.KEEP=m.Constants.KEEP,e.REPLACE=m.Constants.REPLACE,e.INCR=m.Constants.INCR,e.DECR=m.Constants.DECR,e.INVERT=m.Constants.INVERT,e.INCR_WRAP=m.Constants.INCR_WRAP,e.DECR_WRAP=m.Constants.DECR_WRAP,e.TEXTURE_CLAMP_ADDRESSMODE=m.Constants.TEXTURE_CLAMP_ADDRESSMODE,e.TEXTURE_WRAP_ADDRESSMODE=m.Constants.TEXTURE_WRAP_ADDRESSMODE,e.TEXTURE_MIRROR_ADDRESSMODE=m.Constants.TEXTURE_MIRROR_ADDRESSMODE,e.TEXTUREFORMAT_ALPHA=m.Constants.TEXTUREFORMAT_ALPHA,e.TEXTUREFORMAT_LUMINANCE=m.Constants.TEXTUREFORMAT_LUMINANCE,e.TEXTUREFORMAT_LUMINANCE_ALPHA=m.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA,e.TEXTUREFORMAT_RGB=m.Constants.TEXTUREFORMAT_RGB,e.TEXTUREFORMAT_RGBA=m.Constants.TEXTUREFORMAT_RGBA,e.TEXTUREFORMAT_RED=m.Constants.TEXTUREFORMAT_RED,e.TEXTUREFORMAT_R=m.Constants.TEXTUREFORMAT_R,e.TEXTUREFORMAT_RG=m.Constants.TEXTUREFORMAT_RG,e.TEXTUREFORMAT_RED_INTEGER=m.Constants.TEXTUREFORMAT_RED_INTEGER,e.TEXTUREFORMAT_R_INTEGER=m.Constants.TEXTUREFORMAT_R_INTEGER,e.TEXTUREFORMAT_RG_INTEGER=m.Constants.TEXTUREFORMAT_RG_INTEGER,e.TEXTUREFORMAT_RGB_INTEGER=m.Constants.TEXTUREFORMAT_RGB_INTEGER,e.TEXTUREFORMAT_RGBA_INTEGER=m.Constants.TEXTUREFORMAT_RGBA_INTEGER,e.TEXTURETYPE_UNSIGNED_BYTE=m.Constants.TEXTURETYPE_UNSIGNED_BYTE,e.TEXTURETYPE_UNSIGNED_INT=m.Constants.TEXTURETYPE_UNSIGNED_INT,e.TEXTURETYPE_FLOAT=m.Constants.TEXTURETYPE_FLOAT,e.TEXTURETYPE_HALF_FLOAT=m.Constants.TEXTURETYPE_HALF_FLOAT,e.TEXTURETYPE_BYTE=m.Constants.TEXTURETYPE_BYTE,e.TEXTURETYPE_SHORT=m.Constants.TEXTURETYPE_SHORT,e.TEXTURETYPE_UNSIGNED_SHORT=m.Constants.TEXTURETYPE_UNSIGNED_SHORT,e.TEXTURETYPE_INT=m.Constants.TEXTURETYPE_INT,e.TEXTURETYPE_UNSIGNED_INTEGER=m.Constants.TEXTURETYPE_UNSIGNED_INTEGER,e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=m.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4,e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=m.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1,e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=m.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=m.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV,e.TEXTURETYPE_UNSIGNED_INT_24_8=m.Constants.TEXTURETYPE_UNSIGNED_INT_24_8,e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=m.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV,e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=m.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV,e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=m.Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV,e.TEXTURE_NEAREST_SAMPLINGMODE=m.Constants.TEXTURE_NEAREST_SAMPLINGMODE,e.TEXTURE_BILINEAR_SAMPLINGMODE=m.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,e.TEXTURE_TRILINEAR_SAMPLINGMODE=m.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,e.TEXTURE_NEAREST_NEAREST_MIPLINEAR=m.Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR,e.TEXTURE_LINEAR_LINEAR_MIPNEAREST=m.Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST,e.TEXTURE_LINEAR_LINEAR_MIPLINEAR=m.Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR,e.TEXTURE_NEAREST_NEAREST_MIPNEAREST=m.Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST,e.TEXTURE_NEAREST_LINEAR_MIPNEAREST=m.Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST,e.TEXTURE_NEAREST_LINEAR_MIPLINEAR=m.Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR,e.TEXTURE_NEAREST_LINEAR=m.Constants.TEXTURE_NEAREST_LINEAR,e.TEXTURE_NEAREST_NEAREST=m.Constants.TEXTURE_NEAREST_NEAREST,e.TEXTURE_LINEAR_NEAREST_MIPNEAREST=m.Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST,e.TEXTURE_LINEAR_NEAREST_MIPLINEAR=m.Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR,e.TEXTURE_LINEAR_LINEAR=m.Constants.TEXTURE_LINEAR_LINEAR,e.TEXTURE_LINEAR_NEAREST=m.Constants.TEXTURE_LINEAR_NEAREST,e.TEXTURE_EXPLICIT_MODE=m.Constants.TEXTURE_EXPLICIT_MODE,e.TEXTURE_SPHERICAL_MODE=m.Constants.TEXTURE_SPHERICAL_MODE,e.TEXTURE_PLANAR_MODE=m.Constants.TEXTURE_PLANAR_MODE,e.TEXTURE_CUBIC_MODE=m.Constants.TEXTURE_CUBIC_MODE,e.TEXTURE_PROJECTION_MODE=m.Constants.TEXTURE_PROJECTION_MODE,e.TEXTURE_SKYBOX_MODE=m.Constants.TEXTURE_SKYBOX_MODE,e.TEXTURE_INVCUBIC_MODE=m.Constants.TEXTURE_INVCUBIC_MODE,e.TEXTURE_EQUIRECTANGULAR_MODE=m.Constants.TEXTURE_EQUIRECTANGULAR_MODE,e.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=m.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,e.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=m.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,e.SCALEMODE_FLOOR=m.Constants.SCALEMODE_FLOOR,e.SCALEMODE_NEAREST=m.Constants.SCALEMODE_NEAREST,e.SCALEMODE_CEILING=m.Constants.SCALEMODE_CEILING,e.CollisionsEpsilon=.001,e._RescalePostProcessFactory=null,e}()},"./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:!0,configurable:!0}),Object.defineProperty(e,"LastCreatedScene",{get:function(){var e=this.LastCreatedEngine;return e?0===e.scenes.length?null:e.scenes[e.scenes.length-1]:null},enumerable:!0,configurable:!0}),e.Instances=new Array,e}()},"./Engines/index.ts":
- /*!**************************!*\
- !*** ./Engines/index.ts ***!
- \**************************/
- /*! exports provided: Constants, InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine, EngineStore, NullEngineOptions, NullEngine, _OcclusionDataStorage, _forceTransformFeedbackToBundle */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(/*! ./engine */"./Engines/engine.ts");r.d(t,"InstancingAttributeInfo",function(){return i.InstancingAttributeInfo}),r.d(t,"DepthTextureCreationOptions",function(){return i.DepthTextureCreationOptions}),r.d(t,"EngineCapabilities",function(){return i.EngineCapabilities}),r.d(t,"Engine",function(){return i.Engine});var o=r(/*! ./engineStore */"./Engines/engineStore.ts");r.d(t,"EngineStore",function(){return o.EngineStore});var s=r(/*! ./nullEngine */"./Engines/nullEngine.ts");r.d(t,"NullEngineOptions",function(){return s.NullEngineOptions}),r.d(t,"NullEngine",function(){return s.NullEngine});var a=r(/*! ./Extensions/index */"./Engines/Extensions/index.ts");r.d(t,"_OcclusionDataStorage",function(){return a._OcclusionDataStorage}),r.d(t,"_forceTransformFeedbackToBundle",function(){return a._forceTransformFeedbackToBundle})},"./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 l}),r.d(t,"NullEngine",function(){return u});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"),c=r(/*! ./constants */"./Engines/constants.ts"),l=function(){return function(){this.renderWidth=512,this.renderHeight=256,this.textureSize=512,this.deterministicLockstep=!1,this.lockstepMaxSteps=4}}(),u=function(t){function r(r){void 0===r&&(r=new l);var n=t.call(this,null)||this;void 0===r.deterministicLockstep&&(r.deterministicLockstep=!1),void 0===r.lockstepMaxSteps&&(r.lockstepMaxSteps=4),n._options=r,n._caps=new o.EngineCapabilities,n._caps.maxTexturesImageUnits=16,n._caps.maxVertexTextureImageUnits=16,n._caps.maxTextureSize=512,n._caps.maxCubemapTextureSize=512,n._caps.maxRenderTextureSize=512,n._caps.maxVertexAttribs=16,n._caps.maxVaryingVectors=16,n._caps.maxFragmentUniformVectors=16,n._caps.maxVertexUniformVectors=16,n._caps.standardDerivatives=!1,n._caps.astc=null,n._caps.s3tc=null,n._caps.pvrtc=null,n._caps.etc1=null,n._caps.etc2=null,n._caps.textureAnisotropicFilterExtension=null,n._caps.maxAnisotropy=0,n._caps.uintIndices=!1,n._caps.fragmentDepthSupported=!1,n._caps.highPrecisionShaderSupported=!0,n._caps.colorBufferFloat=!1,n._caps.textureFloat=!1,n._caps.textureFloatLinearFiltering=!1,n._caps.textureFloatRender=!1,n._caps.textureHalfFloat=!1,n._caps.textureHalfFloatLinearFiltering=!1,n._caps.textureHalfFloatRender=!1,n._caps.textureLOD=!1,n._caps.drawBuffersExtension=!1,n._caps.depthTextureExtension=!1,n._caps.vertexArrayObject=!1,n._caps.instancedArrays=!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 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){return{capacity:0,references:1,is32Bits:!1}},r.prototype.createIndexBuffer=function(e){return{capacity:0,references:1,is32Bits:!1}},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){return{transformFeedback:null,__SPECTOR_rebuildProgram:null,isParallelCompiled:!1}},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.setMatrix=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.setColor3=function(e,t){},r.prototype.setColor4=function(e,t,r){},r.prototype.setAlphaMode=function(e,t){void 0===t&&(t=!1),this._alphaMode!==e&&(this._alphaState.alphaBlend=e!==c.Constants.ALPHA_DISABLE,t||this.setDepthWrite(e===c.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,l,u,h){void 0===i&&(i=c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===o&&(o=null),void 0===s&&(s=null),void 0===l&&(l=null);var d=new a.InternalTexture(this,a.InternalTexture.DATASOURCE_URL),f=String(e);return d.url=f,d.generateMipMaps=!t,d.samplingMode=i,d.invertY=r,d.baseWidth=this._options.textureSize,d.baseHeight=this._options.textureSize,d.width=this._options.textureSize,d.height=this._options.textureSize,h&&(d.format=h),d.isReady=!0,o&&o(),this._internalTexturesCache.push(d),d},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?c.Constants.TEXTURETYPE_UNSIGNED_INT:t.type,r.samplingMode=void 0===t.samplingMode?c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:t.samplingMode):(r.generateMipMaps=t,r.generateDepthBuffer=!0,r.generateStencilBuffer=!1,r.type=c.Constants.TEXTURETYPE_UNSIGNED_INT,r.samplingMode=c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE);var n=new a.InternalTexture(this,a.InternalTexture.DATASOURCE_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){return{capacity:1,references:1,is32Bits:!1}},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._releaseBuffer=function(e){return e.references--,0===e.references},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"))},"./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(){return 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 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 c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.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(){return 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 n.__extends(t,e),t}(s),c=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.pickInfo=n,i}return 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 c});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"),c=function(e){function t(t){var r=e.call(this,t)||this;return r.controllerType=a.PoseEnabledControllerType.DAYDREAM,r}return 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(c.GAMEPAD_ID_PREFIX)},create:function(e){return new c(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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math */"./Maths/math.ts"),o=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),a=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),c=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),l=function(e){function t(t){var r=e.call(this,t)||this;return r._buttonIndexToObservableNameMap=["onTrackpadChangedObservable","onTriggerStateChangedObservable"],r.controllerType=c.PoseEnabledControllerType.GEAR_VR,r._calculatedPosition=new i.Vector3("left"==r.hand?-.15:.15,-.5,.25),r._disableTrackPosition(r._calculatedPosition),r}return 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);c.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(l.GAMEPAD_ID_PREFIX)||-1!==e.id.indexOf("Oculus Go")},create:function(e){return new l(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 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 */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 c=r(/*! ./viveController */"./Gamepads/Controllers/viveController.ts");r.d(t,"ViveController",function(){return c.ViveController});var l=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts");r.d(t,"WebVRController",function(){return l.WebVRController});var u=r(/*! ./windowsMotionController */"./Gamepads/Controllers/windowsMotionController.ts");r.d(t,"WindowsMotionController",function(){return u.WindowsMotionController})},"./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"),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 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.MODEL_BASE_URL,n,e,function(e){i._defaultModel=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:!0,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:!0,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:!0,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:!0,configurable:!0}),t.prototype._handleButtonChange=function(e,t,r){var n=t,i="right"===this.hand?-1:1;switch(e){case 0:return void this.onPadStateChangedObservable.notifyObservers(n);case 1:return this._defaultModel&&(this._defaultModel.getChildren()[3].rotation.x=.2*-n.value,this._defaultModel.getChildren()[3].position.y=.005*-n.value,this._defaultModel.getChildren()[3].position.z=.005*-n.value),void this.onTriggerStateChangedObservable.notifyObservers(n);case 2:return this._defaultModel&&(this._defaultModel.getChildren()[4].position.x=i*n.value*.0035),void this.onSecondaryTriggerStateChangedObservable.notifyObservers(n);case 3:return this._defaultModel&&(n.pressed?this._defaultModel.getChildren()[1].position.y=-.001:this._defaultModel.getChildren()[1].position.y=0),void this.onMainButtonStateChangedObservable.notifyObservers(n);case 4:return this._defaultModel&&(n.pressed?this._defaultModel.getChildren()[2].position.y=-.001:this._defaultModel.getChildren()[2].position.y=0),void this.onSecondaryButtonStateChangedObservable.notifyObservers(n);case 5:return void this.onThumbRestChangedObservable.notifyObservers(n)}},t.MODEL_BASE_URL="https://controllers.babylonjs.com/oculus/",t.MODEL_LEFT_FILENAME="left.babylon",t.MODEL_RIGHT_FILENAME="right.babylon",t}(s.WebVRController);a.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return-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 h});var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math */"./Maths/math.ts"),a=r(/*! ../../Culling/ray */"./Culling/ray.ts"),c=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts"),l=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}(),h=function(e){function t(t){var r=e.call(this,t.id,t.index,t)||this;return 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=l.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 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(){var e=this.browserGamepad.pose;if((this.updateFromDevice(e),!this._trackPosition&&c.EngineStore.LastCreatedScene&&c.EngineStore.LastCreatedScene.activeCamera&&c.EngineStore.LastCreatedScene.activeCamera.devicePosition)&&((t=c.EngineStore.LastCreatedScene.activeCamera)._computeDevicePosition(),this._deviceToWorld.setTranslation(t.devicePosition),t.deviceRotationQuaternion)){var t;(t=t)._deviceRoomRotationQuaternion.toEulerAnglesToRef(s.Tmp.Vector3[0]);var r=Math.atan2(Math.sin(s.Tmp.Vector3[0].y-this._draggedRoomRotation),Math.cos(s.Tmp.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(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&&(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._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:!0,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}(l.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 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRightButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMenuButtonStateChangedObservable",{get:function(){return this.onSecondaryButtonStateChangedObservable},enumerable:!0,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 n.__extends(t,e),t.prototype.onButtonStateChange=function(e){this._onButtonStateChange=e},Object.defineProperty(t.prototype,"defaultModel",{get:function(){return this._defaultModel},enumerable:!0,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.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 */function(e,t,r){"use strict";r.r(t),r.d(t,"WindowsMotionController",function(){return p});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 */"./Maths/math.ts"),a=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../../Culling/ray */"./Culling/ray.ts"),l=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),u=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),h=r(/*! ./genericController */"./Gamepads/Controllers/genericController.ts"),d=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),f=function(){return 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:d.PoseEnabledController.POINTING_POSE},r.onTrackpadChangedObservable=new o.Observable,r.onTrackpadValuesChangedObservable=new o.Observable,r.trackpad={x:0,y:0},r.controllerType=d.PoseEnabledControllerType.WINDOWS,r._loadedMeshInfo=null,r}return n.__extends(t,e),Object.defineProperty(t.prototype,"onTriggerButtonStateChangedObservable",{get:function(){return this.onTriggerStateChangedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMenuButtonStateChangedObservable",{get:function(){return this.onSecondaryButtonStateChangedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onGripButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onThumbstickButtonStateChangedObservable",{get:function(){return this.onPadStateChangedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTouchpadButtonStateChangedObservable",{get:function(){return this.onTrackpadChangedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTouchpadValuesChangedObservable",{get:function(){return this.onTrackpadValuesChangedObservable},enumerable:!0,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[2],this.trackpad.y=this.browserGamepad.axes[3],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.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),l.SceneLoader.IsPluginForExtensionAvailable(".glb")){var c="default";if(this.id&&!n){var u=this.id.match(t.GAMEPAD_ID_PATTERN);c=u&&u[0]||c}s="left"===this.hand?t.MODEL_LEFT_FILENAME:t.MODEL_RIGHT_FILENAME,o=t.MODEL_BASE_URL+c+"/"}else i.Logger.Warn("You need to reference GLTF loader to load Windows Motion Controllers model. Falling back to generic models"),o=h.GenericController.MODEL_BASE_URL,s=h.GenericController.MODEL_FILENAME;l.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 c=t[s];if(!c.parent){c.isPickable=!1,o=c;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:h(o,"VALUE"),pressed:h(o,"PRESSED"),unpressed:h(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 c=u(e,a);if(c){var l={index:t,value:h(c,"VALUE"),min:h(c,"MIN"),max:h(c,"MAX")};l.value&&l.min&&l.max?r.axisMeshes[t]=l:i.Logger.Warn("Missing axis submesh under mesh with name: "+a+"(VALUE: "+!!l.value+", MIN: "+!!l.min+", MAX:"+!!l.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 h(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 c.Ray(n,a,t)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onTrackpadChangedObservable.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);d.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(p.GAMEPAD_ID_PREFIX)},create:function(e){return new p(e)}})},"./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(){return 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:!0,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:!0,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:!0,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}(),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 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 l});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),s=r(/*! ../Gamepads/Controllers/poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),a=r(/*! ./xboxGamepad */"./Gamepads/xboxGamepad.ts"),c=r(/*! ./gamepad */"./Gamepads/gamepad.ts"),l=function(){function e(e){var t=this;this._scene=e,this._babylonGamepads=[],this._oneGamepadConnected=!1,this._isMonitoring=!1,this.onGamepadDisconnectedObservable=new i.Observable,o.DomManagement.IsWindowObjectExist()?(this._gamepadEventSupported="GamepadEvent"in window,this._gamepadSupport=navigator.getGamepads||navigator.webkitGetGamepads||navigator.msGetGamepads||navigator.webkitGamepads):this._gamepadEventSupported=!1,this.onGamepadConnectedObservable=new i.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);break}},this._gamepadSupport&&(this._updateGamepadObjects(),this._babylonGamepads.length&&this._startMonitoringGamepads(),this._gamepadEventSupported?(window.addEventListener("gamepadconnected",this._onGamepadConnectedEvent,!1),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent,!1)):this._startMonitoringGamepads())}return Object.defineProperty(e.prototype,"gamepads",{get:function(){return this._babylonGamepads},enumerable:!0,configurable:!0}),e.prototype.getGamepadByType=function(e){void 0===e&&(e=c.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("Xbox One");return t=r||-1!==e.id.search("Xbox 360")||-1!==e.id.search("xinput")?new a.Xbox360Pad(e.id,e.index,e,r):e.pose?s.PoseEnabledControllerHelper.InitiateController(e):new c.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&&n.Tools.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"),c=r(/*! ../Cameras/arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts"),l=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},c.ArcRotateCameraInputsManager.prototype.addGamepad=function(){return this.add(new l.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: StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController */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});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})},"./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 c});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.Start=4]="Start",e[e.Back=5]="Back",e[e.LB=6]="LB",e[e.RB=7]="RB",e[e.LeftStick=8]="LeftStick",e[e.RightStick=9]="RightStick"}(n||(n={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(i||(i={}));var c=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 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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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.axes[2],this.rightTrigger=this.browserGamepad.axes[5],this.buttonBack=this.browserGamepad.buttons[9].value,this.buttonStart=this.browserGamepad.buttons[8].value,this.buttonLeftStick=this.browserGamepad.buttons[6].value,this.buttonRightStick=this.browserGamepad.buttons[7].value,this.dPadUp=this.browserGamepad.buttons[11].value,this.dPadDown=this.browserGamepad.buttons[12].value,this.dPadLeft=this.browserGamepad.buttons[13].value,this.dPadRight=this.browserGamepad.buttons[14].value):(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 */"./Maths/math.ts"),s=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),a=r(/*! ../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),c=r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),l=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),u=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),h=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),d=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),f=function(e){function t(r,n,s){void 0===n&&(n=o.Color3.Gray()),void 0===s&&(s=h.UtilityLayerRenderer.DefaultUtilityLayer);var a=e.call(this,s)||this;a._pointerObserver=null,a.snapDistance=0,a.onSnapObservable=new i.Observable;var c=new d.StandardMaterial("",s.utilityLayerScene);c.disableLighting=!0,c.emissiveColor=n;var u=new d.StandardMaterial("",s.utilityLayerScene);u.disableLighting=!0,u.emissiveColor=n.add(new o.Color3(.3,.3,.3));var f=t._CreateArrow(s.utilityLayerScene,c);f.lookAt(a._rootMesh.position.add(r)),f.scaling.scaleInPlace(1/3),f.parent=a._rootMesh;var p=0,g=new o.Vector3,m={snapDistance:0};a.dragBehavior=new l.PointerDragBehavior({dragAxis:r}),a.dragBehavior.moveAttached=!1,a._rootMesh.addBehavior(a.dragBehavior);var _=new o.Vector3,v=new o.Matrix;return a.dragBehavior.onDragObservable.add(function(e){if(a.attachedMesh)if(a.attachedMesh.parent?(a.attachedMesh.parent.computeWorldMatrix().invertToRef(v),v.setTranslationFromFloats(0,0,0),o.Vector3.TransformCoordinatesToRef(e.delta,v,_)):_.copyFrom(e.delta),0==a.snapDistance)a.attachedMesh.position.addInPlace(_);else if(p+=e.dragDistance,Math.abs(p)>a.snapDistance){var t=Math.floor(Math.abs(p)/a.snapDistance);p%=a.snapDistance,_.normalizeToRef(g),g.scaleInPlace(a.snapDistance*t),a.attachedMesh.position.addInPlace(g),m.snapDistance=a.snapDistance*t,a.onSnapObservable.notifyObservers(m)}}),a._pointerObserver=s.utilityLayerScene.onPointerObservable.add(function(e){if(!a._customMeshSet){var t=e.pickInfo&&-1!=a._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?u:c;a._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),a}return n.__extends(t,e),t._CreateArrow=function(e,t){var r=new s.TransformNode("arrow",e),n=a.CylinderBuilder.CreateCylinder("cylinder",{diameterTop:0,height:1.5,diameterBottom:.75,tessellation:96},e),i=c.LinesBuilder.CreateLines("line",{points:[new o.Vector3(0,0,0),new o.Vector3(0,1.1,0)]},e);return i.color=t.emissiveColor,n.parent=r,i.parent=r,n.scaling.scaleInPlace(.05),n.material=t,n.rotation.x=Math.PI/2,n.position.z+=.3,i.scaling.scaleInPlace(.26),i.rotation.x=Math.PI/2,i.material=t,r},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._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},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/axisScaleGizmo.ts":
- /*!**********************************!*\
- !*** ./Gizmos/axisScaleGizmo.ts ***!
- \**********************************/
- /*! exports provided: AxisScaleGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"AxisScaleGizmo",function(){return f});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),c=r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),l=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),u=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),h=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),d=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),f=function(e){function t(t,r,n){void 0===r&&(r=o.Color3.Gray()),void 0===n&&(n=d.UtilityLayerRenderer.DefaultUtilityLayer);var h=e.call(this,n)||this;h._pointerObserver=null,h.snapDistance=0,h.onSnapObservable=new i.Observable,h.uniformScaling=!1,h._coloredMaterial=new l.StandardMaterial("",n.utilityLayerScene),h._coloredMaterial.disableLighting=!0,h._coloredMaterial.emissiveColor=r;var f=new l.StandardMaterial("",n.utilityLayerScene);f.disableLighting=!0,f.emissiveColor=r.add(new o.Color3(.3,.3,.3));var p=new s.AbstractMesh("",n.utilityLayerScene),g=a.BoxBuilder.CreateBox("yPosMesh",{size:.4},n.utilityLayerScene),m=c.LinesBuilder.CreateLines("yPosMesh",{points:[new o.Vector3(0,0,0),new o.Vector3(0,1.1,0)]},n.utilityLayerScene);m.color=h._coloredMaterial.emissiveColor,p.addChild(g),p.addChild(m),g.scaling.scaleInPlace(.1),g.material=h._coloredMaterial,g.rotation.x=Math.PI/2,g.position.z+=.3,m.scaling.scaleInPlace(.26),m.rotation.x=Math.PI/2,m.material=h._coloredMaterial,p.lookAt(h._rootMesh.position.add(t)),h._rootMesh.addChild(p),p.scaling.scaleInPlace(1/3),h.dragBehavior=new u.PointerDragBehavior({dragAxis:t}),h.dragBehavior.moveAttached=!1,h._rootMesh.addBehavior(h.dragBehavior);var _=0,v=new o.Vector3,A={snapDistance:0};return h.dragBehavior.onDragObservable.add(function(e){if(h.attachedMesh){var r=!1,n=0;h.uniformScaling?(h.attachedMesh.scaling.normalizeToRef(v),v.y<0&&v.scaleInPlace(-1)):v.copyFrom(t),0==h.snapDistance?v.scaleToRef(e.dragDistance,v):(_+=e.dragDistance,Math.abs(_)>h.snapDistance?(n=Math.floor(Math.abs(_)/h.snapDistance),_<0&&(n*=-1),_%=h.snapDistance,v.scaleToRef(h.snapDistance*n,v),r=!0):v.scaleInPlace(0)),h.attachedMesh.scaling.addInPlace(v),r&&(A.snapDistance=h.snapDistance*n,h.onSnapObservable.notifyObservers(A))}}),h._pointerObserver=n.utilityLayerScene.onPointerObservable.add(function(e){if(!h._customMeshSet){var t=e.pickInfo&&-1!=h._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?f:h._coloredMaterial;h._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),h}return n.__extends(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),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.emissiveColor)}),this._customMeshSet=!1)},t}(h.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 _});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 */"./Maths/math.ts"),a=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),c=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),u=r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),h=r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),d=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),f=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),p=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),g=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),m=r(/*! ../Misc/pivotTools */"./Misc/pivotTools.ts"),_=function(e){function t(t,r){void 0===t&&(t=s.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 d.PointerDragBehavior,n._updateScale=!1,n._anchorMesh=new a.AbstractMesh("anchor",r.utilityLayerScene),n.coloredMaterial=new g.StandardMaterial("",r.utilityLayerScene),n.coloredMaterial.disableLighting=!0,n.hoverColoredMaterial=new g.StandardMaterial("",r.utilityLayerScene),n.hoverColoredMaterial.disableLighting=!0,n._lineBoundingBox=new a.AbstractMesh("",r.utilityLayerScene),n._lineBoundingBox.rotationQuaternion=new s.Quaternion;var c=[];c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,0),new s.Vector3(n._boundingDimensions.x,0,0)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,0),new s.Vector3(0,n._boundingDimensions.y,0)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,0),new s.Vector3(0,0,n._boundingDimensions.z)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(n._boundingDimensions.x,0,0),new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,0)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(n._boundingDimensions.x,0,0),new s.Vector3(n._boundingDimensions.x,0,n._boundingDimensions.z)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,n._boundingDimensions.y,0),new s.Vector3(n._boundingDimensions.x,n._boundingDimensions.y,0)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,n._boundingDimensions.y,0),new s.Vector3(0,n._boundingDimensions.y,n._boundingDimensions.z)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,n._boundingDimensions.z),new s.Vector3(n._boundingDimensions.x,0,n._boundingDimensions.z)]},r.utilityLayerScene)),c.push(h.LinesBuilder.CreateLines("lines",{points:[new s.Vector3(0,0,n._boundingDimensions.z),new s.Vector3(0,n._boundingDimensions.y,n._boundingDimensions.z)]},r.utilityLayerScene)),c.push(h.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)),c.push(h.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)),c.push(h.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)),c.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=l.SphereBuilder.CreateSphere("",{diameter:1},r.utilityLayerScene);t.rotationQuaternion=new s.Quaternion,t.material=_.coloredMaterial,(b=new d.PointerDragBehavior({})).moveAttached=!1,b.updateDragPlane=!1,t.addBehavior(b);var i=new s.Vector3(1,0,0),a=0;b.onDragStartObservable.add(function(){i.copyFrom(t.forward),a=0}),b.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");m.PivotTools._RemoveAndStorePivotPoint(n.attachedMesh);var c=i,l=t.dragPlaneNormal.scale(s.Vector3.Dot(t.dragPlaneNormal,c)),u=c.subtract(l).normalizeToNew(),h=s.Vector3.Dot(u,t.delta)<0?Math.abs(t.delta.length()):-Math.abs(t.delta.length());h=h/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+=h,Math.abs(a)<=2*Math.PI&&(e>=8?s.Quaternion.RotationYawPitchRollToRef(0,0,h,n._tmpQuaternion):e>=4?s.Quaternion.RotationYawPitchRollToRef(h,0,0,n._tmpQuaternion):s.Quaternion.RotationYawPitchRollToRef(0,h,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(),m.PivotTools._RestorePivotPoint(n.attachedMesh)}n._updateDummy()}),b.onDragStartObservable.add(function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(t)}),b.onDragEndObservable.add(function(){n.onRotationSphereDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()}),_._rotateSpheresParent.addChild(t)},_=this,v=0;v<12;v++)f(v);n._rootMesh.addChild(n._rotateSpheresParent),n._scaleBoxesParent=new a.AbstractMesh("",r.utilityLayerScene),n._scaleBoxesParent.rotationQuaternion=new s.Quaternion;for(var A=0;A<2;A++)for(var y=0;y<2;y++)for(var b,T=function(){var e=u.BoxBuilder.CreateBox("",{size:1},r.utilityLayerScene);e.material=E.coloredMaterial;var t=new s.Vector3(0==A?-1:1,0==y?-1:1,0==x?-1:1);(b=new d.PointerDragBehavior({dragAxis:t})).moveAttached=!1,e.addBehavior(b),b.onDragObservable.add(function(t){if(n.onScaleBoxDragObservable.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");m.PivotTools._RemoveAndStorePivotPoint(n.attachedMesh);var i=t.dragDistance/n._boundingDimensions.length()*n._anchorMesh.scaling.length(),a=new s.Vector3(i,i,i);a.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)):(e.absolutePosition.subtractToRef(n._anchorMesh.position,n._tmpVector),n._anchorMesh.position.subtractInPlace(n._tmpVector)),n._anchorMesh.addChild(n.attachedMesh),n._anchorMesh.scaling.addInPlace(a),(n._anchorMesh.scaling.x<0||n._anchorMesh.scaling.y<0||n._anchorMesh.scaling.z<0)&&n._anchorMesh.scaling.subtractInPlace(a),n._anchorMesh.removeChild(n.attachedMesh),n.attachedMesh.setParent(r),m.PivotTools._RestorePivotPoint(n.attachedMesh)}n._updateDummy()}),b.onDragStartObservable.add(function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(e)}),b.onDragEndObservable.add(function(){n.onScaleBoxDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()}),E._scaleBoxesParent.addChild(e)},E=this,x=0;x<2;x++)T();n._rootMesh.addChild(n._scaleBoxesParent);var C=new Array;return n._pointerObserver=r.utilityLayerScene.onPointerObservable.add(function(e){C[e.event.pointerId]?e.pickInfo&&e.pickInfo.pickedMesh!=C[e.event.pointerId]&&(C[e.event.pointerId].material=n.coloredMaterial,delete C[e.event.pointerId]):n._rotateSpheresParent.getChildMeshes().concat(n._scaleBoxesParent.getChildMeshes()).forEach(function(t){e.pickInfo&&e.pickInfo.pickedMesh==t&&(C[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 n.__extends(t,e),t.prototype.setColor=function(e){this.coloredMaterial.emissiveColor=e,this.hoverColoredMaterial.emissiveColor=e.clone().add(new s.Color3(.3,.3,.3)),this._lineBoundingBox.getChildren().forEach(function(t){t.color&&(t.color=e)})},t.prototype._attachedMeshChanged=function(e){var t=this;if(e){m.PivotTools._RemoveAndStorePivotPoint(e);var r=e.parent;this._anchorMesh.addChild(e),this._anchorMesh.removeChild(e),e.setParent(r),m.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){m.PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);var e=this.attachedMesh.parent;this.attachedMesh.setParent(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 t=this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren,this.includeChildPredicate);t.max.subtractToRef(t.min,this._boundingDimensions),this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions),this._lineBoundingBox.position.set((t.max.x+t.min.x)/2,(t.max.y+t.min.y)/2,(t.max.z+t.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._updateRotationSpheres(),this._updateScaleBoxes(),this.attachedMesh&&(this._existingMeshScale.copyFrom(this.attachedMesh.scaling),m.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;t<2;t++)for(var r=0;r<2;r++)for(var n=0;n<2;n++){var i=4*t+2*r+n;if(e[i])if(e[i].position.set(this._boundingDimensions.x*t,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)),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[i].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var o=this.scaleBoxSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[i].scaling.set(o,o,o)}else e[i].scaling.set(this.scaleBoxSize,this.scaleBoxSize,this.scaleBoxSize)}},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){this._scaleBoxesParent.getChildMeshes().forEach(function(t,r){t.setEnabled(e)})},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=c.Mesh.CreateBox("dummy",1,this.gizmoLayer.utilityLayerScene),this._dragMesh.visibility=0,this._dragMesh.rotationQuaternion=new s.Quaternion,this.pointerDragBehavior.useObjectOrienationForDragging=!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=s.Epsilon),0===i.scaling.x&&(i.scaling.x=s.Epsilon),0===i.scaling.z&&(i.scaling.z=s.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 */"./Maths/math.ts"),i=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),o=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),s=function(){function e(e){void 0===e&&(e=o.UtilityLayerRenderer.DefaultUtilityLayer);var t=this;this.gizmoLayer=e,this.scaleRatio=1,this._tmpMatrix=new n.Matrix,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._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function(){t._update()}),this.attachedMesh=null}return Object.defineProperty(e.prototype,"attachedMesh",{get:function(){return this._attachedMesh},set:function(e){this._attachedMesh=e,this._rootMesh.setEnabled(!!e),this._attachedMeshChanged(e)},enumerable:!0,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._attachedMeshChanged=function(e){},e.prototype._update=function(){if(this.attachedMesh){var e=this.attachedMesh._effectiveMesh||this.attachedMesh;if(this.updateGizmoRotationToMatchAttachedMesh?(this._rootMesh.rotationQuaternion||(this._rootMesh.rotationQuaternion=n.Quaternion.RotationYawPitchRoll(this._rootMesh.rotation.y,this._rootMesh.rotation.x,this._rootMesh.rotation.z)),this._tempVector.copyFrom(e.scaling),e.scaling.x<0&&(e.scaling.x*=-1),e.scaling.y<0&&(e.scaling.y*=-1),e.scaling.z<0&&(e.scaling.z*=-1),e.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix),e.scaling.copyFrom(this._tempVector),e.computeWorldMatrix(),n.Quaternion.FromRotationMatrixToRef(this._tmpMatrix,this._rootMesh.rotationQuaternion)):this._rootMesh.rotationQuaternion&&this._rootMesh.rotationQuaternion.set(0,0,0,1),this.updateGizmoPositionToMatchAttachedMesh&&this._rootMesh.position.copyFrom(e.absolutePosition),this._updateScale&&this.gizmoLayer.utilityLayerScene.activeCamera&&this.attachedMesh){var t=this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition;this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition&&(t=this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition),this._rootMesh.position.subtractToRef(t,this._tempVector);var r=this._tempVector.length()*this.scaleRatio;this._rootMesh.scaling.set(r,r,r)}}},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 */"./Maths/math.ts"),c=r(/*! ../Behaviors/Meshes/sixDofDragBehavior */"./Behaviors/Meshes/sixDofDragBehavior.ts"),l=r(/*! ./rotationGizmo */"./Gizmos/rotationGizmo.ts"),u=r(/*! ./positionGizmo */"./Gizmos/positionGizmo.ts"),h=r(/*! ./scaleGizmo */"./Gizmos/scaleGizmo.ts"),d=r(/*! ./boundingBoxGizmo */"./Gizmos/boundingBoxGizmo.ts"),f=function(){function e(e){var t=this;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.boundingBoxDragBehavior=new c.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.gizmos={positionGizmo:null,rotationGizmo:null,scaleGizmo:null,boundingBoxGizmo:null},this._pointerObserver=e.onPointerObservable.add(function(e){if(t.usePointerToAttachGizmos&&e.type==i.PointerEventTypes.POINTERDOWN)if(e.pickInfo&&e.pickInfo.pickedMesh){var r=e.pickInfo.pickedMesh;if(null==t.attachableMeshes)for(;r&&null!=r.parent;)r=r.parent;else{var n=!1;t.attachableMeshes.forEach(function(e){r&&(r==e||r.isDescendantOf(e))&&(r=e,n=!0)}),n||(r=null)}r instanceof o.AbstractMesh?t._attachedMesh!=r&&t.attachToMesh(r):t.clearGizmoOnEmptyPointerEvent&&t.attachToMesh(null)}else t.clearGizmoOnEmptyPointerEvent&&t.attachToMesh(null)})}return 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.gizmos.positionGizmo.attachedMesh=this._attachedMesh):this.gizmos.positionGizmo&&(this.gizmos.positionGizmo.attachedMesh=null),this._gizmosEnabled.positionGizmo=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationGizmoEnabled",{get:function(){return this._gizmosEnabled.rotationGizmo},set:function(e){e?(this.gizmos.rotationGizmo||(this.gizmos.rotationGizmo=new l.RotationGizmo(this._defaultUtilityLayer)),this.gizmos.rotationGizmo.attachedMesh=this._attachedMesh):this.gizmos.rotationGizmo&&(this.gizmos.rotationGizmo.attachedMesh=null),this._gizmosEnabled.rotationGizmo=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scaleGizmoEnabled",{get:function(){return this._gizmosEnabled.scaleGizmo},set:function(e){e?(this.gizmos.scaleGizmo=this.gizmos.scaleGizmo||new h.ScaleGizmo(this._defaultUtilityLayer),this.gizmos.scaleGizmo.attachedMesh=this._attachedMesh):this.gizmos.scaleGizmo&&(this.gizmos.scaleGizmo.attachedMesh=null),this._gizmosEnabled.scaleGizmo=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boundingBoxGizmoEnabled",{get:function(){return this._gizmosEnabled.boundingBoxGizmo},set:function(e){e?(this.gizmos.boundingBoxGizmo=this.gizmos.boundingBoxGizmo||new d.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.gizmos.boundingBoxGizmo.attachedMesh=null),this._gizmosEnabled.boundingBoxGizmo=e},enumerable:!0,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 */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 c=r(/*! ./planeRotationGizmo */"./Gizmos/planeRotationGizmo.ts");r.d(t,"PlaneRotationGizmo",function(){return c.PlaneRotationGizmo});var l=r(/*! ./positionGizmo */"./Gizmos/positionGizmo.ts");r.d(t,"PositionGizmo",function(){return l.PositionGizmo});var u=r(/*! ./rotationGizmo */"./Gizmos/rotationGizmo.ts");r.d(t,"RotationGizmo",function(){return u.RotationGizmo});var h=r(/*! ./scaleGizmo */"./Gizmos/scaleGizmo.ts");r.d(t,"ScaleGizmo",function(){return h.ScaleGizmo});var d=r(/*! ./lightGizmo */"./Gizmos/lightGizmo.ts");r.d(t,"LightGizmo",function(){return d.LightGizmo})},"./Gizmos/lightGizmo.ts":
- /*!******************************!*\
- !*** ./Gizmos/lightGizmo.ts ***!
- \******************************/
- /*! exports provided: LightGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"LightGizmo",function(){return l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),c=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),l=function(e){function t(t){var r=e.call(this,t)||this;return r._light=null,r._box=s.Mesh.CreateCylinder("light",.02,0,.02,16,1,r.gizmoLayer.utilityLayerScene),r._box.rotation.x=-Math.PI/2,r._box.bakeCurrentTransformIntoVertices(),r._box.material=new c.StandardMaterial("",r.gizmoLayer.utilityLayerScene),r._box.material.emissiveColor=i.Color3.Yellow(),r._rootMesh.addChild(r._box),r.attachedMesh=new o.AbstractMesh("",r.gizmoLayer.utilityLayerScene),r}return n.__extends(t,e),Object.defineProperty(t.prototype,"light",{get:function(){return this._light},set:function(e){this._light=e,e.position&&this.attachedMesh.position.copyFrom(e.position),e.direction&&this._box.setDirection(e.direction)},enumerable:!0,configurable:!0}),t.prototype._update=function(){e.prototype._update.call(this),this._light&&(this._light.position&&this._light.position.copyFrom(this.attachedMesh.position),this._light.direction&&this._light.direction.copyFrom(this._box.forward),this._light.isEnabled()?this._box.material.emissiveColor.set(1,1,1):this._box.material.emissiveColor.set(0,0,0))},t}(a.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 d});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Behaviors/Meshes/pointerDragBehavior */"./Behaviors/Meshes/pointerDragBehavior.ts"),l=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),u=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),d=(r(/*! ../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),function(e){function t(t,r,n,l){void 0===r&&(r=o.Color3.Gray()),void 0===n&&(n=u.UtilityLayerRenderer.DefaultUtilityLayer),void 0===l&&(l=32);var d=e.call(this,n)||this;d._pointerObserver=null,d.snapDistance=0,d.onSnapObservable=new i.Observable;var f=new h.StandardMaterial("",n.utilityLayerScene);f.disableLighting=!0,f.emissiveColor=r;var p=new h.StandardMaterial("",n.utilityLayerScene);p.disableLighting=!0,p.emissiveColor=r.add(new o.Color3(.3,.3,.3));for(var g=new s.AbstractMesh("",n.utilityLayerScene),m=new Array,_=0;_<l;_++){var v=2*Math.PI*(_/(l-1));m.push(new o.Vector3(.8*Math.sin(v),0,.8*Math.cos(v)))}var A=a.Mesh.CreateLines("",m,n.utilityLayerScene);A.color=f.emissiveColor,A.scaling.scaleInPlace(.26),A.material=f,A.rotation.x=Math.PI/2,g.addChild(A),g.lookAt(d._rootMesh.position.add(t)),d._rootMesh.addChild(g),g.scaling.scaleInPlace(1/3),d.dragBehavior=new c.PointerDragBehavior({dragPlaneNormal:t}),d.dragBehavior.moveAttached=!1,d.dragBehavior.maxDragAngle=9*Math.PI/20,d.dragBehavior._useAlternatePickedPointAboveMaxDragAngle=!0,d._rootMesh.addBehavior(d.dragBehavior);var y=new o.Vector3;d.dragBehavior.onDragStartObservable.add(function(e){d.attachedMesh&&y.copyFrom(e.dragPlanePoint)});var b=new o.Matrix,T=new o.Vector3,E=new o.Vector3,x={snapDistance:0},C=0,P=new o.Matrix,M=new o.Vector3,S=new o.Quaternion;return d.dragBehavior.onDragObservable.add(function(e){if(d.attachedMesh){d.attachedMesh.rotationQuaternion||(d.attachedMesh.rotationQuaternion=o.Quaternion.RotationYawPitchRoll(d.attachedMesh.rotation.y,d.attachedMesh.rotation.x,d.attachedMesh.rotation.z));var r=e.dragPlanePoint.subtract(d.attachedMesh.absolutePosition).normalize(),i=y.subtract(d.attachedMesh.absolutePosition).normalize(),s=o.Vector3.Cross(r,i),a=o.Vector3.Dot(r,i),c=Math.atan2(s.length(),a);if(T.copyFrom(t),E.copyFrom(t),d.updateGizmoRotationToMatchAttachedMesh&&(d.attachedMesh.rotationQuaternion.toRotationMatrix(b),E=o.Vector3.TransformCoordinates(T,b)),n.utilityLayerScene.activeCamera){var l=n.utilityLayerScene.activeCamera.position.subtract(d.attachedMesh.position);o.Vector3.Dot(l,E)>0&&(T.scaleInPlace(-1),E.scaleInPlace(-1))}o.Vector3.Dot(E,s)>0&&(c=-c);var u=!1;if(0!=d.snapDistance)if(C+=c,Math.abs(C)>d.snapDistance){var h=Math.floor(Math.abs(C)/d.snapDistance);C<0&&(h*=-1),C%=d.snapDistance,c=d.snapDistance*h,u=!0}else c=0;P.reset(),d.attachedMesh.parent&&(d.attachedMesh.parent.computeWorldMatrix().invertToRef(P),P.getRotationMatrixToRef(P),o.Vector3.TransformCoordinatesToRef(T,P,T));var f=Math.sin(c/2);S.set(T.x*f,T.y*f,T.z*f,Math.cos(c/2)),P.determinant()>0&&(S.toEulerAnglesToRef(M),o.Quaternion.RotationYawPitchRollToRef(M.y,-M.x,-M.z,S)),d.updateGizmoRotationToMatchAttachedMesh?d.attachedMesh.rotationQuaternion.multiplyToRef(S,d.attachedMesh.rotationQuaternion):S.multiplyToRef(d.attachedMesh.rotationQuaternion,d.attachedMesh.rotationQuaternion),y.copyFrom(e.dragPlanePoint),u&&(x.snapDistance=c,d.onSnapObservable.notifyObservers(x))}}),d._pointerObserver=n.utilityLayerScene.onPointerObservable.add(function(e){if(!d._customMeshSet){var t=e.pickInfo&&-1!=d._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?p:f;d._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),d}return n.__extends(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this)},t}(l.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 u});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 */"./Maths/math.ts"),a=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),c=r(/*! ./axisDragGizmo */"./Gizmos/axisDragGizmo.ts"),l=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),u=function(e){function t(t){void 0===t&&(t=l.UtilityLayerRenderer.DefaultUtilityLayer);var r=e.call(this,t)||this;return r.onDragStartObservable=new o.Observable,r.onDragEndObservable=new o.Observable,r.xGizmo=new c.AxisDragGizmo(new s.Vector3(1,0,0),s.Color3.Red().scale(.5),t),r.yGizmo=new c.AxisDragGizmo(new s.Vector3(0,1,0),s.Color3.Green().scale(.5),t),r.zGizmo=new c.AxisDragGizmo(new s.Vector3(0,0,1),s.Color3.Blue().scale(.5),t),[r.xGizmo,r.yGizmo,r.zGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){r.onDragEndObservable.notifyObservers({})})}),r.attachedMesh=null,r}return n.__extends(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this.xGizmo.attachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.attachedMesh=e,this.yGizmo.attachedMesh=e,this.zGizmo.attachedMesh=e)},enumerable:!0,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:!0,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:!0,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:!0,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}(a.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 u});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 */"./Maths/math.ts"),a=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),c=r(/*! ./planeRotationGizmo */"./Gizmos/planeRotationGizmo.ts"),l=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),u=function(e){function t(t,r){void 0===t&&(t=l.UtilityLayerRenderer.DefaultUtilityLayer),void 0===r&&(r=32);var n=e.call(this,t)||this;return n.onDragStartObservable=new o.Observable,n.onDragEndObservable=new o.Observable,n.xGizmo=new c.PlaneRotationGizmo(new s.Vector3(1,0,0),s.Color3.Red().scale(.5),t,r),n.yGizmo=new c.PlaneRotationGizmo(new s.Vector3(0,1,0),s.Color3.Green().scale(.5),t,r),n.zGizmo=new c.PlaneRotationGizmo(new s.Vector3(0,0,1),s.Color3.Blue().scale(.5),t,r),[n.xGizmo,n.yGizmo,n.zGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){n.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){n.onDragEndObservable.notifyObservers({})})}),n.attachedMesh=null,n}return n.__extends(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this.xGizmo.attachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.attachedMesh=e,this.yGizmo.attachedMesh=e,this.zGizmo.attachedMesh=e)},enumerable:!0,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:!0,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:!0,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:!0,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}(a.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 */"./Maths/math.ts"),a=r(/*! ../Meshes/Builders/polyhedronBuilder */"./Meshes/Builders/polyhedronBuilder.ts"),c=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),l=r(/*! ./axisScaleGizmo */"./Gizmos/axisScaleGizmo.ts"),u=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=function(e){function t(t){void 0===t&&(t=u.UtilityLayerRenderer.DefaultUtilityLayer);var r=e.call(this,t)||this;r.onDragStartObservable=new o.Observable,r.onDragEndObservable=new o.Observable,r.xGizmo=new l.AxisScaleGizmo(new s.Vector3(1,0,0),s.Color3.Red().scale(.5),t),r.yGizmo=new l.AxisScaleGizmo(new s.Vector3(0,1,0),s.Color3.Green().scale(.5),t),r.zGizmo=new l.AxisScaleGizmo(new s.Vector3(0,0,1),s.Color3.Blue().scale(.5),t),r.uniformScaleGizmo=new l.AxisScaleGizmo(new s.Vector3(0,1,0),s.Color3.Yellow().scale(.5),t),r.uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh=!1,r.uniformScaleGizmo.uniformScaling=!0;var n=a.PolyhedronBuilder.CreatePolyhedron("",{type:1},r.uniformScaleGizmo.gizmoLayer.utilityLayerScene);n.scaling.scaleInPlace(.02),n.visibility=0;var i=a.PolyhedronBuilder.CreatePolyhedron("",{type:1},r.uniformScaleGizmo.gizmoLayer.utilityLayerScene);return i.scaling.scaleInPlace(.007),n.addChild(i),r.uniformScaleGizmo.setCustomMesh(n,!0),[r.xGizmo,r.yGizmo,r.zGizmo,r.uniformScaleGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){r.onDragEndObservable.notifyObservers({})})}),r.attachedMesh=null,r}return n.__extends(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this.xGizmo.attachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.attachedMesh=e,this.yGizmo.attachedMesh=e,this.zGizmo.attachedMesh=e,this.uniformScaleGizmo.attachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this.xGizmo.updateGizmoRotationToMatchAttachedMesh},set:function(e){e||i.Logger.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported."),this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)},enumerable:!0,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,this.uniformScaleGizmo.snapDistance=e)},enumerable:!0,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,this.uniformScaleGizmo.scaleRatio=e)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.uniformScaleGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},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 p});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 */"./Maths/math.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),l=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=r(/*! ../Materials/Textures/mirrorTexture */"./Materials/Textures/mirrorTexture.ts"),h=r(/*! ../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),d=r(/*! ../Materials/Background/backgroundMaterial */"./Materials/Background/backgroundMaterial.ts"),f=r(/*! ../Engines/constants */"./Engines/constants.ts"),p=(r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),function(){function e(t,r){var o=this;this._errorHandler=function(e,t){o.onErrorObservable.notifyObservers({message:e,exception:t})},this._options=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 s.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:f.Constants.TEXTURETYPE_UNSIGNED_INT,groundYBias:1e-5,createSkybox:!0,skyboxSize:20,skyboxTexture:this._skyboxTextureCDNUrl,skyboxColor:new s.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"skybox",{get:function(){return this._skybox},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"skyboxTexture",{get:function(){return this._skyboxTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"skyboxMaterial",{get:function(){return this._skyboxMaterial},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ground",{get:function(){return this._ground},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"groundTexture",{get:function(){return this._groundTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"groundMirror",{get:function(){return this._groundMirror},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"groundMirrorRenderList",{get:function(){return this._groundMirror?this._groundMirror.renderList:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"groundMaterial",{get:function(){return this._groundMaterial},enumerable:!0,configurable:!0}),e.prototype.updateOptions=function(e){var t=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 s.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 a.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=a.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 d.BackgroundMaterial("BackgroundPlaneMaterial",this._scene)),this._groundMaterial.alpha=this._options.groundOpacity,this._groundMaterial.alphaMode=f.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 l.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=l.Texture.CLAMP_ADDRESSMODE;if(!this._groundMirror&&(this._groundMirror=new u.MirrorTexture("BackgroundPlaneMirrorTexture",{ratio:this._options.groundMirrorSizeRatio},this._scene,!1,this._options.groundMirrorTextureType,l.Texture.BILINEAR_SAMPLINGMODE,!0),this._groundMirror.mirrorPlane=new s.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 s.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=a.Mesh.CreateBox("BackgroundSkybox",e.skyboxSize,this._scene,void 0,a.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 d.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=l.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"),c=r(/*! ../Materials/Background/backgroundMaterial */"./Materials/Background/backgroundMaterial.ts"),l=(r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),r(/*! ../Maths/math */"./Maths/math.ts")),u=function(e){function t(t,r,n,o,u){void 0===u&&(u=null);var h=e.call(this,t,o)||this;h._useDirectMapping=!1,h.onLoadErrorObservable=new i.Observable,t=t||"photoDome",n.resolution=0|Math.abs(n.resolution)||32,n.size=Math.abs(n.size)||(o.activeCamera?.48*o.activeCamera.maxZ:1e3),void 0===n.useDirectMapping?h._useDirectMapping=!0:h._useDirectMapping=n.useDirectMapping,void 0===n.faceForward&&(n.faceForward=!0),h._setReady(!1);var d=h._material=new c.BackgroundMaterial(t+"_material",o);if(h._mesh=s.Mesh.CreateSphere(t+"_mesh",n.resolution,n.size,o,!1,s.Mesh.BACKSIDE),d.opacityFresnel=!1,d.useEquirectangularFOV=!0,d.fovMultiplier=1,h.photoTexture=new a.Texture(r,o,!0,!h._useDirectMapping,void 0,void 0,function(e,t){h.onLoadErrorObservable.notifyObservers(e||"Unknown error occured"),u&&u(e,t)}),h.photoTexture.onLoadObservable.addOnce(function(){h._setReady(!0)}),h._mesh.material=d,h._mesh.parent=h,n.faceForward&&o.activeCamera){var f=o.activeCamera,p=l.Vector3.Forward(),g=l.Vector3.TransformNormal(p,f.getViewMatrix());g.normalize(),h.rotation.y=Math.acos(l.Vector3.Dot(p,g))}return h}return 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._material.fovMultiplier},set:function(e){this._material.fovMultiplier=e},enumerable:!0,configurable:!0}),t.prototype.dispose=function(t,r){void 0===r&&(r=!1),this._photoTexture.dispose(),this._mesh.dispose(),this._material.dispose(),this.onLoadErrorObservable.clear(),e.prototype.dispose.call(this,t,r)},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 A});var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../scene */"./scene.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),l=r(/*! ../Materials/PBR/pbrMaterial */"./Materials/PBR/pbrMaterial.ts"),u=r(/*! ../Lights/hemisphericLight */"./Lights/hemisphericLight.ts"),h=r(/*! ./environmentHelper */"./Helpers/environmentHelper.ts"),d=r(/*! ../Cameras/freeCamera */"./Cameras/freeCamera.ts"),f=r(/*! ../Cameras/arcRotateCamera */"./Cameras/arcRotateCamera.ts"),p=r(/*! ../Cameras/XR/webXRManagedOutputCanvas */"./Cameras/XR/webXRManagedOutputCanvas.ts"),g=r(/*! ../Cameras/XR/webXRInput */"./Cameras/XR/webXRInput.ts"),m=r(/*! ../Cameras/XR/webXREnterExitUI */"./Cameras/XR/webXREnterExitUI.ts"),_=r(/*! ../Cameras/XR/webXRExperienceHelper */"./Cameras/XR/webXRExperienceHelper.ts"),v=r(/*! ../Cameras/VR/vrExperienceHelper */"./Cameras/VR/vrExperienceHelper.ts"),A=(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"),!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(),s=i.max.subtract(i.min),a=i.min.add(s.scale(.5)),c=1.5*s.length();if(isFinite(c)||(c=1,a.copyFromFloats(0,0,0)),e){var l=new f.ArcRotateCamera("default camera",-Math.PI/2,Math.PI/2,c,a,this);l.lowerRadiusLimit=.01*c,l.wheelPrecision=100/c,n=l}else{var u=new d.FreeCamera("default camera",new o.Vector3(a.x,a.y,-c),this);u.setTarget(a),n=u}n.minZ=.01*c,n.maxZ=1e3*c,n.speed=.2*c,this.activeCamera=n;var h=this.getEngine().getRenderingCanvas();r&&h&&n.attachControl(h)}},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 h=new l.PBRMaterial("skyBox",this);h.backFaceCulling=!1,h.reflectionTexture=e.clone(),h.reflectionTexture&&(h.reflectionTexture.coordinatesMode=a.Texture.SKYBOX_MODE),h.microSurface=1-i,h.disableLighting=!0,h.twoSidedLighting=!0,u.infiniteDistance=!0,u.material=h}else{var d=new c.StandardMaterial("skyBox",this);d.backFaceCulling=!1,d.reflectionTexture=e.clone(),d.reflectionTexture&&(d.reflectionTexture.coordinatesMode=a.Texture.SKYBOX_MODE),d.disableLighting=!0,u.infiniteDistance=!0,u.material=d}return u.isPickable=!1,u},i.Scene.prototype.createDefaultEnvironment=function(e){return h.EnvironmentHelper?new h.EnvironmentHelper(e,this):null},i.Scene.prototype.createDefaultVRExperience=function(e){return void 0===e&&(e={}),new v.VRExperienceHelper(this,e)},i.Scene.prototype.createDefaultXRExperienceAsync=function(){var e=this;return _.WebXRExperienceHelper.CreateAsync(this).then(function(t){var r=new p.WebXRManagedOutputCanvas(t);return m.WebXREnterExitUI.CreateAsync(e,t,{outputCanvasContext:r.canvasContext}).then(function(e){return new g.WebXRInput(t),t})})}},"./Helpers/videoDome.ts":
- /*!******************************!*\
- !*** ./Helpers/videoDome.ts ***!
- \******************************/
- /*! exports provided: VideoDome */function(e,t,r){"use strict";r.r(t),r.d(t,"VideoDome",function(){return u});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"),c=r(/*! ../Materials/Background/backgroundMaterial */"./Materials/Background/backgroundMaterial.ts"),l=(r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),r(/*! ../Maths/math */"./Maths/math.ts")),u=function(e){function t(r,n,i,u){var h=e.call(this,r,u)||this;h._useDirectMapping=!1,h._videoMode=t.MODE_MONOSCOPIC,h._onBeforeCameraRenderObserver=null,u=h.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)||(u.activeCamera?.48*u.activeCamera.maxZ:1e3),void 0===i.useDirectMapping?h._useDirectMapping=!0:h._useDirectMapping=i.useDirectMapping,void 0===i.faceForward&&(i.faceForward=!0),h._setReady(!1);var d={loop:i.loop,autoPlay:i.autoPlay,autoUpdateTexture:!0,poster:i.poster},f=h._material=new c.BackgroundMaterial(r+"_material",u),p=h._videoTexture=new a.VideoTexture(r+"_texture",n,u,!1,h._useDirectMapping,s.Texture.TRILINEAR_SAMPLINGMODE,d);if(h._mesh=o.Mesh.CreateSphere(r+"_mesh",i.resolution,i.size,u,!1,o.Mesh.BACKSIDE),p.onLoadObservable.addOnce(function(){h._setReady(!0)}),f.useEquirectangularFOV=!0,f.fovMultiplier=1,f.opacityFresnel=!1,h._useDirectMapping?(p.wrapU=s.Texture.CLAMP_ADDRESSMODE,p.wrapV=s.Texture.CLAMP_ADDRESSMODE,f.diffuseTexture=p):(p.coordinatesMode=s.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE,p.wrapV=s.Texture.CLAMP_ADDRESSMODE,f.reflectionTexture=p),h._mesh.material=f,h._mesh.parent=h,i.clickToPlay&&(u.onPointerUp=function(){h._videoTexture.video.play()}),i.faceForward&&u.activeCamera){var g=u.activeCamera,m=l.Vector3.Forward(),_=l.Vector3.TransformNormal(m,g.getViewMatrix());_.normalize(),h.rotation.y=Math.acos(l.Vector3.Dot(m,_))}return h}return n.__extends(t,e),Object.defineProperty(t.prototype,"videoTexture",{get:function(){return this._videoTexture},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._material.fovMultiplier},set:function(e){this._material.fovMultiplier=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"videoMode",{get:function(){return this._videoMode},set:function(e){this._videoMode!==e&&this._changeVideoMode(e)},enumerable:!0,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_SIDEBYSIDE:this._videoTexture.uScale=.5,this._onBeforeCameraRenderObserver=this._scene.onBeforeCameraRenderObservable.add(function(e){r._videoTexture.uOffset=e.isRightCamera?.5:0});break;case t.MODE_TOPBOTTOM:this._videoTexture.vScale=.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)},"./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/tools */"./Misc/tools.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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"shaderCompilationTimeCounter",{get:function(){return this._shaderCompilationTime},enumerable:!0,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:!0,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 i});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=function(){function e(e){var t=this;this.scene=e,this._captureActiveMeshesEvaluationTime=!1,this._activeMeshesEvaluationTime=new n.PerfCounter,this._captureRenderTargetsRenderTime=!1,this._renderTargetsRenderTime=new n.PerfCounter,this._captureFrameTime=!1,this._frameTime=new n.PerfCounter,this._captureRenderTime=!1,this._renderTime=new n.PerfCounter,this._captureInterFrameTime=!1,this._interFrameTime=new n.PerfCounter,this._captureParticlesRenderTime=!1,this._particlesRenderTime=new n.PerfCounter,this._captureSpritesRenderTime=!1,this._spritesRenderTime=new n.PerfCounter,this._capturePhysicsTime=!1,this._physicsTime=new n.PerfCounter,this._captureAnimationsTime=!1,this._animationsTime=new n.PerfCounter,this._captureCameraRenderTime=!1,this._cameraRenderTime=new n.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(),t.scene.getEngine()._textureCollisions.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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderTargetsRenderTimeCounter",{get:function(){return this._renderTargetsRenderTime},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"particlesRenderTimeCounter",{get:function(){return this._particlesRenderTime},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"spritesRenderTimeCounter",{get:function(){return this._spritesRenderTime},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"physicsTimeCounter",{get:function(){return this._physicsTime},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"animationsTimeCounter",{get:function(){return this._animationsTime},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"frameTimeCounter",{get:function(){return this._frameTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"captureFrameTime",{get:function(){return this._captureFrameTime},set:function(e){this._captureFrameTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interFrameTimeCounter",{get:function(){return this._interFrameTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"captureInterFrameTime",{get:function(){return this._captureInterFrameTime},set:function(e){this._captureInterFrameTime=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderTimeCounter",{get:function(){return this._renderTime},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"cameraRenderTimeCounter",{get:function(){return this._cameraRenderTime},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawCallsCounter",{get:function(){return this.scene.getEngine()._drawCalls},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureCollisionsCounter",{get:function(){return this.scene.getEngine()._textureCollisions},enumerable:!0,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(){return 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 m});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 */"./Maths/math.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),u=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),h=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),d=r(/*! ../Materials/material */"./Materials/material.ts"),f=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),p=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")),m=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.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._genrateVertexBuffer()}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._effectLayerOptions.camera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._effectLayerOptions.renderingGroupId},enumerable:!0,configurable:!0}),e.prototype._init=function(e){this._effectLayerOptions=n.__assign({mainTextureRatio:.5,alphaBlendingMode:p.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._genrateVertexBuffer=function(){var e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1);var t=new l.VertexBuffer(this._engine,e,l.VertexBuffer.PositionKind,!1,!1,2);this._vertexBuffers[l.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?o.Tools.GetExponentOfTwo(this._mainTextureDesiredSize.width,this._maxSize):this._mainTextureDesiredSize.width,this._mainTextureDesiredSize.height=this._engine.needPOTTextures?o.Tools.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,p.Constants.TEXTURETYPE_UNSIGNED_INT),this._mainTexture.activeCamera=this._effectLayerOptions.camera,this._mainTexture.wrapU=u.Texture.CLAMP_ADDRESSMODE,this._mainTexture.wrapV=u.Texture.CLAMP_ADDRESSMODE,this._mainTexture.anisotropicFilteringLevel=1,this._mainTexture.updateSamplingMode(u.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]);for(o=0;o<n.length;o++)e._renderSubMesh(n.data[o])},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=[l.VertexBuffer.PositionKind],s=e.getMesh(),a=!1,c=!1;if(n){var u=n.needAlphaTesting(),h=n.getAlphaTestTexture(),d=h&&h.hasAlpha&&(n.useAlphaFromDiffuseTexture||n._useAlphaFromAlbedoTexture);h&&(u||d)&&(i.push("#define DIFFUSE"),s.isVerticesDataPresent(l.VertexBuffer.UV2Kind)&&1===h.coordinatesIndex?(i.push("#define DIFFUSEUV2"),c=!0):s.isVerticesDataPresent(l.VertexBuffer.UVKind)&&(i.push("#define DIFFUSEUV1"),a=!0),u&&(i.push("#define ALPHATEST"),i.push("#define ALPHATESTVALUE 0.4")));var p=n.opacityTexture;p&&(i.push("#define OPACITY"),s.isVerticesDataPresent(l.VertexBuffer.UV2Kind)&&1===p.coordinatesIndex?(i.push("#define OPACITYUV2"),c=!0):s.isVerticesDataPresent(l.VertexBuffer.UVKind)&&(i.push("#define OPACITYUV1"),a=!0))}r&&(i.push("#define EMISSIVE"),s.isVerticesDataPresent(l.VertexBuffer.UV2Kind)&&1===r.coordinatesIndex?(i.push("#define EMISSIVEUV2"),c=!0):s.isVerticesDataPresent(l.VertexBuffer.UVKind)&&(i.push("#define EMISSIVEUV1"),a=!0)),s.isVerticesDataPresent(l.VertexBuffer.ColorKind)&&s.hasVertexAlpha&&(o.push(l.VertexBuffer.ColorKind),i.push("#define VERTEXALPHA")),a&&(o.push(l.VertexBuffer.UVKind),i.push("#define UV1")),c&&(o.push(l.VertexBuffer.UV2Kind),i.push("#define UV2")),s.useBones&&s.computeBonesUsingShaders?(o.push(l.VertexBuffer.MatricesIndicesKind),o.push(l.VertexBuffer.MatricesWeightsKind),s.numBoneInfluencers>4&&(o.push(l.VertexBuffer.MatricesIndicesExtraKind),o.push(l.VertexBuffer.MatricesWeightsExtraKind)),i.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),i.push("#define BonesPerMesh "+(s.skeleton?s.skeleton.bones.length+1:0))):i.push("#define NUM_BONE_INFLUENCERS 0");var g=s.morphTargetManager,m=0;g&&g.numInfluencers>0&&(i.push("#define MORPHTARGETS"),m=g.numInfluencers,i.push("#define NUM_MORPH_INFLUENCERS "+m),f.MaterialHelper.PrepareAttributesForMorphTargets(o,s,{NUM_MORPH_INFLUENCERS:m})),t&&(i.push("#define INSTANCES"),o.push("world0"),o.push("world1"),o.push("world2"),o.push("world3")),this._addCustomEffectDefines(i);var _=i.join("\n");return this._cachedDefines!==_&&(this._cachedDefines=_,this._effectLayerMapGenerationEffect=this._scene.getEngine().createEffect("glowMapGeneration",o,["world","mBones","viewProjection","color","morphTargetInfluences","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity"],["diffuseSampler","emissiveSampler","opacitySampler"],_,void 0,void 0,void 0,{maxSimultaneousMorphTargets:m})),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){var t=this;if(this.shouldRender()){var r=e.getMaterial(),n=e.getRenderingMesh(),i=this._scene,o=i.getEngine();if(r&&this._canRenderMesh(n,r)){o.setState(r.backFaceCulling);var s=n._getInstancesRenderList(e._id);if(!s.mustReturn&&this._shouldRenderMesh(n)){var a=o.getCaps().instancedArrays&&null!==s.visibleInstances[e._id]&&void 0!==s.visibleInstances[e._id];if(this._setEmissiveTextureAndColor(n,e,r),this._isReady(e,a,this._emissiveTextureAndColor.texture)){o.enableEffect(this._effectLayerMapGenerationEffect),n._bind(e,this._effectLayerMapGenerationEffect,d.Material.TriangleFillMode),this._effectLayerMapGenerationEffect.setMatrix("viewProjection",i.getTransformMatrix()),this._effectLayerMapGenerationEffect.setFloat4("color",this._emissiveTextureAndColor.color.r,this._emissiveTextureAndColor.color.g,this._emissiveTextureAndColor.color.b,this._emissiveTextureAndColor.color.a);var c=r.needAlphaTesting(),l=r.getAlphaTestTexture(),u=l&&l.hasAlpha&&(r.useAlphaFromDiffuseTexture||r._useAlphaFromAlbedoTexture);if(l&&(c||u))this._effectLayerMapGenerationEffect.setTexture("diffuseSampler",l),(h=l.getTextureMatrix())&&this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix",h);var h,p=r.opacityTexture;if(p)this._effectLayerMapGenerationEffect.setTexture("opacitySampler",p),this._effectLayerMapGenerationEffect.setFloat("opacityIntensity",p.level),(h=p.getTextureMatrix())&&this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix",h);this._emissiveTextureAndColor.texture&&(this._effectLayerMapGenerationEffect.setTexture("emissiveSampler",this._emissiveTextureAndColor.texture),this._effectLayerMapGenerationEffect.setMatrix("emissiveMatrix",this._emissiveTextureAndColor.texture.getTextureMatrix())),n.useBones&&n.computeBonesUsingShaders&&n.skeleton&&this._effectLayerMapGenerationEffect.setMatrices("mBones",n.skeleton.getTransformMatrices(n)),f.MaterialHelper.BindMorphTargetParameters(n,this._effectLayerMapGenerationEffect),n._processRendering(e,this._effectLayerMapGenerationEffect,d.Material.TriangleFillMode,s,a,function(e,r){return t._effectLayerMapGenerationEffect.setMatrix("world",r)})}else this._mainTexture.resetRefreshCounter()}}}},e.prototype._rebuild=function(){var e=this._vertexBuffers[l.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();this._postProcesses=[];for(e=0;e<this._textures.length;e++)this._textures[e]&&this._textures[e].dispose();this._textures=[]},e.prototype.dispose=function(){var e=this._vertexBuffers[l.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[l.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.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")},n.__decorate([Object(i.serialize)()],e.prototype,"name",void 0),n.__decorate([Object(i.serializeAsColor4)()],e.prototype,"neutralColor",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"isEnabled",void 0),n.__decorate([Object(i.serializeAsCameraReference)()],e.prototype,"camera",null),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=this.scene.effectLayers;if(t&&t.length>0){this._previousStencilState=this._engine.getStencilBuffer();for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.shouldRender()&&(!o.camera||o.camera.cameraRigMode===n.Camera.RIG_MODE_NONE&&e===o.camera||o.camera.cameraRigMode!==n.Camera.RIG_MODE_NONE&&o.camera._rigCameras.indexOf(e)>-1)){this._renderEffects=!0,this._needStencil=this._needStencil||o.needStencil();var s=o._mainTexture;s._shouldRender()&&(this.scene.incrementRenderId(),s.render(!1,!1))}}this.scene.incrementRenderId()}},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 m});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 */"./Maths/math.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),d=r(/*! ./effectLayer */"./Layers/effectLayer.ts"),f=r(/*! ../abstractScene */"./abstractScene.ts"),p=r(/*! ../Engines/constants */"./Engines/constants.ts"),g=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts");r(/*! ../Shaders/glowMapMerge.fragment */"./Shaders/glowMapMerge.fragment.ts"),r(/*! ../Shaders/glowMapMerge.vertex */"./Shaders/glowMapMerge.vertex.ts"),r(/*! ../Layers/effectLayerSceneComponent */"./Layers/effectLayerSceneComponent.ts");f.AbstractScene.prototype.getGlowLayerByName=function(e){for(var t=0;t<this.effectLayers.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===m.EffectName)return this.effectLayers[t];return null};var m=function(e){function t(r,i,o){var a=e.call(this,r,i)||this;return a._intensity=1,a._includedOnlyMeshes=[],a._excludedMeshes=[],a.neutralColor=new s.Color4(0,0,0,1),a._options=n.__assign({mainTextureRatio:t.DefaultTextureRatio,blurKernelSize:32,mainTextureFixedSize:void 0,camera:null,mainTextureSamples:1,renderingGroupId:-1},o),a._init({alphaBlendingMode:p.Constants.ALPHA_ADD,camera:a._options.camera,mainTextureFixedSize:a._options.mainTextureFixedSize,mainTextureRatio:a._options.mainTextureRatio,renderingGroupId:a._options.renderingGroupId}),a}return 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"intensity",{get:function(){return this._intensity},set:function(e){this._intensity=e},enumerable:!0,configurable:!0}),t.prototype.getEffectName=function(){return t.EffectName},t.prototype._createMergeEffect=function(){return this._engine.createEffect("glowMapMerge",[a.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?o.Tools.GetExponentOfTwo(t,this._maxSize):t,r=this._engine.needPOTTextures?o.Tools.GetExponentOfTwo(r,this._maxSize):r;var n=0;n=this._engine.getCaps().textureHalfFloatRender?p.Constants.TEXTURETYPE_HALF_FLOAT:p.Constants.TEXTURETYPE_UNSIGNED_INT,this._blurTexture1=new l.RenderTargetTexture("GlowLayerBlurRTT",{width:t,height:r},this._scene,!1,!0,n),this._blurTexture1.wrapU=c.Texture.CLAMP_ADDRESSMODE,this._blurTexture1.wrapV=c.Texture.CLAMP_ADDRESSMODE,this._blurTexture1.updateSamplingMode(c.Texture.BILINEAR_SAMPLINGMODE),this._blurTexture1.renderParticles=!1,this._blurTexture1.ignoreCameraViewport=!0;var i=Math.floor(t/2),a=Math.floor(r/2);this._blurTexture2=new l.RenderTargetTexture("GlowLayerBlurRTT2",{width:i,height:a},this._scene,!1,!0,n),this._blurTexture2.wrapU=c.Texture.CLAMP_ADDRESSMODE,this._blurTexture2.wrapV=c.Texture.CLAMP_ADDRESSMODE,this._blurTexture2.updateSamplingMode(c.Texture.BILINEAR_SAMPLINGMODE),this._blurTexture2.renderParticles=!1,this._blurTexture2.ignoreCameraViewport=!0,this._textures=[this._blurTexture1,this._blurTexture2],this._horizontalBlurPostprocess1=new h.BlurPostProcess("GlowLayerHBP1",new s.Vector2(1,0),this._options.blurKernelSize/2,{width:t,height:r},null,c.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 h.BlurPostProcess("GlowLayerVBP1",new s.Vector2(0,1),this._options.blurKernelSize/2,{width:t,height:r},null,c.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess2=new h.BlurPostProcess("GlowLayerHBP2",new s.Vector2(1,0),this._options.blurKernelSize/2,{width:i,height:a},null,c.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,n),this._horizontalBlurPostprocess2.width=i,this._horizontalBlurPostprocess2.height=a,this._horizontalBlurPostprocess2.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._blurTexture1)}),this._verticalBlurPostprocess2=new h.BlurPostProcess("GlowLayerVBP2",new s.Vector2(0,1),this._options.blurKernelSize/2,{width:i,height:a},null,c.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();t&&(e._scene.postProcessManager.directRender(e._postProcesses1,t,!0),(t=e._blurTexture2.getInternalTexture())&&e._scene.postProcessManager.directRender(e._postProcesses2,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(u.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._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,n.__decorate([Object(i.serialize)()],t.prototype,"blurKernelSize",null),n.__decorate([Object(i.serialize)()],t.prototype,"intensity",null),n.__decorate([Object(i.serialize)("options")],t.prototype,"_options",void 0),t}(d.EffectLayer);g._TypeStore.RegisteredTypes["BABYLON.GlowLayer"]=m},"./Layers/highlightLayer.ts":
- /*!**********************************!*\
- !*** ./Layers/highlightLayer.ts ***!
- \**********************************/
- /*! exports provided: HighlightLayer */function(e,t,r){"use strict";r.r(t),r.d(t,"HighlightLayer",function(){return b});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 */"./Maths/math.ts"),c=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Materials/material */"./Materials/material.ts"),u=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),h=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),d=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),f=r(/*! ../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),p=r(/*! ../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),g=r(/*! ./effectLayer */"./Layers/effectLayer.ts"),m=r(/*! ../abstractScene */"./abstractScene.ts"),_=r(/*! ../Engines/constants */"./Engines/constants.ts"),v=r(/*! ../Misc/logger */"./Misc/logger.ts"),A=r(/*! ../Misc/typeStore */"./Misc/typeStore.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");m.AbstractScene.prototype.getHighlightLayerByName=function(e){for(var t=0;t<this.effectLayers.length;t++)if(this.effectLayers[t].name===e&&this.effectLayers[t].getEffectName()===b.EffectName)return this.effectLayers[t];return null};var y=function(e){function t(t,r,n,i,o,s,a,c){void 0===s&&(s=u.Texture.BILINEAR_SAMPLINGMODE);var l=e.call(this,t,"glowBlurPostProcess",["screenSize","direction","blurWidth"],null,i,o,s,a,c)||this;return l.direction=r,l.kernel=n,l.onApplyObservable.add(function(e){e.setFloat2("screenSize",l.width,l.height),e.setVector2("direction",l.direction),e.setFloat("blurWidth",l.kernel)}),l}return n.__extends(t,e),t}(d.PostProcess),b=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=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 n.__extends(t,e),Object.defineProperty(t.prototype,"blurHorizontalSize",{get:function(){return this._horizontalBlurPostprocess.kernel},set:function(e){this._horizontalBlurPostprocess.kernel=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurVerticalSize",{get:function(){return this._verticalBlurPostprocess.kernel},set:function(e){this._verticalBlurPostprocess.kernel=e},enumerable:!0,configurable:!0}),t.prototype.getEffectName=function(){return t.EffectName},t.prototype._createMergeEffect=function(){return this._engine.createEffect("glowMapMerge",[c.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?s.Tools.GetExponentOfTwo(t,this._maxSize):t,r=this._engine.needPOTTextures?s.Tools.GetExponentOfTwo(r,this._maxSize):r;var n=0;n=this._engine.getCaps().textureHalfFloatRender?_.Constants.TEXTURETYPE_HALF_FLOAT:_.Constants.TEXTURETYPE_UNSIGNED_INT,this._blurTexture=new h.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 y("HighlightLayerHBP",new a.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 y("HighlightLayerVBP",new a.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 a.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 a.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.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(l.Material.TriangleFillMode,0,6)),this.innerGlow&&(e.setFloat("offset",1),t.setStencilFunction(_.Constants.EQUAL),t.drawElementsType(l.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._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._excludedMeshes&&n._excludedMeshes[e.uniqueId]?n._defaultStencilReference(e):e.getScene().getEngine().setStencilFunctionReference(n._instanceGlowingMeshStencilReference)}),observerDefault:e.onAfterRenderObservable.add(this._defaultStencilReference),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._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++){(c=r.getMeshByID(e.excludedMeshes[o]))&&s.addExcludedMesh(c)}for(o=0;o<e.meshes.length;o++){var c,l=e.meshes[o];(c=r.getMeshByID(l.meshId))&&s.addMesh(c,a.Color3.FromArray(l.color),l.glowEmissiveOnly)}return s},t.EffectName="HighlightLayer",t.NeutralColor=new a.Color4(0,0,0,0),t.GlowingMeshStencilReference=2,t.NormalMeshStencilReference=1,n.__decorate([Object(i.serialize)()],t.prototype,"innerGlow",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"outerGlow",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"blurHorizontalSize",null),n.__decorate([Object(i.serialize)()],t.prototype,"blurVerticalSize",null),n.__decorate([Object(i.serialize)("options")],t.prototype,"_options",void 0),t}(g.EffectLayer);A._TypeStore.RegisteredTypes["BABYLON.HighlightLayer"]=b},"./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 c=r(/*! ./layerSceneComponent */"./Layers/layerSceneComponent.ts");r.d(t,"LayerSceneComponent",function(){return c.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 d});var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Materials/material */"./Materials/material.ts"),c=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../sceneComponent */"./sceneComponent.ts"),u=r(/*! ./layerSceneComponent */"./Layers/layerSceneComponent.ts"),h=r(/*! ../Engines/constants */"./Engines/constants.ts"),d=(r(/*! ../Shaders/layer.fragment */"./Shaders/layer.fragment.ts"),r(/*! ../Shaders/layer.vertex */"./Shaders/layer.vertex.ts"),function(){function e(e,t,r,a,d){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===a||a,this.color=void 0===d?new i.Color4(1,1,1,1):d,this._scene=r||o.EngineStore.LastCreatedScene;var f=this._scene._getComponent(l.SceneComponentConstants.NAME_LAYER);f||(f=new u.LayerSceneComponent(this._scene),this._scene._addComponent(f)),this._scene.layers.push(this);var p=this._scene.getEngine(),g=[];g.push(1,1),g.push(-1,1),g.push(-1,-1),g.push(1,-1);var m=new s.VertexBuffer(p,g,s.VertexBuffer.PositionKind,!1,!1,2);this._vertexBuffers[s.VertexBuffer.PositionKind]=m,this._createIndexBuffer(),this._effect=p.createEffect("layer",[s.VertexBuffer.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],""),this._alphaTestEffect=p.createEffect("layer",[s.VertexBuffer.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],"#define ALPHATEST")}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!0,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[s.VertexBuffer.PositionKind];e&&e._rebuild(),this._createIndexBuffer()},e.prototype.render=function(){var e=this.alphaTest?this._alphaTestEffect:this._effect;if(e.isReady()&&this.texture&&this.texture.isReady()){var t=this._scene.getEngine();this.onBeforeRenderObservable.notifyObservers(this),t.enableEffect(e),t.setState(!1),e.setTexture("textureSampler",this.texture),e.setMatrix("textureMatrix",this.texture.getTextureMatrix()),e.setFloat4("color",this.color.r,this.color.g,this.color.b,this.color.a),e.setVector2("offset",this.offset),e.setVector2("scale",this.scale),t.bindBuffers(this._vertexBuffers,this._indexBuffer,e),this.alphaTest?t.drawElementsType(a.Material.TriangleFillMode,0,6):(t.setAlphaMode(this.alphaBlendingMode),t.drawElementsType(a.Material.TriangleFillMode,0,6),t.setAlphaMode(h.Constants.ALPHA_DISABLE)),this.onAfterRenderObservable.notifyObservers(this)}},e.prototype.dispose=function(){var e=this._vertexBuffers[s.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[s.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}()},"./Legacy/legacy.ts":
- /*!**************************!*\
- !*** ./Legacy/legacy.ts ***!
- \**************************/
- /*! exports provided: Debug, AbstractScene, KeepAssets, AssetContainer, Node, Scene, SceneComponentConstants, Stage, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction, Animatable, Animation, TargetedAnimation, AnimationGroup, AnimationPropertiesOverride, EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase, RuntimeAnimation, AnimationEvent, AnimationKeyInterpolation, AnimationRange, Analyser, AudioEngine, AudioSceneComponent, Sound, SoundTrack, WeightedSound, Bone, BoneIKController, BoneLookController, Skeleton, CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, BoundingBox, BoundingInfo, BoundingSphere, Ray, AxesViewer, BoneAxesViewer, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer, Constants, InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine, EngineStore, NullEngineOptions, NullEngine, KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome, EngineInstrumentation, SceneInstrumentation, _TimeToken, EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent, LensFlare, LensFlareSystem, LensFlareSystemSceneComponent, Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoader, SceneLoaderFlags, ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, InternalTexture, MirrorTexture, RawTexture, RenderTargetTexture, MultiviewRenderTarget, Texture, UniformBuffer, MaterialFlags, Scalar, ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp, SphericalPolynomial, SphericalHarmonics, AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, TrailMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, MorphTarget, MorphTargetManager, Database, BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, SubEmitterType, SubEmitter, PhysicsEngine, PhysicsEngineSceneComponent, PhysicsHelper, PhysicsRadialExplosionEventOptions, PhysicsUpdraftEventOptions, PhysicsVortexEventOptions, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode, PhysicsImpostor, PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint, 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, SharpenPostProcess, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, VRMultiviewToSingleview, ReflectionProbe, BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer, Sprite, SpriteManager, SpriteSceneComponent, _AlphaState, _DepthCullingState, _StencilState, AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, AssetsManager, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsMatrix, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, MeshExploder, FilesInput, CubeMapToSphericalPolynomialTools, 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, ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, WebRequest, InspectableType, AutoRotationBehavior, BouncingBehavior, FramingBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior, ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FollowCameraKeyboardMoveInput, FollowCameraMouseWheelInput, FollowCameraPointersInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, OnAfterEnteringVRObservableEvent, VRExperienceHelper, WebVRFreeCamera, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager, Octree, OctreeBlock, OctreeSceneComponent, _OcclusionDataStorage, _forceTransformFeedbackToBundle, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, ShadowGenerator, ShadowGeneratorSceneComponent, _BabylonLoaderRegistered, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, EquiRectangularCubeTexture, HDRCubeTexture, DummyInternalTextureTracker, MultiRenderTarget, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, DracoCompression, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, HDRTools, PanoramaToCubeMapTools, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTexture, ProceduralTextureSceneComponent, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"Debug",function(){return l});var n=r(/*! ../index */"./index.ts"),i=r(/*! ../Debug/index */"./Debug/index.ts");r.d(t,"AbstractScene",function(){return n.AbstractScene}),r.d(t,"KeepAssets",function(){return n.KeepAssets}),r.d(t,"AssetContainer",function(){return n.AssetContainer}),r.d(t,"Node",function(){return n.Node}),r.d(t,"Scene",function(){return n.Scene}),r.d(t,"SceneComponentConstants",function(){return n.SceneComponentConstants}),r.d(t,"Stage",function(){return n.Stage}),r.d(t,"Action",function(){return n.Action}),r.d(t,"ActionEvent",function(){return n.ActionEvent}),r.d(t,"ActionManager",function(){return n.ActionManager}),r.d(t,"Condition",function(){return n.Condition}),r.d(t,"ValueCondition",function(){return n.ValueCondition}),r.d(t,"PredicateCondition",function(){return n.PredicateCondition}),r.d(t,"StateCondition",function(){return n.StateCondition}),r.d(t,"SwitchBooleanAction",function(){return n.SwitchBooleanAction}),r.d(t,"SetStateAction",function(){return n.SetStateAction}),r.d(t,"SetValueAction",function(){return n.SetValueAction}),r.d(t,"IncrementValueAction",function(){return n.IncrementValueAction}),r.d(t,"PlayAnimationAction",function(){return n.PlayAnimationAction}),r.d(t,"StopAnimationAction",function(){return n.StopAnimationAction}),r.d(t,"DoNothingAction",function(){return n.DoNothingAction}),r.d(t,"CombineAction",function(){return n.CombineAction}),r.d(t,"ExecuteCodeAction",function(){return n.ExecuteCodeAction}),r.d(t,"SetParentAction",function(){return n.SetParentAction}),r.d(t,"PlaySoundAction",function(){return n.PlaySoundAction}),r.d(t,"StopSoundAction",function(){return n.StopSoundAction}),r.d(t,"InterpolateValueAction",function(){return n.InterpolateValueAction}),r.d(t,"Animatable",function(){return n.Animatable}),r.d(t,"Animation",function(){return n.Animation}),r.d(t,"TargetedAnimation",function(){return n.TargetedAnimation}),r.d(t,"AnimationGroup",function(){return n.AnimationGroup}),r.d(t,"AnimationPropertiesOverride",function(){return n.AnimationPropertiesOverride}),r.d(t,"EasingFunction",function(){return n.EasingFunction}),r.d(t,"CircleEase",function(){return n.CircleEase}),r.d(t,"BackEase",function(){return n.BackEase}),r.d(t,"BounceEase",function(){return n.BounceEase}),r.d(t,"CubicEase",function(){return n.CubicEase}),r.d(t,"ElasticEase",function(){return n.ElasticEase}),r.d(t,"ExponentialEase",function(){return n.ExponentialEase}),r.d(t,"PowerEase",function(){return n.PowerEase}),r.d(t,"QuadraticEase",function(){return n.QuadraticEase}),r.d(t,"QuarticEase",function(){return n.QuarticEase}),r.d(t,"QuinticEase",function(){return n.QuinticEase}),r.d(t,"SineEase",function(){return n.SineEase}),r.d(t,"BezierCurveEase",function(){return n.BezierCurveEase}),r.d(t,"RuntimeAnimation",function(){return n.RuntimeAnimation}),r.d(t,"AnimationEvent",function(){return n.AnimationEvent}),r.d(t,"AnimationKeyInterpolation",function(){return n.AnimationKeyInterpolation}),r.d(t,"AnimationRange",function(){return n.AnimationRange}),r.d(t,"Analyser",function(){return n.Analyser}),r.d(t,"AudioEngine",function(){return n.AudioEngine}),r.d(t,"AudioSceneComponent",function(){return n.AudioSceneComponent}),r.d(t,"Sound",function(){return n.Sound}),r.d(t,"SoundTrack",function(){return n.SoundTrack}),r.d(t,"WeightedSound",function(){return n.WeightedSound}),r.d(t,"Bone",function(){return n.Bone}),r.d(t,"BoneIKController",function(){return n.BoneIKController}),r.d(t,"BoneLookController",function(){return n.BoneLookController}),r.d(t,"Skeleton",function(){return n.Skeleton}),r.d(t,"CameraInputTypes",function(){return n.CameraInputTypes}),r.d(t,"CameraInputsManager",function(){return n.CameraInputsManager}),r.d(t,"Camera",function(){return n.Camera}),r.d(t,"TargetCamera",function(){return n.TargetCamera}),r.d(t,"FreeCamera",function(){return n.FreeCamera}),r.d(t,"FreeCameraInputsManager",function(){return n.FreeCameraInputsManager}),r.d(t,"TouchCamera",function(){return n.TouchCamera}),r.d(t,"ArcRotateCamera",function(){return n.ArcRotateCamera}),r.d(t,"ArcRotateCameraInputsManager",function(){return n.ArcRotateCameraInputsManager}),r.d(t,"DeviceOrientationCamera",function(){return n.DeviceOrientationCamera}),r.d(t,"FlyCamera",function(){return n.FlyCamera}),r.d(t,"FlyCameraInputsManager",function(){return n.FlyCameraInputsManager}),r.d(t,"FollowCamera",function(){return n.FollowCamera}),r.d(t,"ArcFollowCamera",function(){return n.ArcFollowCamera}),r.d(t,"GamepadCamera",function(){return n.GamepadCamera}),r.d(t,"UniversalCamera",function(){return n.UniversalCamera}),r.d(t,"VirtualJoysticksCamera",function(){return n.VirtualJoysticksCamera}),r.d(t,"Collider",function(){return n.Collider}),r.d(t,"DefaultCollisionCoordinator",function(){return n.DefaultCollisionCoordinator}),r.d(t,"PickingInfo",function(){return n.PickingInfo}),r.d(t,"IntersectionInfo",function(){return n.IntersectionInfo}),r.d(t,"BoundingBox",function(){return n.BoundingBox}),r.d(t,"BoundingInfo",function(){return n.BoundingInfo}),r.d(t,"BoundingSphere",function(){return n.BoundingSphere}),r.d(t,"Ray",function(){return n.Ray}),r.d(t,"AxesViewer",function(){return n.AxesViewer}),r.d(t,"BoneAxesViewer",function(){return n.BoneAxesViewer}),r.d(t,"DebugLayer",function(){return n.DebugLayer}),r.d(t,"PhysicsViewer",function(){return n.PhysicsViewer}),r.d(t,"RayHelper",function(){return n.RayHelper}),r.d(t,"SkeletonViewer",function(){return n.SkeletonViewer}),r.d(t,"Constants",function(){return n.Constants}),r.d(t,"InstancingAttributeInfo",function(){return n.InstancingAttributeInfo}),r.d(t,"DepthTextureCreationOptions",function(){return n.DepthTextureCreationOptions}),r.d(t,"EngineCapabilities",function(){return n.EngineCapabilities}),r.d(t,"Engine",function(){return n.Engine}),r.d(t,"EngineStore",function(){return n.EngineStore}),r.d(t,"NullEngineOptions",function(){return n.NullEngineOptions}),r.d(t,"NullEngine",function(){return n.NullEngine}),r.d(t,"KeyboardEventTypes",function(){return n.KeyboardEventTypes}),r.d(t,"KeyboardInfo",function(){return n.KeyboardInfo}),r.d(t,"KeyboardInfoPre",function(){return n.KeyboardInfoPre}),r.d(t,"PointerEventTypes",function(){return n.PointerEventTypes}),r.d(t,"PointerInfoBase",function(){return n.PointerInfoBase}),r.d(t,"PointerInfoPre",function(){return n.PointerInfoPre}),r.d(t,"PointerInfo",function(){return n.PointerInfo}),r.d(t,"ClipboardEventTypes",function(){return n.ClipboardEventTypes}),r.d(t,"ClipboardInfo",function(){return n.ClipboardInfo}),r.d(t,"StickValues",function(){return n.StickValues}),r.d(t,"Gamepad",function(){return n.Gamepad}),r.d(t,"GenericPad",function(){return n.GenericPad}),r.d(t,"GamepadManager",function(){return n.GamepadManager}),r.d(t,"GamepadSystemSceneComponent",function(){return n.GamepadSystemSceneComponent}),r.d(t,"Xbox360Button",function(){return n.Xbox360Button}),r.d(t,"Xbox360Dpad",function(){return n.Xbox360Dpad}),r.d(t,"Xbox360Pad",function(){return n.Xbox360Pad}),r.d(t,"AxisDragGizmo",function(){return n.AxisDragGizmo}),r.d(t,"AxisScaleGizmo",function(){return n.AxisScaleGizmo}),r.d(t,"BoundingBoxGizmo",function(){return n.BoundingBoxGizmo}),r.d(t,"Gizmo",function(){return n.Gizmo}),r.d(t,"GizmoManager",function(){return n.GizmoManager}),r.d(t,"PlaneRotationGizmo",function(){return n.PlaneRotationGizmo}),r.d(t,"PositionGizmo",function(){return n.PositionGizmo}),r.d(t,"RotationGizmo",function(){return n.RotationGizmo}),r.d(t,"ScaleGizmo",function(){return n.ScaleGizmo}),r.d(t,"LightGizmo",function(){return n.LightGizmo}),r.d(t,"EnvironmentHelper",function(){return n.EnvironmentHelper}),r.d(t,"PhotoDome",function(){return n.PhotoDome}),r.d(t,"_forceSceneHelpersToBundle",function(){return n._forceSceneHelpersToBundle}),r.d(t,"VideoDome",function(){return n.VideoDome}),r.d(t,"EngineInstrumentation",function(){return n.EngineInstrumentation}),r.d(t,"SceneInstrumentation",function(){return n.SceneInstrumentation}),r.d(t,"_TimeToken",function(){return n._TimeToken}),r.d(t,"EffectLayer",function(){return n.EffectLayer}),r.d(t,"EffectLayerSceneComponent",function(){return n.EffectLayerSceneComponent}),r.d(t,"GlowLayer",function(){return n.GlowLayer}),r.d(t,"HighlightLayer",function(){return n.HighlightLayer}),r.d(t,"Layer",function(){return n.Layer}),r.d(t,"LayerSceneComponent",function(){return n.LayerSceneComponent}),r.d(t,"LensFlare",function(){return n.LensFlare}),r.d(t,"LensFlareSystem",function(){return n.LensFlareSystem}),r.d(t,"LensFlareSystemSceneComponent",function(){return n.LensFlareSystemSceneComponent}),r.d(t,"Light",function(){return n.Light}),r.d(t,"ShadowLight",function(){return n.ShadowLight}),r.d(t,"DirectionalLight",function(){return n.DirectionalLight}),r.d(t,"HemisphericLight",function(){return n.HemisphericLight}),r.d(t,"PointLight",function(){return n.PointLight}),r.d(t,"SpotLight",function(){return n.SpotLight}),r.d(t,"DefaultLoadingScreen",function(){return n.DefaultLoadingScreen}),r.d(t,"SceneLoaderProgressEvent",function(){return n.SceneLoaderProgressEvent}),r.d(t,"SceneLoader",function(){return n.SceneLoader}),r.d(t,"SceneLoaderFlags",function(){return n.SceneLoaderFlags}),r.d(t,"ColorCurves",function(){return n.ColorCurves}),r.d(t,"EffectFallbacks",function(){return n.EffectFallbacks}),r.d(t,"EffectCreationOptions",function(){return n.EffectCreationOptions}),r.d(t,"Effect",function(){return n.Effect}),r.d(t,"FresnelParameters",function(){return n.FresnelParameters}),r.d(t,"ImageProcessingConfigurationDefines",function(){return n.ImageProcessingConfigurationDefines}),r.d(t,"ImageProcessingConfiguration",function(){return n.ImageProcessingConfiguration}),r.d(t,"Material",function(){return n.Material}),r.d(t,"MaterialDefines",function(){return n.MaterialDefines}),r.d(t,"MaterialHelper",function(){return n.MaterialHelper}),r.d(t,"MultiMaterial",function(){return n.MultiMaterial}),r.d(t,"PushMaterial",function(){return n.PushMaterial}),r.d(t,"ShaderMaterial",function(){return n.ShaderMaterial}),r.d(t,"StandardMaterialDefines",function(){return n.StandardMaterialDefines}),r.d(t,"StandardMaterial",function(){return n.StandardMaterial}),r.d(t,"BaseTexture",function(){return n.BaseTexture}),r.d(t,"CubeTexture",function(){return n.CubeTexture}),r.d(t,"InternalTexture",function(){return n.InternalTexture}),r.d(t,"MirrorTexture",function(){return n.MirrorTexture}),r.d(t,"RawTexture",function(){return n.RawTexture}),r.d(t,"RenderTargetTexture",function(){return n.RenderTargetTexture}),r.d(t,"MultiviewRenderTarget",function(){return n.MultiviewRenderTarget}),r.d(t,"Texture",function(){return n.Texture}),r.d(t,"UniformBuffer",function(){return n.UniformBuffer}),r.d(t,"MaterialFlags",function(){return n.MaterialFlags}),r.d(t,"Scalar",function(){return n.Scalar}),r.d(t,"ToGammaSpace",function(){return n.ToGammaSpace}),r.d(t,"ToLinearSpace",function(){return n.ToLinearSpace}),r.d(t,"Epsilon",function(){return n.Epsilon}),r.d(t,"Color3",function(){return n.Color3}),r.d(t,"Color4",function(){return n.Color4}),r.d(t,"Vector2",function(){return n.Vector2}),r.d(t,"Vector3",function(){return n.Vector3}),r.d(t,"Vector4",function(){return n.Vector4}),r.d(t,"Size",function(){return n.Size}),r.d(t,"Quaternion",function(){return n.Quaternion}),r.d(t,"Matrix",function(){return n.Matrix}),r.d(t,"Plane",function(){return n.Plane}),r.d(t,"Viewport",function(){return n.Viewport}),r.d(t,"Frustum",function(){return n.Frustum}),r.d(t,"Space",function(){return n.Space}),r.d(t,"Axis",function(){return n.Axis}),r.d(t,"BezierCurve",function(){return n.BezierCurve}),r.d(t,"Orientation",function(){return n.Orientation}),r.d(t,"Angle",function(){return n.Angle}),r.d(t,"Arc2",function(){return n.Arc2}),r.d(t,"Path2",function(){return n.Path2}),r.d(t,"Path3D",function(){return n.Path3D}),r.d(t,"Curve3",function(){return n.Curve3}),r.d(t,"PositionNormalVertex",function(){return n.PositionNormalVertex}),r.d(t,"PositionNormalTextureVertex",function(){return n.PositionNormalTextureVertex}),r.d(t,"Tmp",function(){return n.Tmp}),r.d(t,"SphericalPolynomial",function(){return n.SphericalPolynomial}),r.d(t,"SphericalHarmonics",function(){return n.SphericalHarmonics}),r.d(t,"AbstractMesh",function(){return n.AbstractMesh}),r.d(t,"Buffer",function(){return n.Buffer}),r.d(t,"VertexBuffer",function(){return n.VertexBuffer}),r.d(t,"CSG",function(){return n.CSG}),r.d(t,"Geometry",function(){return n.Geometry}),r.d(t,"GroundMesh",function(){return n.GroundMesh}),r.d(t,"TrailMesh",function(){return n.TrailMesh}),r.d(t,"InstancedMesh",function(){return n.InstancedMesh}),r.d(t,"LinesMesh",function(){return n.LinesMesh}),r.d(t,"InstancedLinesMesh",function(){return n.InstancedLinesMesh}),r.d(t,"MeshLODLevel",function(){return n.MeshLODLevel}),r.d(t,"_CreationDataStorage",function(){return n._CreationDataStorage}),r.d(t,"_InstancesBatch",function(){return n._InstancesBatch}),r.d(t,"Mesh",function(){return n.Mesh}),r.d(t,"VertexData",function(){return n.VertexData}),r.d(t,"MeshBuilder",function(){return n.MeshBuilder}),r.d(t,"SimplificationSettings",function(){return n.SimplificationSettings}),r.d(t,"SimplificationQueue",function(){return n.SimplificationQueue}),r.d(t,"SimplificationType",function(){return n.SimplificationType}),r.d(t,"SimplicationQueueSceneComponent",function(){return n.SimplicationQueueSceneComponent}),r.d(t,"Polygon",function(){return n.Polygon}),r.d(t,"PolygonMeshBuilder",function(){return n.PolygonMeshBuilder}),r.d(t,"BaseSubMesh",function(){return n.BaseSubMesh}),r.d(t,"SubMesh",function(){return n.SubMesh}),r.d(t,"TransformNode",function(){return n.TransformNode}),r.d(t,"BoxBuilder",function(){return n.BoxBuilder}),r.d(t,"SphereBuilder",function(){return n.SphereBuilder}),r.d(t,"CylinderBuilder",function(){return n.CylinderBuilder}),r.d(t,"LinesBuilder",function(){return n.LinesBuilder}),r.d(t,"PlaneBuilder",function(){return n.PlaneBuilder}),r.d(t,"MorphTarget",function(){return n.MorphTarget}),r.d(t,"MorphTargetManager",function(){return n.MorphTargetManager}),r.d(t,"Database",function(){return n.Database}),r.d(t,"BaseParticleSystem",function(){return n.BaseParticleSystem}),r.d(t,"GPUParticleSystem",function(){return n.GPUParticleSystem}),r.d(t,"Particle",function(){return n.Particle}),r.d(t,"ParticleHelper",function(){return n.ParticleHelper}),r.d(t,"ParticleSystem",function(){return n.ParticleSystem}),r.d(t,"_IDoNeedToBeInTheBuild",function(){return n._IDoNeedToBeInTheBuild}),r.d(t,"ParticleSystemSet",function(){return n.ParticleSystemSet}),r.d(t,"SolidParticle",function(){return n.SolidParticle}),r.d(t,"ModelShape",function(){return n.ModelShape}),r.d(t,"DepthSortedParticle",function(){return n.DepthSortedParticle}),r.d(t,"SolidParticleSystem",function(){return n.SolidParticleSystem}),r.d(t,"SubEmitterType",function(){return n.SubEmitterType}),r.d(t,"SubEmitter",function(){return n.SubEmitter}),r.d(t,"PhysicsEngine",function(){return n.PhysicsEngine}),r.d(t,"PhysicsEngineSceneComponent",function(){return n.PhysicsEngineSceneComponent}),r.d(t,"PhysicsHelper",function(){return n.PhysicsHelper}),r.d(t,"PhysicsRadialExplosionEventOptions",function(){return n.PhysicsRadialExplosionEventOptions}),r.d(t,"PhysicsUpdraftEventOptions",function(){return n.PhysicsUpdraftEventOptions}),r.d(t,"PhysicsVortexEventOptions",function(){return n.PhysicsVortexEventOptions}),r.d(t,"PhysicsRadialImpulseFalloff",function(){return n.PhysicsRadialImpulseFalloff}),r.d(t,"PhysicsUpdraftMode",function(){return n.PhysicsUpdraftMode}),r.d(t,"PhysicsImpostor",function(){return n.PhysicsImpostor}),r.d(t,"PhysicsJoint",function(){return n.PhysicsJoint}),r.d(t,"DistanceJoint",function(){return n.DistanceJoint}),r.d(t,"MotorEnabledJoint",function(){return n.MotorEnabledJoint}),r.d(t,"HingeJoint",function(){return n.HingeJoint}),r.d(t,"Hinge2Joint",function(){return n.Hinge2Joint}),r.d(t,"AnaglyphPostProcess",function(){return n.AnaglyphPostProcess}),r.d(t,"BlackAndWhitePostProcess",function(){return n.BlackAndWhitePostProcess}),r.d(t,"BloomEffect",function(){return n.BloomEffect}),r.d(t,"BloomMergePostProcess",function(){return n.BloomMergePostProcess}),r.d(t,"BlurPostProcess",function(){return n.BlurPostProcess}),r.d(t,"ChromaticAberrationPostProcess",function(){return n.ChromaticAberrationPostProcess}),r.d(t,"CircleOfConfusionPostProcess",function(){return n.CircleOfConfusionPostProcess}),r.d(t,"ColorCorrectionPostProcess",function(){return n.ColorCorrectionPostProcess}),r.d(t,"ConvolutionPostProcess",function(){return n.ConvolutionPostProcess}),r.d(t,"DepthOfFieldBlurPostProcess",function(){return n.DepthOfFieldBlurPostProcess}),r.d(t,"DepthOfFieldEffectBlurLevel",function(){return n.DepthOfFieldEffectBlurLevel}),r.d(t,"DepthOfFieldEffect",function(){return n.DepthOfFieldEffect}),r.d(t,"DepthOfFieldMergePostProcessOptions",function(){return n.DepthOfFieldMergePostProcessOptions}),r.d(t,"DepthOfFieldMergePostProcess",function(){return n.DepthOfFieldMergePostProcess}),r.d(t,"DisplayPassPostProcess",function(){return n.DisplayPassPostProcess}),r.d(t,"ExtractHighlightsPostProcess",function(){return n.ExtractHighlightsPostProcess}),r.d(t,"FilterPostProcess",function(){return n.FilterPostProcess}),r.d(t,"FxaaPostProcess",function(){return n.FxaaPostProcess}),r.d(t,"GrainPostProcess",function(){return n.GrainPostProcess}),r.d(t,"HighlightsPostProcess",function(){return n.HighlightsPostProcess}),r.d(t,"ImageProcessingPostProcess",function(){return n.ImageProcessingPostProcess}),r.d(t,"MotionBlurPostProcess",function(){return n.MotionBlurPostProcess}),r.d(t,"PassPostProcess",function(){return n.PassPostProcess}),r.d(t,"PassCubePostProcess",function(){return n.PassCubePostProcess}),r.d(t,"PostProcess",function(){return n.PostProcess}),r.d(t,"PostProcessManager",function(){return n.PostProcessManager}),r.d(t,"RefractionPostProcess",function(){return n.RefractionPostProcess}),r.d(t,"SharpenPostProcess",function(){return n.SharpenPostProcess}),r.d(t,"StereoscopicInterlacePostProcess",function(){return n.StereoscopicInterlacePostProcess}),r.d(t,"TonemappingOperator",function(){return n.TonemappingOperator}),r.d(t,"TonemapPostProcess",function(){return n.TonemapPostProcess}),r.d(t,"VolumetricLightScatteringPostProcess",function(){return n.VolumetricLightScatteringPostProcess}),r.d(t,"VRDistortionCorrectionPostProcess",function(){return n.VRDistortionCorrectionPostProcess}),r.d(t,"VRMultiviewToSingleview",function(){return n.VRMultiviewToSingleview}),r.d(t,"ReflectionProbe",function(){return n.ReflectionProbe}),r.d(t,"BoundingBoxRenderer",function(){return n.BoundingBoxRenderer}),r.d(t,"DepthRenderer",function(){return n.DepthRenderer}),r.d(t,"DepthRendererSceneComponent",function(){return n.DepthRendererSceneComponent}),r.d(t,"EdgesRenderer",function(){return n.EdgesRenderer}),r.d(t,"LineEdgesRenderer",function(){return n.LineEdgesRenderer}),r.d(t,"GeometryBufferRenderer",function(){return n.GeometryBufferRenderer}),r.d(t,"GeometryBufferRendererSceneComponent",function(){return n.GeometryBufferRendererSceneComponent}),r.d(t,"OutlineRenderer",function(){return n.OutlineRenderer}),r.d(t,"RenderingGroup",function(){return n.RenderingGroup}),r.d(t,"RenderingGroupInfo",function(){return n.RenderingGroupInfo}),r.d(t,"RenderingManager",function(){return n.RenderingManager}),r.d(t,"UtilityLayerRenderer",function(){return n.UtilityLayerRenderer}),r.d(t,"Sprite",function(){return n.Sprite}),r.d(t,"SpriteManager",function(){return n.SpriteManager}),r.d(t,"SpriteSceneComponent",function(){return n.SpriteSceneComponent}),r.d(t,"_AlphaState",function(){return n._AlphaState}),r.d(t,"_DepthCullingState",function(){return n._DepthCullingState}),r.d(t,"_StencilState",function(){return n._StencilState}),r.d(t,"AndOrNotEvaluator",function(){return n.AndOrNotEvaluator}),r.d(t,"AssetTaskState",function(){return n.AssetTaskState}),r.d(t,"AbstractAssetTask",function(){return n.AbstractAssetTask}),r.d(t,"AssetsProgressEvent",function(){return n.AssetsProgressEvent}),r.d(t,"MeshAssetTask",function(){return n.MeshAssetTask}),r.d(t,"TextFileAssetTask",function(){return n.TextFileAssetTask}),r.d(t,"BinaryFileAssetTask",function(){return n.BinaryFileAssetTask}),r.d(t,"ImageAssetTask",function(){return n.ImageAssetTask}),r.d(t,"TextureAssetTask",function(){return n.TextureAssetTask}),r.d(t,"CubeTextureAssetTask",function(){return n.CubeTextureAssetTask}),r.d(t,"HDRCubeTextureAssetTask",function(){return n.HDRCubeTextureAssetTask}),r.d(t,"AssetsManager",function(){return n.AssetsManager}),r.d(t,"DDSTools",function(){return n.DDSTools}),r.d(t,"expandToProperty",function(){return n.expandToProperty}),r.d(t,"serialize",function(){return n.serialize}),r.d(t,"serializeAsTexture",function(){return n.serializeAsTexture}),r.d(t,"serializeAsColor3",function(){return n.serializeAsColor3}),r.d(t,"serializeAsFresnelParameters",function(){return n.serializeAsFresnelParameters}),r.d(t,"serializeAsVector2",function(){return n.serializeAsVector2}),r.d(t,"serializeAsVector3",function(){return n.serializeAsVector3}),r.d(t,"serializeAsMeshReference",function(){return n.serializeAsMeshReference}),r.d(t,"serializeAsColorCurves",function(){return n.serializeAsColorCurves}),r.d(t,"serializeAsColor4",function(){return n.serializeAsColor4}),r.d(t,"serializeAsImageProcessingConfiguration",function(){return n.serializeAsImageProcessingConfiguration}),r.d(t,"serializeAsQuaternion",function(){return n.serializeAsQuaternion}),r.d(t,"serializeAsMatrix",function(){return n.serializeAsMatrix}),r.d(t,"serializeAsCameraReference",function(){return n.serializeAsCameraReference}),r.d(t,"SerializationHelper",function(){return n.SerializationHelper}),r.d(t,"Deferred",function(){return n.Deferred}),r.d(t,"EnvironmentTextureTools",function(){return n.EnvironmentTextureTools}),r.d(t,"MeshExploder",function(){return n.MeshExploder}),r.d(t,"FilesInput",function(){return n.FilesInput}),r.d(t,"CubeMapToSphericalPolynomialTools",function(){return n.CubeMapToSphericalPolynomialTools}),r.d(t,"KhronosTextureContainer",function(){return n.KhronosTextureContainer}),r.d(t,"EventState",function(){return n.EventState}),r.d(t,"Observer",function(){return n.Observer}),r.d(t,"MultiObserver",function(){return n.MultiObserver}),r.d(t,"Observable",function(){return n.Observable}),r.d(t,"PerformanceMonitor",function(){return n.PerformanceMonitor}),r.d(t,"RollingAverage",function(){return n.RollingAverage}),r.d(t,"PromisePolyfill",function(){return n.PromisePolyfill}),r.d(t,"SceneOptimization",function(){return n.SceneOptimization}),r.d(t,"TextureOptimization",function(){return n.TextureOptimization}),r.d(t,"HardwareScalingOptimization",function(){return n.HardwareScalingOptimization}),r.d(t,"ShadowsOptimization",function(){return n.ShadowsOptimization}),r.d(t,"PostProcessesOptimization",function(){return n.PostProcessesOptimization}),r.d(t,"LensFlaresOptimization",function(){return n.LensFlaresOptimization}),r.d(t,"CustomOptimization",function(){return n.CustomOptimization}),r.d(t,"ParticlesOptimization",function(){return n.ParticlesOptimization}),r.d(t,"RenderTargetsOptimization",function(){return n.RenderTargetsOptimization}),r.d(t,"MergeMeshesOptimization",function(){return n.MergeMeshesOptimization}),r.d(t,"SceneOptimizerOptions",function(){return n.SceneOptimizerOptions}),r.d(t,"SceneOptimizer",function(){return n.SceneOptimizer}),r.d(t,"SceneSerializer",function(){return n.SceneSerializer}),r.d(t,"SmartArray",function(){return n.SmartArray}),r.d(t,"SmartArrayNoDuplicate",function(){return n.SmartArrayNoDuplicate}),r.d(t,"StringDictionary",function(){return n.StringDictionary}),r.d(t,"Tags",function(){return n.Tags}),r.d(t,"TextureTools",function(){return n.TextureTools}),r.d(t,"TGATools",function(){return n.TGATools}),r.d(t,"ColorGradient",function(){return n.ColorGradient}),r.d(t,"Color3Gradient",function(){return n.Color3Gradient}),r.d(t,"FactorGradient",function(){return n.FactorGradient}),r.d(t,"LoadFileError",function(){return n.LoadFileError}),r.d(t,"RetryStrategy",function(){return n.RetryStrategy}),r.d(t,"Tools",function(){return n.Tools}),r.d(t,"PerfCounter",function(){return n.PerfCounter}),r.d(t,"className",function(){return n.className}),r.d(t,"AsyncLoop",function(){return n.AsyncLoop}),r.d(t,"VideoRecorder",function(){return n.VideoRecorder}),r.d(t,"JoystickAxis",function(){return n.JoystickAxis}),r.d(t,"VirtualJoystick",function(){return n.VirtualJoystick}),r.d(t,"WorkerPool",function(){return n.WorkerPool}),r.d(t,"Logger",function(){return n.Logger}),r.d(t,"_TypeStore",function(){return n._TypeStore}),r.d(t,"FilesInputStore",function(){return n.FilesInputStore}),r.d(t,"DeepCopier",function(){return n.DeepCopier}),r.d(t,"PivotTools",function(){return n.PivotTools}),r.d(t,"PrecisionDate",function(){return n.PrecisionDate}),r.d(t,"ScreenshotTools",function(){return n.ScreenshotTools}),r.d(t,"WebRequest",function(){return n.WebRequest}),r.d(t,"InspectableType",function(){return n.InspectableType}),r.d(t,"AutoRotationBehavior",function(){return n.AutoRotationBehavior}),r.d(t,"BouncingBehavior",function(){return n.BouncingBehavior}),r.d(t,"FramingBehavior",function(){return n.FramingBehavior}),r.d(t,"AttachToBoxBehavior",function(){return n.AttachToBoxBehavior}),r.d(t,"FadeInOutBehavior",function(){return n.FadeInOutBehavior}),r.d(t,"MultiPointerScaleBehavior",function(){return n.MultiPointerScaleBehavior}),r.d(t,"PointerDragBehavior",function(){return n.PointerDragBehavior}),r.d(t,"SixDofDragBehavior",function(){return n.SixDofDragBehavior}),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}),r.d(t,"AnaglyphArcRotateCamera",function(){return n.AnaglyphArcRotateCamera}),r.d(t,"AnaglyphFreeCamera",function(){return n.AnaglyphFreeCamera}),r.d(t,"AnaglyphGamepadCamera",function(){return n.AnaglyphGamepadCamera}),r.d(t,"AnaglyphUniversalCamera",function(){return n.AnaglyphUniversalCamera}),r.d(t,"StereoscopicArcRotateCamera",function(){return n.StereoscopicArcRotateCamera}),r.d(t,"StereoscopicFreeCamera",function(){return n.StereoscopicFreeCamera}),r.d(t,"StereoscopicGamepadCamera",function(){return n.StereoscopicGamepadCamera}),r.d(t,"StereoscopicUniversalCamera",function(){return n.StereoscopicUniversalCamera}),r.d(t,"VRCameraMetrics",function(){return n.VRCameraMetrics}),r.d(t,"VRDeviceOrientationArcRotateCamera",function(){return n.VRDeviceOrientationArcRotateCamera}),r.d(t,"VRDeviceOrientationFreeCamera",function(){return n.VRDeviceOrientationFreeCamera}),r.d(t,"VRDeviceOrientationGamepadCamera",function(){return n.VRDeviceOrientationGamepadCamera}),r.d(t,"OnAfterEnteringVRObservableEvent",function(){return n.OnAfterEnteringVRObservableEvent}),r.d(t,"VRExperienceHelper",function(){return n.VRExperienceHelper}),r.d(t,"WebVRFreeCamera",function(){return n.WebVRFreeCamera}),r.d(t,"WebXRCamera",function(){return n.WebXRCamera}),r.d(t,"WebXREnterExitUIButton",function(){return n.WebXREnterExitUIButton}),r.d(t,"WebXREnterExitUIOptions",function(){return n.WebXREnterExitUIOptions}),r.d(t,"WebXREnterExitUI",function(){return n.WebXREnterExitUI}),r.d(t,"WebXRState",function(){return n.WebXRState}),r.d(t,"WebXRExperienceHelper",function(){return n.WebXRExperienceHelper}),r.d(t,"WebXRController",function(){return n.WebXRController}),r.d(t,"WebXRInput",function(){return n.WebXRInput}),r.d(t,"WebXRManagedOutputCanvas",function(){return n.WebXRManagedOutputCanvas}),r.d(t,"WebXRSessionManager",function(){return n.WebXRSessionManager}),r.d(t,"Octree",function(){return n.Octree}),r.d(t,"OctreeBlock",function(){return n.OctreeBlock}),r.d(t,"OctreeSceneComponent",function(){return n.OctreeSceneComponent}),r.d(t,"_OcclusionDataStorage",function(){return n._OcclusionDataStorage}),r.d(t,"_forceTransformFeedbackToBundle",function(){return n._forceTransformFeedbackToBundle}),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,"ShadowGenerator",function(){return n.ShadowGenerator}),r.d(t,"ShadowGeneratorSceneComponent",function(){return n.ShadowGeneratorSceneComponent}),r.d(t,"_BabylonLoaderRegistered",function(){return n._BabylonLoaderRegistered}),r.d(t,"BackgroundMaterial",function(){return n.BackgroundMaterial}),r.d(t,"PBRBaseMaterial",function(){return n.PBRBaseMaterial}),r.d(t,"PBRBaseSimpleMaterial",function(){return n.PBRBaseSimpleMaterial}),r.d(t,"PBRMaterial",function(){return n.PBRMaterial}),r.d(t,"PBRMetallicRoughnessMaterial",function(){return n.PBRMetallicRoughnessMaterial}),r.d(t,"PBRSpecularGlossinessMaterial",function(){return n.PBRSpecularGlossinessMaterial}),r.d(t,"ColorGradingTexture",function(){return n.ColorGradingTexture}),r.d(t,"DynamicTexture",function(){return n.DynamicTexture}),r.d(t,"EquiRectangularCubeTexture",function(){return n.EquiRectangularCubeTexture}),r.d(t,"HDRCubeTexture",function(){return n.HDRCubeTexture}),r.d(t,"DummyInternalTextureTracker",function(){return n.DummyInternalTextureTracker}),r.d(t,"MultiRenderTarget",function(){return n.MultiRenderTarget}),r.d(t,"RawCubeTexture",function(){return n.RawCubeTexture}),r.d(t,"RawTexture3D",function(){return n.RawTexture3D}),r.d(t,"RefractionTexture",function(){return n.RefractionTexture}),r.d(t,"VideoTexture",function(){return n.VideoTexture}),r.d(t,"DracoCompression",function(){return n.DracoCompression}),r.d(t,"DiscBuilder",function(){return n.DiscBuilder}),r.d(t,"RibbonBuilder",function(){return n.RibbonBuilder}),r.d(t,"TorusBuilder",function(){return n.TorusBuilder}),r.d(t,"TorusKnotBuilder",function(){return n.TorusKnotBuilder}),r.d(t,"PolygonBuilder",function(){return n.PolygonBuilder}),r.d(t,"ShapeBuilder",function(){return n.ShapeBuilder}),r.d(t,"LatheBuilder",function(){return n.LatheBuilder}),r.d(t,"GroundBuilder",function(){return n.GroundBuilder}),r.d(t,"TubeBuilder",function(){return n.TubeBuilder}),r.d(t,"PolyhedronBuilder",function(){return n.PolyhedronBuilder}),r.d(t,"IcoSphereBuilder",function(){return n.IcoSphereBuilder}),r.d(t,"DecalBuilder",function(){return n.DecalBuilder}),r.d(t,"BoxParticleEmitter",function(){return n.BoxParticleEmitter}),r.d(t,"ConeParticleEmitter",function(){return n.ConeParticleEmitter}),r.d(t,"CylinderParticleEmitter",function(){return n.CylinderParticleEmitter}),r.d(t,"CylinderDirectedParticleEmitter",function(){return n.CylinderDirectedParticleEmitter}),r.d(t,"HemisphericParticleEmitter",function(){return n.HemisphericParticleEmitter}),r.d(t,"PointParticleEmitter",function(){return n.PointParticleEmitter}),r.d(t,"SphereParticleEmitter",function(){return n.SphereParticleEmitter}),r.d(t,"SphereDirectedParticleEmitter",function(){return n.SphereDirectedParticleEmitter}),r.d(t,"CannonJSPlugin",function(){return n.CannonJSPlugin}),r.d(t,"AmmoJSPlugin",function(){return n.AmmoJSPlugin}),r.d(t,"OimoJSPlugin",function(){return n.OimoJSPlugin}),r.d(t,"PostProcessRenderEffect",function(){return n.PostProcessRenderEffect}),r.d(t,"PostProcessRenderPipeline",function(){return n.PostProcessRenderPipeline}),r.d(t,"PostProcessRenderPipelineManager",function(){return n.PostProcessRenderPipelineManager}),r.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return n.PostProcessRenderPipelineManagerSceneComponent}),r.d(t,"HDRTools",function(){return n.HDRTools}),r.d(t,"PanoramaToCubeMapTools",function(){return n.PanoramaToCubeMapTools}),r.d(t,"_DDSTextureLoader",function(){return n._DDSTextureLoader}),r.d(t,"_ENVTextureLoader",function(){return n._ENVTextureLoader}),r.d(t,"_KTXTextureLoader",function(){return n._KTXTextureLoader}),r.d(t,"_TGATextureLoader",function(){return n._TGATextureLoader}),r.d(t,"CustomProceduralTexture",function(){return n.CustomProceduralTexture}),r.d(t,"NoiseProceduralTexture",function(){return n.NoiseProceduralTexture}),r.d(t,"ProceduralTexture",function(){return n.ProceduralTexture}),r.d(t,"ProceduralTextureSceneComponent",function(){return n.ProceduralTextureSceneComponent}),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 o=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==o){o.BABYLON=s,o.BABYLON=o.BABYLON||{};var s=o.BABYLON;s.Debug=s.Debug||{};var a=[];for(var c in i)s.Debug[c]=i[c],a.push(c);for(var c in n)s[c]=n[c]}var l={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 */"./Maths/math.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 f});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Culling/ray */"./Culling/ray.ts"),l=r(/*! ../Materials/material */"./Materials/material.ts"),u=r(/*! ./lensFlare */"./LensFlares/lensFlare.ts"),h=r(/*! ../Engines/constants */"./Engines/constants.ts"),d=(r(/*! ../Shaders/lensFlare.fragment */"./Shaders/lensFlare.fragment.ts"),r(/*! ../Shaders/lensFlare.vertex */"./Shaders/lensFlare.vertex.ts"),r(/*! ../Misc/devTools */"./Misc/devTools.ts")),f=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 c=[];c.push(0),c.push(1),c.push(2),c.push(0),c.push(2),c.push(3),this._indexBuffer=i.createIndexBuffer(c),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:!0,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 c.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 c=n.x+n.width/2,u=n.y+n.height/2,d=c-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 g=this.lensFlares[p];r.setAlphaMode(g.alphaMode);var m=c-d*g.position,_=u-f*g.position,v=g.size,A=g.size*r.getAspectRatio(this._scene.activeCamera,!0),y=m/(n.width+2*n.x)*2-1,b=1-_/(n.height+2*n.y)*2,T=i.Matrix.FromValues(v/2,0,0,0,0,A/2,0,0,0,0,1,0,y,b,0,1);this._effect.setMatrix("viewportMatrix",T),this._effect.setTexture("textureSampler",g.texture),this._effect.setFloat4("color",g.color.r*a,g.color.g*a,g.color.b*a,1),r.drawElementsType(l.Material.TriangleFillMode,0,6)}return r.setDepthBuffer(!0),r.setAlphaMode(h.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 o=r.getLastEntryByID(t.emitterId),s=t.name||"lensFlareSystem#"+t.emitterId,a=new e(s,o,r);a.id=t.id||s,a.borderLimit=t.borderLimit;for(var c=0;c<t.flares.length;c++){var l=t.flares[c];u.LensFlare.AddFlare(l.size,l.position,i.Color3.FromArray(l.color),l.textureName?n+l.textureName:"",a)}return a},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 d._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],c=s.LensFlareSystem.Parse(a,t,n);r.lensFlareSystems.push(c)}}}),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/index.ts":
- /*!*********************************!*\
- !*** ./Lights/Shadows/index.ts ***!
- \*********************************/
- /*! exports provided: ShadowGenerator, 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(/*! ./shadowGeneratorSceneComponent */"./Lights/Shadows/shadowGeneratorSceneComponent.ts");r.d(t,"ShadowGeneratorSceneComponent",function(){return i.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 m});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math */"./Maths/math.ts"),o=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../../Lights/light */"./Lights/light.ts"),a=r(/*! ../../Materials/material */"./Materials/material.ts"),c=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),h=r(/*! ../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),d=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(/*! ../../Misc/observable */"./Misc/observable.ts")),g=r(/*! ../../Misc/devTools */"./Misc/devTools.ts"),m=function(){function e(t,r,n){this.onBeforeShadowMapRenderObservable=new p.Observable,this.onBeforeShadowMapRenderMeshObservable=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.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"normalBias",{get:function(){return this._normalBias},set:function(e){this._normalBias=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurBoxOffset",{get:function(){return this._blurBoxOffset},set:function(e){this._blurBoxOffset!==e&&(this._blurBoxOffset=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurScale",{get:function(){return this._blurScale},set:function(e){this._blurScale!==e&&(this._blurScale=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurKernel",{get:function(){return this._blurKernel},set:function(e){this._blurKernel!==e&&(this._blurKernel=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useKernelBlur",{get:function(){return this._useKernelBlur},set:function(e){this._useKernelBlur!==e&&(this._useKernelBlur=e,this._disposeBlurPostProcesses())},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter},set:function(t){if(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:!0,configurable:!0}),Object.defineProperty(e.prototype,"usePoissonSampling",{get:function(){return this.filter===e.FILTER_POISSONSAMPLING},set:function(t){(t||this.filter===e.FILTER_POISSONSAMPLING)&&(this.filter=t?e.FILTER_POISSONSAMPLING:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useExponentialShadowMap",{get:function(){return this.filter===e.FILTER_EXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_EXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_EXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useBlurExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_BLUREXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_CLOSEEXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useBlurCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usePercentageCloserFiltering",{get:function(){return this.filter===e.FILTER_PCF},set:function(t){(t||this.filter===e.FILTER_PCF)&&(this.filter=t?e.FILTER_PCF:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filteringQuality",{get:function(){return this._filteringQuality},set:function(e){this._filteringQuality=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useContactHardeningShadow",{get:function(){return this.filter===e.FILTER_PCSS},set:function(t){(t||this.filter===e.FILTER_PCSS)&&(this.filter=t?e.FILTER_PCSS:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contactHardeningLightSizeUVRatio",{get:function(){return this._contactHardeningLightSizeUVRatio},set:function(e){this._contactHardeningLightSizeUVRatio=e},enumerable:!0,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},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.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._initializeShadowMap=function(){var t=this,r=this._scene.getEngine();r.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()),this._shadowMap.wrapU=l.Texture.CLAMP_ADDRESSMODE,this._shadowMap.wrapV=l.Texture.CLAMP_ADDRESSMODE,this._shadowMap.anisotropicFilteringLevel=1,this._shadowMap.updateSamplingMode(l.Texture.BILINEAR_SAMPLINGMODE),this._shadowMap.renderParticles=!1,this._shadowMap.ignoreCameraViewport=!0,this._shadowMap.onBeforeRenderObservable.add(function(n){t._currentFaceIndex=n,t._filter===e.FILTER_PCF&&r.setColorWrite(!1)}),this._shadowMap.customRenderFunction=this._renderForShadowMap.bind(this),this._shadowMap.onAfterUnbindObservable.add(function(){if(t._filter===e.FILTER_PCF&&r.setColorWrite(!0),t.useBlurExponentialShadowMap||t.useBlurCloseExponentialShadowMap){var n=t.getShadowMapForRendering();n&&t._scene.postProcessManager.directRender(t._blurPostProcesses,n.getInternalTexture(),!0)}});var n=new i.Color4(0,0,0,0),o=new i.Color4(1,1,1,1);this._shadowMap.onClearObservable.add(function(r){t._filter===e.FILTER_PCF?r.clear(o,!1,!0,!1):t.useExponentialShadowMap||t.useBlurExponentialShadowMap?r.clear(n,!0,!0,!1):r.clear(o,!0,!0,!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=l.Texture.CLAMP_ADDRESSMODE,this._shadowMap2.wrapV=l.Texture.CLAMP_ADDRESSMODE,this._shadowMap2.updateSamplingMode(l.Texture.BILINEAR_SAMPLINGMODE)),this.useKernelBlur?(this._kernelBlurXPostprocess=new d.BlurPostProcess(this._light.name+"KernelBlurX",new i.Vector2(1,0),this.blurKernel,1,null,l.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 d.BlurPostProcess(this._light.name+"KernelBlurY",new i.Vector2(0,1),this.blurKernel,1,null,l.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 h.PostProcess(this._light.name+"DepthBoxBlur","depthBoxBlur",["screenSize","boxOffset"],[],1,null,l.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();if(n.length){for(o.setColorWrite(!1),i=0;i<n.length;i++)this._renderSubMeshForShadowMap(n.data[i]);o.setColorWrite(!0)}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])},e.prototype._renderSubMeshForShadowMap=function(e){var t=this,r=e.getRenderingMesh(),n=this._scene,i=n.getEngine(),o=e.getMaterial();if(o&&0!==e.verticesCount){i.setState(o.backFaceCulling);var l=r._getInstancesRenderList(e._id);if(!l.mustReturn){var u=i.getCaps().instancedArrays&&null!==l.visibleInstances[e._id]&&void 0!==l.visibleInstances[e._id];if(this.isReady(e,u)){if(i.enableEffect(this._effect),r._bind(e,this._effect,a.Material.TriangleFillMode),this._effect.setFloat3("biasAndScale",this.bias,this.normalBias,this.depthScale),this._effect.setMatrix("viewProjection",this.getTransformMatrix()),this.getLight().getTypeID()===s.Light.LIGHTTYPEID_DIRECTIONALLIGHT?this._effect.setVector3("lightData",this._cachedDirection):this._effect.setVector3("lightData",this._cachedPosition),n.activeCamera&&this._effect.setFloat2("depthValues",this.getLight().getDepthMinZ(n.activeCamera),this.getLight().getDepthMinZ(n.activeCamera)+this.getLight().getDepthMaxZ(n.activeCamera)),o&&o.needAlphaTesting()){var h=o.getAlphaTestTexture();h&&(this._effect.setTexture("diffuseSampler",h),this._effect.setMatrix("diffuseMatrix",h.getTextureMatrix()||this._defaultTextureMatrix))}if(r.useBones&&r.computeBonesUsingShaders&&r.skeleton){var d=r.skeleton;if(d.isUsingTextureForMatrices){var f=d.getTransformMatrixTexture();if(!f)return;this._effect.setTexture("boneSampler",f),this._effect.setFloat("boneTextureWidth",4*(d.bones.length+1))}else this._effect.setMatrices("mBones",d.getTransformMatrices(r))}c.MaterialHelper.BindMorphTargetParameters(r,this._effect),this.forceBackFacesOnly&&i.setState(!0,0,!1,!0),this.onBeforeShadowMapRenderMeshObservable.notifyObservers(r),this.onBeforeShadowMapRenderObservable.notifyObservers(this._effect),r._processRendering(e,this._effect,a.Material.TriangleFillMode,l,u,function(e,r){return t._effect.setMatrix("world",r)}),this.forceBackFacesOnly&&i.setState(!0,0,!1,!1)}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(l.Texture.NEAREST_SAMPLINGMODE):this._shadowMap.updateSamplingMode(l.Texture.BILINEAR_SAMPLINGMODE))},e.prototype.forceCompilation=function(e,t){var r=this,i=n.__assign({useInstances:!1},t),o=this.getShadowMap();if(o){var s=o.renderList;if(s){for(var a=new Array,c=0,l=s;c<l.length;c++){var u=l[c];a.push.apply(a,u.subMeshes)}if(0!==a.length){var h=0,d=function(){if(r._scene&&r._scene.getEngine()){for(;r.isReady(a[h],i.useInstances);)if(++h>=a.length)return void(e&&e(r));setTimeout(d,16)}};d()}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.isReady=function(e,t){var r=[];this._textureType!==f.Constants.TEXTURETYPE_UNSIGNED_INT&&r.push("#define FLOAT"),this.useExponentialShadowMap||this.useBlurExponentialShadowMap?r.push("#define ESM"):(this.usePercentageCloserFiltering||this.useContactHardeningShadow)&&r.push("#define DEPTHTEXTURE");var n=[o.VertexBuffer.PositionKind],i=e.getMesh(),a=e.getMaterial();if(this.normalBias&&i.isVerticesDataPresent(o.VertexBuffer.NormalKind)&&(n.push(o.VertexBuffer.NormalKind),r.push("#define NORMAL"),i.nonUniformScaling&&r.push("#define NONUNIFORMSCALING"),this.getLight().getTypeID()===s.Light.LIGHTTYPEID_DIRECTIONALLIGHT&&r.push("#define DIRECTIONINLIGHTDATA")),a&&a.needAlphaTesting()){var l=a.getAlphaTestTexture();l&&(r.push("#define ALPHATEST"),i.isVerticesDataPresent(o.VertexBuffer.UVKind)&&(n.push(o.VertexBuffer.UVKind),r.push("#define UV1")),i.isVerticesDataPresent(o.VertexBuffer.UV2Kind)&&1===l.coordinatesIndex&&(n.push(o.VertexBuffer.UV2Kind),r.push("#define UV2")))}if(i.useBones&&i.computeBonesUsingShaders&&i.skeleton){n.push(o.VertexBuffer.MatricesIndicesKind),n.push(o.VertexBuffer.MatricesWeightsKind),i.numBoneInfluencers>4&&(n.push(o.VertexBuffer.MatricesIndicesExtraKind),n.push(o.VertexBuffer.MatricesWeightsExtraKind));var u=i.skeleton;r.push("#define NUM_BONE_INFLUENCERS "+i.numBoneInfluencers),u.isUsingTextureForMatrices?r.push("#define BONETEXTURE"):r.push("#define BonesPerMesh "+(u.bones.length+1))}else r.push("#define NUM_BONE_INFLUENCERS 0");var h=i.morphTargetManager,d=0;if(h&&h.numInfluencers>0&&(r.push("#define MORPHTARGETS"),d=h.numInfluencers,r.push("#define NUM_MORPH_INFLUENCERS "+d),c.MaterialHelper.PrepareAttributesForMorphTargets(n,i,{NUM_MORPH_INFLUENCERS:d})),t&&(r.push("#define INSTANCES"),n.push("world0"),n.push("world1"),n.push("world2"),n.push("world3")),this.customShaderOptions&&this.customShaderOptions.defines)for(var p=0,g=this.customShaderOptions.defines;p<g.length;p++){var m=g[p];-1===r.indexOf(m)&&r.push(m)}var _=r.join("\n");if(this._cachedDefines!==_){this._cachedDefines=_;var v="shadowMap",A=["world","mBones","viewProjection","diffuseMatrix","lightData","depthValues","biasAndScale","morphTargetInfluences","boneTextureWidth"],y=["diffuseSampler","boneSampler"];if(this.customShaderOptions){if(v=this.customShaderOptions.shaderName,this.customShaderOptions.attributes)for(var b=0,T=this.customShaderOptions.attributes;b<T.length;b++){var E=T[b];-1===n.indexOf(E)&&n.push(E)}if(this.customShaderOptions.uniforms)for(var x=0,C=this.customShaderOptions.uniforms;x<C.length;x++){var P=C[x];-1===A.indexOf(P)&&A.push(P)}if(this.customShaderOptions.samplers)for(var M=0,S=this.customShaderOptions.samplers;M<S.length;M++){var R=S[M];-1===y.indexOf(R)&&y.push(R)}}this._effect=this._scene.getEngine().createEffect(v,n,A,y,_,void 0,void 0,void 0,{maxSimultaneousMorphTargets:d})}return!!this._effect.isReady()&&((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())},e.prototype.serialize=function(){var e={},t=this.getShadowMap();if(!t)return e;if(e.lightId=this._light.id,e.mapSize=t.getRenderSize(),e.useExponentialShadowMap=this.useExponentialShadowMap,e.useBlurExponentialShadowMap=this.useBlurExponentialShadowMap,e.useCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.useBlurCloseExponentialShadowMap=this.useBlurExponentialShadowMap,e.usePoissonSampling=this.usePoissonSampling,e.forceBackFacesOnly=this.forceBackFacesOnly,e.depthScale=this.depthScale,e.darkness=this.getDarkness(),e.blurBoxOffset=this.blurBoxOffset,e.blurKernel=this.blurKernel,e.blurScale=this.blurScale,e.useKernelBlur=this.useKernelBlur,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.filteringQuality=this.filteringQuality,e.contactHardeningLightSizeUVRatio=this.contactHardeningLightSizeUVRatio,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){for(var n=r.getLightByID(t.lightId),i=new e(t.mapSize,n),o=i.getShadowMap(),s=0;s<t.renderList.length;s++){r.getMeshesByID(t.renderList[s]).forEach(function(e){o&&(o.renderList||(o.renderList=[]),o.renderList.push(e))})}return t.usePoissonSampling?i.usePoissonSampling=!0:t.useExponentialShadowMap?i.useExponentialShadowMap=!0:t.useBlurExponentialShadowMap?i.useBlurExponentialShadowMap=!0:t.useCloseExponentialShadowMap?i.useCloseExponentialShadowMap=!0:t.useBlurCloseExponentialShadowMap?i.useBlurCloseExponentialShadowMap=!0:t.usePercentageCloserFiltering?i.usePercentageCloserFiltering=!0:t.useContactHardeningShadow&&(i.useContactHardeningShadow=!0),t.filteringQuality&&(i.filteringQuality=t.filteringQuality),t.contactHardeningLightSizeUVRatio?i.contactHardeningLightSizeUVRatio=t.contactHardeningLightSizeUVRatio:t.useVarianceShadowMap?i.useExponentialShadowMap=!0:t.useBlurVarianceShadowMap&&(i.useBlurExponentialShadowMap=!0),t.depthScale&&(i.depthScale=t.depthScale),t.blurScale&&(i.blurScale=t.blurScale),t.blurBoxOffset&&(i.blurBoxOffset=t.blurBoxOffset),t.useKernelBlur&&(i.useKernelBlur=t.useKernelBlur),t.blurKernel&&(i.blurKernel=t.blurKernel),void 0!==t.bias&&(i.bias=t.bias),void 0!==t.normalBias&&(i.normalBias=t.normalBias),void 0!==t.frustumEdgeFalloff&&(i.frustumEdgeFalloff=t.frustumEdgeFalloff),t.darkness&&i.setDarkness(t.darkness),t.transparencyShadow&&i.setTransparencyShadow(!0),i.forceBackFacesOnly=t.forceBackFacesOnly,i},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 g._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 o});var n=r(/*! ./shadowGenerator */"./Lights/Shadows/shadowGenerator.ts"),i=r(/*! ../../sceneComponent */"./sceneComponent.ts");r(/*! ../../abstractScene */"./abstractScene.ts").AbstractScene.AddParser(i.SceneComponentConstants.NAME_SHADOWGENERATOR,function(e,t){if(void 0!==e.shadowGenerators&&null!==e.shadowGenerators)for(var r=0,i=e.shadowGenerators.length;r<i;r++){var o=e.shadowGenerators[r];n.ShadowGenerator.Parse(o,t)}});var o=function(){function e(e){this.name=i.SceneComponentConstants.NAME_SHADOWGENERATOR,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(i.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(i.SceneComponentConstants.NAME_SHADOWGENERATOR);t||(t=new o(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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ./light */"./Lights/light.ts"),c=r(/*! ./shadowLight */"./Lights/shadowLight.ts");s.Node.AddNodeConstructor("Light_Type_1",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,n)||this;return i._shadowFrustumSize=0,i._shadowOrthoScale=.1,i.autoUpdateExtends=!0,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 n.__extends(t,e),Object.defineProperty(t.prototype,"shadowFrustumSize",{get:function(){return this._shadowFrustumSize},set:function(e){this._shadowFrustumSize=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowOrthoScale",{get:function(){return this._shadowOrthoScale},set:function(e){this._shadowOrthoScale=e,this.forceProjectionMatrixCompute()},enumerable:!0,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=0;s<r.length;s++){var a=r[s];if(a)for(var c=a.getBoundingInfo().boundingBox,l=0;l<c.vectorsWorld.length;l++)o.Vector3.TransformCoordinatesToRef(c.vectorsWorld[l],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)}}var u=this._orthoRight-this._orthoLeft,h=this._orthoTop-this._orthoBottom;o.Matrix.OrthoOffCenterLHToRef(this._orthoLeft-u*this.shadowOrthoScale,this._orthoRight+u*this.shadowOrthoScale,this._orthoBottom-h*this.shadowOrthoScale,this._orthoTop+h*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",3),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.getDepthMinZ=function(e){return 1},t.prototype.getDepthMaxZ=function(e){return 1},t.prototype.prepareLightSpecificDefines=function(e,t){e["DIRLIGHT"+t]=!0},n.__decorate([Object(i.serialize)()],t.prototype,"shadowFrustumSize",null),n.__decorate([Object(i.serialize)()],t.prototype,"shadowOrthoScale",null),n.__decorate([Object(i.serialize)()],t.prototype,"autoUpdateExtends",void 0),t}(c.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 */"./Maths/math.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ./light */"./Lights/light.ts");s.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 o.Color3(0,0,0),i.direction=r||o.Vector3.Up(),i}return n.__extends(t,e),t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),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.computeWorldMatrix=function(){return this._worldMatrix||(this._worldMatrix=o.Matrix.Identity()),this._worldMatrix},t.prototype.getTypeID=function(){return a.Light.LIGHTTYPEID_HEMISPHERICLIGHT},t.prototype.prepareLightSpecificDefines=function(e,t){e["HEMILIGHT"+t]=!0},n.__decorate([Object(i.serializeAsColor3)()],t.prototype,"groundColor",void 0),n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"direction",void 0),t}(a.Light)},"./Lights/index.ts":
- /*!*************************!*\
- !*** ./Lights/index.ts ***!
- \*************************/
- /*! exports provided: Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, ShadowGenerator, ShadowGeneratorSceneComponent */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,"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 c=r(/*! ./pointLight */"./Lights/pointLight.ts");r.d(t,"PointLight",function(){return c.PointLight});var l=r(/*! ./spotLight */"./Lights/spotLight.ts");r.d(t,"SpotLight",function(){return l.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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ../Materials/uniformBuffer */"./Materials/uniformBuffer.ts"),c=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),l=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i.diffuse=new o.Color3(1,1,1),i.specular=new o.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 a.UniformBuffer(i.getScene().getEngine()),i._buildUniformLayout(),i.includedOnlyMeshes=new Array,i.excludedMeshes=new Array,i._resyncMeshes(),i}return 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"intensityMode",{get:function(){return this._intensityMode},set:function(e){this._intensityMode=e,this._computePhotometricScale()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},set:function(e){this._radius=e,this._computePhotometricScale()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowEnabled",{get:function(){return this._shadowEnabled},set:function(e){this._shadowEnabled!==e&&(this._shadowEnabled=e,this._markMeshesAsLightDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"includedOnlyMeshes",{get:function(){return this._includedOnlyMeshes},set:function(e){this._includedOnlyMeshes=e,this._hookArrayForIncludedOnly(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"excludedMeshes",{get:function(){return this._excludedMeshes},set:function(e){this._excludedMeshes=e,this._hookArrayForExcluded(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"excludeWithLayerMask",{get:function(){return this._excludeWithLayerMask},set:function(e){this._excludeWithLayerMask=e,this._resyncMeshes()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"includeOnlyWithLayerMask",{get:function(){return this._includeOnlyWithLayerMask},set:function(e){this._includeOnlyWithLayerMask=e,this._resyncMeshes()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lightmapMode",{get:function(){return this._lightmapMode},set:function(e){this._lightmapMode!==e&&(this._lightmapMode=e,this._markMeshesAsLightDirty())},enumerable:!0,configurable:!0}),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._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)}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){var r=t.GetConstructorFromName(this.getTypeID(),e,this.getScene());return r?i.SerializationHelper.Clone(r,this):null},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=s.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),e.animations){for(var a=0;a<e.animations.length;a++){var l=e.animations[a],u=c._TypeStore.GetClass("BABYLON.Animation");u&&o.animations.push(u.Parse(l))}s.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++){a[s]._resyncLighSource(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]._resyncLighSource(t)}return o};for(var i=0,o=e;i<o.length;i++){o[i]._resyncLighSource(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]._resyncLighSource(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,n.__decorate([Object(i.serializeAsColor3)()],t.prototype,"diffuse",void 0),n.__decorate([Object(i.serializeAsColor3)()],t.prototype,"specular",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"falloffType",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"intensity",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"range",null),n.__decorate([Object(i.serialize)()],t.prototype,"intensityMode",null),n.__decorate([Object(i.serialize)()],t.prototype,"radius",null),n.__decorate([Object(i.serialize)()],t.prototype,"_renderPriority",void 0),n.__decorate([Object(i.expandToProperty)("_reorderLightsInScene")],t.prototype,"renderPriority",void 0),n.__decorate([Object(i.serialize)("shadowEnabled")],t.prototype,"_shadowEnabled",void 0),n.__decorate([Object(i.serialize)("excludeWithLayerMask")],t.prototype,"_excludeWithLayerMask",void 0),n.__decorate([Object(i.serialize)("includeOnlyWithLayerMask")],t.prototype,"_includeOnlyWithLayerMask",void 0),n.__decorate([Object(i.serialize)("lightmapMode")],t.prototype,"_lightmapMode",void 0),t}(s.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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ./light */"./Lights/light.ts"),c=r(/*! ./shadowLight */"./Lights/shadowLight.ts");s.Node.AddNodeConstructor("Light_Type_0",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,n)||this;return i._shadowAngle=Math.PI/2,i.position=r,i}return n.__extends(t,e),Object.defineProperty(t.prototype,"shadowAngle",{get:function(){return this._shadowAngle},set:function(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()},enumerable:!0,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:!0,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",3),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.prepareLightSpecificDefines=function(e,t){e["POINTLIGHT"+t]=!0},n.__decorate([Object(i.serialize)()],t.prototype,"shadowAngle",null),t}(c.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 s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._needProjectionMatrixCompute=!0,t}return 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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowMinZ",{get:function(){return this._shadowMinZ},set:function(e){this._shadowMinZ=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowMaxZ",{get:function(){return this._shadowMaxZ},set:function(e){this._shadowMaxZ=e,this.forceProjectionMatrixCompute()},enumerable:!0,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,o.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._worldMatrixDeterminant=this._worldMatrix.determinant(),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},n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"position",null),n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"direction",null),n.__decorate([Object(i.serialize)()],t.prototype,"shadowMinZ",null),n.__decorate([Object(i.serialize)()],t.prototype,"shadowMaxZ",null),t}(r(/*! ./light */"./Lights/light.ts").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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ./light */"./Lights/light.ts"),c=r(/*! ./shadowLight */"./Lights/shadowLight.ts");s.Node.AddNodeConstructor("Light_Type_2",function(e,t){return function(){return new l(e,o.Vector3.Zero(),o.Vector3.Zero(),0,0,t)}});var l=function(e){function t(t,r,n,i,s,a){var c=e.call(this,t,a)||this;return c._innerAngle=0,c._projectionTextureMatrix=o.Matrix.Zero(),c._projectionTextureLightNear=1e-6,c._projectionTextureLightFar=1e3,c._projectionTextureUpDirection=o.Vector3.Up(),c._projectionTextureViewLightDirty=!0,c._projectionTextureProjectionLightDirty=!0,c._projectionTextureDirty=!0,c._projectionTextureViewTargetVector=o.Vector3.Zero(),c._projectionTextureViewLightMatrix=o.Matrix.Zero(),c._projectionTextureProjectionLightMatrix=o.Matrix.Zero(),c._projectionTextureScalingMatrix=o.Matrix.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),c.position=r,c.direction=n,c.angle=i,c.exponent=s,c}return 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"innerAngle",{get:function(){return this._innerAngle},set:function(e){this._innerAngle=e,this._computeAngleValues()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowAngleScale",{get:function(){return this._shadowAngleScale},set:function(e){this._shadowAngleScale=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureMatrix",{get:function(){return this._projectionTextureMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightNear",{get:function(){return this._projectionTextureLightNear},set:function(e){this._projectionTextureLightNear=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightFar",{get:function(){return this._projectionTextureLightFar},set:function(e){this._projectionTextureLightFar=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureUpDirection",{get:function(){return this._projectionTextureUpDirection},set:function(e){this._projectionTextureUpDirection=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTexture",{get:function(){return this._projectionTexture},set:function(e){this._projectionTexture=e,this._projectionTextureDirty=!0},enumerable:!0,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(){this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),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",3),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.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._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.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.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},n.__decorate([Object(i.serialize)()],t.prototype,"angle",null),n.__decorate([Object(i.serialize)()],t.prototype,"innerAngle",null),n.__decorate([Object(i.serialize)()],t.prototype,"shadowAngleScale",null),n.__decorate([Object(i.serialize)()],t.prototype,"exponent",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"projectionTextureLightNear",null),n.__decorate([Object(i.serialize)()],t.prototype,"projectionTextureLightFar",null),n.__decorate([Object(i.serialize)()],t.prototype,"projectionTextureUpDirection",null),n.__decorate([Object(i.serializeAsTexture)("projectedLightTexture")],t.prototype,"_projectionTexture",void 0),t}(c.ShadowLight)},"./Loading/Plugins/babylonFileLoader.ts":
- /*!**********************************************!*\
- !*** ./Loading/Plugins/babylonFileLoader.ts ***!
- \**********************************************/
- /*! exports provided: _BabylonLoaderRegistered */function(e,t,r){"use strict";r.r(t),r.d(t,"_BabylonLoaderRegistered",function(){return P});var n=r(/*! ../../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),o=r(/*! ../../Maths/math */"./Maths/math.ts"),s=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../../Meshes/geometry */"./Meshes/geometry.ts"),c=r(/*! ../../Meshes/transformNode */"./Meshes/transformNode.ts"),l=r(/*! ../../Materials/material */"./Materials/material.ts"),u=r(/*! ../../Materials/multiMaterial */"./Materials/multiMaterial.ts"),h=r(/*! ../../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),d=r(/*! ../../Materials/Textures/hdrCubeTexture */"./Materials/Textures/hdrCubeTexture.ts"),f=r(/*! ../../Animations/animationGroup */"./Animations/animationGroup.ts"),p=r(/*! ../../Lights/light */"./Lights/light.ts"),g=r(/*! ../../sceneComponent */"./sceneComponent.ts"),m=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),_=r(/*! ../../abstractScene */"./abstractScene.ts"),v=r(/*! ../../assetContainer */"./assetContainer.ts"),A=r(/*! ../../Actions/actionManager */"./Actions/actionManager.ts"),y=r(/*! ../../Bones/skeleton */"./Bones/skeleton.ts"),b=r(/*! ../../Morph/morphTargetManager */"./Morph/morphTargetManager.ts"),T=r(/*! ../../Physics/Plugins/cannonJSPlugin */"./Physics/Plugins/cannonJSPlugin.ts"),E=r(/*! ../../Physics/Plugins/oimoJSPlugin */"./Physics/Plugins/oimoJSPlugin.ts"),x=r(/*! ../../Probes/reflectionProbe */"./Probes/reflectionProbe.ts"),C=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),P=!0,M=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 l.Material.Parse(s,r,n)}return null},S=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)},R=function(e,t){return e+" of "+(t?t.file+" from "+t.name+" version: "+t.version+", exporter version: "+t.exporter_version:"unknown")},O=function(e,t,r,o,g){void 0===g&&(g=!1);var T=new v.AssetContainer(e),E="importScene has failed JSON parse";try{var P=JSON.parse(t);E="";var M,S,O=m.SceneLoader.loggingLevel===m.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,w=new d.HDRCubeTexture((P.environmentTexture.match(/https?:\/\//g)?"":r)+P.environmentTexture,e,D,!0,!I);P.environmentTextureRotationY&&(w.rotationY=P.environmentTextureRotationY),e.environmentTexture=w}else{var L=h.CubeTexture.CreateFromPrefilteredData((P.environmentTexture.match(/https?:\/\//g)?"":r)+P.environmentTexture,e);P.environmentTextureRotationY&&(L.rotationY=P.environmentTextureRotationY),e.environmentTexture=L}if(!0===P.createDefaultSkybox){var B=void 0!==e.activeCamera&&null!==e.activeCamera?(e.activeCamera.maxZ-e.activeCamera.minZ)/2:1e3,F=P.skyboxBlurLevel||0;e.createDefaultSkybox(e.environmentTexture,I,B,F)}T.environmentTexture=e.environmentTexture}if(void 0!==P.lights&&null!==P.lights)for(M=0,S=P.lights.length;M<S;M++){var N=P.lights[M],V=p.Light.Parse(N,e);V&&(T.lights.push(V),E+=0===M?"\n\tLights:":"",E+="\n\t\t"+V.toString(O))}if(void 0!==P.reflectionProbes&&null!==P.reflectionProbes)for(M=0,S=P.reflectionProbes.length;M<S;M++){var U=P.reflectionProbes[M],G=x.ReflectionProbe.Parse(U,e,r);G&&(T.reflectionProbes.push(G),E+=0===M?"\n\tReflection Probes:":"",E+="\n\t\t"+G.toString(O))}if(void 0!==P.animations&&null!==P.animations)for(M=0,S=P.animations.length;M<S;M++){var k=P.animations[M],z=C._TypeStore.GetClass("BABYLON.Animation");if(z){var H=z.Parse(k);e.animations.push(H),T.animations.push(H),E+=0===M?"\n\tAnimations:":"",E+="\n\t\t"+H.toString(O)}}if(void 0!==P.materials&&null!==P.materials)for(M=0,S=P.materials.length;M<S;M++){var j=P.materials[M],X=l.Material.Parse(j,e,r);T.materials.push(X),E+=0===M?"\n\tMaterials:":"",E+="\n\t\t"+X.toString(O)}if(void 0!==P.multiMaterials&&null!==P.multiMaterials)for(M=0,S=P.multiMaterials.length;M<S;M++){var W=P.multiMaterials[M],Y=u.MultiMaterial.ParseMultiMaterial(W,e);T.multiMaterials.push(Y),E+=0===M?"\n\tMultiMaterials:":"",E+="\n\t\t"+Y.toString(O)}if(void 0!==P.morphTargetManagers&&null!==P.morphTargetManagers)for(var Q=0,K=P.morphTargetManagers;Q<K.length;Q++){var Z=K[Q];T.morphTargetManagers.push(b.MorphTargetManager.Parse(Z,e))}if(void 0!==P.skeletons&&null!==P.skeletons)for(M=0,S=P.skeletons.length;M<S;M++){var J=P.skeletons[M],q=y.Skeleton.Parse(J,e);T.skeletons.push(q),E+=0===M?"\n\tSkeletons:":"",E+="\n\t\t"+q.toString(O)}var $=P.geometries;if(null!=$){var ee=new Array,te=$.vertexData;if(null!=te)for(M=0,S=te.length;M<S;M++){var re=te[M];ee.push(a.Geometry.Parse(re,e,r))}ee.forEach(function(e){e&&T.geometries.push(e)})}if(void 0!==P.transformNodes&&null!==P.transformNodes)for(M=0,S=P.transformNodes.length;M<S;M++){var ne=P.transformNodes[M],ie=c.TransformNode.Parse(ne,e,r);T.transformNodes.push(ie)}if(void 0!==P.meshes&&null!==P.meshes)for(M=0,S=P.meshes.length;M<S;M++){var oe=P.meshes[M],se=s.Mesh.Parse(oe,e,r);T.meshes.push(se),E+=0===M?"\n\tMeshes:":"",E+="\n\t\t"+se.toString(O)}if(void 0!==P.cameras&&null!==P.cameras)for(M=0,S=P.cameras.length;M<S;M++){var ae=P.cameras[M],ce=i.Camera.Parse(ae,e);T.cameras.push(ce),E+=0===M?"\n\tCameras:":"",E+="\n\t\t"+ce.toString(O)}if(void 0!==P.animationGroups&&null!==P.animationGroups)for(M=0,S=P.animationGroups.length;M<S;M++){var le=P.animationGroups[M],ue=f.AnimationGroup.Parse(le,e);T.animationGroups.push(ue),E+=0===M?"\n\tAnimationGroups:":"",E+="\n\t\t"+ue.toString(O)}for(M=0,S=e.cameras.length;M<S;M++){(ce=e.cameras[M])._waitingParentId&&(ce.parent=e.getLastEntryByID(ce._waitingParentId),ce._waitingParentId=null)}for(M=0,S=e.lights.length;M<S;M++){var he=e.lights[M];he&&he._waitingParentId&&(he.parent=e.getLastEntryByID(he._waitingParentId),he._waitingParentId=null)}for(M=0,S=e.transformNodes.length;M<S;M++){var de=e.transformNodes[M];de._waitingParentId&&(de.parent=e.getLastEntryByID(de._waitingParentId),de._waitingParentId=null)}for(M=0,S=e.meshes.length;M<S;M++){(se=e.meshes[M])._waitingParentId&&(se.parent=e.getLastEntryByID(se._waitingParentId),se._waitingParentId=null)}for(M=0,S=e.meshes.length;M<S;M++){var fe=e.meshes[M];fe._waitingFreezeWorldMatrix?(fe.freezeWorldMatrix(),fe._waitingFreezeWorldMatrix=null):fe.computeWorldMatrix(!0)}for(M=0,S=e.lights.length;M<S;M++){var pe=e.lights[M];if(pe._excludedMeshesIds.length>0){for(var ge=0;ge<pe._excludedMeshesIds.length;ge++){var me=e.getMeshByID(pe._excludedMeshesIds[ge]);me&&pe.excludedMeshes.push(me)}pe._excludedMeshesIds=[]}if(pe._includedOnlyMeshesIds.length>0){for(var _e=0;_e<pe._includedOnlyMeshesIds.length;_e++){var ve=e.getMeshByID(pe._includedOnlyMeshesIds[_e]);ve&&pe.includedOnlyMeshes.push(ve)}pe._includedOnlyMeshesIds=[]}}for(_.AbstractScene.Parse(P,e,T,r),M=0,S=e.meshes.length;M<S;M++){(se=e.meshes[M])._waitingActions&&(A.ActionManager.Parse(se._waitingActions,se,e),se._waitingActions=null)}void 0!==P.actions&&null!==P.actions&&A.ActionManager.Parse(P.actions,null,e),g||T.removeAllFromScene()}catch(e){var Ae=R("loadAssets",P?P.producer:"Unknown")+E;if(!o)throw n.Logger.Log(Ae),e;o(Ae,e)}finally{null!==E&&m.SceneLoader.loggingLevel!==m.SceneLoader.NO_LOGGING&&n.Logger.Log(R("loadAssets",P?P.producer:"Unknown")+(m.SceneLoader.loggingLevel!==m.SceneLoader.MINIMAL_LOGGING?E:""))}return T};m.SceneLoader.RegisterPlugin({name:"babylon.js",extensions:".babylon",canDirectLoad:function(e){return-1!==e.indexOf("babylon")},importMesh:function(e,t,r,i,o,c,l,h){var d="importMesh has failed JSON parse";try{var f=JSON.parse(r);d="";var p=m.SceneLoader.loggingLevel===m.SceneLoader.DETAILED_LOGGING;e?Array.isArray(e)||(e=[e]):e=null;var v=new Array;if(void 0!==f.meshes&&null!==f.meshes){var A,T,E,x=[],C=[];for(A=0,T=f.meshes.length;A<T;A++){var P=f.meshes[A];if(null===e||S(P,e,v)){if(null!==e&&delete e[e.indexOf(P.name)],void 0!==P.geometryId&&null!==P.geometryId&&void 0!==f.geometries&&null!==f.geometries){var O=!1;["boxes","spheres","cylinders","toruses","grounds","planes","torusKnots","vertexData"].forEach(function(e){!0!==O&&f.geometries[e]&&Array.isArray(f.geometries[e])&&f.geometries[e].forEach(function(r){if(r.id===P.geometryId){switch(e){case"vertexData":a.Geometry.Parse(r,t,i)}O=!0}})}),!1===O&&n.Logger.Warn("Geometry not found for mesh "+P.id)}if(P.materialId){var I=-1!==C.indexOf(P.materialId);if(!1===I&&void 0!==f.multiMaterials&&null!==f.multiMaterials)for(var D=0,w=f.multiMaterials.length;D<w;D++){var L=f.multiMaterials[D];if(L.id===P.materialId){for(var B=0,F=L.materials.length;B<F;B++){var N,V=L.materials[B];C.push(V),(N=M(V,f,t,i))&&(d+="\n\tMaterial "+N.toString(p))}C.push(L.id);var U=u.MultiMaterial.ParseMultiMaterial(L,t);U&&(I=!0,d+="\n\tMulti-Material "+U.toString(p));break}}if(!1===I)C.push(P.materialId),(N=M(P.materialId,f,t,i))?d+="\n\tMaterial "+N.toString(p):n.Logger.Warn("Material not found for mesh "+P.id)}if(P.skeletonId>-1&&void 0!==f.skeletons&&null!==f.skeletons)if(!1===x.indexOf(P.skeletonId)>-1)for(var G=0,k=f.skeletons.length;G<k;G++){var z=f.skeletons[G];if(z.id===P.skeletonId){var H=y.Skeleton.Parse(z,t);l.push(H),x.push(z.id),d+="\n\tSkeleton "+H.toString(p)}}if(void 0!==f.morphTargetManagers&&null!==f.morphTargetManagers)for(var j=0,X=f.morphTargetManagers;j<X.length;j++){var W=X[j];b.MorphTargetManager.Parse(W,t)}var Y=s.Mesh.Parse(P,t,i);o.push(Y),d+="\n\tMesh "+Y.toString(p)}}for(A=0,T=t.meshes.length;A<T;A++)(E=t.meshes[A])._waitingParentId&&(E.parent=t.getLastEntryByID(E._waitingParentId),E._waitingParentId=null);for(A=0,T=t.meshes.length;A<T;A++)(E=t.meshes[A])._waitingFreezeWorldMatrix?(E.freezeWorldMatrix(),E._waitingFreezeWorldMatrix=null):E.computeWorldMatrix(!0)}if(void 0!==f.particleSystems&&null!==f.particleSystems){var Q=_.AbstractScene.GetIndividualParser(g.SceneComponentConstants.NAME_PARTICLESYSTEM);if(Q)for(A=0,T=f.particleSystems.length;A<T;A++){var K=f.particleSystems[A];-1!==v.indexOf(K.emitterId)&&c.push(Q(K,t,i))}}return!0}catch(e){var Z=R("importMesh",f?f.producer:"Unknown")+d;if(!h)throw n.Logger.Log(Z),e;h(Z,e)}finally{null!==d&&m.SceneLoader.loggingLevel!==m.SceneLoader.NO_LOGGING&&n.Logger.Log(R("importMesh",f?f.producer:"Unknown")+(m.SceneLoader.loggingLevel!==m.SceneLoader.MINIMAL_LOGGING?d:""))}return!1},load:function(e,t,r,i){var s="importScene has failed JSON parse";try{var a=JSON.parse(t);if(s="",void 0!==a.useDelayedTextureLoading&&null!==a.useDelayedTextureLoading&&(e.useDelayedTextureLoading=a.useDelayedTextureLoading&&!m.SceneLoader.ForceFullSceneLoadingForIncremental),void 0!==a.autoClear&&null!==a.autoClear&&(e.autoClear=a.autoClear),void 0!==a.clearColor&&null!==a.clearColor&&(e.clearColor=o.Color4.FromArray(a.clearColor)),void 0!==a.ambientColor&&null!==a.ambientColor&&(e.ambientColor=o.Color3.FromArray(a.ambientColor)),void 0!==a.gravity&&null!==a.gravity&&(e.gravity=o.Vector3.FromArray(a.gravity)),a.fogMode&&0!==a.fogMode)switch(e.fogMode=a.fogMode,e.fogColor=o.Color3.FromArray(a.fogColor),e.fogStart=a.fogStart,e.fogEnd=a.fogEnd,e.fogDensity=a.fogDensity,s+="\tFog mode for scene: ",e.fogMode){case 1:s+="exp\n";break;case 2:s+="exp2\n";break;case 3:s+="linear\n"}if(a.physicsEnabled){var c;"cannon"===a.physicsEngine?c=new T.CannonJSPlugin:"oimo"===a.physicsEngine&&(c=new E.OimoJSPlugin),s="\tPhysics engine "+(a.physicsEngine?a.physicsEngine:"oimo")+" enabled\n";var l=a.physicsGravity?o.Vector3.FromArray(a.physicsGravity):null;e.enablePhysics(l,c)}if(void 0!==a.metadata&&null!==a.metadata&&(e.metadata=a.metadata),void 0!==a.collisionsEnabled&&null!==a.collisionsEnabled&&(e.collisionsEnabled=a.collisionsEnabled),!O(e,t,r,i,!0))return!1;if(a.autoAnimate&&e.beginAnimation(e,a.autoAnimateFrom,a.autoAnimateTo,a.autoAnimateLoop,a.autoAnimateSpeed||1),void 0!==a.activeCameraID&&null!==a.activeCameraID&&e.setActiveCameraByID(a.activeCameraID),void 0!==a.environmentTexture&&null!==a.environmentTexture){var u=void 0===a.isPBR||a.isPBR;if(a.environmentTextureType&&"BABYLON.HDRCubeTexture"===a.environmentTextureType){var f=a.environmentTextureSize?a.environmentTextureSize:128,p=new d.HDRCubeTexture(r+a.environmentTexture,e,f,!0,!u);a.environmentTextureRotationY&&(p.rotationY=a.environmentTextureRotationY),e.environmentTexture=p}else{var g=h.CubeTexture.CreateFromPrefilteredData(r+a.environmentTexture,e);a.environmentTextureRotationY&&(g.rotationY=a.environmentTextureRotationY),e.environmentTexture=g}if(!0===a.createDefaultSkybox){var _=void 0!==e.activeCamera&&null!==e.activeCamera?(e.activeCamera.maxZ-e.activeCamera.minZ)/2:1e3,v=a.skyboxBlurLevel||0;e.createDefaultSkybox(e.environmentTexture,u,_,v)}}return!0}catch(e){var A=R("importScene",a?a.producer:"Unknown")+s;if(!i)throw n.Logger.Log(A),e;i(A,e)}finally{null!==s&&m.SceneLoader.loggingLevel!==m.SceneLoader.NO_LOGGING&&n.Logger.Log(R("importScene",a?a.producer:"Unknown")+(m.SceneLoader.loggingLevel!==m.SceneLoader.MINIMAL_LOGGING?s:""))}return!1},loadAssetContainer:function(e,t,r,n){return O(e,t,r,n)}})},"./Loading/Plugins/index.ts":
- /*!**********************************!*\
- !*** ./Loading/Plugins/index.ts ***!
- \**********************************/
- /*! exports provided: _BabylonLoaderRegistered */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})},"./Loading/index.ts":
- /*!**************************!*\
- !*** ./Loading/index.ts ***!
- \**************************/
- /*! exports provided: DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoader, SceneLoaderFlags, _BabylonLoaderRegistered */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});var o=r(/*! ./sceneLoader */"./Loading/sceneLoader.ts");r.d(t,"SceneLoaderProgressEvent",function(){return o.SceneLoaderProgressEvent}),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){void 0===t&&(t=""),void 0===r&&(r="black");var n=this;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 e=document.createElement("style");e.type="text/css";e.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(e);var t=new Image;t.src="data:image/png;base64,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",t.style.position="absolute",t.style.left="50%",t.style.top="50%",t.style.marginLeft="-60px",t.style.marginTop="-60px",t.style.animation="spin1 2s infinite ease-in-out",t.style.webkitAnimation="spin1 2s infinite ease-in-out",t.style.transformOrigin="50% 50%",t.style.webkitTransformOrigin="50% 50%",this._loadingDiv.appendChild(t),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;if(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:!0,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:!0,configurable:!0}),e}();n.Engine.DefaultLoadingScreenFactory=function(e){return new i(e)}},"./Loading/sceneLoader.ts":
- /*!********************************!*\
- !*** ./Loading/sceneLoader.ts ***!
- \********************************/
- /*! exports provided: SceneLoaderProgressEvent, SceneLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneLoaderProgressEvent",function(){return d}),r.d(t,"SceneLoader",function(){return f});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Misc/filesInputStore */"./Misc/filesInputStore.ts"),s=r(/*! ../scene */"./scene.ts"),a=r(/*! ../Engines/engine */"./Engines/engine.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ../Misc/logger */"./Misc/logger.ts"),u=r(/*! ../Engines/constants */"./Engines/constants.ts"),h=r(/*! ./sceneLoaderFlags */"./Loading/sceneLoaderFlags.ts"),d=function(){function e(e,t,r){this.lengthComputable=e,this.loaded=t,this.total=r}return e.FromProgressEvent=function(t){return new e(t.lengthComputable,t.loaded,t.total)},e}(),f=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return h.SceneLoaderFlags.ForceFullSceneLoadingForIncremental},set:function(e){h.SceneLoaderFlags.ForceFullSceneLoadingForIncremental=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return h.SceneLoaderFlags.ShowLoadingScreen},set:function(e){h.SceneLoaderFlags.ShowLoadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return h.SceneLoaderFlags.loggingLevel},set:function(e){h.SceneLoaderFlags.loggingLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return h.SceneLoaderFlags.CleanBoneMatrixWeights},set:function(e){h.SceneLoaderFlags.CleanBoneMatrixWeights=e},enumerable:!0,configurable:!0}),e._getDefaultPlugin=function(){return e._registeredPlugins[".babylon"]},e._getPluginForExtension=function(t){var r=e._registeredPlugins[t];return r||(l.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: http://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,i,s,c,l,u){var h,f=e._getDirectLoad(t.name),p=u?e._getPluginForExtension(u):f?e._getPluginForDirectLoad(t.name):e._getPluginForFilename(t.name);if(!(h=p.plugin.createPlugin?p.plugin.createPlugin():p.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.";var g,m=p.isBinary;e.OnPluginActivatedObservable.notifyObservers(h);var _=function(e,t){r.isDisposed?c("Scene has been disposed"):(r.offlineProvider=g,i(h,e,t))},v=null,A=!1,y=h.onDisposeObservable;y&&y.add(function(){A=!0,v&&(v.abort(),v=null),l()});var b=function(){A||(v=n.Tools.LoadFile(t.url,_,s?function(e){s(d.FromProgressEvent(e))}:void 0,g,m,function(e,t){c("Failed to load scene."+(t?" "+t.message:""),t)}))};if(f)return _(f),h;var T=t.file||o.FilesInputStore.FilesToLoad[t.name.toLowerCase()];if(-1===t.rootUrl.indexOf("file:")||-1!==t.rootUrl.indexOf("file:")&&!T){var E=r.getEngine(),x=E.enableOfflineSupport;if(x){for(var C=!1,P=0,M=r.disableOfflineSupportExceptionRules;P<M.length;P++){if(M[P].test(t.url)){C=!0;break}}x=!C}x&&a.Engine.OfflineProviderFactory?g=a.Engine.OfflineProviderFactory(t.url,b,E.disableManifestCheck):b()}else T?v=n.Tools.ReadFile(T,_,s,m):c("Unable to find file named "+t.name);return h},e._getFileInfo=function(e,t){var r,i,o=null;if(t)if(t.name){var s=t;r=e+s.name,i=s.name,o=s}else{var a=t;if("/"===a.substr(0,1))return n.Tools.Error("Wrong sceneFilename parameter"),null;r=e+a,i=a}else r=e,i=n.Tools.GetFilename(e),e=n.Tools.GetFolderPath(e);return{url:r,rootUrl:e,name:i,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,u){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===u&&(u=null),!i)return l.Logger.Error("No scene available to import mesh to"),null;var h=e._getFileInfo(r,n);if(!h)return null;var d={};i._addPendingData(d);var f=function(){i._removePendingData(d)},p=function(e,t){var r="Unable to import meshes from "+h.url+": "+e;a?a(i,r,t):l.Logger.Error(r),f()},g=s?function(e){try{s(e)}catch(e){p("Error in onProgress callback",e)}}:void 0,m=function(e,t,r,n){if(i.importedMeshesFiles.push(h.url),o)try{o(e,t,r,n)}catch(e){p("Error in onSuccess callback",e)}i._removePendingData(d)};return e._loadData(h,i,function(e,r,n){if(e.rewriteRootURL&&(h.rootUrl=e.rewriteRootURL(h.rootUrl,n)),e.importMesh){var o=e,s=new Array,a=new Array,c=new Array;if(!o.importMesh(t,i,r,h.rootUrl,s,a,c,p))return;i.loadingPluginName=e.name,m(s,a,c,[])}else{e.importMeshAsync(t,i,r,h.rootUrl,g,h.name).then(function(t){i.loadingPluginName=e.name,m(t.meshes,t.particleSystems,t.skeletons,t.animationGroups)}).catch(function(e){p(e.message,e)})}},g,p,f,u)},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,c){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){c(r||new Error(t))},s)})},e.Load=function(t,r,i,o,a,l,u){return void 0===r&&(r=""),void 0===i&&(i=c.EngineStore.LastCreatedEngine),void 0===o&&(o=null),void 0===a&&(a=null),void 0===l&&(l=null),void 0===u&&(u=null),i?e.Append(t,r,new s.Scene(i),o,a,l,u):(n.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){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 l.Logger.Error("No scene available to append to"),null;var u=e._getFileInfo(t,r);if(!u)return null;e.ShowLoadingScreen&&n.getEngine().displayLoadingUI();var h={};n._addPendingData(h);var d=function(){n._removePendingData(h),n.getEngine().hideLoadingUI()},f=function(e,t){var r="Unable to load from "+u.url+(e?": "+e:"");s?s(n,r,t):l.Logger.Error(r),d()},p=o?function(e){try{o(e)}catch(e){f("Error in onProgress callback",e)}}:void 0,g=function(){if(i)try{i(n)}catch(e){f("Error in onSuccess callback",e)}n._removePendingData(h)};return e._loadData(u,n,function(t,r){if(t.load){if(!t.load(n,r,u.rootUrl,f))return;n.loadingPluginName=t.name,g()}else{t.loadAsync(n,r,u.rootUrl,p,u.name).then(function(){n.loadingPluginName=t.name,g()}).catch(function(e){f(e.message,e)})}e.ShowLoadingScreen&&n.executeWhenReady(function(){n.getEngine().hideLoadingUI()})},p,f,d,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 l.Logger.Error("No scene available to load asset container to"),null;var u=e._getFileInfo(t,r);if(!u)return null;var h={};n._addPendingData(h);var d=function(){n._removePendingData(h)},f=function(e,t){var r="Unable to load assets from "+u.url+(e?": "+e:"");s?s(n,r,t):l.Logger.Error(r),d()},p=o?function(e){try{o(e)}catch(e){f("Error in onProgress callback",e)}}:void 0,g=function(e){if(i)try{i(e)}catch(e){f("Error in onSuccess callback",e)}n._removePendingData(h)};return e._loadData(u,n,function(t,r){if(t.loadAssetContainer){var i=t.loadAssetContainer(n,r,u.rootUrl,f);if(!i)return;n.loadingPluginName=t.name,g(i)}else if(t.loadAssetContainerAsync){t.loadAssetContainerAsync(n,r,u.rootUrl,p,u.name).then(function(e){n.loadingPluginName=t.name,g(e)}).catch(function(e){f(e.message,e)})}else f("LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.");e.ShowLoadingScreen&&n.executeWhenReady(function(){n.getEngine().hideLoadingUI()})},p,f,d,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.NO_LOGGING=u.Constants.SCENELOADER_NO_LOGGING,e.MINIMAL_LOGGING=u.Constants.SCENELOADER_MINIMAL_LOGGING,e.SUMMARY_LOGGING=u.Constants.SCENELOADER_SUMMARY_LOGGING,e.DETAILED_LOGGING=u.Constants.SCENELOADER_DETAILED_LOGGING,e.OnPluginActivatedObservable=new i.Observable,e._registeredPlugins={},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:!0,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return e._ShowLoadingScreen},set:function(t){e._ShowLoadingScreen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return e._loggingLevel},set:function(t){e._loggingLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return e._CleanBoneMatrixWeights},set:function(t){e._CleanBoneMatrixWeights=t},enumerable:!0,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 A});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 */"./Maths/math.ts"),c=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../../Materials/effect */"./Materials/effect.ts"),u=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),h=r(/*! ../../Materials/materialDefines */"./Materials/materialDefines.ts"),d=r(/*! ../../Materials/pushMaterial */"./Materials/pushMaterial.ts"),f=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),p=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),g=r(/*! ../../Engines/constants */"./Engines/constants.ts"),m=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),_=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),v=(r(/*! ../../Shaders/background.fragment */"./Shaders/background.fragment.ts"),r(/*! ../../Shaders/background.vertex */"./Shaders/background.vertex.ts"),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.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_SKYBOX_TRANSFORMED=!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.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 n.__extends(t,e),t}(h.MaterialDefines)),A=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.primaryColor=a.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._imageProcessingObserver=null,n.switchToBGR=!1,n._renderTargets=new o.SmartArray(16),n._reflectionControls=a.Vector4.Zero(),n._white=a.Color3.White(),n._primaryShadowColor=a.Color3.Black(),n._primaryHighlightColor=a.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 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"primaryColorShadowLevel",{get:function(){return this._primaryColorShadowLevel},set:function(e){this._primaryColorShadowLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"primaryColorHighlightLevel",{get:function(){return this._primaryColorHighlightLevel},set:function(e){this._primaryColorHighlightLevel=e,this._computePrimaryColors(),this._markAllSubMeshesAsLightsDirty()},enumerable:!0,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:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this.imageProcessingConfiguration.colorGradingTexture=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this.imageProcessingConfiguration.colorCurves},set:function(e){this.imageProcessingConfiguration.colorCurves=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasRenderTargetTextures",{get:function(){return!(!this._diffuseTexture||!this._diffuseTexture.isRenderTarget)||!(!this._reflectionTexture||!this._reflectionTexture.isRenderTarget)},enumerable:!0,configurable:!0}),t.prototype.needAlphaTesting=function(){return!0},t.prototype.needAlphaBlending=function(){return this.alpha<0||null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha},t.prototype.isReadyForSubMesh=function(e,t,r){var n=this;if(void 0===r&&(r=!1),t.effect&&this.isFrozen&&this._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new v);var i=this.getScene(),o=t._materialDefines;if(!this.checkReadyOnEveryCall&&t.effect&&o._renderId===i.getRenderId())return!0;var a=i.getEngine();if(u.MaterialHelper.PrepareDefinesForLights(i,e,o,!1,this._maxSimultaneousLights),o._needNormals=!0,i.activeCamera){var h=o.MULTIVIEW;o.MULTIVIEW=null!==i.activeCamera.outputRenderTarget&&i.activeCamera.outputRenderTarget.getViewCount()>1,o.MULTIVIEW!=h&&o.markAsUnprocessed()}if(o._areTexturesDirty){if(o._needUVs=!1,i.texturesEnabled){if(i.getEngine().getCaps().textureLOD&&(o.TEXTURELODSUPPORT=!0),this._diffuseTexture&&_.MaterialFlags.DiffuseTextureEnabled){if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;u.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 d=this._reflectionTexture;if(d&&_.MaterialFlags.ReflectionTextureEnabled){if(!d.isReadyOrNotBlocking())return!1;switch(o.REFLECTION=!0,o.GAMMAREFLECTION=d.gammaSpace,o.RGBDREFLECTION=d.isRGBD,o.REFLECTIONBLUR=this._reflectionBlur>0,o.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!d.invertZ:d.invertZ,o.LODINREFLECTIONALPHA=d.lodLevelInAlpha,o.EQUIRECTANGULAR_RELFECTION_FOV=this.useEquirectangularFOV,o.REFLECTIONBGR=this.switchToBGR,d.coordinatesMode===p.Texture.INVCUBIC_MODE&&(o.INVERTCUBICMAP=!0),o.REFLECTIONMAP_3D=d.isCube,d.coordinatesMode){case p.Texture.EXPLICIT_MODE:o.REFLECTIONMAP_EXPLICIT=!0;break;case p.Texture.PLANAR_MODE:o.REFLECTIONMAP_PLANAR=!0;break;case p.Texture.PROJECTION_MODE:o.REFLECTIONMAP_PROJECTION=!0;break;case p.Texture.SKYBOX_MODE:o.REFLECTIONMAP_SKYBOX=!0,o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!d.getReflectionTextureMatrix().isIdentity();break;case p.Texture.SPHERICAL_MODE:o.REFLECTIONMAP_SPHERICAL=!0;break;case p.Texture.EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case p.Texture.FIXED_EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case p.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case p.Texture.CUBIC_MODE:case p.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_SKYBOX_TRANSFORMED=!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===g.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===g.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._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o)}if(u.MaterialHelper.PrepareDefinesForMisc(e,i,!1,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),u.MaterialHelper.PrepareDefinesForFrameBoundValues(i,a,o,r),u.MaterialHelper.PrepareDefinesForAttributes(e,o,!1,!0,!1)&&e&&(i.getEngine().getCaps().standardDerivatives||e.isVerticesDataPresent(c.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 m=new l.EffectFallbacks;o.FOG&&m.addFallback(0,"FOG"),o.POINTSIZE&&m.addFallback(1,"POINTSIZE"),o.MULTIVIEW&&m.addFallback(0,"MULTIVIEW"),u.MaterialHelper.HandleFallbacksForShadows(o,m,this._maxSimultaneousLights),o.NUM_BONE_INFLUENCERS>0&&m.addCPUSkinningFallback(0,e);var A=[c.VertexBuffer.PositionKind];o.NORMAL&&A.push(c.VertexBuffer.NormalKind),o.UV1&&A.push(c.VertexBuffer.UVKind),o.UV2&&A.push(c.VertexBuffer.UV2Kind),u.MaterialHelper.PrepareAttributesForBones(A,e,o,m),u.MaterialHelper.PrepareAttributesForInstances(A,o);var y=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","mBones","vPrimaryColor","vPrimaryColorShadow","vReflectionInfos","reflectionMatrix","vReflectionMicrosurfaceInfos","fFovMultiplier","shadowLevel","alpha","vBackgroundCenter","vReflectionControl","vDiffuseInfos","diffuseMatrix"],b=["diffuseSampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh"],T=["Material","Scene"];f.ImageProcessingConfiguration&&(f.ImageProcessingConfiguration.PrepareUniforms(y,o),f.ImageProcessingConfiguration.PrepareSamplers(b,o)),u.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:y,uniformBuffersNames:T,samplers:b,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var E=o.toString();t.setEffect(i.getEngine().createEffect("background",{attributes:A,uniformsNames:y,uniformBuffersNames:T,samplers:b,defines:E,fallbacks:m,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(),this._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),u.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&&_.MaterialFlags.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),u.MaterialHelper.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse")),a&&_.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&&_.MaterialFlags.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("diffuseSampler",this._diffuseTexture),a&&_.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)))),u.MaterialHelper.BindClipPlane(this._activeEffect,n),u.MaterialHelper.BindEyePosition(o,n)}!s&&this.isFrozen||(n.lightsEnabled&&u.MaterialHelper.BindLights(n,t,this._activeEffect,i,this._maxSimultaneousLights,!1),this.bindView(o),u.MaterialHelper.BindFogParameters(n,t,this._activeEffect,!0),this._imageProcessingConfiguration&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(t,this._activeEffect)}}},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,n.__decorate([Object(i.serializeAsColor3)()],t.prototype,"_primaryColor",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColor",void 0),n.__decorate([Object(i.serializeAsColor3)()],t.prototype,"__perceptualColor",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_primaryColorShadowLevel",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_primaryColorHighlightLevel",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColorHighlightLevel",null),n.__decorate([Object(i.serializeAsTexture)()],t.prototype,"_reflectionTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_reflectionBlur",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionBlur",void 0),n.__decorate([Object(i.serializeAsTexture)()],t.prototype,"_diffuseTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLights",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_shadowLevel",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLevel",void 0),n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"_sceneCenter",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"sceneCenter",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_opacityFresnel",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityFresnel",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_reflectionFresnel",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFresnel",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_reflectionFalloffDistance",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFalloffDistance",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_reflectionAmount",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionAmount",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_reflectionReflectance0",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance0",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_reflectionReflectance90",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance90",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_useRGBColor",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRGBColor",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_enableNoise",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableNoise",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_maxSimultaneousLights",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"maxSimultaneousLights",void 0),n.__decorate([Object(i.serializeAsImageProcessingConfiguration)()],t.prototype,"_imageProcessingConfiguration",void 0),t}(d.PushMaterial);m._TypeStore.RegisteredTypes["BABYLON.BackgroundMaterial"]=A},"./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/PBR/index.ts":
- /*!********************************!*\
- !*** ./Materials/PBR/index.ts ***!
- \********************************/
- /*! exports provided: 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,"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 l});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 */"./Maths/math.ts"),a=r(/*! ../../Materials/materialFlags */"./Materials/materialFlags.ts"),c=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),l=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?c.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),c.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){var t=this;i.SerializationHelper.Parse(function(){return t},e,null)},n.__decorate([Object(i.serialize)()],e.prototype,"_isEnabled",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"intensity",void 0),n.__decorate([Object(i.serializeAsVector2)()],e.prototype,"direction",void 0),n.__decorate([Object(i.serializeAsTexture)()],e.prototype,"_texture",void 0),n.__decorate([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._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.prototype.getClassName=function(){return"PBRClearCoatConfiguration"},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){var t=this;i.SerializationHelper.Parse(function(){return t},e,null)},e.DEFAULT_USE_ENERGY_CONSERVATION=!0,e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED=!0,n.__decorate([Object(i.serialize)()],e.prototype,"_useEnergyConservation",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useEnergyConservation",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_useSmithVisibilityHeightCorrelated",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSmithVisibilityHeightCorrelated",void 0),e}()},"./Materials/PBR/pbrBaseMaterial.ts":
- /*!******************************************!*\
- !*** ./Materials/PBR/pbrBaseMaterial.ts ***!
- \******************************************/
- /*! exports provided: PBRBaseMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRBaseMaterial",function(){return x});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"),c=r(/*! ../../scene */"./scene.ts"),l=r(/*! ../../Maths/math */"./Maths/math.ts"),u=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),h=r(/*! ./pbrClearCoatConfiguration */"./Materials/PBR/pbrClearCoatConfiguration.ts"),d=r(/*! ./pbrAnisotropicConfiguration */"./Materials/PBR/pbrAnisotropicConfiguration.ts"),f=r(/*! ./pbrBRDFConfiguration */"./Materials/PBR/pbrBRDFConfiguration.ts"),p=r(/*! ./pbrSheenConfiguration */"./Materials/PBR/pbrSheenConfiguration.ts"),g=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),m=r(/*! ../../Materials/effect */"./Materials/effect.ts"),_=r(/*! ../../Materials/materialDefines */"./Materials/materialDefines.ts"),v=r(/*! ../../Materials/pushMaterial */"./Materials/pushMaterial.ts"),A=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),y=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),b=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),T=r(/*! ../../Engines/constants */"./Engines/constants.ts"),E=(r(/*! ../../Shaders/pbr.fragment */"./Shaders/pbr.fragment.ts"),r(/*! ../../Shaders/pbr.vertex */"./Shaders/pbr.vertex.ts"),function(e){function t(){var t=e.call(this)||this;return t.PBR=!0,t.MAINUV1=!1,t.MAINUV2=!1,t.UV1=!1,t.UV2=!1,t.ALBEDO=!1,t.ALBEDODIRECTUV=0,t.VERTEXCOLOR=!1,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.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.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_SKYBOX_TRANSFORMED=!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.USESPHERICALINVERTEX=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDREFLECTION=!1,t.RADIANCEOCCLUSION=!1,t.HORIZONOCCLUSION=!1,t.REFRACTION=!1,t.REFRACTIONMAP_3D=!1,t.REFRACTIONMAP_OPPOSITEZ=!1,t.LODINREFRACTIONALPHA=!1,t.GAMMAREFRACTION=!1,t.RGBDREFRACTION=!1,t.LINKREFRACTIONTOTRANSPARENCY=!1,t.INSTANCES=!1,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.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.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.SHEEN=!1,t.SHEEN_TEXTURE=!1,t.SHEEN_TEXTUREDIRECTUV=0,t.SHEEN_LINKWITHALBEDO=!1,t.UNLIT=!1,t.DEBUGMODE=0,t.rebuild(),t}return n.__extends(t,e),t.prototype.reset=function(){e.prototype.reset.call(this),this.ALPHATESTVALUE="0.5",this.PBR=!0},t}(_.MaterialDefines)),x=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 l.Vector4(i._directIntensity,i._emissiveIntensity,i._environmentIntensity,i._specularIntensity),i._disableBumpMap=!1,i._ambientTextureStrength=1,i._ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,i._ambientColor=new l.Color3(0,0,0),i._albedoColor=new l.Color3(1,1,1),i._reflectivityColor=new l.Color3(1,1,1),i._reflectionColor=new l.Color3(1,1,1),i._emissiveColor=new l.Color3(0,0,0),i._microSurface=.9,i._indexOfRefraction=.66,i._invertRefractionY=!1,i._linkRefractionWithTransparency=!1,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._transparencyMode=null,i._environmentBRDFTexture=null,i._forceIrradianceInFragment=!1,i._forceNormalForward=!1,i._enableSpecularAntiAliasing=!1,i._renderTargets=new s.SmartArray(16),i._globalAmbientColor=new l.Color3(0,0,0),i._unlit=!1,i._debugMode=0,i.debugMode=0,i.debugLimit=-1,i.debugFactor=1,i.clearCoat=new h.PBRClearCoatConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i.anisotropy=new d.PBRAnisotropicConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i.brdf=new f.PBRBRDFConfiguration(i._markAllSubMeshesAsMiscDirty.bind(i)),i.sheen=new p.PBRSheenConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i._attachImageProcessingConfiguration(null),i.getRenderTargetTextures=function(){return i._renderTargets.reset(),b.MaterialFlags.ReflectionTextureEnabled&&i._reflectionTexture&&i._reflectionTexture.isRenderTarget&&i._renderTargets.push(i._reflectionTexture),b.MaterialFlags.RefractionTextureEnabled&&i._refractionTexture&&i._refractionTexture.isRenderTarget&&i._renderTargets.push(i._refractionTexture),i._renderTargets},i._environmentBRDFTexture=a.BRDFTextureTools.GetEnvironmentBRDFTexture(n),i}return n.__extends(t,e),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!!(b.MaterialFlags.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||!!(b.MaterialFlags.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseMaterial"},t.prototype.getShaderName=function(){return"pbr"},Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"transparencyMode",{get:function(){return this._transparencyMode},set:function(e){this._transparencyMode!==e&&(this._transparencyMode=e,this._forceAlphaTest=e===t.PBRMATERIAL_ALPHATESTANDBLEND,this._markAllSubMeshesAsTexturesAndMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_disableAlphaBlending",{get:function(){return this._linkRefractionWithTransparency||this._transparencyMode===t.PBRMATERIAL_OPAQUE||this._transparencyMode===t.PBRMATERIAL_ALPHATEST},enumerable:!0,configurable:!0}),t.prototype.needAlphaBlending=function(){return!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromAlbedoTexture())},t.prototype.needAlphaBlendingForMesh=function(t){return!(this._disableAlphaBlending&&t.visibility>=1)&&e.prototype.needAlphaBlendingForMesh.call(this,t)},t.prototype.needAlphaTesting=function(){return!!this._forceAlphaTest||!this._linkRefractionWithTransparency&&(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&&this._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new E);var n=t._materialDefines;if(!this.checkReadyOnEveryCall&&t.effect&&n._renderId===this.getScene().getRenderId())return!0;var i=this.getScene(),s=i.getEngine();if(n._areTexturesDirty&&i.texturesEnabled){if(this._albedoTexture&&b.MaterialFlags.DiffuseTextureEnabled&&!this._albedoTexture.isReadyOrNotBlocking())return!1;if(this._ambientTexture&&b.MaterialFlags.AmbientTextureEnabled&&!this._ambientTexture.isReadyOrNotBlocking())return!1;if(this._opacityTexture&&b.MaterialFlags.OpacityTextureEnabled&&!this._opacityTexture.isReadyOrNotBlocking())return!1;var a=this._getReflectionTexture();if(a&&b.MaterialFlags.ReflectionTextureEnabled&&!a.isReadyOrNotBlocking())return!1;if(this._lightmapTexture&&b.MaterialFlags.LightmapTextureEnabled&&!this._lightmapTexture.isReadyOrNotBlocking())return!1;if(this._emissiveTexture&&b.MaterialFlags.EmissiveTextureEnabled&&!this._emissiveTexture.isReadyOrNotBlocking())return!1;if(b.MaterialFlags.SpecularTextureEnabled){if(this._metallicTexture){if(!this._metallicTexture.isReadyOrNotBlocking())return!1}else if(this._reflectivityTexture&&!this._reflectivityTexture.isReadyOrNotBlocking())return!1;if(this._microSurfaceTexture&&!this._microSurfaceTexture.isReadyOrNotBlocking())return!1}if(s.getCaps().standardDerivatives&&this._bumpTexture&&b.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&!this._bumpTexture.isReady())return!1;var c=this._getRefractionTexture();if(c&&b.MaterialFlags.RefractionTextureEnabled&&!c.isReadyOrNotBlocking())return!1;if(this._environmentBRDFTexture&&b.MaterialFlags.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady())return!1}if(!this.clearCoat.isReadyForSubMesh(n,i,s,this._disableBumpMap))return!1;if(!this.sheen.isReadyForSubMesh(n,i))return!1;if(!this.anisotropy.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,h=this._prepareEffect(e,n,this.onCompiled,this.onError,r);return h&&(this.allowShaderHotSwapping&&l&&!h.isReady()?(h=l,n.markAsUnprocessed()):(i.resetCachedMaterial(),t.setEffect(h,n),this.buildUniformLayout())),!(!t.effect||!t.effect.isReady())&&(n._renderId=i.getRenderId(),this._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){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),!t.isDirty)return null;t.markAsProcessed();var s=this.getScene().getEngine(),a=new m.EffectFallbacks,c=0;t.USESPHERICALINVERTEX&&a.addFallback(c++,"USESPHERICALINVERTEX"),t.FOG&&a.addFallback(c,"FOG"),t.SPECULARAA&&a.addFallback(c,"SPECULARAA"),t.POINTSIZE&&a.addFallback(c,"POINTSIZE"),t.LOGARITHMICDEPTH&&a.addFallback(c,"LOGARITHMICDEPTH"),t.PARALLAX&&a.addFallback(c,"PARALLAX"),t.PARALLAXOCCLUSION&&a.addFallback(c++,"PARALLAXOCCLUSION"),c=d.PBRAnisotropicConfiguration.AddFallbacks(t,a,c),c=h.PBRClearCoatConfiguration.AddFallbacks(t,a,c),c=p.PBRSheenConfiguration.AddFallbacks(t,a,c),t.ENVIRONMENTBRDF&&a.addFallback(c++,"ENVIRONMENTBRDF"),t.TANGENT&&a.addFallback(c++,"TANGENT"),t.BUMP&&a.addFallback(c++,"BUMP"),c=A.MaterialHelper.HandleFallbacksForShadows(t,a,this._maxSimultaneousLights,c++),t.SPECULARTERM&&a.addFallback(c++,"SPECULARTERM"),t.USESPHERICALFROMREFLECTIONMAP&&a.addFallback(c++,"USESPHERICALFROMREFLECTIONMAP"),t.LIGHTMAP&&a.addFallback(c++,"LIGHTMAP"),t.NORMAL&&a.addFallback(c++,"NORMAL"),t.AMBIENT&&a.addFallback(c++,"AMBIENT"),t.EMISSIVE&&a.addFallback(c++,"EMISSIVE"),t.VERTEXCOLOR&&a.addFallback(c++,"VERTEXCOLOR"),t.NUM_BONE_INFLUENCERS>0&&a.addCPUSkinningFallback(c++,e),t.MORPHTARGETS&&a.addFallback(c++,"MORPHTARGETS"),t.MULTIVIEW&&a.addFallback(0,"MULTIVIEW");var l=[u.VertexBuffer.PositionKind];t.NORMAL&&l.push(u.VertexBuffer.NormalKind),t.TANGENT&&l.push(u.VertexBuffer.TangentKind),t.UV1&&l.push(u.VertexBuffer.UVKind),t.UV2&&l.push(u.VertexBuffer.UV2Kind),t.VERTEXCOLOR&&l.push(u.VertexBuffer.ColorKind),A.MaterialHelper.PrepareAttributesForBones(l,e,t,a),A.MaterialHelper.PrepareAttributesForInstances(l,t),A.MaterialHelper.PrepareAttributesForMorphTargets(l,e,t);var f=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","vReflectivityColor","vEmissiveColor","visibility","vReflectionColor","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vReflectionPosition","vReflectionSize","vEmissiveInfos","vReflectivityInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","albedoMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","refractionMatrix","vLightingIntensity","logarithmicDepthConstant","vSphericalX","vSphericalY","vSphericalZ","vSphericalXX","vSphericalYY","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vReflectionMicrosurfaceInfos","vRefractionMicrosurfaceInfos","vTangentSpaceParams","boneTextureWidth","vDebugMode"],_=["albedoSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","microSurfaceSampler","environmentBrdfSampler","boneSampler"],v=["Material","Scene"];h.PBRClearCoatConfiguration.AddUniforms(f),h.PBRClearCoatConfiguration.AddSamplers(_),d.PBRAnisotropicConfiguration.AddUniforms(f),d.PBRAnisotropicConfiguration.AddSamplers(_),p.PBRSheenConfiguration.AddUniforms(f),p.PBRSheenConfiguration.AddSamplers(_),g.ImageProcessingConfiguration&&(g.ImageProcessingConfiguration.PrepareUniforms(f,t),g.ImageProcessingConfiguration.PrepareSamplers(_,t)),A.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:f,uniformBuffersNames:v,samplers:_,defines:t,maxSimultaneousLights:this._maxSimultaneousLights});var y=t.toString();return s.createEffect(this.getShaderName(),{attributes:l,uniformsNames:f,uniformBuffersNames:v,samplers:_,defines:y,fallbacks:a,onCompiled:r,onError:n,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:t.NUM_MORPH_INFLUENCERS}},s)},t.prototype._prepareDefines=function(e,r,n,i){void 0===n&&(n=null),void 0===i&&(i=null);var o=this.getScene(),s=o.getEngine();if(A.MaterialHelper.PrepareDefinesForLights(o,e,r,!0,this._maxSimultaneousLights,this._disableLighting),r._needNormals=!0,o.activeCamera){var a=r.MULTIVIEW;r.MULTIVIEW=null!==o.activeCamera.outputRenderTarget&&o.activeCamera.outputRenderTarget.getViewCount()>1,r.MULTIVIEW!=a&&r.markAsUnprocessed()}if(r.METALLICWORKFLOW=this.isMetallicWorkflow(),r._areTexturesDirty){if(r._needUVs=!1,o.texturesEnabled){o.getEngine().getCaps().textureLOD&&(r.LODBASEDMICROSFURACE=!0),this._albedoTexture&&b.MaterialFlags.DiffuseTextureEnabled?A.MaterialHelper.PrepareDefinesForMergedUV(this._albedoTexture,r,"ALBEDO"):r.ALBEDO=!1,this._ambientTexture&&b.MaterialFlags.AmbientTextureEnabled?(A.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture,r,"AMBIENT"),r.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):r.AMBIENT=!1,this._opacityTexture&&b.MaterialFlags.OpacityTextureEnabled?(A.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture,r,"OPACITY"),r.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):r.OPACITY=!1;var c=this._getReflectionTexture();if(c&&b.MaterialFlags.ReflectionTextureEnabled){switch(r.REFLECTION=!0,r.GAMMAREFLECTION=c.gammaSpace,r.RGBDREFLECTION=c.isRGBD,r.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!c.invertZ:c.invertZ,r.LODINREFLECTIONALPHA=c.lodLevelInAlpha,c.coordinatesMode===y.Texture.INVCUBIC_MODE&&(r.INVERTCUBICMAP=!0),r.REFLECTIONMAP_3D=c.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,r.REFLECTIONMAP_SKYBOX_TRANSFORMED=!1,c.coordinatesMode){case y.Texture.EXPLICIT_MODE:r.REFLECTIONMAP_EXPLICIT=!0;break;case y.Texture.PLANAR_MODE:r.REFLECTIONMAP_PLANAR=!0;break;case y.Texture.PROJECTION_MODE:r.REFLECTIONMAP_PROJECTION=!0;break;case y.Texture.SKYBOX_MODE:r.REFLECTIONMAP_SKYBOX=!0;break;case y.Texture.SPHERICAL_MODE:r.REFLECTIONMAP_SPHERICAL=!0;break;case y.Texture.EQUIRECTANGULAR_MODE:r.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case y.Texture.FIXED_EQUIRECTANGULAR_MODE:r.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case y.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:r.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case y.Texture.CUBIC_MODE:case y.Texture.INVCUBIC_MODE:default:r.REFLECTIONMAP_CUBIC=!0,r.USE_LOCAL_REFLECTIONMAP_CUBIC=!!c.boundingBoxSize}c.coordinatesMode!==y.Texture.SKYBOX_MODE?c.sphericalPolynomial&&(r.USESPHERICALFROMREFLECTIONMAP=!0,this._forceIrradianceInFragment||o.getEngine().getCaps().maxVaryingVectors<=8?r.USESPHERICALINVERTEX=!1:r.USESPHERICALINVERTEX=!0):r.REFLECTIONMAP_SKYBOX_TRANSFORMED=!c.getReflectionTextureMatrix().isIdentity()}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_SKYBOX_TRANSFORMED=!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.USESPHERICALINVERTEX=!1,r.REFLECTIONMAP_OPPOSITEZ=!1,r.LODINREFLECTIONALPHA=!1,r.GAMMAREFLECTION=!1,r.RGBDREFLECTION=!1;this._lightmapTexture&&b.MaterialFlags.LightmapTextureEnabled?(A.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture,r,"LIGHTMAP"),r.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,r.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace):r.LIGHTMAP=!1,this._emissiveTexture&&b.MaterialFlags.EmissiveTextureEnabled?A.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture,r,"EMISSIVE"):r.EMISSIVE=!1,b.MaterialFlags.SpecularTextureEnabled?(this._metallicTexture?(A.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?(A.MaterialHelper.PrepareDefinesForMergedUV(this._reflectivityTexture,r,"REFLECTIVITY"),r.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,r.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap):r.REFLECTIVITY=!1,this._microSurfaceTexture?A.MaterialHelper.PrepareDefinesForMergedUV(this._microSurfaceTexture,r,"MICROSURFACEMAP"):r.MICROSURFACEMAP=!1):(r.REFLECTIVITY=!1,r.MICROSURFACEMAP=!1),o.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&b.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap?(A.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture,r,"BUMP"),this._useParallax&&this._albedoTexture&&b.MaterialFlags.DiffuseTextureEnabled?(r.PARALLAX=!0,r.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):r.PARALLAX=!1,r.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):r.BUMP=!1;var l=this._getRefractionTexture();l&&b.MaterialFlags.RefractionTextureEnabled?(r.REFRACTION=!0,r.REFRACTIONMAP_3D=l.isCube,r.GAMMAREFRACTION=l.gammaSpace,r.RGBDREFRACTION=l.isRGBD,r.REFRACTIONMAP_OPPOSITEZ=l.invertZ,r.LODINREFRACTIONALPHA=l.lodLevelInAlpha,this._linkRefractionWithTransparency&&(r.LINKREFRACTIONTOTRANSPARENCY=!0)):r.REFRACTION=!1,this._environmentBRDFTexture&&b.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.ALPHATESTVALUE=this._alphaCutOff+(this._alphaCutOff%1==0?".":""),r.PREMULTIPLYALPHA=this.alphaMode===T.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===T.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,r.ALPHABLEND=this.needAlphaBlendingForMesh(e),r.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,r.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel,r.SPECULARAA=o.getEngine().getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}r._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(r),r.FORCENORMALFORWARD=this._forceNormalForward,r.RADIANCEOCCLUSION=this._useRadianceOcclusion,r.HORIZONOCCLUSION=this._useHorizonOcclusion,r._areMiscDirty&&(A.MaterialHelper.PrepareDefinesForMisc(e,o,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.clearCoat.prepareDefines(r,o),this.anisotropy.prepareDefines(r,e,o),this.brdf.prepareDefines(r),this.sheen.prepareDefines(r,o),A.MaterialHelper.PrepareDefinesForFrameBoundValues(o,s,r,!!n,i),A.MaterialHelper.PrepareDefinesForAttributes(e,r,!0,!0,!0,this._transparencyMode!==t.PBRMATERIAL_OPAQUE)},t.prototype.forceCompilation=function(e,t,r){var i=this,o=n.__assign({clipPlane:!1},r),s=new E,a=this._prepareEffect(e,s,void 0,void 0,void 0,o.clipPlane);a.isReady()?t&&t(this):a.onCompileObservable.add(function(){t&&t(i)})},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vAlbedoInfos",2),this._uniformBuffer.addUniform("vAmbientInfos",4),this._uniformBuffer.addUniform("vOpacityInfos",2),this._uniformBuffer.addUniform("vEmissiveInfos",2),this._uniformBuffer.addUniform("vLightmapInfos",2),this._uniformBuffer.addUniform("vReflectivityInfos",3),this._uniformBuffer.addUniform("vMicroSurfaceSamplerInfos",2),this._uniformBuffer.addUniform("vRefractionInfos",4),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("vReflectionPosition",3),this._uniformBuffer.addUniform("vReflectionSize",3),this._uniformBuffer.addUniform("vBumpInfos",3),this._uniformBuffer.addUniform("albedoMatrix",16),this._uniformBuffer.addUniform("ambientMatrix",16),this._uniformBuffer.addUniform("opacityMatrix",16),this._uniformBuffer.addUniform("emissiveMatrix",16),this._uniformBuffer.addUniform("lightmapMatrix",16),this._uniformBuffer.addUniform("reflectivityMatrix",16),this._uniformBuffer.addUniform("microSurfaceSamplerMatrix",16),this._uniformBuffer.addUniform("bumpMatrix",16),this._uniformBuffer.addUniform("vTangentSpaceParams",2),this._uniformBuffer.addUniform("refractionMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionColor",3),this._uniformBuffer.addUniform("vAlbedoColor",4),this._uniformBuffer.addUniform("vLightingIntensity",4),this._uniformBuffer.addUniform("vRefractionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("vReflectivityColor",4),this._uniformBuffer.addUniform("vEmissiveColor",3),this._uniformBuffer.addUniform("visibility",1),h.PBRClearCoatConfiguration.PrepareUniformBuffer(this._uniformBuffer),d.PBRAnisotropicConfiguration.PrepareUniformBuffer(this._uniformBuffer),p.PBRSheenConfiguration.PrepareUniformBuffer(this._uniformBuffer),this._uniformBuffer.create()},t.prototype.unbind=function(){this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._uniformBuffer.setTexture("refractionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,r,n){var i=this.getScene(),o=n._materialDefines;if(o){var s=n.effect;if(s){this._activeEffect=s,this.bindOnlyWorldMatrix(e),o.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var a=this._mustRebind(i,s,r.visibility);A.MaterialHelper.BindBonesParameters(r,this._activeEffect);var u=null;if(a){var h=i.getEngine();this._uniformBuffer.bindToEffect(s,"Material"),this.bindViewProjection(s),u=this._getReflectionTexture();var d=this._getRefractionTexture();if(!this._uniformBuffer.useUbo||!this.isFrozen||!this._uniformBuffer.isSync){if(i.texturesEnabled){if(this._albedoTexture&&b.MaterialFlags.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),A.MaterialHelper.BindTextureMatrix(this._albedoTexture,this._uniformBuffer,"albedo")),this._ambientTexture&&b.MaterialFlags.AmbientTextureEnabled&&(this._uniformBuffer.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),A.MaterialHelper.BindTextureMatrix(this._ambientTexture,this._uniformBuffer,"ambient")),this._opacityTexture&&b.MaterialFlags.OpacityTextureEnabled&&(this._uniformBuffer.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),A.MaterialHelper.BindTextureMatrix(this._opacityTexture,this._uniformBuffer,"opacity")),u&&b.MaterialFlags.ReflectionTextureEnabled){if(this._uniformBuffer.updateMatrix("reflectionMatrix",u.getReflectionTextureMatrix()),this._uniformBuffer.updateFloat2("vReflectionInfos",u.level,0),u.boundingBoxSize){var f=u;this._uniformBuffer.updateVector3("vReflectionPosition",f.boundingBoxPosition),this._uniformBuffer.updateVector3("vReflectionSize",f.boundingBoxSize)}var p=u.sphericalPolynomial;o.USESPHERICALFROMREFLECTIONMAP&&p&&(this._activeEffect.setFloat3("vSphericalX",p.x.x,p.x.y,p.x.z),this._activeEffect.setFloat3("vSphericalY",p.y.x,p.y.y,p.y.z),this._activeEffect.setFloat3("vSphericalZ",p.z.x,p.z.y,p.z.z),this._activeEffect.setFloat3("vSphericalXX_ZZ",p.xx.x-p.zz.x,p.xx.y-p.zz.y,p.xx.z-p.zz.z),this._activeEffect.setFloat3("vSphericalYY_ZZ",p.yy.x-p.zz.x,p.yy.y-p.zz.y,p.yy.z-p.zz.z),this._activeEffect.setFloat3("vSphericalZZ",p.zz.x,p.zz.y,p.zz.z),this._activeEffect.setFloat3("vSphericalXY",p.xy.x,p.xy.y,p.xy.z),this._activeEffect.setFloat3("vSphericalYZ",p.yz.x,p.yz.y,p.yz.z),this._activeEffect.setFloat3("vSphericalZX",p.zx.x,p.zx.y,p.zx.z)),this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos",u.getSize().width,u.lodGenerationScale,u.lodGenerationOffset)}if(this._emissiveTexture&&b.MaterialFlags.EmissiveTextureEnabled&&(this._uniformBuffer.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),A.MaterialHelper.BindTextureMatrix(this._emissiveTexture,this._uniformBuffer,"emissive")),this._lightmapTexture&&b.MaterialFlags.LightmapTextureEnabled&&(this._uniformBuffer.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),A.MaterialHelper.BindTextureMatrix(this._lightmapTexture,this._uniformBuffer,"lightmap")),b.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?(this._uniformBuffer.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),A.MaterialHelper.BindTextureMatrix(this._metallicTexture,this._uniformBuffer,"reflectivity")):this._reflectivityTexture&&(this._uniformBuffer.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),A.MaterialHelper.BindTextureMatrix(this._reflectivityTexture,this._uniformBuffer,"reflectivity")),this._microSurfaceTexture&&(this._uniformBuffer.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),A.MaterialHelper.BindTextureMatrix(this._microSurfaceTexture,this._uniformBuffer,"microSurfaceSampler"))),this._bumpTexture&&h.getCaps().standardDerivatives&&b.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&(this._uniformBuffer.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),A.MaterialHelper.BindTextureMatrix(this._bumpTexture,this._uniformBuffer,"bump"),i._mirroredCameraPosition?this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),d&&b.MaterialFlags.RefractionTextureEnabled){this._uniformBuffer.updateMatrix("refractionMatrix",d.getReflectionTextureMatrix());var g=1;d.isCube||d.depth&&(g=d.depth),this._uniformBuffer.updateFloat4("vRefractionInfos",d.level,this._indexOfRefraction,g,this._invertRefractionY?-1:1),this._uniformBuffer.updateFloat3("vRefractionMicrosurfaceInfos",d.getSize().width,d.lodGenerationScale,d.lodGenerationOffset)}}this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),o.METALLICWORKFLOW?(l.Tmp.Color3[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,l.Tmp.Color3[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness,this._uniformBuffer.updateColor4("vReflectivityColor",l.Tmp.Color3[0],0)):this._uniformBuffer.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface),this._uniformBuffer.updateColor3("vEmissiveColor",b.MaterialFlags.EmissiveTextureEnabled?this._emissiveColor:l.Color3.BlackReadOnly),this._uniformBuffer.updateColor3("vReflectionColor",this._reflectionColor),this._uniformBuffer.updateColor4("vAlbedoColor",this._albedoColor,this.alpha),this._uniformBuffer.updateFloat("visibility",r.visibility),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity,this._lightingInfos.w=this._specularIntensity,this._uniformBuffer.updateVector4("vLightingIntensity",this._lightingInfos)}i.texturesEnabled&&(this._albedoTexture&&b.MaterialFlags.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("albedoSampler",this._albedoTexture),this._ambientTexture&&b.MaterialFlags.AmbientTextureEnabled&&this._uniformBuffer.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&b.MaterialFlags.OpacityTextureEnabled&&this._uniformBuffer.setTexture("opacitySampler",this._opacityTexture),u&&b.MaterialFlags.ReflectionTextureEnabled&&(o.LODBASEDMICROSFURACE?this._uniformBuffer.setTexture("reflectionSampler",u):(this._uniformBuffer.setTexture("reflectionSampler",u._lodTextureMid||u),this._uniformBuffer.setTexture("reflectionSamplerLow",u._lodTextureLow||u),this._uniformBuffer.setTexture("reflectionSamplerHigh",u._lodTextureHigh||u))),o.ENVIRONMENTBRDF&&this._uniformBuffer.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),d&&b.MaterialFlags.RefractionTextureEnabled&&(o.LODBASEDMICROSFURACE?this._uniformBuffer.setTexture("refractionSampler",d):(this._uniformBuffer.setTexture("refractionSampler",d._lodTextureMid||d),this._uniformBuffer.setTexture("refractionSamplerLow",d._lodTextureLow||d),this._uniformBuffer.setTexture("refractionSamplerHigh",d._lodTextureHigh||d))),this._emissiveTexture&&b.MaterialFlags.EmissiveTextureEnabled&&this._uniformBuffer.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&b.MaterialFlags.LightmapTextureEnabled&&this._uniformBuffer.setTexture("lightmapSampler",this._lightmapTexture),b.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?this._uniformBuffer.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&this._uniformBuffer.setTexture("reflectivitySampler",this._reflectivityTexture),this._microSurfaceTexture&&this._uniformBuffer.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&h.getCaps().standardDerivatives&&b.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&this._uniformBuffer.setTexture("bumpSampler",this._bumpTexture)),this.clearCoat.bindForSubMesh(this._uniformBuffer,i,h,this._disableBumpMap,this.isFrozen,this._invertNormalMapX,this._invertNormalMapY),this.anisotropy.bindForSubMesh(this._uniformBuffer,i,this.isFrozen),this.sheen.bindForSubMesh(this._uniformBuffer,i,this.isFrozen),A.MaterialHelper.BindClipPlane(this._activeEffect,i),i.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor);var m=i._forcedViewPosition?i._forcedViewPosition:i._mirroredCameraPosition?i._mirroredCameraPosition:i.activeCamera.globalPosition,_=i.useRightHandedSystem===(null!=i._mirroredCameraPosition);s.setFloat4("vEyePosition",m.x,m.y,m.z,_?-1:1),s.setColor3("vAmbientColor",this._globalAmbientColor),s.setFloat2("vDebugMode",this.debugLimit,this.debugFactor)}!a&&this.isFrozen||(i.lightsEnabled&&!this._disableLighting&&A.MaterialHelper.BindLights(i,r,this._activeEffect,o,this._maxSimultaneousLights,this._lightFalloff!==t.LIGHTFALLOFF_STANDARD),(i.fogEnabled&&r.applyFog&&i.fogMode!==c.Scene.FOGMODE_NONE||u)&&this.bindView(s),A.MaterialHelper.BindFogParameters(i,r,this._activeEffect,!0),o.NUM_MORPH_INFLUENCERS&&A.MaterialHelper.BindMorphTargetParameters(r,this._activeEffect),this._imageProcessingConfiguration.bind(this._activeEffect),A.MaterialHelper.BindLogDepth(o,this._activeEffect,i)),this._uniformBuffer.update(),this._afterBind(r,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._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),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._getRefractionTexture=function(){return this._refractionTexture?this._refractionTexture:this._linkRefractionWithTransparency?this.getScene().environmentTexture:null},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._microSurfaceTexture&&t.push(this._microSurfaceTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this._refractionTexture&&t.push(this._refractionTexture),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._microSurfaceTexture===t||(this._bumpTexture===t||(this._lightmapTexture===t||(this.clearCoat.hasTexture(t)||this.sheen.hasTexture(t)||this.anisotropy.hasTexture(t)))))))))))},t.prototype.dispose=function(t,r){r&&(this._albedoTexture&&this._albedoTexture.dispose(),this._ambientTexture&&this._ambientTexture.dispose(),this._opacityTexture&&this._opacityTexture.dispose(),this._reflectionTexture&&this._reflectionTexture.dispose(),this._environmentBRDFTexture&&this.getScene().environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._emissiveTexture&&this._emissiveTexture.dispose(),this._metallicTexture&&this._metallicTexture.dispose(),this._reflectivityTexture&&this._reflectivityTexture.dispose(),this._bumpTexture&&this._bumpTexture.dispose(),this._lightmapTexture&&this._lightmapTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose()),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=0,t.PBRMATERIAL_ALPHATEST=1,t.PBRMATERIAL_ALPHABLEND=2,t.PBRMATERIAL_ALPHATESTANDBLEND=3,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=0,t.LIGHTFALLOFF_PHYSICAL=0,t.LIGHTFALLOFF_GLTF=1,t.LIGHTFALLOFF_STANDARD=2,n.__decorate([Object(i.serializeAsImageProcessingConfiguration)()],t.prototype,"_imageProcessingConfiguration",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"debugMode",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"useLogarithmicDepth",null),n.__decorate([Object(i.serialize)()],t.prototype,"transparencyMode",null),t}(v.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 */"./Maths/math.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 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:!0,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseSimpleMaterial"},n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectionTexture")],t.prototype,"environmentTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_bumpTexture")],t.prototype,"normalTexture",void 0),n.__decorate([Object(i.serializeAsColor3)("emissive"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_ambientTextureStrength")],t.prototype,"occlusionStrength",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_ambientTexture")],t.prototype,"occlusionTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_alphaCutOff")],t.prototype,"alphaCutOff",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"doubleSided",null),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),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 c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math */"./Maths/math.ts"),s=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),c=function(){function e(t){this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.roughness=0,this._indiceOfRefraction=e._DefaultIndiceOfRefraction,this.indiceOfRefraction=e._DefaultIndiceOfRefraction,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._indiceOfRefraction===e._DefaultIndiceOfRefraction,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,c){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,c?1:-1):e.updateFloat2("vClearCoatTangentSpaceParams",o?-1:1,c?-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 l=1-this._indiceOfRefraction,u=1+this._indiceOfRefraction,h=Math.pow(-l/u,2),d=1/this._indiceOfRefraction;e.updateFloat4("vClearCoatRefractionParams",h,d,l,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){var t=this;i.SerializationHelper.Parse(function(){return t},e,null)},e._DefaultIndiceOfRefraction=1.5,n.__decorate([Object(i.serialize)()],e.prototype,"_isEnabled",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"intensity",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"roughness",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_indiceOfRefraction",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"indiceOfRefraction",void 0),n.__decorate([Object(i.serializeAsTexture)()],e.prototype,"_texture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),n.__decorate([Object(i.serializeAsTexture)()],e.prototype,"_bumpTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"bumpTexture",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_isTintEnabled",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isTintEnabled",void 0),n.__decorate([Object(i.serializeAsColor3)()],e.prototype,"tintColor",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"tintColorAtDistance",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"tintThickness",void 0),n.__decorate([Object(i.serializeAsTexture)()],e.prototype,"_tintTexture",void 0),n.__decorate([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 l});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 */"./Maths/math.ts"),a=r(/*! ./pbrBaseMaterial */"./Materials/PBR/pbrBaseMaterial.ts"),c=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),l=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.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.indexOfRefraction=.66,i.invertRefractionY=!1,i.linkRefractionWithTransparency=!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 n.__extends(t,e),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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this._imageProcessingConfiguration.colorGradingTexture=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this._imageProcessingConfiguration.colorCurves},set:function(e){this._imageProcessingConfiguration.colorCurves=e},enumerable:!0,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),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},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),e.anisotropy&&o.anisotropy.parse(e.anisotropy),e.brdf&&o.brdf.parse(e.brdf),e.sheen&&o.sheen.parse(e.brdf),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,n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"directIntensity",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveIntensity",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentIntensity",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularIntensity",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"disableBumpMap",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureStrength",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurfaceTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),n.__decorate([Object(i.serializeAsColor3)("ambient"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientColor",void 0),n.__decorate([Object(i.serializeAsColor3)("albedo"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoColor",void 0),n.__decorate([Object(i.serializeAsColor3)("reflectivity"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityColor",void 0),n.__decorate([Object(i.serializeAsColor3)("reflection"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionColor",void 0),n.__decorate([Object(i.serializeAsColor3)("emissive"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurface",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"indexOfRefraction",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertRefractionY",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkRefractionWithTransparency",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromAlbedoTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"forceAlphaTest",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"alphaCutOff",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureGreen",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMetallnessFromMetallicTextureBlue",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientInGrayScale",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"usePhysicalLightFalloff",null),n.__decorate([Object(i.serialize)()],t.prototype,"useGLTFLightFalloff",null),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOverAlpha",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"parallaxScaleBias",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceIrradianceInFragment",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFresnel",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLinearAlphaFresnel",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentBRDFTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceNormalForward",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableSpecularAntiAliasing",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useHorizonOcclusion",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOcclusion",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"unlit",void 0),t}(a.PBRBaseMaterial);c._TypeStore.RegisteredTypes["BABYLON.PBRMaterial"]=l},"./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 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),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},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),e.anisotropy&&o.anisotropy.parse(e.anisotropy),e.brdf&&o.brdf.parse(e.brdf),e.sheen&&o.sheen.parse(e.brdf),o},n.__decorate([Object(i.serializeAsColor3)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"baseColor",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"baseTexture",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),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 c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math */"./Maths/math.ts"),s=r(/*! ../../Materials/materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),c=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._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._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.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)),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","vSheenInfos","sheenMatrix")},e.PrepareUniformBuffer=function(e){e.addUniform("vSheenColor",4),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){var t=this;i.SerializationHelper.Parse(function(){return t},e,null)},n.__decorate([Object(i.serialize)()],e.prototype,"_isEnabled",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_linkSheenWithAlbedo",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"linkSheenWithAlbedo",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"intensity",void 0),n.__decorate([Object(i.serializeAsColor3)()],e.prototype,"color",void 0),n.__decorate([Object(i.serializeAsTexture)()],e.prototype,"_texture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",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 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),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},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),e.anisotropy&&o.anisotropy.parse(e.anisotropy),e.brdf&&o.brdf.parse(e.brdf),e.sheen&&o.sheen.parse(e.brdf),o},n.__decorate([Object(i.serializeAsColor3)("diffuse"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"diffuseColor",void 0),n.__decorate([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"diffuseTexture",void 0),n.__decorate([Object(i.serializeAsColor3)("specular"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectivityColor")],t.prototype,"specularColor",void 0),n.__decorate([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_microSurface")],t.prototype,"glossiness",void 0),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/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 s});var n=r(/*! ../../../Maths/sphericalPolynomial */"./Maths/sphericalPolynomial.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../../Misc/dds */"./Misc/dds.ts"),s=function(){function e(){this.supportCascades=!0}return e.prototype.canLoad=function(e,t,r,n,i){return 0===e.indexOf(".dds")},e.prototype.transformUrl=function(e,t){return e},e.prototype.getFallbackTextureUrl=function(e,t){return null},e.prototype.loadCubeData=function(e,t,r,i,s){var a,c=t.getEngine(),l=!1;if(Array.isArray(e))for(var u=0;u<e.length;u++){var h=e[u];a=o.DDSTools.GetDDSInfo(h),t.width=a.width,t.height=a.height,l=(a.isRGB||a.isLuminance||a.mipmapCount>1)&&t.generateMipMaps,c._unpackFlipY(a.isCompressed),o.DDSTools.UploadDDSLevels(c,t,h,a,l,6,-1,u),a.isFourCC||1!==a.mipmapCount||c.generateMipMapsForCubemap(t)}else{var d=e;a=o.DDSTools.GetDDSInfo(d),t.width=a.width,t.height=a.height,r&&(a.sphericalPolynomial=new n.SphericalPolynomial),l=(a.isRGB||a.isLuminance||a.mipmapCount>1)&&t.generateMipMaps,c._unpackFlipY(a.isCompressed),o.DDSTools.UploadDDSLevels(c,t,d,a,l,6),a.isFourCC||1!==a.mipmapCount||c.generateMipMapsForCubemap(t)}c._setCubeMapTextureParams(l),t.isReady=!0,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 s)},"./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 o});var n=r(/*! ../../../Misc/environmentTextureTools */"./Misc/environmentTextureTools.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e,t,r,n,i){return 0===e.indexOf(".env")},e.prototype.transformUrl=function(e,t){return e},e.prototype.getFallbackTextureUrl=function(e,t){return null},e.prototype.loadCubeData=function(e,t,r,i,o){if(!Array.isArray(e)){e=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,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 o)},"./Materials/Textures/Loaders/index.ts":
- /*!*********************************************!*\
- !*** ./Materials/Textures/Loaders/index.ts ***!
- \*********************************************/
- /*! exports provided: _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader */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})},"./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 o});var n=r(/*! ../../../Misc/khronosTextureContainer */"./Misc/khronosTextureContainer.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e,t,r,n,i){return!(!t||n||r||i)},e.prototype.transformUrl=function(e,t){var r=e.lastIndexOf(".");return-1!=r&&"ktx"==e.substring(r+1)?e:(r>-1?e.substring(0,r):e)+t},e.prototype.getFallbackTextureUrl=function(e,t){var r=new RegExp(t+"$");return e.replace(r,"")},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),c=a.numberOfMipmapLevels>1&&t.generateMipMaps;s._unpackFlipY(!0),a.uploadLevels(t,t.generateMipMaps),t.width=a.pixelWidth,t.height=a.pixelHeight,s._setCubeMapTextureParams(c),t.isReady=!0}},e.prototype.loadData=function(e,t,r){t._invertVScale=!t.invertY;var i=new n.KhronosTextureContainer(e,1);r(i.pixelWidth,i.pixelHeight,!1,!0,function(){i.uploadLevels(t,t.generateMipMaps)},i.isInvalid)},e}();i.Engine._TextureLoaders.unshift(new o)},"./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 o});var n=r(/*! ../../../Misc/tga */"./Misc/tga.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e,t,r,n,i){return 0===e.indexOf(".tga")},e.prototype.transformUrl=function(e,t){return e},e.prototype.getFallbackTextureUrl=function(e,t){return null},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),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 o)},"./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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../../Maths/math */"./Maths/math.ts"),s=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ./proceduralTexture */"./Materials/Textures/Procedurals/proceduralTexture.ts"),c=r(/*! ../../../Misc/webRequest */"./Misc/webRequest.ts"),l=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 n.__extends(t,e),t.prototype._loadJson=function(e){var t=this,r=function(){i.Logger.Log("No config file found in "+e+" trying to use ShadersStore or DOM element");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 s.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 o.Color3(t.r,t.g,t.b));break;case"color4":this.setColor4(t.name,new o.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:!0,configurable:!0}),t}(a.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 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.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 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(/*! ../../../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../../../sceneComponent */"./sceneComponent.ts"),c=r(/*! ../../../Materials/material */"./Materials/material.ts"),l=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=r(/*! ../../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),h=r(/*! ./proceduralTextureSceneComponent */"./Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts"),d=(r(/*! ../../../Shaders/procedural.vertex */"./Shaders/procedural.vertex.ts"),function(e){function t(t,r,n,i,c,l,u){void 0===c&&(c=null),void 0===l&&(l=!0),void 0===u&&(u=!1);var d=e.call(this,null,i,!l)||this;d.isCube=u,d.isEnabled=!0,d.autoClear=!0,d.onGeneratedObservable=new o.Observable,d._textures={},d._currentRefreshId=-1,d._refreshRate=1,d._vertexBuffers={},d._uniforms=new Array,d._samplers=new Array,d._floats={},d._ints={},d._floatsArrays={},d._colors3={},d._colors4={},d._vectors2={},d._vectors3={},d._matrices={},d._fallbackTextureUsed=!1,d._cachedDefines="",d._contentUpdateId=-1;var f=(i=d.getScene())._getComponent(a.SceneComponentConstants.NAME_PROCEDURALTEXTURE);f||(f=new h.ProceduralTextureSceneComponent(i),i._addComponent(f)),i.proceduralTextures.push(d),d._engine=i.getEngine(),d.name=t,d.isRenderTarget=!0,d._size=r,d._generateMipMaps=l,d.setFragment(n),d._fallbackTexture=c,u?(d._texture=d._engine.createRenderTargetCubeTexture(r,{generateMipMaps:l,generateDepthBuffer:!1,generateStencilBuffer:!1}),d.setFloat("face",0)):d._texture=d._engine.createRenderTargetTexture(r,{generateMipMaps:l,generateDepthBuffer:!1,generateStencilBuffer:!1});var p=[];return p.push(1,1),p.push(-1,1),p.push(-1,-1),p.push(1,-1),d._vertexBuffers[s.VertexBuffer.PositionKind]=new s.VertexBuffer(d._engine,p,s.VertexBuffer.PositionKind,!1,!1,2),d._createIndexBuffer(),d}return n.__extends(t,e),t.prototype.getEffect=function(){return this._effect},t.prototype.getContent=function(){return this._contentData&&this._currentRefreshId==this._contentUpdateId?this._contentData:(this._contentData=this.readPixels(0,0,this._contentData),this._contentUpdateId=this._currentRefreshId,this._contentData)},t.prototype._createIndexBuffer=function(){var e=this._engine,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._engine._releaseEffect(this._effect)},t.prototype._getDefines=function(){return""},t.prototype.isReady=function(){var e,t=this,r=this._engine;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:!0,configurable:!0}),t.prototype._shouldRender=function(){return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId?(this._currentRefreshId=1,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!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._engine.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._engine;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(c.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(c.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._engine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),e.prototype.dispose.call(this)}},n.__decorate([Object(i.serialize)()],t.prototype,"isEnabled",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"autoClear",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_generateMipMaps",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_size",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"refreshRate",null),t}(l.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,e.layers=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.ts":
- /*!*******************************************!*\
- !*** ./Materials/Textures/baseTexture.ts ***!
- \*******************************************/
- /*! exports provided: BaseTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseTexture",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(/*! ../../Misc/tools */"./Misc/tools.ts"),a=r(/*! ../../Misc/HighDynamicRange/cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts"),c=r(/*! ../../Maths/math */"./Maths/math.ts"),l=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../../Engines/constants */"./Engines/constants.ts"),h=function(){function e(t){this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this.getAlphaFromRGB=!1,this.level=1,this.coordinatesIndex=0,this._coordinatesMode=u.Constants.TEXTURE_EXPLICIT_MODE,this.wrapU=u.Constants.TEXTURE_WRAP_ADDRESSMODE,this.wrapV=u.Constants.TEXTURE_WRAP_ADDRESSMODE,this.wrapR=u.Constants.TEXTURE_WRAP_ADDRESSMODE,this.anisotropicFilteringLevel=e.DEFAULT_ANISOTROPIC_FILTERING_LEVEL,this.gammaSpace=!0,this.invertZ=!1,this.lodLevelInAlpha=!1,this.isRenderTarget=!1,this.animations=new Array,this.onDisposeObservable=new o.Observable,this.delayLoadState=u.Constants.DELAYLOADSTATE_NONE,this._cachedSize=c.Size.Zero(),this._scene=t||l.EngineStore.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this)),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(u.Constants.MATERIAL_TextureDirtyFlag|u.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!0,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(u.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRGBD",{get:function(){return null!=this._texture&&this._texture._isRGBD},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noMipmap",{get:function(){return!1},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"uid",{get:function(){return this._uid||(this._uid=s.Tools.RandomId()),this._uid},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBlocking",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getTextureMatrix=function(){return c.Matrix.IdentityReadOnly},e.prototype.getReflectionTextureMatrix=function(){return c.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===u.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 c.Size(this._texture._size,this._texture._size):new c.Size(this._texture.baseWidth,this._texture.baseHeight):c.Size.Zero()},e.prototype.updateSamplingMode=function(e){if(this._texture){var t=this.getScene();t&&t.getEngine().updateTextureSamplingMode(e,this._texture)}},e.prototype.scale=function(e){},Object.defineProperty(e.prototype,"canRescale",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype._getFromCache=function(e,t,r,n){if(!this._scene)return null;for(var i=this._scene.getEngine().getLoadedTexturesCache(),o=0;o<i.length;o++){var s=i[o];if(!(void 0!==n&&n!==s.invertY||s.url!==e||s.generateMipMaps!==!t||r&&r!==s.samplingMode))return s.incrementReferences(),s}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:u.Constants.TEXTURETYPE_UNSIGNED_INT},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureFormat",{get:function(){return this._texture&&void 0!==this._texture.format?this._texture.format:u.Constants.TEXTUREFORMAT_RGBA},enumerable:!0,configurable:!0}),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.getScene();if(!s)return null;var a=s.getEngine();return 0!=t&&(i/=Math.pow(2,t),o/=Math.pow(2,t),i=Math.round(i),o=Math.round(o)),this._texture.isCube?a._readTexturePixels(this._texture,i,o,e,t,r):a._readTexturePixels(this._texture,i,o,-1,t,r)},e.prototype.releaseInternalTexture=function(){this._texture&&(this._texture.dispose(),this._texture=null)},Object.defineProperty(e.prototype,"sphericalPolynomial",{get:function(){return this._texture&&a.CubeMapToSphericalPolynomialTools&&this.isReady()?(this._texture._sphericalPolynomial||(this._texture._sphericalPolynomial=a.CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this)),this._texture._sphericalPolynomial):null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_lodTextureHigh",{get:function(){return this._texture?this._texture._lodTextureHigh:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_lodTextureMid",{get:function(){return this._texture?this._texture._lodTextureMid:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_lodTextureLow",{get:function(){return this._texture?this._texture._lodTextureLow:null},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){if(this._scene){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),void 0!==this._texture&&(this.releaseInternalTexture(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear())}},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{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.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,n.__decorate([Object(i.serialize)()],e.prototype,"uniqueId",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"name",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"metadata",void 0),n.__decorate([Object(i.serialize)("hasAlpha")],e.prototype,"_hasAlpha",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"getAlphaFromRGB",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"level",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"coordinatesIndex",void 0),n.__decorate([Object(i.serialize)("coordinatesMode")],e.prototype,"_coordinatesMode",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"wrapU",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"wrapV",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"wrapR",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"anisotropicFilteringLevel",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"isCube",null),n.__decorate([Object(i.serialize)()],e.prototype,"is3D",null),n.__decorate([Object(i.serialize)()],e.prototype,"gammaSpace",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"invertZ",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"lodLevelInAlpha",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"lodGenerationOffset",null),n.__decorate([Object(i.serialize)()],e.prototype,"lodGenerationScale",null),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 c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math */"./Maths/math.ts"),o=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),c=function(e){function t(t,r){var n=e.call(this,r)||this;return t?(n._engine=r.getEngine(),n._textureMatrix=i.Matrix.Identity(),n.name=t,n.url=t,n.hasAlpha=!1,n.isCube=!1,n.is3D=n._engine.webGLVersion>1,n.wrapU=s.Constants.TEXTURE_CLAMP_ADDRESSMODE,n.wrapV=s.Constants.TEXTURE_CLAMP_ADDRESSMODE,n.wrapR=s.Constants.TEXTURE_CLAMP_ADDRESSMODE,n.anisotropicFilteringLevel=1,n._texture=n._getFromCache(t,!0),n._texture||(r.useDelayedTextureLoading?n.delayLoadState=s.Constants.DELAYLOADSTATE_NOTLOADED:n.loadTexture()),n):n}return n.__extends(t,e),t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.load3dlTexture=function(){var e,r=this._engine;e=1===r.webGLVersion?r.createRawTexture(null,1,1,s.Constants.TEXTUREFORMAT_RGBA,!1,!1,s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE):r.createRawTexture3D(null,1,1,1,s.Constants.TEXTUREFORMAT_RGBA,!1,!1,s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE),this._texture=e;var n=function(n){if("string"==typeof n){for(var i,o=null,a=null,c=n.split("\n"),l=0,u=0,h=0,d=0,f=0,p=0;p<c.length;p++)if(i=c[p],t._noneEmptyLineRegex.test(i)&&0!==i.indexOf("#")){var g=i.split(" ");if(0!==l){if(0!=l){var m=Math.max(parseInt(g[0]),0),_=Math.max(parseInt(g[1]),0),v=Math.max(parseInt(g[2]),0);f=Math.max(m,f),f=Math.max(_,f),f=Math.max(v,f);var A=4*(u+d*l+h*l*l);a&&(a[A+0]=m,a[A+1]=_,a[A+2]=v),++h%l==0&&(h=0,++d%l==0&&(u++,d=0))}}else l=g.length,o=new Uint8Array(l*l*l*4),a=new Float32Array(l*l*l*4)}if(a&&o)for(p=0;p<a.length;p++)if(p>0&&(p+1)%4==0)o[p]=255;else{var y=a[p];o[p]=y/f*255}e.is3D?(e.updateSize(l,l,l),r.updateRawTexture3D(e,o,s.Constants.TEXTUREFORMAT_RGBA,!1)):(e.updateSize(l*l,l),r.updateRawTexture(e,o,s.Constants.TEXTUREFORMAT_RGBA,!1))}},i=this.getScene();return i?i._loadFile(this.url,n):this._engine._loadFile(this.url,n),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());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"]=c},"./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 h});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 */"./Maths/math.ts"),a=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),c=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../../Engines/constants */"./Engines/constants.ts"),u=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),h=function(e){function t(t,r,n,i,a,u,h,d,f,p,g,m,_){void 0===n&&(n=null),void 0===i&&(i=!1),void 0===a&&(a=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===d&&(d=l.Constants.TEXTUREFORMAT_RGBA),void 0===f&&(f=!1),void 0===p&&(p=null),void 0===g&&(g=!1),void 0===m&&(m=.8),void 0===_&&(_=0);var v=e.call(this,r)||this;if(v.boundingBoxPosition=s.Vector3.Zero(),v._rotationY=0,v._prefiltered=!1,v.name=t,v.url=t,v._noMipmap=i,v.hasAlpha=!1,v._format=d,v.isCube=!0,v._textureMatrix=s.Matrix.Identity(),v._createPolynomials=g,v.coordinatesMode=c.Texture.CUBIC_MODE,!t&&!a)return v;var A=t.lastIndexOf("."),y=p||(A>-1?t.substring(A).toLowerCase():""),b=".dds"===y,T=".env"===y;if(T?(v.gammaSpace=!1,v._prefiltered=!1):(v._prefiltered=f,f&&(v.gammaSpace=!1)),v._texture=v._getFromCache(t,i),!a&&(T||b||n||(n=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),a=[],n))for(var E=0;E<n.length;E++)a.push(t+n[E]);return v._files=a,v._texture?u&&(v._texture.isReady?o.Tools.SetImmediate(function(){return u()}):v._texture.onLoadedObservable.add(u)):r.useDelayedTextureLoading?v.delayLoadState=l.Constants.DELAYLOADSTATE_NOTLOADED:v._texture=f?r.getEngine().createPrefilteredCubeTexture(t,r,m,_,u,h,d,p,v._createPolynomials):r.getEngine().createCubeTexture(t,r,a,i,u,h,v._format,p,!1,m,_),v}return 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(l.Constants.MATERIAL_TextureDirtyFlag)}},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"noMipmap",{get:function(){return this._noMipmap},enumerable:!0,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){return void 0===n&&(n=null),void 0===i&&(i=!0),new t(e,r,null,!1,null,null,null,void 0,!0,n,i)},t.prototype.getClassName=function(){return"CubeTexture"},t.prototype.updateURL=function(e,t,r){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag)),this.url=e,this.delayLoadState=l.Constants.DELAYLOADSTATE_NOTLOADED,this._prefiltered=!1,r&&(this._delayedOnLoad=r),this.delayLoad(t)},t.prototype.delayLoad=function(e){if(this.delayLoadState===l.Constants.DELAYLOADSTATE_NOTLOADED){var t=this.getScene();t&&(this.delayLoadState=l.Constants.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap),this._texture||(this._prefiltered?this._texture=t.getEngine().createPrefilteredCubeTexture(this.url,t,this.lodGenerationScale,this.lodGenerationOffset,this._delayedOnLoad,void 0,this._format,void 0,this._createPolynomials):this._texture=t.getEngine().createCubeTexture(this.url,t,this._files,this._noMipmap,this._delayedOnLoad,void 0,this._format,e)))}},t.prototype.getReflectionTextureMatrix=function(){return this._textureMatrix},t.prototype.setReflectionTextureMatrix=function(e){var t=this;e.updateFlag!==this._textureMatrix.updateFlag&&(e.isIdentity()!==this._textureMatrix.isIdentity()&&this.getScene().markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag,function(e){return-1!==e.getActiveTextures().indexOf(t)}),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,null,null,null,void 0,i)},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 c=e.animations[a],l=u._TypeStore.GetClass("BABYLON.Animation");l&&o.animations.push(l.Parse(c))}return o},t.prototype.clone=function(){var e=this,r=this.getScene(),n=0,o=i.SerializationHelper.Clone(function(){if(!r)return e;var i=new t(e.url,r,e._extensions,e._noMipmap,e._files);return n=i.uniqueId,i},this);return o.uniqueId=n,o},n.__decorate([Object(i.serialize)("rotationY")],t.prototype,"rotationY",null),n.__decorate([Object(i.serializeAsMatrix)("textureMatrix")],t.prototype,"_textureMatrix",void 0),t}(a.BaseTexture);c.Texture._CubeTextureParser=h.Parse,u._TypeStore.RegisteredTypes["BABYLON.CubeTexture"]=h},"./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 a});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=function(e){function t(t,r,n,i,a,c){void 0===n&&(n=null),void 0===a&&(a=s.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===c&&(c=s.Constants.TEXTUREFORMAT_RGBA);var l=e.call(this,null,n,!i,void 0,a,void 0,void 0,void 0,void 0,c)||this;l.name=t,l._engine=l.getScene().getEngine(),l.wrapU=o.Texture.CLAMP_ADDRESSMODE,l.wrapV=o.Texture.CLAMP_ADDRESSMODE,l._generateMipMaps=i,r.getContext?(l._canvas=r,l._texture=l._engine.createDynamicTexture(r.width,r.height,i,a)):(l._canvas=document.createElement("canvas"),r.width||0===r.width?l._texture=l._engine.createDynamicTexture(r.width,r.height,i,a):l._texture=l._engine.createDynamicTexture(r,r,i,a));var u=l.getSize();return l._canvas.width=u.width,l._canvas.height=u.height,l._context=l._canvas.getContext("2d"),l}return n.__extends(t,e),t.prototype.getClassName=function(){return"DynamicTexture"},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype._recreate=function(e){this._canvas.width=e.width,this._canvas.height=e.height,this.releaseInternalTexture(),this._texture=this._engine.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._engine.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 c=this.getSize();if(o&&(this._context.fillStyle=o,this._context.fillRect(0,0,c.width,c.height)),this._context.font=n,null==t){var l=this._context.measureText(e);t=(c.width-l.width)/2}if(null==r){var u=parseInt(n.replace(/\D/g,""));r=c.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 r.base64String=this._canvas.toDataURL(),r.invertY=this._invertY,r.samplingMode=this.samplingMode,r},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(/*! ../../Engines/engine */"./Engines/engine.ts"),s=r(/*! ./baseTexture */"./Materials/Textures/baseTexture.ts"),a=r(/*! ./texture */"./Materials/Textures/texture.ts"),c=function(e){function t(t,r,n,i,s,c,l){void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===c&&(c=null),void 0===l&&(l=null);var u=e.call(this,r)||this;if(u._onLoad=null,u._onError=null,u.coordinatesMode=a.Texture.CUBIC_MODE,!t)throw new Error("Image url is not set");return u.name=t,u.url=t,u._size=n,u._noMipmap=i,u.gammaSpace=s,u._onLoad=c,u._onError=l,u.hasAlpha=!1,u.isCube=!0,u._texture=u._getFromCache(t,u._noMipmap),u._texture||(r.useDelayedTextureLoading?u.delayLoadState=o.Engine.DELAYLOADSTATE_NOTLOADED:u.loadImage(u.loadTexture.bind(u))),u}return n.__extends(t,e),t.prototype.loadImage=function(e){var t=this,r=document.createElement("canvas"),n=new Image;n.addEventListener("load",function(){t._width=n.width,t._height=n.height,r.width=t._width,r.height=t._height;var i=r.getContext("2d");i.drawImage(n,0,0);var o=i.getImageData(0,0,n.width,n.height);t._buffer=o.data.buffer,r.remove(),e()}),n.src=this.url},t.prototype.loadTexture=function(){var e=this,r=this.getScene();r&&(this._texture=r.getEngine().createRawCubeTextureFromUrl(this.url,r,this._size,o.Engine.TEXTUREFORMAT_RGB,r.getEngine().getCaps().textureFloat?o.Engine.TEXTURETYPE_FLOAT:o.Engine.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}(s.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 d});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math */"./Maths/math.ts"),o=r(/*! ../../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),a=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ../../Engines/constants */"./Engines/constants.ts"),l=r(/*! ../../Misc/HighDynamicRange/hdr */"./Misc/HighDynamicRange/hdr.ts"),u=r(/*! ../../Misc/HighDynamicRange/cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts"),h=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),d=function(e){function t(t,r,n,s,c,l,u,h,d){void 0===s&&(s=!1),void 0===c&&(c=!0),void 0===l&&(l=!1),void 0===u&&(u=!1),void 0===h&&(h=null),void 0===d&&(d=null);var f=e.call(this,r)||this;return f._generateHarmonics=!0,f._onLoad=null,f._onError=null,f.coordinatesMode=a.Texture.CUBIC_MODE,f._isBlocking=!0,f._rotationY=0,f.boundingBoxPosition=i.Vector3.Zero(),t?(f.name=t,f.url=t,f.hasAlpha=!1,f.isCube=!0,f._textureMatrix=i.Matrix.Identity(),f._onLoad=h,f._onError=d,f.gammaSpace=l,f._noMipmap=s,f._size=n,f._texture=f._getFromCache(t,f._noMipmap),f._texture||(r.useDelayedTextureLoading?f.delayLoadState=o.Engine.DELAYLOADSTATE_NOTLOADED:f.loadTexture()),f):f}return n.__extends(t,e),Object.defineProperty(t.prototype,"isBlocking",{get:function(){return this._isBlocking},set:function(e){this._isBlocking=e},enumerable:!0,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:!0,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(c.Constants.MATERIAL_TextureDirtyFlag)}},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"HDRCubeTexture"},t.prototype.loadTexture=function(){var e=this,r=this.getScene();r&&(this._texture=r.getEngine().createRawCubeTextureFromUrl(this.url,r,this._size,o.Engine.TEXTUREFORMAT_RGB,r.getEngine().getCaps().textureFloat?o.Engine.TEXTURETYPE_FLOAT:o.Engine.TEXTURETYPE_UNSIGNED_INT,this._noMipmap,function(r){e.lodGenerationOffset=0,e.lodGenerationScale=.8;var n=e.getScene();if(!n)return null;var o=l.HDRTools.GetCubeMapTextureData(r,e._size);if(e._generateHarmonics){var s=u.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial(o);e.sphericalPolynomial=s}for(var a=[],c=null,h=0;h<6;h++){if(!n.getEngine().getCaps().textureFloat){var d=new ArrayBuffer(e._size*e._size*3);c=new Uint8Array(d)}var f=o[t._facesMapping[h]];if(e.gammaSpace||c)for(var p=0;p<e._size*e._size;p++)if(e.gammaSpace&&(f[3*p+0]=Math.pow(f[3*p+0],i.ToGammaSpace),f[3*p+1]=Math.pow(f[3*p+1],i.ToGammaSpace),f[3*p+2]=Math.pow(f[3*p+2],i.ToGammaSpace)),c){var g=Math.max(255*f[3*p+0],0),m=Math.max(255*f[3*p+1],0),_=Math.max(255*f[3*p+2],0),v=Math.max(Math.max(g,m),_);if(v>255){var A=255/v;g*=A,m*=A,_*=A}c[3*p+0]=g,c[3*p+1]=m,c[3*p+2]=_}c?a.push(c):a.push(f)}return a},null,this._onLoad,this._onError))},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var r=new t(this.url,e,this._size,this._noMipmap,this._generateHarmonics,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.prototype.delayLoad=function(){this.delayLoadState===o.Engine.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=o.Engine.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=this;this._textureMatrix=e,e.updateFlag!==this._textureMatrix.updateFlag&&e.isIdentity()!==this._textureMatrix.isIdentity()&&this.getScene().markAllMaterialsAsDirty(c.Constants.MATERIAL_TextureDirtyFlag,function(e){return-1!==e.getActiveTextures().indexOf(t)})},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}(s.BaseTexture);h._TypeStore.RegisteredTypes["BABYLON.HDRCubeTexture"]=d},"./Materials/Textures/index.ts":
- /*!*************************************!*\
- !*** ./Materials/Textures/index.ts ***!
- \*************************************/
- /*! exports provided: BaseTexture, CubeTexture, InternalTexture, MirrorTexture, RawTexture, RenderTargetTexture, MultiviewRenderTarget, Texture, ColorGradingTexture, DynamicTexture, EquiRectangularCubeTexture, HDRCubeTexture, DummyInternalTextureTracker, MultiRenderTarget, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTexture, ProceduralTextureSceneComponent */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});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 c=r(/*! ./hdrCubeTexture */"./Materials/Textures/hdrCubeTexture.ts");r.d(t,"HDRCubeTexture",function(){return c.HDRCubeTexture});var l=r(/*! ./internalTexture */"./Materials/Textures/internalTexture.ts");r.d(t,"InternalTexture",function(){return l.InternalTexture});var u=r(/*! ./internalTextureTracker */"./Materials/Textures/internalTextureTracker.ts");r.d(t,"DummyInternalTextureTracker",function(){return u.DummyInternalTextureTracker});var h=r(/*! ./Loaders/index */"./Materials/Textures/Loaders/index.ts");r.d(t,"_DDSTextureLoader",function(){return h._DDSTextureLoader}),r.d(t,"_ENVTextureLoader",function(){return h._ENVTextureLoader}),r.d(t,"_KTXTextureLoader",function(){return h._KTXTextureLoader}),r.d(t,"_TGATextureLoader",function(){return h._TGATextureLoader});var d=r(/*! ./mirrorTexture */"./Materials/Textures/mirrorTexture.ts");r.d(t,"MirrorTexture",function(){return d.MirrorTexture});var f=r(/*! ./multiRenderTarget */"./Materials/Textures/multiRenderTarget.ts");r.d(t,"MultiRenderTarget",function(){return f.MultiRenderTarget});var p=r(/*! ./Procedurals/index */"./Materials/Textures/Procedurals/index.ts");r.d(t,"CustomProceduralTexture",function(){return p.CustomProceduralTexture}),r.d(t,"NoiseProceduralTexture",function(){return p.NoiseProceduralTexture}),r.d(t,"ProceduralTexture",function(){return p.ProceduralTexture}),r.d(t,"ProceduralTextureSceneComponent",function(){return p.ProceduralTextureSceneComponent});var g=r(/*! ./rawCubeTexture */"./Materials/Textures/rawCubeTexture.ts");r.d(t,"RawCubeTexture",function(){return g.RawCubeTexture});var m=r(/*! ./rawTexture */"./Materials/Textures/rawTexture.ts");r.d(t,"RawTexture",function(){return m.RawTexture});var _=r(/*! ./rawTexture3D */"./Materials/Textures/rawTexture3D.ts");r.d(t,"RawTexture3D",function(){return _.RawTexture3D});var v=r(/*! ./refractionTexture */"./Materials/Textures/refractionTexture.ts");r.d(t,"RefractionTexture",function(){return v.RefractionTexture});var A=r(/*! ./renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts");r.d(t,"RenderTargetTexture",function(){return A.RenderTargetTexture}),r.d(t,"MultiviewRenderTarget",function(){return A.MultiviewRenderTarget});var y=r(/*! ./texture */"./Materials/Textures/texture.ts");r.d(t,"Texture",function(){return y.Texture});var b=r(/*! ./videoTexture */"./Materials/Textures/videoTexture.ts");r.d(t,"VideoTexture",function(){return b.VideoTexture})},"./Materials/Textures/internalTexture.ts":
- /*!***********************************************!*\
- !*** ./Materials/Textures/internalTexture.ts ***!
- \***********************************************/
- /*! exports provided: InternalTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"InternalTexture",function(){return a});var n=r(/*! ../../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../../Misc/devTools */"./Misc/devTools.ts"),a=function(){function e(t,r,i){void 0===i&&(i=!1),this.onLoadedObservable=new n.Observable,this.previous=null,this.next=null,this._invertVScale=!1,this._initialSlot=-1,this._designatedSlot=-1,this._dataSource=e.DATASOURCE_UNKNOWN,this._comparisonFunction=0,this._sphericalPolynomial=null,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._isRGBD=!1,this._references=1,this._engine=t,this._dataSource=r,i||(this._webGLTexture=t._createTexture())}return e.prototype.getEngine=function(){return this._engine},Object.defineProperty(e.prototype,"dataSource",{get:function(){return this._dataSource},enumerable:!0,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._dataSource){case e.DATASOURCE_TEMP:return;case e.DATASOURCE_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 e.DATASOURCE_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 e.DATASOURCE_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 e.DATASOURCE_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 e.DATASOURCE_RENDERTARGET:var n=new i.RenderTargetCreationOptions;if(n.generateDepthBuffer=this._generateDepthBuffer,n.generateMipMaps=this.generateMipMaps,n.generateStencilBuffer=this._generateStencilBuffer,n.samplingMode=this.samplingMode,n.type=this.type,this.isCube)t=this._engine.createRenderTargetCubeTexture(this.width,n);else{var s={width:this.width,height:this.height};t=this._engine.createRenderTargetTexture(s,n)}return t._swapAndDie(this),void(this.isReady=!0);case e.DATASOURCE_DEPTHTEXTURE:var a={bilinearFiltering:this.samplingMode!==o.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,comparisonFunction:this._comparisonFunction,generateStencil:this._generateStencilBuffer,isCube:this.isCube};return(t=this._engine.createDepthStencilTexture({width:this.width,height:this.height},a))._swapAndDie(this),void(this.isReady=!0);case e.DATASOURCE_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 e.DATASOURCE_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 e.DATASOURCE_CUBERAW_RGBD: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 e.DATASOURCE_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),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);var t=this._engine.getLoadedTexturesCache(),r=t.indexOf(this);-1!==r&&t.splice(r,1)},e.prototype.dispose=function(){this._webGLTexture&&(this._references--,0===this._references&&(this._engine._releaseTexture(this),this._webGLTexture=null,this.previous=null,this.next=null))},e._UpdateRGBDAsync=function(e,t,r,n,i){throw s._DevTools.WarnImport("environmentTextureTools")},e.DATASOURCE_UNKNOWN=0,e.DATASOURCE_URL=1,e.DATASOURCE_TEMP=2,e.DATASOURCE_RAW=3,e.DATASOURCE_DYNAMIC=4,e.DATASOURCE_RENDERTARGET=5,e.DATASOURCE_MULTIRENDERTARGET=6,e.DATASOURCE_CUBE=7,e.DATASOURCE_CUBERAW=8,e.DATASOURCE_CUBEPREFILTERED=9,e.DATASOURCE_RAW3D=10,e.DATASOURCE_DEPTHTEXTURE=11,e.DATASOURCE_CUBERAW_RGBD=12,e}()},"./Materials/Textures/internalTextureTracker.ts":
- /*!******************************************************!*\
- !*** ./Materials/Textures/internalTextureTracker.ts ***!
- \******************************************************/
- /*! exports provided: DummyInternalTextureTracker */function(e,t,r){"use strict";r.r(t),r.d(t,"DummyInternalTextureTracker",function(){return n});var n=function(){return function(){this.previous=null,this.next=null}}()},"./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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math */"./Maths/math.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"),c=r(/*! ../../Engines/constants */"./Engines/constants.ts"),l=function(e){function t(t,r,n,s,a,l,u){void 0===a&&(a=c.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=o.Texture.BILINEAR_SAMPLINGMODE),void 0===u&&(u=!0);var h=e.call(this,t,r,n,s,!0,a,!1,l,u)||this;return h.scene=n,h.mirrorPlane=new i.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,delete n.clipPlane}),h}return 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"adaptiveBlurKernel",{set:function(e){this._adaptiveBlurKernel=e,this._autoComputeBlurKernel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernel",{set:function(e){this.blurKernelX=e,this.blurKernelY=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelX",{get:function(){return this._blurKernelX},set:function(e){this._blurKernelX!==e&&(this._blurKernelX=e,this._preparePostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelY",{get:function(){return this._blurKernelY},set:function(e){this._blurKernelY!==e&&(this._blurKernelY=e,this._preparePostProcesses())},enumerable:!0,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?c.Constants.TEXTURETYPE_FLOAT:c.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 l(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=function(e){function t(t,r,n,o,a){var c=this,l=!(!a||!a.generateMipMaps)&&a.generateMipMaps,u=!(!a||!a.generateDepthTexture)&&a.generateDepthTexture,h=!a||void 0===a.doNotChangeAspectRatio||a.doNotChangeAspectRatio;if((c=e.call(this,t,r,o,l,h)||this)._engine=o.getEngine(),c.isSupported){for(var d=[],f=[],p=0;p<n;p++)a&&a.types&&void 0!==a.types[p]?d.push(a.types[p]):d.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 g=!a||void 0===a.generateDepthBuffer||a.generateDepthBuffer,m=!(!a||void 0===a.generateStencilBuffer)&&a.generateStencilBuffer;return c._size=r,c._multiRenderTargetOptions={samplingModes:f,generateMipMaps:l,generateDepthBuffer:g,generateStencilBuffer:m,generateDepthTexture:u,types:d,textureCount:n},c._createInternalTextures(),c._createTextures(),c}c.dispose()}return n.__extends(t,e),Object.defineProperty(t.prototype,"isSupported",{get:function(){return this._engine.webGLVersion>1||this._engine.getCaps().drawBuffersExtension},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textures",{get:function(){return this._textures},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"depthTexture",{get:function(){return this._textures[this._textures.length-1]},enumerable:!0,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:!0,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:!0,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]},t.prototype._createInternalTextures=function(){this._internalTextures=this._engine.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._engine.updateMultipleRenderTargetTextureSampleCount(this._internalTextures,e))},enumerable:!0,configurable:!0}),t.prototype.resize=function(e){this.releaseInternalTextures(),this._internalTextures=this._engine.createMultipleRenderTarget(e,this._multiRenderTargetOptions),this._createInternalTextures()},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 l});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(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ../../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),c=r(/*! ../../Engines/constants */"./Engines/constants.ts"),l=function(e){function t(t,r,n,i,o,s,a,l,u){void 0===i&&(i=c.Constants.TEXTUREFORMAT_RGBA),void 0===o&&(o=c.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===l&&(l=c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===u&&(u=null);var h=e.call(this,"",t)||this;return h._texture=t.getEngine().createRawCubeTexture(r,n,i,o,s,a,l,u),h}return 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.dataSource===s.InternalTexture.DATASOURCE_CUBERAW_RGBD&&i.updateRGBDAsync(n._bufferViewArrayArray,n._sphericalPolynomial,n._lodGenerationScale,n._lodGenerationOffset),i},this)},t._UpdateRGBDAsync=function(e,t,r,n,i){return e._dataSource=s.InternalTexture.DATASOURCE_CUBERAW_RGBD,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(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=function(e){function t(t,r,n,s,a,c,l,u,h){void 0===c&&(c=!0),void 0===l&&(l=!1),void 0===u&&(u=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===h&&(h=o.Constants.TEXTURETYPE_UNSIGNED_INT);var d=e.call(this,null,a,!c,l)||this;return d.format=s,d._engine=a.getEngine(),d._texture=a.getEngine().createRawTexture(t,r,n,s,c,l,u,null,h),d.wrapU=i.Texture.CLAMP_ADDRESSMODE,d.wrapV=i.Texture.CLAMP_ADDRESSMODE,d}return n.__extends(t,e),t.prototype.update=function(e){this._engine.updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,void 0,this._texture.type)},t.CreateLuminanceTexture=function(e,r,n,i,s,a,c){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===c&&(c=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,r,n,o.Constants.TEXTUREFORMAT_LUMINANCE,i,s,a,c)},t.CreateLuminanceAlphaTexture=function(e,r,n,i,s,a,c){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===c&&(c=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,r,n,o.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA,i,s,a,c)},t.CreateAlphaTexture=function(e,r,n,i,s,a,c){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===c&&(c=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),new t(e,r,n,o.Constants.TEXTUREFORMAT_ALPHA,i,s,a,c)},t.CreateRGBTexture=function(e,r,n,i,s,a,c,l){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===c&&(c=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===l&&(l=o.Constants.TEXTURETYPE_UNSIGNED_INT),new t(e,r,n,o.Constants.TEXTUREFORMAT_RGB,i,s,a,c,l)},t.CreateRGBATexture=function(e,r,n,i,s,a,c,l){return void 0===s&&(s=!0),void 0===a&&(a=!1),void 0===c&&(c=o.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===l&&(l=o.Constants.TEXTURETYPE_UNSIGNED_INT),new t(e,r,n,o.Constants.TEXTUREFORMAT_RGBA,i,s,a,c,l)},t.CreateRTexture=function(e,r,n,s,a,c,l,u){return void 0===a&&(a=!0),void 0===c&&(c=!1),void 0===l&&(l=i.Texture.TRILINEAR_SAMPLINGMODE),void 0===u&&(u=o.Constants.TEXTURETYPE_FLOAT),new t(e,r,n,o.Constants.TEXTUREFORMAT_R,s,a,c,l,u)},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(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=function(e){function t(t,r,n,s,a,c,l,u,h,d){void 0===l&&(l=!0),void 0===u&&(u=!1),void 0===h&&(h=i.Texture.TRILINEAR_SAMPLINGMODE),void 0===d&&(d=o.Constants.TEXTURETYPE_UNSIGNED_INT);var f=e.call(this,null,c,!l,u)||this;return f.format=a,f._engine=c.getEngine(),f._texture=c.getEngine().createRawTexture3D(t,r,n,s,a,l,u,h,void 0,d),f.is3D=!0,f}return n.__extends(t,e),t.prototype.update=function(e){this._texture&&this._engine.updateRawTexture3D(this._texture,e,this._texture.format,this._texture.invertY,void 0,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 */"./Maths/math.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(){delete n.clipPlane}),s}return 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(){return function(){}}()},"./Materials/Textures/renderTargetTexture.ts":
- /*!***************************************************!*\
- !*** ./Materials/Textures/renderTargetTexture.ts ***!
- \***************************************************/
- /*! exports provided: RenderTargetTexture, MultiviewRenderTarget */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderTargetTexture",function(){return d}),r.d(t,"MultiviewRenderTarget",function(){return f});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 */"./Maths/math.ts"),a=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),c=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../../PostProcesses/postProcessManager */"./PostProcesses/postProcessManager.ts"),u=r(/*! ../../Rendering/renderingManager */"./Rendering/renderingManager.ts"),h=r(/*! ../../Engines/constants */"./Engines/constants.ts"),d=function(e){function t(t,r,n,o,a,l,d,f,p,g,m,_,v){void 0===a&&(a=!0),void 0===l&&(l=h.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1),void 0===f&&(f=c.Texture.TRILINEAR_SAMPLINGMODE),void 0===p&&(p=!0),void 0===g&&(g=!1),void 0===m&&(m=!1),void 0===_&&(_=h.Constants.TEXTUREFORMAT_RGBA),void 0===v&&(v=!1);var A=e.call(this,null,n,!o)||this;return A.isCube=d,A.renderParticles=!0,A.renderSprites=!1,A.coordinatesMode=c.Texture.PROJECTION_MODE,A.ignoreCameraViewport=!1,A.onBeforeBindObservable=new i.Observable,A.onAfterUnbindObservable=new i.Observable,A.onBeforeRenderObservable=new i.Observable,A.onAfterRenderObservable=new i.Observable,A.onClearObservable=new i.Observable,A._currentRefreshId=-1,A._refreshRate=1,A._samples=1,A.boundingBoxPosition=s.Vector3.Zero(),(n=A.getScene())?(A.renderList=new Array,A._engine=n.getEngine(),A.name=t,A.isRenderTarget=!0,A._initialSizeParameter=r,A._processSizeParameter(r),A._resizeObserver=A.getScene().getEngine().onResizeObservable.add(function(){}),A._generateMipMaps=!!o,A._doNotChangeAspectRatio=a,A._renderingManager=new u.RenderingManager(n),A._renderingManager._useSceneAutoClearSetup=!0,m?A:(A._renderTargetOptions={generateMipMaps:o,type:l,format:_,samplingMode:f,generateDepthBuffer:p,generateStencilBuffer:g},f===c.Texture.NEAREST_SAMPLINGMODE&&(A.wrapU=c.Texture.CLAMP_ADDRESSMODE,A.wrapV=c.Texture.CLAMP_ADDRESSMODE),v||(d?(A._texture=n.getEngine().createRenderTargetCubeTexture(A.getRenderSize(),A._renderTargetOptions),A.coordinatesMode=c.Texture.INVCUBIC_MODE,A._textureMatrix=s.Matrix.Identity()):A._texture=n.getEngine().createRenderTargetTexture(A._size,A._renderTargetOptions)),A)):A}return 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:!0,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().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:!0,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onClear",{set:function(e){this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderTargetOptions",{get:function(){return this._renderTargetOptions},enumerable:!0,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(h.Constants.MATERIAL_TextureDirtyFlag)}},enumerable:!0,configurable:!0}),t.prototype.createDepthStencilTexture=function(e,t,r){if(void 0===e&&(e=0),void 0===t&&(t=!0),void 0===r&&(r=!1),this.getScene()){var n=this.getScene().getEngine();this.depthStencilTexture=n.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:r,isCube:this.isCube}),n.setFrameBufferDepthStencilTexture(this)}},t.prototype._processSizeParameter=function(e){e.ratio?(this._sizeRatio=e.ratio,this._size={width:this._bestReflectionRenderTargetDimension(this._engine.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(this._engine.getRenderHeight(),this._sizeRatio)}):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:!0,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:!0,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._currentRefreshId=1,!0):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},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.scale=function(e){var t=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){this.releaseInternalTexture();var t=this.getScene();t&&(this._processSizeParameter(e),this.isCube?this._texture=t.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._texture=t.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions))},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 c=a.meshes;for(i=0;i<c.length;i++){var l=c[i];this.renderListPredicate(l)&&this.renderList.push(l)}}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._renderingManager.reset();for(var u=this.renderList?this.renderList:a.getActiveMeshes().data,h=this.renderList?this.renderList.length:a.getActiveMeshes().length,d=a.getRenderId(),f=0;f<h;f++){if(l=u[f]){if(!l.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}l._preActivateForIntermediateRendering(d);var p=void 0;if(p=!(this.renderList||!r)&&0==(l.layerMask&r.layerMask),l.isEnabled()&&l.isVisible&&l.subMeshes&&!p){l._activate(d);for(var g=0;g<l.subMeshes.length;g++){var m=l.subMeshes[g];a._activeIndices.addCount(m.indexCount,!1),this._renderingManager.dispatch(m,l)}}}}for(var _=0;_<a.particleSystems.length;_++){var v=a.particleSystems[_],A=v.emitter;v.isStarted()&&A&&A.position&&A.isEnabled()&&(u.indexOf(A)>=0&&this._renderingManager.dispatchParticles(v))}if(this.isCube)for(var y=0;y<6;y++)this.renderToTarget(y,u,e,t),a.incrementRenderId(),a.resetCachedMaterial();else this.renderToTarget(0,u,e,t);this.onAfterUnbindObservable.notifyObservers(this),a.activeCamera&&(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=o.Tools.NearestPOT(r+16384/(128+r));return Math.min(o.Tools.FloorPOT(e),n)},t.prototype._bindFrameBuffer=function(e){void 0===e&&(e=0);var t=this.getScene();if(t){var r=t.getEngine();this._texture&&r.bindFramebuffer(this._texture,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,this.depthStencilTexture?this.depthStencilTexture:void 0)}},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){var i=this.getScene();if(i){var s=i.getEngine();if(this._texture){this._postProcessManager?this._postProcessManager._prepareFrame(this._texture,this._postProcesses):r&&i.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(e),this.onBeforeRenderObservable.notifyObservers(e),this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(s):s.clear(this.clearColor||i.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||i.updateTransformMatrix(!0);for(var a=0,c=i._beforeRenderTargetDrawStage;a<c.length;a++){c[a].action(this)}this._renderingManager.render(this.customRenderFunction,t,this.renderParticles,this.renderSprites);for(var l=0,u=i._afterRenderTargetDrawStage;l<u.length;l++){u[l].action(this)}this._postProcessManager?this._postProcessManager._finalizeFrame(!1,this._texture,e,this._postProcesses,this.ignoreCameraViewport):r&&i.postProcessManager._finalizeFrame(!1,this._texture,e),this._doNotChangeAspectRatio||i.updateTransformMatrix(!0),n&&o.Tools.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),s),this.isCube&&5!==e?this.onAfterRenderObservable.notifyObservers(e):(this.isCube&&5===e&&s.generateMipMapsForCubemap(this._texture),this.unbindFrameBuffer(s,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._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)}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}(c.Texture);c.Texture._CreateRenderTargetTexture=function(e,t,r,n){return new d(e,t,r,n)};var f=function(e){function t(t,r){void 0===r&&(r=512);var n=e.call(this,"multiview rtt",r,t,!1,!0,a.InternalTexture.DATASOURCE_UNKNOWN,!1,void 0,!1,!1,!0,void 0,!0)||this,i=t.getEngine().createMultiviewRenderTargetTexture(n.getRenderWidth(),n.getRenderHeight());return i.isMultiview=!0,n._texture=i,n}return 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}(d)},"./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 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 */"./Maths/math.ts"),c=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),l=r(/*! ../../Engines/constants */"./Engines/constants.ts"),u=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),h=r(/*! ../../Misc/devTools */"./Misc/devTools.ts"),d=function(e){function t(r,n,i,a,c,u,h,d,f,p){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===c&&(c=t.TRILINEAR_SAMPLINGMODE),void 0===u&&(u=null),void 0===h&&(h=null),void 0===d&&(d=null),void 0===f&&(f=!1);var g=e.call(this,n)||this;if(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._initialSamplingMode=t.BILINEAR_SAMPLINGMODE,g.onLoadObservable=new o.Observable,g._isBlocking=!0,g.name=r||"",g.url=r,g._noMipmap=i,g._invertY=a,g._initialSamplingMode=c,g._buffer=d,g._deleteBuffer=f,p&&(g._format=p),!(n=g.getScene()))return g;n.getEngine().onBeforeTextureInitObservable.notifyObservers(g);var m=function(){g._texture&&g._texture._invertVScale&&(g.vScale=-1),g.onLoadObservable.hasObservers()&&g.onLoadObservable.notifyObservers(g),u&&u(),!g.isBlocking&&n&&n.resetCachedMaterial()};return g.url?(g._texture=g._getFromCache(g.url,i,c,a),g._texture?g._texture.isReady?s.Tools.SetImmediate(function(){return m()}):g._texture.onLoadedObservable.add(m):n.useDelayedTextureLoading?(g.delayLoadState=l.Constants.DELAYLOADSTATE_NOTLOADED,g._delayedOnLoad=m,g._delayedOnError=h):(g._texture=n.getEngine().createTexture(g.url,i,a,n,c,m,h,g._buffer,void 0,g._format),f&&delete g._buffer),g):(g._delayedOnLoad=m,g._delayedOnError=h,g)}return n.__extends(t,e),Object.defineProperty(t.prototype,"noMipmap",{get:function(){return this._noMipmap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBlocking",{get:function(){return this._isBlocking},set:function(e){this._isBlocking=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"samplingMode",{get:function(){return this._texture?this._texture.samplingMode:this._initialSamplingMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invertY",{get:function(){return this._invertY},enumerable:!0,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.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?s.Tools.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),this._deleteBuffer&&delete this._buffer),this._delayedOnLoad=null,this._delayedOnError=null)}},t.prototype._prepareRowForTextureGeneration=function(e,t,r,n){e*=this.uScale,t*=this.vScale,e-=this.uRotationCenter*this.uScale,t-=this.vRotationCenter*this.vScale,r-=this.wRotationCenter,a.Vector3.TransformCoordinatesFromFloatsToRef(e,t,r,this._rowGenerationMatrix,n),n.x+=this.uRotationCenter*this.uScale+this.uOffset,n.y+=this.vRotationCenter*this.vScale+this.vOffset,n.z+=this.wRotationCenter},t.prototype.getTextureMatrix=function(){var e=this;if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale===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,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedTextureMatrix||(this._cachedTextureMatrix=a.Matrix.Zero(),this._rowGenerationMatrix=new a.Matrix,this._t0=a.Vector3.Zero(),this._t1=a.Vector3.Zero(),this._t2=a.Vector3.Zero()),a.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),a.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 t=this.getScene();return t?(t.markAllMaterialsAsDirty(l.Constants.MATERIAL_TextureDirtyFlag,function(t){return t.hasTexture(e)}),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=a.Matrix.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=a.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:a.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:a.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:a.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)},this)},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return"string"==typeof this._buffer&&"data:"===this._buffer.substr(0,5)&&(t.base64String=this._buffer,t.name=t.name.replace("data:","")),t.invertY=this._invertY,t.samplingMode=this.samplingMode,t},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=s.Tools.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 c=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=a.Plane.FromArray(e.mirrorPlane),s}if(e.isRenderTarget){var c=null;if(e.isCube){if(r.reflectionProbes)for(var l=0;l<r.reflectionProbes.length;l++){var u=r.reflectionProbes[l];if(u.name===e.name)return u.cubeTexture}}else(c=t._CreateRenderTargetTexture(e.name,e.renderTargetSize,r,o))._waitingRenderList=e.renderList;return c}if(e.base64String)i=t.CreateFromBase64String(e.base64String,e.name,r,!o);else{var h=n+e.name;t.UseSerializedUrlIfAny&&e.url&&(h=e.url),i=new t(h,r,!o,e.invertY)}return i},e,r);if(e.samplingMode){var l=e.samplingMode;c&&c.samplingMode!==l&&c.updateSamplingMode(l)}if(c&&e.animations)for(var h=0;h<e.animations.length;h++){var d=e.animations[h],f=u._TypeStore.GetClass("BABYLON.Animation");f&&c.animations.push(f.Parse(d))}return c},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,h){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===h&&(h=l.Constants.TEXTUREFORMAT_RGBA),"data:"!==e.substr(0,5)&&(e="data:"+e),new t(e,n,o,s,a,c,u,r,i,h)},t._CubeTextureParser=function(e,t,r){throw h._DevTools.WarnImport("CubeTexture")},t._CreateMirror=function(e,t,r,n){throw h._DevTools.WarnImport("MirrorTexture")},t._CreateRenderTargetTexture=function(e,t,r,n){throw h._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,n.__decorate([Object(i.serialize)()],t.prototype,"url",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"uOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"vOffset",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"uScale",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"vScale",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"uAng",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"vAng",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"wAng",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"uRotationCenter",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"vRotationCenter",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"wRotationCenter",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"isBlocking",null),t}(c.BaseTexture);i.SerializationHelper._TextureParser=d.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 c});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"),c=function(e){function t(t,r,n,i,s,c,l){void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===c&&(c=a.Texture.TRILINEAR_SAMPLINGMODE),void 0===l&&(l={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._createInternalTexture=function(){if(null!=u._texture){if(!u._displayingPosterTexture)return;u._texture.dispose(),u._displayingPosterTexture=!1}if(!u._engine.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._engine.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(){null!=u._texture&&u._texture.isReady&&(u.video.readyState<u.video.HAVE_CURRENT_DATA||u._displayingPosterTexture||u._engine.updateVideoTexture(u._texture,u.video,u._invertY))},u._engine=u.getScene().getEngine(),u._generateMipMaps=i,u._initialSamplingMode=c,u.autoUpdateTexture=l.autoUpdateTexture,u.name=t||u._getName(r),u.video=u._getVideo(r),u._settings=l,l.poster&&(u.video.poster=l.poster),void 0!==l.autoPlay&&(u.video.autoplay=l.autoPlay),void 0!==l.loop&&(u.video.loop=l.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=l.poster&&!l.autoPlay?"play":"canplay",u.video.addEventListener(u._createInternalTextureOnEvent,u._createInternalTexture);var h=u.video.readyState>=u.video.HAVE_CURRENT_DATA;return!l.poster||l.autoPlay&&h?h&&u._createInternalTexture():(u._texture=u._engine.createTexture(l.poster,!1,!0,n),u._displayingPosterTexture=!0),u}return n.__extends(t,e),Object.defineProperty(t.prototype,"onUserActionRequestedObservable",{get:function(){return this._onUserActionRequestedObservable||(this._onUserActionRequestedObservable=new i.Observable),this._onUserActionRequestedObservable},enumerable:!0,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},t.prototype.dispose=function(){e.prototype.dispose.call(this),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 */"./Maths/math.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalDensity",{get:function(){return this._globalDensity},set:function(e){this._globalDensity=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalSaturation",{get:function(){return this._globalSaturation},set:function(e){this._globalSaturation=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalExposure",{get:function(){return this._globalExposure},set:function(e){this._globalExposure=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"highlightsHue",{get:function(){return this._highlightsHue},set:function(e){this._highlightsHue=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"highlightsDensity",{get:function(){return this._highlightsDensity},set:function(e){this._highlightsDensity=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"highlightsSaturation",{get:function(){return this._highlightsSaturation},set:function(e){this._highlightsSaturation=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"highlightsExposure",{get:function(){return this._highlightsExposure},set:function(e){this._highlightsExposure=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"midtonesHue",{get:function(){return this._midtonesHue},set:function(e){this._midtonesHue=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"midtonesDensity",{get:function(){return this._midtonesDensity},set:function(e){this._midtonesDensity=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"midtonesSaturation",{get:function(){return this._midtonesSaturation},set:function(e){this._midtonesSaturation=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"midtonesExposure",{get:function(){return this._midtonesExposure},set:function(e){this._midtonesExposure=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowsHue",{get:function(){return this._shadowsHue},set:function(e){this._shadowsHue=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowsDensity",{get:function(){return this._shadowsDensity},set:function(e){this._shadowsDensity=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowsSaturation",{get:function(){return this._shadowsSaturation},set:function(e){this._shadowsSaturation=e,this._dirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadowsExposure",{get:function(){return this._shadowsExposure},set:function(e){this._shadowsExposure=e,this._dirty=!0},enumerable:!0,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 c=Math.floor(o),l=o-c,u=a*(1-s),h=a*(1-s*l),d=a*(1-s*(1-l));switch(c){case 0:i.r=a,i.g=d,i.b=u;break;case 1:i.r=h,i.g=a,i.b=u;break;case 2:i.r=u,i.g=a,i.b=d;break;case 3:i.r=u,i.g=h,i.b=a;break;case 4:i.r=d,i.g=u,i.b=a;break;default:i.r=a,i.g=u,i.b=h}}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)},n.__decorate([Object(i.serialize)()],e.prototype,"_globalHue",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_globalDensity",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_globalSaturation",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_globalExposure",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_highlightsHue",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_highlightsDensity",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_highlightsSaturation",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_highlightsExposure",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_midtonesHue",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_midtonesDensity",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_midtonesSaturation",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_midtonesExposure",void 0),e}();i.SerializationHelper._ColorCurvesParser=s.Parse},"./Materials/effect.ts":
- /*!*****************************!*\
- !*** ./Materials/effect.ts ***!
- \*****************************/
- /*! exports provided: EffectFallbacks, EffectCreationOptions, Effect */function(e,t,r){"use strict";r.r(t),r.d(t,"EffectFallbacks",function(){return a}),r.d(t,"EffectCreationOptions",function(){return c}),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=function(){function e(){this._defines={},this._currentRank=32,this._maxRank=-1}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,"isMoreFallbacks",{get:function(){return this._currentRank<=this._maxRank},enumerable:!0,configurable:!0}),e.prototype.reduce=function(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0&&this._mesh.material){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&&(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{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}(),c=function(){return function(){}}(),l=function(){function e(t,r,i,o,s,a,c,l,u,h){void 0===o&&(o=null),void 0===a&&(a=null),void 0===c&&(c=null),void 0===l&&(l=null),void 0===u&&(u=null);var d,f,p=this;if(this.uniqueId=0,this.onCompileObservable=new n.Observable,this.onErrorObservable=new n.Observable,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._isReady=!1,this._compilationError="",this.name=t,r.attributes){var g=r;if(this._engine=i,this._attributesNames=g.attributes,this._uniformsNames=g.uniformsNames.concat(g.samplers),this._samplers=g.samplers.slice(),this.defines=g.defines,this.onError=g.onError,this.onCompiled=g.onCompiled,this._fallbacks=g.fallbacks,this._indexParameters=g.indexParameters,this._transformFeedbackVaryings=g.transformFeedbackVaryings,g.uniformBuffersNames)for(var m=0;m<g.uniformBuffersNames.length;m++)this._uniformBuffersNames[g.uniformBuffersNames[m]]=m}else this._engine=s,this.defines=null==a?"":a,this._uniformsNames=i.concat(o),this._samplers=o?o.slice():[],this._attributesNames=r,this.onError=u,this.onCompiled=l,this._indexParameters=h,this._fallbacks=c;this.uniqueId=e._uniqueIdSeed++,t.vertexElement?(d=document.getElementById(t.vertexElement))||(d=t.vertexElement):d=t.vertex||t,t.fragmentElement?(f=document.getElementById(t.fragmentElement))||(f=t.fragmentElement):f=t.fragment||t,this._loadVertexShader(d,function(e){p._processIncludes(e,function(e){p._processShaderConversion(e,!1,function(e){p._loadFragmentShader(f,function(r){p._processIncludes(r,function(r){p._processShaderConversion(r,!0,function(r){if(t){var n=t.vertexElement||t.vertex||t,i=t.fragmentElement||t.fragment||t;p._vertexSourceCode="#define SHADER_NAME vertex:"+n+"\n"+e,p._fragmentSourceCode="#define SHADER_NAME fragment:"+i+"\n"+r}else p._vertexSourceCode=e,p._fragmentSourceCode=r;p._prepareEffect()})})})})})})}return Object.defineProperty(e.prototype,"onBindObservable",{get:function(){return this._onBindObservable||(this._onBindObservable=new n.Observable),this._onBindObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this._key},enumerable:!0,configurable:!0}),e.prototype.isReady=function(){return!this._isReady&&this._program&&this._program.isParallelCompiled?this._engine._isProgramCompiled(this._program):this._isReady},e.prototype.getEngine=function(){return this._engine},e.prototype.getProgram=function(){return this._program},e.prototype.getAttributesNames=function(){return this._attributesNames},e.prototype.getAttributeLocation=function(e){return this._attributes[e]},e.prototype.getAttributeLocationByName=function(e){var t=this._attributesNames.indexOf(e);return this._attributes[t]},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[this._uniformsNames.indexOf(e)]},e.prototype.getSamplers=function(){return this._samplers},e.prototype.getCompilationError=function(){return this._compilationError},e.prototype.executeWhenCompiled=function(e){var t=this;this.isReady()?e(this):(this.onCompileObservable.add(function(t){e(t)}),this._program&&!this._program.isParallelCompiled||setTimeout(function(){t._checkIsReady()},16))},e.prototype._checkIsReady=function(){var e=this;this.isReady()||setTimeout(function(){e._checkIsReady()},16)},e.prototype._loadVertexShader=function(t,r){var n;if(o.DomManagement.IsWindowObjectExist()&&t instanceof HTMLElement)return void r(o.DomManagement.GetDOMTextContent(t));"base64:"!==t.substr(0,7)?e.ShadersStore[t+"VertexShader"]?r(e.ShadersStore[t+"VertexShader"]):(n="."===t[0]||"/"===t[0]||t.indexOf("http")>-1?t:e.ShadersRepository+t,this._engine._loadFile(n+".vertex.fx",r)):r(window.atob(t.substr(7)))},e.prototype._loadFragmentShader=function(t,r){var n;if(o.DomManagement.IsWindowObjectExist()&&t instanceof HTMLElement)return void r(o.DomManagement.GetDOMTextContent(t));"base64:"!==t.substr(0,7)?e.ShadersStore[t+"PixelShader"]?r(e.ShadersStore[t+"PixelShader"]):e.ShadersStore[t+"FragmentShader"]?r(e.ShadersStore[t+"FragmentShader"]):(n="."===t[0]||"/"===t[0]||t.indexOf("http")>-1?t:e.ShadersRepository+t,this._engine._loadFile(n+".fragment.fx",r)):r(window.atob(t.substr(7)))},e.prototype._dumpShadersSource=function(e,t,r){var n=(this._engine.webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"")+(r?r+"\n":"");t=n+t;var i=2,o=/\n/gm,a="\n1\t"+(e=n+e).replace(o,function(){return"\n"+i+++"\t"});i=2;var c="\n1\t"+t.replace(o,function(){return"\n"+i+++"\t"});this.name.vertexElement?(s.Logger.Error("Vertex shader: "+this.name.vertexElement+a),s.Logger.Error("Fragment shader: "+this.name.fragmentElement+c)):this.name.vertex?(s.Logger.Error("Vertex shader: "+this.name.vertex+a),s.Logger.Error("Fragment shader: "+this.name.fragment+c)):(s.Logger.Error("Vertex shader: "+this.name+a),s.Logger.Error("Fragment shader: "+this.name+c))},e.prototype._processShaderConversion=function(e,t,r){var n=this._processPrecision(e);if(1!=this._engine.webGLVersion)if(-1===n.indexOf("#version 3")){var i=-1!==n.search(/#extension.+GL_EXT_draw_buffers.+require/),o=n.replace(/#extension.+(GL_OVR_multiview|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"");o=(o=(o=(o=o.replace(/varying(?![\n\r])\s/g,t?"in ":"out ")).replace(/attribute[ \t]/g,"in ")).replace(/[ \t]attribute/g," in")).replace(/texture2D\s*\(/g,"texture("),t&&(o=(o=(o=(o=(o=(o=(o=o.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,(i?"":"out vec4 glFragColor;\n")+"void main(")),-1!==this.defines.indexOf("#define MULTIVIEW\n")&&!t&&(o="#extension GL_OVR_multiview : require\nlayout (num_views = 2) in;\n"+o),r(o)}else r(n.replace("#version 300 es",""));else r(n)},e.prototype._processIncludes=function(t,r){for(var n=this,i=/#include<(.+)>(\((.*)\))*(\[(.*)\])*/g,o=i.exec(t),s=new String(t);null!=o;){var a=o[1];if(-1!==a.indexOf("__decl__")&&(a=a.replace(/__decl__/,""),this._engine.supportsUniformBuffers&&(a=(a=a.replace(/Vertex/,"Ubo")).replace(/Fragment/,"Ubo")),a+="Declaration"),!e.IncludesShadersStore[a]){var c=e.ShadersRepository+"ShadersInclude/"+a+".fx";return void this._engine._loadFile(c,function(t){e.IncludesShadersStore[a]=t,n._processIncludes(s,r)})}var l=e.IncludesShadersStore[a];if(o[2])for(var u=o[3].split(","),h=0;h<u.length;h+=2){var d=new RegExp(u[h],"g"),f=u[h+1];l=l.replace(d,f)}if(o[4]){var p=o[5];if(-1!==p.indexOf("..")){var g=p.split(".."),m=parseInt(g[0]),_=parseInt(g[1]),v=l.slice(0);l="",isNaN(_)&&(_=this._indexParameters[g[1]]);for(var A=m;A<_;A++)this._engine.supportsUniformBuffers||(v=v.replace(/light\{X\}.(\w*)/g,function(e,t){return t+"{X}"})),l+=v.replace(/\{X\}/g,A.toString())+"\n"}else this._engine.supportsUniformBuffers||(l=l.replace(/light\{X\}.(\w*)/g,function(e,t){return t+"{X}"})),l=l.replace(/\{X\}/g,p)}s=s.replace(o[0],l),o=i.exec(t)}r(s)},e.prototype._processPrecision=function(e){var t=this._engine._shouldUseHighPrecisionShader;return-1===e.indexOf("precision highp float")?e=t?"precision highp float;\n"+e:"precision mediump float;\n"+e:t||(e=e.replace("precision highp float","precision mediump float")),e},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(){for(var e=o.getEngine().scenes,t=0;t<e.length;t++)e[t].markAllMaterialsAsDirty(i.Constants.MATERIAL_AllDirtyFlag);r&&r(o._program)},this._fallbacks=null,this._prepareEffect()},e.prototype.getSpecificUniformLocations=function(e){return this._engine.getUniforms(this._program,e)},e.prototype._prepareEffect=function(){var e=this,t=this._attributesNames,r=this.defines,n=this._fallbacks;this._valueCache={};var i=this._program;try{var o=this._engine;this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._program=o.createRawShaderProgram(this._vertexSourceCodeOverride,this._fragmentSourceCodeOverride,void 0,this._transformFeedbackVaryings):this._program=o.createShaderProgram(this._vertexSourceCode,this._fragmentSourceCode,r,void 0,this._transformFeedbackVaryings),this._program.__SPECTOR_rebuildProgram=this._rebuildProgram.bind(this),o._executeWhenProgramIsCompiled(this._program,function(){if(o.supportsUniformBuffers)for(var r in e._uniformBuffersNames)e.bindUniformBlock(r,e._uniformBuffersNames[r]);var n;for(e._uniforms=o.getUniforms(e._program,e._uniformsNames),e._attributes=o.getAttributes(e._program,t),n=0;n<e._samplers.length;n++){null==e.getUniform(e._samplers[n])&&(e._samplers.splice(n,1),n--)}o.bindSamplers(e),e._compilationError="",e._isReady=!0,e.onCompiled&&e.onCompiled(e),e.onCompileObservable.notifyObservers(e),e.onCompileObservable.clear(),e._fallbacks&&e._fallbacks.unBindMesh(),i&&e.getEngine()._deleteProgram(i)}),this._program.isParallelCompiled&&this._checkIsReady()}catch(e){this._compilationError=e.message,s.Logger.Error("Unable to compile effect:"),s.Logger.Error("Uniforms: "+this._uniformsNames.map(function(e){return" "+e})),s.Logger.Error("Attributes: "+t.map(function(e){return" "+e})),s.Logger.Error("Error: "+this._compilationError),i&&(this._program=i,this._isReady=!0,this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this)),n&&n.isMoreFallbacks?(s.Logger.Error("Trying next fallback."),this.defines=n.reduce(this.defines,this),this._prepareEffect()):(this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())}},Object.defineProperty(e.prototype,"isSupported",{get:function(){return""===this._compilationError},enumerable:!0,configurable:!0}),e.prototype._bindTexture=function(e,t){this._engine._bindTexture(this._samplers.indexOf(e),t)},e.prototype.setTexture=function(e,t){this._engine.setTexture(this._samplers.indexOf(e),this.getUniform(e),t)},e.prototype.setDepthStencilTexture=function(e,t){this._engine.setDepthStencilTexture(this._samplers.indexOf(e),this.getUniform(e),t)},e.prototype.setTextureArray=function(e,t){if(-1===this._samplers.indexOf(e+"Ex"))for(var r=this._samplers.indexOf(e),n=1;n<t.length;n++)this._samplers.splice(r+n,0,e+"Ex");this._engine.setTextureArray(this._samplers.indexOf(e),this.getUniform(e),t)},e.prototype.setTextureFromPostProcess=function(e,t){this._engine.setTextureFromPostProcess(this._samplers.indexOf(e),t)},e.prototype.setTextureFromPostProcessOutput=function(e,t){this._engine.setTextureFromPostProcessOutput(this._samplers.indexOf(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)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)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)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._program,e,t)},e.prototype.setInt=function(e,t){var r=this._valueCache[e];return void 0!==r&&r===t?this:(this._valueCache[e]=t,this._engine.setInt(this.getUniform(e),t),this)},e.prototype.setIntArray=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray(this.getUniform(e),t),this},e.prototype.setIntArray2=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray2(this.getUniform(e),t),this},e.prototype.setIntArray3=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray3(this.getUniform(e),t),this},e.prototype.setIntArray4=function(e,t){return this._valueCache[e]=null,this._engine.setIntArray4(this.getUniform(e),t),this},e.prototype.setFloatArray=function(e,t){return this._valueCache[e]=null,this._engine.setFloatArray(this.getUniform(e),t),this},e.prototype.setFloatArray2=function(e,t){return this._valueCache[e]=null,this._engine.setFloatArray2(this.getUniform(e),t),this},e.prototype.setFloatArray3=function(e,t){return this._valueCache[e]=null,this._engine.setFloatArray3(this.getUniform(e),t),this},e.prototype.setFloatArray4=function(e,t){return this._valueCache[e]=null,this._engine.setFloatArray4(this.getUniform(e),t),this},e.prototype.setArray=function(e,t){return this._valueCache[e]=null,this._engine.setArray(this.getUniform(e),t),this},e.prototype.setArray2=function(e,t){return this._valueCache[e]=null,this._engine.setArray2(this.getUniform(e),t),this},e.prototype.setArray3=function(e,t){return this._valueCache[e]=null,this._engine.setArray3(this.getUniform(e),t),this},e.prototype.setArray4=function(e,t){return this._valueCache[e]=null,this._engine.setArray4(this.getUniform(e),t),this},e.prototype.setMatrices=function(e,t){return t?(this._valueCache[e]=null,this._engine.setMatrices(this.getUniform(e),t),this):this},e.prototype.setMatrix=function(e,t){return this._cacheMatrix(e,t)&&this._engine.setMatrix(this.getUniform(e),t),this},e.prototype.setMatrix3x3=function(e,t){return this._valueCache[e]=null,this._engine.setMatrix3x3(this.getUniform(e),t),this},e.prototype.setMatrix2x2=function(e,t){return this._valueCache[e]=null,this._engine.setMatrix2x2(this.getUniform(e),t),this},e.prototype.setFloat=function(e,t){var r=this._valueCache[e];return void 0!==r&&r===t?this:(this._valueCache[e]=t,this._engine.setFloat(this.getUniform(e),t),this)},e.prototype.setBool=function(e,t){var r=this._valueCache[e];return void 0!==r&&r===t?this:(this._valueCache[e]=t,this._engine.setBool(this.getUniform(e),t?1:0),this)},e.prototype.setVector2=function(e,t){return this._cacheFloat2(e,t.x,t.y)&&this._engine.setFloat2(this.getUniform(e),t.x,t.y),this},e.prototype.setFloat2=function(e,t,r){return this._cacheFloat2(e,t,r)&&this._engine.setFloat2(this.getUniform(e),t,r),this},e.prototype.setVector3=function(e,t){return this._cacheFloat3(e,t.x,t.y,t.z)&&this._engine.setFloat3(this.getUniform(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.getUniform(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.getUniform(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.getUniform(e),t,r,n,i),this},e.prototype.setColor3=function(e,t){return this._cacheFloat3(e,t.r,t.g,t.b)&&this._engine.setColor3(this.getUniform(e),t),this},e.prototype.setColor4=function(e,t,r){return this._cacheFloat4(e,t.r,t.g,t.b,r)&&this._engine.setColor4(this.getUniform(e),t,r),this},e.prototype.setDirectColor4=function(e,t){return this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&this._engine.setDirectColor4(this.getUniform(e),t),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._uniqueIdSeed=0,e._baseCache={},e.ShadersStore={},e.IncludesShadersStore={},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 c});var n=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=function(){function e(){this._isEnabled=!0,this.leftColor=i.Color3.White(),this.rightColor=i.Color3.Black(),this.bias=0,this.power=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:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.serialize=function(){var e={};return e.isEnabled=this.isEnabled,e.leftColor=this.leftColor.asArray(),e.rightColor=this.rightColor.asArray(),e.bias=this.bias,e.power=this.power,e},e.Parse=function(t){var r=new e;return r.isEnabled=t.isEnabled,r.leftColor=i.Color3.FromArray(t.leftColor),r.rightColor=i.Color3.FromArray(t.rightColor),r.bias=t.bias,r.power=t.power||1,r},e}();s.SerializationHelper._FresnelParametersParser=c.Parse},"./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 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(/*! ../Misc/tools */"./Misc/tools.ts"),a=r(/*! ../Maths/math */"./Maths/math.ts"),c=r(/*! ../Materials/materialDefines */"./Materials/materialDefines.ts"),l=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 n.__extends(t,e),t}(c.MaterialDefines),h=function(){function e(){this.colorCurves=new l.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingTexture",{get:function(){return this._colorGradingTexture},set:function(e){this._colorGradingTexture!==e&&(this._colorGradingTexture=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingEnabled",{get:function(){return this._colorGradingEnabled},set:function(e){this._colorGradingEnabled!==e&&(this._colorGradingEnabled=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingWithGreenDepth",{get:function(){return this._colorGradingWithGreenDepth},set:function(e){this._colorGradingWithGreenDepth!==e&&(this._colorGradingWithGreenDepth=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorGradingBGR",{get:function(){return this._colorGradingBGR},set:function(e){this._colorGradingBGR!==e&&(this._colorGradingBGR=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exposure",{get:function(){return this._exposure},set:function(e){this._exposure!==e&&(this._exposure=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"toneMappingEnabled",{get:function(){return this._toneMappingEnabled},set:function(e){this._toneMappingEnabled!==e&&(this._toneMappingEnabled=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"toneMappingType",{get:function(){return this._toneMappingType},set:function(e){this._toneMappingType!==e&&(this._toneMappingType=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contrast",{get:function(){return this._contrast},set:function(e){this._contrast!==e&&(this._contrast=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vignetteBlendMode",{get:function(){return this._vignetteBlendMode},set:function(e){this._vignetteBlendMode!==e&&(this._vignetteBlendMode=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vignetteEnabled",{get:function(){return this._vignetteEnabled},set:function(e){this._vignetteEnabled!==e&&(this._vignetteEnabled=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"applyByPostProcess",{get:function(){return this._applyByPostProcess},set:function(e){this._applyByPostProcess!==e&&(this._applyByPostProcess=e,this._updateParameters())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled!==e&&(this._isEnabled=e,this._updateParameters())},enumerable:!0,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&&l.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(void 0===t&&(t=1),this._colorCurvesEnabled&&this.colorCurves&&l.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=Math.tan(.5*this.vignetteCameraFov),o=i*t,a=Math.sqrt(o*i);o=s.Tools.Mix(o,a,this.vignetteStretch),i=s.Tools.Mix(i,a,this.vignetteStretch),e.setFloat4("vignetteSettings1",o,i,-o*this.vignetteCentreX,-i*this.vignetteCentreY);var c=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,c)}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);var u=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(u-1)/u,.5/u,u,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:!0,configurable:!0}),Object.defineProperty(e,"VIGNETTEMODE_OPAQUE",{get:function(){return this._VIGNETTEMODE_OPAQUE},enumerable:!0,configurable:!0}),e.TONEMAPPING_STANDARD=0,e.TONEMAPPING_ACES=1,e._VIGNETTEMODE_MULTIPLY=0,e._VIGNETTEMODE_OPAQUE=1,n.__decorate([Object(i.serializeAsColorCurves)()],e.prototype,"colorCurves",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_colorCurvesEnabled",void 0),n.__decorate([Object(i.serializeAsTexture)("colorGradingTexture")],e.prototype,"_colorGradingTexture",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_colorGradingEnabled",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_colorGradingWithGreenDepth",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_colorGradingBGR",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_exposure",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_toneMappingEnabled",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_toneMappingType",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_contrast",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"vignetteStretch",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"vignetteCentreX",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"vignetteCentreY",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"vignetteWeight",void 0),n.__decorate([Object(i.serializeAsColor4)()],e.prototype,"vignetteColor",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"vignetteCameraFov",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_vignetteBlendMode",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_vignetteEnabled",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_applyByPostProcess",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_isEnabled",void 0),e}();i.SerializationHelper._ImageProcessingConfigurationParser=h.Parse},"./Materials/index.ts":
- /*!****************************!*\
- !*** ./Materials/index.ts ***!
- \****************************/
- /*! exports provided: ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, InternalTexture, MirrorTexture, RawTexture, RenderTargetTexture, MultiviewRenderTarget, Texture, UniformBuffer, MaterialFlags, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, EquiRectangularCubeTexture, HDRCubeTexture, DummyInternalTextureTracker, MultiRenderTarget, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTexture, ProceduralTextureSceneComponent */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(/*! ./effect */"./Materials/effect.ts");r.d(t,"EffectFallbacks",function(){return o.EffectFallbacks}),r.d(t,"EffectCreationOptions",function(){return o.EffectCreationOptions}),r.d(t,"Effect",function(){return o.Effect});var s=r(/*! ./fresnelParameters */"./Materials/fresnelParameters.ts");r.d(t,"FresnelParameters",function(){return s.FresnelParameters});var a=r(/*! ./imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts");r.d(t,"ImageProcessingConfigurationDefines",function(){return a.ImageProcessingConfigurationDefines}),r.d(t,"ImageProcessingConfiguration",function(){return a.ImageProcessingConfiguration});var c=r(/*! ./material */"./Materials/material.ts");r.d(t,"Material",function(){return c.Material});var l=r(/*! ./materialDefines */"./Materials/materialDefines.ts");r.d(t,"MaterialDefines",function(){return l.MaterialDefines});var u=r(/*! ./materialHelper */"./Materials/materialHelper.ts");r.d(t,"MaterialHelper",function(){return u.MaterialHelper});var h=r(/*! ./multiMaterial */"./Materials/multiMaterial.ts");r.d(t,"MultiMaterial",function(){return h.MultiMaterial});var d=r(/*! ./PBR/index */"./Materials/PBR/index.ts");r.d(t,"PBRBaseMaterial",function(){return d.PBRBaseMaterial}),r.d(t,"PBRBaseSimpleMaterial",function(){return d.PBRBaseSimpleMaterial}),r.d(t,"PBRMaterial",function(){return d.PBRMaterial}),r.d(t,"PBRMetallicRoughnessMaterial",function(){return d.PBRMetallicRoughnessMaterial}),r.d(t,"PBRSpecularGlossinessMaterial",function(){return d.PBRSpecularGlossinessMaterial});var f=r(/*! ./pushMaterial */"./Materials/pushMaterial.ts");r.d(t,"PushMaterial",function(){return f.PushMaterial});var p=r(/*! ./shaderMaterial */"./Materials/shaderMaterial.ts");r.d(t,"ShaderMaterial",function(){return p.ShaderMaterial});var g=r(/*! ./standardMaterial */"./Materials/standardMaterial.ts");r.d(t,"StandardMaterialDefines",function(){return g.StandardMaterialDefines}),r.d(t,"StandardMaterial",function(){return g.StandardMaterial});var m=r(/*! ./Textures/index */"./Materials/Textures/index.ts");r.d(t,"BaseTexture",function(){return m.BaseTexture}),r.d(t,"CubeTexture",function(){return m.CubeTexture}),r.d(t,"InternalTexture",function(){return m.InternalTexture}),r.d(t,"MirrorTexture",function(){return m.MirrorTexture}),r.d(t,"RawTexture",function(){return m.RawTexture}),r.d(t,"RenderTargetTexture",function(){return m.RenderTargetTexture}),r.d(t,"MultiviewRenderTarget",function(){return m.MultiviewRenderTarget}),r.d(t,"Texture",function(){return m.Texture}),r.d(t,"ColorGradingTexture",function(){return m.ColorGradingTexture}),r.d(t,"DynamicTexture",function(){return m.DynamicTexture}),r.d(t,"EquiRectangularCubeTexture",function(){return m.EquiRectangularCubeTexture}),r.d(t,"HDRCubeTexture",function(){return m.HDRCubeTexture}),r.d(t,"DummyInternalTextureTracker",function(){return m.DummyInternalTextureTracker}),r.d(t,"MultiRenderTarget",function(){return m.MultiRenderTarget}),r.d(t,"RawCubeTexture",function(){return m.RawCubeTexture}),r.d(t,"RawTexture3D",function(){return m.RawTexture3D}),r.d(t,"RefractionTexture",function(){return m.RefractionTexture}),r.d(t,"VideoTexture",function(){return m.VideoTexture}),r.d(t,"_DDSTextureLoader",function(){return m._DDSTextureLoader}),r.d(t,"_ENVTextureLoader",function(){return m._ENVTextureLoader}),r.d(t,"_KTXTextureLoader",function(){return m._KTXTextureLoader}),r.d(t,"_TGATextureLoader",function(){return m._TGATextureLoader}),r.d(t,"CustomProceduralTexture",function(){return m.CustomProceduralTexture}),r.d(t,"NoiseProceduralTexture",function(){return m.NoiseProceduralTexture}),r.d(t,"ProceduralTexture",function(){return m.ProceduralTexture}),r.d(t,"ProceduralTextureSceneComponent",function(){return m.ProceduralTextureSceneComponent});var _=r(/*! ./uniformBuffer */"./Materials/uniformBuffer.ts");r.d(t,"UniformBuffer",function(){return _.UniformBuffer});var v=r(/*! ./materialFlags */"./Materials/materialFlags.ts");r.d(t,"MaterialFlags",function(){return v.MaterialFlags})},"./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(/*! ../Maths/math */"./Maths/math.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),u=r(/*! ./uniformBuffer */"./Materials/uniformBuffer.ts"),h=r(/*! ../Engines/constants */"./Engines/constants.ts"),d=r(/*! ../Misc/logger */"./Misc/logger.ts"),f=function(){function e(t,r,n){this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.onDisposeObservable=new s.Observable,this._alphaMode=h.Constants.ALPHA_COMBINE,this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.forceDepthWrite=!1,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this._wasPreviouslyReady=!1,this._fillMode=e.TriangleFillMode,this._indexInSceneMaterialArray=-1,this.name=t,this.id=t||o.Tools.RandomId(),this._scene=r||c.EngineStore.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.useRightHandedSystem?this.sideOrientation=e.ClockWiseSideOrientation:this.sideOrientation=e.CounterClockWiseSideOrientation,this._uniformBuffer=new u.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,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasRenderTargetTextures",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBindObservable",{get:function(){return this._onBindObservable||(this._onBindObservable=new s.Observable),this._onBindObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBind",{set:function(e){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onUnBindObservable",{get:function(){return this._onUnBindObservable||(this._onUnBindObservable=new s.Observable),this._onUnBindObservable},enumerable:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,configurable:!0}),e.prototype.freeze=function(){this.checkReadyOnlyOnce=!0},e.prototype.unfreeze=function(){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},e.prototype.needAlphaBlending=function(){return this.alpha<1},e.prototype.needAlphaBlendingForMesh=function(e){return this.needAlphaBlending()||e.visibility<1||e.hasVertexAlpha},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.markDirty=function(){this._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._shouldTurnAlphaTestOn=function(e){return!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()},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)}},e.prototype.unbind=function(){(this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.disableDepthWrite)&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState)},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){var i=this,o=n.__assign({clipPlane:!1},r),s=new l.BaseSubMesh,c=this.getScene(),u=function(){if(i._scene&&i._scene.getEngine()){s._materialDefines&&(s._materialDefines._renderId=-1);var r=c.clipPlane;o.clipPlane&&(c.clipPlane=new a.Plane(0,0,0,1)),i._storeEffectOnSubMeshes?i.isReadyForSubMesh(e,s)?t&&t(i):setTimeout(u,16):i.isReady()?t&&t(i):setTimeout(u,16),o.clipPlane&&(c.clipPlane=r)}};u()},e.prototype.forceCompilationAsync=function(e,t){var r=this;return new Promise(function(n){r.forceCompilation(e,function(){n()},t)})},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._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.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.material=null,this.releaseVertexArrayObject(a,e))}this._uniformBuffer.dispose(),e&&this._effect&&(this._storeEffectOnSubMeshes||n.getEngine()._releaseEffect(this._effect),this._effect=null),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear()},e.prototype.releaseVertexArrayObject=function(e,t){if(e.geometry){var r=e.geometry,n=this.getScene();if(this._storeEffectOnSubMeshes)for(var i=0,o=e.subMeshes;i<o.length;i++){var s=o[i];r._releaseVertexArrayObject(s._materialEffect),t&&s._materialEffect&&n.getEngine()._releaseEffect(s._materialEffect)}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 void d.Logger.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library.")}else e.customType="BABYLON.StandardMaterial";return o.Tools.Instantiate(e.customType).Parse(e,t,r)},e.TriangleFillMode=h.Constants.MATERIAL_TriangleFillMode,e.WireFrameFillMode=h.Constants.MATERIAL_WireFrameFillMode,e.PointFillMode=h.Constants.MATERIAL_PointFillMode,e.PointListDrawMode=h.Constants.MATERIAL_PointListDrawMode,e.LineListDrawMode=h.Constants.MATERIAL_LineListDrawMode,e.LineLoopDrawMode=h.Constants.MATERIAL_LineLoopDrawMode,e.LineStripDrawMode=h.Constants.MATERIAL_LineStripDrawMode,e.TriangleStripDrawMode=h.Constants.MATERIAL_TriangleStripDrawMode,e.TriangleFanDrawMode=h.Constants.MATERIAL_TriangleFanDrawMode,e.ClockWiseSideOrientation=h.Constants.MATERIAL_ClockWiseSideOrientation,e.CounterClockWiseSideOrientation=h.Constants.MATERIAL_CounterClockWiseSideOrientation,e.TextureDirtyFlag=h.Constants.MATERIAL_TextureDirtyFlag,e.LightDirtyFlag=h.Constants.MATERIAL_LightDirtyFlag,e.FresnelDirtyFlag=h.Constants.MATERIAL_FresnelDirtyFlag,e.AttributesDirtyFlag=h.Constants.MATERIAL_AttributesDirtyFlag,e.MiscDirtyFlag=h.Constants.MATERIAL_MiscDirtyFlag,e.AllDirtyFlag=h.Constants.MATERIAL_AllDirtyFlag,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)}},n.__decorate([Object(i.serialize)()],e.prototype,"id",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"uniqueId",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"name",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"checkReadyOnEveryCall",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"checkReadyOnlyOnce",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"state",void 0),n.__decorate([Object(i.serialize)("alpha")],e.prototype,"_alpha",void 0),n.__decorate([Object(i.serialize)("backFaceCulling")],e.prototype,"_backFaceCulling",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"sideOrientation",void 0),n.__decorate([Object(i.serialize)("alphaMode")],e.prototype,"_alphaMode",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"_needDepthPrePass",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"disableDepthWrite",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"forceDepthWrite",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"separateCullingPass",void 0),n.__decorate([Object(i.serialize)("fogEnabled")],e.prototype,"_fogEnabled",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"pointSize",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"zOffset",void 0),n.__decorate([Object(i.serialize)()],e.prototype,"wireframe",null),n.__decorate([Object(i.serialize)()],e.prototype,"pointsCloud",null),n.__decorate([Object(i.serialize)()],e.prototype,"fillMode",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._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:!0,configurable:!0}),e.prototype.markAsProcessed=function(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!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(){this._areLightsDirty=!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,configurable:!0}),e._DiffuseTextureEnabled=!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}()},"./Materials/materialHelper.ts":
- /*!*************************************!*\
- !*** ./Materials/materialHelper.ts ***!
- \*************************************/
- /*! exports provided: MaterialHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"MaterialHelper",function(){return l});var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../scene */"./scene.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Lights/light */"./Lights/light.ts"),l=function(){function e(){}return e.BindEyePosition=function(e,t){if(t._forcedViewPosition)e.setVector3("vEyePosition",t._forcedViewPosition);else{var r=t.activeCamera.globalPosition;r||(r=t.activeCamera.devicePosition),e.setVector3("vEyePosition",t._mirroredCameraPosition?t._mirroredCameraPosition:r)}},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();n.isIdentityAs3x2()||t.updateMatrix(r+"Matrix",n)},e.PrepareDefinesForMisc=function(e,t,r,n,o,s,a){a._areMiscDirty&&(a.LOGARITHMICDEPTH=r,a.POINTSIZE=n,a.FOG=t.fogEnabled&&e.applyFog&&t.fogMode!==i.Scene.FOGMODE_NONE&&o,a.NONUNIFORMSCALING=e.nonUniformScaling,a.ALPHATEST=s)},e.PrepareDefinesForFrameBoundValues=function(e,t,r,n,i){void 0===i&&(i=null);var o,s,a,c,l=!1;o=null==i?void 0!==e.clipPlane&&null!==e.clipPlane:i,s=null==i?void 0!==e.clipPlane2&&null!==e.clipPlane2:i,a=null==i?void 0!==e.clipPlane3&&null!==e.clipPlane3:i,c=null==i?void 0!==e.clipPlane4&&null!==e.clipPlane4:i,r.CLIPPLANE!==o&&(r.CLIPPLANE=o,l=!0),r.CLIPPLANE2!==s&&(r.CLIPPLANE2=s,l=!0),r.CLIPPLANE3!==a&&(r.CLIPPLANE3=a,l=!0),r.CLIPPLANE4!==c&&(r.CLIPPLANE4=c,l=!0),r.DEPTHPREPASS!==!t.getColorWrite()&&(r.DEPTHPREPASS=!r.DEPTHPREPASS,l=!0),r.INSTANCES!==n&&(r.INSTANCES=n,l=!0),l&&r.markAsUnprocessed()},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(a.VertexBuffer.NormalKind),t._needNormals&&e.isVerticesDataPresent(a.VertexBuffer.TangentKind)&&(t.TANGENT=!0),t._needUVs?(t.UV1=e.isVerticesDataPresent(a.VertexBuffer.UVKind),t.UV2=e.isVerticesDataPresent(a.VertexBuffer.UV2Kind)):(t.UV1=!1,t.UV2=!1),r){var s=e.useVertexColors&&e.isVerticesDataPresent(a.VertexBuffer.ColorKind);t.VERTEXCOLOR=s,t.VERTEXALPHA=e.hasVertexAlpha&&s&&o}if(n)if(e.useBones&&e.computeBonesUsingShaders&&e.skeleton){t.NUM_BONE_INFLUENCERS=e.numBoneInfluencers;var c=void 0!==t.BONETEXTURE;e.skeleton.isUsingTextureForMatrices&&c?t.BONETEXTURE=!0:(t.BonesPerMesh=e.skeleton.bones.length+1,t.BONETEXTURE=!c&&void 0)}else t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0;if(i){var l=e.morphTargetManager;l?(t.MORPHTARGETS_TANGENT=l.supportsTangents&&t.TANGENT,t.MORPHTARGETS_NORMAL=l.supportsNormals&&t.NORMAL,t.MORPHTARGETS=l.numInfluencers>0,t.NUM_MORPH_INFLUENCERS=l.numInfluencers):(t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)}return!0},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=!1,l=!1,u=!1,h=!1,d=!1;if(e.lightsEnabled&&!o)for(var f=0,p=t._lightSources;f<p.length;f++){var g=p[f];switch(a=!0,void 0===r["LIGHT"+s]&&(l=!0),r["LIGHT"+s]=!0,r["SPOTLIGHT"+s]=!1,r["HEMILIGHT"+s]=!1,r["POINTLIGHT"+s]=!1,r["DIRLIGHT"+s]=!1,g.prepareLightSpecificDefines(r,s),r["LIGHT_FALLOFF_PHYSICAL"+s]=!1,r["LIGHT_FALLOFF_GLTF"+s]=!1,r["LIGHT_FALLOFF_STANDARD"+s]=!1,g.falloffType){case c.Light.FALLOFF_GLTF:r["LIGHT_FALLOFF_GLTF"+s]=!0;break;case c.Light.FALLOFF_PHYSICAL:r["LIGHT_FALLOFF_PHYSICAL"+s]=!0;break;case c.Light.FALLOFF_STANDARD:r["LIGHT_FALLOFF_STANDARD"+s]=!0}if(n&&!g.specular.equalsFloats(0,0,0)&&(d=!0),r["SHADOW"+s]=!1,r["SHADOWPCF"+s]=!1,r["SHADOWPCSS"+s]=!1,r["SHADOWPOISSON"+s]=!1,r["SHADOWESM"+s]=!1,r["SHADOWCUBE"+s]=!1,r["SHADOWLOWQUALITY"+s]=!1,r["SHADOWMEDIUMQUALITY"+s]=!1,t&&t.receiveShadows&&e.shadowsEnabled&&g.shadowEnabled){var m=g.getShadowGenerator();if(m){var _=m.getShadowMap();_&&_.renderList&&_.renderList.length>0&&(h=!0,m.prepareDefines(r,s))}}if(g.lightmapMode!=c.Light.LIGHTMAP_DEFAULT?(u=!0,r["LIGHTMAPEXCLUDED"+s]=!0,r["LIGHTMAPNOSPECULAR"+s]=g.lightmapMode==c.Light.LIGHTMAP_SHADOWSONLY):(r["LIGHTMAPEXCLUDED"+s]=!1,r["LIGHTMAPNOSPECULAR"+s]=!1),++s===i)break}r.SPECULARTERM=d,r.SHADOWS=h;for(var v=s;v<i;v++)void 0!==r["LIGHT"+v]&&(r["LIGHT"+v]=!1,r["HEMILIGHT"+v]=!1,r["POINTLIGHT"+v]=!1,r["DIRLIGHT"+v]=!1,r["SPOTLIGHT"+v]=!1,r["SHADOW"+v]=!1,r["SHADOWPCF"+v]=!1,r["SHADOWPCSS"+v]=!1,r["SHADOWPOISSON"+v]=!1,r["SHADOWESM"+v]=!1,r["SHADOWCUBE"+v]=!1,r["SHADOWLOWQUALITY"+v]=!1,r["SHADOWMEDIUMQUALITY"+v]=!1);var A=e.getEngine().getCaps();return void 0===r.SHADOWFLOAT&&(l=!0),r.SHADOWFLOAT=h&&(A.textureFloatRender&&A.textureFloatLinearFiltering||A.textureHalfFloatRender&&A.textureHalfFloatLinearFiltering),r.LIGHTMAPEXCLUDED=u,l&&r.rebuild(),a},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}else i=e,t||(t=[]);for(var a=0;a<n&&r["LIGHT"+a];a++)i.push("vLightData"+a,"vLightDiffuse"+a,"vLightSpecular"+a,"vLightDirection"+a,"vLightFalloff"+a,"vLightGround"+a,"lightMatrix"+a,"shadowsInfo"+a,"depthValues"+a),o&&o.push("Light"+a),t.push("shadowSampler"+a),t.push("depthSampler"+a),r["PROJECTEDLIGHTTEXTURE"+a]&&(t.push("projectionLightSampler"+a),i.push("textureProjectionMatrix"+a));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.PrepareAttributesForMorphTargets=function(e,t,r){var i=r.NUM_MORPH_INFLUENCERS;if(i>0&&s.EngineStore.LastCreatedEngine)for(var o=s.EngineStore.LastCreatedEngine.getCaps().maxVertexAttribs,c=t.morphTargetManager,l=c&&c.supportsNormals&&r.NORMAL,u=c&&c.supportsTangents&&r.TANGENT,h=0;h<i;h++)e.push(a.VertexBuffer.PositionKind+h),l&&e.push(a.VertexBuffer.NormalKind+h),u&&e.push(a.VertexBuffer.TangentKind+h),e.length>o&&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(a.VertexBuffer.MatricesIndicesKind),e.push(a.VertexBuffer.MatricesWeightsKind),r.NUM_BONE_INFLUENCERS>4&&(e.push(a.VertexBuffer.MatricesIndicesExtraKind),e.push(a.VertexBuffer.MatricesWeightsExtraKind)))},e.PrepareAttributesForInstances=function(e,t){t.INSTANCES&&(e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3"))},e.BindLightShadow=function(e,t,r,n){if(e.shadowEnabled&&t.receiveShadows){var i=e.getShadowGenerator();i&&i.bindShadowLight(r,n)}},e.BindLightProperties=function(e,t,r){e.transferToEffect(t,r+"")},e.BindLights=function(t,r,n,i,s,a){void 0===s&&(s=4),void 0===a&&(a=!1);for(var c=Math.min(r._lightSources.length,s),l=0;l<c;l++){var u=r._lightSources[l],h=l.toString(),d=u.getScaledIntensity();u._uniformBuffer.bindToEffect(n,"Light"+l),e.BindLightProperties(u,n,l),u.diffuse.scaleToRef(d,o.Tmp.Color3[0]),u._uniformBuffer.updateColor4("vLightDiffuse",o.Tmp.Color3[0],a?u.radius:u.range,h),i.SPECULARTERM&&(u.specular.scaleToRef(d,o.Tmp.Color3[1]),u._uniformBuffer.updateColor3("vLightSpecular",o.Tmp.Color3[1],h)),t.shadowsEnabled&&this.BindLightShadow(u,r,h,n),u._uniformBuffer.update()}},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();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)}if(t.clipPlane2){r=t.clipPlane2;e.setFloat4("vClipPlane2",r.normal.x,r.normal.y,r.normal.z,r.d)}if(t.clipPlane3){r=t.clipPlane3;e.setFloat4("vClipPlane3",r.normal.x,r.normal.y,r.normal.z,r.d)}if(t.clipPlane4){r=t.clipPlane4;e.setFloat4("vClipPlane4",r.normal.x,r.normal.y,r.normal.z,r.d)}},e._tempFogColor=o.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 n.__extends(t,e),Object.defineProperty(t.prototype,"subMaterials",{get:function(){return this._subMaterials},set:function(e){this._subMaterials=e,this._hookArray(e)},enumerable:!0,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.getMaterialByID(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 */"./Maths/math.ts"),o=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._normalMatrix=new i.Matrix,n.allowShaderHotSwapping=!0,n._storeEffectOnSubMeshes=!0,n}return 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.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 d});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ./materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ./effect */"./Materials/effect.ts"),u=r(/*! ./material */"./Materials/material.ts"),h=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),d=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._vectors2={},a._vectors3={},a._vectors4={},a._matrices={},a._matrices3x3={},a._matrices2x2={},a._vectors2Arrays={},a._vectors3Arrays={},a._cachedWorldViewMatrix=new o.Matrix,a._shaderPath=i,a._options=n.__assign({needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],defines:[]},s),a}return n.__extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!0,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.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.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._checkCache=function(e,t){return!e||(this._effect&&this._effect.defines.indexOf("#define INSTANCES"),!1)},t.prototype.isReadyForSubMesh=function(e,t,r){return this.isReady(e,r)},t.prototype.isReady=function(e,t){var r=this.getScene(),n=r.getEngine();if(!this.checkReadyOnEveryCall&&this._renderId===r.getRenderId()&&this._checkCache(e,t))return!0;for(var i=[],o=[],a=new l.EffectFallbacks,u=0;u<this._options.defines.length;u++)i.push(this._options.defines[u]);for(u=0;u<this._options.attributes.length;u++)o.push(this._options.attributes[u]);if(e&&e.isVerticesDataPresent(s.VertexBuffer.ColorKind)&&(o.push(s.VertexBuffer.ColorKind),i.push("#define VERTEXCOLOR")),t&&(i.push("#define INSTANCES"),c.MaterialHelper.PrepareAttributesForInstances(o,i)),e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton){o.push(s.VertexBuffer.MatricesIndicesKind),o.push(s.VertexBuffer.MatricesWeightsKind),e.numBoneInfluencers>4&&(o.push(s.VertexBuffer.MatricesIndicesExtraKind),o.push(s.VertexBuffer.MatricesWeightsExtraKind));var h=e.skeleton;i.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),a.addCPUSkinningFallback(0,e),h.isUsingTextureForMatrices?(i.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")):(i.push("#define BonesPerMesh "+(h.bones.length+1)),-1===this._options.uniforms.indexOf("mBones")&&this._options.uniforms.push("mBones"))}else i.push("#define NUM_BONE_INFLUENCERS 0");for(var d in this._textures)if(!this._textures[d].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&i.push("#define ALPHATEST");var f=this._effect,p=i.join("\n");return this._effect=n.createEffect(this._shaderPath,{attributes:o,uniformsNames:this._options.uniforms,uniformBuffersNames:this._options.uniformBuffers,samplers:this._options.samplers,defines:p,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError},n),!!this._effect.isReady()&&(f!==this._effect&&r.resetCachedMaterial(),this._renderId=r.getRenderId(),!0)},t.prototype.bindOnlyWorldMatrix=function(e){var t=this.getScene();this._effect&&(-1!==this._options.uniforms.indexOf("world")&&this._effect.setMatrix("world",e),-1!==this._options.uniforms.indexOf("worldView")&&(e.multiplyToRef(t.getViewMatrix(),this._cachedWorldViewMatrix),this._effect.setMatrix("worldView",this._cachedWorldViewMatrix)),-1!==this._options.uniforms.indexOf("worldViewProjection")&&this._effect.setMatrix("worldViewProjection",e.multiply(t.getTransformMatrix())))},t.prototype.bind=function(e,t){if(this.bindOnlyWorldMatrix(e),this._effect&&this.getScene().getCachedMaterial()!==this){var r;for(r in-1!==this._options.uniforms.indexOf("view")&&this._effect.setMatrix("view",this.getScene().getViewMatrix()),-1!==this._options.uniforms.indexOf("projection")&&this._effect.setMatrix("projection",this.getScene().getProjectionMatrix()),-1!==this._options.uniforms.indexOf("viewProjection")&&this._effect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),c.MaterialHelper.BindBonesParameters(t,this._effect),this._textures)this._effect.setTexture(r,this._textures[r]);for(r in this._textureArrays)this._effect.setTextureArray(r,this._textureArrays[r]);for(r in this._ints)this._effect.setInt(r,this._ints[r]);for(r in this._floats)this._effect.setFloat(r,this._floats[r]);for(r in this._floatsArrays)this._effect.setArray(r,this._floatsArrays[r]);for(r in this._colors3)this._effect.setColor3(r,this._colors3[r]);for(r in this._colors3Arrays)this._effect.setArray3(r,this._colors3Arrays[r]);for(r in this._colors4){var n=this._colors4[r];this._effect.setFloat4(r,n.r,n.g,n.b,n.a)}for(r in this._vectors2)this._effect.setVector2(r,this._vectors2[r]);for(r in this._vectors3)this._effect.setVector3(r,this._vectors3[r]);for(r in this._vectors4)this._effect.setVector4(r,this._vectors4[r]);for(r in this._matrices)this._effect.setMatrix(r,this._matrices[r]);for(r in this._matrices3x3)this._effect.setMatrix3x3(r,this._matrices3x3[r]);for(r in this._matrices2x2)this._effect.setMatrix2x2(r,this._matrices2x2[r]);for(r in this._vectors2Arrays)this._effect.setArray2(r,this._vectors2Arrays[r]);for(r in this._vectors3Arrays)this._effect.setArray3(r,this._vectors3Arrays[r])}this._afterBind(t)},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){return new t(e,this.getScene(),this._shaderPath,this._options)},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="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.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.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];return t},t.Parse=function(e,r,n){var s,c=i.SerializationHelper.Parse(function(){return new t(e.name,r,e.shaderPath,e.options)},e,r,n);for(s in e.textures)c.setTexture(s,a.Texture.Parse(e.textures[s],r,n));for(s in e.textureArrays){for(var l=e.textureArrays[s],u=new Array,h=0;h<l.length;h++)u.push(a.Texture.Parse(l[h],r,n));c.setTextureArray(s,u)}for(s in e.floats)c.setFloat(s,e.floats[s]);for(s in e.floatsArrays)c.setFloats(s,e.floatsArrays[s]);for(s in e.colors3)c.setColor3(s,o.Color3.FromArray(e.colors3[s]));for(s in e.colors3Arrays){var d=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 o.Color3.FromArray(e)});c.setColor3Array(s,d)}for(s in e.colors4)c.setColor4(s,o.Color4.FromArray(e.colors4[s]));for(s in e.vectors2)c.setVector2(s,o.Vector2.FromArray(e.vectors2[s]));for(s in e.vectors3)c.setVector3(s,o.Vector3.FromArray(e.vectors3[s]));for(s in e.vectors4)c.setVector4(s,o.Vector4.FromArray(e.vectors4[s]));for(s in e.matrices)c.setMatrix(s,o.Matrix.FromArray(e.matrices[s]));for(s in e.matrices3x3)c.setMatrix3x3(s,e.matrices3x3[s]);for(s in e.matrices2x2)c.setMatrix2x2(s,e.matrices2x2[s]);for(s in e.vectors2Arrays)c.setArray2(s,e.vectors2Arrays[s]);for(s in e.vectors3Arrays)c.setArray3(s,e.vectors3Arrays[s]);return c},t}(u.Material);h._TypeStore.RegisteredTypes["BABYLON.ShaderMaterial"]=d},"./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 v}),r.d(t,"StandardMaterial",function(){return A});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 */"./Maths/math.ts"),c=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ./imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),u=r(/*! ./effect */"./Materials/effect.ts"),h=r(/*! ../Materials/materialDefines */"./Materials/materialDefines.ts"),d=r(/*! ./pushMaterial */"./Materials/pushMaterial.ts"),f=r(/*! ./materialHelper */"./Materials/materialHelper.ts"),p=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),g=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),m=r(/*! ./materialFlags */"./Materials/materialFlags.ts"),_=(r(/*! ../Shaders/default.fragment */"./Shaders/default.fragment.ts"),r(/*! ../Shaders/default.vertex */"./Shaders/default.vertex.ts"),r(/*! ../Engines/constants */"./Engines/constants.ts")),v=function(e){function t(){var t=e.call(this)||this;return t.MAINUV1=!1,t.MAINUV2=!1,t.DIFFUSE=!1,t.DIFFUSEDIRECTUV=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.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.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_SKYBOX_TRANSFORMED=!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.NUM_MORPH_INFLUENCERS=0,t.NONUNIFORMSCALING=!1,t.PREMULTIPLYALPHA=!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 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),A=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i.ambientColor=new a.Color3(0,0,0),i.diffuseColor=new a.Color3(1,1,1),i.specularColor=new a.Color3(1,1,1),i.emissiveColor=new a.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._renderTargets=new o.SmartArray(16),i._worldViewProjectionMatrix=a.Matrix.Zero(),i._globalAmbientColor=new a.Color3(0,0,0),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 n.__extends(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsTexturesDirty()},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraToneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraExposure",{get:function(){return this._imageProcessingConfiguration.exposure},set:function(e){this._imageProcessingConfiguration.exposure=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraContrast",{get:function(){return this._imageProcessingConfiguration.contrast},set:function(e){this._imageProcessingConfiguration.contrast=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorGradingTexture",{get:function(){return this._imageProcessingConfiguration.colorGradingTexture},set:function(e){this._imageProcessingConfiguration.colorGradingTexture=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraColorCurves",{get:function(){return this._imageProcessingConfiguration.colorCurves},set:function(e){this._imageProcessingConfiguration.colorCurves=e},enumerable:!0,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:!0,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:!0,configurable:!0}),t.prototype.needAlphaBlending=function(){return this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled},t.prototype.needAlphaTesting=function(){return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha},t.prototype._shouldUseAlphaFromDiffuseTexture=function(){return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture},t.prototype.getAlphaTestTexture=function(){return this._diffuseTexture},t.prototype.isReadyForSubMesh=function(e,r,n){if(void 0===n&&(n=!1),r.effect&&this.isFrozen&&this._wasPreviouslyReady)return!0;r._materialDefines||(r._materialDefines=new v);var i=this.getScene(),o=r._materialDefines;if(!this.checkReadyOnEveryCall&&r.effect&&o._renderId===i.getRenderId())return!0;var s=i.getEngine();if(o._needNormals=f.MaterialHelper.PrepareDefinesForLights(i,e,o,!0,this._maxSimultaneousLights,this._disableLighting),i.activeCamera){var a=o.MULTIVIEW;o.MULTIVIEW=null!==i.activeCamera.outputRenderTarget&&i.activeCamera.outputRenderTarget.getViewCount()>1,o.MULTIVIEW!=a&&o.markAsUnprocessed()}if(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;f.MaterialHelper.PrepareDefinesForMergedUV(this._diffuseTexture,o,"DIFFUSE")}else o.DIFFUSE=!1;if(this._ambientTexture&&t.AmbientTextureEnabled){if(!this._ambientTexture.isReadyOrNotBlocking())return!1;f.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture,o,"AMBIENT")}else o.AMBIENT=!1;if(this._opacityTexture&&t.OpacityTextureEnabled){if(!this._opacityTexture.isReadyOrNotBlocking())return!1;f.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===p.Texture.INVCUBIC_MODE,o.REFLECTIONMAP_3D=this._reflectionTexture.isCube,this._reflectionTexture.coordinatesMode){case p.Texture.EXPLICIT_MODE:o.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case p.Texture.PLANAR_MODE:o.setReflectionMode("REFLECTIONMAP_PLANAR");break;case p.Texture.PROJECTION_MODE:o.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case p.Texture.SKYBOX_MODE:o.setReflectionMode("REFLECTIONMAP_SKYBOX"),o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!this._reflectionTexture.getReflectionTextureMatrix().isIdentity();break;case p.Texture.SPHERICAL_MODE:o.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case p.Texture.EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case p.Texture.FIXED_EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case p.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case p.Texture.CUBIC_MODE:case p.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;f.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture,o,"EMISSIVE")}else o.EMISSIVE=!1;if(this._lightmapTexture&&t.LightmapTextureEnabled){if(!this._lightmapTexture.isReadyOrNotBlocking())return!1;f.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture,o,"LIGHTMAP"),o.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap}else o.LIGHTMAP=!1;if(this._specularTexture&&t.SpecularTextureEnabled){if(!this._specularTexture.isReadyOrNotBlocking())return!1;f.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;f.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}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===_.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===_.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF}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),f.MaterialHelper.PrepareDefinesForMisc(e,i,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),f.MaterialHelper.PrepareDefinesForAttributes(e,o,!0,!0,!0),f.MaterialHelper.PrepareDefinesForFrameBoundValues(i,s,o,n),o.isDirty){o.markAsProcessed();var h=new u.EffectFallbacks;o.REFLECTION&&h.addFallback(0,"REFLECTION"),o.SPECULAR&&h.addFallback(0,"SPECULAR"),o.BUMP&&h.addFallback(0,"BUMP"),o.PARALLAX&&h.addFallback(1,"PARALLAX"),o.PARALLAXOCCLUSION&&h.addFallback(0,"PARALLAXOCCLUSION"),o.SPECULAROVERALPHA&&h.addFallback(0,"SPECULAROVERALPHA"),o.FOG&&h.addFallback(1,"FOG"),o.POINTSIZE&&h.addFallback(0,"POINTSIZE"),o.LOGARITHMICDEPTH&&h.addFallback(0,"LOGARITHMICDEPTH"),f.MaterialHelper.HandleFallbacksForShadows(o,h,this._maxSimultaneousLights),o.SPECULARTERM&&h.addFallback(0,"SPECULARTERM"),o.DIFFUSEFRESNEL&&h.addFallback(1,"DIFFUSEFRESNEL"),o.OPACITYFRESNEL&&h.addFallback(2,"OPACITYFRESNEL"),o.REFLECTIONFRESNEL&&h.addFallback(3,"REFLECTIONFRESNEL"),o.EMISSIVEFRESNEL&&h.addFallback(4,"EMISSIVEFRESNEL"),o.FRESNEL&&h.addFallback(4,"FRESNEL"),o.MULTIVIEW&&h.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),f.MaterialHelper.PrepareAttributesForBones(d,e,o,h),f.MaterialHelper.PrepareAttributesForInstances(d,o),f.MaterialHelper.PrepareAttributesForMorphTargets(d,e,o);var g="default",m=["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","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"],A=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler"],y=["Material","Scene"];l.ImageProcessingConfiguration&&(l.ImageProcessingConfiguration.PrepareUniforms(m,o),l.ImageProcessingConfiguration.PrepareSamplers(A,o)),f.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:m,uniformBuffersNames:y,samplers:A,defines:o,maxSimultaneousLights:this._maxSimultaneousLights}),this.customShaderNameResolve&&(g=this.customShaderNameResolve(g,m,y,A,o));var b=o.toString(),T=r.effect,E=i.getEngine().createEffect(g,{attributes:d,uniformsNames:m,uniformBuffersNames:y,samplers:A,defines:b,fallbacks:h,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:o.NUM_MORPH_INFLUENCERS}},s);E&&(this.allowShaderHotSwapping&&T&&!E.isReady()?(E=T,o.markAsUnprocessed()):(i.resetCachedMaterial(),r.setEffect(E,o),this.buildUniformLayout()))}return!(!r.effect||!r.effect.isReady())&&(o._renderId=i.getRenderId(),this._wasPreviouslyReady=!0,!0)},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("diffuseLeftColor",4),this._uniformBuffer.addUniform("diffuseRightColor",4),this._uniformBuffer.addUniform("opacityParts",4),this._uniformBuffer.addUniform("reflectionLeftColor",4),this._uniformBuffer.addUniform("reflectionRightColor",4),this._uniformBuffer.addUniform("refractionLeftColor",4),this._uniformBuffer.addUniform("refractionRightColor",4),this._uniformBuffer.addUniform("emissiveLeftColor",4),this._uniformBuffer.addUniform("emissiveRightColor",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vAmbientInfos",2),this._uniformBuffer.addUniform("vOpacityInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("vReflectionPosition",3),this._uniformBuffer.addUniform("vReflectionSize",3),this._uniformBuffer.addUniform("vEmissiveInfos",2),this._uniformBuffer.addUniform("vLightmapInfos",2),this._uniformBuffer.addUniform("vSpecularInfos",2),this._uniformBuffer.addUniform("vBumpInfos",3),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("ambientMatrix",16),this._uniformBuffer.addUniform("opacityMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("emissiveMatrix",16),this._uniformBuffer.addUniform("lightmapMatrix",16),this._uniformBuffer.addUniform("specularMatrix",16),this._uniformBuffer.addUniform("bumpMatrix",16),this._uniformBuffer.addUniform("vTangentSpaceParams",2),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("refractionMatrix",16),this._uniformBuffer.addUniform("vRefractionInfos",4),this._uniformBuffer.addUniform("vSpecularColor",4),this._uniformBuffer.addUniform("vEmissiveColor",3),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.addUniform("vDiffuseColor",4),this._uniformBuffer.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 c=n.effect;if(c){this._activeEffect=c,this.bindOnlyWorldMatrix(e),o.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var l=this._mustRebind(i,c,r.visibility);if(f.MaterialHelper.BindBonesParameters(r,c),l){if(this._uniformBuffer.bindToEffect(c,"Material"),this.bindViewProjection(c),!this._uniformBuffer.useUbo||!this.isFrozen||!this._uniformBuffer.isSync){if(t.FresnelEnabled&&o.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),this._uniformBuffer.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&this._uniformBuffer.updateColor4("opacityParts",new a.Color3(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),this._uniformBuffer.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),this._uniformBuffer.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),this._uniformBuffer.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),i.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),f.MaterialHelper.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse"),this._diffuseTexture.hasAlpha&&c.setFloat("alphaCutOff",this.alphaCutOff)),this._ambientTexture&&t.AmbientTextureEnabled&&(this._uniformBuffer.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),f.MaterialHelper.BindTextureMatrix(this._ambientTexture,this._uniformBuffer,"ambient")),this._opacityTexture&&t.OpacityTextureEnabled&&(this._uniformBuffer.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),f.MaterialHelper.BindTextureMatrix(this._opacityTexture,this._uniformBuffer,"opacity")),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._uniformBuffer.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),this._uniformBuffer.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){var u=this._reflectionTexture;this._uniformBuffer.updateVector3("vReflectionPosition",u.boundingBoxPosition),this._uniformBuffer.updateVector3("vReflectionSize",u.boundingBoxSize)}if(this._emissiveTexture&&t.EmissiveTextureEnabled&&(this._uniformBuffer.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),f.MaterialHelper.BindTextureMatrix(this._emissiveTexture,this._uniformBuffer,"emissive")),this._lightmapTexture&&t.LightmapTextureEnabled&&(this._uniformBuffer.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),f.MaterialHelper.BindTextureMatrix(this._lightmapTexture,this._uniformBuffer,"lightmap")),this._specularTexture&&t.SpecularTextureEnabled&&(this._uniformBuffer.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),f.MaterialHelper.BindTextureMatrix(this._specularTexture,this._uniformBuffer,"specular")),this._bumpTexture&&i.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&(this._uniformBuffer.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),f.MaterialHelper.BindTextureMatrix(this._bumpTexture,this._uniformBuffer,"bump"),i._mirroredCameraPosition?this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&t.RefractionTextureEnabled){var h=1;this._refractionTexture.isCube||(this._uniformBuffer.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(h=this._refractionTexture.depth)),this._uniformBuffer.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,h,this.invertRefractionY?-1:1)}}this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),o.SPECULARTERM&&this._uniformBuffer.updateColor4("vSpecularColor",this.specularColor,this.specularPower),this._uniformBuffer.updateColor3("vEmissiveColor",t.EmissiveTextureEnabled?this.emissiveColor:a.Color3.BlackReadOnly),this._uniformBuffer.updateFloat("visibility",r.visibility),this._uniformBuffer.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha)}if(i.texturesEnabled&&(this._diffuseTexture&&t.DiffuseTextureEnabled&&c.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&t.AmbientTextureEnabled&&c.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&t.OpacityTextureEnabled&&c.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?c.setTexture("reflectionCubeSampler",this._reflectionTexture):c.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&t.EmissiveTextureEnabled&&c.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&t.LightmapTextureEnabled&&c.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&t.SpecularTextureEnabled&&c.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&i.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&c.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&t.RefractionTextureEnabled)){h=1;this._refractionTexture.isCube?c.setTexture("refractionCubeSampler",this._refractionTexture):c.setTexture("refraction2DSampler",this._refractionTexture)}f.MaterialHelper.BindClipPlane(c,i),i.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),f.MaterialHelper.BindEyePosition(c,i),c.setColor3("vAmbientColor",this._globalAmbientColor)}!l&&this.isFrozen||(i.lightsEnabled&&!this._disableLighting&&f.MaterialHelper.BindLights(i,r,c,o,this._maxSimultaneousLights),(i.fogEnabled&&r.applyFog&&i.fogMode!==s.Scene.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture)&&this.bindView(c),f.MaterialHelper.BindFogParameters(i,r,c),o.NUM_MORPH_INFLUENCERS&&f.MaterialHelper.BindMorphTargetParameters(r,c),f.MaterialHelper.BindLogDepth(o,c,i),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.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),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),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))))))))},t.prototype.dispose=function(t,r){r&&(this._diffuseTexture&&this._diffuseTexture.dispose(),this._ambientTexture&&this._ambientTexture.dispose(),this._opacityTexture&&this._opacityTexture.dispose(),this._reflectionTexture&&this._reflectionTexture.dispose(),this._emissiveTexture&&this._emissiveTexture.dispose(),this._specularTexture&&this._specularTexture.dispose(),this._bumpTexture&&this._bumpTexture.dispose(),this._lightmapTexture&&this._lightmapTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose()),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 m.MaterialFlags.DiffuseTextureEnabled},set:function(e){m.MaterialFlags.DiffuseTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AmbientTextureEnabled",{get:function(){return m.MaterialFlags.AmbientTextureEnabled},set:function(e){m.MaterialFlags.AmbientTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OpacityTextureEnabled",{get:function(){return m.MaterialFlags.OpacityTextureEnabled},set:function(e){m.MaterialFlags.OpacityTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ReflectionTextureEnabled",{get:function(){return m.MaterialFlags.ReflectionTextureEnabled},set:function(e){m.MaterialFlags.ReflectionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"EmissiveTextureEnabled",{get:function(){return m.MaterialFlags.EmissiveTextureEnabled},set:function(e){m.MaterialFlags.EmissiveTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpecularTextureEnabled",{get:function(){return m.MaterialFlags.SpecularTextureEnabled},set:function(e){m.MaterialFlags.SpecularTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BumpTextureEnabled",{get:function(){return m.MaterialFlags.BumpTextureEnabled},set:function(e){m.MaterialFlags.BumpTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightmapTextureEnabled",{get:function(){return m.MaterialFlags.LightmapTextureEnabled},set:function(e){m.MaterialFlags.LightmapTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RefractionTextureEnabled",{get:function(){return m.MaterialFlags.RefractionTextureEnabled},set:function(e){m.MaterialFlags.RefractionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ColorGradingTextureEnabled",{get:function(){return m.MaterialFlags.ColorGradingTextureEnabled},set:function(e){m.MaterialFlags.ColorGradingTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FresnelEnabled",{get:function(){return m.MaterialFlags.FresnelEnabled},set:function(e){m.MaterialFlags.FresnelEnabled=e},enumerable:!0,configurable:!0}),n.__decorate([Object(i.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"diffuseTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("ambientTexture")],t.prototype,"_ambientTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("opacityTexture")],t.prototype,"_opacityTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("reflectionTexture")],t.prototype,"_reflectionTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("emissiveTexture")],t.prototype,"_emissiveTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("specularTexture")],t.prototype,"_specularTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("bumpTexture")],t.prototype,"_bumpTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("lightmapTexture")],t.prototype,"_lightmapTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"lightmapTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("refractionTexture")],t.prototype,"_refractionTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),n.__decorate([Object(i.serializeAsColor3)("ambient")],t.prototype,"ambientColor",void 0),n.__decorate([Object(i.serializeAsColor3)("diffuse")],t.prototype,"diffuseColor",void 0),n.__decorate([Object(i.serializeAsColor3)("specular")],t.prototype,"specularColor",void 0),n.__decorate([Object(i.serializeAsColor3)("emissive")],t.prototype,"emissiveColor",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"specularPower",void 0),n.__decorate([Object(i.serialize)("useAlphaFromDiffuseTexture")],t.prototype,"_useAlphaFromDiffuseTexture",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFromDiffuseTexture",void 0),n.__decorate([Object(i.serialize)("useEmissiveAsIllumination")],t.prototype,"_useEmissiveAsIllumination",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useEmissiveAsIllumination",void 0),n.__decorate([Object(i.serialize)("linkEmissiveWithDiffuse")],t.prototype,"_linkEmissiveWithDiffuse",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkEmissiveWithDiffuse",void 0),n.__decorate([Object(i.serialize)("useSpecularOverAlpha")],t.prototype,"_useSpecularOverAlpha",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),n.__decorate([Object(i.serialize)("useReflectionOverAlpha")],t.prototype,"_useReflectionOverAlpha",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useReflectionOverAlpha",void 0),n.__decorate([Object(i.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),n.__decorate([Object(i.serialize)("useObjectSpaceNormalMap")],t.prototype,"_useObjectSpaceNormalMap",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),n.__decorate([Object(i.serialize)("useParallax")],t.prototype,"_useParallax",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),n.__decorate([Object(i.serialize)("useParallaxOcclusion")],t.prototype,"_useParallaxOcclusion",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"parallaxScaleBias",void 0),n.__decorate([Object(i.serialize)("roughness")],t.prototype,"_roughness",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"indexOfRefraction",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"invertRefractionY",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"alphaCutOff",void 0),n.__decorate([Object(i.serialize)("useLightmapAsShadowmap")],t.prototype,"_useLightmapAsShadowmap",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),n.__decorate([Object(i.serializeAsFresnelParameters)("diffuseFresnelParameters")],t.prototype,"_diffuseFresnelParameters",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"diffuseFresnelParameters",void 0),n.__decorate([Object(i.serializeAsFresnelParameters)("opacityFresnelParameters")],t.prototype,"_opacityFresnelParameters",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelAndMiscDirty")],t.prototype,"opacityFresnelParameters",void 0),n.__decorate([Object(i.serializeAsFresnelParameters)("reflectionFresnelParameters")],t.prototype,"_reflectionFresnelParameters",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"reflectionFresnelParameters",void 0),n.__decorate([Object(i.serializeAsFresnelParameters)("refractionFresnelParameters")],t.prototype,"_refractionFresnelParameters",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"refractionFresnelParameters",void 0),n.__decorate([Object(i.serializeAsFresnelParameters)("emissiveFresnelParameters")],t.prototype,"_emissiveFresnelParameters",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"emissiveFresnelParameters",void 0),n.__decorate([Object(i.serialize)("useReflectionFresnelFromSpecular")],t.prototype,"_useReflectionFresnelFromSpecular",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"useReflectionFresnelFromSpecular",void 0),n.__decorate([Object(i.serialize)("useGlossinessFromSpecularMapAlpha")],t.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useGlossinessFromSpecularMapAlpha",void 0),n.__decorate([Object(i.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),n.__decorate([Object(i.serialize)("invertNormalMapX")],t.prototype,"_invertNormalMapX",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),n.__decorate([Object(i.serialize)("invertNormalMapY")],t.prototype,"_invertNormalMapY",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),n.__decorate([Object(i.serialize)("twoSidedLighting")],t.prototype,"_twoSidedLighting",void 0),n.__decorate([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"useLogarithmicDepth",null),t}(d.PushMaterial);g._TypeStore.RegisteredTypes["BABYLON.StandardMaterial"]=A,s.Scene.DefaultMaterialFactory=function(e){return new A("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=function(){function e(e,t,r){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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSync",{get:function(){return!this._needSync},enumerable:!0,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)}this._fillAlignment(t),this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(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._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++)this._bufferData[i+s]!==t[s]&&(o=!0,this._bufferData[i+s]=t[s]);this._needSync=this._needSync||o}},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.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&&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, ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp, SphericalPolynomial, SphericalHarmonics */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,"ToGammaSpace",function(){return i.ToGammaSpace}),r.d(t,"ToLinearSpace",function(){return i.ToLinearSpace}),r.d(t,"Epsilon",function(){return i.Epsilon}),r.d(t,"Color3",function(){return i.Color3}),r.d(t,"Color4",function(){return i.Color4}),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,"Size",function(){return i.Size}),r.d(t,"Quaternion",function(){return i.Quaternion}),r.d(t,"Matrix",function(){return i.Matrix}),r.d(t,"Plane",function(){return i.Plane}),r.d(t,"Viewport",function(){return i.Viewport}),r.d(t,"Frustum",function(){return i.Frustum}),r.d(t,"Space",function(){return i.Space}),r.d(t,"Axis",function(){return i.Axis}),r.d(t,"BezierCurve",function(){return i.BezierCurve}),r.d(t,"Orientation",function(){return i.Orientation}),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,"PositionNormalVertex",function(){return i.PositionNormalVertex}),r.d(t,"PositionNormalTextureVertex",function(){return i.PositionNormalTextureVertex}),r.d(t,"Tmp",function(){return i.Tmp});var o=r(/*! ./sphericalPolynomial */"./Maths/sphericalPolynomial.ts");r.d(t,"SphericalPolynomial",function(){return o.SphericalPolynomial}),r.d(t,"SphericalHarmonics",function(){return o.SphericalHarmonics})},"./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=1.401298e-45);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.ts":
- /*!***********************!*\
- !*** ./Maths/math.ts ***!
- \***********************/
- /*! exports provided: ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp */function(e,t,r){"use strict";r.r(t),r.d(t,"ToGammaSpace",function(){return s}),r.d(t,"ToLinearSpace",function(){return a}),r.d(t,"Epsilon",function(){return c}),r.d(t,"Color3",function(){return l}),r.d(t,"Color4",function(){return u}),r.d(t,"Vector2",function(){return h}),r.d(t,"Vector3",function(){return d}),r.d(t,"Vector4",function(){return f}),r.d(t,"Size",function(){return p}),r.d(t,"Quaternion",function(){return g}),r.d(t,"Matrix",function(){return m}),r.d(t,"Plane",function(){return _}),r.d(t,"Viewport",function(){return v}),r.d(t,"Frustum",function(){return A}),r.d(t,"Space",function(){return n}),r.d(t,"Axis",function(){return b}),r.d(t,"BezierCurve",function(){return T}),r.d(t,"Orientation",function(){return y}),r.d(t,"Angle",function(){return E}),r.d(t,"Arc2",function(){return x}),r.d(t,"Path2",function(){return C}),r.d(t,"Path3D",function(){return P}),r.d(t,"Curve3",function(){return M}),r.d(t,"PositionNormalVertex",function(){return S}),r.d(t,"PositionNormalTextureVertex",function(){return R}),r.d(t,"Tmp",function(){return O});var n,i=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),o=r(/*! ./math.scalar */"./Maths/math.scalar.ts"),s=1/2.2,a=2.2,c=.001,l=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=this.r||0;return e=397*(e=397*e^(this.g||0))^(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.toColor4=function(e){return void 0===e&&(e=1),new u(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=o.Scalar.Clamp(this.r,e,t),r.g=o.Scalar.Clamp(this.g,e,t),r.b=o.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"#"+o.Scalar.ToHex(e)+o.Scalar.ToHex(t)+o.Scalar.ToHex(r)},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,a),e.g=Math.pow(this.g,a),e.b=Math.pow(this.b,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,s),e.g=Math.pow(this.g,s),e.b=Math.pow(this.b,s),this},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.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:!0,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}(),u=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.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=o.Scalar.Clamp(this.r,e,t),r.g=o.Scalar.Clamp(this.g,e,t),r.b=o.Scalar.Clamp(this.b,e,t),r.a=o.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=this.r||0;return e=397*(e=397*(e=397*e^(this.g||0))^(this.b||0))^(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(){var e=255*this.r|0,t=255*this.g|0,r=255*this.b|0,n=255*this.a|0;return"#"+o.Scalar.ToHex(e)+o.Scalar.ToHex(t)+o.Scalar.ToHex(r)+o.Scalar.ToHex(n)},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,a),e.g=Math.pow(this.g,a),e.b=Math.pow(this.b,a),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,s),e.g=Math.pow(this.g,s),e.b=Math.pow(this.b,s),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.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}(),h=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=this.x||0;return e=397*e^(this.y||0)},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,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.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=c),e&&o.Scalar.WithinEpsilon(this.x,e.x,t)&&o.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();if(0===e)return this;var t=1/e;return this.x*=t,this.y*=t,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,c=2*a-3*s+1,l=-2*a+3*s,u=a-2*s+o,h=a-s;return new e(t.x*c+n.x*l+r.x*u+i.x*h,t.y*c+n.y*l+r.y*u+i.y*h)},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}(),d=function(){function e(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),this.x=e,this.y=t,this.z=r}return 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=this.x||0;return e=397*(e=397*e^(this.y||0))^(this.z||0)},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.toQuaternion=function(){return g.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.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.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=c),e&&o.Scalar.WithinEpsilon(this.x,e.x,t)&&o.Scalar.WithinEpsilon(this.y,e.y,t)&&o.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(!o.Scalar.WithinEpsilon(t,r,e))return!0;var n=Math.abs(this.z);return!o.Scalar.WithinEpsilon(t,n,e)||!o.Scalar.WithinEpsilon(r,n,e)},Object.defineProperty(e.prototype,"isNonUniform",{get:function(){var e=Math.abs(this.x),t=Math.abs(this.y);if(e!==t)return!0;var r=Math.abs(this.z);return e!==r||t!==r},enumerable:!0,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())?this:(I.Vector3[0].copyFrom(this),["x","y","z"].forEach(function(r,n){t[r]=I.Vector3[0][e[n]]}),this)},e.prototype.rotateByQuaternionToRef=function(t,r){return t.toRotationMatrix(I.Matrix[0]),e.TransformCoordinatesToRef(this,I.Matrix[0],r),r},e.prototype.rotateByQuaternionAroundPointToRef=function(e,t,r){return this.subtractToRef(t,I.Vector3[0]),I.Vector3[0].rotateByQuaternionToRef(e,I.Vector3[0]),t.addToRef(I.Vector3[0],r),r},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(I.Vector3[1]),o=r.normalizeToRef(I.Vector3[2]),s=e.Dot(i,o),a=I.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:!0,configurable:!0}),e.Down=function(){return new e(0,-1,0)},e.Forward=function(){return new e(0,0,1)},e.Backward=function(){return new e(0,0,-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],c=e*o[2]+t*o[6]+r*o[10]+o[14],l=1/(e*o[3]+t*o[7]+r*o[11]+o[15]);i.x=s*l,i.y=a*l,i.z=c*l},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.Hermite=function(t,r,n,i,o){var s=o*o,a=o*s,c=2*a-3*s+1,l=-2*a+3*s,u=a-2*s+o,h=a-s;return new e(t.x*c+n.x*l+r.x*u+i.x*h,t.y*c+n.y*l+r.y*u+i.y*h,t.z*c+n.z*l+r.z*u+i.z*h)},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,c=i.y,l=I.Matrix[1];m.FromValuesToRef(o/2,0,0,0,0,-s/2,0,0,0,0,.5,0,a+o/2,s/2+c,.5,1,l);var u=I.Matrix[0];return r.multiplyToRef(n,u),u.multiplyToRef(l,u),e.TransformCoordinates(t,u)},e._UnprojectFromInvertedMatrixToRef=function(t,r,n){e.TransformCoordinatesToRef(t,r,n);var i=r.m,s=t.x*i[3]+t.y*i[7]+t.z*i[11]+i[15];o.Scalar.WithinEpsilon(s,1)&&n.scaleInPlace(1/s)},e.UnprojectFromTransform=function(t,r,n,i,o){var s=I.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,c,l){var u=I.Matrix[0];s.multiplyToRef(a,u),u.multiplyToRef(c,u),u.invert();var h=I.Vector3[0];h.x=t/i*2-1,h.y=-(r/o*2-1),h.z=2*n-1,e._UnprojectFromInvertedMatrixToRef(h,u,l)},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=I.Quaternion[0];g.RotationQuaternionFromAxisToRef(e,t,r,i),i.toEulerAnglesToRef(n)},e._UpReadOnly=e.Up(),e}(),f=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=this.x||0;return e=397*(e=397*(e=397*e^(this.y||0))^(this.z||0))^(this.w||0)},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.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.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=c),e&&o.Scalar.WithinEpsilon(this.x,e.x,t)&&o.Scalar.WithinEpsilon(this.y,e.y,t)&&o.Scalar.WithinEpsilon(this.z,e.z,t)&&o.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 d(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}(),p=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=this.width||0;return e=397*e^(this.height||0)},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:!0,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}(),g=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.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"Quaternion"},e.prototype.getHashCode=function(){var e=this.x||0;return e=397*(e=397*(e=397*e^(this.y||0))^(this.z||0))^(this.w||0)},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.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=d.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,c=n*n,l=n*t-r*i;return l<-.4999999?(e.y=2*Math.atan2(n,i),e.x=Math.PI/2,e.z=0):l>.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+c+o),e.x=Math.asin(-2*(t*n-r*i)),e.y=Math.atan2(2*(t*r+n*i),s-a-c+o)),this},e.prototype.toRotationMatrix=function(e){return m.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],c=n[5],l=n[9],u=n[2],h=n[6],d=n[10],f=i+c+d;f>0?(r=.5/Math.sqrt(f+1),t.w=.25/r,t.x=(h-l)*r,t.y=(s-u)*r,t.z=(a-o)*r):i>c&&i>d?(r=2*Math.sqrt(1+i-c-d),t.w=(h-l)/r,t.x=.25*r,t.y=(o+a)/r,t.z=(s+u)/r):c>d?(r=2*Math.sqrt(1+c-i-d),t.w=(s-u)/r,t.x=(o+a)/r,t.y=.25*r,t.z=(l+h)/r):(r=2*Math.sqrt(1+d-i-c),t.w=(a-o)/r,t.x=(s+u)/r,t.y=(l+h)/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.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),c=Math.cos(i),l=Math.sin(o),u=Math.cos(o),h=Math.sin(s),d=Math.cos(s);n.x=d*l*c+h*u*a,n.y=h*u*c-d*l*a,n.z=d*u*a-h*l*c,n.w=d*u*c+h*l*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=I.Matrix[0];m.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 c=Math.acos(s),l=1/Math.sin(c);o=Math.sin((1-r)*c)*l,i=a?-Math.sin(r*c)*l:Math.sin(r*c)*l}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,c=2*a-3*s+1,l=-2*a+3*s,u=a-2*s+o,h=a-s;return new e(t.x*c+n.x*l+r.x*u+i.x*h,t.y*c+n.y*l+r.y*u+i.y*h,t.z*c+n.z*l+r.z*u+i.z*h,t.w*c+n.w*l+r.w*u+i.w*h)},e}(),m=function(){function e(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this._m=new Float32Array(16),this._updateIdentityStatus(!1)}return Object.defineProperty(e.prototype,"m",{get:function(){return this._m},enumerable:!0,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]?this._isIdentity3x2=!1: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],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],g=e[14],m=e[15],_=h*m-g*d,v=u*m-p*d,A=u*g-p*h,y=l*m-f*d,b=l*g-h*f,T=l*p-f*u;return t*+(s*_-a*v+c*A)+r*-(o*_-a*y+c*b)+n*+(o*v-s*y+c*T)+i*-(o*A-s*b+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],c=r[5],l=r[6],u=r[7],h=r[8],d=r[9],f=r[10],p=r[11],g=r[12],m=r[13],_=r[14],v=r[15],A=f*v-_*p,y=d*v-m*p,b=d*_-m*f,T=h*v-g*p,E=h*_-f*g,x=h*m-g*d,C=+(c*A-l*y+u*b),P=-(a*A-l*T+u*E),M=+(a*y-c*T+u*x),S=-(a*b-c*E+l*x),R=n*C+i*P+o*M+s*S;if(0===R)return t.copyFrom(this),this;var O=1/R,I=l*v-_*u,D=c*v-m*u,w=c*_-m*l,L=a*v-g*u,B=a*_-g*l,F=a*m-g*c,N=l*p-f*u,V=c*p-d*u,U=c*f-d*l,G=a*p-h*u,k=a*f-h*l,z=a*d-h*c,H=-(i*A-o*y+s*b),j=+(n*A-o*T+s*E),X=-(n*y-i*T+s*x),W=+(n*b-i*E+o*x),Y=+(i*I-o*D+s*w),Q=-(n*I-o*L+s*B),K=+(n*D-i*L+s*F),Z=-(n*w-i*B+o*F),J=-(i*N-o*V+s*U),q=+(n*N-o*G+s*k),$=-(n*V-i*G+s*z),ee=+(n*U-i*k+o*z);return e.FromValuesToRef(C*O,H*O,Y*O,J*O,P*O,j*O,Q*O,q*O,M*O,X*O,K*O,$*O,S*O,W*O,Z*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.setTranslation=function(e){return this.setTranslationFromFloats(e.x,e.y,e.z)},e.prototype.getTranslation=function(){return new d(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);for(var r=0;r<16;r++)e[t+r]=this._m[r];return 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],c=n[3],l=n[4],u=n[5],h=n[6],d=n[7],f=n[8],p=n[9],g=n[10],m=n[11],_=n[12],v=n[13],A=n[14],y=n[15],b=i[0],T=i[1],E=i[2],x=i[3],C=i[4],P=i[5],M=i[6],S=i[7],R=i[8],O=i[9],I=i[10],D=i[11],w=i[12],L=i[13],B=i[14],F=i[15];return t[r]=o*b+s*C+a*R+c*w,t[r+1]=o*T+s*P+a*O+c*L,t[r+2]=o*E+s*M+a*I+c*B,t[r+3]=o*x+s*S+a*D+c*F,t[r+4]=l*b+u*C+h*R+d*w,t[r+5]=l*T+u*P+h*O+d*L,t[r+6]=l*E+u*M+h*I+d*B,t[r+7]=l*x+u*S+h*D+d*F,t[r+8]=f*b+p*C+g*R+m*w,t[r+9]=f*T+p*P+g*O+m*L,t[r+10]=f*E+p*M+g*I+m*B,t[r+11]=f*x+p*S+g*D+m*F,t[r+12]=_*b+v*C+A*R+y*w,t[r+13]=_*T+v*P+A*O+y*L,t[r+14]=_*E+v*M+A*I+y*B,t[r+15]=_*x+v*S+A*D+y*F,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=this._m[0]||0,t=1;t<16;t++)e=397*e^(this._m[t]||0);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||I.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,I.Matrix[0]),g.FromRotationMatrixToRef(I.Matrix[0],r)}return!0},e.prototype.getRow=function(e){if(e<0||e>3)return null;var t=4*e;return new f(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=I.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=I.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:!0,configurable:!0}),e.FromValuesToRef=function(e,t,r,n,i,o,s,a,c,l,u,h,d,f,p,g,m){var _=m._m;_[0]=e,_[1]=t,_[2]=r,_[3]=n,_[4]=i,_[5]=o,_[6]=s,_[7]=a,_[8]=c,_[9]=l,_[10]=u,_[11]=h,_[12]=d,_[13]=f,_[14]=p,_[15]=g,m._markAsUpdated()},e.FromValues=function(t,r,n,i,o,s,a,c,l,u,h,d,f,p,g,m){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]=c,v[8]=l,v[9]=u,v[10]=h,v[11]=d,v[12]=f,v[13]=p,v[14]=g,v[15]=m,_._markAsUpdated(),_},e.Compose=function(t,r,n){var i=new e;return e.ComposeToRef(t,r,n,i),i},e.ComposeToRef=function(t,r,n,i){e.ScalingToRef(t.x,t.y,t.z,I.Matrix[1]),r.toRotationMatrix(I.Matrix[0]),I.Matrix[1].multiplyToRef(I.Matrix[0],i),i.setTranslation(n)},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.RotationYawPitchRoll=function(t,r,n){var i=new e;return e.RotationYawPitchRollToRef(t,r,n,i),i},e.RotationYawPitchRollToRef=function(e,t,r,n){g.RotationYawPitchRollToRef(e,t,r,I.Quaternion[0]),I.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=I.Vector3[0],s=I.Quaternion[0],a=I.Vector3[1];t.decompose(o,s,a);var c=I.Vector3[2],l=I.Quaternion[1],u=I.Vector3[3];r.decompose(c,l,u);var h=I.Vector3[4];d.LerpToRef(o,c,n,h);var f=I.Quaternion[2];g.SlerpToRef(s,l,n,f);var p=I.Vector3[5];d.LerpToRef(a,u,n,p),e.ComposeToRef(h,f,p,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=I.Vector3[0],s=I.Vector3[1],a=I.Vector3[2];r.subtractToRef(t,a),a.normalize(),d.CrossToRef(n,a,o);var c=o.lengthSquared();0===c?o.x=1:o.normalizeFromLength(Math.sqrt(c)),d.CrossToRef(a,o,s),s.normalize();var l=-d.Dot(o,t),u=-d.Dot(s,t),h=-d.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,l,u,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=I.Vector3[0],s=I.Vector3[1],a=I.Vector3[2];t.subtractToRef(r,a),a.normalize(),d.CrossToRef(n,a,o);var c=o.lengthSquared();0===c?o.x=1:o.normalizeFromLength(Math.sqrt(c)),d.CrossToRef(a,o,s),s.normalize();var l=-d.Dot(o,t),u=-d.Dot(s,t),h=-d.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,l,u,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,c=2/(i-n),l=-(i+n)/(i-n);e.FromValuesToRef(s,0,0,0,0,a,0,0,0,0,c,0,0,0,l,1,o),o._updateIdentityStatus(1===s&&1===a&&1===c&&0===l)},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 c=2/(r-t),l=2/(i-n),u=2/(s-o),h=-(s+o)/(s-o),d=(t+r)/(t-r),f=(i+n)/(n-i);e.FromValuesToRef(c,0,0,0,0,l,0,0,0,0,u,0,d,f,h,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,c=(i+n)/(i-n),l=-2*i*n/(i-n);return e.FromValuesToRef(s,0,0,0,0,a,0,0,0,0,c,1,0,0,l,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,c=i,l=1/Math.tan(.5*t),u=s?l/r:l,h=s?l:l*r,d=(c+a)/(c-a),f=-2*c*a/(c-a);e.FromValuesToRef(u,0,0,0,0,h,0,0,0,0,d,1,0,0,f,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,c=i,l=1/Math.tan(.5*t),u=s?l/r:l,h=s?l:l*r,d=-(c+a)/(c-a),f=-2*c*a/(c-a);e.FromValuesToRef(u,0,0,0,0,h,0,0,0,0,d,-1,0,0,f,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),c=Math.tan(e.leftDegrees*Math.PI/180),l=Math.tan(e.rightDegrees*Math.PI/180),u=2/(c+l),h=2/(s+a),d=n._m;d[0]=u,d[1]=d[2]=d[3]=d[4]=0,d[5]=h,d[6]=d[7]=0,d[8]=(c-l)*u*.5,d[9]=-(s-a)*h*.5,d[10]=-r/(t-r),d[11]=1*o,d[12]=d[13]=d[15]=0,d[14]=-2*r*t/(r-t),n._markAsUpdated()},e.GetFinalMatrix=function(t,r,n,i,o,s){var a=t.width,c=t.height,l=t.x,u=t.y,h=e.FromValues(a/2,0,0,0,0,-c/2,0,0,0,0,s-o,0,l+a/2,c/2+u,o,1),d=I.Matrix[0];return r.multiplyToRef(n,d),d.multiplyToRef(i,d),d.multiply(h)},e.GetAsMatrix2x2=function(e){var t=e.m;return new Float32Array([t[0],t[1],t[4],t[5]])},e.GetAsMatrix3x3=function(e){var t=e.m;return new Float32Array([t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]])},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,c=-2*o;e.FromValuesToRef(s*n+1,a*n,c*n,0,s*i,a*i+1,c*i,0,s*o,a*o,c*o+1,0,s*t.d,a*t.d,c*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,c=e.y*e.w,l=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-c),t._m[3]=0,t._m[4]=2*(o-s),t._m[5]=1-2*(i+r),t._m[6]=2*(l+u),t._m[7]=0,t._m[8]=2*(a+c),t._m[9]=2*(l-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}(),_=function(){function e(e,t,r,n){this.normal=new d(e,t,r),this.d=n}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^(this.d||0)},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=I.Matrix[0];m.TransposeToRef(t,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,c=r.y-e.y,l=r.z-e.z,u=o*l-s*c,h=s*a-i*l,d=i*c-o*a,f=Math.sqrt(u*u+h*h+d*d);return n=0!==f?1/f:0,this.normal.x=u*n,this.normal.y=h*n,this.normal.z=d*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 d.Dot(this.normal,e)<=t},e.prototype.signedDistanceTo=function(e){return d.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 n=-(t.x*e.x+t.y*e.y+t.z*e.z);return d.Dot(r,t)+n},e}(),v=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}(),A=function(){function e(){}return e.GetPlanes=function(t){for(var r=[],n=0;n<6;n++)r.push(new _(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}();!function(e){e[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE"}(n||(n={}));var y,b=function(){function e(){}return e.X=new d(1,0,0),e.Y=new d(0,1,0),e.Z=new d(0,0,1),e}(),T=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,c=e,l=0;l<5;l++){var u=c*c;c-=(o*(u*c)+s*u+a*c-e)*(1/(3*o*u+2*s*c+a)),c=Math.min(1,Math.max(0,c))}return 3*Math.pow(1-c,2)*c*r+3*(1-c)*Math.pow(c,2)*i+Math.pow(c,3)},e}();!function(e){e[e.CW=0]="CW",e[e.CCW=1]="CCW"}(y||(y={}));var E=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}(),x=function(){return function(e,t,r){this.startPoint=e,this.midPoint=t,this.endPoint=r;var n=Math.pow(t.x,2)+Math.pow(t.y,2),i=(Math.pow(e.x,2)+Math.pow(e.y,2)-n)/2,o=(n-Math.pow(r.x,2)-Math.pow(r.y,2))/2,s=(e.x-t.x)*(t.y-r.y)-(t.x-r.x)*(e.y-t.y);this.centerPoint=new h((i*(t.y-r.y)-o*(e.y-t.y))/s,((e.x-t.x)*o-(t.x-r.x)*i)/s),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=E.BetweenTwoPoints(this.centerPoint,this.startPoint);var a=this.startAngle.degrees(),c=E.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),l=E.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();c-a>180&&(c-=360),c-a<-180&&(c+=360),l-c>180&&(l-=360),l-c<-180&&(l+=360),this.orientation=c-a<0?y.CW:y.CCW,this.angle=E.FromDegrees(this.orientation===y.CW?a-l:l-a)}}(),C=function(){function e(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new h(e,t))}return e.prototype.addLineTo=function(e,t){if(this.closed)return this;var r=new h(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,n,i){if(void 0===i&&(i=36),this.closed)return this;var o=this._points[this._points.length-1],s=new h(e,t),a=new h(r,n),c=new x(o,s,a),l=c.angle.radians()/i;c.orientation===y.CW&&(l*=-1);for(var u=c.startAngle.radians()+l,d=0;d<i;d++){var f=Math.cos(u)*c.radius+c.centerPoint.x,p=Math.sin(u)*c.radius+c.centerPoint.y;this.addLineTo(f,p),u+=l}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 h.Zero();for(var t=e*this.length(),r=0,n=0;n<this._points.length;n++){var i=(n+1)%this._points.length,o=this._points[n],s=this._points[i].subtract(o),a=s.length()+r;if(t>=r&&t<=a){var c=s.normalize(),l=t-r;return new h(o.x+c.x*l,o.y+c.y*l)}r=a}return h.Zero()},e.StartingAt=function(t,r){return new e(t,r)},e}(),P=function(){function e(e,t,r){void 0===t&&(t=null),this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array;for(var n=0;n<e.length;n++)this._curve[n]=e[n].clone();this._raw=r||!1,this._compute(t)}return e.prototype.getCurve=function(){return this._curve},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.update=function(e,t){void 0===t&&(t=null);for(var r=0;r<e.length;r++)this._curve[r].x=e[r].x,this._curve[r].y=e[r].y,this._curve[r].z=e[r].z;return this._compute(t),this},e.prototype._compute=function(e){var t=this._curve.length;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[t-1]=this._curve[t-1].subtract(this._curve[t-2]),this._raw||this._tangents[t-1].normalize();var r,n,i,o,s=this._tangents[0],a=this._normalVector(s,e);this._normals[0]=a,this._raw||this._normals[0].normalize(),this._binormals[0]=d.Cross(s,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(var c=1;c<t;c++)r=this._getLastNonNullVector(c),c<t-1&&(n=this._getFirstNonNullVector(c),this._tangents[c]=r.add(n),this._tangents[c].normalize()),this._distances[c]=this._distances[c-1]+r.length(),i=this._tangents[c],o=this._binormals[c-1],this._normals[c]=d.Cross(o,i),this._raw||this._normals[c].normalize(),this._binormals[c]=d.Cross(i,this._normals[c]),this._raw||this._binormals[c].normalize()},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,i=e.length();(0===i&&(i=1),null==t)?(n=o.Scalar.WithinEpsilon(Math.abs(e.y)/i,1,c)?o.Scalar.WithinEpsilon(Math.abs(e.x)/i,1,c)?o.Scalar.WithinEpsilon(Math.abs(e.z)/i,1,c)?d.Zero():new d(0,0,1):new d(1,0,0):new d(0,-1,0),r=d.Cross(e,n)):(r=d.Cross(e,t),d.CrossToRef(r,e,r));return r.normalize(),r},e}(),M=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 o=new Array,s=function(e,t,r,n){return(1-e)*(1-e)*t+2*e*(1-e)*r+e*e*n},a=0;a<=i;a++)o.push(new d(s(a/i,t.x,r.x,n.x),s(a/i,t.y,r.y,n.y),s(a/i,t.z,r.z,n.z)));return new e(o)},e.CreateCubicBezier=function(t,r,n,i,o){o=o>3?o:4;for(var s=new Array,a=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<=o;c++)s.push(new d(a(c/o,t.x,r.x,n.x,i.x),a(c/o,t.y,r.y,n.y,i.y),a(c/o,t.z,r.z,n.z,i.z)));return new e(s)},e.CreateHermiteSpline=function(t,r,n,i,o){for(var s=new Array,a=1/o,c=0;c<=o;c++)s.push(d.Hermite(t,r,n,i,c*a));return new e(s)},e.CreateCatmullRomSpline=function(t,r,n){var i=new Array,o=1/r,s=0;if(n){for(var a=t.length,c=0;c<a;c++){s=0;for(var l=0;l<r;l++)i.push(d.CatmullRom(t[c%a],t[(c+1)%a],t[(c+2)%a],t[(c+3)%a],s)),s+=o}i.push(i[0])}else{var u=new Array;u.push(t[0].clone()),Array.prototype.push.apply(u,t),u.push(t[t.length-1].clone());for(c=0;c<u.length-3;c++){s=0;for(l=0;l<r;l++)i.push(d.CatmullRom(u[c],u[c+1],u[c+2],u[c+3],s)),s+=o}c--,i.push(d.CatmullRom(u[c],u[c+1],u[c+2],u[c+3],s))}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}(),S=function(){function e(e,t){void 0===e&&(e=d.Zero()),void 0===t&&(t=d.Up()),this.position=e,this.normal=t}return e.prototype.clone=function(){return new e(this.position.clone(),this.normal.clone())},e}(),R=function(){function e(e,t,r){void 0===e&&(e=d.Zero()),void 0===t&&(t=d.Up()),void 0===r&&(r=h.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}(),O=function(){function e(){}return e.Color3=i.ArrayTools.BuildArray(3,l.Black),e.Color4=i.ArrayTools.BuildArray(3,function(){return new u(0,0,0,0)}),e.Vector2=i.ArrayTools.BuildArray(3,h.Zero),e.Vector3=i.ArrayTools.BuildArray(13,d.Zero),e.Vector4=i.ArrayTools.BuildArray(3,f.Zero),e.Quaternion=i.ArrayTools.BuildArray(2,g.Zero),e.Matrix=i.ArrayTools.BuildArray(8,m.Identity),e}(),I=function(){function e(){}return e.Vector3=i.ArrayTools.BuildArray(6,d.Zero),e.Matrix=i.ArrayTools.BuildArray(2,m.Identity),e.Quaternion=i.ArrayTools.BuildArray(3,g.Zero),e}()},"./Maths/sphericalPolynomial.ts":
- /*!**************************************!*\
- !*** ./Maths/sphericalPolynomial.ts ***!
- \**************************************/
- /*! exports provided: SphericalPolynomial, SphericalHarmonics */function(e,t,r){"use strict";r.r(t),r.d(t,"SphericalPolynomial",function(){return i}),r.d(t,"SphericalHarmonics",function(){return o});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=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 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.scale=function(e){this.x=this.x.scale(e),this.y=this.y.scale(e),this.z=this.z.scale(e),this.xx=this.xx.scale(e),this.yy=this.yy.scale(e),this.zz=this.zz.scale(e),this.yz=this.yz.scale(e),this.zx=this.zx.scale(e),this.xy=this.xy.scale(e)},e.FromHarmonics=function(t){var r=new e;return r.x=t.l11.scale(1.02333),r.y=t.l1_1.scale(1.02333),r.z=t.l10.scale(1.02333),r.xx=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).add(t.lL22.scale(.429043)),r.yy=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).subtract(t.lL22.scale(.429043)),r.zz=t.l00.scale(.886277).add(t.l20.scale(.495417)),r.yz=t.l2_1.scale(.858086),r.zx=t.l21.scale(.858086),r.xy=t.l2_2.scale(.858086),r.scale(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}(),o=function(){function e(){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.lL22=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(.282095)),this.l1_1=this.l1_1.add(i.scale(.488603*e.y)),this.l10=this.l10.add(i.scale(.488603*e.z)),this.l11=this.l11.add(i.scale(.488603*e.x)),this.l2_2=this.l2_2.add(i.scale(1.092548*e.x*e.y)),this.l2_1=this.l2_1.add(i.scale(1.092548*e.y*e.z)),this.l21=this.l21.add(i.scale(1.092548*e.x*e.z)),this.l20=this.l20.add(i.scale(.315392*(3*e.z*e.z-1))),this.lL22=this.lL22.add(i.scale(.546274*(e.x*e.x-e.y*e.y)))},e.prototype.scale=function(e){this.l00=this.l00.scale(e),this.l1_1=this.l1_1.scale(e),this.l10=this.l10.scale(e),this.l11=this.l11.scale(e),this.l2_2=this.l2_2.scale(e),this.l2_1=this.l2_1.scale(e),this.l20=this.l20.scale(e),this.l21=this.l21.scale(e),this.lL22=this.lL22.scale(e)},e.prototype.convertIncidentRadianceToIrradiance=function(){this.l00=this.l00.scale(3.141593),this.l1_1=this.l1_1.scale(2.094395),this.l10=this.l10.scale(2.094395),this.l11=this.l11.scale(2.094395),this.l2_2=this.l2_2.scale(.785398),this.l2_1=this.l2_1.scale(.785398),this.l20=this.l20.scale(.785398),this.l21=this.l21.scale(.785398),this.lL22=this.lL22.scale(.785398)},e.prototype.convertIrradianceToLambertianRadiance=function(){this.scale(1/Math.PI)},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.lL22=t.xx.scale(1.16538).subtract(t.yy.scale(1.16538)),r.scale(Math.PI),r},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.lL22),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 s});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.VertexData.CreateBox=function(e){for(var t=[new n.Vector3(0,0,1),new n.Vector3(0,0,-1),new n.Vector3(1,0,0),new n.Vector3(-1,0,0),new n.Vector3(0,1,0),new n.Vector3(0,-1,0)],r=[],i=[],s=[],a=[],c=e.width||e.size||1,l=e.height||e.size||1,u=e.depth||e.size||1,h=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,d=e.faceUV||new Array(6),f=e.faceColors,p=[],g=0;g<6;g++)void 0===d[g]&&(d[g]=new n.Vector4(0,0,1,1)),f&&void 0===f[g]&&(f[g]=new n.Color4(1,1,1,1));for(var m=new n.Vector3(c/2,l/2,u/2),_=0;_<t.length;_++){var v=t[_],A=new n.Vector3(v.y,v.z,v.x),y=n.Vector3.Cross(v,A),b=i.length/3;r.push(b),r.push(b+1),r.push(b+2),r.push(b),r.push(b+2),r.push(b+3);var T=v.subtract(A).subtract(y).multiply(m);i.push(T.x,T.y,T.z),s.push(v.x,v.y,v.z),a.push(d[_].z,d[_].w),f&&p.push(f[_].r,f[_].g,f[_].b,f[_].a),T=v.subtract(A).add(y).multiply(m),i.push(T.x,T.y,T.z),s.push(v.x,v.y,v.z),a.push(d[_].x,d[_].w),f&&p.push(f[_].r,f[_].g,f[_].b,f[_].a),T=v.add(A).add(y).multiply(m),i.push(T.x,T.y,T.z),s.push(v.x,v.y,v.z),a.push(d[_].x,d[_].y),f&&p.push(f[_].r,f[_].g,f[_].b,f[_].a),T=v.add(A).subtract(y).multiply(m),i.push(T.x,T.y,T.z),s.push(v.x,v.y,v.z),a.push(d[_].z,d[_].y),f&&p.push(f[_].r,f[_].g,f[_].b,f[_].a)}o.VertexData._ComputeSides(h,i,r,s,a,e.frontUVs,e.backUVs);var E=new o.VertexData;if(E.indices=r,E.positions=i,E.normals=s,E.uvs=a,f){var x=h===o.VertexData.DOUBLESIDE?p.concat(p):p;E.colors=x}return E},i.Mesh.CreateBox=function(e,t,r,n,i){void 0===r&&(r=null);var o={size:t,sideOrientation:i,updatable:n};return s.CreateBox(e,o,r)};var s=function(){function e(){}return e.CreateBox=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.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 a});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),s=r(/*! ../../scene */"./scene.ts");o.VertexData.CreateCylinder=function(e){var t,r=e.height||2,i=0===e.diameterTop?0:e.diameterTop||e.diameter||1,s=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1,a=e.tessellation||24,c=e.subdivisions||1,l=!!e.hasRings,u=!!e.enclose,h=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,d=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,f=e.faceUV||new Array(3),p=e.faceColors,g=2+(1+(1!==h&&u?2:0))*(l?c:1);for(t=0;t<g;t++)p&&void 0===p[t]&&(p[t]=new n.Color4(1,1,1,1));for(t=0;t<g;t++)f&&void 0===f[t]&&(f[t]=new n.Vector4(0,0,1,1));var m,_,v,A,y,b,T=new Array,E=new Array,x=new Array,C=new Array,P=new Array,M=2*Math.PI*h/a,S=(s-i)/2/r,R=n.Vector3.Zero(),O=n.Vector3.Zero(),I=n.Vector3.Zero(),D=n.Vector3.Zero(),w=n.Vector3.Zero(),L=n.Axis.Y,B=1,F=1,N=0,V=0;for(A=0;A<=c;A++)for(v=((_=A/c)*(i-s)+s)/2,B=l&&0!==A&&A!==c?2:1,b=0;b<B;b++){for(l&&(F+=b),u&&(F+=2*b),y=0;y<=a;y++)m=y*M,R.x=Math.cos(-m)*v,R.y=-r/2+_*r,R.z=Math.sin(-m)*v,0===i&&A===c?(O.x=x[x.length-3*(a+1)],O.y=x[x.length-3*(a+1)+1],O.z=x[x.length-3*(a+1)+2]):(O.x=R.x,O.z=R.z,O.y=Math.sqrt(O.x*O.x+O.z*O.z)*S,O.normalize()),0===y&&(I.copyFrom(R),D.copyFrom(O)),E.push(R.x,R.y,R.z),x.push(O.x,O.y,O.z),V=l?N!==F?f[F].y:f[F].w:f[F].y+(f[F].w-f[F].y)*_,C.push(f[F].x+(f[F].z-f[F].x)*y/a,V),p&&P.push(p[F].r,p[F].g,p[F].b,p[F].a);1!==h&&u&&(E.push(R.x,R.y,R.z),E.push(0,R.y,0),E.push(0,R.y,0),E.push(I.x,I.y,I.z),n.Vector3.CrossToRef(L,O,w),w.normalize(),x.push(w.x,w.y,w.z,w.x,w.y,w.z),n.Vector3.CrossToRef(D,L,w),w.normalize(),x.push(w.x,w.y,w.z,w.x,w.y,w.z),V=l?N!==F?f[F+1].y:f[F+1].w:f[F+1].y+(f[F+1].w-f[F+1].y)*_,C.push(f[F+1].x,V),C.push(f[F+1].z,V),V=l?N!==F?f[F+2].y:f[F+2].w:f[F+2].y+(f[F+2].w-f[F+2].y)*_,C.push(f[F+2].x,V),C.push(f[F+2].z,V),p&&(P.push(p[F+1].r,p[F+1].g,p[F+1].b,p[F+1].a),P.push(p[F+1].r,p[F+1].g,p[F+1].b,p[F+1].a),P.push(p[F+2].r,p[F+2].g,p[F+2].b,p[F+2].a),P.push(p[F+2].r,p[F+2].g,p[F+2].b,p[F+2].a))),N!==F&&(N=F)}var U=1!==h&&u?a+4:a;for(A=0,F=0;F<c;F++){var G=0,k=0,z=0,H=0;for(y=0;y<a;y++)G=A*(U+1)+y,k=(A+1)*(U+1)+y,z=A*(U+1)+(y+1),H=(A+1)*(U+1)+(y+1),T.push(G,k,z),T.push(H,z,k);1!==h&&u&&(T.push(G+2,k+2,z+2),T.push(H+2,z+2,k+2),T.push(G+4,k+4,z+4),T.push(H+4,z+4,k+4)),A=l?A+2:A+1}var j=function(e){var t=e?i/2:s/2;if(0!==t){var o,c,l,u=e?f[g-1]:f[0],d=null;p&&(d=e?p[g-1]:p[0]);var m=E.length/3,_=e?r/2:-r/2,v=new n.Vector3(0,_,0);E.push(v.x,v.y,v.z),x.push(0,e?1:-1,0),C.push(u.x+.5*(u.z-u.x),u.y+.5*(u.w-u.y)),d&&P.push(d.r,d.g,d.b,d.a);var A=new n.Vector2(.5,.5);for(l=0;l<=a;l++){o=2*Math.PI*l*h/a;var y=Math.cos(-o),b=Math.sin(-o);c=new n.Vector3(y*t,_,b*t);var M=new n.Vector2(y*A.x+.5,b*A.y+.5);E.push(c.x,c.y,c.z),x.push(0,e?1:-1,0),C.push(u.x+(u.z-u.x)*M.x,u.y+(u.w-u.y)*M.y),d&&P.push(d.r,d.g,d.b,d.a)}for(l=0;l<a;l++)e?(T.push(m),T.push(m+(l+2)),T.push(m+(l+1))):(T.push(m),T.push(m+(l+1)),T.push(m+(l+2)))}};j(!1),j(!0),o.VertexData._ComputeSides(d,E,T,x,C,e.frontUVs,e.backUVs);var X=new o.VertexData;return X.indices=T,X.positions=E,X.normals=x,X.uvs=C,p&&(X.colors=P),X},i.Mesh.CreateCylinder=function(e,t,r,n,o,c,l,u,h){void 0!==l&&l instanceof s.Scene||(void 0!==l&&(h=u||i.Mesh.DEFAULTSIDE,u=l),l=c,c=1);var d={height:t,diameterTop:r,diameterBottom:n,tessellation:o,subdivisions:c,sideOrientation:h,updatable:u};return a.CreateCylinder(e,d,l)};var a=function(){function e(){}return e.CreateCylinder=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.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 a});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../buffer */"./Meshes/buffer.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");i.Mesh.CreateDecal=function(e,t,r,n,i,o){var s={position:r,normal:n,size:i,angle:o};return a.CreateDecal(e,t,s)};var a=function(){function e(){}return e.CreateDecal=function(e,t,r){var a=t.getIndices(),c=t.getVerticesData(o.VertexBuffer.PositionKind),l=t.getVerticesData(o.VertexBuffer.NormalKind),u=r.position||n.Vector3.Zero(),h=r.normal||n.Vector3.Up(),d=r.size||n.Vector3.One(),f=r.angle||0;if(!h){var p=new n.Vector3(0,0,1),g=t.getScene().activeCamera,m=n.Vector3.TransformCoordinates(p,g.getWorldMatrix());h=g.globalPosition.subtract(m)}var _=-Math.atan2(h.z,h.x)-Math.PI/2,v=Math.sqrt(h.x*h.x+h.z*h.z),A=Math.atan2(h.y,v),y=n.Matrix.RotationYawPitchRoll(_,A,f).multiply(n.Matrix.Translation(u.x,u.y,u.z)),b=n.Matrix.Invert(y),T=t.getWorldMatrix().multiply(b),E=new s.VertexData;E.indices=[],E.positions=[],E.normals=[],E.uvs=[];for(var x=0,C=function(e){var t=new n.PositionNormalVertex;if(!a||!c||!l)return t;var r=a[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,T),t.normal=new n.Vector3(l[3*r],l[3*r+1],l[3*r+2]),t.normal=n.Vector3.TransformNormal(t.normal,T),t},P=function(e,t){if(0===e.length)return e;for(var r=.5*Math.abs(n.Vector3.Dot(d,t)),i=function(e,i){var o=n.Vector3.GetClipFactor(e.position,i.position,t,r);return new n.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 a,c,l,u=null,h=null,f=null,p=null;switch(((a=n.Vector3.Dot(e[s].position,t)-r>0)?1:0)+((c=n.Vector3.Dot(e[s+1].position,t)-r>0)?1:0)+((l=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(a&&(u=e[s+1],h=e[s+2],f=i(e[s],u),p=i(e[s],h)),c){u=e[s],h=e[s+2],f=i(e[s+1],u),p=i(e[s+1],h),o.push(f),o.push(h.clone()),o.push(u.clone()),o.push(h.clone()),o.push(f.clone()),o.push(p);break}l&&(u=e[s],h=e[s+1],f=i(e[s+2],u),p=i(e[s+2],h)),u&&h&&f&&p&&(o.push(u.clone()),o.push(h.clone()),o.push(f),o.push(p),o.push(f.clone()),o.push(h.clone()));break;case 2:a||(h=i(u=e[s].clone(),e[s+1]),f=i(u,e[s+2]),o.push(u),o.push(h),o.push(f)),c||(h=i(u=e[s+1].clone(),e[s+2]),f=i(u,e[s]),o.push(u),o.push(h),o.push(f)),l||(h=i(u=e[s+2].clone(),e[s]),f=i(u,e[s+1]),o.push(u),o.push(h),o.push(f))}}return o},M=0;M<a.length;M+=3){var S=new Array;if(S.push(C(M)),S.push(C(M+1)),S.push(C(M+2)),S=P(S,new n.Vector3(1,0,0)),S=P(S,new n.Vector3(-1,0,0)),S=P(S,new n.Vector3(0,1,0)),S=P(S,new n.Vector3(0,-1,0)),S=P(S,new n.Vector3(0,0,1)),0!==(S=P(S,new n.Vector3(0,0,-1))).length)for(var R=0;R<S.length;R++){var O=S[R];E.indices.push(x),O.position.toArray(E.positions,3*x),O.normal.toArray(E.normals,3*x),E.uvs.push(.5+O.position.x/d.x),E.uvs.push(.5+O.position.y/d.y),x++}}var I=new i.Mesh(e,t.getScene());return E.applyToMesh(I),I.position=u.clone(),I.rotation=new n.Vector3(A,_,f),I},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,c=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,l=0===e.sideOrientation?0:e.sideOrientation||i.VertexData.DEFAULTSIDE;t.push(0,0,0),o.push(.5,.5);for(var u=2*Math.PI*c,h=u/a,d=0;d<u;d+=h){var f=Math.cos(d),p=Math.sin(d),g=(f+1)/2,m=(1-p)/2;t.push(s*f,s*p,0),o.push(g,m)}1===c&&(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(l,t,r,n,o,e.frontUVs,e.backUVs);var A=new i.VertexData;return A.indices=r,A.positions=t,A.normals=n,A.uvs=o,A},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 c});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),s=r(/*! ../groundMesh */"./Meshes/groundMesh.ts"),a=r(/*! ../../Misc/tools */"./Misc/tools.ts");o.VertexData.CreateGround=function(e){var t,r,i=[],s=[],a=[],c=[],l=e.width||1,u=e.height||1,h=e.subdivisionsX||e.subdivisions||1,d=e.subdivisionsY||e.subdivisions||1;for(t=0;t<=d;t++)for(r=0;r<=h;r++){var f=new n.Vector3(r*l/h-l/2,0,(d-t)*u/d-u/2),p=new n.Vector3(0,1,0);s.push(f.x,f.y,f.z),a.push(p.x,p.y,p.z),c.push(r/h,1-t/d)}for(t=0;t<d;t++)for(r=0;r<h;r++)i.push(r+1+(t+1)*(h+1)),i.push(r+1+t*(h+1)),i.push(r+t*(h+1)),i.push(r+(t+1)*(h+1)),i.push(r+1+(t+1)*(h+1)),i.push(r+t*(h+1));var g=new o.VertexData;return g.indices=i,g.positions=s,g.normals=a,g.uvs=c,g},o.VertexData.CreateTiledGround=function(e){var t,r,i,s,a=void 0!==e.xmin&&null!==e.xmin?e.xmin:-1,c=void 0!==e.zmin&&null!==e.zmin?e.zmin:-1,l=void 0!==e.xmax&&null!==e.xmax?e.xmax:1,u=void 0!==e.zmax&&null!==e.zmax?e.zmax:1,h=e.subdivisions||{w:1,h:1},d=e.precision||{w:1,h:1},f=new Array,p=new Array,g=new Array,m=new Array;h.h=h.h<1?1:h.h,h.w=h.w<1?1:h.w,d.w=d.w<1?1:d.w,d.h=d.h<1?1:d.h;var _=(l-a)/h.w,v=(u-c)/h.h;function A(e,i,o,s){var a=p.length/3,c=d.w+1;for(t=0;t<d.h;t++)for(r=0;r<d.w;r++){var l=[a+r+t*c,a+(r+1)+t*c,a+(r+1)+(t+1)*c,a+r+(t+1)*c];f.push(l[1]),f.push(l[2]),f.push(l[3]),f.push(l[0]),f.push(l[1]),f.push(l[3])}var u=n.Vector3.Zero(),h=new n.Vector3(0,1,0);for(t=0;t<=d.h;t++)for(u.z=t*(s-i)/d.h+i,r=0;r<=d.w;r++)u.x=r*(o-e)/d.w+e,u.y=0,p.push(u.x,u.y,u.z),g.push(h.x,h.y,h.z),m.push(r/d.w,t/d.h)}for(i=0;i<h.h;i++)for(s=0;s<h.w;s++)A(a+s*_,c+i*v,a+(s+1)*_,c+(i+1)*v);var y=new o.VertexData;return y.indices=f,y.positions=p,y.normals=g,y.uvs=m,y},o.VertexData.CreateGroundFromHeightMap=function(e){var t,r,i=[],s=[],a=[],c=[],l=e.colorFilter||new n.Color3(.3,.59,.11),u=e.alphaFilter||0;for(t=0;t<=e.subdivisions;t++)for(r=0;r<=e.subdivisions;r++){var h=new n.Vector3(r*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-t)*e.height/e.subdivisions-e.height/2),d=4*(((h.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(h.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth),f=e.buffer[d]/255,p=e.buffer[d+1]/255,g=e.buffer[d+2]/255,m=e.buffer[d+3]/255,_=f*l.r+p*l.g+g*l.b;h.y=m>=u?e.minHeight+(e.maxHeight-e.minHeight)*_:e.minHeight-n.Epsilon,s.push(h.x,h.y,h.z),a.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 v=r+1+(t+1)*(e.subdivisions+1),A=r+1+t*(e.subdivisions+1),y=r+t*(e.subdivisions+1),b=r+(t+1)*(e.subdivisions+1),T=s[3*v+1]>=e.minHeight,E=s[3*A+1]>=e.minHeight,x=s[3*y+1]>=e.minHeight;T&&E&&x&&(i.push(v),i.push(A),i.push(y)),s[3*b+1]>=e.minHeight&&T&&x&&(i.push(b),i.push(v),i.push(y))}o.VertexData.ComputeNormals(s,i,a);var C=new o.VertexData;return C.indices=i,C.positions=s,C.normals=a,C.uvs=c,C},i.Mesh.CreateGround=function(e,t,r,n,i,o){var s={width:t,height:r,subdivisions:n,updatable:o};return c.CreateGround(e,s,i)},i.Mesh.CreateTiledGround=function(e,t,r,n,i,o,s,a,l){var u={xmin:t,zmin:r,xmax:n,zmax:i,subdivisions:o,precision:s,updatable:l};return c.CreateTiledGround(e,u,a)},i.Mesh.CreateGroundFromHeightMap=function(e,t,r,n,i,o,s,a,l,u,h){var d={width:r,height:n,subdivisions:i,minHeight:o,maxHeight:s,updatable:l,onReady:u,alphaFilter:h};return c.CreateGroundFromHeightMap(e,t,d,a)};var c=function(){function e(){}return e.CreateGround=function(e,t,r){var n=new s.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,o.VertexData.CreateGround(t).applyToMesh(n,t.updatable),n._setReady(!0),n},e.CreateTiledGround=function(e,t,r){var n=new i.Mesh(e,r);return o.VertexData.CreateTiledGround(t).applyToMesh(n,t.updatable),n},e.CreateGroundFromHeightMap=function(e,t,r,i){var c=r.width||10,l=r.height||10,u=r.subdivisions||1,h=r.minHeight||0,d=r.maxHeight||1,f=r.colorFilter||new n.Color3(.3,.59,.11),p=r.alphaFilter||0,g=r.updatable,m=r.onReady,_=new s.GroundMesh(e,i);_._subdivisionsX=u,_._subdivisionsY=u,_._width=c,_._height=l,_._maxX=_._width/2,_._maxZ=_._height/2,_._minX=-_._maxX,_._minZ=-_._maxZ,_._setReady(!1);return a.Tools.LoadImage(t,function(e){var t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("Unable to get 2d context for CreateGroundFromHeightMap");if(!i.isDisposed){var n=e.width,s=e.height;t.width=n,t.height=s,r.drawImage(e,0,0);var a=r.getImageData(0,0,n,s).data;o.VertexData.CreateGroundFromHeightMap({width:c,height:l,subdivisions:u,minHeight:h,maxHeight:d,colorFilter:f,buffer:a,bufferWidth:n,bufferHeight:s,alphaFilter:p}).applyToMesh(_,g),m&&m(_),_._setReady(!0)}},function(){},i.offlineProvider),_},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 */"./Maths/math.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,c=e.radiusX||i,l=e.radiusY||i,u=e.radiusZ||i,h=(1+Math.sqrt(5))/2,d=[-1,h,-0,1,h,0,-1,-h,0,1,-h,0,0,-1,-h,0,1,-h,0,-1,h,0,1,h,h,0,1,h,0,-1,-h,0,1,-h,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],g=[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],m=[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,A=new Array,y=new Array,b=0,T=new Array(3),E=new Array(3);for(t=0;t<3;t++)T[t]=n.Vector3.Zero(),E[t]=n.Vector2.Zero();for(var x=0;x<20;x++){for(t=0;t<3;t++){var C=f[3*x+t];T[t].copyFromFloats(d[3*p[C]],d[3*p[C]+1],d[3*p[C]+2]),T[t].normalize().scaleInPlace(i),E[t].copyFromFloats(g[2*C]*(138/1024)+60/1024+m[x]*(-40/1024),g[2*C+1]*(239/1024)+26/1024+m[x]*(20/1024))}for(var P=function(e,t,r,i){var o,h=n.Vector3.Lerp(T[0],T[2],t/a),d=n.Vector3.Lerp(T[1],T[2],t/a),f=a===t?T[2]:n.Vector3.Lerp(h,d,e/(a-t));if(f.normalize(),s){var p=n.Vector3.Lerp(T[0],T[2],i/a),g=n.Vector3.Lerp(T[1],T[2],i/a);o=n.Vector3.Lerp(p,g,r/(a-i))}else o=new n.Vector3(f.x,f.y,f.z);o.x/=c,o.y/=l,o.z/=u,o.normalize();var m=n.Vector2.Lerp(E[0],E[2],t/a),x=n.Vector2.Lerp(E[1],E[2],t/a),C=a===t?E[2]:n.Vector2.Lerp(m,x,e/(a-t));v.push(f.x*c,f.y*l,f.z*u),A.push(o.x,o.y,o.z),y.push(C.x,C.y),_.push(b),b++},M=0;M<a;M++)for(var S=0;S+M<a;S++)P(S,M,S+1/3,M+1/3),P(S+1,M,S+1/3,M+1/3),P(S,M+1,S+1/3,M+1/3),S+M+1<a&&(P(S+1,M,S+2/3,M+2/3),P(S+1,M+1,S+2/3,M+2/3),P(S,M+1,S+2/3,M+2/3))}o.VertexData._ComputeSides(r,v,_,A,y,e.frontUVs,e.backUVs);var R=new o.VertexData;return R.indices=_,R.positions=v,R.normals=A,R.uvs=y,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){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, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, 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(/*! ./discBuilder */"./Meshes/Builders/discBuilder.ts");r.d(t,"DiscBuilder",function(){return i.DiscBuilder});var o=r(/*! ./ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts");r.d(t,"RibbonBuilder",function(){return o.RibbonBuilder});var s=r(/*! ./sphereBuilder */"./Meshes/Builders/sphereBuilder.ts");r.d(t,"SphereBuilder",function(){return s.SphereBuilder});var a=r(/*! ./cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts");r.d(t,"CylinderBuilder",function(){return a.CylinderBuilder});var c=r(/*! ./torusBuilder */"./Meshes/Builders/torusBuilder.ts");r.d(t,"TorusBuilder",function(){return c.TorusBuilder});var l=r(/*! ./torusKnotBuilder */"./Meshes/Builders/torusKnotBuilder.ts");r.d(t,"TorusKnotBuilder",function(){return l.TorusKnotBuilder});var u=r(/*! ./linesBuilder */"./Meshes/Builders/linesBuilder.ts");r.d(t,"LinesBuilder",function(){return u.LinesBuilder});var h=r(/*! ./polygonBuilder */"./Meshes/Builders/polygonBuilder.ts");r.d(t,"PolygonBuilder",function(){return h.PolygonBuilder});var d=r(/*! ./shapeBuilder */"./Meshes/Builders/shapeBuilder.ts");r.d(t,"ShapeBuilder",function(){return d.ShapeBuilder});var f=r(/*! ./latheBuilder */"./Meshes/Builders/latheBuilder.ts");r.d(t,"LatheBuilder",function(){return f.LatheBuilder});var p=r(/*! ./planeBuilder */"./Meshes/Builders/planeBuilder.ts");r.d(t,"PlaneBuilder",function(){return p.PlaneBuilder});var g=r(/*! ./groundBuilder */"./Meshes/Builders/groundBuilder.ts");r.d(t,"GroundBuilder",function(){return g.GroundBuilder});var m=r(/*! ./tubeBuilder */"./Meshes/Builders/tubeBuilder.ts");r.d(t,"TubeBuilder",function(){return m.TubeBuilder});var _=r(/*! ./polyhedronBuilder */"./Meshes/Builders/polyhedronBuilder.ts");r.d(t,"PolyhedronBuilder",function(){return _.PolyhedronBuilder});var v=r(/*! ./icoSphereBuilder */"./Meshes/Builders/icoSphereBuilder.ts");r.d(t,"IcoSphereBuilder",function(){return v.IcoSphereBuilder});var A=r(/*! ./decalBuilder */"./Meshes/Builders/decalBuilder.ts");r.d(t,"DecalBuilder",function(){return A.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 */"./Maths/math.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 c={shape:t,radius:r,tessellation:n,sideOrientation:a,updatable:o};return s.CreateLathe(e,c,i)};var s=function(){function e(){}return e.CreateLathe=function(e,t,r){var s,a=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,c=void 0===t.closed||t.closed,l=t.shape,u=t.radius||1,h=t.tessellation||64,d=t.clip||0,f=t.updatable,p=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),g=t.cap||i.Mesh.NO_CAP,m=2*Math.PI,_=new Array,v=t.invertUV||!1,A=0,y=0,b=m/h*a,T=new Array;for(A=0;A<=h-d;A++){T=[];for(g!=i.Mesh.CAP_START&&g!=i.Mesh.CAP_ALL||(T.push(new n.Vector3(0,l[0].y,0)),T.push(new n.Vector3(Math.cos(A*b)*l[0].x*u,l[0].y,Math.sin(A*b)*l[0].x*u))),y=0;y<l.length;y++)s=new n.Vector3(Math.cos(A*b)*l[y].x*u,l[y].y,Math.sin(A*b)*l[y].x*u),T.push(s);g!=i.Mesh.CAP_END&&g!=i.Mesh.CAP_ALL||(T.push(new n.Vector3(Math.cos(A*b)*l[l.length-1].x*u,l[l.length-1].y,Math.sin(A*b)*l[l.length-1].x*u)),T.push(new n.Vector3(0,l[l.length-1].y,0))),_.push(T)}return o.RibbonBuilder.CreateRibbon(e,{pathArray:_,closeArray:c,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 c});var n=r(/*! ../../Maths/math */"./Maths/math.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,c=0;c<n.length;c++)for(var l=n[c],u=0;u<l.length;u++){if(r.push(l[u].x,l[u].y,l[u].z),i){var h=i[c];s.push(h[u].r,h[u].g,h[u].b,h[u].a)}u>0&&(t.push(a-1),t.push(a)),a++}var d=new o.VertexData;return d.indices=t,d.positions=r,i&&(d.colors=s),d},o.VertexData.CreateDashedLines=function(e){var t,r,i=e.dashSize||3,s=e.gapSize||1,a=e.dashNb||200,c=e.points,l=new Array,u=new Array,h=n.Vector3.Zero(),d=0,f=0,p=0,g=0,m=0;for(m=0;m<c.length-1;m++)c[m+1].subtractToRef(c[m],h),d+=h.length();for(r=i*(t=d/a)/(i+s),m=0;m<c.length-1;m++){c[m+1].subtractToRef(c[m],h),f=Math.floor(h.length()/t),h.normalize();for(var _=0;_<f;_++)p=t*_,l.push(c[m].x+p*h.x,c[m].y+p*h.y,c[m].z+p*h.z),l.push(c[m].x+(p+r)*h.x,c[m].y+(p+r)*h.y,c[m].z+(p+r)*h.z),u.push(g,g+1),g+=2}var v=new o.VertexData;return v.positions=l,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 c.CreateLines(e,o,r)},i.Mesh.CreateDashedLines=function(e,t,r,n,i,o,s,a){void 0===o&&(o=null);var l={points:t,dashSize:r,gapSize:n,dashNb:i,updatable:s,instance:a};return c.CreateDashedLines(e,l,o)};var c=function(){function e(){}return e.CreateLineSystem=function(e,t,r){var n=t.instance,i=t.lines,c=t.colors;if(n){var l,u,h=n.getVerticesData(a.VertexBuffer.PositionKind);c&&(l=n.getVerticesData(a.VertexBuffer.ColorKind));for(var d=0,f=0,p=0;p<i.length;p++)for(var g=i[p],m=0;m<g.length;m++)h[d]=g[m].x,h[d+1]=g[m].y,h[d+2]=g[m].z,c&&l&&(u=c[p],l[f]=u[m].r,l[f+1]=u[m].g,l[f+2]=u[m].b,l[f+3]=u[m].a,f+=4),d+=3;return n.updateVerticesData(a.VertexBuffer.PositionKind,h,!1,!1),c&&l&&n.updateVerticesData(a.VertexBuffer.ColorKind,l,!1,!1),n}var _=!!c,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,c=t.instance,l=t.gapSize||1,u=t.dashSize||3;if(c){return c.updateMeshPositions(function(e){var t,r,i=n.Vector3.Zero(),o=e.length/6,s=0,l=0,u=0,h=0,d=0,f=0;for(d=0;d<a.length-1;d++)a[d+1].subtractToRef(a[d],i),s+=i.length();t=s/o;var p=c._creationDataStorage.dashSize;for(r=p*t/(p+c._creationDataStorage.gapSize),d=0;d<a.length-1;d++)for(a[d+1].subtractToRef(a[d],i),l=Math.floor(i.length()/t),i.normalize(),f=0;f<l&&h<e.length;)u=t*f,e[h]=a[d].x+u*i.x,e[h+1]=a[d].y+u*i.y,e[h+2]=a[d].z+u*i.z,e[h+3]=a[d].x+(u+r)*i.x,e[h+4]=a[d].y+(u+r)*i.y,e[h+5]=a[d].z+(u+r)*i.z,h+=6,f++;for(;h<e.length;)e[h]=a[d].x,e[h+1]=a[d].y,e[h+2]=a[d].z,h+=3},!1),c}var h=new s.LinesMesh(e,r);return o.VertexData.CreateDashedLines(t).applyToMesh(h,t.updatable),h._creationDataStorage=new i._CreationDataStorage,h._creationDataStorage.dashSize=u,h._creationDataStorage.gapSize=l,h},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,c=0===e.sideOrientation?0:e.sideOrientation||i.VertexData.DEFAULTSIDE,l=s/2,u=a/2;r.push(-l,-u,0),n.push(0,0,-1),o.push(0,0),r.push(l,-u,0),n.push(0,0,-1),o.push(1,0),r.push(l,u,0),n.push(0,0,-1),o.push(1,1),r.push(-l,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(c,r,t,n,o,e.frontUVs,e.backUVs);var h=new i.VertexData;return h.indices=t,h.positions=r,h.normals=n,h.uvs=o,h},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){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 c});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),s=r(/*! ../polygonMesh */"./Meshes/polygonMesh.ts"),a=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts");o.VertexData.CreatePolygon=function(e,t,r,i,s,c){for(var l=r||new Array(3),u=i,h=[],d=0;d<3;d++)void 0===l[d]&&(l[d]=new n.Vector4(0,0,1,1)),u&&void 0===u[d]&&(u[d]=new n.Color4(1,1,1,1));for(var f=e.getVerticesData(a.VertexBuffer.PositionKind),p=e.getVerticesData(a.VertexBuffer.NormalKind),g=e.getVerticesData(a.VertexBuffer.UVKind),m=e.getIndices(),_=0,v=0,A=0;A<p.length;A+=3)Math.abs(p[A+1])<.001&&(v=1),Math.abs(p[A+1]-1)<.001&&(v=0),Math.abs(p[A+1]+1)<.001&&(v=2),g[2*(_=A/3)]=(1-g[2*_])*l[v].x+g[2*_]*l[v].z,g[2*_+1]=(1-g[2*_+1])*l[v].y+g[2*_+1]*l[v].w,u&&h.push(u[v].r,u[v].g,u[v].b,u[v].a);o.VertexData._ComputeSides(t,f,m,p,g,s,c);var y=new o.VertexData;if(y.indices=m,y.positions=f,y.normals=p,y.uvs=g,u){var b=t===o.VertexData.DOUBLESIDE?h.concat(h):h;y.colors=b}return y},i.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 c.CreatePolygon(e,a,r,s)},i.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 c.ExtrudePolygon(e,l,n,a)};var c=function(){function e(){}return e.CreatePolygon=function(e,t,r,a){void 0===a&&(a=earcut),t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);for(var c=t.shape,l=t.holes||[],u=t.depth||0,h=[],d=[],f=0;f<c.length;f++)h[f]=new n.Vector2(c[f].x,c[f].z);h[0].equalsWithEpsilon(h[h.length-1],1e-8)&&h.pop();for(var p=new s.PolygonMeshBuilder(e,h,r,a),g=0;g<l.length;g++){d=[];for(var m=0;m<l[g].length;m++)d.push(new n.Vector2(l[g][m].x,l[g][m].z));p.addHole(d)}var _=p.build(t.updatable,u);return _._originalBuilderSideOrientation=t.sideOrientation,o.VertexData.CreatePolygon(_,t.sideOrientation,t.faceUV,t.faceColors,t.frontUVs,t.backUVs).applyToMesh(_,t.updatable),_},e.ExtrudePolygon=function(t,r,n,i){return 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 s});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.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,i,s,a,c,l,u=e.type&&(e.type<0||e.type>=t.length)?0:e.type||0,h=e.size,d=e.sizeX||h||1,f=e.sizeY||h||1,p=e.sizeZ||h||1,g=e.custom||t[u],m=g.face.length,_=e.faceUV||new Array(m),v=e.faceColors,A=void 0===e.flat||e.flat,y=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,b=new Array,T=new Array,E=new Array,x=new Array,C=new Array,P=0,M=0,S=new Array,R=0,O=0;if(A)for(O=0;O<m;O++)v&&void 0===v[O]&&(v[O]=new n.Color4(1,1,1,1)),_&&void 0===_[O]&&(_[O]=new n.Vector4(0,0,1,1));if(A)for(O=0;O<m;O++){var I=g.face[O].length;for(s=2*Math.PI/I,a=.5*Math.tan(s/2),c=.5,R=0;R<I;R++)b.push(g.vertex[g.face[O][R]][0]*d,g.vertex[g.face[O][R]][1]*f,g.vertex[g.face[O][R]][2]*p),S.push(P),P++,r=_[O].x+(_[O].z-_[O].x)*(.5+a),i=_[O].y+(_[O].w-_[O].y)*(c-.5),x.push(r,i),l=a*Math.cos(s)-c*Math.sin(s),c=a*Math.sin(s)+c*Math.cos(s),a=l,v&&C.push(v[O].r,v[O].g,v[O].b,v[O].a);for(R=0;R<I-2;R++)T.push(S[0+M],S[R+2+M],S[R+1+M]);M+=I}else{for(R=0;R<g.vertex.length;R++)b.push(g.vertex[R][0]*d,g.vertex[R][1]*f,g.vertex[R][2]*p),x.push(0,0);for(O=0;O<m;O++)for(R=0;R<g.face[O].length-2;R++)T.push(g.face[O][0],g.face[O][R+2],g.face[O][R+1])}o.VertexData.ComputeNormals(b,T,E),o.VertexData._ComputeSides(y,b,T,E,x,e.frontUVs,e.backUVs);var D=new o.VertexData;return D.positions=b,D.indices=T,D.normals=E,D.uvs=x,v&&A&&(D.colors=C),D},i.Mesh.CreatePolyhedron=function(e,t,r){return s.CreatePolyhedron(e,t,r)};var s=function(){function e(){}return e.CreatePolyhedron=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.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 c});var n=r(/*! ../../Maths/math */"./Maths/math.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),c=e.offset||a;c=c>a?a:Math.floor(c);var l,u,h,d,f=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,p=e.uvs,g=e.colors,m=[],_=[],v=[],A=[],y=[],b=[],T=[],E=[],x=[],C=[];if(t.length<2){var P=[],M=[];for(h=0;h<t[0].length-c;h++)P.push(t[0][h]),M.push(t[0][h+c]);t=[P,M]}var S,R,O,I,D,w=0,L=n?1:0;for(l=t[0].length,u=0;u<t.length;u++){for(T[u]=0,y[u]=[0],l=l<(R=(S=t[u]).length)?l:R,d=0;d<R;)m.push(S[d].x,S[d].y,S[d].z),d>0&&(O=S[d].subtract(S[d-1]).length()+T[u],y[u].push(O),T[u]=O),d++;n&&(d--,m.push(S[0].x,S[0].y,S[0].z),O=S[d].subtract(S[0]).length()+T[u],y[u].push(O),T[u]=O),x[u]=R+L,C[u]=w,w+=R+L}var B,F,N=null,V=null;for(h=0;h<l+L;h++){for(E[h]=0,b[h]=[0],u=0;u<t.length-1;u++)I=t[u],D=t[u+1],h===l?(N=I[0],V=D[0]):(N=I[h],V=D[h]),O=V.subtract(N).length()+E[h],b[h].push(O),E[h]=O;r&&V&&N&&(I=t[u],D=t[0],h===l&&(V=D[0]),O=V.subtract(N).length()+E[h],E[h]=O)}if(p)for(u=0;u<p.length;u++)A.push(p[u].x,p[u].y);else for(u=0;u<t.length;u++)for(h=0;h<l+L;h++)B=0!=T[u]?y[u][h]/T[u]:0,F=0!=E[h]?b[h][u]/E[h]:0,i?A.push(F,B):A.push(B,F);for(var U=0,G=x[u=0]-1,k=x[u+1]-1,z=G<k?G:k,H=C[1]-C[0],j=r?x.length:x.length-1;U<=z&&u<j;)_.push(U,U+H,U+1),_.push(U+H+1,U+1,U+H),(U+=1)===z&&(++u===x.length-1?(H=C[0]-C[u],G=x[u]-1,k=x[0]-1):(H=C[u+1]-C[u],G=x[u]-1,k=x[u+1]-1),U=C[u],z=G<k?G+U:k+U);if(s.VertexData.ComputeNormals(m,_,v),n){var X=0,W=0;for(u=0;u<t.length;u++)X=3*C[u],W=u+1<t.length?3*(C[u+1]-1):v.length-3,v[X]=.5*(v[X]+v[W]),v[X+1]=.5*(v[X+1]+v[W+1]),v[X+2]=.5*(v[X+2]+v[W+2]),v[W]=v[X],v[W+1]=v[X+1],v[W+2]=v[X+2]}s.VertexData._ComputeSides(f,m,_,v,A,e.frontUVs,e.backUVs);var Y=null;if(g){Y=new Float32Array(4*g.length);for(var Q=0;Q<g.length;Q++)Y[4*Q]=g[Q].r,Y[4*Q+1]=g[Q].g,Y[4*Q+2]=g[Q].b,Y[4*Q+3]=g[Q].a}var K=new s.VertexData,Z=new Float32Array(m),J=new Float32Array(v),q=new Float32Array(A);return K.indices=_,K.positions=Z,K.normals=J,K.uvs=q,Y&&K.set(Y,o.VertexBuffer.ColorKind),n&&(K._idx=C),K},i.Mesh.CreateRibbon=function(e,t,r,n,i,o,s,a,l){return void 0===r&&(r=!1),void 0===s&&(s=!1),c.CreateRibbon(e,{pathArray:t,closeArray:r,closePath:n,offset:i,updatable:s,sideOrientation:a,instance:l},o)};var c=function(){function e(){}return e.CreateRibbon=function(e,t,r){void 0===r&&(r=null);var c=t.pathArray,l=t.closeArray,u=t.closePath,h=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),d=t.instance,f=t.updatable;if(d){var p=n.Tmp.Vector3[0].setAll(Number.MAX_VALUE),g=n.Tmp.Vector3[1].setAll(-Number.MAX_VALUE),m=d.getVerticesData(o.VertexBuffer.PositionKind);if(function(e){for(var t=c[0].length,r=d,n=0,o=r._originalBuilderSideOrientation===i.Mesh.DOUBLESIDE?2:1,s=1;s<=o;++s)for(var a=0;a<c.length;++a){var l=c[a],u=l.length;t=t<u?t:u;for(var h=0;h<t;++h){var f=l[h];e[n]=f.x,e[n+1]=f.y,e[n+2]=f.z,p.minimizeInPlaceFromFloats(f.x,f.y,f.z),g.maximizeInPlaceFromFloats(f.x,f.y,f.z),n+=3}r._creationDataStorage&&r._creationDataStorage.closePath&&(f=l[0],e[n]=f.x,e[n+1]=f.y,e[n+2]=f.z,n+=3)}}(m),d._boundingInfo?d._boundingInfo.reConstruct(p,g,d._worldMatrix):d._boundingInfo=new a.BoundingInfo(p,g,d._worldMatrix),d.updateVerticesData(o.VertexBuffer.PositionKind,m,!1,!1),t.colors){for(var _=d.getVerticesData(o.VertexBuffer.ColorKind),v=0,A=0;v<t.colors.length;v++,A+=4){var y=t.colors[v];_[A]=y.r,_[A+1]=y.g,_[A+2]=y.b,_[A+3]=y.a}d.updateVerticesData(o.VertexBuffer.ColorKind,_,!1,!1)}if(t.uvs){for(var b=d.getVerticesData(o.VertexBuffer.UVKind),T=0;T<t.uvs.length;T++)b[2*T]=t.uvs[T].x,b[2*T+1]=t.uvs[T].y;d.updateVerticesData(o.VertexBuffer.UVKind,b,!1,!1)}if(!d.areNormalsFrozen||d.isFacetDataEnabled){var E=d.getIndices(),x=d.getVerticesData(o.VertexBuffer.NormalKind),C=d.isFacetDataEnabled?d.getFacetDataParameters():null;if(s.VertexData.ComputeNormals(m,E,x,C),d._creationDataStorage&&d._creationDataStorage.closePath)for(var P=0,M=0,S=0;S<c.length;S++)P=3*d._creationDataStorage.idx[S],M=S+1<c.length?3*(d._creationDataStorage.idx[S+1]-1):x.length-3,x[P]=.5*(x[P]+x[M]),x[P+1]=.5*(x[P+1]+x[M+1]),x[P+2]=.5*(x[P+2]+x[M+2]),x[M]=x[P],x[M+1]=x[P+1],x[M+2]=x[P+2];d.areNormalsFrozen||d.updateVerticesData(o.VertexBuffer.NormalKind,x,!1,!1)}return d}var R=new i.Mesh(e,r);R._originalBuilderSideOrientation=h,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=l,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 s});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ./ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts");i.Mesh.ExtrudeShape=function(e,t,r,n,o,a,c,l,u,h){void 0===c&&(c=null);var d={shape:t,path:r,scale:n,rotation:o,cap:0===a?0:a||i.Mesh.NO_CAP,sideOrientation:u,instance:h,updatable:l};return s.ExtrudeShape(e,d,c)},i.Mesh.ExtrudeShapeCustom=function(e,t,r,n,o,a,c,l,u,h,d,f){var p={shape:t,path:r,scaleFunction:n,rotationFunction:o,ribbonCloseArray:a,ribbonClosePath:c,cap:0===l?0:l||i.Mesh.NO_CAP,sideOrientation:d,instance:f,updatable:h};return s.ExtrudeShapeCustom(e,p,u)};var s=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,c=r.rotation||0,l=0===r.cap?0:r.cap||i.Mesh.NO_CAP,u=r.updatable,h=i.Mesh._GetDefaultSideOrientation(r.sideOrientation),d=r.instance||null,f=r.invertUV||!1;return e._ExtrudeShapeGeneric(t,s,o,a,c,null,null,!1,!1,l,!1,n,!!u,h,d,f,r.frontUVs||null,r.backUVs||null)},e.ExtrudeShapeCustom=function(t,r,n){var o=r.path,s=r.shape,a=r.scaleFunction||function(){return 1},c=r.rotationFunction||function(){return 0},l=r.ribbonCloseArray||!1,u=r.ribbonClosePath||!1,h=0===r.cap?0:r.cap||i.Mesh.NO_CAP,d=r.updatable,f=i.Mesh._GetDefaultSideOrientation(r.sideOrientation),p=r.instance,g=r.invertUV||!1;return e._ExtrudeShapeGeneric(t,s,o,null,null,a,c,l,u,h,!0,n,!!d,f,p||null,g,r.frontUVs||null,r.backUVs||null)},e._ExtrudeShapeGeneric=function(e,t,r,s,a,c,l,u,h,d,f,p,g,m,_,v,A,y){var b,T,E=function(e,t,r,o,s,a,c,l,u,h){for(var d=r.getTangents(),f=r.getNormals(),p=r.getBinormals(),g=r.getDistances(),m=0,_=h&&l?l:function(){return null!==a?a:0},v=h&&c?c:function(){return null!==s?s:1},A=u===i.Mesh.NO_CAP||u===i.Mesh.CAP_END?0:2,y=n.Tmp.Matrix[0],b=0;b<t.length;b++){for(var T=new Array,E=_(b,g[b]),x=v(b,g[b]),C=0;C<e.length;C++){n.Matrix.RotationAxisToRef(d[b],m,y);var P=d[b].scale(e[C].z).add(f[b].scale(e[C].x)).add(p[b].scale(e[C].y)),M=T[C]?T[C]:n.Vector3.Zero();n.Vector3.TransformCoordinatesToRef(P,y,M),M.scaleInPlace(x).addInPlace(t[b]),T[C]=M}o[A]=T,m+=E,A++}var S=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]=S(o[2]),o[1]=o[2];break;case i.Mesh.CAP_END:o[A]=o[A-1],o[A+1]=S(o[A-1]);break;case i.Mesh.CAP_ALL:o[0]=S(o[2]),o[1]=o[2],o[A]=o[A-1],o[A+1]=S(o[A-1])}return o};if(_){var x=_._creationDataStorage;return b=x.path3D.update(r),T=E(t,r,x.path3D,x.pathArray,s,a,c,l,x.cap,f),_=i.Mesh.CreateRibbon("",T,!1,!1,0,p||void 0,!1,0,_)}T=E(t,r,b=new n.Path3D(r),new Array,s,a,c,l,d=d<0||d>3?0:d,f);var C=o.RibbonBuilder.CreateRibbon(e,{pathArray:T,closeArray:u,closePath:h,updatable:g,sideOrientation:m,invertUV:v,frontUVs:A||void 0,backUVs:y||void 0},p);return C._creationDataStorage.pathArray=T,C._creationDataStorage.path3D=b,C._creationDataStorage.cap=d,C},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 */"./Maths/math.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,c=e.slice&&e.slice<=0?1:e.slice||1,l=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,u=new n.Vector3(r/2,i/2,s/2),h=2+t,d=2*h,f=[],p=[],g=[],m=[],_=0;_<=h;_++){for(var v=_/h,A=v*Math.PI*c,y=0;y<=d;y++){var b=y/d,T=b*Math.PI*2*a,E=n.Matrix.RotationZ(-A),x=n.Matrix.RotationY(T),C=n.Vector3.TransformCoordinates(n.Vector3.Up(),E),P=n.Vector3.TransformCoordinates(C,x),M=P.multiply(u),S=P.divide(u).normalize();p.push(M.x,M.y,M.z),g.push(S.x,S.y,S.z),m.push(b,v)}if(_>0)for(var R=p.length/3,O=R-2*(d+1);O+d+2<R;O++)f.push(O),f.push(O+1),f.push(O+d+1),f.push(O+d+1),f.push(O+1),f.push(O+d+2)}o.VertexData._ComputeSides(l,p,f,g,m,e.frontUVs,e.backUVs);var I=new o.VertexData;return I.indices=f,I.positions=p,I.normals=g,I.uvs=m,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){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/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 */"./Maths/math.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,c=e.thickness||.5,l=e.tessellation||16,u=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,h=l+1,d=0;d<=l;d++)for(var f=d/l,p=d*Math.PI*2/l-Math.PI/2,g=n.Matrix.Translation(a/2,0,0).multiply(n.Matrix.RotationY(p)),m=0;m<=l;m++){var _=1-m/l,v=m*Math.PI*2/l+Math.PI,A=Math.cos(v),y=Math.sin(v),b=new n.Vector3(A,y,0),T=b.scale(c/2),E=new n.Vector2(f,_);T=n.Vector3.TransformCoordinates(T,g),b=n.Vector3.TransformNormal(b,g),r.push(T.x,T.y,T.z),i.push(b.x,b.y,b.z),s.push(E.x,E.y);var x=(d+1)%h,C=(m+1)%h;t.push(d*h+m),t.push(d*h+C),t.push(x*h+m),t.push(d*h+C),t.push(x*h+C),t.push(x*h+m)}o.VertexData._ComputeSides(u,r,t,i,s,e.frontUVs,e.backUVs);var P=new o.VertexData;return P.indices=t,P.positions=r,P.normals=i,P.uvs=s,P},i.Mesh.CreateTorus=function(e,t,r,n,i,o,a){var c={diameter:t,thickness:r,tessellation:n,sideOrientation:a,updatable:o};return s.CreateTorus(e,c,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 */"./Maths/math.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,c=new Array,l=e.radius||2,u=e.tube||.5,h=e.radialSegments||32,d=e.tubularSegments||32,f=e.p||2,p=e.q||3,g=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,m=function(e){var t=Math.cos(e),r=Math.sin(e),i=p/f*e,o=Math.cos(i),s=l*(2+o)*.5*t,a=l*(2+o)*r*.5,c=l*Math.sin(i)*.5;return new n.Vector3(s,a,c)};for(t=0;t<=h;t++){var _=t%h/h*2*f*Math.PI,v=m(_),A=m(_+.01),y=A.subtract(v),b=A.add(v),T=n.Vector3.Cross(y,b);for(b=n.Vector3.Cross(T,y),T.normalize(),b.normalize(),r=0;r<d;r++){var E=r%d/d*2*Math.PI,x=-u*Math.cos(E),C=u*Math.sin(E);s.push(v.x+x*b.x+C*T.x),s.push(v.y+x*b.y+C*T.y),s.push(v.z+x*b.z+C*T.z),c.push(t/h),c.push(r/d)}}for(t=0;t<h;t++)for(r=0;r<d;r++){var P=(r+1)%d,M=t*d+r,S=(t+1)*d+r,R=(t+1)*d+P,O=t*d+P;i.push(O),i.push(S),i.push(M),i.push(O),i.push(R),i.push(S)}o.VertexData.ComputeNormals(s,i,a),o.VertexData._ComputeSides(g,s,i,a,c,e.frontUVs,e.backUVs);var I=new o.VertexData;return I.indices=i,I.positions=s,I.normals=a,I.uvs=c,I},i.Mesh.CreateTorusKnot=function(e,t,r,n,i,o,a,c,l,u){var h={radius:t,tube:r,radialSegments:n,tubularSegments:i,p:o,q:a,sideOrientation:u,updatable:l};return s.CreateTorusKnot(e,h,c)};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 s});var n=r(/*! ../../Maths/math */"./Maths/math.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ./ribbonBuilder */"./Meshes/Builders/ribbonBuilder.ts");i.Mesh.CreateTube=function(e,t,r,n,i,o,a,c,l,u){var h={path:t,radius:r,tessellation:n,radiusFunction:i,arc:1,cap:o,updatable:c,sideOrientation:l,instance:u};return s.CreateTube(e,h,a)};var s=function(){function e(){}return e.CreateTube=function(e,t,r){var s=t.path,a=t.instance,c=1;void 0!==t.radius?c=t.radius:a&&(c=a._creationDataStorage.radius);var l=t.tessellation||64,u=t.radiusFunction||null,h=t.cap||i.Mesh.NO_CAP,d=t.invertUV||!1,f=t.updatable,p=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);t.arc=t.arc&&(t.arc<=0||t.arc>1)?1:t.arc||1;var g,m,_=function(e,t,r,o,s,a,c,l){for(var u,h,d,f,p=t.getTangents(),g=t.getNormals(),m=t.getDistances(),_=2*Math.PI/s*l,v=a||function(){return o},A=n.Tmp.Matrix[0],y=c===i.Mesh.NO_CAP||c===i.Mesh.CAP_END?0:2,b=0;b<e.length;b++){h=v(b,m[b]),u=Array(),d=g[b];for(var T=0;T<s;T++)n.Matrix.RotationAxisToRef(p[b],_*T,A),f=u[T]?u[T]:n.Vector3.Zero(),n.Vector3.TransformCoordinatesToRef(d,A,f),f.scaleInPlace(h).addInPlace(e[b]),u[T]=f;r[y]=u,y++}var E=function(t,r){for(var n=Array(),i=0;i<t;i++)n.push(e[r]);return n};switch(c){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:r[0]=E(s,0),r[1]=r[2].slice(0);break;case i.Mesh.CAP_END:r[y]=r[y-1].slice(0),r[y+1]=E(s,e.length-1);break;case i.Mesh.CAP_ALL:r[0]=E(s,0),r[1]=r[2].slice(0),r[y]=r[y-1].slice(0),r[y+1]=E(s,e.length-1)}return r};if(a){var v=a._creationDataStorage,A=t.arc||v.arc;return m=_(s,g=v.path3D.update(s),v.pathArray,c,v.tessellation,u,v.cap,A),a=o.RibbonBuilder.CreateRibbon("",{pathArray:m,instance:a}),v.path3D=g,v.pathArray=m,v.arc=A,v.radius=c,a}m=_(s,g=new n.Path3D(s),new Array,c,l,u,h=h<0||h>3?0:h,t.arc);var y=o.RibbonBuilder.CreateRibbon(e,{pathArray:m,closePath:!0,closeArray:!1,updatable:f,sideOrientation:p,invertUV:d,frontUVs:t.frontUVs,backUVs:t.backUVs},r);return y._creationDataStorage.pathArray=m,y._creationDataStorage.path3D=g,y._creationDataStorage.tessellation=l,y._creationDataStorage.cap=h,y._creationDataStorage.arc=t.arc,y._creationDataStorage.radius=c,y},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 o});var n=r(/*! ../../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),o=function(){function e(){}return Object.defineProperty(e,"DecoderAvailable",{get:function(){if("undefined"!=typeof DracoDecoderModule)return!0;var t=e.Configuration.decoder;if(t){if(t.wasmUrl&&t.wasmBinaryUrl&&"object"==typeof WebAssembly)return!0;if(t.fallbackUrl)return!0}return!1},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){},e.prototype.decodeMeshAsync=function(t,r){var n=t instanceof ArrayBuffer?new Uint8Array(t):t;return e._GetDecoderModule().then(function(e){var t=e.module,o=new i.VertexData,s=new t.DecoderBuffer;s.Init(n,n.byteLength);var a,c,l=new t.Decoder;try{var u=l.GetEncodedGeometryType(s);switch(u){case t.TRIANGULAR_MESH:a=new t.Mesh,c=l.DecodeBufferToMesh(s,a);break;case t.POINT_CLOUD:a=new t.PointCloud,c=l.DecodeBufferToPointCloud(s,a);break;default:throw new Error("Invalid geometry type "+u)}if(!c.ok()||!a.ptr)throw new Error(c.error_msg());var h=a.num_points();if(u===t.TRIANGULAR_MESH){var d=a.num_faces(),f=new t.DracoInt32Array;try{for(var p=new Uint32Array(3*d),g=0;g<d;g++){l.GetFaceFromMesh(a,g,f);var m=3*g;p[m+0]=f.GetValue(0),p[m+1]=f.GetValue(1),p[m+2]=f.GetValue(2)}o.indices=p}finally{t.destroy(f)}}for(var _ in r){var v=r[_],A=l.GetAttributeByUniqueId(a,v),y=new t.DracoFloat32Array;try{l.GetAttributeFloatForAllPoints(a,A,y);var b=new Float32Array(h*A.num_components());for(g=0;g<b.length;g++)b[g]=y.GetValue(g);o.set(b,_)}finally{t.destroy(y)}}}finally{a&&t.destroy(a),t.destroy(l),t.destroy(s)}return o})},e._GetDecoderModule=function(){if(!e._DecoderModulePromise){var t=null,r={};if("undefined"!=typeof DracoDecoderModule)t=Promise.resolve();else{var n=e.Configuration.decoder;n&&(n.wasmUrl&&n.wasmBinaryUrl&&"object"==typeof WebAssembly?t=Promise.all([e._LoadScriptAsync(n.wasmUrl),e._LoadFileAsync(n.wasmBinaryUrl).then(function(e){r.wasmBinary=e})]):n.fallbackUrl&&(t=e._LoadScriptAsync(n.fallbackUrl)))}if(!t)throw new Error("Draco decoder module is not available");e._DecoderModulePromise=t.then(function(){return new Promise(function(e){r.onModuleLoaded=function(t){e({module:t})},DracoDecoderModule(r)})})}return e._DecoderModulePromise},e._LoadScriptAsync=function(e){return new Promise(function(t,r){n.Tools.LoadScript(e,function(){t()},function(e){r(new Error(e))})})},e._LoadFileAsync=function(e){return new Promise(function(t,r){n.Tools.LoadFile(e,function(e){t(e)},void 0,void 0,!0,function(e,t){r(t)})})},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}()},"./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/abstractMesh.ts":
- /*!********************************!*\
- !*** ./Meshes/abstractMesh.ts ***!
- \********************************/
- /*! exports provided: AbstractMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"AbstractMesh",function(){return g});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 */"./Maths/math.ts"),a=r(/*! ../Engines/engine */"./Engines/engine.ts"),c=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),u=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),h=r(/*! ../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),d=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),f=r(/*! ../Engines/constants */"./Engines/constants.ts"),p=function(){return 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}}(),g=function(e){function t(r,n){void 0===n&&(n=null);var i=e.call(this,r,n,!1)||this;return i._facetData=new p,i.cullingStrategy=t.CULLINGSTRATEGY_STANDARD,i.onCollideObservable=new o.Observable,i.onCollisionPositionChangeObservable=new o.Observable,i.onMaterialChangedObservable=new o.Observable,i.definedFacingForward=!0,i._visibility=1,i.alphaIndex=Number.MAX_VALUE,i.isVisible=!0,i.isPickable=!0,i.showSubMeshesBoundingBox=!1,i.isBlocker=!1,i.enablePointerMoveEvents=!1,i.renderingGroupId=0,i._receiveShadows=!1,i.outlineColor=s.Color3.Red(),i.outlineWidth=.02,i.overlayColor=s.Color3.Red(),i.overlayAlpha=.5,i._hasVertexAlpha=!1,i._useVertexColors=!0,i._computeBonesUsingShaders=!0,i._numBoneInfluencers=4,i._applyFog=!0,i.useOctreeForRenderingSelection=!0,i.useOctreeForPicking=!0,i.useOctreeForCollisions=!0,i._layerMask=268435455,i.alwaysSelectAsActiveMesh=!1,i.actionManager=null,i._checkCollisions=!1,i._collisionMask=-1,i._collisionGroup=-1,i.ellipsoid=new s.Vector3(.5,1,.5),i.ellipsoidOffset=new s.Vector3(0,0,0),i._oldPositionForCollisions=new s.Vector3(0,0,0),i._diffPositionForCollisions=new s.Vector3(0,0,0),i.edgesWidth=1,i.edgesColor=new s.Color4(1,0,0,1),i._renderId=0,i._intersectionsInProgress=new Array,i._unIndexed=!1,i._lightSources=new Array,i.onRebuildObservable=new o.Observable,i._onCollisionPositionChange=function(e,t,r){void 0===r&&(r=null),t.subtractToRef(i._oldPositionForCollisions,i._diffPositionForCollisions),i._diffPositionForCollisions.length()>a.Engine.CollisionsEpsilon&&i.position.addInPlace(i._diffPositionForCollisions),r&&i.onCollideObservable.notifyObservers(r),i.onCollisionPositionChangeObservable.notifyObservers(i.position)},i.getScene().addMesh(i),i._resyncLightSources(),i}return n.__extends(t,e),Object.defineProperty(t,"BILLBOARDMODE_NONE",{get:function(){return u.TransformNode.BILLBOARDMODE_NONE},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_X",{get:function(){return u.TransformNode.BILLBOARDMODE_X},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Y",{get:function(){return u.TransformNode.BILLBOARDMODE_Y},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Z",{get:function(){return u.TransformNode.BILLBOARDMODE_Z},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_ALL",{get:function(){return u.TransformNode.BILLBOARDMODE_ALL},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetNb",{get:function(){return this._facetData.facetNb},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningSubdivisions",{get:function(){return this._facetData.partitioningSubdivisions},set:function(e){this._facetData.partitioningSubdivisions=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningBBoxRatio",{get:function(){return this._facetData.partitioningBBoxRatio},set:function(e){this._facetData.partitioningBBoxRatio=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mustDepthSortFacets",{get:function(){return this._facetData.facetDepthSort},set:function(e){this._facetData.facetDepthSort=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetDepthSortFrom",{get:function(){return this._facetData.facetDepthSortFrom},set:function(e){this._facetData.facetDepthSortFrom=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFacetDataEnabled",{get:function(){return this._facetData.facetDataEnabled},enumerable:!0,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._onCollideObserver&&this.onCollideObservable.remove(this._onCollideObserver),this._onCollideObserver=this.onCollideObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onCollisionPositionChange",{set:function(e){this._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._onCollisionPositionChangeObserver),this._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._visibility},set:function(e){this._visibility!==e&&(this._visibility=e,this._markSubMeshesAsMiscDirty())},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this._markSubMeshesAsLightDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasVertexAlpha",{get:function(){return this._hasVertexAlpha},set:function(e){this._hasVertexAlpha!==e&&(this._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useVertexColors",{get:function(){return this._useVertexColors},set:function(e){this._useVertexColors!==e&&(this._useVertexColors=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._computeBonesUsingShaders},set:function(e){this._computeBonesUsingShaders!==e&&(this._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numBoneInfluencers",{get:function(){return this._numBoneInfluencers},set:function(e){this._numBoneInfluencers!==e&&(this._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"applyFog",{get:function(){return this._applyFog},set:function(e){this._applyFog!==e&&(this._applyFog=e,this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layerMask",{get:function(){return this._layerMask},set:function(e){e!==this._layerMask&&(this._layerMask=e,this._resyncLightSources())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionGroup",{get:function(){return this._collisionGroup},set:function(e){this._collisionGroup=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_positions",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._skeleton},set:function(e){this._skeleton&&this._skeleton.needInitialSkinMatrix&&this._skeleton._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._skeleton=e,this._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"AbstractMesh"},t.prototype.toString=function(e){var t="Name: "+this.name+", isInstance: "+("InstancedMesh"!==this.getClassName()?"YES":"NO");return t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0),this._skeleton&&(t+=", skeleton: "+this._skeleton.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingFreezeWorldMatrix?"YES":"NO")),t},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._resyncLighSource=function(e){var t=e.isEnabled()&&e.canAffectMesh(this),r=this._lightSources.indexOf(e);if(-1===r){if(!t)return;this._lightSources.push(e)}else{if(t)return;this._lightSources.splice(r,1)}this._markSubMeshesAsLightDirty()},t.prototype._unBindEffect=function(){for(var e=0,t=this.subMeshes;e<t.length;e++){t[e].setEffect(null)}},t.prototype._removeLightSource=function(e){var t=this._lightSources.indexOf(e);-1!==t&&(this._lightSources.splice(t,1),this._markSubMeshesAsLightDirty())},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(){this._markSubMeshesAsDirty(function(e){return e.markAsLightDirty()})},t.prototype._markSubMeshesAsAttributesDirty=function(){this._markSubMeshesAsDirty(function(e){return e.markAsAttributesDirty()})},t.prototype._markSubMeshesAsMiscDirty=function(){if(this.subMeshes)for(var e=0,t=this.subMeshes;e<t.length;e++){var r=t[e].getMaterial();r&&r.markAsDirty(f.Constants.MATERIAL_MiscDirtyFlag)}},Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e,this.physicsImpostor&&this.physicsImpostor.forceUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isBlocked",{get:function(){return!1},enumerable:!0,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(e,t){void 0===e&&(e=!0),void 0===t&&(t=!1);var r=null,n=null;t&&(this.rotationQuaternion?(n=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(r=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));var i=this.getHierarchyBoundingVectors(e),o=i.max.subtract(i.min),s=Math.max(o.x,o.y,o.z);if(0===s)return this;var a=1/s;return this.scaling.scaleInPlace(a),t&&(this.rotationQuaternion&&n?this.rotationQuaternion.copyFrom(n):this.rotation&&r&&this.rotation.copyFrom(r)),this},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(c.VertexBuffer.MatricesIndicesKind)&&this.isVerticesDataPresent(c.VertexBuffer.MatricesWeightsKind)},enumerable:!0,configurable:!0}),t.prototype._preActivate=function(){},t.prototype._preActivateForIntermediateRendering=function(e){},t.prototype._activate=function(e){this._renderId=e},t.prototype.getWorldMatrix=function(){return this._masterMesh?this._masterMesh.getWorldMatrix():e.prototype.getWorldMatrix.call(this)},t.prototype._getWorldMatrixDeterminant=function(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():e.prototype._getWorldMatrixDeterminant.call(this)},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.getHierarchyBoundingVectors=function(e,t){var r,n;void 0===e&&(e=!0),void 0===t&&(t=null),this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);var o=this.getBoundingInfo();if(this.subMeshes?(r=o.boundingBox.minimumWorld,n=o.boundingBox.maximumWorld):(r=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new s.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)),e)for(var a=0,c=this.getDescendants(!1);a<c.length;a++){var l=c[a];if(l.computeWorldMatrix(!0),(!t||t(l))&&l.getBoundingInfo&&0!==l.getTotalVertices()){var u=l.getBoundingInfo().boundingBox,h=u.minimumWorld,d=u.maximumWorld;i.Tools.CheckExtends(h,r,n),i.Tools.CheckExtends(d,r,n)}}return{min:r,max:n}},t.prototype.refreshBoundingInfo=function(e){return void 0===e&&(e=!1),this._boundingInfo&&this._boundingInfo.isLocked?this:(this._refreshBoundingInfo(this._getPositionData(e),null),this)},t.prototype._refreshBoundingInfo=function(e,t){if(e){var r=i.Tools.ExtractMinAndMax(e,0,this.getTotalVertices(),t);this._boundingInfo?this._boundingInfo.reConstruct(r.minimum,r.maximum):this._boundingInfo=new d.BoundingInfo(r.minimum,r.maximum)}if(this.subMeshes)for(var n=0;n<this.subMeshes.length;n++)this.subMeshes[n].refreshBoundingInfo();this._updateBoundingInfo()},t.prototype._getPositionData=function(e){var t=this.getVerticesData(c.VertexBuffer.PositionKind);if(t&&e&&this.skeleton){t=i.Tools.Slice(t);var r=this.getVerticesData(c.VertexBuffer.MatricesIndicesKind),n=this.getVerticesData(c.VertexBuffer.MatricesWeightsKind);if(n&&r){var o=this.numBoneInfluencers>4,a=o?this.getVerticesData(c.VertexBuffer.MatricesIndicesExtraKind):null,l=o?this.getVerticesData(c.VertexBuffer.MatricesWeightsExtraKind):null;this.skeleton.prepare();for(var u=this.skeleton.getTransformMatrices(this),h=s.Tmp.Vector3[0],d=s.Tmp.Matrix[0],f=s.Tmp.Matrix[1],p=0,g=0;g<t.length;g+=3,p+=4){var m,_;for(d.reset(),m=0;m<4;m++)(_=n[p+m])>0&&(s.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*r[p+m]),_,f),d.addToSelf(f));if(o)for(m=0;m<4;m++)(_=l[p+m])>0&&(s.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*a[p+m]),_,f),d.addToSelf(f));s.Vector3.TransformCoordinatesFromFloatsToRef(t[g],t[g+1],t[g+2],d,h),h.toArray(t,g)}}}return t},t.prototype._updateBoundingInfo=function(){var e=this._effectiveMesh;return this._boundingInfo?this._boundingInfo.update(e.worldMatrixFromCache):this._boundingInfo=new d.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._updateBoundingInfo()},Object.defineProperty(t.prototype,"_effectiveMesh",{get:function(){return this.skeleton&&this.skeleton.overrideMesh||this},enumerable:!0,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._checkCollisions},set:function(e){this._checkCollisions=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collider",{get:function(){return this._collider},enumerable:!0,configurable:!0}),t.prototype.moveWithCollisions=function(e){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._oldPositionForCollisions);var t=this.getScene().collisionCoordinator;return this._collider||(this._collider=t.createCollider()),this._collider._radius=this.ellipsoid,t.getNewPosition(this._oldPositionForCollisions,e,this._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()),r.collisionFound&&(r.collidedMesh=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.Tmp.Matrix[0],r=s.Tmp.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){var n=new h.PickingInfo,i="InstancedLinesMesh"===this.getClassName()||"LinesMesh"===this.getClassName()?this.intersectionThreshold:0,o=this._boundingInfo;if(!(this.subMeshes&&o&&e.intersectsSphere(o.boundingSphere,i)&&e.intersectsBox(o.boundingBox,i)))return n;if(!this._generatePointsArray())return n;for(var a=null,c=this._scene.getIntersectingSubMeshCandidates(this,e),l=c.length,u=0;u<l;u++){var d=c.data[u];if(!(l>1)||d.canIntersects(e)){var f=d.intersects(e,this._positions,this.getIndices(),t,r);if(f&&(t||!a||f.distance<a.distance)&&((a=f).subMeshId=u,t))break}}if(a){var p=this.getWorldMatrix(),g=s.Tmp.Vector3[0],m=s.Tmp.Vector3[1];s.Vector3.TransformCoordinatesToRef(e.origin,p,g),e.direction.scaleToRef(a.distance,m);var _=s.Vector3.TransformNormal(m,p).addInPlace(g);return n.hit=!0,n.distance=s.Vector3.Distance(g,_),n.pickedPoint=_,n.pickedMesh=this,n.bu=a.bu||0,n.bv=a.bv||0,n.faceId=a.faceId,n.subMeshId=a.subMeshId,n}return n},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.getScene().freeActiveMeshes(),this.getScene().freeRenderingGroups(),void 0!==this.actionManager&&null!==this.actionManager&&(this.actionManager.dispose(),this.actionManager=null),this._skeleton=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._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._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._facetData;e.facetDataEnabled||this._initFacetData();var t=this.getVerticesData(c.VertexBuffer.PositionKind),r=this.getIndices(),n=this.getVerticesData(c.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 h=0;h<e.facetNb;h++){var d={ind:3*h,sqDistance:0};e.depthSortedFacets.push(d)}e.invertedMatrix=s.Matrix.Identity(),e.facetDepthSortOrigin=s.Vector3.Zero()}e.bbSize.x=i.maximum.x-i.minimum.x>s.Epsilon?i.maximum.x-i.minimum.x:s.Epsilon,e.bbSize.y=i.maximum.y-i.minimum.y>s.Epsilon?i.maximum.y-i.minimum.y:s.Epsilon,e.bbSize.z=i.maximum.z-i.minimum.z>s.Epsilon?i.maximum.z-i.minimum.z:s.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,l.VertexData.ComputeNormals(t,r,n,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);var p=e.depthSortedIndices.length/3|0;for(h=0;h<p;h++){var g=e.depthSortedFacets[h].ind;e.depthSortedIndices[3*h]=r[g],e.depthSortedIndices[3*h+1]=r[g+1],e.depthSortedIndices[3*h+2]=r[g+2]}this.updateIndices(e.depthSortedIndices,void 0,!0)}return this},t.prototype.getFacetLocalNormals=function(){return this._facetData.facetNormals||this.updateFacetData(),this._facetData.facetNormals},t.prototype.getFacetLocalPositions=function(){return this._facetData.facetPositions||this.updateFacetData(),this._facetData.facetPositions},t.prototype.getFacetLocalPartitioning=function(){return this._facetData.facetPartitioning||this.updateFacetData(),this._facetData.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._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(),c=s.Tmp.Matrix[5];a.invertToRef(c);var l=s.Tmp.Vector3[8];s.Vector3.TransformCoordinatesFromFloatsToRef(e,t,r,c,l);var u=this.getClosestFacetAtLocalCoordinates(l.x,l.y,l.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,c=0,l=0,u=0,h=0,d=0,f=0,p=0,g=this.getFacetLocalPositions(),m=this.getFacetLocalNormals(),_=this.getFacetsAtLocalCoordinates(e,t,r);if(!_)return null;for(var v,A,y,b=Number.MAX_VALUE,T=b,E=0;E<_.length;E++)A=m[v=_[E]],u=(e-(y=g[v]).x)*A.x+(t-y.y)*A.y+(r-y.z)*A.z,(!i||i&&o&&u>=0||i&&!o&&u<=0)&&(u=A.x*y.x+A.y*y.y+A.z*y.z,h=-(A.x*e+A.y*t+A.z*r-u)/(A.x*A.x+A.y*A.y+A.z*A.z),(T=(a=(d=e+A.x*h)-e)*a+(c=(f=t+A.y*h)-t)*c+(l=(p=r+A.z*h)-r)*l)<b&&(b=T,s=v,n&&(n.x=d,n.y=f,n.z=p)));return s},t.prototype.getFacetDataParameters=function(){return this._facetData.facetParameters},t.prototype.disableFacetData=function(){return this._facetData.facetDataEnabled&&(this._facetData.facetDataEnabled=!1,this._facetData.facetPositions=new Array,this._facetData.facetNormals=new Array,this._facetData.facetPartitioning=new Array,this._facetData.facetParameters=null,this._facetData.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(c.VertexBuffer.PositionKind),n=this.getIndices();return t=this.isVerticesDataPresent(c.VertexBuffer.NormalKind)?this.getVerticesData(c.VertexBuffer.NormalKind):[],l.VertexData.ComputeNormals(r,n,t,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(c.VertexBuffer.NormalKind,t,e),this},t.prototype.alignWithNormal=function(e,t){t||(t=s.Axis.Y);var r=s.Tmp.Vector3[0],n=s.Tmp.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.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){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._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){void 0===s&&(s=!1);var a=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,a,r,void 0,void 0,!0)},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,c,l,u,h,d,f){if(void 0===d&&(d=!1),void 0===f&&(f=!1),r instanceof n?(this._buffer=r,this._ownsBuffer=!1):(this._buffer=new n(t,r,o,a,s,c,f),this._ownsBuffer=!0),this._kind=i,null==h){var p=this.getData();this.type=e.FLOAT,p instanceof Int8Array?this.type=e.BYTE:p instanceof Uint8Array?this.type=e.UNSIGNED_BYTE:p instanceof Int16Array?this.type=e.SHORT:p instanceof Uint16Array?this.type=e.UNSIGNED_SHORT:p instanceof Int32Array?this.type=e.INT:p instanceof Uint32Array&&(this.type=e.UNSIGNED_INT)}else this.type=h;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=l||0):(this._size=u||a||e.DeduceStride(i),this.byteStride=a?a*g:this._buffer.byteStride||this._size*g,this.byteOffset=(l||0)*g),this.normalized=d,this._instanced=void 0!==c&&c,this._instanceDivisor=c?1:0}return Object.defineProperty(e.prototype,"instanceDivisor",{get:function(){return this._instanceDivisor},set:function(e){this._instanceDivisor=e,this._instanced=0!=e},enumerable:!0,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.FLOAT:return 4;default:throw new Error("Invalid type '"+t+"'")}},e.ForEach=function(t,r,n,i,o,s,a,c){if(t instanceof Array)for(var l=r/4,u=n/4,h=0;h<s;h+=i){for(var d=0;d<i;d++)c(t[l+d],h+d);l+=u}else{var f=t instanceof ArrayBuffer?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),p=e.GetTypeByteLength(o);for(h=0;h<s;h+=i){var g=r;for(d=0;d<i;d++){c(e._GetFloatValue(f,o,g,a),h+d),g+=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:o=t.getUint8(n);return i&&(o/=255),o;case e.SHORT:o=t.getInt16(n,!0);return i&&(o=Math.max(o/16383,-1)),o;case e.UNSIGNED_SHORT:o=t.getUint16(n,!0);return i&&(o/=65535),o;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 d});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=0,c=function(){function e(e,t,r){this.pos=e,this.normal=t,this.uv=r}return e.prototype.clone=function(){return new e(this.pos.clone(),this.normal.clone(),this.uv.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),n.Vector2.Lerp(this.uv,t.uv,r))},e}(),l=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,c,l=0,h=[];for(a=0;a<t.vertices.length;a++){var d=(c=n.Vector3.Dot(this.normal,t.vertices[a].pos)-this.w)<-e.EPSILON?2:c>e.EPSILON?1:0;l|=d,h.push(d)}switch(l){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=[],g=[];for(a=0;a<t.vertices.length;a++){var m=(a+1)%t.vertices.length,_=h[a],v=h[m],A=t.vertices[a],y=t.vertices[m];if(2!==_&&p.push(A),1!==_&&g.push(2!==_?A.clone():A),3==(_|v)){c=(this.w-n.Vector3.Dot(this.normal,A.pos))/n.Vector3.Dot(this.normal,y.pos.subtract(A.pos));var b=A.interpolate(y,c);p.push(b),g.push(b.clone())}}p.length>=3&&(f=new u(p,t.shared)).plane&&o.push(f),g.length>=3&&(f=new u(g,t.shared)).plane&&s.push(f)}},e.EPSILON=1e-5,e}(),u=function(){function e(e,t){this.vertices=e,this.shared=t,this.plane=l.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}(),d=function(){function e(){this.polygons=new Array}return e.FromMesh=function(t){var r,o,l,h,d,f,p,g,m,_,v=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(),g=t.position.clone(),m=t.rotation.clone(),t.rotationQuaternion&&(A=t.rotationQuaternion.clone()),_=t.scaling.clone();for(var y=t.getIndices(),b=t.getVerticesData(i.VertexBuffer.PositionKind),T=t.getVerticesData(i.VertexBuffer.NormalKind),E=t.getVerticesData(i.VertexBuffer.UVKind),x=t.subMeshes,C=0,P=x.length;C<P;C++)for(var M=x[C].indexStart,S=x[C].indexCount+x[C].indexStart;M<S;M+=3){f=[];for(var R=0;R<3;R++){var O=new n.Vector3(T[3*y[M+R]],T[3*y[M+R]+1],T[3*y[M+R]+2]);l=new n.Vector2(E[2*y[M+R]],E[2*y[M+R]+1]);var I=new n.Vector3(b[3*y[M+R]],b[3*y[M+R]+1],b[3*y[M+R]+2]);h=n.Vector3.TransformCoordinates(I,p),o=n.Vector3.TransformNormal(O,p),r=new c(h,o,l),f.push(r)}(d=new u(f,{subMeshId:C,meshId:a,materialIndex:x[C].materialIndex})).plane&&v.push(d)}var D=e.FromPolygons(v);return D.matrix=p,D.position=g,D.rotation=m,D.scaling=_,D.rotationQuaternion=A,a++,D},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 a=this.matrix.clone();a.invert();var c,l,u,h=new s.Mesh(e,t),d=[],f=[],p=[],g=[],m=n.Vector3.Zero(),_=n.Vector3.Zero(),v=n.Vector2.Zero(),A=this.polygons,y=[0,0,0],b={},T=0,E={};r&&A.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 x=0,C=A.length;x<C;x++){E[(c=A[x]).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}),u=E[c.shared.meshId][c.shared.subMeshId];for(var P=2,M=c.vertices.length;P<M;P++){y[0]=0,y[1]=P-1,y[2]=P;for(var S=0;S<3;S++){m.copyFrom(c.vertices[y[S]].pos),_.copyFrom(c.vertices[y[S]].normal),v.copyFrom(c.vertices[y[S]].uv);var R=n.Vector3.TransformCoordinates(m,a),O=n.Vector3.TransformNormal(_,a);void 0!==(l=b[R.x+","+R.y+","+R.z])&&p[3*l]===O.x&&p[3*l+1]===O.y&&p[3*l+2]===O.z&&g[2*l]===v.x&&g[2*l+1]===v.y||(d.push(R.x,R.y,R.z),g.push(v.x,v.y),p.push(_.x,_.y,_.z),l=b[R.x+","+R.y+","+R.z]=d.length/3-1),f.push(l),u.indexStart=Math.min(T,u.indexStart),u.indexEnd=Math.max(T,u.indexEnd),T++}}}if(h.setVerticesData(i.VertexBuffer.PositionKind,d),h.setVerticesData(i.VertexBuffer.NormalKind,p),h.setVerticesData(i.VertexBuffer.UVKind,g),h.setIndices(f,null),r){var I,D=0;for(var w in h.subMeshes=new Array,E){for(var L in I=-1,E[w])u=E[w][L],o.SubMesh.CreateFromIndices(u.materialIndex+D,u.indexStart,u.indexEnd-u.indexStart+1,h),I=Math.max(u.materialIndex,I);D+=++I}}return h},e.prototype.toMesh=function(e,t,r,n){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/geometry.ts":
- /*!****************************!*\
- !*** ./Meshes/geometry.ts ***!
- \****************************/
- /*! exports provided: Geometry */function(e,t,r){"use strict";r.r(t),r.d(t,"Geometry",function(){return d});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),a=r(/*! ../Loading/sceneLoaderFlags */"./Loading/sceneLoaderFlags.ts"),c=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),l=r(/*! ../Engines/constants */"./Engines/constants.ts"),u=r(/*! ../Misc/tools */"./Misc/tools.ts"),h=r(/*! ../Misc/tags */"./Misc/tags.ts"),d=function(){function e(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i=null),this.delayLoadState=l.Constants.DELAYLOADSTATE_NONE,this._totalVertices=0,this._isDisposed=!1,this._indexBufferIsUpdatable=!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:!0,configurable:!0}),e.CreateGeometryForMesh=function(t){var r=new e(e.RandomId(),t.getScene());return r.applyToMesh(t),r},Object.defineProperty(e.prototype,"extend",{get:function(){return this._extend},enumerable:!0,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getEngine=function(){return this._engine},e.prototype.isReady=function(){return this.delayLoadState===l.Constants.DELAYLOADSTATE_LOADED||this.delayLoadState===l.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:!0,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 o.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===o.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,s=i.length,a=0;a<s;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===o.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 s=n.getSize()*o.VertexBuffer.GetTypeByteLength(n.type),a=this._totalVertices*n.getSize();if(n.type!==o.VertexBuffer.FLOAT||n.byteStride!==s){var c=[];return n.forEach(a,function(e){return c.push(e)}),c}if(!(i instanceof Array||i instanceof Float32Array)||0!==n.byteOffset||i.length!==a){if(i instanceof Array){var l=n.byteOffset/4;return u.Tools.Slice(i,l,l+a)}if(i instanceof ArrayBuffer)return new Float32Array(i,n.byteOffset,a);l=i.byteOffset+n.byteOffset;if(r||t&&1!==this._meshes.length){var h=new Float32Array(a),d=new Float32Array(i.buffer,l,a);return h.set(d),h}return new Float32Array(i.buffer,l,a)}return r||t&&1!==this._meshes.length?u.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),e||(e=this.getVerticesData(o.VertexBuffer.PositionKind)),this._extend=u.Tools.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===o.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!==l.Constants.DELAYLOADSTATE_LOADING&&(this.isReady()?t&&t():(this.delayLoadState=l.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=l.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(o.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(o.VertexBuffer.PositionKind,n,!1)}var i=this.getVerticesData(o.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(o.VertexBuffer.NormalKind,i,!1)}},e.prototype._resetPointsArrayCache=function(){this._positions=null},e.prototype._generatePointsArray=function(){if(this._positions)return!0;var e=this.getVerticesData(o.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=l.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 i.VertexData;r.indices=[];var n=this.getIndices();if(n)for(var o=0;o<n.length;o++)r.indices.push(n[o]);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 h=this.getVertexBuffer(s);h&&(l=!(a=h.isUpdatable()))}}var d=new e(t,this._scene,r,a);for(s in d.delayLoadState=this.delayLoadState,d.delayLoadingFile=this.delayLoadingFile,d._delayLoadingFunction=this._delayLoadingFunction,this._delayInfo)d._delayInfo=d._delayInfo||[],d._delayInfo.push(s);return d._boundingInfo=new c.BoundingInfo(this._extend.minimum,this._extend.maximum),d},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(o.VertexBuffer.PositionKind)&&(e.positions=this.toNumberArray(this.getVerticesData(o.VertexBuffer.PositionKind)),this.isVertexBufferUpdatable(o.VertexBuffer.PositionKind)&&(e.positions._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.NormalKind)&&(e.normals=this.toNumberArray(this.getVerticesData(o.VertexBuffer.NormalKind)),this.isVertexBufferUpdatable(o.VertexBuffer.NormalKind)&&(e.normals._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.TangentKind)&&(e.tangets=this.toNumberArray(this.getVerticesData(o.VertexBuffer.TangentKind)),this.isVertexBufferUpdatable(o.VertexBuffer.TangentKind)&&(e.tangets._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.UVKind)&&(e.uvs=this.toNumberArray(this.getVerticesData(o.VertexBuffer.UVKind)),this.isVertexBufferUpdatable(o.VertexBuffer.UVKind)&&(e.uvs._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.UV2Kind)&&(e.uv2s=this.toNumberArray(this.getVerticesData(o.VertexBuffer.UV2Kind)),this.isVertexBufferUpdatable(o.VertexBuffer.UV2Kind)&&(e.uv2s._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.UV3Kind)&&(e.uv3s=this.toNumberArray(this.getVerticesData(o.VertexBuffer.UV3Kind)),this.isVertexBufferUpdatable(o.VertexBuffer.UV3Kind)&&(e.uv3s._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.UV4Kind)&&(e.uv4s=this.toNumberArray(this.getVerticesData(o.VertexBuffer.UV4Kind)),this.isVertexBufferUpdatable(o.VertexBuffer.UV4Kind)&&(e.uv4s._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.UV5Kind)&&(e.uv5s=this.toNumberArray(this.getVerticesData(o.VertexBuffer.UV5Kind)),this.isVertexBufferUpdatable(o.VertexBuffer.UV5Kind)&&(e.uv5s._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.UV6Kind)&&(e.uv6s=this.toNumberArray(this.getVerticesData(o.VertexBuffer.UV6Kind)),this.isVertexBufferUpdatable(o.VertexBuffer.UV6Kind)&&(e.uv6s._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.ColorKind)&&(e.colors=this.toNumberArray(this.getVerticesData(o.VertexBuffer.ColorKind)),this.isVertexBufferUpdatable(o.VertexBuffer.ColorKind)&&(e.colors._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndices=this.toNumberArray(this.getVerticesData(o.VertexBuffer.MatricesIndicesKind)),e.matricesIndices._isExpanded=!0,this.isVertexBufferUpdatable(o.VertexBuffer.MatricesIndicesKind)&&(e.matricesIndices._updatable=!0)),this.isVerticesDataPresent(o.VertexBuffer.MatricesWeightsKind)&&(e.matricesWeights=this.toNumberArray(this.getVerticesData(o.VertexBuffer.MatricesWeightsKind)),this.isVertexBufferUpdatable(o.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 u.Tools.RandomId()},e._ImportGeometry=function(t,r){var i=r.getScene(),a=t.geometryId;if(a){var c=i.getGeometryByID(a);c&&c.applyToMesh(r)}else if(t instanceof ArrayBuffer){var l=r._binaryInfo;if(l.positionsAttrDesc&&l.positionsAttrDesc.count>0){var u=new Float32Array(t,l.positionsAttrDesc.offset,l.positionsAttrDesc.count);r.setVerticesData(o.VertexBuffer.PositionKind,u,!1)}if(l.normalsAttrDesc&&l.normalsAttrDesc.count>0){var h=new Float32Array(t,l.normalsAttrDesc.offset,l.normalsAttrDesc.count);r.setVerticesData(o.VertexBuffer.NormalKind,h,!1)}if(l.tangetsAttrDesc&&l.tangetsAttrDesc.count>0){var d=new Float32Array(t,l.tangetsAttrDesc.offset,l.tangetsAttrDesc.count);r.setVerticesData(o.VertexBuffer.TangentKind,d,!1)}if(l.uvsAttrDesc&&l.uvsAttrDesc.count>0){var f=new Float32Array(t,l.uvsAttrDesc.offset,l.uvsAttrDesc.count);r.setVerticesData(o.VertexBuffer.UVKind,f,!1)}if(l.uvs2AttrDesc&&l.uvs2AttrDesc.count>0){var p=new Float32Array(t,l.uvs2AttrDesc.offset,l.uvs2AttrDesc.count);r.setVerticesData(o.VertexBuffer.UV2Kind,p,!1)}if(l.uvs3AttrDesc&&l.uvs3AttrDesc.count>0){var g=new Float32Array(t,l.uvs3AttrDesc.offset,l.uvs3AttrDesc.count);r.setVerticesData(o.VertexBuffer.UV3Kind,g,!1)}if(l.uvs4AttrDesc&&l.uvs4AttrDesc.count>0){var m=new Float32Array(t,l.uvs4AttrDesc.offset,l.uvs4AttrDesc.count);r.setVerticesData(o.VertexBuffer.UV4Kind,m,!1)}if(l.uvs5AttrDesc&&l.uvs5AttrDesc.count>0){var _=new Float32Array(t,l.uvs5AttrDesc.offset,l.uvs5AttrDesc.count);r.setVerticesData(o.VertexBuffer.UV5Kind,_,!1)}if(l.uvs6AttrDesc&&l.uvs6AttrDesc.count>0){var v=new Float32Array(t,l.uvs6AttrDesc.offset,l.uvs6AttrDesc.count);r.setVerticesData(o.VertexBuffer.UV6Kind,v,!1)}if(l.colorsAttrDesc&&l.colorsAttrDesc.count>0){var A=new Float32Array(t,l.colorsAttrDesc.offset,l.colorsAttrDesc.count);r.setVerticesData(o.VertexBuffer.ColorKind,A,!1,l.colorsAttrDesc.stride)}if(l.matricesIndicesAttrDesc&&l.matricesIndicesAttrDesc.count>0){for(var y=new Int32Array(t,l.matricesIndicesAttrDesc.offset,l.matricesIndicesAttrDesc.count),b=[],T=0;T<y.length;T++){var E=y[T];b.push(255&E),b.push((65280&E)>>8),b.push((16711680&E)>>16),b.push(E>>24)}r.setVerticesData(o.VertexBuffer.MatricesIndicesKind,b,!1)}if(l.matricesWeightsAttrDesc&&l.matricesWeightsAttrDesc.count>0){var x=new Float32Array(t,l.matricesWeightsAttrDesc.offset,l.matricesWeightsAttrDesc.count);r.setVerticesData(o.VertexBuffer.MatricesWeightsKind,x,!1)}if(l.indicesAttrDesc&&l.indicesAttrDesc.count>0){var C=new Int32Array(t,l.indicesAttrDesc.offset,l.indicesAttrDesc.count);r.setIndices(C,null)}if(l.subMeshesAttrDesc&&l.subMeshesAttrDesc.count>0){var P=new Int32Array(t,l.subMeshesAttrDesc.offset,5*l.subMeshesAttrDesc.count);r.subMeshes=[];for(T=0;T<l.subMeshesAttrDesc.count;T++){var M=P[5*T+0],S=P[5*T+1],R=P[5*T+2],O=P[5*T+3],I=P[5*T+4];s.SubMesh.AddToMesh(M,S,R,O,I,r)}}}else if(t.positions&&t.normals&&t.indices){if(r.setVerticesData(o.VertexBuffer.PositionKind,t.positions,t.positions._updatable),r.setVerticesData(o.VertexBuffer.NormalKind,t.normals,t.normals._updatable),t.tangents&&r.setVerticesData(o.VertexBuffer.TangentKind,t.tangents,t.tangents._updatable),t.uvs&&r.setVerticesData(o.VertexBuffer.UVKind,t.uvs,t.uvs._updatable),t.uvs2&&r.setVerticesData(o.VertexBuffer.UV2Kind,t.uvs2,t.uvs2._updatable),t.uvs3&&r.setVerticesData(o.VertexBuffer.UV3Kind,t.uvs3,t.uvs3._updatable),t.uvs4&&r.setVerticesData(o.VertexBuffer.UV4Kind,t.uvs4,t.uvs4._updatable),t.uvs5&&r.setVerticesData(o.VertexBuffer.UV5Kind,t.uvs5,t.uvs5._updatable),t.uvs6&&r.setVerticesData(o.VertexBuffer.UV6Kind,t.uvs6,t.uvs6._updatable),t.colors&&r.setVerticesData(o.VertexBuffer.ColorKind,n.Color4.CheckColors4(t.colors,t.positions.length/3),t.colors._updatable),t.matricesIndices)if(t.matricesIndices._isExpanded)delete t.matricesIndices._isExpanded,r.setVerticesData(o.VertexBuffer.MatricesIndicesKind,t.matricesIndices,t.matricesIndices._updatable);else{for(b=[],T=0;T<t.matricesIndices.length;T++){var D=t.matricesIndices[T];b.push(255&D),b.push((65280&D)>>8),b.push((16711680&D)>>16),b.push(D>>24)}r.setVerticesData(o.VertexBuffer.MatricesIndicesKind,b,t.matricesIndices._updatable)}if(t.matricesIndicesExtra)if(t.matricesIndicesExtra._isExpanded)delete t.matricesIndices._isExpanded,r.setVerticesData(o.VertexBuffer.MatricesIndicesExtraKind,t.matricesIndicesExtra,t.matricesIndicesExtra._updatable);else{for(b=[],T=0;T<t.matricesIndicesExtra.length;T++){D=t.matricesIndicesExtra[T];b.push(255&D),b.push((65280&D)>>8),b.push((16711680&D)>>16),b.push(D>>24)}r.setVerticesData(o.VertexBuffer.MatricesIndicesExtraKind,b,t.matricesIndicesExtra._updatable)}t.matricesWeights&&(e._CleanMatricesWeights(t,r),r.setVerticesData(o.VertexBuffer.MatricesWeightsKind,t.matricesWeights,t.matricesWeights._updatable)),t.matricesWeightsExtra&&r.setVerticesData(o.VertexBuffer.MatricesWeightsExtraKind,t.matricesWeightsExtra,t.matricesWeights._updatable),r.setIndices(t.indices,null)}if(t.subMeshes){r.subMeshes=[];for(var w=0;w<t.subMeshes.length;w++){var L=t.subMeshes[w];s.SubMesh.AddToMesh(L.materialIndex,L.verticesStart,L.verticesCount,L.indexStart,L.indexCount,r)}}r._shouldGenerateFlatShading&&(r.convertToFlatShadedMesh(),delete r._shouldGenerateFlatShading),r.computeWorldMatrix(!0),i.onMeshImportedObservable.notifyObservers(r)},e._CleanMatricesWeights=function(e,t){if(a.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(o.VertexBuffer.MatricesIndicesKind),s=t.getVerticesData(o.VertexBuffer.MatricesIndicesExtraKind),c=e.matricesWeights,l=e.matricesWeightsExtra,u=e.numBoneInfluencer,h=c.length,d=0;d<h;d+=4){for(var f=0,p=-1,g=0;g<4;g++){f+=m=c[d+g],m<.001&&p<0&&(p=g)}if(l)for(g=0;g<4;g++){var m;f+=m=l[d+g],m<.001&&p<0&&(p=g+4)}if((p<0||p>u-1)&&(p=u-1),f>.001){var _=1/f;for(g=0;g<4;g++)c[d+g]*=_;if(l)for(g=0;g<4;g++)l[d+g]*=_}else p>=4?(l[d+p-4]=1-f,s[d+p-4]=r):(c[d+p]=1-f,i[d+p]=r)}t.setVerticesData(o.VertexBuffer.MatricesIndicesKind,i),e.matricesWeightsExtra&&t.setVerticesData(o.VertexBuffer.MatricesIndicesExtraKind,s)}}}},e.Parse=function(t,r,s){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=l.Constants.DELAYLOADSTATE_NOTLOADED,a.delayLoadingFile=s+t.delayLoadingFile,a._boundingInfo=new c.BoundingInfo(n.Vector3.FromArray(t.boundingBoxMinimum),n.Vector3.FromArray(t.boundingBoxMaximum)),a._delayInfo=[],t.hasUVs&&a._delayInfo.push(o.VertexBuffer.UVKind),t.hasUVs2&&a._delayInfo.push(o.VertexBuffer.UV2Kind),t.hasUVs3&&a._delayInfo.push(o.VertexBuffer.UV3Kind),t.hasUVs4&&a._delayInfo.push(o.VertexBuffer.UV4Kind),t.hasUVs5&&a._delayInfo.push(o.VertexBuffer.UV5Kind),t.hasUVs6&&a._delayInfo.push(o.VertexBuffer.UV6Kind),t.hasColors&&a._delayInfo.push(o.VertexBuffer.ColorKind),t.hasMatricesIndices&&a._delayInfo.push(o.VertexBuffer.MatricesIndicesKind),t.hasMatricesWeights&&a._delayInfo.push(o.VertexBuffer.MatricesWeightsKind),a._delayLoadingFunction=i.VertexData.ImportVertexData):i.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 */"./Maths/math.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 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"subdivisionsX",{get:function(){return this._subdivisionsX},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subdivisionsY",{get:function(){return this._subdivisionsY},enumerable:!0,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.Tmp.Matrix[5];r.invertToRef(n);var o=i.Tmp.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.Tmp.Matrix[5];n.invertToRef(o);var s=i.Tmp.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.Tmp.Vector3[3],r=i.Tmp.Vector3[2],n=i.Tmp.Vector3[1],s=i.Tmp.Vector3[0],a=i.Tmp.Vector3[4],c=i.Tmp.Vector3[5],l=i.Tmp.Vector3[6],u=i.Tmp.Vector3[7],h=i.Tmp.Vector3[8],d=0,f=0,p=0,g=0,m=0,_=0,v=0,A=this._subdivisionsX,y=this._subdivisionsY,b=0;b<y;b++)for(var T=0;T<A;T++){d=3*T,f=b*(A+1)*3,p=(b+1)*(A+1)*3,t.x=e[f+d],t.y=e[f+d+1],t.z=e[f+d+2],r.x=e[f+d+3],r.y=e[f+d+4],r.z=e[f+d+5],n.x=e[p+d],n.y=e[p+d+1],n.z=e[p+d+2],s.x=e[p+d+3],s.y=e[p+d+4],s.z=e[p+d+5],g=(s.z-t.z)/(s.x-t.x),m=t.z-g*t.x,r.subtractToRef(t,a),n.subtractToRef(t,c),s.subtractToRef(t,l),i.Vector3.CrossToRef(l,c,u),i.Vector3.CrossToRef(a,l,h),u.normalize(),h.normalize(),_=-(u.x*t.x+u.y*t.y+u.z*t.z),v=-(h.x*r.x+h.y*r.y+h.z*r.z);var E=this._heightQuads[b*A+T];E.slope.copyFromFloats(g,m),E.facet1.copyFromFloats(u.x,u.y,u.z,_),E.facet2.copyFromFloats(h.x,h.y,h.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, CSG, Geometry, GroundMesh, TrailMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, DracoCompression, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder */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 c=r(/*! ./groundMesh */"./Meshes/groundMesh.ts");r.d(t,"GroundMesh",function(){return c.GroundMesh});var l=r(/*! ./trailMesh */"./Meshes/trailMesh.ts");r.d(t,"TrailMesh",function(){return l.TrailMesh});var u=r(/*! ./instancedMesh */"./Meshes/instancedMesh.ts");r.d(t,"InstancedMesh",function(){return u.InstancedMesh});var h=r(/*! ./linesMesh */"./Meshes/linesMesh.ts");r.d(t,"LinesMesh",function(){return h.LinesMesh}),r.d(t,"InstancedLinesMesh",function(){return h.InstancedLinesMesh});var d=r(/*! ./mesh */"./Meshes/mesh.ts");r.d(t,"MeshLODLevel",function(){return d.MeshLODLevel}),r.d(t,"_CreationDataStorage",function(){return d._CreationDataStorage}),r.d(t,"_InstancesBatch",function(){return d._InstancesBatch}),r.d(t,"Mesh",function(){return d.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 g=r(/*! ./meshSimplification */"./Meshes/meshSimplification.ts");r.d(t,"SimplificationSettings",function(){return g.SimplificationSettings}),r.d(t,"SimplificationQueue",function(){return g.SimplificationQueue}),r.d(t,"SimplificationType",function(){return g.SimplificationType});var m=r(/*! ./meshSimplificationSceneComponent */"./Meshes/meshSimplificationSceneComponent.ts");r.d(t,"SimplicationQueueSceneComponent",function(){return m.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,"BaseSubMesh",function(){return v.BaseSubMesh}),r.d(t,"SubMesh",function(){return v.SubMesh});var A=r(/*! ./transformNode */"./Meshes/transformNode.ts");r.d(t,"TransformNode",function(){return A.TransformNode});var y=r(/*! ./Builders/index */"./Meshes/Builders/index.ts");r.d(t,"BoxBuilder",function(){return y.BoxBuilder}),r.d(t,"SphereBuilder",function(){return y.SphereBuilder}),r.d(t,"CylinderBuilder",function(){return y.CylinderBuilder}),r.d(t,"LinesBuilder",function(){return y.LinesBuilder}),r.d(t,"PlaneBuilder",function(){return y.PlaneBuilder}),r.d(t,"DiscBuilder",function(){return y.DiscBuilder}),r.d(t,"RibbonBuilder",function(){return y.RibbonBuilder}),r.d(t,"TorusBuilder",function(){return y.TorusBuilder}),r.d(t,"TorusKnotBuilder",function(){return y.TorusKnotBuilder}),r.d(t,"PolygonBuilder",function(){return y.PolygonBuilder}),r.d(t,"ShapeBuilder",function(){return y.ShapeBuilder}),r.d(t,"LatheBuilder",function(){return y.LatheBuilder}),r.d(t,"GroundBuilder",function(){return y.GroundBuilder}),r.d(t,"TubeBuilder",function(){return y.TubeBuilder}),r.d(t,"PolyhedronBuilder",function(){return y.PolyhedronBuilder}),r.d(t,"IcoSphereBuilder",function(){return y.IcoSphereBuilder}),r.d(t,"DecalBuilder",function(){return y.DecalBuilder})},"./Meshes/instancedMesh.ts":
- /*!*********************************!*\
- !*** ./Meshes/instancedMesh.ts ***!
- \*********************************/
- /*! exports provided: InstancedMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"InstancedMesh",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts");s.Mesh._instancedMeshFactory=function(e,t){return new c(e,t)};var c=function(e){function t(t,r){var n=e.call(this,t,r.getScene())||this;return n._indexInSourceMeshInstanceArray=-1,r.addInstance(n),n._sourceMesh=r,n.position.copyFrom(r.position),n.rotation.copyFrom(r.rotation),n.scaling.copyFrom(r.scaling),r.rotationQuaternion&&(n.rotationQuaternion=r.rotationQuaternion.clone()),n.infiniteDistance=r.infiniteDistance,n.setPivotMatrix(r.getPivotMatrix()),n.refreshBoundingInfo(),n._syncSubMeshes(),n}return n.__extends(t,e),t.prototype.getClassName=function(){return"InstancedMesh"},Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._sourceMesh.receiveShadows},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._sourceMesh.material},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._sourceMesh.visibility},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._sourceMesh.skeleton},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderingGroupId",{get:function(){return this._sourceMesh.renderingGroupId},set:function(e){this._sourceMesh&&e!==this._sourceMesh.renderingGroupId&&i.Logger.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")},enumerable:!0,configurable:!0}),t.prototype.getTotalVertices=function(){return this._sourceMesh.getTotalVertices()},t.prototype.getTotalIndices=function(){return this._sourceMesh.getTotalIndices()},Object.defineProperty(t.prototype,"sourceMesh",{get:function(){return this._sourceMesh},enumerable:!0,configurable:!0}),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:!0,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){return this._currentLOD&&this._currentLOD._registerInstanceForRenderId(this,e),this},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:this._currentLOD},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){var n=this._sourceMesh.createInstance(e);if(a.DeepCopier.DeepCopy(this,n,["name","subMeshes","uniqueId"],[]),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}(o.AbstractMesh)},"./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 h}),r.d(t,"InstancedLinesMesh",function(){return d});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Meshes/instancedMesh */"./Meshes/instancedMesh.ts"),c=r(/*! ../Materials/material */"./Materials/material.ts"),l=r(/*! ../Materials/shaderMaterial */"./Materials/shaderMaterial.ts"),u=(r(/*! ../Shaders/color.fragment */"./Shaders/color.fragment.ts"),r(/*! ../Shaders/color.vertex */"./Shaders/color.vertex.ts"),r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts")),h=function(e){function t(t,r,n,s,a,c,u){void 0===r&&(r=null),void 0===n&&(n=null);var h=e.call(this,t,r,n,s,a)||this;h.useVertexColor=c,h.useVertexAlpha=u,h.color=new i.Color3(1,1,1),h.alpha=1,s&&(h.color=s.color.clone(),h.alpha=s.alpha,h.useVertexColor=s.useVertexColor,h.useVertexAlpha=s.useVertexAlpha),h.intersectionThreshold=.1;var d={attributes:[o.VertexBuffer.PositionKind,"world0","world1","world2","world3"],uniforms:["vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","world","viewProjection"],needAlphaBlending:!0,defines:[]};return!1===u&&(d.needAlphaBlending=!1),c?(d.defines.push("#define VERTEXCOLOR"),d.attributes.push(o.VertexBuffer.ColorKind)):d.uniforms.push("color"),h._colorShader=new l.ShaderMaterial("colorShader",h.getScene(),"color",d),h}return 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"),!!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:!0,configurable:!0}),Object.defineProperty(t.prototype,"checkCollisions",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype._bind=function(e,t,r){if(!this._geometry)return this;var n=this._colorShader.getEffect();return this._geometry._bind(n),this.useVertexColor||this._colorShader.setColor4("color",this.color.toColor4(this.alpha)),u.MaterialHelper.BindClipPlane(n,this.getScene()),this},t.prototype._draw=function(e,t,r){return this._geometry&&this._geometry.getVertexBuffers()&&(this._unIndexed||this._geometry.getIndexBuffer())?(this.getScene().getEngine().drawElementsType(c.Material.LineListDrawMode,e.indexStart,e.indexCount,r),this):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 new t(e,this.getScene(),r,this,n)},t.prototype.createInstance=function(e){return new d(e,this)},t}(s.Mesh),d=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.intersectionThreshold=r.intersectionThreshold,n}return n.__extends(t,e),t.prototype.getClassName=function(){return"InstancedLinesMesh"},t}(a.InstancedMesh)},"./Meshes/mesh.ts":
- /*!************************!*\
- !*** ./Meshes/mesh.ts ***!
- \************************/
- /*! exports provided: MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh */function(e,t,r){"use strict";r.r(t),r.d(t,"MeshLODLevel",function(){return x}),r.d(t,"_CreationDataStorage",function(){return C}),r.d(t,"_InstancesBatch",function(){return M}),r.d(t,"Mesh",function(){return S});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"),c=r(/*! ../Maths/math */"./Maths/math.ts"),l=r(/*! ../node */"./node.ts"),u=r(/*! ./buffer */"./Meshes/buffer.ts"),h=r(/*! ./mesh.vertexData */"./Meshes/mesh.vertexData.ts"),d=r(/*! ./geometry */"./Meshes/geometry.ts"),f=r(/*! ./abstractMesh */"./Meshes/abstractMesh.ts"),p=r(/*! ./subMesh */"./Meshes/subMesh.ts"),g=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),m=r(/*! ../Materials/material */"./Materials/material.ts"),_=r(/*! ../Materials/multiMaterial */"./Materials/multiMaterial.ts"),v=r(/*! ../Loading/sceneLoaderFlags */"./Loading/sceneLoaderFlags.ts"),A=r(/*! ../Engines/constants */"./Engines/constants.ts"),y=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),b=r(/*! ../Misc/logger */"./Misc/logger.ts"),T=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),E=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),x=function(){return function(e,t){this.distance=e,this.mesh=t}}(),C=function(){return function(){}}(),P=function(){return function(){this.visibleInstances={},this.renderIdForInstances=new Array,this.batchCache=new M,this.instancesBufferSize=2048}}(),M=function(){return function(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=new Array}}(),S=function(e){function t(r,n,i,o,c,l){void 0===n&&(n=null),void 0===i&&(i=null),void 0===o&&(o=null),void 0===l&&(l=!0);var u=e.call(this,r,n)||this;if(u.delayLoadState=A.Constants.DELAYLOADSTATE_NONE,u.instances=new Array,u._LODLevels=new Array,u._instanceDataStorage=new P,u._originalBuilderSideOrientation=t.DEFAULTSIDE,u.overrideMaterialSideOrientation=null,u._areNormalsFrozen=!1,u._source=null,u._isMesh=!0,n=u.getScene(),o){if(o._geometry&&o._geometry.applyToMesh(u),s.DeepCopier.DeepCopy(o,u,["name","material","skeleton","instances","parent","uniqueId","source","metadata","hasLODLevels","geometry","isBlocked","areNormalsFrozen","onBeforeDrawObservable","onBeforeRenderObservable","onAfterRenderObservable","onBeforeDraw","onAfterWorldMatrixUpdateObservable","onCollideObservable","onCollisionPositionChangeObservable","onRebuildObservable","onDisposeObservable"],["_poseMatrix"]),u._source=o,n.useClonedMeshhMap&&(o.meshMap||(o.meshMap={}),o.meshMap[u.uniqueId]=u),u._originalBuilderSideOrientation=o._originalBuilderSideOrientation,u._creationDataStorage=o._creationDataStorage,u._source._ranges){var h=u._source._ranges;for(var r in h)h.hasOwnProperty(r)&&h[r]&&u.createAnimationRange(r,h[r].from,h[r].to)}var d;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.parent=o.parent,u.setPivotMatrix(o.getPivotMatrix()),u.id=r+"."+o.id,u.material=o.material,!c)for(var f=o.getDescendants(!0),p=0;p<f.length;p++){var g=f[p];g.clone&&g.clone(r+"."+g.name,u)}var m=u.getScene().getPhysicsEngine();if(l&&m){var _=m.getImpostorForPhysicsObject(o);_&&(u.physicsImpostor=_.clone(u))}for(d=0;d<n.particleSystems.length;d++){var v=n.particleSystems[d];v.emitter===o&&v.clone(v.name,u)}u.refreshBoundingInfo(),u.computeWorldMatrix(!0)}return null!==i&&(u.parent=i),u}return n.__extends(t,e),t._GetDefaultSideOrientation=function(e){return e||t.FRONTSIDE},Object.defineProperty(t.prototype,"onBeforeRenderObservable",{get:function(){return this._onBeforeRenderObservable||(this._onBeforeRenderObservable=new i.Observable),this._onBeforeRenderObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeBindObservable",{get:function(){return this._onBeforeBindObservable||(this._onBeforeBindObservable=new i.Observable),this._onBeforeBindObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onAfterRenderObservable",{get:function(){return this._onAfterRenderObservable||(this._onAfterRenderObservable=new i.Observable),this._onAfterRenderObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeDrawObservable",{get:function(){return this._onBeforeDrawObservable||(this._onBeforeDrawObservable=new i.Observable),this._onBeforeDrawObservable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onBeforeDraw",{set:function(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"morphTargetManager",{get:function(){return this._morphTargetManager},set:function(e){this._morphTargetManager!==e&&(this._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isUnIndexed",{get:function(){return this._unIndexed},set:function(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"Mesh"},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(u.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._LODLevels.length>0},enumerable:!0,configurable:!0}),t.prototype.getLODLevels=function(){return this._LODLevels},t.prototype._sortLODLevels=function(){this._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 b.Logger.Warn("You cannot use a mesh as LOD level twice"),this;var r=new x(e,t);return this._LODLevels.push(r),t&&(t._masterMesh=this),this._sortLODLevels(),this},t.prototype.getLODLevelAtDistance=function(e){for(var t=0;t<this._LODLevels.length;t++){var r=this._LODLevels[t];if(r.distance===e)return r.mesh}return null},t.prototype.removeLODLevel=function(e){for(var t=0;t<this._LODLevels.length;t++)this._LODLevels[t].mesh===e&&(this._LODLevels.splice(t,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this},t.prototype.getLOD=function(e,t){if(!this._LODLevels||0===this._LODLevels.length)return this;var r;t?r=t:r=this.getBoundingInfo().boundingSphere;var n=r.centerWorld.subtract(e.globalPosition).length();if(this._LODLevels[this._LODLevels.length-1].distance>n)return this.onLODLevelSelection&&this.onLODLevelSelection(n,this,this._LODLevels[this._LODLevels.length-1].mesh),this;for(var i=0;i<this._LODLevels.length;i++){var o=this._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:!0,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:!0,configurable:!0}),t.prototype.isReady=function(t,r){if(void 0===t&&(t=!1),void 0===r&&(r=!1),this.delayLoadState===A.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 n=this.getEngine(),i=this.getScene(),o=r||n.getCaps().instancedArrays&&this.instances.length>0;this.computeWorldMatrix();var s=this.material||i.defaultMaterial;if(s)if(s._storeEffectOnSubMeshes)for(var a=0,c=this.subMeshes;a<c.length;a++){var l=(g=c[a]).getMaterial();if(l)if(l._storeEffectOnSubMeshes){if(!l.isReadyForSubMesh(this,g,o))return!1}else if(!l.isReady(this,o))return!1}else if(!s.isReady(this,o))return!1;for(var u=0,h=this._lightSources;u<h.length;u++){var d=h[u].getShadowGenerator();if(d)for(var f=0,p=this.subMeshes;f<p.length;f++){var g=p[f];if(!d.isReady(g,o))return!1}}for(var m=0,_=this._LODLevels;m<_.length;m++){var v=_[m];if(v.mesh&&!v.mesh.isReady(o))return!1}return!0},Object.defineProperty(t.prototype,"areNormalsFrozen",{get:function(){return this._areNormalsFrozen},enumerable:!0,configurable:!0}),t.prototype.freezeNormals=function(){return this._areNormalsFrozen=!0,this},t.prototype.unfreezeNormals=function(){return this._areNormalsFrozen=!1,this},Object.defineProperty(t.prototype,"overridenInstanceCount",{set:function(e){this._instanceDataStorage.overridenInstanceCount=e},enumerable:!0,configurable:!0}),t.prototype._preActivate=function(){var e=this.getScene().getRenderId();return this._preActivateId===e?this:(this._preActivateId=e,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.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 p.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++)p.SubMesh.CreateFromIndices(0,n,Math.min(r,t-n),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 d.Geometry(d.Geometry.RandomId(),o,i,r,this)}return this},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=d.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(u.VertexBuffer.PositionKind);if(!r)return this;if(e(r),this.updateVerticesData(u.VertexBuffer.PositionKind,r,!1,!1),t){var n=this.getIndices(),i=this.getVerticesData(u.VertexBuffer.NormalKind);if(!i)return this;h.VertexData.ComputeNormals(r,n,i),this.updateVerticesData(u.VertexBuffer.NormalKind,i,!1,!1)}return this},t.prototype.makeGeometryUnique=function(){if(!this._geometry)return this;var e=this._geometry,t=this._geometry.copy(d.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 d.Geometry(d.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 m.Material.PointFillMode:n=null;break;case m.Material.WireFrameFillMode:n=e._getLinesIndexBuffer(this.getIndices(),i);break;default:case m.Material.TriangleFillMode:n=this._unIndexed?null: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._onBeforeDrawObservable&&this._onBeforeDrawObservable.notifyObservers(this);var n=this.getScene().getEngine();return this._unIndexed||t==m.Material.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,r):t==m.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){var t=this.getScene(),r=this._instanceDataStorage.batchCache;if(r.mustReturn=!1,r.renderSelf[e]=this.isEnabled()&&this.isVisible,r.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances){var n=this._instanceDataStorage.visibleInstances,i=t.getRenderId(),o=t._isInIntermediateRendering()?n.intermediateDefaultRenderId:n.defaultRenderId;r.visibleInstances[e]=n[i];var s=this._renderId;!r.visibleInstances[e]&&o&&(r.visibleInstances[e]=n[o],i=Math.max(o,i),s=Math.max(n.selfDefaultRenderId,i));var a=r.visibleInstances[e];if(a&&a.length){if(this._instanceDataStorage.renderIdForInstances[e]===i)return r.mustReturn=!0,r;i!==s&&(r.renderSelf[e]=!1)}this._instanceDataStorage.renderIdForInstances[e]=i}return r},t.prototype._renderWithInstances=function(e,t,r,n,i){var o=r.visibleInstances[e._id];if(!o)return this;for(var s=16*(o.length+1)*4,a=this._instanceDataStorage,c=a.instancesBufferSize,l=a.instancesBuffer;a.instancesBufferSize<s;)a.instancesBufferSize*=2;a.instancesData&&c==a.instancesBufferSize||(a.instancesData=new Float32Array(a.instancesBufferSize/4));var h=0,d=0,f=this._effectiveMesh.getWorldMatrix();if(r.renderSelf[e._id]&&(f.copyToArray(a.instancesData,h),h+=16,d++),o)for(var p=0;p<o.length;p++){o[p].getWorldMatrix().copyToArray(a.instancesData,h),h+=16,d++}return l&&c==a.instancesBufferSize?l.updateDirectly(a.instancesData,0,d):(l&&l.dispose(),l=new u.Buffer(i,a.instancesData,!0,16,!1,!0),a.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._bind(e,n,t),this._draw(e,t,d),i.unbindInstanceAttributes(),this},t.prototype._processRendering=function(e,t,r,n,i,o,s){var a=this.getScene().getEngine();if(i)this._renderWithInstances(e,r,n,t,a);else{n.renderSelf[e._id]&&(o&&o(!1,this._effectiveMesh.getWorldMatrix(),s),this._draw(e,r,this._instanceDataStorage.overridenInstanceCount));var c=n.visibleInstances[e._id];if(c)for(var l=0;l<c.length;l++){var u=c[l].getWorldMatrix();o&&o(!0,u,s),this._draw(e,r)}}return this},t.prototype.render=function(e,t){if(this._checkOcclusionQuery())return this;var r=this.getScene(),n=this._getInstancesRenderList(e._id);if(n.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._onBeforeRenderObservable&&this._onBeforeRenderObservable.notifyObservers(this);var i,o=r.getEngine(),s=o.getCaps().instancedArrays&&null!==n.visibleInstances[e._id]&&void 0!==n.visibleInstances[e._id],a=e.getMaterial();if(!a)return this;if(this._effectiveMaterial=a,this._effectiveMaterial._storeEffectOnSubMeshes){if(!this._effectiveMaterial.isReadyForSubMesh(this,e,s))return this}else if(!this._effectiveMaterial.isReady(this,s))return this;t&&o.setAlphaMode(this._effectiveMaterial.alphaMode);for(var c=0,l=r._beforeRenderingMeshStage;c<l.length;c++){l[c].action(this,e,n)}if(!(i=this._effectiveMaterial._storeEffectOnSubMeshes?e.effect:this._effectiveMaterial.getEffect()))return this;var u=this._effectiveMesh,h=this.overrideMaterialSideOrientation;null==h&&(h=this._effectiveMaterial.sideOrientation,u._getWorldMatrixDeterminant()<0&&(h=h===m.Material.ClockWiseSideOrientation?m.Material.CounterClockWiseSideOrientation:m.Material.ClockWiseSideOrientation));var d=this._effectiveMaterial._preBind(i,h);this._effectiveMaterial.forceDepthWrite&&o.setDepthWrite(!0);var f=r.forcePointsCloud?m.Material.PointFillMode:r.forceWireframe?m.Material.WireFrameFillMode:this._effectiveMaterial.fillMode;this._onBeforeBindObservable&&this._onBeforeBindObservable.notifyObservers(this),s||this._bind(e,i,f);var p=u.getWorldMatrix();this._effectiveMaterial._storeEffectOnSubMeshes?this._effectiveMaterial.bindForSubMesh(p,this,e):this._effectiveMaterial.bind(p,this),!this._effectiveMaterial.backFaceCulling&&this._effectiveMaterial.separateCullingPass&&(o.setState(!0,this._effectiveMaterial.zOffset,!1,!d),this._processRendering(e,i,f,n,s,this._onBeforeDraw,this._effectiveMaterial),o.setState(!0,this._effectiveMaterial.zOffset,!1,d)),this._processRendering(e,i,f,n,s,this._onBeforeDraw,this._effectiveMaterial),this._effectiveMaterial.unbind();for(var g=0,_=r._afterRenderingMeshStage;g<_.length;g++){_[g].action(this,e,n)}return this._onAfterRenderObservable&&this._onAfterRenderObservable.notifyObservers(this),this},t.prototype._onBeforeDraw=function(e,t,r){e&&r&&r.bindOnlyWorldMatrix(t)},t.prototype.cleanMatrixWeights=function(){this.isVerticesDataPresent(u.VertexBuffer.MatricesWeightsKind)&&(this.isVerticesDataPresent(u.VertexBuffer.MatricesWeightsExtraKind)?this.normalizeSkinWeightsAndExtra():this.normalizeSkinFourWeights())},t.prototype.normalizeSkinFourWeights=function(){for(var e=this.getVerticesData(u.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(u.VertexBuffer.MatricesWeightsKind,e)},t.prototype.normalizeSkinWeightsAndExtra=function(){for(var e=this.getVerticesData(u.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(u.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(u.VertexBuffer.MatricesWeightsKind,t),this.setVerticesData(u.VertexBuffer.MatricesWeightsKind,e)},t.prototype.validateSkinning=function(){var e=this.getVerticesData(u.VertexBuffer.MatricesWeightsExtraKind),t=this.getVerticesData(u.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,c=new Array,l=0;l<=a;l++)c[l]=0;for(l=0;l<r;l+=4){for(var h=t[l],d=h,f=0===d?0:1,p=1;p<a;p++){var g=p<4?t[l+p]:e[l+p-4];g>h&&n++,0!==g&&f++,d+=g,h=g}if(c[f]++,f>o&&(o=f),0===d)i++;else{var m=1/d,_=0;for(p=0;p<a;p++)_+=p<4?Math.abs(t[l+p]-t[l+p]*m):Math.abs(e[l+p-4]-e[l+p-4]*m);_>.001&&s++}}var v=this.skeleton.bones.length,A=this.getVerticesData(u.VertexBuffer.MatricesIndicesKind),y=this.getVerticesData(u.VertexBuffer.MatricesIndicesExtraKind),b=0;for(l=0;l<r;l++)for(p=0;p<a;p++){var T=p<4?A[p]:y[p-4];(T>=v||T<0)&&b++}return{skinned:!0,valid:0===i&&0===s&&0===b,report:"Number of Weights = "+r/4+"\nMaximum influences = "+o+"\nMissing Weights = "+i+"\nNot Sorted = "+n+"\nNot Normalized = "+s+"\nWeightCounts = ["+c+"]\nNumber of bones = "+v+"\nBad Bone Indices = "+b}},t.prototype._checkDelayState=function(){var e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===A.Constants.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=A.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._syncSubMeshes()}),t.delayLoadState=A.Constants.DELAYLOADSTATE_LOADED,e._removePendingData(t)},function(){},e.offlineProvider,r),this},t.prototype.isInFrustum=function(t){return this.delayLoadState!==A.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(u.VertexBuffer.PositionKind))return this;var t=this.subMeshes.splice(0);this._resetPointsArrayCache();var r,n=this.getVerticesData(u.VertexBuffer.PositionKind),i=new Array;for(r=0;r<n.length;r+=3)c.Vector3.TransformCoordinates(c.Vector3.FromArray(n,r),e).toArray(i,r);if(this.setVerticesData(u.VertexBuffer.PositionKind,i,this.getVertexBuffer(u.VertexBuffer.PositionKind).isUpdatable()),this.isVerticesDataPresent(u.VertexBuffer.NormalKind)){for(n=this.getVerticesData(u.VertexBuffer.NormalKind),i=[],r=0;r<n.length;r+=3)c.Vector3.TransformNormal(c.Vector3.FromArray(n,r),e).normalize().toArray(i,r);this.setVerticesData(u.VertexBuffer.NormalKind,i,this.getVertexBuffer(u.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(){return this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=c.Quaternion.Identity()),this._worldMatrix=c.Matrix.Identity(),this},Object.defineProperty(t.prototype,"_positions",{get:function(){return this._geometry?this._geometry._positions:null},enumerable:!0,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===i&&(i=!0),new t(e,this.getScene(),r,this,n,i)},t.prototype.dispose=function(t,r){if(void 0===r&&(r=!1),this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0),this._onBeforeDrawObservable&&this._onBeforeDrawObservable.clear(),this._onBeforeBindObservable&&this._onBeforeBindObservable.clear(),this._onBeforeRenderObservable&&this._onBeforeRenderObservable.clear(),this._onAfterRenderObservable&&this._onAfterRenderObservable.clear(),this._scene.useClonedMeshhMap){if(this.meshMap)for(var n in this.meshMap){(s=this.meshMap[n])&&(s._source=null,this.meshMap[n]=void 0)}this._source&&this._source.meshMap&&(this._source.meshMap[this.uniqueId]=void 0)}else for(var i=0,o=this.getScene().meshes;i<o.length;i++){var s;(s=o[i])._source&&s._source===this&&(s._source=null)}for(this._source=null,this._instanceDataStorage.instancesBuffer&&(this._instanceDataStorage.instancesBuffer.dispose(),this._instanceDataStorage.instancesBuffer=null);this.instances.length;)this.instances[0].dispose();e.prototype.dispose.call(this,t,r)},t.prototype.applyDisplacementMap=function(e,t,r,n,i,s,a){var c=this;void 0===a&&(a=!1);var l=this.getScene();return o.Tools.LoadImage(e,function(e){var o=document.createElement("canvas"),l=o.getContext("2d"),u=e.width,h=e.height;o.width=u,o.height=h,l.drawImage(e,0,0);var d=l.getImageData(0,0,u,h).data;c.applyDisplacementMapFromBuffer(d,u,h,t,r,i,s,a),n&&n(c)},function(){},l.offlineProvider),this},t.prototype.applyDisplacementMapFromBuffer=function(e,t,r,n,i,o,s,a){if(void 0===a&&(a=!1),!this.isVerticesDataPresent(u.VertexBuffer.PositionKind)||!this.isVerticesDataPresent(u.VertexBuffer.NormalKind)||!this.isVerticesDataPresent(u.VertexBuffer.UVKind))return b.Logger.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;var l=this.getVerticesData(u.VertexBuffer.PositionKind,!0,!0),d=this.getVerticesData(u.VertexBuffer.NormalKind),f=this.getVerticesData(u.VertexBuffer.UVKind),p=c.Vector3.Zero(),g=c.Vector3.Zero(),m=c.Vector2.Zero();o=o||c.Vector2.Zero(),s=s||new c.Vector2(1,1);for(var _=0;_<l.length;_+=3){c.Vector3.FromArrayToRef(l,_,p),c.Vector3.FromArrayToRef(d,_,g),c.Vector2.FromArrayToRef(f,_/3*2,m);var v=4*((Math.abs(m.x*s.x+o.x)*t%t|0)+(Math.abs(m.y*s.y+o.y)*r%r|0)*t),A=.3*(e[v]/255)+.59*(e[v+1]/255)+.11*(e[v+2]/255);g.normalize(),g.scaleInPlace(n+(i-n)*A),(p=p.add(g)).toArray(l,_)}return h.VertexData.ComputeNormals(l,this.getIndices(),d),a?(this.setVerticesData(u.VertexBuffer.PositionKind,l),this.setVerticesData(u.VertexBuffer.NormalKind,d)):(this.updateVerticesData(u.VertexBuffer.PositionKind,l),this.updateVerticesData(u.VertexBuffer.NormalKind,d)),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!==u.VertexBuffer.NormalKind?(n[t]=a,i[t]=n[t].getData(),o[t]=[]):(s=a.isUpdatable(),r.splice(e,1),e--)}var l,h=this.subMeshes.slice(0),d=this.getIndices(),f=this.getTotalIndices();for(l=0;l<f;l++){var g=d[l];for(e=0;e<r.length;e++)for(var m=n[t=r[e]].getStrideSize(),_=0;_<m;_++)o[t].push(i[t][g*m+_])}var v=[],A=o[u.VertexBuffer.PositionKind];for(l=0;l<f;l+=3){d[l]=l,d[l+1]=l+1,d[l+2]=l+2;for(var y=c.Vector3.FromArray(A,3*l),b=c.Vector3.FromArray(A,3*(l+1)),T=c.Vector3.FromArray(A,3*(l+2)),E=y.subtract(b),x=T.subtract(b),C=c.Vector3.Normalize(c.Vector3.Cross(E,x)),P=0;P<3;P++)v.push(C.x),v.push(C.y),v.push(C.z)}for(this.setIndices(d),this.setVerticesData(u.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 M=0;M<h.length;M++){var S=h[M];p.SubMesh.AddToMesh(S.materialIndex,S.indexStart,S.indexCount,S.indexStart,S.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,c=this.subMeshes.slice(0),l=this.getIndices(),u=this.getTotalIndices();for(a=0;a<u;a++){var h=l[a];for(e=0;e<r.length;e++)for(var d=n[t=r[e]].getStrideSize(),f=0;f<d;f++)o[t].push(i[t][h*d+f])}for(a=0;a<u;a+=3)l[a]=a,l[a+1]=a+1,l[a+2]=a+2;for(this.setIndices(l),e=0;e<r.length;e++)t=r[e],this.setVerticesData(t,o[t],n[t].isUpdatable());this.releaseSubMeshes();for(var g=0;g<c.length;g++){var m=c[g];p.SubMesh.AddToMesh(m.materialIndex,m.indexStart,m.indexCount,m.indexStart,m.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(u.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},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)b.Logger.Warn("VertexData contains null entries");else{for(var s,a,l=e+1,u=new Array,d=0;d<l+1;d++)u[d]=new Array;var f,p=new c.Vector3(0,0,0),g=new c.Vector3(0,0,0),m=new c.Vector2(0,0),_=new Array,v=new Array,A=new Array,y=i.length,T=r.length;for(d=0;d<n.length;d+=3){v[0]=n[d],v[1]=n[d+1],v[2]=n[d+2];for(var E=0;E<3;E++)if(s=v[E],a=v[(E+1)%3],void 0===A[s]&&void 0===A[a]?(A[s]=new Array,A[a]=new Array):(void 0===A[s]&&(A[s]=new Array),void 0===A[a]&&(A[a]=new Array)),void 0===A[s][a]&&void 0===A[a][s]){A[s][a]=[],p.x=(i[3*a]-i[3*s])/l,p.y=(i[3*a+1]-i[3*s+1])/l,p.z=(i[3*a+2]-i[3*s+2])/l,g.x=(o[3*a]-o[3*s])/l,g.y=(o[3*a+1]-o[3*s+1])/l,g.z=(o[3*a+2]-o[3*s+2])/l,m.x=(r[2*a]-r[2*s])/l,m.y=(r[2*a+1]-r[2*s+1])/l,A[s][a].push(s);for(var x=1;x<l;x++)A[s][a].push(i.length/3),i[y]=i[3*s]+x*p.x,o[y++]=o[3*s]+x*g.x,i[y]=i[3*s+1]+x*p.y,o[y++]=o[3*s+1]+x*g.y,i[y]=i[3*s+2]+x*p.z,o[y++]=o[3*s+2]+x*g.z,r[T++]=r[2*s]+x*m.x,r[T++]=r[2*s+1]+x*m.y;A[s][a].push(a),A[a][s]=new Array,f=A[s][a].length;for(var C=0;C<f;C++)A[a][s][C]=A[s][a][f-1-C]}u[0][0]=n[d],u[1][0]=A[n[d]][n[d+1]][1],u[1][1]=A[n[d]][n[d+2]][1];for(x=2;x<l;x++){u[x][0]=A[n[d]][n[d+1]][x],u[x][x]=A[n[d]][n[d+2]][x],p.x=(i[3*u[x][x]]-i[3*u[x][0]])/x,p.y=(i[3*u[x][x]+1]-i[3*u[x][0]+1])/x,p.z=(i[3*u[x][x]+2]-i[3*u[x][0]+2])/x,g.x=(o[3*u[x][x]]-o[3*u[x][0]])/x,g.y=(o[3*u[x][x]+1]-o[3*u[x][0]+1])/x,g.z=(o[3*u[x][x]+2]-o[3*u[x][0]+2])/x,m.x=(r[2*u[x][x]]-r[2*u[x][0]])/x,m.y=(r[2*u[x][x]+1]-r[2*u[x][0]+1])/x;for(E=1;E<x;E++)u[x][E]=i.length/3,i[y]=i[3*u[x][0]]+E*p.x,o[y++]=o[3*u[x][0]]+E*g.x,i[y]=i[3*u[x][0]+1]+E*p.y,o[y++]=o[3*u[x][0]+1]+E*g.y,i[y]=i[3*u[x][0]+2]+E*p.z,o[y++]=o[3*u[x][0]+2]+E*g.z,r[T++]=r[2*u[x][0]]+E*m.x,r[T++]=r[2*u[x][0]+1]+E*m.y}u[l]=A[n[d+1]][n[d+2]],_.push(u[0][0],u[1][0],u[1][1]);for(x=1;x<l;x++){for(E=0;E<x;E++)_.push(u[x][E],u[x+1][E],u[x+1][E+1]),_.push(u[x][E],u[x+1][E+1],u[x][E+1]);_.push(u[x][E],u[x+1][E],u[x+1][E+1])}}t.indices=_,t.applyToMesh(this)}},t.prototype.forceSharedVertices=function(){var e=h.VertexData.ExtractFromMesh(this),t=e.uvs,r=e.indices,n=e.positions,i=e.normals;if(null===r||null===n||null===i||null===t)b.Logger.Warn("VertexData contains null entries");else{for(var o,s,a=new Array,c=new Array,l=new Array,u=new Array,d=0,f=new Array,p=0;p<r.length;p+=3){s=[r[p],r[p+1],r[p+2]],u=new Array;for(var g=0;g<3;g++){u[g]="";for(var m=0;m<3;m++)Math.abs(n[3*s[g]+m])<1e-8&&(n[3*s[g]+m]=0),u[g]+=n[3*s[g]+m]+"|";u[g]=u[g].slice(0,-1)}if(u[0]!=u[1]&&u[0]!=u[2]&&u[1]!=u[2])for(g=0;g<3;g++){if((o=f.indexOf(u[g]))<0){f.push(u[g]),o=d++;for(m=0;m<3;m++)a.push(n[3*s[g]+m]);for(m=0;m<2;m++)l.push(t[2*s[g]+m])}c.push(o)}}var _=new Array;h.VertexData.ComputeNormals(a,c,_),e.positions=a,e.indices=c,e.normals=_,e.uvs=l,e.applyToMesh(this)}},t._instancedMeshFactory=function(e,t){throw E._DevTools.WarnImport("InstancedMesh")},t._PhysicsImpostorParser=function(e,t,r){throw E._DevTools.WarnImport("PhysicsImpostor")},t.prototype.createInstance=function(e){return t._instancedMeshFactory(e,this)},t.prototype.synchronizeInstances=function(){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(u.VertexBuffer.PositionKind);if(!n||!r)return this;for(var i=new Array,s=0;s<n.length;s+=3)i.push(c.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.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,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?e.materialId=this.material.id:this.material=null,this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id);var o=this.getPhysicsImpostor();o&&(e.physicsMass=o.getParam("mass"),e.physicsFriction=o.getParam("friction"),e.physicsRestitution=o.getParam("mass"),e.physicsImpostor=o.type),this.metadata&&(e.metadata=this.metadata),e.instances=[];for(var s=0;s<this.instances.length;s++){var c=this.instances[s];if(!c.doNotSerialize){var l={name:c.name,id:c.id,position:c.position.asArray(),scaling:c.scaling.asArray()};c.parent&&(l.parentId=c.parent.id),c.rotationQuaternion?l.rotationQuaternion=c.rotationQuaternion.asArray():c.rotation&&(l.rotation=c.rotation.asArray()),e.instances.push(l),y.SerializationHelper.AppendSerializedAnimations(c,l),l.ranges=c.serializeAnimationRanges()}}y.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._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices())return b.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 b.Logger.Error("Invalid morph target. Target must have positions.");this.geometry.setVerticesData(u.VertexBuffer.PositionKind+t,n,!1,3);var i=r.getNormals();i&&this.geometry.setVerticesData(u.VertexBuffer.NormalKind+t,i,!1,3);var o=r.getTangents();o&&this.geometry.setVerticesData(u.VertexBuffer.TangentKind+t,o,!1,3)}}else for(t=0;this.geometry.isVerticesDataPresent(u.VertexBuffer.PositionKind+t);)this.geometry.removeVerticesData(u.VertexBuffer.PositionKind+t),this.geometry.isVerticesDataPresent(u.VertexBuffer.NormalKind+t)&&this.geometry.removeVerticesData(u.VertexBuffer.NormalKind+t),this.geometry.isVerticesDataPresent(u.VertexBuffer.TangentKind+t)&&this.geometry.removeVerticesData(u.VertexBuffer.TangentKind+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=c.Vector3.FromArray(e.position),void 0!==e.metadata&&(i.metadata=e.metadata),e.rotationQuaternion?i.rotationQuaternion=c.Quaternion.FromArray(e.rotationQuaternion):e.rotation&&(i.rotation=c.Vector3.FromArray(e.rotation)),i.scaling=c.Vector3.FromArray(e.scaling),e.localMatrix?i.setPreTransformMatrix(c.Matrix.FromArray(e.localMatrix)):e.pivotMatrix&&i.setPivotMatrix(c.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,void 0!==e.isBlocker&&(i.isBlocker=e.isBlocker),i._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(i._waitingFreezeWorldMatrix=e.freezeWorldMatrix),e.parentId&&(i._waitingParentId=e.parentId),void 0!==e.actions&&(i._waitingActions=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=A.Constants.DELAYLOADSTATE_NOTLOADED,i.delayLoadingFile=n+e.delayLoadingFile,i._boundingInfo=new g.BoundingInfo(c.Vector3.FromArray(e.boundingBoxMinimum),c.Vector3.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(i._binaryInfo=e._binaryInfo),i._delayInfo=[],e.hasUVs&&i._delayInfo.push(u.VertexBuffer.UVKind),e.hasUVs2&&i._delayInfo.push(u.VertexBuffer.UV2Kind),e.hasUVs3&&i._delayInfo.push(u.VertexBuffer.UV3Kind),e.hasUVs4&&i._delayInfo.push(u.VertexBuffer.UV4Kind),e.hasUVs5&&i._delayInfo.push(u.VertexBuffer.UV5Kind),e.hasUVs6&&i._delayInfo.push(u.VertexBuffer.UV6Kind),e.hasColors&&i._delayInfo.push(u.VertexBuffer.ColorKind),e.hasMatricesIndices&&i._delayInfo.push(u.VertexBuffer.MatricesIndicesKind),e.hasMatricesWeights&&i._delayInfo.push(u.VertexBuffer.MatricesWeightsKind),i._delayLoadingFunction=d.Geometry._ImportGeometry,v.SceneLoaderFlags.ForceFullSceneLoadingForIncremental&&i._checkDelayState()):d.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=T._TypeStore.GetClass("BABYLON.Animation"))&&i.animations.push(m.Parse(s))}l.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.instances)for(var h=0;h<e.instances.length;h++){var f=e.instances[h],p=i.createInstance(f.name);if(f.id&&(p.id=f.id),a.Tags&&(f.tags?a.Tags.AddTagsTo(p,f.tags):a.Tags.AddTagsTo(p,e.tags)),p.position=c.Vector3.FromArray(f.position),f.parentId&&(p._waitingParentId=f.parentId),f.rotationQuaternion?p.rotationQuaternion=c.Quaternion.FromArray(f.rotationQuaternion):f.rotation&&(p.rotation=c.Vector3.FromArray(f.rotation)),p.scaling=c.Vector3.FromArray(f.scaling),null!=f.checkCollisions&&null!=f.checkCollisions&&(p.checkCollisions=f.checkCollisions),null!=f.pickable&&null!=f.pickable&&(p.isPickable=f.pickable),null!=f.showBoundingBox&&null!=f.showBoundingBox&&(p.showBoundingBox=f.showBoundingBox),null!=f.showSubMeshesBoundingBox&&null!=f.showSubMeshesBoundingBox&&(p.showSubMeshesBoundingBox=f.showSubMeshesBoundingBox),null!=f.alphaIndex&&null!=f.showSubMeshesBoundingBox&&(p.alphaIndex=f.alphaIndex),f.physicsImpostor&&t._PhysicsImpostorParser(r,p,f),f.animations){for(o=0;o<f.animations.length;o++){var m;s=f.animations[o],(m=T._TypeStore.GetClass("BABYLON.Animation"))&&p.animations.push(m.Parse(s))}l.Node.ParseAnimationRanges(p,f,r),f.autoAnimate&&r.beginAnimation(p,f.autoAnimateFrom,f.autoAnimateTo,f.autoAnimateLoop,f.autoAnimateSpeed||1)}}return i},t.CreateRibbon=function(e,t,r,n,i,o,s,a,c){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateDisc=function(e,t,r,n,i,o){throw void 0===n&&(n=null),E._DevTools.WarnImport("MeshBuilder")},t.CreateBox=function(e,t,r,n,i){throw void 0===r&&(r=null),E._DevTools.WarnImport("MeshBuilder")},t.CreateSphere=function(e,t,r,n,i,o){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateCylinder=function(e,t,r,n,i,o,s,a,c){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateTorus=function(e,t,r,n,i,o,s){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateTorusKnot=function(e,t,r,n,i,o,s,a,c,l){throw E._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),E._DevTools.WarnImport("MeshBuilder")},t.CreateDashedLines=function(e,t,r,n,i,o,s,a){throw void 0===o&&(o=null),E._DevTools.WarnImport("MeshBuilder")},t.CreatePolygon=function(e,t,r,n,i,o,s){throw void 0===s&&(s=earcut),E._DevTools.WarnImport("MeshBuilder")},t.ExtrudePolygon=function(e,t,r,n,i,o,s,a){throw void 0===a&&(a=earcut),E._DevTools.WarnImport("MeshBuilder")},t.ExtrudeShape=function(e,t,r,n,i,o,s,a,c,l){throw void 0===s&&(s=null),E._DevTools.WarnImport("MeshBuilder")},t.ExtrudeShapeCustom=function(e,t,r,n,i,o,s,a,c,l,u,h){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateLathe=function(e,t,r,n,i,o,s){throw E._DevTools.WarnImport("MeshBuilder")},t.CreatePlane=function(e,t,r,n,i){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateGround=function(e,t,r,n,i,o){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateTiledGround=function(e,t,r,n,i,o,s,a,c){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateGroundFromHeightMap=function(e,t,r,n,i,o,s,a,c,l,u){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateTube=function(e,t,r,n,i,o,s,a,c,l){throw E._DevTools.WarnImport("MeshBuilder")},t.CreatePolyhedron=function(e,t,r){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateIcoSphere=function(e,t,r){throw E._DevTools.WarnImport("MeshBuilder")},t.CreateDecal=function(e,t,r,n,i,o){throw E._DevTools.WarnImport("MeshBuilder")},t.prototype.setPositionsForCPUSkinning=function(){if(!this._sourcePositions){var e=this.getVerticesData(u.VertexBuffer.PositionKind);if(!e)return this._sourcePositions;this._sourcePositions=new Float32Array(e),this.isVertexBufferUpdatable(u.VertexBuffer.PositionKind)||this.setVerticesData(u.VertexBuffer.PositionKind,e,!0)}return this._sourcePositions},t.prototype.setNormalsForCPUSkinning=function(){if(!this._sourceNormals){var e=this.getVerticesData(u.VertexBuffer.NormalKind);if(!e)return this._sourceNormals;this._sourceNormals=new Float32Array(e),this.isVertexBufferUpdatable(u.VertexBuffer.NormalKind)||this.setVerticesData(u.VertexBuffer.NormalKind,e,!0)}return this._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(u.VertexBuffer.PositionKind))return this;if(!this.isVerticesDataPresent(u.VertexBuffer.NormalKind))return this;if(!this.isVerticesDataPresent(u.VertexBuffer.MatricesIndicesKind))return this;if(!this.isVerticesDataPresent(u.VertexBuffer.MatricesWeightsKind))return this;if(!this._sourcePositions){var t=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=t}this._sourceNormals||this.setNormalsForCPUSkinning();var r=this.getVerticesData(u.VertexBuffer.PositionKind);if(!r)return this;r instanceof Float32Array||(r=new Float32Array(r));var n=this.getVerticesData(u.VertexBuffer.NormalKind);if(!n)return this;n instanceof Float32Array||(n=new Float32Array(n));var i=this.getVerticesData(u.VertexBuffer.MatricesIndicesKind),o=this.getVerticesData(u.VertexBuffer.MatricesWeightsKind);if(!o||!i)return this;for(var s,a=this.numBoneInfluencers>4,l=a?this.getVerticesData(u.VertexBuffer.MatricesIndicesExtraKind):null,h=a?this.getVerticesData(u.VertexBuffer.MatricesWeightsExtraKind):null,d=e.getTransformMatrices(this),f=c.Vector3.Zero(),p=new c.Matrix,g=new c.Matrix,m=0,_=0;_<r.length;_+=3,m+=4){var v;for(s=0;s<4;s++)(v=o[m+s])>0&&(c.Matrix.FromFloat32ArrayToRefScaled(d,Math.floor(16*i[m+s]),v,g),p.addToSelf(g));if(a)for(s=0;s<4;s++)(v=h[m+s])>0&&(c.Matrix.FromFloat32ArrayToRefScaled(d,Math.floor(16*l[m+s]),v,g),p.addToSelf(g));c.Vector3.TransformCoordinatesFromFloatsToRef(this._sourcePositions[_],this._sourcePositions[_+1],this._sourcePositions[_+2],p,f),f.toArray(r,_),c.Vector3.TransformNormalFromFloatsToRef(this._sourceNormals[_],this._sourceNormals[_+1],this._sourceNormals[_+2],p,f),f.toArray(n,_),p.reset()}return this.updateVerticesData(u.VertexBuffer.PositionKind,r),this.updateVerticesData(u.VertexBuffer.NormalKind,n),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:c.Vector3.Zero(),max:c.Vector3.Zero()}},t.Center=function(e){var r=e instanceof Array?t.MinMax(e):e;return c.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 c=0;for(a=0;a<e.length;a++)if(e[a]&&(c+=e[a].getTotalVertices())>65536)return b.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 l,u,d=null;o=!1}var f,g=new Array,m=new Array,v=null,A=new Array,y=null;for(a=0;a<e.length;a++)if(e[a]){var T=e[a],E=T.computeWorldMatrix(!0);if((f=h.VertexData.ExtractFromMesh(T,!0,!0)).transform(E),v?v.merge(f,n):(v=f,y=T),o&&A.push(T.getTotalIndices()),s)if(T.material){var x=T.material;if(x instanceof _.MultiMaterial){for(u=0;u<x.subMaterials.length;u++)g.indexOf(x.subMaterials[u])<0&&g.push(x.subMaterials[u]);for(l=0;l<T.subMeshes.length;l++)m.push(g.indexOf(x.subMaterials[T.subMeshes[l].materialIndex])),A.push(T.subMeshes[l].indexCount)}else for(g.indexOf(x)<0&&g.push(x),l=0;l<T.subMeshes.length;l++)m.push(g.indexOf(x)),A.push(T.subMeshes[l].indexCount)}else for(l=0;l<T.subMeshes.length;l++)m.push(0),A.push(T.subMeshes[l].indexCount)}if(y=y,i||(i=new t(y.name+"_merged",y.getScene())),v.applyToMesh(i),i.checkCollisions=y.checkCollisions,r)for(a=0;a<e.length;a++)e[a]&&e[a].dispose();if(o||s){i.releaseSubMeshes(),a=0;for(var C=0;a<A.length;)p.SubMesh.CreateFromIndices(0,C,A[a],i),C+=A[a],a++}if(s){for((d=new _.MultiMaterial(y.name+"_merged",y.getScene())).subMaterials=g,l=0;l<i.subMeshes.length;l++)i.subMeshes[l].materialIndex=m[l];i.material=d}else i.material=y.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._GroundMeshParser=function(e,t){throw E._DevTools.WarnImport("GroundMesh")},t}(f.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 s});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),s=function(){function e(){}return e.prototype.set=function(e,t){switch(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(),c=n.Vector4.Zero();for(t=0;t<this.tangents.length;t+=4)n.Vector4.FromArrayToRef(this.tangents,t,a),n.Vector4.TransformNormalToRef(a,e,c),this.tangents[t]=c.x,this.tangents[t+1]=c.y,this.tangents[t+2]=c.z,this.tangents[t+3]=c.w}if(r&&this.indices)for(t=0;t<this.indices.length;t+=3){var l=this.indices[t+1];this.indices[t+1]=this.indices[t+2],this.indices[t+2]=l}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.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){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,c=0,l=0,u=0,h=0,d=0,f=0,p=0,g=0,m=0,_=0,v=0,A=0,y=0,b=0,T=0,E=0,x=0,C=!1,P=!1,M=!1,S=!1,R=1,O=0,I=null;if(i&&(C=!!i.facetNormals,P=!!i.facetPositions,M=!!i.facetPartitioning,R=!0===i.useRightHandedSystem?-1:1,O=i.ratio||0,S=!!i.depthSort,I=i.distanceTo,S)){void 0===I&&(I=n.Vector3.Zero());var D=i.depthSortedFacets}var w=0,L=0,B=0,F=0;if(M&&i&&i.bbSize){var N=0,V=0,U=0,G=0,k=0,z=0,H=0,j=0,X=0,W=0,Y=0,Q=0,K=0,Z=0,J=0,q=0,$=i.bbSize.x>i.bbSize.y?i.bbSize.x:i.bbSize.y;$=$>i.bbSize.z?$:i.bbSize.z,w=i.subDiv.X*O/i.bbSize.x,L=i.subDiv.Y*O/i.bbSize.y,B=i.subDiv.Z*O/i.bbSize.z,F=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(_=(m=3*t[3*o])+1,v=m+2,y=(A=3*t[3*o+1])+1,b=A+2,E=(T=3*t[3*o+2])+1,x=T+2,s=e[m]-e[A],a=e[_]-e[y],c=e[v]-e[b],l=e[T]-e[A],u=e[E]-e[y],d=R*(a*(h=e[x]-e[b])-c*u),f=R*(c*l-s*h),p=R*(s*u-a*l),d/=g=0===(g=Math.sqrt(d*d+f*f+p*p))?1:g,f/=g,p/=g,C&&i&&(i.facetNormals[o].x=d,i.facetNormals[o].y=f,i.facetNormals[o].z=p),P&&i&&(i.facetPositions[o].x=(e[m]+e[A]+e[T])/3,i.facetPositions[o].y=(e[_]+e[y]+e[E])/3,i.facetPositions[o].z=(e[v]+e[b]+e[x])/3),M&&i&&(N=Math.floor((i.facetPositions[o].x-i.bInfo.minimum.x*O)*w),V=Math.floor((i.facetPositions[o].y-i.bInfo.minimum.y*O)*L),U=Math.floor((i.facetPositions[o].z-i.bInfo.minimum.z*O)*B),G=Math.floor((e[m]-i.bInfo.minimum.x*O)*w),k=Math.floor((e[_]-i.bInfo.minimum.y*O)*L),z=Math.floor((e[v]-i.bInfo.minimum.z*O)*B),H=Math.floor((e[A]-i.bInfo.minimum.x*O)*w),j=Math.floor((e[y]-i.bInfo.minimum.y*O)*L),X=Math.floor((e[b]-i.bInfo.minimum.z*O)*B),W=Math.floor((e[T]-i.bInfo.minimum.x*O)*w),Y=Math.floor((e[E]-i.bInfo.minimum.y*O)*L),Q=Math.floor((e[x]-i.bInfo.minimum.z*O)*B),Z=G+i.subDiv.max*k+F*z,J=H+i.subDiv.max*j+F*X,q=W+i.subDiv.max*Y+F*Q,K=N+i.subDiv.max*V+F*U,i.facetPartitioning[K]=i.facetPartitioning[K]?i.facetPartitioning[K]: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]=i.facetPartitioning[q]?i.facetPartitioning[q]:new Array,i.facetPartitioning[Z].push(o),J!=Z&&i.facetPartitioning[J].push(o),q!=J&&q!=Z&&i.facetPartitioning[q].push(o),K!=Z&&K!=J&&K!=q&&i.facetPartitioning[K].push(o)),S&&i&&i.facetPositions){var te=D[o];te.ind=3*o,te.sqDistance=n.Vector3.DistanceSquared(i.facetPositions[o],I)}r[m]+=d,r[_]+=f,r[v]+=p,r[A]+=d,r[y]+=f,r[b]+=p,r[T]+=d,r[E]+=f,r[x]+=p}for(o=0;o<r.length/3;o++)d=r[3*o],f=r[3*o+1],p=r[3*o+2],d/=g=0===(g=Math.sqrt(d*d+f*f+p*p))?1:g,f/=g,p/=g,r[3*o]=d,r[3*o+1]=f,r[3*o+2]=p},e._ComputeSides=function(t,r,i,o,s,a,c){var l,u,h=i.length,d=o.length;switch(t=t||e.DEFAULTSIDE){case e.FRONTSIDE:break;case e.BACKSIDE:var f;for(l=0;l<h;l+=3)f=i[l],i[l]=i[l+2],i[l+2]=f;for(u=0;u<d;u++)o[u]=-o[u];break;case e.DOUBLESIDE:for(var p=r.length,g=p/3,m=0;m<p;m++)r[p+m]=r[m];for(l=0;l<h;l+=3)i[l+h]=i[l+2]+g,i[l+1+h]=i[l+1]+g,i[l+2+h]=i[l]+g;for(u=0;u<d;u++)o[d+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),c=c||new n.Vector4(0,0,1,1),v=0,l=0;l<_/2;l++)s[v]=a.x+(a.z-a.x)*s[v],s[v+1]=a.y+(a.w-a.y)*s[v+1],s[v+_]=c.x+(c.z-c.x)*s[v+_],s[v+_+1]=c.y+(c.w-c.y)*s[v+_+1],v+=2}},e.ImportVertexData=function(t,r){var o=new e,s=t.positions;s&&o.set(s,i.VertexBuffer.PositionKind);var a=t.normals;a&&o.set(a,i.VertexBuffer.NormalKind);var c=t.tangents;c&&o.set(c,i.VertexBuffer.TangentKind);var l=t.uvs;l&&o.set(l,i.VertexBuffer.UVKind);var u=t.uv2s;u&&o.set(u,i.VertexBuffer.UV2Kind);var h=t.uv3s;h&&o.set(h,i.VertexBuffer.UV3Kind);var d=t.uv4s;d&&o.set(d,i.VertexBuffer.UV4Kind);var f=t.uv5s;f&&o.set(f,i.VertexBuffer.UV5Kind);var p=t.uv6s;p&&o.set(p,i.VertexBuffer.UV6Kind);var g=t.colors;g&&o.set(n.Color4.CheckColors4(g,s.length/3),i.VertexBuffer.ColorKind);var m=t.matricesIndices;m&&o.set(m,i.VertexBuffer.MatricesIndicesKind);var _=t.matricesWeights;_&&o.set(_,i.VertexBuffer.MatricesWeightsKind);var v=t.indices;v&&(o.indices=v),r.setAllVerticesData(o,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 y});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/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),a=r(/*! ./Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),c=r(/*! ./Builders/torusBuilder */"./Meshes/Builders/torusBuilder.ts"),l=r(/*! ./Builders/torusKnotBuilder */"./Meshes/Builders/torusKnotBuilder.ts"),u=r(/*! ./Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),h=r(/*! ./Builders/polygonBuilder */"./Meshes/Builders/polygonBuilder.ts"),d=r(/*! ./Builders/shapeBuilder */"./Meshes/Builders/shapeBuilder.ts"),f=r(/*! ./Builders/latheBuilder */"./Meshes/Builders/latheBuilder.ts"),p=r(/*! ./Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),g=r(/*! ./Builders/groundBuilder */"./Meshes/Builders/groundBuilder.ts"),m=r(/*! ./Builders/tubeBuilder */"./Meshes/Builders/tubeBuilder.ts"),_=r(/*! ./Builders/polyhedronBuilder */"./Meshes/Builders/polyhedronBuilder.ts"),v=r(/*! ./Builders/icoSphereBuilder */"./Meshes/Builders/icoSphereBuilder.ts"),A=r(/*! ./Builders/decalBuilder */"./Meshes/Builders/decalBuilder.ts"),y=function(){function e(){}return e.CreateBox=function(e,t,r){return void 0===r&&(r=null),o.BoxBuilder.CreateBox(e,t,r)},e.CreateSphere=function(e,t,r){return s.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 v.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 a.CylinderBuilder.CreateCylinder(e,t,r)},e.CreateTorus=function(e,t,r){return c.TorusBuilder.CreateTorus(e,t,r)},e.CreateTorusKnot=function(e,t,r){return l.TorusKnotBuilder.CreateTorusKnot(e,t,r)},e.CreateLineSystem=function(e,t,r){return u.LinesBuilder.CreateLineSystem(e,t,r)},e.CreateLines=function(e,t,r){return void 0===r&&(r=null),u.LinesBuilder.CreateLines(e,t,r)},e.CreateDashedLines=function(e,t,r){return void 0===r&&(r=null),u.LinesBuilder.CreateDashedLines(e,t,r)},e.ExtrudeShape=function(e,t,r){return void 0===r&&(r=null),d.ShapeBuilder.ExtrudeShape(e,t,r)},e.ExtrudeShapeCustom=function(e,t,r){return d.ShapeBuilder.ExtrudeShapeCustom(e,t,r)},e.CreateLathe=function(e,t,r){return f.LatheBuilder.CreateLathe(e,t,r)},e.CreatePlane=function(e,t,r){return p.PlaneBuilder.CreatePlane(e,t,r)},e.CreateGround=function(e,t,r){return g.GroundBuilder.CreateGround(e,t,r)},e.CreateTiledGround=function(e,t,r){return g.GroundBuilder.CreateTiledGround(e,t,r)},e.CreateGroundFromHeightMap=function(e,t,r,n){return g.GroundBuilder.CreateGroundFromHeightMap(e,t,r,n)},e.CreatePolygon=function(e,t,r,n){return void 0===n&&(n=earcut),h.PolygonBuilder.CreatePolygon(e,t,r,n)},e.ExtrudePolygon=function(e,t,r,n){return void 0===n&&(n=earcut),h.PolygonBuilder.ExtrudePolygon(e,t,r,n)},e.CreateTube=function(e,t,r){return m.TubeBuilder.CreateTube(e,t,r)},e.CreatePolyhedron=function(e,t,r){return _.PolyhedronBuilder.CreatePolyhedron(e,t,r)},e.CreateDecal=function(e,t,r){return A.DecalBuilder.CreateDecal(e,t,r)},e}()},"./Meshes/meshSimplification.ts":
- /*!**************************************!*\
- !*** ./Meshes/meshSimplification.ts ***!
- \**************************************/
- /*! exports provided: SimplificationSettings, SimplificationQueue, SimplificationType */function(e,t,r){"use strict";r.r(t),r.d(t,"SimplificationSettings",function(){return l}),r.d(t,"SimplificationQueue",function(){return u}),r.d(t,"SimplificationType",function(){return n});var n,i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Misc/tools */"./Misc/tools.ts"),l=function(){return function(e,t,r){this.quality=e,this.distance=t,this.optimizeMesh=r}}(),u=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);c.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(){return function(e){this.vertices=e,this.error=new Array(4),this.deleted=!1,this.isDirty=!1,this.deletePending=!1,this.borderFactor=0}}(),d=function(){function e(e,t){this.position=e,this.id=t,this.isBorder=!0,this.q=new f,this.triangleCount=0,this.triangleStart=0,this.originalOffsets=[]}return e.prototype.updatePosition=function(e){this.position.copyFrom(e)},e}(),f=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,c){return this.data[e]*this.data[i]*this.data[c]+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[c]},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}(),p=function(){return 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=i.Epsilon}return e.prototype.simplify=function(e,t){var r=this;this.initDecimatedMesh(),c.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;c.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 l=1e-9*Math.pow(t+3,n.aggressiveness);c.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]>l||r.deleted||r.isDirty))for(var o=0;o<3;++o)if(r.error[o]<l){var a=[],c=[],u=r.vertices[o],h=r.vertices[(o+1)%3];if(u.isBorder||h.isBorder)continue;var d=i.Vector3.Zero();n.calculateError(u,h,d);var f=new Array;if(n.isFlipped(u,h,d,a,f))continue;if(n.isFlipped(h,u,d,c,f))continue;if(a.indexOf(!0)<0||c.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=h.q.add(u.q),u.updatePosition(d);var g=n.references.length;s=n.updateTriangles(u,u,a,s),s=n.updateTriangles(u,h,c,s);var m=n.references.length-g;if(m<=u.triangleCount){if(m)for(var _=0;_<m;_++)n.references[u.triangleStart+_]=n.references[g+_]}else u.triangleStart=g;u.triangleCount=m;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(),l=this._mesh.subMeshes[e],u=[],f=l.verticesCount;c.AsyncLoop.SyncAsyncForLoop(f,this.syncIterations/4>>0,function(e){if(s){var t=e+l.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 d(o,n.vertices.length);a.originalOffsets.push(t),a.id===n.vertices.length&&n.vertices.push(a),u.push(a.id)}},function(){c.AsyncLoop.SyncAsyncForLoop(l.indexCount/3,n.syncIterations,function(e){if(a){var t=3*(l.indexStart/3+e),r=a[t+0],i=a[t+1],o=a[t+2],s=n.vertices[u[r-l.verticesStart]],c=n.vertices[u[i-l.verticesStart]],d=n.vertices[u[o-l.verticesStart]],f=new h([s,c,d]);f.originalOffset=t,n.triangles.push(f)}},function(){n.init(t)})})},e.prototype.init=function(e){var t=this;c.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(f.DataFromNumbers(r.normal.x,r.normal.y,r.normal.z,-i.Vector3.Dot(r.normal,r.vertices[0].position)))},function(){c.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)||[],c=this._reconstructedMesh.getVerticesData(o.VertexBuffer.NormalKind)||[],l=this._reconstructedMesh.getVerticesData(o.VertexBuffer.UVKind)||[],u=this._reconstructedMesh.getVerticesData(o.VertexBuffer.ColorKind)||[],h=this._mesh.getVerticesData(o.VertexBuffer.NormalKind),d=this._mesh.getVerticesData(o.VertexBuffer.UVKind),f=this._mesh.getVerticesData(o.VertexBuffer.ColorKind),p=0;for(t=0;t<this.vertices.length;++t){var g=this.vertices[t];g.id=p,g.triangleCount&&g.originalOffsets.forEach(function(e){h&&(a.push(g.position.x),a.push(g.position.y),a.push(g.position.z),c.push(h[3*e]),c.push(h[3*e+1]),c.push(h[3*e+2]),d&&d.length?(l.push(d[2*e]),l.push(d[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 m=this._reconstructedMesh.getTotalIndices(),_=this._reconstructedMesh.getTotalVertices(),v=this._reconstructedMesh.subMeshes;this._reconstructedMesh.subMeshes=[];var A=this._reconstructedMesh.getIndices(),y=this._mesh.getIndices();for(t=0;t<i.length;++t)r=i[t],[0,1,2].forEach(function(e){var t=y[r.originalOffset+e],n=r.vertices[e].originalOffsets.indexOf(t);n<0&&(n=0),A.push(r.vertices[e].id+n+_)});this._reconstructedMesh.setIndices(A),this._reconstructedMesh.setVerticesData(o.VertexBuffer.PositionKind,a),this._reconstructedMesh.setVerticesData(o.VertexBuffer.NormalKind,c),l.length>0&&this._reconstructedMesh.setVerticesData(o.VertexBuffer.UVKind,l),u.length>0&&this._reconstructedMesh.setVerticesData(o.VertexBuffer.ColorKind,u);var b=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(b.materialIndex,_,p,m,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 c=this.references[e.triangleStart+s].vertexId,l=a.vertices[(c+1)%3],u=a.vertices[(c+2)%3];if(l!==t&&u!==t){var h=l.position.subtract(r);h=h.normalize();var d=u.position.subtract(r);if(d=d.normalize(),Math.abs(i.Vector3.Dot(h,d))>.999)return!0;var f=i.Vector3.Cross(h,d).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,c=o.vertices[s];a<r.length&&n[a]!==c.id;)++a;a===r.length?(r.push(1),n.push(c.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 p(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 c=e.position.add(t.position).divide(new i.Vector3(2,2,2)),l=this.vertexError(n,e.position),u=this.vertexError(n,t.position),h=this.vertexError(n,c);(s=Math.min(l,u,h))===l?r&&r.copyFrom(e.position):s===u?r&&r.copyFrom(t.position):r&&r.copyFrom(c)}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 d}),r.d(t,"PolygonMeshBuilder",function(){return f});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),l=r(/*! ../Engines/engine */"./Engines/engine.ts"),u=function(e){function t(t,r){var n=e.call(this,t.x,t.y)||this;return n.index=r,n}return 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 u(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}(),d=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,c=0;c<n;c++)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 o.Path2.StartingAt(e,t)},e}(),f=function(){function e(e,t,r,n){var s;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||l.Engine.LastCreatedScene,s=t instanceof o.Path2?t.getPoints():t,this._addToepoint(s),this._points.add(s),this._outlinepoints.add(s),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 c.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,l=this.bjsEarcut(this._epoints,this._eholes,2),u=0;u<l.length;u++)a.push(l[u]);if(e>0){var h=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 d=a.length;for(u=0;u<d;u+=3){var f=a[u+0],p=a[u+1],g=a[u+2];a.push(g+h),a.push(p+h),a.push(f+h)}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,c){for(var l=e.length/3,u=0,h=0;h<s.elements.length;h++){var d,f=s.elements[h];d=h+1>s.elements.length-1?s.elements[0]:s.elements[h+1],e.push(f.x,0,f.y),e.push(f.x,-a,f.y),e.push(d.x,0,d.y),e.push(d.x,-a,d.y);var p=new o.Vector3(f.x,0,f.y),g=new o.Vector3(d.x,0,d.y).subtract(p),m=new o.Vector3(0,1,0),_=o.Vector3.Cross(g,m);_=_.normalize(),r.push(u/i.width,0),r.push(u/i.width,1),u+=g.length(),r.push(u/i.width,0),r.push(u/i.width,1),c?(t.push(_.x,_.y,_.z),t.push(_.x,_.y,_.z),t.push(_.x,_.y,_.z),t.push(_.x,_.y,_.z),n.push(l),n.push(l+2),n.push(l+1),n.push(l+1),n.push(l+2),n.push(l+3)):(t.push(-_.x,-_.y,-_.z),t.push(-_.x,-_.y,-_.z),t.push(-_.x,-_.y,-_.z),t.push(-_.x,-_.y,-_.z),n.push(l),n.push(l+1),n.push(l+2),n.push(l+1),n.push(l+3),n.push(l+2)),l+=4}},e}()},"./Meshes/subMesh.ts":
- /*!***************************!*\
- !*** ./Meshes/subMesh.ts ***!
- \***************************/
- /*! exports provided: BaseSubMesh, SubMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseSubMesh",function(){return l}),r.d(t,"SubMesh",function(){return u});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/tools */"./Misc/tools.ts"),o=r(/*! ./buffer */"./Meshes/buffer.ts"),s=r(/*! ../Collisions/intersectionInfo */"./Collisions/intersectionInfo.ts"),a=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),c=r(/*! ../Engines/constants */"./Engines/constants.ts"),l=function(){function e(){}return Object.defineProperty(e.prototype,"effect",{get:function(){return this._materialEffect},enumerable:!0,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}(),u=function(e){function t(t,r,n,i,o,s,a,c){void 0===c&&(c=!0);var l=e.call(this)||this;return l.materialIndex=t,l.verticesStart=r,l.verticesCount=n,l.indexStart=i,l.indexCount=o,l._renderId=0,l._mesh=s,l._renderingMesh=a||s,s.subMeshes.push(l),l._trianglePlanes=[],l._id=s.subMeshes.length-1,c&&(l.refreshBoundingInfo(),s.computeWorldMatrix(!0)),l}return n.__extends(t,e),t.AddToMesh=function(e,r,n,i,o,s,a,c){return void 0===c&&(c=!0),new t(e,r,n,i,o,s,a,c)},Object.defineProperty(t.prototype,"IsGlobal",{get:function(){return 0===this.verticesStart&&this.verticesCount===this._mesh.getTotalVertices()},enumerable:!0,configurable:!0}),t.prototype.getBoundingInfo=function(){return this.IsGlobal?this._mesh.getBoundingInfo():this._boundingInfo},t.prototype.setBoundingInfo=function(e){return this._boundingInfo=e,this},t.prototype.getMesh=function(){return this._mesh},t.prototype.getRenderingMesh=function(){return this._renderingMesh},t.prototype.getMaterial=function(){var e=this._renderingMesh.material;if(null==e)return this._mesh.getScene().defaultMaterial;if(e.getSubMaterial){var t=e.getSubMaterial(this.materialIndex);return this._currentMaterial!==t&&(this._currentMaterial=t,this._materialDefines=null),t}return e},t.prototype.refreshBoundingInfo=function(){if(this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;var e=this._renderingMesh.getVerticesData(o.VertexBuffer.PositionKind);if(!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;var t,r=this._renderingMesh.getIndices();if(0===this.indexStart&&this.indexCount===r.length){var n=this._renderingMesh.getBoundingInfo();t={minimum:n.minimum.clone(),maximum:n.maximum.clone()}}else t=i.Tools.ExtractMinAndMaxIndexed(e,r,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(t.minimum,t.maximum):this._boundingInfo=new a.BoundingInfo(t.minimum,t.maximum),this},t.prototype._checkCollision=function(e){return this.getBoundingInfo()._checkCollision(e)},t.prototype.updateBoundingInfo=function(e){var t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t.update(e),this},t.prototype.isInFrustum=function(e){var t=this.getBoundingInfo();return!!t&&t.isInFrustum(e,this._mesh.cullingStrategy)},t.prototype.isCompletelyInFrustum=function(e){var t=this.getBoundingInfo();return!!t&&t.isCompletelyInFrustum(e)},t.prototype.render=function(e){return this._renderingMesh.render(this,e),this},t.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},t.prototype.canIntersects=function(e){var t=this.getBoundingInfo();return!!t&&e.intersectsBox(t.boundingBox)},t.prototype.intersects=function(e,t,r,n,i){var o=this.getMaterial();if(!o)return null;switch(o.fillMode){case c.Constants.MATERIAL_PointListDrawMode:case c.Constants.MATERIAL_LineListDrawMode:case c.Constants.MATERIAL_LineLoopDrawMode:case c.Constants.MATERIAL_LineStripDrawMode:case c.Constants.MATERIAL_TriangleFanDrawMode:case c.Constants.MATERIAL_TriangleStripDrawMode:return null}return"InstancedLinesMesh"===this._mesh.getClassName()||"LinesMesh"===this._mesh.getClassName()?this._intersectLines(e,t,r,this._mesh.intersectionThreshold,n):this._intersectTriangles(e,t,r,n,i)},t.prototype._intersectLines=function(e,t,r,n,i){for(var o=null,a=this.indexStart;a<this.indexStart+this.indexCount;a+=2){var c=t[r[a]],l=t[r[a+1]],u=e.intersectionSegment(c,l,n);if(!(u<0)&&((i||!o||u<o.distance)&&((o=new s.IntersectionInfo(null,null,u)).faceId=a/2,i)))break}return o},t.prototype._intersectTriangles=function(e,t,r,n,i){for(var o=null,s=this.indexStart;s<this.indexStart+this.indexCount;s+=3){var a=t[r[s]],c=t[r[s+1]],l=t[r[s+2]];if(!i||i(a,c,l,e)){var u=e.intersectsTriangle(a,c,l);if(u){if(u.distance<0)continue;if((n||!o||u.distance<o.distance)&&((o=u).faceId=s/3,n))break}}}return o},t.prototype._rebuild=function(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)},t.prototype.clone=function(e,r){var n=new t(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,e,r,!1);if(!this.IsGlobal){var i=this.getBoundingInfo();if(!i)return n;n._boundingInfo=new a.BoundingInfo(i.minimum,i.maximum)}return n},t.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)},t.prototype.getClassName=function(){return"SubMesh"},t.CreateFromIndices=function(e,r,n,i,o){for(var s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=(o||i).getIndices(),l=r;l<r+n;l++){var u=c[l];u<s&&(s=u),u>a&&(a=u)}return new t(e,s,a-s+1,r,n,i,o)},t}(l)},"./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/mesh */"./Meshes/mesh.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),a=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),c=function(e){function t(t,r,n,i,s,a){void 0===i&&(i=1),void 0===s&&(s=60),void 0===a&&(a=!0);var c=e.call(this,t,n)||this;c._sectionPolygonPointsCount=4,c._running=!1,c._autoStart=a,c._generator=r,c._diameter=i,c._length=s,c._sectionVectors=[],c._sectionNormalVectors=[];for(var l=0;l<c._sectionPolygonPointsCount;l++)c._sectionVectors[l]=o.Vector3.Zero(),c._sectionNormalVectors[l]=o.Vector3.Zero();return c._createMesh(),c}return n.__extends(t,e),t.prototype.getClassName=function(){return"TrailMesh"},t.prototype._createMesh=function(){var e=new a.VertexData,t=[],r=[],n=[],i=o.Vector3.Zero();this._generator._boundingInfo&&(i=this._generator._boundingInfo.boundingBox.centerWorld);for(var s=2*Math.PI/this._sectionPolygonPointsCount,c=0;c<this._sectionPolygonPointsCount;c++)t.push(i.x+Math.cos(c*s)*this._diameter,i.y+Math.sin(c*s)*this._diameter,i.z);for(c=1;c<=this._length;c++){for(var l=0;l<this._sectionPolygonPointsCount;l++)t.push(i.x+Math.cos(l*s)*this._diameter,i.y+Math.sin(l*s)*this._diameter,i.z);var u=t.length/3-2*this._sectionPolygonPointsCount;for(l=0;l<this._sectionPolygonPointsCount-1;l++)n.push(u+l,u+l+this._sectionPolygonPointsCount,u+l+this._sectionPolygonPointsCount+1),n.push(u+l,u+l+this._sectionPolygonPointsCount+1,u+l+1);n.push(u+this._sectionPolygonPointsCount-1,u+this._sectionPolygonPointsCount-1+this._sectionPolygonPointsCount,u+this._sectionPolygonPointsCount),n.push(u+this._sectionPolygonPointsCount-1,u+this._sectionPolygonPointsCount,u)}a.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(s.VertexBuffer.PositionKind),t=this.getVerticesData(s.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,a=2*Math.PI/this._sectionPolygonPointsCount;for(n=0;n<this._sectionPolygonPointsCount;n++)this._sectionVectors[n].copyFromFloats(Math.cos(n*a)*this._diameter,Math.sin(n*a)*this._diameter,0),this._sectionNormalVectors[n].copyFromFloats(Math.cos(n*a),Math.sin(n*a),0),o.Vector3.TransformCoordinatesToRef(this._sectionVectors[n],r,this._sectionVectors[n]),o.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(s.VertexBuffer.PositionKind,e,!0,!1),this.updateVerticesData(s.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}(i.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 a});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 */"./Maths/math.ts"),a=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._scaling=s.Vector3.One(),a._isDirty=!1,a.billboardMode=t.BILLBOARDMODE_NONE,a.scalingDeterminant=1,a.infiniteDistance=!1,a.ignoreNonUniformScaling=!1,a._localMatrix=s.Matrix.Zero(),a._absolutePosition=s.Vector3.Zero(),a._pivotMatrix=s.Matrix.Identity(),a._postMultiplyPivotMatrix=!1,a._tempMatrix=s.Matrix.Identity(),a._tempMatrix2=s.Matrix.Identity(),a._isWorldMatrixFrozen=!1,a._indexInSceneTransformNodesArray=-1,a.onAfterWorldMatrixUpdateObservable=new o.Observable,a._nonUniformScaling=!1,i&&a.getScene().addTransformNode(a),a}return n.__extends(t,e),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:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._rotationQuaternion},set:function(e){this._rotationQuaternion=e,e&&this.rotation.setAll(0)},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"up",{get:function(){return s.Vector3.Normalize(s.Vector3.TransformNormal(this._up,this.getWorldMatrix()))},enumerable:!0,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:!0,configurable:!0}),t.prototype.updatePoseMatrix=function(e){return this._poseMatrix.copyFrom(e),this},t.prototype.getPoseMatrix=function(){return this._poseMatrix},t.prototype._isSynchronized=function(){return!this._isDirty&&(this.billboardMode===this._cache.billboardMode&&this.billboardMode===t.BILLBOARDMODE_NONE&&(!this._cache.pivotMatrixUpdated&&(!this.infiniteDistance&&(!!this._cache.position.equals(this._position)&&(!(this._rotationQuaternion&&!this._cache.rotationQuaternion.equals(this._rotationQuaternion))&&(!!this._cache.rotation.equals(this._rotation)&&!!this._cache.scaling.equals(this._scaling)))))))},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.localMatrixUpdated=!1,this._cache.position=s.Vector3.Zero(),this._cache.scaling=s.Vector3.Zero(),this._cache.rotation=s.Vector3.Zero(),this._cache.rotationQuaternion=new s.Quaternion(0,0,0,0),this._cache.billboardMode=-1,this._cache.infiniteDistance=!1},t.prototype.markAsDirty=function(e){return"rotation"===e&&(this.rotationQuaternion=null),this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this},Object.defineProperty(t.prototype,"absolutePosition",{get:function(){return this._absolutePosition},enumerable:!0,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._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.freezeWorldMatrix=function(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),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:!0,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.Tmp.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},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.Tmp.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=s.Space.LOCAL);var a=t._lookAtVectorCache,c=o===s.Space.LOCAL?this.position:this.getAbsolutePosition();if(e.subtractToRef(c,a),this.setDirection(a,r,n,i),o===s.Space.WORLD&&this.parent)if(this.rotationQuaternion){var l=s.Tmp.Matrix[0];this.rotationQuaternion.toRotationMatrix(l);var u=s.Tmp.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(u),u.invert(),l.multiplyToRef(u,l),this.rotationQuaternion.fromRotationMatrix(l)}else{var h=s.Tmp.Quaternion[0];s.Quaternion.FromEulerVectorToRef(this.rotation,h);l=s.Tmp.Matrix[0];h.toRotationMatrix(l);u=s.Tmp.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(u),u.invert(),l.multiplyToRef(u,l),h.fromRotationMatrix(l),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=s.Space.LOCAL),0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);var r=this.getWorldMatrix();if(t==s.Space.WORLD){var n=s.Tmp.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 e.x=this._pivotMatrix.m[12],e.y=this._pivotMatrix.m[13],e.z=this._pivotMatrix.m[14],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.Tmp.Quaternion[0],r=s.Tmp.Vector3[0],n=s.Tmp.Vector3[1];if(e){var i=s.Tmp.Matrix[0],o=s.Tmp.Matrix[1];this.computeWorldMatrix(!0),e.computeWorldMatrix(!0),e.getWorldMatrix().invertToRef(o),this.getWorldMatrix().multiplyToRef(o,i),i.decompose(n,t,r)}else this.parent&&this.parent.computeWorldMatrix&&this.parent.computeWorldMatrix(!0),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:!0,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.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!==s.Space.LOCAL){if(this.parent){var o=s.Tmp.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.Tmp.Vector3[0],i=s.Tmp.Vector3[1],o=s.Tmp.Vector3[2],a=s.Tmp.Quaternion[0],c=s.Tmp.Matrix[0],l=s.Tmp.Matrix[1],u=s.Tmp.Matrix[2],h=s.Tmp.Matrix[3];return e.subtractToRef(this.position,n),s.Matrix.TranslationToRef(n.x,n.y,n.z,c),s.Matrix.TranslationToRef(-n.x,-n.y,-n.z,l),s.Matrix.RotationAxisToRef(t,r,u),l.multiplyToRef(u,h),h.multiplyToRef(c,h),h.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!==s.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.Tmp.Quaternion[1],s.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,n));var i=s.Tmp.Quaternion[0];return s.Quaternion.RotationYawPitchRollToRef(t,e,r,i),n.multiplyInPlace(i),this.rotationQuaternion||n.toEulerAnglesToRef(this.rotation),this},t.prototype.computeWorldMatrix=function(e){if(this._isWorldMatrixFrozen)return this._worldMatrix;if(!e&&this.isSynchronized())return this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix;(this._updateCache(),this._cache.position.copyFrom(this.position),this._cache.scaling.copyFrom(this.scaling),this._cache.pivotMatrixUpdated=!1,this._cache.billboardMode=this.billboardMode,this._cache.infiniteDistance=this.infiniteDistance,this._currentRenderId=this.getScene().getRenderId(),this._childRenderId=this.getScene().getRenderId(),this._isDirty=!1,s.Matrix.ScalingToRef(this.scaling.x*this.scalingDeterminant,this.scaling.y*this.scalingDeterminant,this.scaling.z*this.scalingDeterminant,s.Tmp.Matrix[1]),this.rotationQuaternion)&&(this.rotation.length()&&(this.rotationQuaternion.multiplyInPlace(s.Quaternion.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)),this.rotation.copyFromFloats(0,0,0)));this.rotationQuaternion?(this.rotationQuaternion.toRotationMatrix(s.Tmp.Matrix[0]),this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)):(s.Matrix.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s.Tmp.Matrix[0]),this._cache.rotation.copyFrom(this.rotation));var r=this.getScene().activeCamera;if(this.infiniteDistance&&!this.parent&&r){var n=r.getWorldMatrix(),i=new s.Vector3(n.m[12],n.m[13],n.m[14]);s.Matrix.TranslationToRef(this.position.x+i.x,this.position.y+i.y,this.position.z+i.z,this._tempMatrix2)}else s.Matrix.TranslationToRef(this.position.x,this.position.y,this.position.z,this._tempMatrix2);if(this._pivotMatrix.multiplyToRef(s.Tmp.Matrix[1],s.Tmp.Matrix[4]),s.Tmp.Matrix[4].multiplyToRef(s.Tmp.Matrix[0],this._tempMatrix),this.billboardMode!==t.BILLBOARDMODE_NONE&&r){if((this.billboardMode&t.BILLBOARDMODE_ALL)!==t.BILLBOARDMODE_ALL){var o=s.Tmp.Vector3[3];this.parent&&this.parent.getWorldMatrix?this._transformToBoneReferal?(this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.Tmp.Matrix[6]),s.Vector3.TransformCoordinatesToRef(this.position,s.Tmp.Matrix[6],o)):s.Vector3.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),o):o.copyFrom(this.position),o.subtractInPlace(r.globalPosition);var a=s.Tmp.Vector3[4].copyFromFloats(0,0,0);(this.billboardMode&t.BILLBOARDMODE_X)===t.BILLBOARDMODE_X&&(a.x=Math.atan2(-o.y,o.z)),(this.billboardMode&t.BILLBOARDMODE_Y)===t.BILLBOARDMODE_Y&&(a.y=Math.atan2(o.x,o.z)),(this.billboardMode&t.BILLBOARDMODE_Z)===t.BILLBOARDMODE_Z&&(a.z=Math.atan2(o.y,o.x)),s.Matrix.RotationYawPitchRollToRef(a.y,a.x,a.z,s.Tmp.Matrix[0])}else s.Tmp.Matrix[1].copyFrom(r.getViewMatrix()),s.Tmp.Matrix[1].setTranslationFromFloats(0,0,0),s.Tmp.Matrix[1].invertToRef(s.Tmp.Matrix[0]);this._scene.useRightHandedSystem&&(s.Matrix.ScalingToRef(1,1,-1,s.Tmp.Matrix[1]),s.Tmp.Matrix[0].multiplyToRef(s.Tmp.Matrix[1],s.Tmp.Matrix[0])),this._tempMatrix.multiplyToRef(s.Tmp.Matrix[0],this._tempMatrix)}if(this._postMultiplyPivotMatrix&&this._tempMatrix.multiplyToRef(this._pivotMatrixInverse,this._tempMatrix),this._tempMatrix.multiplyToRef(this._tempMatrix2,this._localMatrix),this.parent&&this.parent.getWorldMatrix){if(this.billboardMode!==t.BILLBOARDMODE_NONE){this._transformToBoneReferal?this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.Tmp.Matrix[7]):s.Tmp.Matrix[7].copyFrom(this.parent.getWorldMatrix());var c=s.Tmp.Vector3[5],l=s.Tmp.Vector3[6];s.Tmp.Matrix[7].decompose(l,void 0,c),s.Matrix.ScalingToRef(l.x,l.y,l.z,s.Tmp.Matrix[7]),s.Tmp.Matrix[7].setTranslation(c),this._localMatrix.multiplyToRef(s.Tmp.Matrix[7],this._worldMatrix)}else this._transformToBoneReferal?(this._localMatrix.multiplyToRef(this.parent.getWorldMatrix(),s.Tmp.Matrix[6]),s.Tmp.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)):this._localMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this.scaling.isNonUniform?this._updateNonUniformScalingState(!0):this.parent&&this.parent._nonUniformScaling?this._updateNonUniformScalingState(this.parent._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=s.Matrix.Invert(this._worldMatrix)),this._worldMatrixDeterminant=this._worldMatrix.determinant(),this._worldMatrix},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.absolutePosition,e.getViewMatrix())},t.prototype.getDistanceToCamera=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),this.absolutePosition.subtract(e.position).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),c=0;c<a.length;c++){var l=a[c];l.clone&&l.clone(e+"."+l.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.BILLBOARDMODE_NONE=0,t.BILLBOARDMODE_X=1,t.BILLBOARDMODE_Y=2,t.BILLBOARDMODE_Z=4,t.BILLBOARDMODE_ALL=7,t._lookAtVectorCache=new s.Vector3(0,0,0),t._rotationAxisCache=new s.Quaternion,n.__decorate([Object(i.serializeAsVector3)("position")],t.prototype,"_position",void 0),n.__decorate([Object(i.serializeAsVector3)("rotation")],t.prototype,"_rotation",void 0),n.__decorate([Object(i.serializeAsQuaternion)("rotationQuaternion")],t.prototype,"_rotationQuaternion",void 0),n.__decorate([Object(i.serializeAsVector3)("scaling")],t.prototype,"_scaling",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"billboardMode",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"scalingDeterminant",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"infiniteDistance",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"ignoreNonUniformScaling",void 0),t}(r(/*! ../node */"./node.ts").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 c});var n=r(/*! ../../Maths/math */"./Maths/math.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=function(){return function(e,t,r,n){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=r,this.worldAxisForFileY=n}}(),c=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),c=e.readPixels(5),l=e.gammaSpace,u=s.Constants.TEXTUREFORMAT_RGBA,h=s.Constants.TEXTURETYPE_UNSIGNED_INT;e.textureType&&e.textureType!==s.Constants.TEXTURETYPE_UNSIGNED_INT&&(h=s.Constants.TEXTURETYPE_FLOAT);var d={size:n,right:i,left:o,up:t,down:r,front:a,back:c,format:u,type:h,gammaSpace:l};return this.ConvertCubeMapToSphericalPolynomial(d)},e.ConvertCubeMapToSphericalPolynomial=function(e){for(var t=new o.SphericalHarmonics,r=0,a=2/e.size,c=a,l=.5*a-1,u=0;u<6;u++)for(var h=this.FileFaces[u],d=e[h.name],f=l,p=e.format===s.Constants.TEXTUREFORMAT_RGBA?4:3,g=0;g<e.size;g++){for(var m=l,_=0;_<e.size;_++){var v=h.worldAxisForFileX.scale(m).add(h.worldAxisForFileY.scale(f)).add(h.worldAxisForNormal);v.normalize();var A=Math.pow(1+m*m+f*f,-1.5),y=d[g*e.size*p+_*p+0],b=d[g*e.size*p+_*p+1],T=d[g*e.size*p+_*p+2];e.type===s.Constants.TEXTURETYPE_UNSIGNED_INT&&(y/=255,b/=255,T/=255),e.gammaSpace&&(y=Math.pow(i.Scalar.Clamp(y),n.ToLinearSpace),b=Math.pow(i.Scalar.Clamp(b),n.ToLinearSpace),T=Math.pow(i.Scalar.Clamp(T),n.ToLinearSpace));var E=new n.Color3(y,b,T);t.addLight(v,E,A),r+=A,m+=a}f+=c}var x=6*(4*Math.PI)/6/r;return t.scale(x),t.convertIncidentRadianceToIrradiance(),t.convertIrradianceToLambertianRadiance(),o.SphericalPolynomial.FromHarmonics(t)},e.FileFaces=[new a("right",new n.Vector3(1,0,0),new n.Vector3(0,0,-1),new n.Vector3(0,-1,0)),new a("left",new n.Vector3(-1,0,0),new n.Vector3(0,0,1),new n.Vector3(0,-1,0)),new a("up",new n.Vector3(0,1,0),new n.Vector3(1,0,0),new n.Vector3(0,0,1)),new a("down",new n.Vector3(0,-1,0),new n.Vector3(1,0,0),new n.Vector3(0,0,-1)),new a("front",new n.Vector3(0,0,1),new n.Vector3(1,0,0),new n.Vector3(0,-1,0)),new a("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_RLE(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,c=t.width,l=t.dataPosition,u=0,h=0,d=0,f=new ArrayBuffer(4*c),p=new Uint8Array(f),g=new ArrayBuffer(t.width*t.height*4*3),m=new Float32Array(g);a>0;){if(r=e[l++],n=e[l++],i=e[l++],o=e[l++],2!=r||2!=n||128&i)throw"HDR Bad header format, not RLE";if((i<<8|o)!=c)throw"HDR Bad header format, wrong scan line width";for(u=0,d=0;d<4;d++)for(h=(d+1)*c;u<h;)if(r=e[l++],n=e[l++],r>128){if(0==(s=r-128)||s>h-u)throw"HDR Bad Format, bad scanline data (run)";for(;s-- >0;)p[u++]=n}else{if(0==(s=r)||s>h-u)throw"HDR Bad Format, bad scanline data (non-run)";if(p[u++]=n,--s>0)for(var _=0;_<s;_++)p[u++]=e[l++]}for(d=0;d<c;d++)r=p[d],n=p[d+c],i=p[d+2*c],o=p[d+3*c],this.Rgbe2float(m,r,n,i,o,(t.height-a)*c*3+3*d);a--}return m},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 */"./Maths/math.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),c=t[3].subtract(t[2]).scale(1/e),l=1/e,u=0,h=0;h<e;h++){for(var d=t[0],f=t[2],p=0;p<e;p++){var g=f.subtract(d).scale(u).add(d);g.normalize();var m=this.CalcProjectionSpherical(g,r,n,i);s[h*e*3+3*p+0]=m.r,s[h*e*3+3*p+1]=m.g,s[h*e*3+3*p+2]=m.b,d=d.add(a),f=f.add(c)}u+=l}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 c=Math.round(s*r);c<0?c=0:c>=r&&(c=r-1);var l=Math.round(a*n);l<0?l=0:l>=n&&(l=n-1);var u=n-l-1;return{r:t[u*r*3+3*c+0],g:t[u*r*3+3*c+1],b:t[u*r*3+3*c+2]}},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_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_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_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 c=0;c<a.length;++c){var l=e._SimplifyNegation(a[c].trim());if(!(n="true"!==l&&"false"!==l?"!"===l[0]?!r(l.substring(1)):r(l):"true"===l)){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, AssetsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"AssetTaskState",function(){return n}),r.d(t,"AbstractAssetTask",function(){return d}),r.d(t,"AssetsProgressEvent",function(){return f}),r.d(t,"MeshAssetTask",function(){return p}),r.d(t,"TextFileAssetTask",function(){return g}),r.d(t,"BinaryFileAssetTask",function(){return m}),r.d(t,"ImageAssetTask",function(){return _}),r.d(t,"TextureAssetTask",function(){return v}),r.d(t,"CubeTextureAssetTask",function(){return A}),r.d(t,"HDRCubeTextureAssetTask",function(){return y}),r.d(t,"AssetsManager",function(){return b});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"),c=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),u=r(/*! ../Materials/Textures/hdrCubeTexture */"./Materials/Textures/hdrCubeTexture.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 d=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:!0,configurable:!0}),Object.defineProperty(e.prototype,"taskState",{get:function(){return this._taskState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorObject",{get:function(){return this._errorObject},enumerable:!0,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}(),f=function(){return function(e,t,r){this.remainingCount=e,this.totalCount=t,this.task=r}}(),p=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 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}(d),g=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name=t,n.url=r,n}return 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}(d),m=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name=t,n.url=r,n}return 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}(d),_=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name=t,n.url=r,n}return 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}(d),v=function(e){function t(t,r,n,i,o){void 0===o&&(o=c.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 i.__extends(t,e),t.prototype.runTask=function(e,t,r){this.texture=new c.Texture(this.url,e,this.noMipmap,this.invertY,this.samplingMode,function(){t()},function(e,t){r(e,t)})},t}(d),A=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 i.__extends(t,e),t.prototype.runTask=function(e,t,r){this.texture=new l.CubeTexture(this.url,e,this.extensions,this.noMipmap,this.files,function(){t()},function(e,t){r(e,t)})},t}(d),y=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 c=e.call(this,t)||this;return c.name=t,c.url=r,c.size=n,c.noMipmap=i,c.generateHarmonics=o,c.gammaSpace=s,c.reserved=a,c}return i.__extends(t,e),t.prototype.run=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}(d),b=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._scene=e}return e.prototype.addMeshTask=function(e,t,r,n){var i=new p(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 m(e,t);return this._tasks.push(r),r},e.prototype.addImageTask=function(e,t){var r=new _(e,t);return this._tasks.push(r),r},e.prototype.addTextureTask=function(e,t,r,n,i){void 0===i&&(i=c.Texture.TRILINEAR_SAMPLINGMODE);var o=new v(e,t,r,n,i);return this._tasks.push(o),o},e.prototype.addCubeTextureTask=function(e,t,r,n,i){var o=new A(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 y(e,t,r,n,i,o,s);return this._tasks.push(a),a},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 f(this._waitingTasksCount,this._totalTasksCount,e))}catch(e){h.Logger.Error("Error running progress callbacks."),console.log(e)}if(0===this._waitingTasksCount){try{this.onFinish&&this.onFinish(this._tasks);for(var t=this._tasks.slice(),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._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.onTasksDoneObservable.addOnce(function(e){e&&e.length?r(e):t()})})},e}()},"./Misc/brdfTextureTools.ts":
- /*!**********************************!*\
- !*** ./Misc/brdfTextureTools.ts ***!
- \**********************************/
- /*! exports provided: BRDFTextureTools */function(e,t,r){"use strict";r.r(t),r.d(t,"BRDFTextureTools",function(){return s});var n=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),s=function(){function e(){}return e._ExpandDefaultBRDFTexture=function(e){var t=e.getEngine(),r=t.getCaps(),n=!1;if(r.textureHalfFloatRender&&r.textureHalfFloatLinearFiltering?(n=!0,e.type=i.Constants.TEXTURETYPE_HALF_FLOAT):r.textureFloatRender&&r.textureFloatLinearFiltering&&(n=!0,e.type=i.Constants.TEXTURETYPE_FLOAT),n){e.isReady=!1;var s=new o.PostProcess("rgbdDecode","rgbdDecode",null,null,1,null,i.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,t,!1,void 0,e.type,void 0,null,!1);e._isRGBD=!1,e.invertY=!1;var a=t.createRenderTargetTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:i.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,type:e.type,format:i.Constants.TEXTUREFORMAT_RGBA});s.getEffect().executeWhenCompiled(function(){s.onApply=function(t){t._bindTexture("textureSampler",e),t.setFloat2("scale",1,1)},t.scenes[0].postProcessManager.directRender([s],a,!0),t.restoreDefaultFramebuffer(),t._releaseTexture(e),t._releaseFramebufferObjects(a),s&&s.dispose(),a._swapAndDie(e),e.isReady=!0})}},e.GetEnvironmentBRDFTexture=function(e){var t=this;if(!e.environmentBRDFTexture){var r=n.Texture.CreateFromBase64String(this._environmentBRDFBase64Texture,"EnvironmentBRDFTexture",e,!0,!0,n.Texture.BILINEAR_SAMPLINGMODE);r._texture._isRGBD=!0,r.wrapU=n.Texture.CLAMP_ADDRESSMODE,r.wrapV=n.Texture.CLAMP_ADDRESSMODE,e.environmentBRDFTexture=r,r.onLoadObservable.addOnce(function(){t._ExpandDefaultBRDFTexture(r._texture)})}return e.environmentBRDFTexture},e._environmentBRDFBase64Texture="data:image/png;base64,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",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 m});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(/*! ../Engines/engine */"./Engines/engine.ts"),a=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),c=r(/*! ../Misc/logger */"./Misc/logger.ts"),l=r(/*! ../Misc/HighDynamicRange/cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts"),u=r(/*! ../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts");function h(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var d=h("DXT1"),f=h("DXT3"),p=h("DXT5"),g=h("DX10"),m=function(){function e(){}return e.GetDDSInfo=function(e){var t=new Int32Array(e,0,31),r=new Int32Array(e,0,35),n=1;131072&t[2]&&(n=Math.max(1,t[7]));var i=t[21],s=i===g?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 g:if(10===s){a=o.Constants.TEXTURETYPE_HALF_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===d||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),c=new Uint16Array(o,n),l=0,u=0;u<r;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);a[l]=e._FromHalfFloat(c[d]),a[l+1]=e._FromHalfFloat(c[d+1]),a[l+2]=e._FromHalfFloat(c[d+2]),e.StoreLODInAlphaChannel?a[l+3]=s:a[l+3]=e._FromHalfFloat(c[d+3]),l+=4}return a},e._GetHalfFloatRGBAArrayBuffer=function(t,r,n,i,o,s){if(e.StoreLODInAlphaChannel){for(var a=new Uint16Array(i),c=new Uint16Array(o,n),l=0,u=0;u<r;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);a[l]=c[d],a[l+1]=c[d+1],a[l+2]=c[d+2],a[l+3]=e._ToHalfFloat(s),l+=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),c=new Float32Array(o,n),l=0,u=0;u<r;u++)for(var h=0;h<t;h++){var d=4*(h+u*t);a[l]=c[d],a[l+1]=c[d+1],a[l+2]=c[d+2],a[l+3]=s,l+=4}return a}return new Float32Array(o,n,i)},e._GetFloatAsUIntRGBAArrayBuffer=function(t,r,i,o,s,a){for(var c=new Uint8Array(o),l=new Float32Array(s,i),u=0,h=0;h<r;h++)for(var d=0;d<t;d++){var f=4*(d+h*t);c[u]=255*n.Scalar.Clamp(l[f]),c[u+1]=255*n.Scalar.Clamp(l[f+1]),c[u+2]=255*n.Scalar.Clamp(l[f+2]),e.StoreLODInAlphaChannel?c[u+3]=a:c[u+3]=255*n.Scalar.Clamp(l[f+3]),u+=4}return c},e._GetHalfFloatAsUIntRGBAArrayBuffer=function(t,r,i,o,s,a){for(var c=new Uint8Array(o),l=new Uint16Array(s,i),u=0,h=0;h<r;h++)for(var d=0;d<t;d++){var f=4*(d+h*t);c[u]=255*n.Scalar.Clamp(e._FromHalfFloat(l[f])),c[u+1]=255*n.Scalar.Clamp(e._FromHalfFloat(l[f+1])),c[u+2]=255*n.Scalar.Clamp(e._FromHalfFloat(l[f+2])),e.StoreLODInAlphaChannel?c[u+3]=a:c[u+3]=255*n.Scalar.Clamp(e._FromHalfFloat(l[f+3])),u+=4}return c},e._GetRGBAArrayBuffer=function(e,t,r,n,i,o,s,a,c){for(var l=new Uint8Array(n),u=new Uint8Array(i,r),h=0,d=0;d<t;d++)for(var f=0;f<e;f++){var p=4*(f+d*e);l[h]=u[p+o],l[h+1]=u[p+s],l[h+2]=u[p+a],l[h+3]=u[p+c],h+=4}return l},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 c=new Uint8Array(n),l=new Uint8Array(i,r),u=0,h=0;h<t;h++)for(var d=0;d<e;d++){var f=3*(d+h*e);c[u]=l[f+o],c[u+1]=l[f+s],c[u+2]=l[f+a],u+=3}return c},e._GetLuminanceArrayBuffer=function(e,t,r,n,i){for(var o=new Uint8Array(n),s=new Uint8Array(i,r),a=0,c=0;c<t;c++)for(var l=0;l<e;l++){var u=l+c*e;o[a]=s[u],a++}return o},e.UploadDDSLevels=function(t,r,n,i,s,a,u,h){void 0===u&&(u=-1);var m=null;i.sphericalPolynomial&&(m=new Array);var _,v,A,y,b,T,E,x=t.getCaps().s3tc,C=new Int32Array(n,0,31),P=0,M=0,S=1;if(542327876===C[0])if(i.isFourCC||i.isRGB||i.isLuminance)if(!i.isCompressed||x){var R=C[22];y=C[1]+4;var O,I=!1;if(i.isFourCC)switch(_=C[21]){case d:S=8,M=x.COMPRESSED_RGBA_S3TC_DXT1_EXT;break;case f:S=16,M=x.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case p:S=16,M=x.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;case 113:case 116:I=!0;break;case g:y+=20;var D=!1;switch(i.dxgiFormat){case 10: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 w=e._ExtractLongWordOrder(C[23]),L=e._ExtractLongWordOrder(C[24]),B=e._ExtractLongWordOrder(C[25]),F=e._ExtractLongWordOrder(C[26]);I&&(M=t._getRGBABufferInternalSizedFormat(i.textureType)),T=1,131072&C[2]&&!1!==s&&(T=Math.max(1,C[7]));for(var N=0;N<a;N++){for(v=C[4],A=C[3],E=0;E<T;++E){if(-1===u||u===E){var V=-1===u?E:0;if(!i.isCompressed&&i.isFourCC){r.format=o.Constants.TEXTUREFORMAT_RGBA,P=v*A*4;var U=null;t._badOS||t._badDesktopOS||!t.getCaps().textureHalfFloat&&!t.getCaps().textureFloat?(128===R?(U=e._GetFloatAsUIntRGBAArrayBuffer(v,A,y,P,n,V),m&&0==V&&m.push(e._GetFloatRGBAArrayBuffer(v,A,y,P,n,V))):64===R&&(U=e._GetHalfFloatAsUIntRGBAArrayBuffer(v,A,y,P,n,V),m&&0==V&&m.push(e._GetHalfFloatAsFloatRGBAArrayBuffer(v,A,y,P,n,V))),r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT):128===R?(r.type=o.Constants.TEXTURETYPE_FLOAT,U=e._GetFloatRGBAArrayBuffer(v,A,y,P,n,V),m&&0==V&&m.push(U)):64!==R||t.getCaps().textureHalfFloat?(r.type=o.Constants.TEXTURETYPE_HALF_FLOAT,U=e._GetHalfFloatRGBAArrayBuffer(v,A,y,P,n,V),m&&0==V&&m.push(e._GetHalfFloatAsFloatRGBAArrayBuffer(v,A,y,P,n,V))):(r.type=o.Constants.TEXTURETYPE_FLOAT,U=e._GetHalfFloatAsFloatRGBAArrayBuffer(v,A,y,P,n,V),m&&0==V&&m.push(U)),U&&t._uploadDataToTextureDirectly(r,U,N,V)}else if(i.isRGB)r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT,24===R?(r.format=o.Constants.TEXTUREFORMAT_RGB,P=v*A*3,b=e._GetRGBArrayBuffer(v,A,y,P,n,w,L,B),t._uploadDataToTextureDirectly(r,b,N,V)):(r.format=o.Constants.TEXTUREFORMAT_RGBA,P=v*A*4,b=e._GetRGBAArrayBuffer(v,A,y,P,n,w,L,B,F),t._uploadDataToTextureDirectly(r,b,N,V));else if(i.isLuminance){var G=t._getUnpackAlignement(),k=v;P=Math.floor((v+G-1)/G)*G*(A-1)+k,b=e._GetLuminanceArrayBuffer(v,A,y,P,n),r.format=o.Constants.TEXTUREFORMAT_LUMINANCE,r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT,t._uploadDataToTextureDirectly(r,b,N,V)}else P=Math.max(4,v)/4*Math.max(4,A)/4*S,b=new Uint8Array(n,y,P),r.type=o.Constants.TEXTURETYPE_UNSIGNED_INT,t._uploadCompressedDataToTextureDirectly(r,M,v,A,b,N,V)}y+=R?v*A*(R/8):P,v*=.5,A*=.5,v=Math.max(1,v),A=Math.max(1,A)}if(void 0!==h)break}m&&m.length>0?i.sphericalPolynomial=l.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial({size:C[4],right:m[0],left:m[1],up:m[2],down:m[3],front:m[4],back:m[5],format:o.Constants.TEXTUREFORMAT_RGBA,type:o.Constants.TEXTURETYPE_FLOAT,gammaSpace:!1}):i.sphericalPolynomial=void 0}else c.Logger.Error("Compressed textures are not supported on this platform.");else c.Logger.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");else c.Logger.Error("Invalid magic number in DDS header")},e.StoreLODInAlphaChannel=!1,e}();s.Engine.prototype.createPrefilteredCubeTexture=function(e,t,r,o,s,l,h,d,f){var p=this;void 0===s&&(s=null),void 0===l&&(l=null),void 0===d&&(d=null),void 0===f&&(f=!0);return this.createCubeTexture(e,t,null,!1,function(e){if(e){var l=e.texture;if(f?e.info.sphericalPolynomial&&(l._sphericalPolynomial=e.info.sphericalPolynomial):l._sphericalPolynomial=new i.SphericalPolynomial,l._dataSource=a.InternalTexture.DATASOURCE_CUBEPREFILTERED,p.getCaps().textureLOD)s&&s(l);else{var h=p._gl,d=e.width;if(d){for(var g=[],_=0;_<3;_++){var v=1-_/2,A=o,y=n.Scalar.Log2(d)*r+o,b=A+(y-A)*v,T=Math.round(Math.min(Math.max(b,0),y)),E=new a.InternalTexture(p,a.InternalTexture.DATASOURCE_TEMP);if(E.type=l.type,E.format=l.format,E.width=Math.pow(2,Math.max(n.Scalar.Log2(d)-T,0)),E.height=E.width,E.isCube=!0,p._bindTextureDirectly(h.TEXTURE_CUBE_MAP,E,!0),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_MAG_FILTER,h.LINEAR),h.texParameteri(h.TEXTURE_CUBE_MAP,h.TEXTURE_MIN_FILTER,h.LINEAR),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),e.isDDS){var x=e.info,C=e.data;p._unpackFlipY(x.isCompressed),m.UploadDDSLevels(p,E,C,x,!0,6,T)}else c.Logger.Warn("DDS is the only prefiltered cube map supported so far.");p._bindTextureDirectly(h.TEXTURE_CUBE_MAP,null);var P=new u.BaseTexture(t);P.isCube=!0,P._texture=E,E.isReady=!0,g.push(P)}l._lodTextureHigh=g[2],l._lodTextureMid=g[1],l._lodTextureLow=g[0],s&&s(l)}}}else s&&s(null)},l,h,d,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 d}),r.d(t,"serializeAsTexture",function(){return f}),r.d(t,"serializeAsColor3",function(){return p}),r.d(t,"serializeAsFresnelParameters",function(){return g}),r.d(t,"serializeAsVector2",function(){return m}),r.d(t,"serializeAsVector3",function(){return _}),r.d(t,"serializeAsMeshReference",function(){return v}),r.d(t,"serializeAsColorCurves",function(){return A}),r.d(t,"serializeAsColor4",function(){return y}),r.d(t,"serializeAsImageProcessingConfiguration",function(){return b}),r.d(t,"serializeAsQuaternion",function(){return T}),r.d(t,"serializeAsMatrix",function(){return E}),r.d(t,"serializeAsCameraReference",function(){return x}),r.d(t,"SerializationHelper",function(){return C});var n=r(/*! ../Misc/tags */"./Misc/tags.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ./devTools */"./Misc/devTools.ts"),s={},a={},c=function(e,t,r){var i=e();n.Tags&&n.Tags.AddTagsTo(i,t.tags);var o=l(i);for(var s in o){var a=o[s],c=t[s],u=a.type;if(null!=c&&"uniqueId"!==s)switch(u){case 0:case 6:case 11:i[s]=c;break;case 1:i[s]=r||c.isRenderTarget?c:c.clone();break;case 2:case 3:case 4:case 5:case 7:case 10:case 12:i[s]=r?c:c.clone()}}return i};function l(e){var t=e.getClassName();if(a[t])return a[t];a[t]={};for(var r=a[t],n=e,i=t;i;){var o=s[i];for(var c in o)r[c]=o[c];var l=void 0,u=!1;do{if(!(l=Object.getPrototypeOf(n)).getClassName){u=!0;break}if(l.getClassName()!==i)break;n=l}while(l);if(u)break;i=l.getClassName(),n=l}return r}function u(e,t){return function(r,n){var i=function(e){var t=e.getClassName();return s[t]||(s[t]={}),s[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 d(e){return u(0,e)}function f(e){return u(1,e)}function p(e){return u(2,e)}function g(e){return u(3,e)}function m(e){return u(4,e)}function _(e){return u(5,e)}function v(e){return u(6,e)}function A(e){return u(7,e)}function y(e){return u(8,e)}function b(e){return u(9,e)}function T(e){return u(10,e)}function E(e){return u(12,e)}function x(e){return u(11,e)}var C=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=l(e);for(var i in r){var o=r[i],s=o.sourceName||i,a=o.type,c=e[i];if(null!=c)switch(a){case 0:t[s]=c;break;case 1:t[s]=c.serialize();break;case 2:t[s]=c.asArray();break;case 3:t[s]=c.serialize();break;case 4:case 5:t[s]=c.asArray();break;case 6:t[s]=c.id;break;case 7:t[s]=c.serialize();break;case 8:t[s]=c.asArray();break;case 9:t[s]=c.serialize();break;case 10:t[s]=c.asArray();break;case 11:t[s]=c.id;case 12:t[s]=c.asArray()}}return t},e.Parse=function(t,r,o,s){void 0===s&&(s=null);var a=t();s||(s=""),n.Tags&&n.Tags.AddTagsTo(a,r.tags);var c=l(a);for(var u in c){var h=c[u],d=r[h.sourceName||u],f=h.type;if(null!=d){var p=a;switch(f){case 0:p[u]=d;break;case 1:o&&(p[u]=e._TextureParser(d,o,s));break;case 2:p[u]=i.Color3.FromArray(d);break;case 3:p[u]=e._FresnelParametersParser(d);break;case 4:p[u]=i.Vector2.FromArray(d);break;case 5:p[u]=i.Vector3.FromArray(d);break;case 6:o&&(p[u]=o.getLastMeshByID(d));break;case 7:p[u]=e._ColorCurvesParser(d);break;case 8:p[u]=i.Color4.FromArray(d);break;case 9:p[u]=e._ImageProcessingConfigurationParser(d);break;case 10:p[u]=i.Quaternion.FromArray(d);break;case 11:o&&(p[u]=o.getCameraByID(d));case 12:p[u]=i.Matrix.FromArray(d)}}}return a},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 i});var n=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},i=function(){function e(){}return e.DeepCopy=function(e,t,r,i){for(var o in e)if(("_"!==o[0]||i&&-1!==i.indexOf(o))&&(!r||-1===r.indexOf(o))){var s=e[o],a=typeof s;if("function"!==a)try{if("object"===a)if(s instanceof Array){if(t[o]=[],s.length>0)if("object"==typeof s[0])for(var c=0;c<s.length;c++){var l=n(s[c],t);-1===t[o].indexOf(l)&&t[o].push(l)}else t[o]=s.slice(0)}else t[o]=n(s,t);else t[o]=s}catch(e){}}},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:!0,configurable:!0}),Object.defineProperty(e.prototype,"reject",{get:function(){return this._reject},enumerable:!0,configurable:!0}),e}()},"./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.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 */"./Maths/math.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"),c=r(/*! ../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),l=r(/*! ../Engines/constants */"./Engines/constants.ts"),u=r(/*! ../scene */"./scene.ts"),h=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),d=r(/*! ../Misc/logger */"./Misc/logger.ts"),f=(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),n=0,i=0;i<e._MagicBytes.length;i++)if(r.getUint8(n++)!==e._MagicBytes[i])return d.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.");if(!t._prefiltered)return Promise.reject("The cube texture is invalid (not prefiltered).");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===l.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 c=l.Constants.TEXTURETYPE_FLOAT;if(!s.getCaps().textureFloatRender&&(c=l.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 d=i.width,f=new u.Scene(s),p={},g=[],m=o.Scalar.Log2(i.width);m=Math.round(m);for(var _=function(e){for(var r=Math.pow(2,m-e),i=function(i){var o=t.readPixels(i,e),u=s.createRawTexture(o,r,r,l.Constants.TEXTUREFORMAT_RGBA,!1,!1,l.Constants.TEXTURE_NEAREST_SAMPLINGMODE,null,c),d=new Promise(function(t,o){var c=new h.PostProcess("rgbdEncode","rgbdEncode",null,null,1,null,l.Constants.TEXTURE_NEAREST_SAMPLINGMODE,s,!1,void 0,l.Constants.TEXTURETYPE_UNSIGNED_INT,void 0,null,!1);c.getEffect().executeWhenCompiled(function(){c.onApply=function(e){e._bindTexture("textureSampler",u)};var o=s.getRenderWidth(),l=s.getRenderHeight();s.setSize(r,r),f.postProcessManager.directRender([c],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,l)})});g.push(d)},o=0;o<6;o++)i(o)},v=0;v<=m;v++)_(v);return Promise.all(g).then(function(){f.dispose();for(var n={version:1,width:d,irradiance:r._CreateEnvTextureIrradiance(t),specular:{mipmaps:[],lodGenerationScale:t.lodGenerationScale}},i=0,o=0;o<=m;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 c=JSON.stringify(n),l=new ArrayBuffer(c.length+1),u=new Uint8Array(l),h=(o=0,c.length);o<h;o++)u[o]=c.charCodeAt(o);u[c.length]=0;var g=e._MagicBytes.length+i+l.byteLength,_=new ArrayBuffer(g),v=new Uint8Array(_),A=new DataView(_),y=0;for(o=0;o<e._MagicBytes.length;o++)A.setUint8(y++,e._MagicBytes[o]);v.set(new Uint8Array(l),y),y+=l.byteLength;for(o=0;o<=m;o++)for(s=0;s<6;s++){var b=p[6*o+s];v.set(new Uint8Array(b),y),y+=b.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.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();var s=o.Scalar.Log2(n.width);if(s=Math.round(s)+1,i.mipmaps.length!==6*s)throw new Error('Unsupported specular mipmaps number "'+i.mipmaps.length+'"');t._lodGenerationScale=i.lodGenerationScale;for(var a=new Array(s),c=0;c<s;c++){a[c]=new Array(6);for(var l=0;l<6;l++){var u=i.mipmaps[6*c+l];a[c][l]=new Uint8Array(r,i.specularDataPosition+u.position,u.length)}}return e.UploadLevelsAsync(t,a)},e.UploadLevelsAsync=function(e,t){if(!n.Tools.IsExponentOfTwo(e.width))throw new Error("Texture size must be a power of two");var r=Math.round(o.Scalar.Log2(e.width))+1,i=e.getEngine(),s=!1,u=!1,d=null,f=null,p=null,g=i.getCaps();if(e.format=l.Constants.TEXTUREFORMAT_RGBA,e.type=l.Constants.TEXTURETYPE_UNSIGNED_INT,e.generateMipMaps=!0,i.updateTextureSamplingMode(l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,e),g.textureLOD?i.webGLVersion<2?s=!1:g.textureHalfFloatRender&&g.textureHalfFloatLinearFiltering?(s=!0,e.type=l.Constants.TEXTURETYPE_HALF_FLOAT):g.textureFloatRender&&g.textureFloatLinearFiltering&&(s=!0,e.type=l.Constants.TEXTURETYPE_FLOAT):(s=!1,u=!0,p={}),s)d=new h.PostProcess("rgbdDecode","rgbdDecode",null,null,1,null,l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,i,!1,void 0,e.type,void 0,null,!1),e._isRGBD=!1,e.invertY=!1,f=i.createRenderTargetCubeTexture(e.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,type:e.type,format:l.Constants.TEXTUREFORMAT_RGBA});else if(e._isRGBD=!0,e.invertY=!0,u)for(var m=e._lodGenerationScale,_=e._lodGenerationOffset,v=0;v<3;v++){var A=(r-1)*m+_,y=_+(A-_)*(1-v/2),b=Math.round(Math.min(Math.max(y,0),A)),T=new a.InternalTexture(i,a.InternalTexture.DATASOURCE_TEMP);T.isCube=!0,T.invertY=!0,T.generateMipMaps=!1,i.updateTextureSamplingMode(l.Constants.TEXTURE_LINEAR_LINEAR,T);var E=new c.BaseTexture(null);switch(E.isCube=!0,E._texture=T,p[b]=E,v){case 0:e._lodTextureLow=E;break;case 1:e._lodTextureMid=E;break;case 2:e._lodTextureHigh=E}}var x=[],C=function(r){for(var n=function(n){var o=t[r][n],a=new Blob([o],{type:"image/png"}),c=URL.createObjectURL(a),h=new Image;h.src=c;var g=new Promise(function(t,o){h.onload=function(){if(s){var a=i.createTexture(null,!0,!0,null,l.Constants.TEXTURE_NEAREST_SAMPLINGMODE,null,function(e){o(e)},h);d.getEffect().executeWhenCompiled(function(){d.onApply=function(e){e._bindTexture("textureSampler",a),e.setFloat2("scale",1,1)},i.scenes[0].postProcessManager.directRender([d],f,!0,n,r),i.restoreDefaultFramebuffer(),a.dispose(),window.URL.revokeObjectURL(c),t()})}else{if(i._uploadImageToTexture(e,h,n,r),u){var g=p[r];g&&i._uploadImageToTexture(g._texture,h,n,0)}t()}},h.onerror=function(e){o(e)}});x.push(g)},o=0;o<6;o++)n(o)};for(v=0;v<t.length;v++)C(v);if(t.length<r){var P=void 0,M=Math.pow(2,r-1-t.length),S=M*M*4;switch(e.type){case l.Constants.TEXTURETYPE_UNSIGNED_INT:P=new Uint8Array(S);break;case l.Constants.TEXTURETYPE_HALF_FLOAT:P=new Uint16Array(S);break;case l.Constants.TEXTURETYPE_FLOAT:P=new Float32Array(S)}for(v=t.length;v<r;v++)for(var R=0;R<6;R++)i._uploadArrayBufferViewToTexture(e,P,R,v)}return Promise.all(x).then(function(){f&&(i._releaseFramebufferObjects(f),f._swapAndDie(e)),d&&d.dispose(),u&&(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&&d.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._dataSource=a.InternalTexture.DATASOURCE_CUBERAW_RGBD,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/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,c){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=c}return Object.defineProperty(e,"FilesToLoad",{get:function(){return o.FilesInputStore.FilesToLoad},enumerable:!0,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))},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 c=a[o];c.isFile?c.file(function(e){e.correctName=s+e.name,t.push(e),0==--r.count&&n()}):c.isDirectory&&i._traverseFolder(c,t,r,n)}--r.count&&n()})},e.prototype._processFiles=function(t){for(var r=0;r<t.length;r++){var n=t[r].correctName.toLowerCase(),i=n.split(".").pop();this.onProcessFileCallback(t[r],n,i)&&("babylon"!==i&&"stl"!==i&&"obj"!==i&&"gltf"!==i&&"glb"!==i||-1!==n.indexOf(".binary.babylon")||-1!==n.indexOf(".incremental.babylon")||(this._sceneFileToLoad=t[r]),e.FilesToLoad[n]=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(),c=void 0;if(s.correctName=a,i){var l=i[o];l.getAsEntry?c=l.getAsEntry():l.webkitGetAsEntry&&(c=l.webkitGetAsEntry())}c&&c.isDirectory?n.push(c):r.push(s)}if(0===n.length)this._processFiles(r),this._processReload();else for(var u={count:n.length},h=0,d=n;h<d.length;h++){var f=d[h];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.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.runRenderLoop(function(){e.renderFunction()})})}).catch(function(t){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/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"}(n||(n={}))},"./Misc/index.ts":
- /*!***********************!*\
- !*** ./Misc/index.ts ***!
- \***********************/
- /*! exports provided: AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, AssetsManager, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsMatrix, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, MeshExploder, FilesInput, CubeMapToSphericalPolynomialTools, 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, ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, WebRequest, InspectableType, HDRTools, PanoramaToCubeMapTools */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,"AssetsManager",function(){return i.AssetsManager});var o=r(/*! ./dds */"./Misc/dds.ts");r.d(t,"DDSTools",function(){return o.DDSTools});var s=r(/*! ./decorators */"./Misc/decorators.ts");r.d(t,"expandToProperty",function(){return s.expandToProperty}),r.d(t,"serialize",function(){return s.serialize}),r.d(t,"serializeAsTexture",function(){return s.serializeAsTexture}),r.d(t,"serializeAsColor3",function(){return s.serializeAsColor3}),r.d(t,"serializeAsFresnelParameters",function(){return s.serializeAsFresnelParameters}),r.d(t,"serializeAsVector2",function(){return s.serializeAsVector2}),r.d(t,"serializeAsVector3",function(){return s.serializeAsVector3}),r.d(t,"serializeAsMeshReference",function(){return s.serializeAsMeshReference}),r.d(t,"serializeAsColorCurves",function(){return s.serializeAsColorCurves}),r.d(t,"serializeAsColor4",function(){return s.serializeAsColor4}),r.d(t,"serializeAsImageProcessingConfiguration",function(){return s.serializeAsImageProcessingConfiguration}),r.d(t,"serializeAsQuaternion",function(){return s.serializeAsQuaternion}),r.d(t,"serializeAsMatrix",function(){return s.serializeAsMatrix}),r.d(t,"serializeAsCameraReference",function(){return s.serializeAsCameraReference}),r.d(t,"SerializationHelper",function(){return s.SerializationHelper});var a=r(/*! ./deferred */"./Misc/deferred.ts");r.d(t,"Deferred",function(){return a.Deferred});var c=r(/*! ./environmentTextureTools */"./Misc/environmentTextureTools.ts");r.d(t,"EnvironmentTextureTools",function(){return c.EnvironmentTextureTools});var l=r(/*! ./meshExploder */"./Misc/meshExploder.ts");r.d(t,"MeshExploder",function(){return l.MeshExploder});var u=r(/*! ./filesInput */"./Misc/filesInput.ts");r.d(t,"FilesInput",function(){return u.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 d=r(/*! ./khronosTextureContainer */"./Misc/khronosTextureContainer.ts");r.d(t,"KhronosTextureContainer",function(){return d.KhronosTextureContainer});var f=r(/*! ./observable */"./Misc/observable.ts");r.d(t,"EventState",function(){return f.EventState}),r.d(t,"Observer",function(){return f.Observer}),r.d(t,"MultiObserver",function(){return f.MultiObserver}),r.d(t,"Observable",function(){return f.Observable});var p=r(/*! ./performanceMonitor */"./Misc/performanceMonitor.ts");r.d(t,"PerformanceMonitor",function(){return p.PerformanceMonitor}),r.d(t,"RollingAverage",function(){return p.RollingAverage});var g=r(/*! ./promise */"./Misc/promise.ts");r.d(t,"PromisePolyfill",function(){return g.PromisePolyfill});var m=r(/*! ./sceneOptimizer */"./Misc/sceneOptimizer.ts");r.d(t,"SceneOptimization",function(){return m.SceneOptimization}),r.d(t,"TextureOptimization",function(){return m.TextureOptimization}),r.d(t,"HardwareScalingOptimization",function(){return m.HardwareScalingOptimization}),r.d(t,"ShadowsOptimization",function(){return m.ShadowsOptimization}),r.d(t,"PostProcessesOptimization",function(){return m.PostProcessesOptimization}),r.d(t,"LensFlaresOptimization",function(){return m.LensFlaresOptimization}),r.d(t,"CustomOptimization",function(){return m.CustomOptimization}),r.d(t,"ParticlesOptimization",function(){return m.ParticlesOptimization}),r.d(t,"RenderTargetsOptimization",function(){return m.RenderTargetsOptimization}),r.d(t,"MergeMeshesOptimization",function(){return m.MergeMeshesOptimization}),r.d(t,"SceneOptimizerOptions",function(){return m.SceneOptimizerOptions}),r.d(t,"SceneOptimizer",function(){return m.SceneOptimizer});var _=r(/*! ./sceneSerializer */"./Misc/sceneSerializer.ts");r.d(t,"SceneSerializer",function(){return _.SceneSerializer});var v=r(/*! ./smartArray */"./Misc/smartArray.ts");r.d(t,"SmartArray",function(){return v.SmartArray}),r.d(t,"SmartArrayNoDuplicate",function(){return v.SmartArrayNoDuplicate});var A=r(/*! ./stringDictionary */"./Misc/stringDictionary.ts");r.d(t,"StringDictionary",function(){return A.StringDictionary});var y=r(/*! ./tags */"./Misc/tags.ts");r.d(t,"Tags",function(){return y.Tags});var b=r(/*! ./textureTools */"./Misc/textureTools.ts");r.d(t,"TextureTools",function(){return b.TextureTools});var T=r(/*! ./tga */"./Misc/tga.ts");r.d(t,"TGATools",function(){return T.TGATools});var E=r(/*! ./tools */"./Misc/tools.ts");r.d(t,"ColorGradient",function(){return E.ColorGradient}),r.d(t,"Color3Gradient",function(){return E.Color3Gradient}),r.d(t,"FactorGradient",function(){return E.FactorGradient}),r.d(t,"LoadFileError",function(){return E.LoadFileError}),r.d(t,"RetryStrategy",function(){return E.RetryStrategy}),r.d(t,"Tools",function(){return E.Tools}),r.d(t,"PerfCounter",function(){return E.PerfCounter}),r.d(t,"className",function(){return E.className}),r.d(t,"AsyncLoop",function(){return E.AsyncLoop});var x=r(/*! ./videoRecorder */"./Misc/videoRecorder.ts");r.d(t,"VideoRecorder",function(){return x.VideoRecorder});var C=r(/*! ./virtualJoystick */"./Misc/virtualJoystick.ts");r.d(t,"JoystickAxis",function(){return C.JoystickAxis}),r.d(t,"VirtualJoystick",function(){return C.VirtualJoystick});var P=r(/*! ./workerPool */"./Misc/workerPool.ts");r.d(t,"WorkerPool",function(){return P.WorkerPool});var M=r(/*! ./logger */"./Misc/logger.ts");r.d(t,"Logger",function(){return M.Logger});var S=r(/*! ./typeStore */"./Misc/typeStore.ts");r.d(t,"_TypeStore",function(){return S._TypeStore});var R=r(/*! ./filesInputStore */"./Misc/filesInputStore.ts");r.d(t,"FilesInputStore",function(){return R.FilesInputStore});var O=r(/*! ./deepCopier */"./Misc/deepCopier.ts");r.d(t,"DeepCopier",function(){return O.DeepCopier});var I=r(/*! ./pivotTools */"./Misc/pivotTools.ts");r.d(t,"PivotTools",function(){return I.PivotTools});var D=r(/*! ./precisionDate */"./Misc/precisionDate.ts");r.d(t,"PrecisionDate",function(){return D.PrecisionDate});var w=r(/*! ./screenshotTools */"./Misc/screenshotTools.ts");r.d(t,"ScreenshotTools",function(){return w.ScreenshotTools});var L=r(/*! ./webRequest */"./Misc/webRequest.ts");r.d(t,"WebRequest",function(){return L.WebRequest});var B=r(/*! ./iInspectable */"./Misc/iInspectable.ts");r.d(t,"InspectableType",function(){return B.InspectableType})},"./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){this.arrayBuffer=t,this.isInvalid=!1;var s=new Uint8Array(this.arrayBuffer,0,12);if(171!==s[0]||75!==s[1]||84!==s[2]||88!==s[3]||32!==s[4]||49!==s[5]||49!==s[6]||187!==s[7]||13!==s[8]||10!==s[9]||26!==s[10]||10!==s[11])return this.isInvalid=!0,void n.Logger.Error("texture missing KTX identifier");var a=Uint32Array.BYTES_PER_ELEMENT,c=new DataView(this.arrayBuffer,12,13*a),l=67305985===c.getUint32(0,!0);this.glType=c.getUint32(1*a,l),this.glTypeSize=c.getUint32(2*a,l),this.glFormat=c.getUint32(3*a,l),this.glInternalFormat=c.getUint32(4*a,l),this.glBaseInternalFormat=c.getUint32(5*a,l),this.pixelWidth=c.getUint32(6*a,l),this.pixelHeight=c.getUint32(7*a,l),this.pixelDepth=c.getUint32(8*a,l),this.numberOfArrayElements=c.getUint32(9*a,l),this.numberOfFaces=c.getUint32(10*a,l),this.numberOfMipmapLevels=c.getUint32(11*a,l),this.bytesOfKeyValueData=c.getUint32(12*a,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 c=new Int32Array(this.arrayBuffer,n,1)[0];n+=4;for(var l=0;l<this.numberOfFaces;l++){var u=new Uint8Array(this.arrayBuffer,n,c);t.getEngine()._uploadCompressedDataToTextureDirectly(t,this.glInternalFormat,i,o,u,l,a),n+=c,n+=3-(c+3)%4}i=Math.max(1,.5*i),o=Math.max(1,.5*o)}},e.HEADER_LEN=64,e.COMPRESSED_2D=0,e.COMPRESSED_3D=1,e.TEX_2D=2,e.TEX_3D=3,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:!0,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:!0,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 */"./Maths/math.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++){if(this._meshes[i])(s=(o=this._meshes[i]).getBoundingInfo())&&t.addInPlace(s.boundingBox.centerWorld)}e=t.scale(1/this._meshes.length);for(i=0;i<this._meshes.length;i++){var o,s;if(this._meshes[i])if(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/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(){return 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 c=a[s].add(r,n,!1,i);c&&o._observers.push(c)}return o},e}(),s=function(){function e(e){this._observers=new Array,this._eventState=new n(0),e&&(this._onObserverAdded=e)}return 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++)if(this._observers[r].callback===e&&(!t||t===this._observers[r].scope))return this._deferUnregister(this._observers[r]),!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/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:!0,configurable:!0}),Object.defineProperty(e.prototype,"averageFrameTimeVariance",{get:function(){return this._rollingFrameTime.variance},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"instantaneousFrameTime",{get:function(){return this._rollingFrameTime.history(0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"averageFPS",{get:function(){return 1e3/this._rollingFrameTime.average},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"instantaneousFPS",{get:function(){var e=this._rollingFrameTime.history(0);return 0===e?0:1e3/e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSaturated",{get:function(){return this._rollingFrameTime.isSaturated()},enumerable:!0,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:!0,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 */"./Maths/math.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:!0,configurable:!0}),e}()},"./Misc/promise.ts":
- /*!*************************!*\
- !*** ./Misc/promise.ts ***!
- \*************************/
- /*! exports provided: PromisePolyfill */function(e,t,r){"use strict";r.r(t),r.d(t,"PromisePolyfill",function(){return a});var n,i=r(/*! ./tools */"./Misc/tools.ts");!function(e){e[e.Pending=0]="Pending",e[e.Fulfilled=1]="Fulfilled",e[e.Rejected=2]="Rejected"}(n||(n={}));var o=function(){return function(){this.count=0,this.target=0,this.results=[]}}(),s=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:!0,configurable:!0}),e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.then=function(t,r){var o=this,s=new e;return s._onFulfilled=t,s._onRejected=r,this._children.push(s),s._parent=this,this._state!==n.Pending&&i.Tools.SetImmediate(function(){if(o._state===n.Fulfilled||o._rejectWasConsumed){var e=s._resolve(o._result);if(null!=e)if(void 0!==e._state){var t=e;s._children.push(t),t._parent=s,s=t}else s._result=e}else s._reject(o._reason)}),s},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 o;if(n.target=t.length,n.rootPromise=r,t.length)for(var i=0;i<t.length;i++)e._RegisterForFulfillment(t[i],n,i);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}(),a=function(){function e(){}return e.Apply=function(e){(void 0===e&&(e=!1),e||"undefined"==typeof Promise)&&(window.Promise=s)},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 c}),r.d(t,"HardwareScalingOptimization",function(){return l}),r.d(t,"ShadowsOptimization",function(){return u}),r.d(t,"PostProcessesOptimization",function(){return h}),r.d(t,"LensFlaresOptimization",function(){return d}),r.d(t,"CustomOptimization",function(){return f}),r.d(t,"ParticlesOptimization",function(){return p}),r.d(t,"RenderTargetsOptimization",function(){return g}),r.d(t,"MergeMeshesOptimization",function(){return m}),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}(),c=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 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),l=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 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 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),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return 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),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return 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 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 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),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return 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),m=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 n.__extends(t,e),Object.defineProperty(t,"UpdateSelectionTree",{get:function(){return t._UpdateSelectionTree},set:function(e){t._UpdateSelectionTree=e},enumerable:!0,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 c=new Array,l=i[a];if(this._canBeMerged(l)){c.push(l);for(var u=a+1;u<s;u++){var h=i[u];this._canBeMerged(h)&&(h.material===l.material&&h.checkCollisions===l.checkCollisions&&(c.push(h),s--,i.splice(u,1),u--))}c.length<2||o.Mesh.MergeMeshes(c,void 0,!0)}}var d=e;return d.createOrUpdateSelectionOctree&&(null!=n?n&&d.createOrUpdateSelectionOctree():t.UpdateSelectionTree&&d.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 m(n)),r.addOptimization(new u(n)),r.addOptimization(new d(n)),n++,r.addOptimization(new h(n)),r.addOptimization(new p(n)),n++,r.addOptimization(new c(n,1024)),r},e.ModerateDegradationAllowed=function(t){var r=new e(t),n=0;return r.addOptimization(new m(n)),r.addOptimization(new u(n)),r.addOptimization(new d(n)),n++,r.addOptimization(new h(n)),r.addOptimization(new p(n)),n++,r.addOptimization(new c(n,512)),n++,r.addOptimization(new g(n)),n++,r.addOptimization(new l(n,2)),r},e.HighDegradationAllowed=function(t){var r=new e(t),n=0;return r.addOptimization(new m(n)),r.addOptimization(new u(n)),r.addOptimization(new d(n)),n++,r.addOptimization(new h(n)),r.addOptimization(new p(n)),n++,r.addOptimization(new c(n,256)),n++,r.addOptimization(new g(n)),n++,r.addOptimization(new l(n,4)),r},e}(),v=function(){function e(e,t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var o=this;if(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,c=0,l=this._options.optimizations;c<l.length;c++){l[c].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:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentPriorityLevel",{get:function(){return this._currentPriorityLevel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentFrameRate",{get:function(){return this._currentFrameRate},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targetFrameRate",{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackerDuration",{get:function(){return this._trackerDuration},set:function(e){this._trackerDuration=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optimizations",{get:function(){return this._options.optimizations},enumerable:!0,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/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=[],c=function(e,t){a[e.id]||e.doNotSerialize||(t.vertexData.push(e.serializeVerticeData()),a[e.id]=!0)},l=function(e,t){var r={},n=e._geometry;return n&&(e.getScene().getGeometryByID(n.id)||c(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,h={};if(e.ClearCache(),h.useDelayedTextureLoading=t.useDelayedTextureLoading,h.autoClear=t.autoClear,h.clearColor=t.clearColor.asArray(),h.ambientColor=t.ambientColor.asArray(),h.gravity=t.gravity.asArray(),h.collisionsEnabled=t.collisionsEnabled,t.fogMode&&0!==t.fogMode&&(h.fogMode=t.fogMode,h.fogColor=t.fogColor.asArray(),h.fogStart=t.fogStart,h.fogEnd=t.fogEnd,h.fogDensity=t.fogDensity),t.isPhysicsEnabled()){var d=t.getPhysicsEngine();d&&(h.physicsEnabled=!0,h.physicsGravity=d.gravity.asArray(),h.physicsEngine=d.getPhysicsPluginName())}t.metadata&&(h.metadata=t.metadata),h.morphTargetManagers=[];for(var f=0,p=t.meshes;f<p.length;f++){var g=(T=p[f]).morphTargetManager;g&&h.morphTargetManagers.push(g.serialize())}for(h.lights=[],r=0;r<t.lights.length;r++)(o=t.lights[r]).doNotSerialize||h.lights.push(o.serialize());for(h.cameras=[],r=0;r<t.cameras.length;r++){var m=t.cameras[r];m.doNotSerialize||h.cameras.push(m.serialize())}if(t.activeCamera&&(h.activeCameraID=t.activeCamera.id),s.SerializationHelper.AppendSerializedAnimations(t,h),t.reflectionProbes&&t.reflectionProbes.length>0)for(h.reflectionProbes=[],r=0;r<t.reflectionProbes.length;r++){var _=t.reflectionProbes[r];h.reflectionProbes.push(_.serialize())}for(h.materials=[],h.multiMaterials=[],r=0;r<t.materials.length;r++)(u=t.materials[r]).doNotSerialize||h.materials.push(u.serialize());for(h.multiMaterials=[],r=0;r<t.multiMaterials.length;r++){var v=t.multiMaterials[r];h.multiMaterials.push(v.serialize())}for(t.environmentTexture&&(h.environmentTexture=t.environmentTexture.name),h.skeletons=[],r=0;r<t.skeletons.length;r++){var A=t.skeletons[r];A.doNotSerialize||h.skeletons.push(A.serialize())}for(h.transformNodes=[],r=0;r<t.transformNodes.length;r++)h.transformNodes.push(t.transformNodes[r].serialize());h.geometries={},h.geometries.boxes=[],h.geometries.spheres=[],h.geometries.cylinders=[],h.geometries.toruses=[],h.geometries.grounds=[],h.geometries.planes=[],h.geometries.torusKnots=[],h.geometries.vertexData=[],a=[];var y=t.getGeometries();for(r=0;r<y.length;r++){var b=y[r];b.isReady()&&c(b,h.geometries)}for(h.meshes=[],r=0;r<t.meshes.length;r++){var T;if((T=t.meshes[r])instanceof n.Mesh){var E=T;E.doNotSerialize||E.delayLoadState!==i.Constants.DELAYLOADSTATE_LOADED&&E.delayLoadState!==i.Constants.DELAYLOADSTATE_NONE||h.meshes.push(l(E,h))}}for(h.particleSystems=[],r=0;r<t.particleSystems.length;r++)h.particleSystems.push(t.particleSystems[r].serialize());t.actionManager&&(h.actions=t.actionManager.serialize("scene"));for(var x=0,C=t._serializableComponents;x<C.length;x++){C[x].serialize(h)}return h},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&&t.push(e)}),r&&t[u].parent&&t.indexOf(t[u].parent)<0&&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)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=[]),c(a,t.geometries)),e.skeleton&&(t.skeletons=t.skeletons||[],t.skeletons.push(e.skeleton.serialize())),t.meshes=t.meshes||[],t.meshes.push(l(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 l});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"),c=r(/*! ./tools */"./Misc/tools.ts"),l=function(){function e(){}return e.CreateScreenshot=function(e,t,r,n,i){var o,s;if(void 0===i&&(i="image/png"),r.precision)o=Math.round(e.getRenderWidth()*r.precision),s=Math.round(o/e.getAspectRatio(t));else if(r.width&&r.height)o=r.width,s=r.height;else if(r.width&&!r.height)o=r.width,s=Math.round(o/e.getAspectRatio(t));else if(r.height&&!r.width)s=r.height,o=Math.round(s*e.getAspectRatio(t));else{if(isNaN(r))return void a.Logger.Error("Invalid 'size' parameter !");s=r,o=r}c.Tools._ScreenshotCanvas||(c.Tools._ScreenshotCanvas=document.createElement("canvas")),c.Tools._ScreenshotCanvas.width=o,c.Tools._ScreenshotCanvas.height=s;var l=c.Tools._ScreenshotCanvas.getContext("2d"),u=e.getRenderWidth()/e.getRenderHeight(),h=o,d=h/u;d>s&&(h=(d=s)*u);var f=Math.max(0,o-h)/2,p=Math.max(0,s-d)/2,g=e.getRenderingCanvas();l&&g&&l.drawImage(g,f,p,h,d),c.Tools.EncodeScreenshotCanvasData(n,i)},e.CreateScreenshotUsingRenderTarget=function(e,t,r,l,u,h,d,f){var p,g;if(void 0===u&&(u="image/png"),void 0===h&&(h=1),void 0===d&&(d=!1),r.precision)p=Math.round(e.getRenderWidth()*r.precision),g=Math.round(p/e.getAspectRatio(t)),r={width:p,height:g};else if(r.width&&r.height)p=r.width,g=r.height;else if(r.width&&!r.height)p=r.width,g=Math.round(p/e.getAspectRatio(t)),r={width:p,height:g};else if(r.height&&!r.width)g=r.height,r={width:p=Math.round(g*e.getAspectRatio(t)),height:g};else{if(isNaN(r))return void a.Logger.Error("Invalid 'size' parameter !");g=r,p=r}var m=t.getScene(),_=null;m.activeCamera!==t&&(_=m.activeCamera,m.activeCamera=t);var v=e.getRenderingCanvas();if(v){var A={width:v.width,height:v.height};e.setSize(p,g),m.render();var y=new i.RenderTargetTexture("screenShot",r,m,!1,!1,s.Constants.TEXTURETYPE_UNSIGNED_INT,!1,n.Texture.NEAREST_SAMPLINGMODE);y.renderList=null,y.samples=h,d&&y.addPostProcess(new o.FxaaPostProcess("antialiasing",1,m.activeCamera)),y.onAfterRenderObservable.add(function(){c.Tools.DumpFramebuffer(p,g,e,l,u,f)}),m.incrementRenderId(),m.resetCachedMaterial(),y.render(!0),y.dispose(),_&&(m.activeCamera=_),e.setSize(A.width,A.height),t.getProjectionMatrix(!0)}else a.Logger.Error("No rendering canvas found !")},e}();c.Tools.CreateScreenshot=l.CreateScreenshot,c.Tools.CreateScreenshotUsingRenderTarget=l.CreateScreenshotUsingRenderTarget},"./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 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:((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:!0,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/tags.ts":
- /*!**********************!*\
- !*** ./Misc/tags.ts ***!
- \**********************/
- /*! exports provided: Tags */function(e,t,r){"use strict";r.r(t),r.d(t,"Tags",function(){return o});var n=r(/*! ./tools */"./Misc/tools.ts"),i=r(/*! ./andOrNotEvaluator */"./Misc/andOrNotEvaluator.ts"),o=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){return!!e._tags&&!n.Tools.IsEmpty(e._tags)},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):i.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 c=e.getScene(),l=c.getEngine(),u=new i.RenderTargetTexture("resized"+e.name,{width:t,height:r},c,!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 h=new o.PassPostProcess("pass",1,null,a?n.Texture.BILINEAR_SAMPLINGMODE:n.Texture.NEAREST_SAMPLINGMODE,l,!1,s.Constants.TEXTURETYPE_UNSIGNED_INT);return h.getEffect().executeWhenCompiled(function(){h.onApply=function(t){t.setTexture("textureSampler",e)};var t=u.getInternalTexture();t&&(c.postProcessManager.directRender([h],t),l.unBindFramebuffer(t),u.disposeFramebufferObjects(),h.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,c=!1,l=!1;switch(o.image_type){case e._TYPE_RLE_INDEXED:a=!0;case e._TYPE_INDEXED:c=!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:l=!0}var u,h,d,f,p,g,m,_=o.pixel_size>>3,v=o.width*o.height*_;if(c&&(u=r.subarray(i,i+=o.colormap_length*(o.colormap_size>>3))),a){var A,y,b;s=new Uint8Array(v);for(var T=0,E=new Uint8Array(_);i<v&&T<v;)if(y=1+(127&(A=r[i++])),128&A){for(b=0;b<_;++b)E[b]=r[i++];for(b=0;b<y;++b)s.set(E,T+b*_);T+=_*y}else{for(y*=_,b=0;b<y;++b)s[T+b]=r[i++];T+=y}}else s=r.subarray(i,i+=c?o.width*o.height:v);switch((o.flags&e._ORIGIN_MASK)>>e._ORIGIN_SHIFT){default:case e._ORIGIN_UL:h=0,f=1,m=o.width,d=0,p=1,g=o.height;break;case e._ORIGIN_BL:h=0,f=1,m=o.width,d=o.height-1,p=-1,g=-1;break;case e._ORIGIN_UR:h=o.width-1,f=-1,m=-1,d=0,p=1,g=o.height;break;case e._ORIGIN_BR:h=o.width-1,f=-1,m=-1,d=o.height-1,p=-1,g=-1}var x=e["_getImageData"+(l?"Grey":"")+o.pixel_size+"bits"](o,u,s,d,p,g,h,f,m);t.getEngine()._uploadDataToTextureDirectly(t,x)}}},e._getImageData8bits=function(e,t,r,n,i,o,s,a,c){var l,u,h,d=r,f=t,p=e.width,g=e.height,m=0,_=new Uint8Array(p*g*4);for(h=n;h!==o;h+=i)for(u=s;u!==c;u+=a,m++)l=d[m],_[4*(u+p*h)+3]=255,_[4*(u+p*h)+2]=f[3*l+0],_[4*(u+p*h)+1]=f[3*l+1],_[4*(u+p*h)+0]=f[3*l+2];return _},e._getImageData16bits=function(e,t,r,n,i,o,s,a,c){var l,u,h,d=r,f=e.width,p=e.height,g=0,m=new Uint8Array(f*p*4);for(h=n;h!==o;h+=i)for(u=s;u!==c;u+=a,g+=2){var _=255*((31744&(l=d[g+0]+(d[g+1]<<8)))>>10)/31|0,v=255*((992&l)>>5)/31|0,A=255*(31&l)/31|0;m[4*(u+f*h)+0]=_,m[4*(u+f*h)+1]=v,m[4*(u+f*h)+2]=A,m[4*(u+f*h)+3]=32768&l?0:255}return m},e._getImageData24bits=function(e,t,r,n,i,o,s,a,c){var l,u,h=r,d=e.width,f=e.height,p=0,g=new Uint8Array(d*f*4);for(u=n;u!==o;u+=i)for(l=s;l!==c;l+=a,p+=3)g[4*(l+d*u)+3]=255,g[4*(l+d*u)+2]=h[p+0],g[4*(l+d*u)+1]=h[p+1],g[4*(l+d*u)+0]=h[p+2];return g},e._getImageData32bits=function(e,t,r,n,i,o,s,a,c){var l,u,h=r,d=e.width,f=e.height,p=0,g=new Uint8Array(d*f*4);for(u=n;u!==o;u+=i)for(l=s;l!==c;l+=a,p+=4)g[4*(l+d*u)+2]=h[p+0],g[4*(l+d*u)+1]=h[p+1],g[4*(l+d*u)+0]=h[p+2],g[4*(l+d*u)+3]=h[p+3];return g},e._getImageDataGrey8bits=function(e,t,r,n,i,o,s,a,c){var l,u,h,d=r,f=e.width,p=e.height,g=0,m=new Uint8Array(f*p*4);for(h=n;h!==o;h+=i)for(u=s;u!==c;u+=a,g++)l=d[g],m[4*(u+f*h)+0]=l,m[4*(u+f*h)+1]=l,m[4*(u+f*h)+2]=l,m[4*(u+f*h)+3]=255;return m},e._getImageDataGrey16bits=function(e,t,r,n,i,o,s,a,c){var l,u,h=r,d=e.width,f=e.height,p=0,g=new Uint8Array(d*f*4);for(u=n;u!==o;u+=i)for(l=s;l!==c;l+=a,p+=2)g[4*(l+d*u)+0]=h[p+0],g[4*(l+d*u)+1]=h[p+0],g[4*(l+d*u)+2]=h[p+0],g[4*(l+d*u)+3]=h[p+1];return g},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/tools.ts":
- /*!***********************!*\
- !*** ./Misc/tools.ts ***!
- \***********************/
- /*! exports provided: ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorGradient",function(){return m}),r.d(t,"Color3Gradient",function(){return _}),r.d(t,"FactorGradient",function(){return v}),r.d(t,"LoadFileError",function(){return A}),r.d(t,"RetryStrategy",function(){return y}),r.d(t,"Tools",function(){return b}),r.d(t,"PerfCounter",function(){return T}),r.d(t,"className",function(){return E}),r.d(t,"AsyncLoop",function(){return x});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ./observable */"./Misc/observable.ts"),a=r(/*! ./filesInputStore */"./Misc/filesInputStore.ts"),c=r(/*! ../Engines/constants */"./Engines/constants.ts"),l=r(/*! ./domManagement */"./Misc/domManagement.ts"),u=r(/*! ./logger */"./Misc/logger.ts"),h=r(/*! ./typeStore */"./Misc/typeStore.ts"),d=r(/*! ./deepCopier */"./Misc/deepCopier.ts"),f=r(/*! ./precisionDate */"./Misc/precisionDate.ts"),p=r(/*! ./devTools */"./Misc/devTools.ts"),g=r(/*! ./webRequest */"./Misc/webRequest.ts"),m=function(){function e(){}return e.prototype.getColorToRef=function(e){this.color2?i.Color4.LerpToRef(this.color1,this.color2,Math.random(),e):e.copyFrom(this.color1)},e}(),_=function(){return function(){}}(),v=function(){function e(){}return e.prototype.getFactor=function(){return void 0===this.factor2?this.factor1:o.Scalar.Lerp(this.factor1,this.factor2,Math.random())},e}(),A=function(e){function t(r,n){var i=e.call(this,r)||this;return i.request=n,i.name="LoadFileError",t._setPrototypeOf(i,t.prototype),i}return n.__extends(t,e),t._setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t}(Error),y=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}(),b=function(){function e(){}return 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(t){if(e.RegisteredExternalClasses&&e.RegisteredExternalClasses[t])return e.RegisteredExternalClasses[t];var r=h._TypeStore.GetClass(t);if(r)return r;u.Logger.Warn(t+" not found, you may have missed an import.");for(var n=t.split("."),i=window||this,o=0,s=n.length;o<s;o++)i=i[n[o]];return"function"!=typeof i?null:i},e.Slice=function(e,t,r){return e.slice?e.slice(t,r):Array.prototype.slice.call(e,t,r)},e.SetImmediate=function(e){l.DomManagement.IsWindowObjectExist()&&window.setImmediate?window.setImmediate(e):setTimeout(e,1)},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.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=c.Constants.SCALEMODE_NEAREST),n){case c.Constants.SCALEMODE_FLOOR:i=e.FloorPOT(t);break;case c.Constants.SCALEMODE_NEAREST:i=e.NearestPOT(t);break;case c.Constants.SCALEMODE_CEILING:default:i=e.CeilingPOT(t)}return Math.min(i,r)},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.EncodeArrayBufferTobase64=function(e){for(var t,r,n,i,o,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0,h=new Uint8Array(e);u<h.length;)i=(t=h[u++])>>2,o=(3&t)<<4|(r=u<h.length?h[u++]:Number.NaN)>>4,s=(15&r)<<2|(n=u<h.length?h[u++]:Number.NaN)>>6,a=63&n,isNaN(r)?s=a=64:isNaN(n)&&(a=64),l+=c.charAt(i)+c.charAt(o)+c.charAt(s)+c.charAt(a);return"data:image/png;base64,"+l},e.ExtractMinAndMaxIndexed=function(e,t,r,n,o){void 0===o&&(o=null);for(var s=new i.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new i.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=r;c<r+n;c++){var l=3*t[c],u=e[l],h=e[l+1],d=e[l+2];s.minimizeInPlaceFromFloats(u,h,d),a.maximizeInPlaceFromFloats(u,h,d)}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}},e.ExtractMinAndMax=function(e,t,r,n,o){void 0===n&&(n=null);var s=new i.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new i.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);o||(o=3);for(var c=t,l=t*o;c<t+r;c++,l+=o){var u=e[l],h=e[l+1],d=e[l+2];s.minimizeInPlaceFromFloats(u,h,d),a.maximizeInPlaceFromFloats(u,h,d)}return n&&(s.x-=s.x*n.x+n.y,s.y-=s.y*n.x+n.y,s.z-=s.z*n.x+n.y,a.x+=a.x*n.x+n.y,a.y+=a.y*n.x+n.y,a.z+=a.z*n.x+n.y),{minimum:s,maximum:a}},e.MakeArray=function(e,t){return!0===t||void 0!==e&&null!=e?Array.isArray(e)?e:[e]:null},e.GetPointerPrefix=function(){var e="pointer";return!l.DomManagement.IsWindowObjectExist()||window.PointerEvent||navigator.pointerEnabled||(e="mouse"),e},e.QueueNewFrame=function(e,t){return l.DomManagement.IsWindowObjectExist()?(t||(t=window),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)):setTimeout(e,16)},e.RequestFullscreen=function(e){var t=e.requestFullscreen||e.msRequestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen;t&&t.call(e)},e.ExitFullscreen=function(){var e=document;document.exitFullscreen?document.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.msCancelFullScreen&&e.msCancelFullScreen()},e.SetCorsBehavior=function(t,r){if((!t||0!==t.indexOf("data:"))&&e.CorsBehavior)if("string"==typeof e.CorsBehavior||e.CorsBehavior instanceof String)r.crossOrigin=e.CorsBehavior;else{var n=e.CorsBehavior(t);n&&(r.crossOrigin=n)}},e.CleanUrl=function(e){return e=e.replace(/#/gm,"%23")},e.LoadImage=function(t,r,n,i){var o,s=!1;t instanceof ArrayBuffer?(o=URL.createObjectURL(new Blob([t])),s=!0):t instanceof Blob?(o=URL.createObjectURL(t),s=!0):(o=e.CleanUrl(t),o=e.PreprocessUrl(t));var c=new Image;e.SetCorsBehavior(o,c);var l=function(){c.removeEventListener("load",l),c.removeEventListener("error",h),r(c),s&&c.src&&URL.revokeObjectURL(c.src)},h=function(e){c.removeEventListener("load",l),c.removeEventListener("error",h),u.Logger.Error("Error while trying to load image: "+t),n&&n("Error while trying to load image: "+t,e),s&&c.src&&URL.revokeObjectURL(c.src)};c.addEventListener("load",l),c.addEventListener("error",h);var d=function(){c.src=o};if("data:"!==o.substr(0,5)&&i&&i.enableTexturesOffline)i.open(function(){i&&i.loadImage(o,c)},d);else{if(-1!==o.indexOf("file:")){var f=decodeURIComponent(o.substring(5).toLowerCase());if(a.FilesInputStore.FilesToLoad[f]){try{var p;try{p=URL.createObjectURL(a.FilesInputStore.FilesToLoad[f])}catch(e){p=URL.createObjectURL(a.FilesInputStore.FilesToLoad[f])}c.src=p,s=!0}catch(e){c.src=""}return c}}d()}return c},e.LoadFile=function(t,r,n,i,o,c){if(t=e.CleanUrl(t),-1!==(t=e.PreprocessUrl(t)).indexOf("file:")){var u=decodeURIComponent(t.substring(5).toLowerCase());if(a.FilesInputStore.FilesToLoad[u])return e.ReadFile(a.FilesInputStore.FilesToLoad[u],r,n,o)}var h=e.BaseUrl+t,d=!1,f={onCompleteObservable:new s.Observable,abort:function(){return d=!0}},p=function(){var t=new g.WebRequest,i=null;f.abort=function(){d=!0,t.readyState!==(XMLHttpRequest.DONE||4)&&t.abort(),null!==i&&(clearTimeout(i),i=null)};var s=function(a){t.open("GET",h),o&&(t.responseType="arraybuffer"),n&&t.addEventListener("progress",n);var u=function(){t.removeEventListener("loadend",u),f.onCompleteObservable.notifyObservers(f),f.onCompleteObservable.clear()};t.addEventListener("loadend",u);var p=function(){if(!d&&t.readyState===(XMLHttpRequest.DONE||4)){if(t.removeEventListener("readystatechange",p),t.status>=200&&t.status<300||0===t.status&&(!l.DomManagement.IsWindowObjectExist()||e.IsFileURL()))return void r(o?t.response:t.responseText,t.responseURL);var n=e.DefaultRetryStrategy;if(n){var f=n(h,t,a);if(-1!==f)return t.removeEventListener("loadend",u),t=new g.WebRequest,void(i=setTimeout(function(){return s(a+1)},f))}var m=new A("Error status: "+t.status+" "+t.statusText+" - Unable to load "+h,t);if(!c)throw m;c(t,m)}};t.addEventListener("readystatechange",p),t.send()};s(0)};if(i&&i.enableSceneOffline){var m=function(e){e&&e.status>400?c&&c(e):d||p()};i.open(function(){d||i&&i.loadFile(t,function(e){d||r(e),f.onCompleteObservable.notifyObservers(f)},n?function(e){d||n(e)}:void 0,m,o)},m)}else p();return f},e.LoadScript=function(e,t,r){if(l.DomManagement.IsWindowObjectExist()){var n=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.src=e,i.onload=function(){t&&t()},i.onerror=function(t){r&&r("Unable to load script '"+e+"'",t)},n.appendChild(i)}},e.ReadFileAsDataURL=function(e,t,r){var n=new FileReader,i={onCompleteObservable:new s.Observable,abort:function(){return n.abort()}};return n.onloadend=function(e){i.onCompleteObservable.notifyObservers(i)},n.onload=function(e){t(e.target.result)},n.onprogress=r,n.readAsDataURL(e),i},e.ReadFile=function(e,t,r,n){var i=new FileReader,o={onCompleteObservable:new s.Observable,abort:function(){return i.abort()}};return i.onloadend=function(e){return o.onCompleteObservable.notifyObservers(o)},i.onerror=function(r){u.Logger.Log("Error while reading file: "+e.name),t(JSON.stringify({autoClear:!0,clearColor:[1,0,0],ambientColor:[0,0,0],gravity:[0,-9.807,0],meshes:[],cameras:[],lights:[]}))},i.onload=function(e){t(e.target.result)},r&&(i.onprogress=r),n?i.readAsArrayBuffer(e):i.readAsText(e),o},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.CheckExtends=function(e,t,r){t.minimizeInPlace(e),r.maximizeInPlace(e)},e.DeepCopy=function(e,t,r,n){d.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){for(var t=0;t<e.length;t++){var r=e[t];window.addEventListener(r.name,r.handler,!1);try{window.parent&&window.parent.addEventListener(r.name,r.handler,!1)}catch(e){}}},e.UnregisterTopRootEvents=function(e){for(var t=0;t<e.length;t++){var r=e[t];window.removeEventListener(r.name,r.handler);try{window.parent&&window.parent.removeEventListener(r.name,r.handler)}catch(e){}}},e.DumpFramebuffer=function(t,r,n,i,o,s){void 0===o&&(o="image/png");for(var a=4*t,c=r/2,l=n.readPixels(0,0,t,r),u=0;u<c;u++)for(var h=0;h<a;h++){var d=h+u*a,f=h+(r-u-1)*a,p=l[d];l[d]=l[f],l[f]=p}e._ScreenshotCanvas||(e._ScreenshotCanvas=document.createElement("canvas")),e._ScreenshotCanvas.width=t,e._ScreenshotCanvas.height=r;var g=e._ScreenshotCanvas.getContext("2d");if(g){var m=g.createImageData(t,r);m.data.set(l),g.putImageData(m,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"),p._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),p._DevTools.WarnImport("ScreenshotTools")},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.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},Object.defineProperty(e,"errorsCount",{get:function(){return u.Logger.errorsCount},enumerable:!0,configurable:!0}),e.Log=function(e){u.Logger.Log(e)},e.Warn=function(e){u.Logger.Warn(e)},e.Error=function(e){u.Logger.Error(e)},Object.defineProperty(e,"LogCache",{get:function(){return u.Logger.LogCache},enumerable:!0,configurable:!0}),e.ClearLogCache=function(){u.Logger.ClearLogCache()},Object.defineProperty(e,"LogLevels",{set:function(e){u.Logger.LogLevels=e},enumerable:!0,configurable:!0}),e.IsFileURL=function(){return"file:"===location.protocol},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:!0,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(!l.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.time&&console.timeEnd(t))},Object.defineProperty(e,"Now",{get:function(){return f.PrecisionDate.Now},enumerable:!0,configurable:!0}),e.GetClassName=function(e,t){void 0===t&&(t=!1);var r=null;if(!t&&e.getClassName)r=e.getClassName();else{if(e instanceof Object)r=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__;r||(r=typeof e)}return 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.GetCurrentGradient=function(e,t,r){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.BaseUrl="",e.UseCustomRequestHeaders=!1,e.CustomRequestHeaders=g.WebRequest.CustomRequestHeaders,e.DefaultRetryStrategy=y.ExponentialBackoff(),e.CorsBehavior="anonymous",e.UseFallbackTexture=!0,e.RegisteredExternalClasses={},e.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",e._tmpFloatArray=new Float32Array(1),e.GetDOMTextContent=l.DomManagement.GetDOMTextContent,e.PreprocessUrl=function(e){return e},e.NoneLogLevel=u.Logger.NoneLogLevel,e.MessageLogLevel=u.Logger.MessageLogLevel,e.WarningLogLevel=u.Logger.WarningLogLevel,e.ErrorLogLevel=u.Logger.ErrorLogLevel,e.AllLogLevel=u.Logger.AllLogLevel,e.IsWindowObjectExist=l.DomManagement.IsWindowObjectExist,e.PerformanceNoneLogLevel=0,e.PerformanceUserMarkLogLevel=1,e.PerformanceConsoleLogLevel=2,e.StartPerformanceCounter=e._StartPerformanceCounterDisabled,e.EndPerformanceCounter=e._EndPerformanceCounterDisabled,e}(),T=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:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"average",{get:function(){return this._average},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastSecAverage",{get:function(){return this._lastSecAverage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this._totalAccumulated},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._totalValueCount},enumerable:!0,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=f.PrecisionDate.Now)},e.prototype.endMonitoring=function(t){if(void 0===t&&(t=!0),e.Enabled){t&&this.fetchNewFrame();var r=f.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=f.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}();function E(e,t){return function(r){r.__bjsclassName__=e,r.__bjsmoduleName__=null!=t?t:null}}var x=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}()},"./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/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=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 c=a[s];o.addTrack(c)}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:!0,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 s});var n,i=r(/*! ../Maths/math */"./Maths/math.ts"),o=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 s=function(){function e(t){var r=this;if(this._leftJoystick=!!t,e._globalJoystickIndex++,this._axisTargetedByLeftAndRight=n.X,this._axisTargetedByUpAndDown=n.Y,this.reverseLeftRight=!1,this.reverseUpDown=!1,this._touches=new o.StringDictionary,this.deltaPosition=i.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.setAttribute("touch-action","none");var s=e.Canvas.getContext("2d");if(!s)throw new Error("Unable to create canvas for virtual joystick");e.vjCanvasContext=s,e.vjCanvasContext.strokeStyle="#ffffff",e.vjCanvasContext.lineWidth=2,document.body.appendChild(e.Canvas)}e.halfWidth=e.Canvas.width/2,this.pressed=!1,this._joystickColor="cyan",this._joystickPointerID=-1,this._joystickPointerPos=new i.Vector2(0,0),this._joystickPreviousPointerPos=new i.Vector2(0,0),this._joystickPointerStartPos=new i.Vector2(0,0),this._deltaJoystickVector=new i.Vector2(0,0),this._onPointerDownHandlerRef=function(e){r._onPointerDown(e)},this._onPointerMoveHandlerRef=function(e){r._onPointerMove(e)},this._onPointerUpHandlerRef=function(e){r._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(){r._drawVirtualJoystick()})}return 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._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(e){if(this._joystickPointerID==e.pointerId){this._joystickPointerPos.x=e.clientX,this._joystickPointerPos.y=e.clientY,this._deltaJoystickVector=this._joystickPointerPos.clone(),this._deltaJoystickVector=this._deltaJoystickVector.subtract(this._joystickPointerStartPos);var t=(this.reverseLeftRight?-1:1)*this._deltaJoystickVector.x/this._inversedSensibility;switch(this._axisTargetedByLeftAndRight){case n.X:this.deltaPosition.x=Math.min(1,Math.max(-1,t));break;case n.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,t));break;case n.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,t))}var r=(this.reverseUpDown?1:-1)*this._deltaJoystickVector.y/this._inversedSensibility;switch(this._axisTargetedByUpAndDown){case n.X:this.deltaPosition.x=Math.min(1,Math.max(-1,r));break;case n.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,r));break;case n.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,r))}}else{var i=this._touches.get(e.pointerId.toString());i&&(i.x=e.clientX,i.y=e.clientY)}},e.prototype._onPointerUp=function(t){if(this._joystickPointerID==t.pointerId)e.vjCanvasContext.clearRect(this._joystickPointerStartPos.x-64,this._joystickPointerStartPos.y-64,128,128),e.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x-42,this._joystickPreviousPointerPos.y-42,84,84),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},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._drawVirtualJoystick=function(){var t=this;this.pressed&&this._touches.forEach(function(r,n){n.pointerId===t._joystickPointerID?(e.vjCanvasContext.clearRect(t._joystickPointerStartPos.x-64,t._joystickPointerStartPos.y-64,128,128),e.vjCanvasContext.clearRect(t._joystickPreviousPointerPos.x-42,t._joystickPreviousPointerPos.y-42,84,84),e.vjCanvasContext.beginPath(),e.vjCanvasContext.lineWidth=6,e.vjCanvasContext.strokeStyle=t._joystickColor,e.vjCanvasContext.arc(t._joystickPointerStartPos.x,t._joystickPointerStartPos.y,40,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle=t._joystickColor,e.vjCanvasContext.lineWidth=2,e.vjCanvasContext.arc(t._joystickPointerStartPos.x,t._joystickPointerStartPos.y,60,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),e.vjCanvasContext.beginPath(),e.vjCanvasContext.strokeStyle=t._joystickColor,e.vjCanvasContext.arc(t._joystickPointerPos.x,t._joystickPointerPos.y,40,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),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}()},"./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:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._xhr.readyState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._xhr.status},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"statusText",{get:function(){return this._xhr.statusText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"response",{get:function(){return this._xhr.response},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"responseURL",{get:function(){return this._xhr.responseURL},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"responseText",{get:function(){return this._xhr.responseText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"responseType",{get:function(){return this._xhr.responseType},set:function(e){this._xhr.responseType=e},enumerable:!0,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(e){this._xhr.send(e)},e.prototype.open=function(t,r){e.CustomRequestHeaders&&this._injectCustomRequestHeaders();for(var n=0,i=e.CustomRequestModifiers;n<i.length;n++){(0,i[n])(this._xhr)}return this._xhr.open(t,r,!0)},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 l});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"),c=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),l=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.onInfluenceChanged=new i.Observable,this._onDataLayoutChanged=new i.Observable,this._animationPropertiesOverride=null,this._scene=r||o.EngineStore.LastCreatedScene,this.influence=t}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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPositions",{get:function(){return!!this._positions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNormals",{get:function(){return!!this._normals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTangents",{get:function(){return!!this._tangents},enumerable:!0,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.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())),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.animations)for(var n=0;n<t.animations.length;n++){var i=t.animations[n],o=c._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)),i},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._vertexCount=0,this._uniqueId=0,this._tempInfluences=new Array,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"vertexCount",{get:function(){return this._vertexCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"supportsNormals",{get:function(){return this._supportsNormals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"supportsTangents",{get:function(){return this._supportsTangents},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numTargets",{get:function(){return this._targets.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numInfluencers",{get:function(){return this._activeTargets.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"influences",{get:function(){return this._influences},enumerable:!0,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.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._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;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 c=0;c<t;c++)this._influences[c]=this._tempInfluences[c];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}()},"./Offline/database.ts":
- /*!*****************************!*\
- !*** ./Offline/database.ts ***!
- \*****************************/
- /*! exports provided: Database */function(e,t,r){"use strict";r.r(t),r.d(t,"Database",function(){return c});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 c(e,t,r)};var c=function(){function e(t,r,i){void 0===i&&(i=!1);var o=this;this._idbFactory=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableTexturesOffline",{get:function(){return this._enableTexturesOffline},enumerable:!0,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,c=new a.WebRequest;c.open("GET",t),c.responseType="blob",c.addEventListener("load",function(){if(200===c.status&&n._db){s=c.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 l=i.objectStore("textures").put(a);l.onsuccess=function(){},l.onerror=function(){o()}}catch(i){25===i.code&&(e.IsUASupportingBlobStorage=!1,n._enableTexturesOffline=!1),r.src=t}}else r.src=t},!1),c.addEventListener("error",function(){i.Logger.Error("Error in XHR request in BABYLON.Database."),r.src=t},!1),c.send()}else r.src=t}else i.Logger.Error("Error: IndexedDB not supported by your browser or BabylonJS 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 BabylonJS 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),c=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,c):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 c=this;if(this._isSupported){var l;l=-1!==t.indexOf(".babylon")?"scenes":"textures";var u,h=new a.WebRequest;h.open("GET",t+"?"+Date.now()),o&&(h.responseType="arraybuffer"),n&&(h.onprogress=n),h.addEventListener("load",function(){if(200===h.status||h.status<400&&e._ValidateXHRData(h,o?6:1))if(u=o?h.response:h.responseText,!c._hasReachedQuota&&c._db){var n,a=c._db.transaction([l],"readwrite");a.onabort=function(e){try{var t=e.srcElement.error;t&&"QuotaExceededError"===t.name&&(c._hasReachedQuota=!0)}catch(e){}r(u)},a.oncomplete=function(){r(u)},n="scenes"===l?{sceneUrl:t,data:u,version:c._manifestVersionFound}:{textureUrl:t,data:u};try{var d=a.objectStore(l).put(n);d.onsuccess=function(){},d.onerror=function(){i.Logger.Error("Error in DB add file request in BABYLON.Database.")}}catch(e){r(u)}}else r(u);else h.status>=400&&s?s(h):r()},!1),h.addEventListener("error",function(){i.Logger.Error("error on XHR request."),r()},!1),h.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:/")?e._ParseURL(window.location.href)+t:t},e}()},"./Offline/index.ts":
- /*!**************************!*\
- !*** ./Offline/index.ts ***!
- \**************************/
- /*! exports provided: Database */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./database */"./Offline/database.ts");r.d(t,"Database",function(){return n.Database})},"./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 */"./Maths/math.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){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)},e.prototype.startPositionFunction=function(e,t,r){var n=o.Scalar.RandomRange(this.minEmitBox.x,this.maxEmitBox.x),s=o.Scalar.RandomRange(this.minEmitBox.y,this.maxEmitBox.y),a=o.Scalar.RandomRange(this.minEmitBox.z,this.maxEmitBox.z);i.Vector3.TransformCoordinatesFromFloatsToRef(n,s,a,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 */"./Maths/math.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._buildHeight()},enumerable:!0,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){if(1===Math.abs(Math.cos(this._angle)))i.Vector3.TransformNormalFromFloatsToRef(0,1,0,e,t);else{var n=r.position.subtract(e.getTranslation()).normalize(),s=o.Scalar.RandomRange(0,this.directionRandomizer),a=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer);n.x+=s,n.y+=a,n.z+=c,n.normalize(),i.Vector3.TransformNormalFromFloatsToRef(n.x,n.y,n.z,e,t)}},e.prototype.startPositionFunction=function(e,t,r){var n,s=o.Scalar.RandomRange(0,2*Math.PI);n=this.emitFromSpawnPointOnly?1e-4:1-(n=o.Scalar.RandomRange(0,this.heightRange))*n;var a=this._radius-o.Scalar.RandomRange(0,this._radius*this.radiusRange),c=(a*=n)*Math.sin(s),l=a*Math.cos(s),u=n*this._height;i.Vector3.TransformCoordinatesFromFloatsToRef(c,u,l,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},e.prototype.parse=function(e){this.radius=e.radius,this.angle=e.angle,this.directionRandomizer=e.directionRandomizer},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 c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math */"./Maths/math.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){var n=r.position.subtract(e.getTranslation()).normalize(),s=o.Scalar.RandomRange(-this.directionRandomizer/2,this.directionRandomizer/2),a=Math.atan2(n.x,n.z);a+=o.Scalar.RandomRange(-Math.PI/2,Math.PI/2)*this.directionRandomizer,n.y=s,n.x=Math.sin(a),n.z=Math.cos(a),n.normalize(),i.Vector3.TransformNormalFromFloatsToRef(n.x,n.y,n.z,e,t)},e.prototype.startPositionFunction=function(e,t,r){var n=o.Scalar.RandomRange(-this.height/2,this.height/2),s=o.Scalar.RandomRange(0,2*Math.PI),a=o.Scalar.RandomRange((1-this.radiusRange)*(1-this.radiusRange),1),c=Math.sqrt(a)*this.radius,l=c*Math.cos(s),u=c*Math.sin(s);i.Vector3.TransformCoordinatesFromFloatsToRef(l,n,u,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}(),c=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 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 */"./Maths/math.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){var n=r.position.subtract(e.getTranslation()).normalize(),s=o.Scalar.RandomRange(0,this.directionRandomizer),a=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer);n.x+=s,n.y+=a,n.z+=c,n.normalize(),i.Vector3.TransformNormalFromFloatsToRef(n.x,n.y,n.z,e,t)},e.prototype.startPositionFunction=function(e,t,r){var n=this.radius-o.Scalar.RandomRange(0,this.radius*this.radiusRange),s=o.Scalar.RandomRange(0,1),a=o.Scalar.RandomRange(0,2*Math.PI),c=Math.acos(2*s-1),l=n*Math.cos(a)*Math.sin(c),u=n*Math.cos(c),h=n*Math.sin(a)*Math.sin(c);i.Vector3.TransformCoordinatesFromFloatsToRef(l,Math.abs(u),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 ***!
- \*****************************************/
- /*! exports provided: BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter */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(/*! ./pointParticleEmitter */"./Particles/EmitterTypes/pointParticleEmitter.ts");r.d(t,"PointParticleEmitter",function(){return a.PointParticleEmitter});var c=r(/*! ./sphereParticleEmitter */"./Particles/EmitterTypes/sphereParticleEmitter.ts");r.d(t,"SphereParticleEmitter",function(){return c.SphereParticleEmitter}),r.d(t,"SphereDirectedParticleEmitter",function(){return c.SphereDirectedParticleEmitter})},"./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 */"./Maths/math.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){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)},e.prototype.startPositionFunction=function(e,t,r){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 c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math */"./Maths/math.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){var n=r.position.subtract(e.getTranslation()).normalize(),s=o.Scalar.RandomRange(0,this.directionRandomizer),a=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer);n.x+=s,n.y+=a,n.z+=c,n.normalize(),i.Vector3.TransformNormalFromFloatsToRef(n.x,n.y,n.z,e,t)},e.prototype.startPositionFunction=function(e,t,r){var n=this.radius-o.Scalar.RandomRange(0,this.radius*this.radiusRange),s=o.Scalar.RandomRange(0,1),a=o.Scalar.RandomRange(0,2*Math.PI),c=Math.acos(2*s-1),l=n*Math.cos(a)*Math.sin(c),u=n*Math.cos(c),h=n*Math.sin(a)*Math.sin(c);i.Vector3.TransformCoordinatesFromFloatsToRef(l,u,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}(),c=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 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/baseParticleSystem.ts":
- /*!*****************************************!*\
- !*** ./Particles/baseParticleSystem.ts ***!
- \*****************************************/
- /*! exports provided: BaseParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseParticleSystem",function(){return a});var n=r(/*! ../Maths/math */"./Maths/math.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=function(){function e(t){this.animations=[],this.renderingGroupId=0,this.emitter=null,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 n.Color4(1,1,1,1),this.color2=new n.Color4(1,1,1,1),this.colorDead=new n.Color4(0,0,0,1),this.textureMask=new n.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimationSheetEnabled",{get:function(){return this._isAnimationSheetEnabled},set:function(e){this._isAnimationSheetEnabled!=e&&(this._isAnimationSheetEnabled=e,this._reset())},enumerable:!0,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:!0,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:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBillboardBased",{get:function(){return this._isBillboardBased},set:function(e){this._isBillboardBased!==e&&(this._isBillboardBased=e,this._reset())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e)},enumerable:!0,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/gpuParticleSystem.ts":
- /*!****************************************!*\
- !*** ./Particles/gpuParticleSystem.ts ***!
- \****************************************/
- /*! exports provided: GPUParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"GPUParticleSystem",function(){return b});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 */"./Maths/math.ts"),a=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),c=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ./baseParticleSystem */"./Particles/baseParticleSystem.ts"),u=r(/*! ./particleSystem */"./Particles/particleSystem.ts"),h=r(/*! ../Particles/EmitterTypes/boxParticleEmitter */"./Particles/EmitterTypes/boxParticleEmitter.ts"),d=r(/*! ../Materials/effect */"./Materials/effect.ts"),f=r(/*! ../Materials/material */"./Materials/material.ts"),p=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),g=r(/*! ../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),m=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),_=r(/*! ../Materials/Textures/rawTexture */"./Materials/Textures/rawTexture.ts"),v=r(/*! ../Engines/constants */"./Engines/constants.ts"),A=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),y=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),b=(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){void 0===s&&(s=!1);var a=e.call(this,t)||this;a.layerMask=268435455,a._accumulatedCount=0,a._targetIndex=0,a._currentRenderId=-1,a._started=!1,a._stopped=!1,a._timeDelta=0,a._actualFrame=0,a._rawTextureWidth=256,a.onDisposeObservable=new o.Observable,a.forceDepthWrite=!1,a._preWarmDone=!1,a._scene=i||A.EngineStore.LastCreatedScene,a._attachImageProcessingConfiguration(null),a._engine=a._scene.getEngine(),r.randomTextureSize||delete r.randomTextureSize;var c=n.__assign({capacity:5e4,randomTextureSize:a._engine.getCaps().maxTextureSize},r),l=r;isFinite(l)&&(c.capacity=l),a._capacity=c.capacity,a._activeCount=c.capacity,a._currentActiveCount=0,a._isAnimationSheetEnabled=s,a._scene.particleSystems.push(a),a._updateEffectOptions={attributes:["position","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:[]},a.particleEmitterType=new h.BoxParticleEmitter;for(var u=Math.min(a._engine.getCaps().maxTextureSize,c.randomTextureSize),d=[],f=0;f<u;++f)d.push(Math.random()),d.push(Math.random()),d.push(Math.random()),d.push(Math.random());a._randomTexture=new _.RawTexture(new Float32Array(d),u,1,v.Constants.TEXTUREFORMAT_RGBA,a._scene,!1,!1,v.Constants.TEXTURE_NEAREST_SAMPLINGMODE,v.Constants.TEXTURETYPE_FLOAT),a._randomTexture.wrapU=m.Texture.WRAP_ADDRESSMODE,a._randomTexture.wrapV=m.Texture.WRAP_ADDRESSMODE,d=[];for(f=0;f<u;++f)d.push(Math.random()),d.push(Math.random()),d.push(Math.random()),d.push(Math.random());return a._randomTexture2=new _.RawTexture(new Float32Array(d),u,1,v.Constants.TEXTUREFORMAT_RGBA,a._scene,!1,!1,v.Constants.TEXTURE_NEAREST_SAMPLINGMODE,v.Constants.TEXTURETYPE_FLOAT),a._randomTexture2.wrapU=m.Texture.WRAP_ADDRESSMODE,a._randomTexture2.wrapV=m.Texture.WRAP_ADDRESSMODE,a._randomTextureSize=u,a}return n.__extends(t,e),Object.defineProperty(t,"IsSupported",{get:function(){return!!A.EngineStore.LastCreatedEngine&&A.EngineStore.LastCreatedEngine.webGLVersion>1},enumerable:!0,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:!0,configurable:!0}),t.prototype.isReady=function(){return this._updateEffect?!!(this.emitter&&this._updateEffect.isReady()&&this._imageProcessingConfiguration.isReady()&&this._renderEffect.isReady()&&this.particleTexture&&this.particleTexture.isReady()):(this._recreateUpdateEffect(),this._recreateRenderEffect(),!1)},t.prototype.isStarted=function(){return this._started},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._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;return n.gradient=e,n.color1=t,this._colorGradients.push(n),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),this._releaseBuffers(),this},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;n.gradient=t,n.factor1=r,e.push(n),e.sort(function(e,t){return e.gradient<t.gradient?-1:e.gradient>t.gradient?1:0}),this._releaseBuffers()},t.prototype.addSizeGradient=function(e,t){return this._sizeGradients||(this._sizeGradients=[]),this._addFactorGradient(this._sizeGradients,e,t),this._sizeGradientsTexture&&(this._sizeGradientsTexture.dispose(),this._sizeGradientsTexture=null),this._releaseBuffers(),this},t.prototype.removeSizeGradient=function(e){return this._removeGradientAndTexture(e,this._sizeGradients,this._sizeGradientsTexture),this._sizeGradientsTexture=null,this},t.prototype.addAngularSpeedGradient=function(e,t){return this._angularSpeedGradients||(this._angularSpeedGradients=[]),this._addFactorGradient(this._angularSpeedGradients,e,t),this._angularSpeedGradientsTexture&&(this._angularSpeedGradientsTexture.dispose(),this._angularSpeedGradientsTexture=null),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._velocityGradientsTexture&&(this._velocityGradientsTexture.dispose(),this._velocityGradientsTexture=null),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._limitVelocityGradientsTexture&&(this._limitVelocityGradientsTexture.dispose(),this._limitVelocityGradientsTexture=null),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._dragGradientsTexture&&(this._dragGradientsTexture.dispose(),this._dragGradientsTexture=null),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:!0,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),t.age=e.createVertexBuffer("age",3,1),t.life=e.createVertexBuffer("life",4,1),t.seed=e.createVertexBuffer("seed",5,4),t.size=e.createVertexBuffer("size",9,3);var r=12;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),r.age=e.createVertexBuffer("age",3,1,this._attributesStrideSize,!0),r.life=e.createVertexBuffer("life",4,1,this._attributesStrideSize,!0),r.size=e.createVertexBuffer("size",9,3,this._attributesStrideSize,!0);var n=12;this._colorGradientsTexture||(r.color=e.createVertexBuffer("color",n,4,this._attributesStrideSize,!0),n+=4),this.billboardMode===u.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._renderEffect);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.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=0;n<this._capacity;n++)r.push(0),r.push(0),r.push(0),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)),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 i=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,i,!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._updateEffect&&this._updateEffectOptions.defines===e||(this._updateEffectOptions.transformFeedbackVaryings=["outPosition","outAge","outLife","outSeed","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 d.Effect("gpuUpdateParticles",this._updateEffectOptions,this._scene.getEngine()))},t.prototype._recreateRenderEffect=function(){var e="";if(this._scene.clipPlane&&(e="\n#define CLIPPLANE"),this._scene.clipPlane2&&(e="\n#define CLIPPLANE2"),this._scene.clipPlane3&&(e="\n#define CLIPPLANE3"),this._scene.clipPlane4&&(e="\n#define CLIPPLANE4"),this.blendMode===u.ParticleSystem.BLENDMODE_MULTIPLY&&(e="\n#define BLENDMULTIPLYMODE"),this._isBillboardBased)switch(e+="\n#define BILLBOARD",this.billboardMode){case u.ParticleSystem.BILLBOARDMODE_Y:e+="\n#define BILLBOARDY";break;case u.ParticleSystem.BILLBOARDMODE_STRETCHED:e+="\n#define BILLBOARDSTRETCHED";break;case u.ParticleSystem.BILLBOARDMODE_ALL:}if(this._colorGradientsTexture&&(e+="\n#define COLORGRADIENTS"),this.isAnimationSheetEnabled&&(e+="\n#define ANIMATESHEET"),this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),e+="\n"+this._imageProcessingConfigurationDefines.toString()),!this._renderEffect||this._renderEffect.defines!==e){var t=["worldOffset","view","projection","colorDead","invView","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","sheetInfos","translationPivot","eyePosition"],r=["textureSampler","colorGradientSampler"];g.ImageProcessingConfiguration&&(g.ImageProcessingConfiguration.PrepareUniforms(t,this._imageProcessingConfigurationDefines),g.ImageProcessingConfiguration.PrepareSamplers(r,this._imageProcessingConfigurationDefines)),this._renderEffect=new d.Effect("gpuRenderParticles",["position","age","life","size","color","offset","uv","direction","initialDirection","angle","cellIndex"],t,r,this._scene.getEngine(),e)}},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.Tools.GetCurrentGradient(s,e,function(e,t,r){n[o]=a.Scalar.Lerp(e.factor1,t.factor1,r)})}this[t]=_.RawTexture.CreateRTexture(n,this._rawTextureWidth,1,this._scene,!1,!1,m.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=s.Tmp.Color4[0],r=0;r<this._rawTextureWidth;r++){var n=r/this._rawTextureWidth;i.Tools.GetCurrentGradient(n,this._colorGradients,function(n,i,o){s.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=_.RawTexture.CreateRGBATexture(e,this._rawTextureWidth,1,this._scene,!1,!1,m.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._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(f.Material.PointListDrawMode,0,this._currentActiveCount),this._engine.endTransformFeedback(),this._engine.setRasterizerState(!0),this._engine.bindTransformFeedbackBuffer(null),!e){this._engine.enableEffect(this._renderEffect);var o=this._scene.getViewMatrix();if(this._renderEffect.setMatrix("view",o),this._renderEffect.setMatrix("projection",this._scene.getProjectionMatrix()),this._renderEffect.setTexture("textureSampler",this.particleTexture),this._renderEffect.setVector2("translationPivot",this.translationPivot),this._renderEffect.setVector3("worldOffset",this.worldOffset),this._colorGradientsTexture?this._renderEffect.setTexture("colorGradientSampler",this._colorGradientsTexture):this._renderEffect.setDirectColor4("colorDead",this.colorDead),this._isAnimationSheetEnabled&&this.particleTexture){var a=this.particleTexture.getBaseSize();this._renderEffect.setFloat3("sheetInfos",this.spriteCellWidth/a.width,this.spriteCellHeight/a.height,a.width/this.spriteCellWidth)}if(this._isBillboardBased){var c=this._scene.activeCamera;this._renderEffect.setVector3("eyePosition",c.globalPosition)}if(this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4){var l=o.clone();l.invert(),this._renderEffect.setMatrix("invView",l),p.MaterialHelper.BindClipPlane(this._renderEffect,this._scene)}switch(this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._renderEffect),this.blendMode){case u.ParticleSystem.BLENDMODE_ADD:this._engine.setAlphaMode(v.Constants.ALPHA_ADD);break;case u.ParticleSystem.BLENDMODE_ONEONE:this._engine.setAlphaMode(v.Constants.ALPHA_ONEONE);break;case u.ParticleSystem.BLENDMODE_STANDARD:this._engine.setAlphaMode(v.Constants.ALPHA_COMBINE);break;case u.ParticleSystem.BLENDMODE_MULTIPLY:this._engine.setAlphaMode(v.Constants.ALPHA_MULTIPLY)}this.forceDepthWrite&&this._engine.setDepthWrite(!0),this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex],null),this._engine.drawArraysType(f.Material.TriangleFanDrawMode,0,4,this._currentActiveCount),this._engine.setAlphaMode(v.Constants.ALPHA_DISABLE)}this._targetIndex++,2===this._targetIndex&&(this._targetIndex=0);var h=this._sourceBuffer;return this._sourceBuffer=this._targetBuffer,this._targetBuffer=h,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]);this._updateVAO=[];for(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 n=new t(e,{capacity:this._capacity,randomTextureSize:this._randomTextureSize},this._scene);return y.DeepCopier.DeepCopy(this,n),void 0===r&&(r=this.emitter),n.emitter=r,this.particleTexture&&(n.particleTexture=new m.Texture(this.particleTexture.url,this._scene)),n},t.prototype.serialize=function(){var e={};return u.ParticleSystem._Serialize(e,this),e.activeParticleCount=this.activeParticleCount,e},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),u.ParticleSystem._Parse(e,o,r,n),e.preventAutoStart&&(o.preventAutoStart=e.preventAutoStart),i||o.preventAutoStart||o.start(),o},t}(l.BaseParticleSystem))},"./Particles/index.ts":
- /*!****************************!*\
- !*** ./Particles/index.ts ***!
- \****************************/
- /*! exports provided: BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, SubEmitterType, SubEmitter, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter */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");r.d(t,"BoxParticleEmitter",function(){return i.BoxParticleEmitter}),r.d(t,"ConeParticleEmitter",function(){return i.ConeParticleEmitter}),r.d(t,"CylinderParticleEmitter",function(){return i.CylinderParticleEmitter}),r.d(t,"CylinderDirectedParticleEmitter",function(){return i.CylinderDirectedParticleEmitter}),r.d(t,"HemisphericParticleEmitter",function(){return i.HemisphericParticleEmitter}),r.d(t,"PointParticleEmitter",function(){return i.PointParticleEmitter}),r.d(t,"SphereParticleEmitter",function(){return i.SphereParticleEmitter}),r.d(t,"SphereDirectedParticleEmitter",function(){return i.SphereDirectedParticleEmitter});var o=r(/*! ./gpuParticleSystem */"./Particles/gpuParticleSystem.ts");r.d(t,"GPUParticleSystem",function(){return o.GPUParticleSystem});var s=r(/*! ./particle */"./Particles/particle.ts");r.d(t,"Particle",function(){return s.Particle});var a=r(/*! ./particleHelper */"./Particles/particleHelper.ts");r.d(t,"ParticleHelper",function(){return a.ParticleHelper});var c=r(/*! ./particleSystem */"./Particles/particleSystem.ts");r.d(t,"ParticleSystem",function(){return c.ParticleSystem});var l=r(/*! ./particleSystemComponent */"./Particles/particleSystemComponent.ts");r.d(t,"_IDoNeedToBeInTheBuild",function(){return l._IDoNeedToBeInTheBuild});var u=r(/*! ./particleSystemSet */"./Particles/particleSystemSet.ts");r.d(t,"ParticleSystemSet",function(){return u.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});var d=r(/*! ./solidParticleSystem */"./Particles/solidParticleSystem.ts");r.d(t,"SolidParticleSystem",function(){return d.SolidParticleSystem});var f=r(/*! ./subEmitter */"./Particles/subEmitter.ts");r.d(t,"SubEmitterType",function(){return f.SubEmitterType}),r.d(t,"SubEmitter",function(){return f.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 o});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),o=function(){function e(t){this.particleSystem=t,this.position=n.Vector3.Zero(),this.direction=n.Vector3.Zero(),this.color=new n.Color4(0,0,0,0),this.colorStep=new n.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 n.Color4(0,0,0,0),this._currentColor2=new n.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=i.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;t.position.copyFrom(this.position),e.inheritDirection&&(t.position.subtractToRef(this.direction,n.Tmp.Vector3[0]),t.lookAt(n.Tmp.Vector3[0],0,Math.PI/2))}else{e.particleSystem.emitter.copyFrom(this.position)}this.direction.scaleToRef(e.inheritedVelocityAmount/2,n.Tmp.Vector3[0]),e.particleSystem._inheritedVelocityOffset.copyFrom(n.Tmp.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._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),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.copyFrom(this.remapData),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 h});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Maths/math */"./Maths/math.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ./gpuParticleSystem */"./Particles/gpuParticleSystem.ts"),c=r(/*! ./particleSystemSet */"./Particles/particleSystemSet.ts"),l=r(/*! ./particleSystem */"./Particles/particleSystem.ts"),u=r(/*! ../Engines/constants */"./Engines/constants.ts"),h=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 l.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,l){if(i&&!a.GPUParticleSystem.IsSupported)return r._removePendingData(o),l("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(c.ParticleSystemSet.Parse(t,r,i))},void 0,void 0,void 0,function(){return r._removePendingData(o),l("An error occured while the creation of your particle system. Check if your type '"+t+"' exists.")})})},e.ExportSet=function(e){for(var t=new c.ParticleSystemSet,r=0,n=e;r<n.length;r++){var i=n[r];t.systems.push(i)}return t},e.BaseAssetsUrl=u.Constants.PARTICLES_BaseAssetsUrl,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 C});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 */"./Maths/math.ts"),a=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),c=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),l=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),d=r(/*! ../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),f=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),p=r(/*! ../Materials/Textures/rawTexture */"./Materials/Textures/rawTexture.ts"),g=r(/*! ../Materials/Textures/Procedurals/proceduralTexture */"./Materials/Textures/Procedurals/proceduralTexture.ts"),m=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),_=r(/*! ../Particles/EmitterTypes/index */"./Particles/EmitterTypes/index.ts"),v=r(/*! ./baseParticleSystem */"./Particles/baseParticleSystem.ts"),A=r(/*! ./particle */"./Particles/particle.ts"),y=r(/*! ./subEmitter */"./Particles/subEmitter.ts"),b=r(/*! ../Engines/constants */"./Engines/constants.ts"),T=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),E=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),x=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),C=(r(/*! ../Shaders/particles.fragment */"./Shaders/particles.fragment.ts"),r(/*! ../Shaders/particles.vertex */"./Shaders/particles.vertex.ts"),function(e){function t(t,r,n,c,l,u){void 0===c&&(c=null),void 0===l&&(l=!1),void 0===u&&(u=.01);var h=e.call(this,t)||this;return h._inheritedVelocityOffset=new s.Vector3,h.onDisposeObservable=new o.Observable,h._particles=new Array,h._stockParticles=new Array,h._newPartsExcess=0,h._vertexBuffers={},h._scaledColorStep=new s.Color4(0,0,0,0),h._colorDiff=new s.Color4(0,0,0,0),h._scaledDirection=s.Vector3.Zero(),h._scaledGravity=s.Vector3.Zero(),h._currentRenderId=-1,h._useInstancing=!1,h._started=!1,h._stopped=!1,h._actualFrame=0,h._currentEmitRate1=0,h._currentEmitRate2=0,h._currentStartSize1=0,h._currentStartSize2=0,h._rawTextureWidth=256,h._useRampGradients=!1,h._disposeEmitterOnDispose=!1,h.recycleParticle=function(e){var t=h._particles.pop();t!==e&&t.copyTo(e),h._stockParticles.push(t)},h._createParticle=function(){var e;if(0!==h._stockParticles.length?(e=h._stockParticles.pop())._reset():e=new A.Particle(h),h._subEmitters&&h._subEmitters.length>0){var t=h._subEmitters[Math.floor(Math.random()*h._subEmitters.length)];e._attachedSubEmitters=[],t.forEach(function(t){if(t.type===y.SubEmitterType.ATTACHED){var r=t.clone();e._attachedSubEmitters.push(r),r.particleSystem.start()}})}return e},h._emitFromParticle=function(e){if(h._subEmitters&&0!==h._subEmitters.length){var t=Math.floor(Math.random()*h._subEmitters.length);h._subEmitters[t].forEach(function(t){if(t.type===y.SubEmitterType.END){var r=t.clone();e._inheritParticleInfoToSubEmitter(r),r.particleSystem._rootParticleSystem=h,h.activeSubSystems.push(r.particleSystem),r.particleSystem.start()}})}},h._capacity=r,h._epsilon=u,h._isAnimationSheetEnabled=l,h._scene=n||m.EngineStore.LastCreatedScene,h._attachImageProcessingConfiguration(null),h._customEffect=c,h._scene.particleSystems.push(h),h._useInstancing=h._scene.getEngine().getCaps().instancedArrays,h._createIndexBuffer(),h._createVertexBuffers(),h.particleEmitterType=new _.BoxParticleEmitter,h.updateFunction=function(e){var t=null,r=null;h.noiseTexture&&(t=h.noiseTexture.getSize(),r=h.noiseTexture.getContent());for(var n,o=function(){n=e[c];var o=h._scaledUpdateSpeed,l=n.age;if(n.age+=o,n.age>n.lifeTime){var u=n.age-l;o=(n.lifeTime-l)*o/u,n.age=n.lifeTime}var d=n.age/n.lifeTime;h._colorGradients&&h._colorGradients.length>0?i.Tools.GetCurrentGradient(d,h._colorGradients,function(e,t,r){e!==n._currentColorGradient&&(n._currentColor1.copyFrom(n._currentColor2),t.getColorToRef(n._currentColor2),n._currentColorGradient=e),s.Color4.LerpToRef(n._currentColor1,n._currentColor2,r,n.color)}):(n.colorStep.scaleToRef(o,h._scaledColorStep),n.color.addInPlace(h._scaledColorStep),n.color.a<0&&(n.color.a=0)),h._angularSpeedGradients&&h._angularSpeedGradients.length>0&&i.Tools.GetCurrentGradient(d,h._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(h._velocityGradients&&h._velocityGradients.length>0&&i.Tools.GetCurrentGradient(d,h._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,h._scaledDirection),h._limitVelocityGradients&&h._limitVelocityGradients.length>0&&i.Tools.GetCurrentGradient(d,h._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(h.limitVelocityDamping)}),h._dragGradients&&h._dragGradients.length>0&&i.Tools.GetCurrentGradient(d,h._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);h._scaledDirection.scaleInPlace(1-i)}),n.position.addInPlace(h._scaledDirection),r&&t&&n._randomNoiseCoordinates1){var p=h._fetchR(n._randomNoiseCoordinates1.x,n._randomNoiseCoordinates1.y,t.width,t.height,r),g=h._fetchR(n._randomNoiseCoordinates1.z,n._randomNoiseCoordinates2.x,t.width,t.height,r),m=h._fetchR(n._randomNoiseCoordinates2.y,n._randomNoiseCoordinates2.z,t.width,t.height,r),_=s.Tmp.Vector3[0],v=s.Tmp.Vector3[1];_.copyFromFloats((2*p-1)*h.noiseStrength.x,(2*g-1)*h.noiseStrength.y,(2*m-1)*h.noiseStrength.z),_.scaleToRef(o,v),n.direction.addInPlace(v)}if(h.gravity.scaleToRef(o,h._scaledGravity),n.direction.addInPlace(h._scaledGravity),h._sizeGradients&&h._sizeGradients.length>0&&i.Tools.GetCurrentGradient(d,h._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)}),h._useRampGradients&&(h._colorRemapGradients&&h._colorRemapGradients.length>0&&i.Tools.GetCurrentGradient(d,h._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}),h._alphaRemapGradients&&h._alphaRemapGradients.length>0&&i.Tools.GetCurrentGradient(d,h._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})),h._isAnimationSheetEnabled&&n.updateCellIndex(),n._inheritParticleInfoToSubEmitters(),n.age>=n.lifeTime)return h._emitFromParticle(n),n._attachedSubEmitters&&(n._attachedSubEmitters.forEach(function(e){e.particleSystem.disposeOnStop=!0,e.particleSystem.stop()}),n._attachedSubEmitters=null),h.recycleParticle(n),c--,"continue"},c=0;c<e.length;c++)o()},h}return 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:!0,configurable:!0}),Object.defineProperty(t.prototype,"useRampGradients",{get:function(){return this._useRampGradients},set:function(e){this._useRampGradients!==e&&(this._useRampGradients=e,this._resetEffect())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"particles",{get:function(){return this._particles},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"ParticleSystem"},t.prototype._addFactorGradient=function(e,t,r,n){var o=new i.FactorGradient;o.gradient=t,o.factor1=r,o.factor2=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._emitRateGradients,e),this},t.prototype._createRampGradientTexture=function(){if(this._rampGradients&&this._rampGradients.length&&!this._rampGradientsTexture){for(var e=new Uint8Array(4*this._rawTextureWidth),t=s.Tmp.Color3[0],r=0;r<this._rawTextureWidth;r++){var n=r/this._rawTextureWidth;i.Tools.GetCurrentGradient(n,this._rampGradients,function(n,i,o){s.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.addRampGradient=function(e,t){this._rampGradients||(this._rampGradients=[]);var r=new i.Color3Gradient;return r.gradient=e,r.color=t,this._rampGradients.push(r),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(),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;return n.gradient=e,n.color1=t,n.color2=r,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 c.Buffer(e,this._vertexData,!0,this._vertexBufferSize);var r=0,n=this._vertexBuffer.createVertexBuffer(c.VertexBuffer.PositionKind,r,3,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[c.VertexBuffer.PositionKind]=n,r+=3;var i=this._vertexBuffer.createVertexBuffer(c.VertexBuffer.ColorKind,r,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers[c.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 l=this._vertexBuffer.createVertexBuffer("cellIndex",r,1,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.cellIndex=l,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 h=this._vertexBuffer.createVertexBuffer("remapData",r,4,this._vertexBufferSize,this._useInstancing);this._vertexBuffers.remapData=h,r+=4}if(this._useInstancing){var d=new Float32Array([0,0,1,0,1,1,0,1]);this._spriteBuffer=new c.Buffer(e,d,!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 y.SubEmitter(r)]):r instanceof y.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 l.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;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):r._initialDirection?(this._vertexData[o++]=r._initialDirection.x,this._vertexData[o++]=r._initialDirection.y,this._vertexData[o++]=r._initialDirection.z):(this._vertexData[o++]=r.direction.x,this._vertexData[o++]=r.direction.y,this._vertexData[o++]=r.direction.z),this._useRampGradients&&(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 c,l=function(){if(u._particles.length===u._capacity)return"break";t=u._createParticle(),u._particles.push(t);var e=a.Scalar.RandomRange(u.minEmitPower,u.maxEmitPower);if(u.startPositionFunction?u.startPositionFunction(u._emitterWorldMatrix,t.position,t):u.particleEmitterType.startPositionFunction(u._emitterWorldMatrix,t.position,t),u.startDirectionFunction?u.startDirectionFunction(u._emitterWorldMatrix,t.direction,t):u.particleEmitterType.startDirectionFunction(u._emitterWorldMatrix,t.direction,t),0===e?t._initialDirection?t._initialDirection.copyFrom(t.direction):t._initialDirection=t.direction.clone():t._initialDirection=null,t.direction.scaleInPlace(e),u.targetStopDuration&&u._lifeTimeGradients&&u._lifeTimeGradients.length>0){var n=a.Scalar.Clamp(u._actualFrame/u.targetStopDuration);i.Tools.GetCurrentGradient(n,u._lifeTimeGradients,function(e,r){var i=e,o=r,s=i.getFactor(),c=o.getFactor(),l=(n-i.gradient)/(o.gradient-i.gradient);t.lifeTime=a.Scalar.Lerp(s,c,l)})}else t.lifeTime=a.Scalar.RandomRange(u.minLifeTime,u.maxLifeTime);if(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.Tools.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)):(c=a.Scalar.RandomRange(0,1),s.Color4.LerpToRef(u.color1,u.color2,c,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,h=0;h<e;h++){if("break"===l())break}},t._GetAttributeNamesOrOptions=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=!1),void 0===r&&(r=!1);var n=[c.VertexBuffer.PositionKind,c.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","textureMask","translationPivot","eyePosition"];return e&&t.push("particlesInfos"),t},t.prototype._getEffect=function(e){if(this._customEffect)return this._customEffect;var r=[];if(this._scene.clipPlane&&r.push("#define CLIPPLANE"),this._scene.clipPlane2&&r.push("#define CLIPPLANE2"),this._scene.clipPlane3&&r.push("#define CLIPPLANE3"),this._scene.clipPlane4&&r.push("#define CLIPPLANE4"),this._isAnimationSheetEnabled&&r.push("#define ANIMATESHEET"),e===t.BLENDMODE_MULTIPLY&&r.push("#define BLENDMULTIPLYMODE"),this._useRampGradients&&r.push("#define RAMPGRADIENT"),this._isBillboardBased)switch(r.push("#define BILLBOARD"),this.billboardMode){case t.BILLBOARDMODE_Y:r.push("#define BILLBOARDY");break;case t.BILLBOARDMODE_STRETCHED:r.push("#define BILLBOARDSTRETCHED");break;case t.BILLBOARDMODE_ALL:}this._imageProcessingConfiguration&&(this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines),r.push(this._imageProcessingConfigurationDefines.toString()));var n=r.join("\n");if(this._cachedDefines!==n){this._cachedDefines=n;var i=t._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled,this._isBillboardBased&&this.billboardMode!==t.BILLBOARDMODE_STRETCHED,this._useRampGradients),o=t._GetEffectCreationOptions(this._isAnimationSheetEnabled),s=["diffuseSampler","rampSampler"];d.ImageProcessingConfiguration&&(d.ImageProcessingConfiguration.PrepareUniforms(o,this._imageProcessingConfigurationDefines),d.ImageProcessingConfiguration.PrepareSamplers(s,this._imageProcessingConfigurationDefines)),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.Tools.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,c=0;c<this._particles.length;c++){var l=this._particles[c];this._appendParticleVertices(s,l),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(){this._createIndexBuffer(),this._vertexBuffer&&this._vertexBuffer._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)}if(this._rampGradientsTexture&&r.setTexture("rampSampler",this._rampGradientsTexture),this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4){var a=i.clone();a.invert(),r.setMatrix("invView",a),h.MaterialHelper.BindClipPlane(r,this._scene)}switch(n.bindBuffers(this._vertexBuffers,this._indexBuffer,r),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(r),e){case t.BLENDMODE_ADD:n.setAlphaMode(b.Constants.ALPHA_ADD);break;case t.BLENDMODE_ONEONE:n.setAlphaMode(b.Constants.ALPHA_ONEONE);break;case t.BLENDMODE_STANDARD:n.setAlphaMode(b.Constants.ALPHA_COMBINE);break;case t.BLENDMODE_MULTIPLY:n.setAlphaMode(b.Constants.ALPHA_MULTIPLY)}return 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(b.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),(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 n=null,i=null;if(null!=this.customShader){var o=(i=this.customShader).shaderOptions.defines.length>0?i.shaderOptions.defines.join("\n"):"";n=this._scene.getEngine().createEffectForParticles(i.shaderPath.fragmentElement,i.shaderOptions.uniforms,i.shaderOptions.samplers,o)}else this._customEffect&&(n=this._customEffect);var s=new t(e,this._capacity,this._scene,n);return s.customShader=i,E.DeepCopier.DeepCopy(this,s,["particles","customShader","noiseTexture"]),void 0===r&&(r=this.emitter),s.noiseTexture=this.noiseTexture,s.emitter=r,this.particleTexture&&(s.particleTexture=new f.Texture(this.particleTexture.url,this._scene)),this._colorGradients&&this._colorGradients.forEach(function(e){s.addColorGradient(e.gradient,e.color1,e.color2)}),this._dragGradients&&this._dragGradients.forEach(function(e){s.addDragGradient(e.gradient,e.factor1,e.factor2)}),this._angularSpeedGradients&&this._angularSpeedGradients.forEach(function(e){s.addAngularSpeedGradient(e.gradient,e.factor1,e.factor2)}),this._emitRateGradients&&this._emitRateGradients.forEach(function(e){s.addEmitRateGradient(e.gradient,e.factor1,e.factor2)}),this._lifeTimeGradients&&this._lifeTimeGradients.forEach(function(e){s.addLifeTimeGradient(e.gradient,e.factor1,e.factor2)}),this._limitVelocityGradients&&this._limitVelocityGradients.forEach(function(e){s.addLimitVelocityGradient(e.gradient,e.factor1,e.factor2)}),this._sizeGradients&&this._sizeGradients.forEach(function(e){s.addSizeGradient(e.gradient,e.factor1,e.factor2)}),this._startSizeGradients&&this._startSizeGradients.forEach(function(e){s.addStartSizeGradient(e.gradient,e.factor1,e.factor2)}),this._velocityGradients&&this._velocityGradients.forEach(function(e){s.addVelocityGradient(e.gradient,e.factor1,e.factor2)}),this._rampGradients&&this._rampGradients.forEach(function(e){s.addRampGradient(e.gradient,e.color)}),this._colorRemapGradients&&this._colorRemapGradients.forEach(function(e){s.addColorRemapGradient(e.gradient,e.factor1,e.factor2)}),this._alphaRemapGradients&&this._alphaRemapGradients.forEach(function(e){s.addAlphaRemapGradient(e.gradient,e.factor1,e.factor2)}),this.preventAutoStart||s.start(),s},t.prototype.serialize=function(){var e={};if(t._Serialize(e,this),e.textureMask=this.textureMask.asArray(),e.customShader=this.customShader,e.preventAutoStart=this.preventAutoStart,this.subEmitters){e.subEmitters=[],this._subEmitters||this._prepareSubEmitterInternalArray();for(var r=0,n=this._subEmitters;r<n.length;r++){for(var i=[],o=0,s=n[r];o<s.length;o++){var a=s[o];i.push(a.serialize())}e.subEmitters.push(i)}}return e},t._Serialize=function(e,t){if(e.name=t.name,e.id=t.id,e.capacity=t.getCapacity(),t.emitter.position){var r=t.emitter;e.emitterId=r.id}else{var n=t.emitter;e.emitter=n.asArray()}t.particleEmitterType&&(e.particleEmitterType=t.particleEmitterType.serialize()),t.particleTexture&&(e.textureName=t.particleTexture.name,e.invertY=t.particleTexture._invertY),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 i=t.getColorGradients();if(i){e.colorGradients=[];for(var o=0,s=i;o<s.length;o++){var a=s[o],c={gradient:a.gradient,color1:a.color1.asArray()};a.color2&&(c.color2=a.color2.asArray()),e.colorGradients.push(c)}}var l=t.getRampGradients();if(l){e.rampGradients=[];for(var u=0,h=l;u<h.length;u++){var d=h[u];c={gradient:d.gradient,color:d.color.asArray()};e.rampGradients.push(c)}e.useRampGradients=t.useRampGradients}var f=t.getColorRemapGradients();if(f){e.colorRemapGradients=[];for(var p=0,g=f;p<g.length;p++){var m=g[p];c={gradient:m.gradient,factor1:m.factor1};void 0!==m.factor2&&(c.factor2=m.factor2),e.colorRemapGradients.push(c)}}var _=t.getAlphaRemapGradients();if(_){e.alphaRemapGradients=[];for(var v=0,A=_;v<A.length;v++){var y=A[v];c={gradient:y.gradient,factor1:y.factor1};void 0!==y.factor2&&(c.factor2=y.factor2),e.alphaRemapGradients.push(c)}}var b=t.getSizeGradients();if(b){e.sizeGradients=[];for(var E=0,x=b;E<x.length;E++){var C=x[E];c={gradient:C.gradient,factor1:C.factor1};void 0!==C.factor2&&(c.factor2=C.factor2),e.sizeGradients.push(c)}}var P=t.getAngularSpeedGradients();if(P){e.angularSpeedGradients=[];for(var M=0,S=P;M<S.length;M++){var R=S[M];c={gradient:R.gradient,factor1:R.factor1};void 0!==R.factor2&&(c.factor2=R.factor2),e.angularSpeedGradients.push(c)}}var O=t.getVelocityGradients();if(O){e.velocityGradients=[];for(var I=0,D=O;I<D.length;I++){var w=D[I];c={gradient:w.gradient,factor1:w.factor1};void 0!==w.factor2&&(c.factor2=w.factor2),e.velocityGradients.push(c)}}var L=t.getDragGradients();if(L){e.dragyGradients=[];for(var B=0,F=L;B<F.length;B++){var N=F[B];c={gradient:N.gradient,factor1:N.factor1};void 0!==N.factor2&&(c.factor2=N.factor2),e.dragGradients.push(c)}}var V=t.getEmitRateGradients();if(V){e.emitRateGradients=[];for(var U=0,G=V;U<G.length;U++){var k=G[U];c={gradient:k.gradient,factor1:k.factor1};void 0!==k.factor2&&(c.factor2=k.factor2),e.emitRateGradients.push(c)}}var z=t.getStartSizeGradients();if(z){e.startSizeGradients=[];for(var H=0,j=z;H<j.length;H++){var X=j[H];c={gradient:X.gradient,factor1:X.factor1};void 0!==X.factor2&&(c.factor2=X.factor2),e.startSizeGradients.push(c)}}var W=t.getLifeTimeGradients();if(W){e.lifeTimeGradients=[];for(var Y=0,Q=W;Y<Q.length;Y++){var K=Q[Y];c={gradient:K.gradient,factor1:K.factor1};void 0!==K.factor2&&(c.factor2=K.factor2),e.lifeTimeGradients.push(c)}}var Z=t.getLimitVelocityGradients();if(Z){e.limitVelocityGradients=[];for(var J=0,q=Z;J<q.length;J++){var $=q[J];c={gradient:$.gradient,factor1:$.factor1};void 0!==$.factor2&&(c.factor2=$.factor2),e.limitVelocityGradients.push(c)}e.limitVelocityDamping=t.limitVelocityDamping}t.noiseTexture&&(e.noiseTexture=t.noiseTexture.serialize())},t._Parse=function(e,t,r,n){if(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(),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=x._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=s.Color4.FromArray(e.color1),t.color2=s.Color4.FromArray(e.color2),t.colorDead=s.Color4.FromArray(e.colorDead),t.updateSpeed=e.updateSpeed,t.targetStopDuration=e.targetStopDuration,t.blendMode=e.blendMode,e.colorGradients)for(var c=0,l=e.colorGradients;c<l.length;c++){var u=l[c];t.addColorGradient(u.gradient,s.Color4.FromArray(u.color1),u.color2?s.Color4.FromArray(u.color2):void 0)}if(e.rampGradients){for(var h=0,d=e.rampGradients;h<d.length;h++){var p=d[h];t.addRampGradient(p.gradient,s.Color3.FromArray(p.color))}t.useRampGradients=e.useRampGradients}if(e.colorRemapGradients)for(var m=0,v=e.colorRemapGradients;m<v.length;m++){var A=v[m];t.addColorRemapGradient(A.gradient,void 0!==A.factor1?A.factor1:A.factor,A.factor2)}if(e.alphaRemapGradients)for(var y=0,b=e.alphaRemapGradients;y<b.length;y++){var T=b[y];t.addAlphaRemapGradient(T.gradient,void 0!==T.factor1?T.factor1:T.factor,T.factor2)}if(e.sizeGradients)for(var E=0,C=e.sizeGradients;E<C.length;E++){var P=C[E];t.addSizeGradient(P.gradient,void 0!==P.factor1?P.factor1:P.factor,P.factor2)}if(e.sizeGradients)for(var M=0,S=e.sizeGradients;M<S.length;M++){P=S[M];t.addSizeGradient(P.gradient,void 0!==P.factor1?P.factor1:P.factor,P.factor2)}if(e.angularSpeedGradients)for(var R=0,O=e.angularSpeedGradients;R<O.length;R++){var I=O[R];t.addAngularSpeedGradient(I.gradient,void 0!==I.factor1?I.factor1:I.factor,I.factor2)}if(e.velocityGradients)for(var D=0,w=e.velocityGradients;D<w.length;D++){var L=w[D];t.addVelocityGradient(L.gradient,void 0!==L.factor1?L.factor1:L.factor,L.factor2)}if(e.dragGradients)for(var B=0,F=e.dragGradients;B<F.length;B++){var N=F[B];t.addDragGradient(N.gradient,void 0!==N.factor1?N.factor1:N.factor,N.factor2)}if(e.emitRateGradients)for(var V=0,U=e.emitRateGradients;V<U.length;V++){var G=U[V];t.addEmitRateGradient(G.gradient,void 0!==G.factor1?G.factor1:G.factor,G.factor2)}if(e.startSizeGradients)for(var k=0,z=e.startSizeGradients;k<z.length;k++){var H=z[k];t.addStartSizeGradient(H.gradient,void 0!==H.factor1?H.factor1:H.factor,H.factor2)}if(e.lifeTimeGradients)for(var j=0,X=e.lifeTimeGradients;j<X.length;j++){var W=X[j];t.addLifeTimeGradient(W.gradient,void 0!==W.factor1?W.factor1:W.factor,W.factor2)}if(e.limitVelocityGradients){for(var Y=0,Q=e.limitVelocityGradients;Y<Q.length;Y++){var K=Q[Y];t.addLimitVelocityGradient(K.gradient,void 0!==K.factor1?K.factor1:K.factor,K.factor2)}t.limitVelocityDamping=e.limitVelocityDamping}var Z;if(e.noiseTexture&&(t.noiseTexture=g.ProceduralTexture.Parse(e.noiseTexture,r,n)),e.particleEmitterType){switch(e.particleEmitterType.type){case"SphereParticleEmitter":Z=new _.SphereParticleEmitter;break;case"SphereDirectedParticleEmitter":Z=new _.SphereDirectedParticleEmitter;break;case"ConeEmitter":case"ConeParticleEmitter":Z=new _.ConeParticleEmitter;break;case"CylinderParticleEmitter":Z=new _.CylinderParticleEmitter;break;case"HemisphericParticleEmitter":Z=new _.HemisphericParticleEmitter;break;case"BoxEmitter":case"BoxParticleEmitter":default:Z=new _.BoxParticleEmitter}Z.parse(e.particleEmitterType)}else(Z=new _.BoxParticleEmitter).parse(e);t.particleEmitterType=Z,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,a=null,c=null;if(e.customShader){var l=(c=e.customShader).shaderOptions.defines.length>0?c.shaderOptions.defines.join("\n"):"";a=r.getEngine().createEffectForParticles(c.shaderPath.fragmentElement,c.shaderOptions.uniforms,c.shaderOptions.samplers,l)}var u=new t(o,e.capacity,r,a,e.isAnimationSheetEnabled);if(u.customShader=c,e.id&&(u.id=e.id),e.subEmitters){u.subEmitters=[];for(var h=0,d=e.subEmitters;h<d.length;h++){for(var f=[],p=0,g=d[h];p<g.length;p++){var m=g[p];f.push(y.SubEmitter.Parse(m,r,n))}u.subEmitters.push(f)}}return t._Parse(e,u,r,n),u.textureMask=s.Color4.FromArray(e.textureMask),e.preventAutoStart&&(u.preventAutoStart=e.preventAutoStart),i||u.preventAutoStart||u.start(),u},t.BILLBOARDMODE_Y=b.Constants.PARTICLES_BILLBOARDMODE_Y,t.BILLBOARDMODE_ALL=b.Constants.PARTICLES_BILLBOARDMODE_ALL,t.BILLBOARDMODE_STRETCHED=b.Constants.PARTICLES_BILLBOARDMODE_STRETCHED,t}(v.BaseParticleSystem));y.SubEmitter._ParseParticleSystem=C.Parse},"./Particles/particleSystemComponent.ts":
- /*!**********************************************!*\
- !*** ./Particles/particleSystemComponent.ts ***!
- \**********************************************/
- /*! exports provided: _IDoNeedToBeInTheBuild */function(e,t,r){"use strict";r.r(t),r.d(t,"_IDoNeedToBeInTheBuild",function(){return l});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"),c=r(/*! ../sceneComponent */"./sceneComponent.ts");r(/*! ../Shaders/particles.vertex */"./Shaders/particles.vertex.ts");o.AbstractScene.AddParser(c.SceneComponentConstants.NAME_PARTICLESYSTEM,function(e,t,r,n){var i=o.AbstractScene.GetIndividualParser(c.SceneComponentConstants.NAME_PARTICLESYSTEM);if(i&&void 0!==e.particleSystems&&null!==e.particleSystems)for(var s=0,a=e.particleSystems.length;s<a;s++){var l=e.particleSystems[s];r.particleSystems.push(i(l,t,n))}}),o.AbstractScene.AddIndividualParser(c.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){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");var c=a.ParticleSystem._GetAttributeNamesOrOptions(),l=a.ParticleSystem._GetEffectCreationOptions();return-1===n.indexOf(" BILLBOARD")&&(n+="\n#define BILLBOARD\n"),-1===r.indexOf("diffuseSampler")&&r.push("diffuseSampler"),this.createEffect({vertex:"particles",fragmentElement:e},c,l.concat(t),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};var l=42},"./Particles/particleSystemSet.ts":
- /*!****************************************!*\
- !*** ./Particles/particleSystemSet.ts ***!
- \****************************************/
- /*! exports provided: ParticleSystemSet */function(e,t,r){"use strict";r.r(t),r.d(t,"ParticleSystemSet",function(){return u});var n=r(/*! ../Maths/math */"./Maths/math.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"),c=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),l=r(/*! ../Engines/constants */"./Engines/constants.ts"),u=(function(){}(),function(){function e(){this.systems=new Array}return Object.defineProperty(e.prototype,"emitterNode",{get:function(){return this._emitterNode},enumerable:!0,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 c.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(){for(var e={systems:[]},t=0,r=this.systems;t<r.length;t++){var n=r[t];e.systems.push(n.serialize())}return this._emitterNode&&(e.emitter=this._emitterCreationOptions),e},e.Parse=function(t,r,i){void 0===i&&(i=!1);var c=new e,u=l.Constants.PARTICLES_BaseAssetsUrl+"/textures/";r=r||s.EngineStore.LastCreatedScene;for(var h=0,d=t.systems;h<d.length;h++){var f=d[h];c.systems.push(i?o.GPUParticleSystem.Parse(f,r,u,!0):a.ParticleSystem.Parse(f,r,u,!0))}if(t.emitter){var p=t.emitter.options;switch(t.emitter.kind){case"Sphere":c.setEmitterAsSphere({diameter:p.diameter,segments:p.segments,color:n.Color3.FromArray(p.color)},t.emitter.renderingGroupId,r)}}return c},e}())},"./Particles/solidParticle.ts":
- /*!************************************!*\
- !*** ./Particles/solidParticle.ts ***!
- \************************************/
- /*! exports provided: SolidParticle, ModelShape, DepthSortedParticle */function(e,t,r){"use strict";r.r(t),r.d(t,"SolidParticle",function(){return a}),r.d(t,"ModelShape",function(){return c}),r.d(t,"DepthSortedParticle",function(){return l});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),o=r(/*! ../Culling/boundingSphere */"./Culling/boundingSphere.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=function(){function e(e,t,r,o,a,c,l,u){void 0===u&&(u=null),this.idx=0,this.color=new n.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.cullingStrategy=s.AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this._globalPosition=n.Vector3.Zero(),this.idx=e,this._pos=t,this._ind=r,this._model=o,this.shapeId=a,this.idxInShape=c,this._sps=l,u&&(this._modelBoundingInfo=u,this._boundingInfo=new i.BoundingInfo(u.minimum,u.maximum))}return Object.defineProperty(e.prototype,"scale",{get:function(){return this.scaling},set:function(e){this.scaling=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quaternion",{get:function(){return this.rotationQuaternion},set:function(e){this.rotationQuaternion=e},enumerable:!0,configurable:!0}),e.prototype.intersectsMesh=function(e){return!(!this._boundingInfo||!e._boundingInfo)&&(this._sps._bSphereOnly?o.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.Tmp.Quaternion[0];var r=this.rotation;n.Quaternion.RotationYawPitchRollToRef(r.y,r.x,r.z,t)}t.toRotationMatrix(e)},e}(),c=function(){return function(e,t,r,n,i,o){this._indicesLength=0,this.shapeID=e,this._shape=t,this._indicesLength=r,this._shapeUV=n,this._positionFunction=i,this._vertexFunction=o}}(),l=function(){return function(){this.ind=0,this.indicesLength=0,this.sqDistance=0}}()},"./Particles/solidParticleSystem.ts":
- /*!******************************************!*\
- !*** ./Particles/solidParticleSystem.ts ***!
- \******************************************/
- /*! exports provided: SolidParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"SolidParticleSystem",function(){return d});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),a=r(/*! ../Meshes/Builders/discBuilder */"./Meshes/Builders/discBuilder.ts"),c=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),l=r(/*! ./solidParticle */"./Particles/solidParticle.ts"),u=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),h=function(e,t){return t.sqDistance-e.sqDistance},d=function(){function e(e,t,r){this.particles=new Array,this.nbParticles=0,this.billboard=!1,this.recomputeNormals=!0,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._shapeCounter=0,this._copy=new l.SolidParticle(0,0,0,null,0,0,this),this._color=new n.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.name=e,this._scene=t||c.EngineStore.LastCreatedScene,this._camera=t.activeCamera,this._pickable=!!r&&r.isPickable,this._depthSort=!!r&&r.enableDepthSort,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.pickedParticles=[]),this._depthSort&&(this.depthSortedParticles=[])}return e.prototype.buildMesh=function(){if(0===this.nbParticles){var e=a.DiscBuilder.CreateDisc("",{radius:1,tessellation:3},this._scene);this.addShape(e,1),e.dispose()}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.recomputeNormals&&o.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 t=new o.VertexData;t.indices=this._depthSort?this._indices:this._indices32,t.set(this._positions32,i.VertexBuffer.PositionKind),t.set(this._normals32,i.VertexBuffer.NormalKind),this._uvs32.length>0&&t.set(this._uvs32,i.VertexBuffer.UVKind),this._colors32.length>0&&t.set(this._colors32,i.VertexBuffer.ColorKind);var r=new s.Mesh(this.name,this._scene);return t.applyToMesh(r,this._updatable),this.mesh=r,this.mesh.isPickable=this._pickable,this._depthSort||(this._indices=null),this._positions=null,this._normals=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0),r},e.prototype.digest=function(e,t){var r=t&&t.facetNb||1,o=t&&t.number||0,s=t&&t.delta||0,a=e.getVerticesData(i.VertexBuffer.PositionKind),c=e.getIndices(),h=e.getVerticesData(i.VertexBuffer.UVKind),d=e.getVerticesData(i.VertexBuffer.ColorKind),f=e.getVerticesData(i.VertexBuffer.NormalKind),p=0,g=c.length/3;o?(o=o>g?g:o,r=Math.round(g/o),s=0):r=r>g?g:r;for(var m=[],_=[],v=[],A=[],y=n.Vector3.Zero(),b=r;p<g;){p>g-(r=b+Math.floor((1+s)*Math.random()))&&(r=g-p),m.length=0,_.length=0,v.length=0,A.length=0;for(var T=0,E=3*p;E<3*(p+r);E++){_.push(T);var x=c[E];m.push(a[3*x],a[3*x+1],a[3*x+2]),h&&v.push(h[2*x],h[2*x+1]),d&&A.push(d[4*x],d[4*x+1],d[4*x+2],d[4*x+3]),T++}var C,P,M=this.nbParticles,S=this._posToShape(m),R=this._uvsToShapeUV(v);for(C=0;C<S.length;C++)y.addInPlace(S[C]);for(y.scaleInPlace(1/S.length),C=0;C<S.length;C++)S[C].subtractInPlace(y);this._particlesIntersect&&(P=new u.BoundingInfo(y,y));var O=new l.ModelShape(this._shapeCounter,S,3*r,R,null,null),I=this._positions.length,D=this._indices.length;this._meshBuilder(this._index,S,this._positions,_,this._indices,v,this._uvs,A,this._colors,f,this._normals,M,0,null),this._addParticle(M,I,D,O,this._shapeCounter,0,P),this.particles[this.nbParticles].position.addInPlace(y),this._index+=S.length,M++,this.nbParticles++,this._shapeCounter++,p+=r}return this},e.prototype._unrotateFixedNormals=function(){for(var e=0,t=0,r=n.Tmp.Vector3[0],i=n.Tmp.Quaternion[0],o=n.Tmp.Matrix[0],s=0;s<this.particles.length;s++){var a=this.particles[s],c=a._model._shape;if(a.rotationQuaternion)a.rotationQuaternion.conjugateToRef(i);else{var l=a.rotation;n.Quaternion.RotationYawPitchRollToRef(l.y,l.x,l.z,i),i.conjugateInPlace()}i.toRotationMatrix(o);for(var u=0;u<c.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.prototype._meshBuilder=function(e,t,r,i,o,s,a,c,u,h,d,f,p,g){var m,_=0,v=0,A=0;this._resetCopy();var y=this._copy;g&&g.positionFunction&&(g.positionFunction(y,f,p),this._mustUnrotateFixedNormals=!0);var b=n.Tmp.Matrix[0],T=n.Tmp.Vector3[0],E=n.Tmp.Vector3[1],x=n.Tmp.Vector3[2],C=n.Tmp.Vector3[3];for(y.getRotationMatrix(b),y.pivot.multiplyToRef(y.scaling,C),y.translateFromPivot?x.setAll(0):x.copyFrom(C),m=0;m<t.length;m++){if(T.copyFrom(t[m]),g&&g.vertexFunction&&g.vertexFunction(y,T,m),T.multiplyInPlace(y.scaling).subtractInPlace(C),n.Vector3.TransformCoordinatesToRef(T,b,E),E.addInPlace(x).addInPlace(y.position),r.push(E.x,E.y,E.z),s){var P=y.uvs;a.push((P.z-P.x)*s[_]+P.x,(P.w-P.y)*s[_+1]+P.y),_+=2}if(y.color)this._color=y.color;else{var M=this._color;c&&void 0!==c[v]?(M.r=c[v],M.g=c[v+1],M.b=c[v+2],M.a=c[v+3]):(M.r=1,M.g=1,M.b=1,M.a=1)}u.push(this._color.r,this._color.g,this._color.b,this._color.a),v+=4,!this.recomputeNormals&&h&&(T.x=h[A],T.y=h[A+1],T.z=h[A+2],n.Vector3.TransformNormalToRef(T,b,T),d.push(T.x,T.y,T.z),A+=3)}for(m=0;m<i.length;m++){var S=e+i[m];o.push(S),S>65535&&(this._needs32Bits=!0)}if(this._pickable){var R=i.length/3;for(m=0;m<R;m++)this.pickedParticles.push({idx:f,faceId:m})}return this._depthSort&&this.depthSortedParticles.push(new l.DepthSortedParticle),y},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){void 0===s&&(s=null);var a=new l.SolidParticle(e,t,r,n,i,o,this,s);return this.particles.push(a),a},e.prototype.addShape=function(e,t,r){var n,o=e.getVerticesData(i.VertexBuffer.PositionKind),s=e.getIndices(),a=e.getVerticesData(i.VertexBuffer.UVKind),c=e.getVerticesData(i.VertexBuffer.ColorKind),u=e.getVerticesData(i.VertexBuffer.NormalKind);this._particlesIntersect&&(n=e.getBoundingInfo());for(var h,d,f=this._posToShape(o),p=this._uvsToShapeUV(a),g=r?r.positionFunction:null,m=r?r.vertexFunction:null,_=new l.ModelShape(this._shapeCounter,f,s.length,p,g,m),v=this.nbParticles,A=0;A<t;A++){var y=this._positions.length,b=this._indices.length;d=this._meshBuilder(this._index,f,this._positions,s,this._indices,a,this._uvs,c,this._colors,u,this._normals,v,A,r),this._updatable&&((h=this._addParticle(v,y,b,_,this._shapeCounter,A,n)).position.copyFrom(d.position),h.rotation.copyFrom(d.rotation),d.rotationQuaternion&&h.rotationQuaternion&&h.rotationQuaternion.copyFrom(d.rotationQuaternion),d.color&&h.color&&h.color.copyFrom(d.color),h.scaling.copyFrom(d.scaling),h.uvs.copyFrom(d.uvs)),this._index+=f.length,v++}return this.nbParticles+=t,this._shapeCounter++,this._shapeCounter-1},e.prototype._rebuildParticle=function(e){this._resetCopy();var t=this._copy;e._model._positionFunction&&e._model._positionFunction(t,e.idx,e.idxInShape);var r=n.Tmp.Matrix[0],i=n.Tmp.Vector3[0],o=n.Tmp.Vector3[1],s=n.Tmp.Vector3[2],a=n.Tmp.Vector3[3];t.getRotationMatrix(r),e.pivot.multiplyToRef(e.scaling,a),t.translateFromPivot?s.copyFromFloats(0,0,0):s.copyFrom(a);for(var c=e._model._shape,l=0;l<c.length;l++)i.copyFrom(c[l]),e._model._vertexFunction&&e._model._vertexFunction(t,i,l),i.multiplyInPlace(t.scaling).subtractInPlace(a),n.Vector3.TransformCoordinatesToRef(i,r,o),o.addInPlace(s).addInPlace(t.position).toArray(this._positions32,e._pos+3*l);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(){for(var e=0;e<this.particles.length;e++)this._rebuildParticle(this.particles[e]);return this.mesh.updateVerticesData(i.VertexBuffer.PositionKind,this._positions32,!1,!1),this},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)return this;this.beforeUpdateParticles(e,t,r);var s=n.Tmp.Matrix[0],a=n.Tmp.Matrix[1],c=this.mesh,l=this._colors32,d=this._positions32,f=this._normals32,p=this._uvs32,g=this._indices32,m=this._indices,_=this._fixedNormal32,v=n.Tmp.Vector3,A=v[5].copyFromFloats(1,0,0),y=v[6].copyFromFloats(0,1,0),b=v[7].copyFromFloats(0,0,1),T=v[8].setAll(Number.MAX_VALUE),E=v[9].setAll(-Number.MAX_VALUE),x=v[10].setAll(0);if((this.billboard||this._depthSort)&&(this.mesh.computeWorldMatrix(!0),this.mesh._worldMatrix.invertToRef(a)),this.billboard){var C=v[0];this._camera.getDirectionToRef(n.Axis.Z,C),n.Vector3.TransformNormalToRef(C,a,b),b.normalize();var P=this._camera.getViewMatrix(!0);n.Vector3.TransformNormalFromFloatsToRef(P.m[1],P.m[5],P.m[9],a,y),n.Vector3.CrossToRef(y,b,A),y.normalize(),A.normalize()}this._depthSort&&n.Vector3.TransformCoordinatesToRef(this._camera.globalPosition,a,x),n.Matrix.IdentityToRef(s);var M=0,S=0,R=0,O=0,I=0,D=0,w=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 L=this.mesh._boundingInfo;L&&(T.copyFrom(L.minimum),E.copyFrom(L.maximum))}var B=(S=this.particles[e]._pos)/3|0;O=4*B,D=2*B;for(var F=e;F<=t;F++){var N=this.particles[F];this.updateParticle(N);var V=N._model._shape,U=N._model._shapeUV,G=N._rotationMatrix,k=N.position,z=N.rotation,H=N.scaling,j=N._globalPosition;if(this._depthSort&&this._depthSortParticles){var X=this.depthSortedParticles[F];X.ind=N._ind,X.indicesLength=N._model._indicesLength,X.sqDistance=n.Vector3.DistanceSquared(N.position,x)}if(!N.alive||N._stillInvisible&&!N.isVisible)S+=3*(w=V.length),O+=4*w,D+=2*w;else{if(N.isVisible){N._stillInvisible=!1;var W=v[12];if(N.pivot.multiplyToRef(H,W),this.billboard&&(z.x=0,z.y=0),(this._computeParticleRotation||this.billboard)&&N.getRotationMatrix(s),null!==N.parentId){var Y=this.particles[N.parentId],Q=Y._rotationMatrix,K=Y._globalPosition,Z=k.x*Q[1]+k.y*Q[4]+k.z*Q[7],J=k.x*Q[0]+k.y*Q[3]+k.z*Q[6],q=k.x*Q[2]+k.y*Q[5]+k.z*Q[8];if(j.x=K.x+J,j.y=K.y+Z,j.z=K.z+q,this._computeParticleRotation||this.billboard){var $=s.m;G[0]=$[0]*Q[0]+$[1]*Q[3]+$[2]*Q[6],G[1]=$[0]*Q[1]+$[1]*Q[4]+$[2]*Q[7],G[2]=$[0]*Q[2]+$[1]*Q[5]+$[2]*Q[8],G[3]=$[4]*Q[0]+$[5]*Q[3]+$[6]*Q[6],G[4]=$[4]*Q[1]+$[5]*Q[4]+$[6]*Q[7],G[5]=$[4]*Q[2]+$[5]*Q[5]+$[6]*Q[8],G[6]=$[8]*Q[0]+$[9]*Q[3]+$[10]*Q[6],G[7]=$[8]*Q[1]+$[9]*Q[4]+$[10]*Q[7],G[8]=$[8]*Q[2]+$[9]*Q[5]+$[10]*Q[8]}}else if(j.x=k.x,j.y=k.y,j.z=k.z,this._computeParticleRotation||this.billboard){$=s.m;G[0]=$[0],G[1]=$[1],G[2]=$[2],G[3]=$[4],G[4]=$[5],G[5]=$[6],G[6]=$[8],G[7]=$[9],G[8]=$[10]}var ee=v[11];for(N.translateFromPivot?ee.setAll(0):ee.copyFrom(W),w=0;w<V.length;w++){M=S+3*w,R=O+4*w,I=D+2*w,(C=v[0]).copyFrom(V[w]),this._computeParticleVertex&&this.updateParticleVertex(N,C,w);var te=C.x*H.x-W.x,re=C.y*H.y-W.y,ne=C.z*H.z-W.z;J=te*G[0]+re*G[3]+ne*G[6],Z=te*G[1]+re*G[4]+ne*G[7],q=te*G[2]+re*G[5]+ne*G[8];J+=ee.x,Z+=ee.y,q+=ee.z;var ie=d[M]=j.x+A.x*J+y.x*Z+b.x*q,oe=d[M+1]=j.y+A.y*J+y.y*Z+b.y*q,se=d[M+2]=j.z+A.z*J+y.z*Z+b.z*q;if(this._computeBoundingBox&&(T.minimizeInPlaceFromFloats(ie,oe,se),E.maximizeInPlaceFromFloats(ie,oe,se)),!this._computeParticleVertex){var ae=_[M],ce=_[M+1],le=_[M+2],ue=ae*G[0]+ce*G[3]+le*G[6],he=ae*G[1]+ce*G[4]+le*G[7],de=ae*G[2]+ce*G[5]+le*G[8];f[M]=A.x*ue+y.x*he+b.x*de,f[M+1]=A.y*ue+y.y*he+b.y*de,f[M+2]=A.z*ue+y.z*he+b.z*de}if(this._computeParticleColor&&N.color){var fe=N.color,pe=this._colors32;pe[R]=fe.r,pe[R+1]=fe.g,pe[R+2]=fe.b,pe[R+3]=fe.a}if(this._computeParticleTexture){var ge=N.uvs;p[I]=U[2*w]*(ge.z-ge.x)+ge.x,p[I+1]=U[2*w+1]*(ge.w-ge.y)+ge.y}}}else for(N._stillInvisible=!0,w=0;w<V.length;w++){if(R=O+4*w,I=D+2*w,d[M=S+3*w]=d[M+1]=d[M+2]=0,f[M]=f[M+1]=f[M+2]=0,this._computeParticleColor&&N.color){fe=N.color;l[R]=fe.r,l[R+1]=fe.g,l[R+2]=fe.b,l[R+3]=fe.a}if(this._computeParticleTexture){ge=N.uvs;p[I]=U[2*w]*(ge.z-ge.x)+ge.x,p[I+1]=U[2*w+1]*(ge.w-ge.y)+ge.y}}if(this._particlesIntersect){var me=N._boundingInfo,_e=me.boundingBox,ve=me.boundingSphere,Ae=N._modelBoundingInfo;if(!this._bSphereOnly){var ye=Ae.boundingBox.vectors,be=v[1],Te=v[2];be.setAll(Number.MAX_VALUE),Te.setAll(-Number.MAX_VALUE);for(var Ee=0;Ee<8;Ee++){var xe=ye[Ee].x*H.x,Ce=ye[Ee].y*H.y,Pe=ye[Ee].z*H.z,Me=(J=xe*G[0]+Ce*G[3]+Pe*G[6],Z=xe*G[1]+Ce*G[4]+Pe*G[7],q=xe*G[2]+Ce*G[5]+Pe*G[8],k.x+A.x*J+y.x*Z+b.x*q),Se=k.y+A.y*J+y.y*Z+b.y*q,Re=k.z+A.z*J+y.z*Z+b.z*q;be.minimizeInPlaceFromFloats(Me,Se,Re),Te.maximizeInPlaceFromFloats(Me,Se,Re)}_e.reConstruct(be,Te,c._worldMatrix)}var Oe=Ae.minimum.multiplyToRef(H,v[1]),Ie=Ae.maximum.multiplyToRef(H,v[2]),De=Ie.addToRef(Oe,v[3]).scaleInPlace(.5).addInPlace(j),we=Ie.subtractToRef(Oe,v[4]).scaleInPlace(.5*this._bSphereRadiusFactor),Le=De.subtractToRef(we,v[1]),Be=De.addToRef(we,v[2]);ve.reConstruct(Le,Be,c._worldMatrix)}S=M+3,O=R+4,D=I+2}}if(r){if(this._computeParticleColor&&c.updateVerticesData(i.VertexBuffer.ColorKind,l,!1,!1),this._computeParticleTexture&&c.updateVerticesData(i.VertexBuffer.UVKind,p,!1,!1),c.updateVerticesData(i.VertexBuffer.PositionKind,d,!1,!1),!c.areNormalsFrozen||c.isFacetDataEnabled){if(this._computeParticleVertex||c.isFacetDataEnabled){var Fe=c.isFacetDataEnabled?c.getFacetDataParameters():null;o.VertexData.ComputeNormals(d,g,f,Fe);for(var Ne=0;Ne<f.length;Ne++)_[Ne]=f[Ne]}c.areNormalsFrozen||c.updateVerticesData(i.VertexBuffer.NormalKind,f,!1,!1)}if(this._depthSort&&this._depthSortParticles){var Ve=this.depthSortedParticles;Ve.sort(h);for(var Ue=Ve.length,Ge=0,ke=0;ke<Ue;ke++){var ze=Ve[ke].indicesLength,He=Ve[ke].ind;for(Ne=0;Ne<ze;Ne++)g[Ge]=m[He+Ne],Ge++}c.updateIndices(g)}}return this._computeBoundingBox&&(c._boundingInfo?c._boundingInfo.reConstruct(T,E,c._worldMatrix):c._boundingInfo=new u.BoundingInfo(T,E,c._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._normals32=null,this._fixedNormal32=null,this._uvs32=null,this._colors32=null,this.pickedParticles=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 u.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisibilityBoxLocked",{get:function(){return this._isVisibilityBoxLocked},set:function(e){this._isVisibilityBoxLocked=e,this.mesh.getBoundingInfo().isLocked=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleRotation",{get:function(){return this._computeParticleRotation},set:function(e){this._computeParticleRotation=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleColor",{get:function(){return this._computeParticleColor},set:function(e){this._computeParticleColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleTexture",{get:function(){return this._computeParticleTexture},set:function(e){this._computeParticleTexture=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computeParticleVertex",{get:function(){return this._computeParticleVertex},set:function(e){this._computeParticleVertex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"computeBoundingBox",{get:function(){return this._computeBoundingBox},set:function(e){this._computeBoundingBox=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"depthSortParticles",{get:function(){return this._depthSortParticles},set:function(e){this._depthSortParticles=e},enumerable:!0,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 t},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 c});var n,i=r(/*! ../Maths/math */"./Maths/math.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 c=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.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/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 h});var n=r(/*! ../../Maths/math */"./Maths/math.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"),c=r(/*! ../../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),l=r(/*! ../../Meshes/Builders/shapeBuilder */"./Meshes/Builders/shapeBuilder.ts"),u=r(/*! ../../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),h=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Ammo);var r=this;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._tmpVector=new n.Vector3,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=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(){r._tmpContactCallbackResult=!0},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 c=0,l=a._onPhysicsCollideCallbacks;c<l.length;c++)for(var u=0,h=l[c].otherImpostors;u<h.length;u++){var d=h[u];(a.physicsBody.isActive()||d.physicsBody.isActive())&&this._isImpostorPairInContact(a,d)&&(a.onCollide({body:d.physicsBody}),d.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(),c=new Array,h=0;h<a;h++)r=(t=s.at(h).get_m_x()).x(),i=t.y(),o=t.z(),c.push(new n.Vector3(r,i,o));var d=e.object,f=e.getParam("shape");e._isFromLine?e.object=u.LinesBuilder.CreateLines("lines",{points:c,instance:d}):e.object=l.ShapeBuilder.ExtrudeShape("ext",{shape:f,path:c,instance:d})},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,l,u,h,d,f,p,g,m=n.length/3,_=e.physicsBody.get_m_nodes(),v=0;v<m;v++){var A;u=(l=(s=_.at(v)).get_m_x()).x(),h=l.y(),d=l.z()*t,f=(A=s.get_m_n()).x(),p=A.y(),g=A.z()*t,n[3*v]=u,n[3*v+1]=h,n[3*v+2]=d,i[3*v]=f,i[3*v+1]=p,i[3*v+2]=g}var y=new c.VertexData;y.positions=n,y.normals=i,y.uvs=r.getVerticesData(a.VertexBuffer.UVKind),y.colors=r.getVerticesData(a.VertexBuffer.ColorKind),r&&r.getIndices&&(y.indices=r.getIndices()),y.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 o=this._tmpAmmoVectorA,s=this._tmpAmmoVectorB;e.object&&e.object.getWorldMatrix&&(e.object.getWorldMatrix().invertToRef(this._tmpMatrix),n.Vector3.TransformCoordinatesToRef(r,this._tmpMatrix,this._tmpVector),r=this._tmpVector),o.setValue(r.x,r.y,r.z),s.setValue(t.x,t.y,t.z),e.physicsBody.applyImpulse(s,o)}},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 o=this._tmpAmmoVectorA,s=this._tmpAmmoVectorB;e.object&&e.object.getWorldMatrix&&(e.object.getWorldMatrix().invertToRef(this._tmpMatrix),n.Vector3.TransformCoordinatesToRef(r,this._tmpMatrix,this._tmpVector),r=this._tmpVector),o.setValue(r.x,r.y,r.z),s.setValue(t.x,t.y,t.z),e.physicsBody.applyForce(s,o)}},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")),Ammo.castObject(r,Ammo.btCollisionObject).getCollisionShape().setMargin(t.getParam("margin")),r.setActivationState(e.DISABLE_DEACTIVATION_FLAG),this.world.addSoftBody(r,1,-1),t.physicsBody=r,t._pluginData.toDispose.concat([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 Ammo.btVector3(0,0,0),s=new Ammo.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 Ammo.btDefaultMotionState(s),c=new Ammo.btRigidBodyConstructionInfo(n,a,r,i),l=new Ammo.btRigidBody(c);0===n&&(l.setCollisionFlags(l.getCollisionFlags()|e.KINEMATIC_FLAG),l.setActivationState(e.DISABLE_DEACTIVATION_FLAG)),t.type!=o.PhysicsImpostor.NoImpostor||r.getChildShape||l.setCollisionFlags(l.getCollisionFlags()|e.DISABLE_COLLISION_FLAG),this.world.addRigidBody(l),t.physicsBody=l,t._pluginData.toDispose.concat([l,c,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&&(this.world.removeRigidBody(e.physicsBody),e._pluginData.toDispose.forEach(function(e){t.bjsAMMO.destroy(e)}))},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 c=a.maxDistance;c&&(a.mainPivot=new n.Vector3(0,-c/2,0),a.connectedPivot=new n.Vector3(0,c/2,0)),o=new Ammo.btPoint2PointConstraint(t,r,new Ammo.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new Ammo.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 l=new Ammo.btVector3(a.mainAxis.x,a.mainAxis.y,a.mainAxis.z),u=new Ammo.btVector3(a.connectedAxis.x,a.connectedAxis.y,a.connectedAxis.z);o=new Ammo.btHingeConstraint(t,r,new Ammo.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new Ammo.btVector3(a.connectedPivot.x,a.connectedPivot.y,a.connectedPivot.z),l,u);break;case s.PhysicsJoint.BallAndSocketJoint:o=new Ammo.btPoint2PointConstraint(t,r,new Ammo.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new Ammo.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 Ammo.btPoint2PointConstraint(t,r,new Ammo.btVector3(a.mainPivot.x,a.mainPivot.y,a.mainPivot.z),new Ammo.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 c=r.getVerticesData(a.VertexBuffer.PositionKind);c||(c=[]),r.computeWorldMatrix(!1);for(var l=s.length/3,u=0;u<l;u++){for(var h=[],d=0;d<3;d++){var f,p=new n.Vector3(c[3*s[3*u+d]+0],c[3*s[3*u+d]+1],c[3*s[3*u+d]+2]);n.Matrix.ScalingToRef(r.scaling.x,r.scaling.y,r.scaling.z,this._tmpMatrix),p=n.Vector3.TransformCoordinates(p,this._tmpMatrix),(f=0==d?this._tmpAmmoVectorA:1==d?this._tmpAmmoVectorB:this._tmpAmmoVectorC).setValue(p.x,p.y,p.z),h.push(f)}e.addTriangle(h[0],h[1],h[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=[],l=[],u=0;u<i.length;u+=3){var h=new n.Vector3(i[u],i[u+1],i[u+2]),d=new n.Vector3(o[u],o[u+1],o[u+2]);h=n.Vector3.TransformCoordinates(h,t.getWorldMatrix()),d=n.Vector3.TransformNormal(d,t.getWorldMatrix()),s.push(h.x,h.y,h.z),l.push(d.x,d.y,d.z)}var f=new c.VertexData;return f.positions=s,f.normals=l,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 c.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 Ammo.btCompoundShape;for(var a=[],c=[],l=0;l<o.length;l+=3){var u=new n.Vector3(o[l],o[l+1],o[l+2]),h=new n.Vector3(s[l],s[l+1],s[l+2]);a.push(u.x,u.y,-u.z),c.push(h.x,h.y,-h.z)}var d=(new Ammo.btSoftBodyHelpers).CreateFromTriMesh(this.world.getWorldInfo(),a,t.getIndices(),r.length/3,!0),f=o.length/3,p=d.get_m_nodes();for(l=0;l<f;l++){var g;(g=p.at(l).get_m_n()).setX(c[3*l]),g.setY(c[3*l+1]),g.setZ(c[3*l+2])}return d}},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 Ammo.btCompoundShape;var s=i.length,a=Math.sqrt(s/3);e.segments=a;var c=a-1;return this._tmpAmmoVectorA.setValue(i[0],i[1],i[2]),this._tmpAmmoVectorB.setValue(i[3*c],i[3*c+1],i[3*c+2]),this._tmpAmmoVectorD.setValue(i[s-3],i[s-2],i[s-1]),this._tmpAmmoVectorC.setValue(i[s-3-3*c],i[s-2-3*c],i[s-1-3*c]),(new Ammo.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 Ammo.btCompoundShape;n.applyToMesh(e.object,!0),e._isFromLine=!0;if(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 Ammo.btCompoundShape;if(o.length%(3*a.length)!=0)return i.Logger.Warn("Path does not match extrusion"),new Ammo.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 c=e.getParam("fixedPoints");c=c>3?3:c;var l=(new Ammo.btSoftBodyHelpers).CreateRope(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,r-1,c);return l.get_m_cfg().set_collisions(17),l},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 c=r.getVerticesData(a.VertexBuffer.PositionKind);c||(c=[]),r.computeWorldMatrix(!1);for(var l=s.length/3,u=0;u<l;u++){for(var h=[],d=0;d<3;d++){var f,p=new n.Vector3(c[3*s[3*u+d]+0],c[3*s[3*u+d]+1],c[3*s[3*u+d]+2]);n.Matrix.ScalingToRef(r.scaling.x,r.scaling.y,r.scaling.z,this._tmpMatrix),p=n.Vector3.TransformCoordinates(p,this._tmpMatrix),(f=0==d?this._tmpAmmoVectorA:1==d?this._tmpAmmoVectorB:this._tmpAmmoVectorC).setValue(p.x,p.y,p.z),h.push(f)}e.addPoint(h[0],!0),e.addPoint(h[1],!0),e.addPoint(h[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,c=e.getObjectExtendSize();if(!t){var l=e.object.getChildMeshes?e.object.getChildMeshes(!0):[];s=new Ammo.btCompoundShape;var u=0;if(l.forEach(function(e){var t=e.getPhysicsImpostor();if(t){var i=r._createShape(t),o=e.parent.getWorldMatrix().clone(),a=new n.Vector3;o.decompose(a),r._tmpAmmoTransform.getOrigin().setValue(e.position.x*a.x,e.position.y*a.y,e.position.z*a.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 h=this._createShape(e,!0);h&&(this._tmpAmmoTransform.getOrigin().setValue(0,0,0),this._tmpAmmoQuaternion.setValue(0,0,0,1),this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion),s.addChildShape(this._tmpAmmoTransform,h))}return s}Ammo.destroy(s),s=null}switch(e.type){case o.PhysicsImpostor.SphereImpostor:s=new Ammo.btSphereShape(c.x/2);break;case o.PhysicsImpostor.CylinderImpostor:this._tmpAmmoVectorA.setValue(c.x/2,c.y/2,c.z/2),s=new Ammo.btCylinderShape(this._tmpAmmoVectorA);break;case o.PhysicsImpostor.PlaneImpostor:case o.PhysicsImpostor.BoxImpostor:this._tmpAmmoVectorA.setValue(c.x/2,c.y/2,c.z/2),s=new Ammo.btBoxShape(this._tmpAmmoVectorA);break;case o.PhysicsImpostor.MeshImpostor:if(0==e.getParam("mass")){var d=new Ammo.btTriangleMesh;e._pluginData.toDispose.concat([d]);var f=this._addMeshVerts(d,a,a);s=0==f?new Ammo.btCompoundShape:new Ammo.btBvhTriangleMeshShape(d);break}case o.PhysicsImpostor.ConvexHullImpostor:var p=new Ammo.btConvexHullShape;0==(f=this._addHullVerts(p,a,a))?(e._pluginData.toDispose.concat([p]),s=new Ammo.btCompoundShape):s=p;break;case o.PhysicsImpostor.NoImpostor:s=new Ammo.btSphereShape(c.x/2);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();return t?new n.Vector3(t.x(),t.y(),t.z()):null},e.prototype.getAngularVelocity=function(e){if(e.soft)var t=e.physicsBody.angularVelocity();else t=e.physicsBody.getAngularVelocity();return t?new n.Vector3(t.x(),t.y(),t.z()):null},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},e.prototype.getBodyFriction=function(e){return e._pluginData.friction},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},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:(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:(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:(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:(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(){Ammo.destroy(this.world),Ammo.destroy(this._solver),Ammo.destroy(this._overlappingPairCache),Ammo.destroy(this._dispatcher),Ammo.destroy(this._collisionConfiguration),Ammo.destroy(this._tmpAmmoVectorA),Ammo.destroy(this._tmpAmmoVectorB),Ammo.destroy(this._tmpAmmoVectorC),Ammo.destroy(this._tmpAmmoTransform),Ammo.destroy(this._tmpAmmoQuaternion),Ammo.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._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 */"./Maths/math.ts"),o=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),a=r(/*! ../../Physics/physicsJoint */"./Physics/physicsJoint.ts"),c=r(/*! ../../Physics/physicsEngine */"./Physics/physicsEngine.ts"),l=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._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 l.PhysicsRaycastResult):n.Logger.Error("CannonJS is not available. Please make sure you included the js file.")}return e.prototype.setGravity=function(e){this.world.gravity.copy(e)},e.prototype.setTimeStep=function(e){this._fixedTimeStep=e},e.prototype.getTimeStep=function(){return this._fixedTimeStep},e.prototype.executeStep=function(e){this.world.step(this._fixedTimeStep,this._useDeltaForWorldStep?e:0,3)},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(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){e.physicsBody[t].copy(r[t])}),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)if(a.parent!==e){var c=s.getAbsolutePosition().subtract(e.object.getAbsolutePosition()),l=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(c.x,c.y,c.z),new t.BJSCANNON.Quaternion(l.x,l.y,l.z,l.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),this.world.remove(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).copy(i.mainPivot):null,pivotB:i.connectedPivot?(new this.BJSCANNON.Vec3).copy(i.connectedPivot):null,axisA:i.mainAxis?(new this.BJSCANNON.Vec3).copy(i.mainAxis):null,axisB:i.connectedAxis?(new this.BJSCANNON.Vec3).copy(i.connectedAxis):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<c.PhysicsEngine.Epsilon?c.PhysicsEngine.Epsilon:e},e.prototype._createShape=function(e){var t,r=e.object,a=e.getObjectExtendSize();switch(e.type){case s.PhysicsImpostor.SphereImpostor:var c=a.x,l=a.y,u=a.z;t=new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(c),this._checkWithEpsilon(l),this._checkWithEpsilon(u))/2);break;case s.PhysicsImpostor.CylinderImpostor:var h=e.getParam("nativeOptions");h||(h={});var d=void 0!==h.radiusTop?h.radiusTop:this._checkWithEpsilon(a.x)/2,f=void 0!==h.radiusBottom?h.radiusBottom:this._checkWithEpsilon(a.x)/2,p=void 0!==h.height?h.height:this._checkWithEpsilon(a.y),g=void 0!==h.numSegments?h.numSegments:16;t=new this.BJSCANNON.Cylinder(d,f,p,g);var m=new this.BJSCANNON.Quaternion;m.setFromAxisAngle(new this.BJSCANNON.Vec3(1,0,0),-Math.PI/2);var _=new this.BJSCANNON.Vec3(0,0,0);t.transformAllPoints(_,m);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 A=r.getVerticesData?r.getVerticesData(o.VertexBuffer.PositionKind):[],y=r.getIndices?r.getIndices():[];if(!A)return;var b=r.position.clone(),T=r.rotation&&r.rotation.clone(),E=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 x,C=r.computeWorldMatrix(!0),P=new Array;for(x=0;x<A.length;x+=3)i.Vector3.TransformCoordinates(i.Vector3.FromArray(A,x),C).toArray(P,x);n.Logger.Warn("MeshImpostor only collides against spheres."),t=new this.BJSCANNON.Trimesh(P,y),r.position.copyFrom(b),T&&r.rotation&&r.rotation.copyFrom(T),E&&r.rotationQuaternion&&r.rotationQuaternion.copyFrom(E);break;case s.PhysicsImpostor.HeightmapImpostor:var M=r.position.clone(),S=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(M),S&&r.rotation&&r.rotation.copyFrom(S),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 c=new Array,l=t||~~(Math.sqrt(n.length/3)-1),u=e.getBoundingInfo(),h=Math.min(u.boundingBox.extendSizeWorld.x,u.boundingBox.extendSizeWorld.y),d=u.boundingBox.extendSizeWorld.z,f=2*h/l,p=0;p<n.length;p+=3){var g=Math.round(n[p+0]/f+l/2),m=Math.round(-1*(n[p+1]/f-l/2)),_=-n[p+2]+d;c[g]||(c[g]=[]),c[g][m]||(c[g][m]=_),c[g][m]=Math.max(_,c[g][m])}for(g=0;g<=l;++g){if(!c[g]){for(var v=1;!c[(g+v)%l];)v++;c[g]=c[(g+v)%l].slice()}for(m=0;m<=l;++m)if(!c[g][m]){var A;for(v=1;void 0===A;)A=c[g][(m+v++)%l];c[g][m]=A}}var y=new this.BJSCANNON.Heightfield(c,{elementSize:f});return y.minY=d,y},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(),c=o.rotationQuaternion;o.rotationQuaternion=this._tmpUnityRotation,o.computeWorldMatrix(!0);var l=r.clone(),u=o.getPivotMatrix();u=u?u.clone():i.Matrix.Identity();var h=i.Matrix.Translation(a.boundingBox.extendSizeWorld.x,0,-a.boundingBox.extendSizeWorld.z);o.setPreTransformMatrix(h),o.computeWorldMatrix(!0);var d=a.boundingBox.centerWorld.subtract(r).subtract(o.position).negate();this._tmpPosition.copyFromFloats(d.x,d.y-a.boundingBox.extendSizeWorld.y,d.z),this._tmpDeltaPosition.copyFrom(a.boundingBox.centerWorld.subtract(l)),this._tmpDeltaPosition.y+=a.boundingBox.extendSizeWorld.y,o.rotationQuaternion=c,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.copy(this._tmpPosition),e.physicsBody.quaternion.copy(n)}}},e.prototype.setTransformationFromPhysicsBody=function(e){e.object.position.copyFrom(e.physicsBody.position),e.object.rotationQuaternion&&e.object.rotationQuaternion.copyFrom(e.physicsBody.quaternion)},e.prototype.setPhysicsBodyTransformation=function(e,t,r){e.physicsBody.position.copy(t),e.physicsBody.quaternion.copy(r)},e.prototype.isSupported=function(){return void 0!==this.BJSCANNON},e.prototype.setLinearVelocity=function(e,t){e.physicsBody.velocity.copy(t)},e.prototype.setAngularVelocity=function(e,t){e.physicsBody.angularVelocity.copy(t)},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 c=this.time%r/r,l=e,u=this.bodies,h=0;h!==u.length;h++){var d=u[h];d.type!==t.Body.STATIC&&d.sleepState!==t.Body.SLEEPING?(d.position.vsub(d.previousPosition,l),l.scale(c,l),d.position.vadd(l,d.interpolatedPosition)):(d.interpolatedPosition.copy(d.position),d.interpolatedQuaternion.copy(d.quaternion))}}}},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}();c.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 l});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 */"./Maths/math.ts"),a=r(/*! ../../Misc/logger */"./Misc/logger.ts"),c=r(/*! ../physicsRaycastResult */"./Physics/physicsRaycastResult.ts"),l=function(){function e(e,t){void 0===t&&(t=OIMO),this.name="OimoJSPlugin",this._tmpImpostorsArray=[],this._tmpPositionVector=s.Vector3.Zero(),this.BJSOIMO=t,this.world=new this.BJSOIMO.World({iterations:e}),this.world.clear(),this._raycastResult=new c.PhysicsRaycastResult}return e.prototype.setGravity=function(e){this.world.gravity.copy(e)},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.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")||1,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 c=function(e){return Math.max(e,o.PhysicsEngine.Epsilon)},l=new s.Quaternion;i.forEach(function(i){if(i.object.rotationQuaternion){var o=i.object.rotationQuaternion;l=o.clone();var s=o.toEulerAngles(),u=i.getObjectExtendSize();if(i===e){var h=e.getObjectCenter();e.object.getAbsolutePivotPoint().subtractToRef(h,t._tmpPositionVector),t._tmpPositionVector.divideInPlace(e.object.scaling),r.pos.push(h.x),r.pos.push(h.y),r.pos.push(h.z),r.posShape.push(0,0,0),r.rotShape.push(0,0,0)}else{var d=i.object.getAbsolutePosition().subtract(e.object.getAbsolutePosition());r.posShape.push(d.x),r.posShape.push(d.y),r.posShape.push(d.z),r.pos.push(0,0,0),r.rotShape.push(57.29577951308232*s.x),r.rotShape.push(57.29577951308232*s.y),r.rotShape.push(57.29577951308232*s.z)}switch(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,g=u.z,m=Math.max(c(f),c(p),c(g))/2;r.type.push("sphere"),r.size.push(m),r.size.push(m),r.size.push(m);break;case n.PhysicsImpostor.CylinderImpostor:var _=c(u.x)/2,v=c(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:_=c(u.x),v=c(u.y);var A=c(u.z);r.type.push("box"),r.size.push(_),r.size.push(v),r.size.push(A)}i.object.rotationQuaternion=o}}),e.physicsBody=this.world.add(r),e.physicsBody.resetQuaternion(l),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||{},c={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 l=o;c.min=l.length||c.min,c.max=Math.max(c.min,c.max);case i.PhysicsJoint.DistanceJoint:n="jointDistance",c.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"}c.type=n,e.joint.physicsJoint=this.world.add(c)}},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){e.physicsBody.sleeping||(e.object.position.copyFrom(e.physicsBody.getPosition()),e.object.rotationQuaternion&&e.object.rotationQuaternion.copyFrom(e.physicsBody.getQuaternion()))},e.prototype.setPhysicsBodyTransformation=function(e,t,r){var n=e.physicsBody;n.position.copy(t),n.orientation.copy(r),n.syncShapes(),n.awake()},e.prototype.setLinearVelocity=function(e,t){e.physicsBody.linearVelocity.copy(t)},e.prototype.setAngularVelocity=function(e,t){e.physicsBody.angularVelocity.copy(t)},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 ***!
- \**************************/
- /*! exports provided: PhysicsEngine, PhysicsEngineSceneComponent, PhysicsHelper, PhysicsRadialExplosionEventOptions, PhysicsUpdraftEventOptions, PhysicsVortexEventOptions, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode, PhysicsImpostor, PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./physicsEngine */"./Physics/physicsEngine.ts");r.d(t,"PhysicsEngine",function(){return n.PhysicsEngine});var i=r(/*! ./physicsEngineComponent */"./Physics/physicsEngineComponent.ts");r.d(t,"PhysicsEngineSceneComponent",function(){return i.PhysicsEngineSceneComponent});var o=r(/*! ./physicsHelper */"./Physics/physicsHelper.ts");r.d(t,"PhysicsHelper",function(){return o.PhysicsHelper}),r.d(t,"PhysicsRadialExplosionEventOptions",function(){return o.PhysicsRadialExplosionEventOptions}),r.d(t,"PhysicsUpdraftEventOptions",function(){return o.PhysicsUpdraftEventOptions}),r.d(t,"PhysicsVortexEventOptions",function(){return o.PhysicsVortexEventOptions}),r.d(t,"PhysicsRadialImpulseFalloff",function(){return o.PhysicsRadialImpulseFalloff}),r.d(t,"PhysicsUpdraftMode",function(){return o.PhysicsUpdraftMode});var s=r(/*! ./physicsImpostor */"./Physics/physicsImpostor.ts");r.d(t,"PhysicsImpostor",function(){return s.PhysicsImpostor});var a=r(/*! ./physicsJoint */"./Physics/physicsJoint.ts");r.d(t,"PhysicsJoint",function(){return a.PhysicsJoint}),r.d(t,"DistanceJoint",function(){return a.DistanceJoint}),r.d(t,"MotorEnabledJoint",function(){return a.MotorEnabledJoint}),r.d(t,"HingeJoint",function(){return a.HingeJoint}),r.d(t,"Hinge2Joint",function(){return a.Hinge2Joint});var c=r(/*! ./Plugins/index */"./Physics/Plugins/index.ts");r.d(t,"CannonJSPlugin",function(){return c.CannonJSPlugin}),r.d(t,"AmmoJSPlugin",function(){return c.AmmoJSPlugin}),r.d(t,"OimoJSPlugin",function(){return c.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 */"./Maths/math.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._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.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);if(t>-1){var r=this._impostors.splice(t,1);r.length&&(r[0].physicsBody=null)}},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"),c=r(/*! ./physicsEngine */"./Physics/physicsEngine.ts"),l=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 c.PhysicsEngine(e,t),!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){this._physicsEngine&&(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,l.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 h}),r.d(t,"PhysicsRadialExplosionEventOptions",function(){return m}),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 */"./Maths/math.ts"),c=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),l=r(/*! ../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),u=r(/*! ../Culling/ray */"./Culling/ray.ts"),h=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 m).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var o=new d(this._scene,t);return i.forEach(function(t){var r=o.getImpostorForceAndContactPoint(t,e);r&&t.applyImpulse(r.force,r.contactPoint)}),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 m).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var o=new d(this._scene,t);return i.forEach(function(t){var r=o.getImpostorForceAndContactPoint(t,e);r&&t.applyForce(r.force,r.contactPoint)}),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 m).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 g(this._scene,e,t);return i.dispose(!1),i},e}(),d=function(){function e(e,t){this._scene=e,this._options=t,this._dataFetched=!1,this._options=o.__assign({},new m,this._options)}return e.prototype.getData=function(){return this._dataFetched=!0,{sphere:this._sphere}},e.prototype.getImpostorForceAndContactPoint=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}},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=c.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=o.__assign({},new m,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=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.getImpostorForceAndContactPoint=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=-1*this._options.strength;return{force:r.multiplyByFloats(n,n,n),contactPoint:t}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var r=e.getImpostorForceAndContactPoint(t);r&&t.applyForce(r.force,r.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=l.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}(),g=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=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.getImpostorForceAndContactPoint=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,c=o.normalize();if(s>this._options.centripetalForceThreshold&&(c=c.negate()),s>this._options.centripetalForceThreshold)var l=c.x*this._options.centripetalForceMultiplier,h=c.y*this._options.updraftForceMultiplier,d=c.z*this._options.centripetalForceMultiplier;else{var f=a.Vector3.Cross(r,t).normalize();l=(f.x+c.x)*this._options.centrifugalForceMultiplier,h=this._originTop.y*this._options.updraftForceMultiplier,d=(f.z+c.z)*this._options.centrifugalForceMultiplier}var p=new a.Vector3(l,h,d);return{force:p=p.multiplyByFloats(this._options.strength,this._options.strength,this._options.strength),contactPoint:t}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var r=e.getImpostorForceAndContactPoint(t);r&&t.applyForce(r.force,r.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=l.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}(),m=function(){return function(){this.radius=5,this.strength=10,this.falloff=n.Constant,this.sphere={segments:32,diameter:1}}}(),_=function(){return function(){this.radius=5,this.strength=10,this.height=10,this.updraftMode=i.Center}}(),v=function(){return 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 l});var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ./physicsJoint */"./Physics/physicsJoint.ts");a.Mesh._PhysicsImpostorParser=function(e,t,r){return new l(t,r.physicsImpostor,{mass:r.physicsMass,friction:r.physicsFriction,restitution:r.physicsRestitution},e)};var l=function(){function e(e,t,r,i){void 0===r&&(r={mass:0});var s=this;this.object=e,this.type=t,this._options=r,this._scene=i,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._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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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 c.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,s){var a=e._tmpVecs[0],c=this.object;if(c.rotationQuaternion)if(s){var l=e._tmpQuat;c.rotationQuaternion.multiplyToRef(s,l),t.setRotationQuaternion(l,o.Space.WORLD,r)}else t.setRotationQuaternion(c.rotationQuaternion,o.Space.WORLD,r);a.x=0,a.y=0,a.z=0,n&&(a.x=n.x,a.y=n.y,a.z=n.z,t.getDirectionToRef(a,r,a),null==i&&(i=n.length()),a.x*=i,a.y*=i,a.z*=i),t.getParent()?(a.addInPlace(c.getAbsolutePosition()),t.setAbsolutePosition(a,r)):(r.setAbsolutePosition(c.getAbsolutePosition()),r.position.x-=a.x,r.position.y-=a.y,r.position.z-=a.z)},e.prototype.syncImpostorWithBone=function(t,r,n,i,s,a){var c=this.object;if(c.rotationQuaternion)if(s){var l=e._tmpQuat;t.getRotationQuaternionToRef(o.Space.WORLD,r,l),l.multiplyToRef(s,c.rotationQuaternion)}else t.getRotationQuaternionToRef(o.Space.WORLD,r,c.rotationQuaternion);var u=e._tmpVecs[0],h=e._tmpVecs[1];a||((a=e._tmpVecs[2]).x=0,a.y=1,a.z=0),t.getDirectionToRef(a,r,h),t.getAbsolutePositionToRef(r,u),null==i&&n&&(i=n.length()),null!=i&&(u.x+=h.x*i,u.y+=h.y*i,u.z+=h.z*i),c.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.CylinderImpostor=7,e.ParticleImpostor=8,e.HeightmapImpostor=9,e.ConvexHullImpostor=10,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 c});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:!0,configurable:!0}),Object.defineProperty(e.prototype,"physicsPlugin",{set:function(e){this._physicsPlugin=e},enumerable:!0,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 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 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 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),c=function(e){function t(t){return e.call(this,i.Hinge2Joint,t)||this}return 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 */"./Maths/math.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"hitDistance",{get:function(){return this._hitDistance},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hitNormalWorld",{get:function(){return this._hitNormalWorld},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hitPointWorld",{get:function(){return this._hitPointWorld},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rayFromWorld",{get:function(){return this._rayFromWorld},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rayToWorld",{get:function(){return this._rayToWorld},enumerable:!0,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 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(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),c=r(/*! ../../../Layers/glowLayer */"./Layers/glowLayer.ts"),l=r(/*! ../../../PostProcesses/sharpenPostProcess */"./PostProcesses/sharpenPostProcess.ts"),u=r(/*! ../../../PostProcesses/imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts"),h=r(/*! ../../../PostProcesses/chromaticAberrationPostProcess */"./PostProcesses/chromaticAberrationPostProcess.ts"),d=r(/*! ../../../PostProcesses/grainPostProcess */"./PostProcesses/grainPostProcess.ts"),f=r(/*! ../../../PostProcesses/fxaaPostProcess */"./PostProcesses/fxaaPostProcess.ts"),p=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),g=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),m=r(/*! ../../../PostProcesses/depthOfFieldEffect */"./PostProcesses/depthOfFieldEffect.ts"),_=r(/*! ../../../PostProcesses/bloomEffect */"./PostProcesses/bloomEffect.ts"),v=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),A=r(/*! ../../../Engines/engineStore */"./Engines/engineStore.ts"),y=(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=A.EngineStore.LastCreatedScene),void 0===o&&(o=!0);var c=e.call(this,n.getEngine(),t)||this;c._camerasToBeAttached=[],c.SharpenPostProcessId="SharpenPostProcessEffect",c.ImageProcessingPostProcessId="ImageProcessingPostProcessEffect",c.FxaaPostProcessId="FxaaPostProcessEffect",c.ChromaticAberrationPostProcessId="ChromaticAberrationPostProcessEffect",c.GrainPostProcessId="GrainPostProcessEffect",c._glowLayer=null,c.animations=[],c._imageProcessingConfigurationObserver=null,c._sharpenEnabled=!1,c._bloomEnabled=!1,c._depthOfFieldEnabled=!1,c._depthOfFieldBlurLevel=m.DepthOfFieldEffectBlurLevel.Low,c._fxaaEnabled=!1,c._imageProcessingEnabled=!0,c._bloomScale=.5,c._chromaticAberrationEnabled=!1,c._grainEnabled=!1,c._buildAllowed=!0,c._resizeObserver=null,c._hardwareScaleLevel=1,c._bloomKernel=64,c._bloomWeight=.15,c._bloomThreshold=.9,c._samples=1,c._hasCleared=!1,c._prevPostProcess=null,c._prevPrevPostProcess=null,c._depthOfFieldSceneObserver=null,c._cameras=i||n.cameras,c._cameras=c._cameras.slice(),c._camerasToBeAttached=c._cameras.slice(),c._buildAllowed=o,c._scene=n;var u=c._scene.getEngine().getCaps();c._hdr=r&&(u.textureHalfFloatRender||u.textureFloatRender),c._hdr?u.textureHalfFloatRender?c._defaultPipelineTextureType=a.Constants.TEXTURETYPE_HALF_FLOAT:u.textureFloatRender&&(c._defaultPipelineTextureType=a.Constants.TEXTURETYPE_FLOAT):c._defaultPipelineTextureType=a.Constants.TEXTURETYPE_UNSIGNED_INT,n.postProcessRenderPipelineManager.addPipeline(c);var f=c._scene.getEngine();return c.sharpen=new l.SharpenPostProcess("sharpen",1,null,s.Texture.BILINEAR_SAMPLINGMODE,f,!1,c._defaultPipelineTextureType,!0),c._sharpenEffect=new g.PostProcessRenderEffect(f,c.SharpenPostProcessId,function(){return c.sharpen},!0),c.depthOfField=new m.DepthOfFieldEffect(c._scene,null,c._depthOfFieldBlurLevel,c._defaultPipelineTextureType,!0),c.bloom=new _.BloomEffect(c._scene,c._bloomScale,c._bloomWeight,c.bloomKernel,c._defaultPipelineTextureType,!0),c.chromaticAberration=new h.ChromaticAberrationPostProcess("ChromaticAberration",f.getRenderWidth(),f.getRenderHeight(),1,null,s.Texture.BILINEAR_SAMPLINGMODE,f,!1,c._defaultPipelineTextureType,!0),c._chromaticAberrationEffect=new g.PostProcessRenderEffect(f,c.ChromaticAberrationPostProcessId,function(){return c.chromaticAberration},!0),c.grain=new d.GrainPostProcess("Grain",1,null,s.Texture.BILINEAR_SAMPLINGMODE,f,!1,c._defaultPipelineTextureType,!0),c._grainEffect=new g.PostProcessRenderEffect(f,c.GrainPostProcessId,function(){return c.grain},!0),c._resizeObserver=f.onResizeObservable.add(function(){c._hardwareScaleLevel=f.getHardwareScalingLevel(),c.bloomKernel=c.bloomKernel}),c._imageProcessingConfigurationObserver=c._scene.imageProcessingConfiguration.onUpdateParameters.add(function(){c.bloom._downscale._exposure=c._scene.imageProcessingConfiguration.exposure}),c._buildPipeline(),c}return n.__extends(t,e),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sharpenEnabled",{get:function(){return this._sharpenEnabled},set:function(e){this._sharpenEnabled!==e&&(this._sharpenEnabled=e,this._buildPipeline())},enumerable:!0,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:!0,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:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"bloomEnabled",{get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())},enumerable:!0,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:!0,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 m.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:!0,configurable:!0}),Object.defineProperty(t.prototype,"fxaaEnabled",{get:function(){return this._fxaaEnabled},set:function(e){this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingEnabled",{get:function(){return this._imageProcessingEnabled},set:function(e){this._imageProcessingEnabled!==e&&(this._imageProcessingEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"glowLayerEnabled",{get:function(){return null!=this._glowLayer},set:function(e){e&&!this._glowLayer?this._glowLayer=new c.GlowLayer("",this._scene):!e&&this._glowLayer&&(this._glowLayer.dispose(),this._glowLayer=null)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chromaticAberrationEnabled",{get:function(){return this._chromaticAberrationEnabled},set:function(e){this._chromaticAberrationEnabled!==e&&(this._chromaticAberrationEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"grainEnabled",{get:function(){return this._grainEnabled},set:function(e){this._grainEnabled!==e&&(this._grainEnabled=e,this._buildPipeline())},enumerable:!0,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 g.PostProcessRenderEffect(t,this.ImageProcessingPostProcessId,function(){return e.imageProcessing},!0)),this._setAutoClearAndTextureSharing(this.imageProcessing)):this._scene.imageProcessingConfiguration.applyByPostProcess=!1),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 g.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._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)},n.__decorate([Object(i.serialize)()],t.prototype,"sharpenEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"bloomKernel",null),n.__decorate([Object(i.serialize)()],t.prototype,"_bloomWeight",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_bloomThreshold",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_hdr",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"bloomWeight",null),n.__decorate([Object(i.serialize)()],t.prototype,"bloomThreshold",null),n.__decorate([Object(i.serialize)()],t.prototype,"bloomScale",null),n.__decorate([Object(i.serialize)()],t.prototype,"bloomEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"depthOfFieldEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"depthOfFieldBlurLevel",null),n.__decorate([Object(i.serialize)()],t.prototype,"fxaaEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"samples",null),n.__decorate([Object(i.serialize)()],t.prototype,"imageProcessingEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"glowLayerEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"chromaticAberrationEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"grainEnabled",null),t}(p.PostProcessRenderPipeline));v._TypeStore.RegisteredTypes["BABYLON.DefaultRenderingPipeline"]=y},"./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 l});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"),c=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),l=(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 c.PostProcessRenderEffect(n.getEngine(),s.LensChromaticAberrationEffect,function(){return s._chromaticAberrationPostProcess},!0)),s.addEffect(new c.PostProcessRenderEffect(n.getEngine(),s.HighlightsEnhancingEffect,function(){return s._highlightsPostProcess},!0)),s.addEffect(new c.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 n.__extends(t,e),t.prototype.getClassName=function(){return"LensRenderingPipeline"},Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"edgeBlur",{get:function(){return this._edgeBlur},set:function(e){this.setEdgeBlur(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"grainAmount",{get:function(){return this._grainAmount},set:function(e){this.setGrainAmount(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chromaticAberration",{get:function(){return this._chromaticAberration},set:function(e){this.setChromaticAberration(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dofAperture",{get:function(){return this._dofAperture},set:function(e){this.setAperture(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"edgeDistortion",{get:function(){return this._distortion},set:function(e){this.setEdgeDistortion(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dofDistortion",{get:function(){return this._dofDistance},set:function(e){this.setFocusDistance(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"darkenOutOfFocus",{get:function(){return this._dofDarken},set:function(e){this.setDarkenOutOfFocus(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurNoise",{get:function(){return this._blurNoise},set:function(e){this._blurNoise=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pentagonBokeh",{get:function(){return this._pentagonBokehIsEnabled},set:function(e){e?this.enablePentagonBokeh():this.disablePentagonBokeh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"highlightsGain",{get:function(){return this._highlightsGain},set:function(e){this.setHighlightsGain(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"highlightsThreshold",{get:function(){return this._highlightsThreshold},set:function(e){this.setHighlightsThreshold(e)},enumerable:!0,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 */"./Maths/math.ts"),a=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ../../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),l=r(/*! ../../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),u=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),h=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),d=r(/*! ../../../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),f=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),p=r(/*! ../../../Engines/engineStore */"./Engines/engineStore.ts"),g=(r(/*! ../../../Shaders/ssao2.fragment */"./Shaders/ssao2.fragment.ts"),r(/*! ../../../Shaders/ssaoCombine.fragment */"./Shaders/ssaoCombine.fragment.ts"),function(e){function t(t,r,n,o){var s=e.call(this,r.getEngine(),t)||this;if(s.SSAOOriginalSceneColorEffect="SSAOOriginalSceneColorEffect",s.SSAORenderEffect="SSAORenderEffect",s.SSAOBlurHRenderEffect="SSAOBlurHRenderEffect",s.SSAOBlurVRenderEffect="SSAOBlurVRenderEffect",s.SSAOCombineRenderEffect="SSAOCombineRenderEffect",s.totalStrength=1,s.maxZ=100,s.minZAspect=.2,s._samples=8,s._textureSamples=1,s._expensiveBlur=!0,s.radius=2,s.base=0,s._firstUpdate=!0,s._bits=new Uint32Array(1),s._scene=r,s._ratio=n,!s.isSupported)return i.Logger.Error("SSAO 2 needs WebGL 2 support."),s;var c=s._ratio.ssaoRatio||n,l=s._ratio.blurRatio||n,u=r.enableGeometryBufferRenderer();return s._createRandomTexture(),s._depthTexture=u.getGBuffer().textures[0],s._normalTexture=u.getGBuffer().textures[1],s._originalColorPostProcess=new d.PassPostProcess("SSAOOriginalSceneColor",1,null,a.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1),s._originalColorPostProcess.samples=s.textureSamples,s._createSSAOPostProcess(1),s._createBlurPostProcess(c,l),s._createSSAOCombinePostProcess(l),s.addEffect(new h.PostProcessRenderEffect(r.getEngine(),s.SSAOOriginalSceneColorEffect,function(){return s._originalColorPostProcess},!0)),s.addEffect(new h.PostProcessRenderEffect(r.getEngine(),s.SSAORenderEffect,function(){return s._ssaoPostProcess},!0)),s.addEffect(new h.PostProcessRenderEffect(r.getEngine(),s.SSAOBlurHRenderEffect,function(){return s._blurHPostProcess},!0)),s.addEffect(new h.PostProcessRenderEffect(r.getEngine(),s.SSAOBlurVRenderEffect,function(){return s._blurVPostProcess},!0)),s.addEffect(new h.PostProcessRenderEffect(r.getEngine(),s.SSAOCombineRenderEffect,function(){return s._ssaoCombinePostProcess},!0)),r.postProcessRenderPipelineManager.addPipeline(s),o&&r.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,o),s}return n.__extends(t,e),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._ssaoPostProcess.updateEffect("#define SAMPLES "+e+"\n#define SSAO"),this._samples=e,this._sampleSphere=this._generateHemisphere(),this._firstUpdate=!0},enumerable:!0,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:!0,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","depthSampler"]),this._blurVPostProcess.updateEffect("#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE "+(e?"1":"0")+"\n",null,["textureSampler","depthSampler"]),this._expensiveBlur=e,this._firstUpdate=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IsSupported",{get:function(){var e=p.EngineStore.LastCreatedEngine;return!!e&&e.getCaps().drawBuffersExtension},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!0,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 l.PostProcess("BlurH","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthSampler"],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),e.setTexture("depthSampler",r._depthTexture),r._firstUpdate&&e.setArray("samplerOffsets",r._samplerOffsets))},this._blurVPostProcess=new l.PostProcess("BlurV","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthSampler"],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),e.setTexture("depthSampler",r._depthTexture),r._firstUpdate&&(e.setArray("samplerOffsets",r._samplerOffsets),r._firstUpdate=!1))},this._blurHPostProcess.samples=this.textureSamples,this._blurVPostProcess.samples=this.textureSamples},t.prototype._rebuild=function(){this._firstUpdate=!0,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._createSSAOPostProcess=function(e){var t=this,r=this.samples;this._sampleSphere=this._generateHemisphere(),this._ssaoPostProcess=new l.PostProcess("ssao2","ssao2",["sampleSphere","samplesFactor","randTextureTiles","totalStrength","radius","base","range","projection","near","far","texelSize","xViewport","yViewport","maxZ","minZAspect"],["randomSampler","normalSampler"],e,null,a.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define SAMPLES "+r+"\n#define SSAO"),this._ssaoPostProcess.onApply=function(e){t._firstUpdate&&(e.setArray3("sampleSphere",t._sampleSphere),e.setFloat("randTextureTiles",32)),t._scene.activeCamera&&(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()),e.setTexture("textureSampler",t._depthTexture),e.setTexture("normalSampler",t._normalTexture),e.setTexture("randomSampler",t._randomTexture))},this._ssaoPostProcess.samples=this.textureSamples},t.prototype._createSSAOCombinePostProcess=function(e){var t=this;this._ssaoCombinePostProcess=new l.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.Tmp.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 c.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)},n.__decorate([Object(o.serialize)()],t.prototype,"totalStrength",void 0),n.__decorate([Object(o.serialize)()],t.prototype,"maxZ",void 0),n.__decorate([Object(o.serialize)()],t.prototype,"minZAspect",void 0),n.__decorate([Object(o.serialize)("samples")],t.prototype,"_samples",void 0),n.__decorate([Object(o.serialize)("textureSamples")],t.prototype,"_textureSamples",void 0),n.__decorate([Object(o.serialize)()],t.prototype,"_ratio",void 0),n.__decorate([Object(o.serialize)("expensiveBlur")],t.prototype,"_expensiveBlur",void 0),n.__decorate([Object(o.serialize)()],t.prototype,"radius",void 0),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 */"./Maths/math.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"),c=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),l=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),u=r(/*! ../../../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),h=r(/*! ../../../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),d=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),f=r(/*! ../../../Misc/decorators */"./Misc/decorators.ts"),p=(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,c=n.combineRatio||n;return s._originalColorPostProcess=new u.PassPostProcess("SSAOOriginalSceneColor",c,null,o.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1),s._createSSAOPostProcess(a),s._createBlurPostProcess(a),s._createSSAOCombinePostProcess(c),s.addEffect(new l.PostProcessRenderEffect(r.getEngine(),s.SSAOOriginalSceneColorEffect,function(){return s._originalColorPostProcess},!0)),s.addEffect(new l.PostProcessRenderEffect(r.getEngine(),s.SSAORenderEffect,function(){return s._ssaoPostProcess},!0)),s.addEffect(new l.PostProcessRenderEffect(r.getEngine(),s.SSAOBlurHRenderEffect,function(){return s._blurHPostProcess},!0)),s.addEffect(new l.PostProcessRenderEffect(r.getEngine(),s.SSAOBlurVRenderEffect,function(){return s._blurVPostProcess},!0)),s.addEffect(new l.PostProcessRenderEffect(r.getEngine(),s.SSAOCombineRenderEffect,function(){return s._ssaoCombinePostProcess},!0)),r.postProcessRenderPipelineManager.addPipeline(s),i&&r.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(t,i),s}return n.__extends(t,e),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},enumerable:!0,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 h.BlurPostProcess("BlurH",new i.Vector2(1,0),16,e,null,o.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,d.Constants.TEXTURETYPE_UNSIGNED_INT),this._blurVPostProcess=new h.BlurPostProcess("BlurV",new i.Vector2(0,1),16,e,null,o.Texture.BILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,d.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.Tmp.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)},n.__decorate([Object(f.serialize)()],t.prototype,"totalStrength",void 0),n.__decorate([Object(f.serialize)()],t.prototype,"radius",void 0),n.__decorate([Object(f.serialize)()],t.prototype,"area",void 0),n.__decorate([Object(f.serialize)()],t.prototype,"fallOff",void 0),n.__decorate([Object(f.serialize)()],t.prototype,"base",void 0),t}(c.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 m});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 */"./Maths/math.ts"),a=r(/*! ../../../Maths/math.scalar */"./Maths/math.scalar.ts"),c=r(/*! ../../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../../../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),u=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */"./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts"),h=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),d=r(/*! ../../../PostProcesses/blurPostProcess */"./PostProcesses/blurPostProcess.ts"),f=r(/*! ../../../PostProcesses/fxaaPostProcess */"./PostProcesses/fxaaPostProcess.ts"),p=r(/*! ../../../Engines/constants */"./Engines/constants.ts"),g=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),m=(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.brightThreshold=1,s.blurWidth=512,s.horizontalBlur=!1,s.exposure=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.lensStarTexture=null,s.lensFlareDirtTexture=null,s.depthOfFieldDistance=10,s.depthOfFieldBlurWidth=64,s.motionStrength=1,s.animations=[],s._currentDepthOfFieldSource=null,s._hdrCurrentLuminance=1,s._bloomEnabled=!1,s._depthOfFieldEnabled=!1,s._vlsEnabled=!1,s._lensFlareEnabled=!1,s._hdrEnabled=!1,s._motionBlurEnabled=!1,s._fxaaEnabled=!1,s._motionBlurSamples=64,s._volumetricLightStepsCount=50,s._samples=1,s._cameras=o||[],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 n.__extends(t,e),Object.defineProperty(t.prototype,"BloomEnabled",{get:function(){return this._bloomEnabled},set:function(e){this._bloomEnabled!==e&&(this._bloomEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"DepthOfFieldEnabled",{get:function(){return this._depthOfFieldEnabled},set:function(e){this._depthOfFieldEnabled!==e&&(this._depthOfFieldEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"LensFlareEnabled",{get:function(){return this._lensFlareEnabled},set:function(e){this._lensFlareEnabled!==e&&(this._lensFlareEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"HDREnabled",{get:function(){return this._hdrEnabled},set:function(e){this._hdrEnabled!==e&&(this._hdrEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"VLSEnabled",{get:function(){return this._vlsEnabled},set:function(e){if(this._vlsEnabled!==e){if(e)if(!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:!0,configurable:!0}),Object.defineProperty(t.prototype,"MotionBlurEnabled",{get:function(){return this._motionBlurEnabled},set:function(e){this._motionBlurEnabled!==e&&(this._motionBlurEnabled=e,this._buildPipeline())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fxaaEnabled",{get:function(){return this._fxaaEnabled},set:function(e){this._fxaaEnabled!==e&&(this._fxaaEnabled=e,this._buildPipeline())},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"motionBlurSamples",{get:function(){return this._motionBlurSamples},set:function(e){this.motionBlurPostProcess&&this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+e.toFixed(1)),this._motionBlurSamples=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"samples",{get:function(){return this._samples},set:function(e){this._samples!==e&&(this._samples=e,this._buildPipeline())},enumerable:!0,configurable:!0}),t.prototype._buildPipeline=function(){var e=this,t=this._ratio,r=this._scene;this._disposePostProcesses(),this._reset(),this._basePostProcess?this.originalPostProcess=this._basePostProcess:(this.originalPostProcess=new l.PostProcess("HDRPass","standard",[],[],t,null,p.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",this._floatTextureType),this.originalPostProcess.onApply=function(){e._currentDepthOfFieldSource=e.originalPostProcess}),(this._bloomEnabled||this._vlsEnabled||this._lensFlareEnabled||this._depthOfFieldEnabled||this._motionBlurEnabled)&&this.addEffect(new h.PostProcessRenderEffect(r.getEngine(),"HDRPassPostProcess",function(){return e.originalPostProcess},!0)),this._currentDepthOfFieldSource=this.originalPostProcess,this._bloomEnabled&&(this._createDownSampleX4PostProcess(r,t/2),this._createBrightPassPostProcess(r,t/2),this._createBlurPostProcesses(r,t/4,1),this._createTextureAdderPostProcess(r,t),this.textureAdderFinalPostProcess=new l.PostProcess("HDRDepthOfFieldSource","standard",[],[],t,null,c.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new h.PostProcessRenderEffect(r.getEngine(),"HDRBaseDepthOfFieldSource",function(){return e.textureAdderFinalPostProcess},!0))),this._vlsEnabled&&(this._createVolumetricLightPostProcess(r,t),this.volumetricLightFinalPostProcess=new l.PostProcess("HDRVLSFinal","standard",[],[],t,null,c.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new h.PostProcessRenderEffect(r.getEngine(),"HDRVLSFinal",function(){return e.volumetricLightFinalPostProcess},!0))),this._lensFlareEnabled&&(this._createLensFlarePostProcess(r,t),this.lensFlareFinalPostProcess=new l.PostProcess("HDRPostLensFlareDepthOfFieldSource","standard",[],[],t,null,c.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new h.PostProcessRenderEffect(r.getEngine(),"HDRPostLensFlareDepthOfFieldSource",function(){return e.lensFlareFinalPostProcess},!0))),this._hdrEnabled&&(this._createLuminancePostProcesses(r,this._floatTextureType),this._createHdrPostProcess(r,t),this.hdrFinalPostProcess=new l.PostProcess("HDRPostHDReDepthOfFieldSource","standard",[],[],t,null,c.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,"#define PASS_POST_PROCESS",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new h.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,c.Texture.BILINEAR_SAMPLINGMODE,r.getEngine(),!1,p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new h.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 l.PostProcess("HDRDownSampleX4","standard",["dsOffsets"],[],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DOWN_SAMPLE_X4",p.Constants.TEXTURETYPE_UNSIGNED_INT),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 h.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 l.PostProcess("HDRBrightPass","standard",["dsOffsets","brightThreshold"],[],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define BRIGHT_PASS",p.Constants.TEXTURETYPE_UNSIGNED_INT),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 h.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 d.BlurPostProcess("HDRBlurH_"+r,new s.Vector2(1,0),this[n],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,p.Constants.TEXTURETYPE_UNSIGNED_INT),l=new d.BlurPostProcess("HDRBlurV_"+r,new s.Vector2(0,1),this[n],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,p.Constants.TEXTURETYPE_UNSIGNED_INT);a.onActivateObservable.add(function(){var e=a.width/o.getRenderWidth();a.kernel=i[n]*e}),l.onActivateObservable.add(function(){var e=l.height/o.getRenderHeight();l.kernel=i.horizontalBlur?64*e:i[n]*e}),this.addEffect(new h.PostProcessRenderEffect(e.getEngine(),"HDRBlurH"+r,function(){return a},!0)),this.addEffect(new h.PostProcessRenderEffect(e.getEngine(),"HDRBlurV"+r,function(){return l},!0)),this.blurHPostProcesses.push(a),this.blurVPostProcesses.push(l)},t.prototype._createTextureAdderPostProcess=function(e,t){var r=this;this.textureAdderPostProcess=new l.PostProcess("HDRTextureAdder","standard",["exposure"],["otherSampler","lensSampler"],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define TEXTURE_ADDER",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.textureAdderPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",r._vlsEnabled?r._currentDepthOfFieldSource:r.originalPostProcess),e.setTexture("lensSampler",r.lensTexture),e.setFloat("exposure",r.exposure),r._currentDepthOfFieldSource=r.textureAdderFinalPostProcess},this.addEffect(new h.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 l.PostProcess("HDRVLS","standard",["shadowViewProjection","cameraPosition","sunDirection","sunColor","scatteringCoefficient","scatteringPower","depthValues"],["shadowMapSampler","positionSampler"],t/8,null,c.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 h.PostProcessRenderEffect(e.getEngine(),"HDRVLS",function(){return r.volumetricLightPostProcess},!0)),this._createBlurPostProcesses(e,t/4,0,"volumetricLightBlurScale"),this.volumetricLightMergePostProces=new l.PostProcess("HDRVLSMerge","standard",[],["originalSampler"],t,null,c.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 h.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 l.PostProcess("HDRLuminance","standard",["lumOffsets"],[],{width:i,height:i},null,c.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 h.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 d=new l.PostProcess("HDRLuminanceDownSample"+a,"standard",["dsOffsets","halfDestPixelSize"],[],{width:i,height:i},null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,u,r);this.luminanceDownSamplePostProcesses.push(d)}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 h.PostProcessRenderEffect(e.getEngine(),"HDRLuminanceDownSample"+r,function(){return t},!0))})},t.prototype._createHdrPostProcess=function(e,t){var r=this;this.hdrPostProcess=new l.PostProcess("HDR","standard",["averageLuminance"],["textureAdderSampler"],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define HDR",p.Constants.TEXTURETYPE_UNSIGNED_INT);var n=1,i=0,o=0;this.hdrPostProcess.onApply=function(t){if(t.setTextureFromPostProcess("textureAdderSampler",r._currentDepthOfFieldSource),i+=e.getEngine().getDeltaTime(),n<0)n=r._hdrCurrentLuminance;else{var s=(o-i)/1e3;r._hdrCurrentLuminance<n+r.hdrDecreaseRate*s?n+=r.hdrDecreaseRate*s:r._hdrCurrentLuminance>n-r.hdrIncreaseRate*s?n-=r.hdrIncreaseRate*s:n=r._hdrCurrentLuminance}n=a.Scalar.Clamp(n,r.hdrMinimumLuminance,1e20),t.setFloat("averageLuminance",n),o=i,r._currentDepthOfFieldSource=r.hdrFinalPostProcess},this.addEffect(new h.PostProcessRenderEffect(e.getEngine(),"HDR",function(){return r.hdrPostProcess},!0))},t.prototype._createLensFlarePostProcess=function(e,t){var r=this;this.lensFlarePostProcess=new l.PostProcess("HDRLensFlare","standard",["strength","ghostDispersal","haloWidth","resolution","distortionStrength"],["lensColorSampler"],t/2,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new h.PostProcessRenderEffect(e.getEngine(),"HDRLensFlare",function(){return r.lensFlarePostProcess},!0)),this._createBlurPostProcesses(e,t/4,2),this.lensFlareComposePostProcess=new l.PostProcess("HDRLensFlareCompose","standard",["lensStarMatrix"],["otherSampler","lensDirtSampler","lensStarSampler"],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE_COMPOSE",p.Constants.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new h.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._currentDepthOfFieldSource),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 c=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),l=o.multiply(c).multiply(i);e.setMatrix("lensStarMatrix",l),r._currentDepthOfFieldSource=r.lensFlareFinalPostProcess}}},t.prototype._createDepthOfFieldPostProcess=function(e,t){var r=this;this.depthOfFieldPostProcess=new l.PostProcess("HDRDepthOfField","standard",["distance"],["otherSampler","depthSampler"],t,null,c.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 h.PostProcessRenderEffect(e.getEngine(),"HDRDepthOfField",function(){return r.depthOfFieldPostProcess},!0))},t.prototype._createMotionBlurPostProcess=function(e,t){var r=this;this.motionBlurPostProcess=new l.PostProcess("HDRMotionBlur","standard",["inverseViewProjection","prevViewProjection","screenSize","motionScale","motionStrength"],["depthSampler"],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+this.motionBlurSamples.toFixed(1),p.Constants.TEXTURETYPE_UNSIGNED_INT);var n=0,i=s.Matrix.Identity(),o=s.Matrix.Identity(),a=s.Matrix.Identity(),u=s.Vector2.Zero();this.motionBlurPostProcess.onApply=function(t){(a=e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(o),t.setMatrix("inverseViewProjection",o),t.setMatrix("prevViewProjection",i),i=a,u.x=r.motionBlurPostProcess.width,u.y=r.motionBlurPostProcess.height,t.setVector2("screenSize",u),n=e.getEngine().getFps()/60,t.setFloat("motionScale",n),t.setFloat("motionStrength",r.motionStrength),t.setTexture("depthSampler",r._getDepthTexture())},this.addEffect(new h.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.downSampleX4PostProcess&&this.downSampleX4PostProcess.dispose(t),this.brightPassPostProcess&&this.brightPassPostProcess.dispose(t),this.textureAdderPostProcess&&this.textureAdderPostProcess.dispose(t),this.textureAdderFinalPostProcess&&this.textureAdderFinalPostProcess.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);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);for(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.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),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)),o},t.LuminanceSteps=6,n.__decorate([Object(i.serialize)()],t.prototype,"brightThreshold",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"blurWidth",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"horizontalBlur",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"exposure",void 0),n.__decorate([Object(i.serializeAsTexture)("lensTexture")],t.prototype,"lensTexture",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"volumetricLightCoefficient",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"volumetricLightPower",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"volumetricLightBlurScale",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"hdrMinimumLuminance",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"hdrDecreaseRate",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"hdrIncreaseRate",void 0),n.__decorate([Object(i.serializeAsTexture)("lensColorTexture")],t.prototype,"lensColorTexture",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lensFlareStrength",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lensFlareGhostDispersal",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lensFlareHaloWidth",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"lensFlareDistortionStrength",void 0),n.__decorate([Object(i.serializeAsTexture)("lensStarTexture")],t.prototype,"lensStarTexture",void 0),n.__decorate([Object(i.serializeAsTexture)("lensFlareDirtTexture")],t.prototype,"lensFlareDirtTexture",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"depthOfFieldDistance",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"depthOfFieldBlurWidth",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"motionStrength",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"_ratio",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"BloomEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"DepthOfFieldEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"LensFlareEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"HDREnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"VLSEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"MotionBlurEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"fxaaEnabled",null),n.__decorate([Object(i.serialize)()],t.prototype,"volumetricLightStepsCount",null),n.__decorate([Object(i.serialize)()],t.prototype,"motionBlurSamples",null),n.__decorate([Object(i.serialize)()],t.prototype,"samples",null),t}(u.PostProcessRenderPipeline));g._TypeStore.RegisteredTypes["BABYLON.StandardRenderingPipeline"]=m},"./PostProcesses/RenderPipeline/index.ts":
- /*!***********************************************!*\
- !*** ./PostProcesses/RenderPipeline/index.ts ***!
- \***********************************************/
- /*! exports provided: PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */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:!0,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],a=s.name;if(t=this._singleInstance?0:a,!this._postProcesses[t]){var c=this._getPostProcesses();c&&(this._postProcesses[t]=Array.isArray(c)?c:[c])}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:!0,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:!0,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],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 c in this._renderEffects)this._renderEffects.hasOwnProperty(c)&&this._renderEffects[c]._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++){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){var t=Object.keys(this._renderEffects);if(1===this.engine.webGLVersion)return!1;if(t.length>0){var r=this._renderEffects[t[0]].getPostProcesses();r&&(r[0].samples=e)}return!0},e.prototype.dispose=function(){},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:!0,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){if(this._renderPipelines.hasOwnProperty(e))this._renderPipelines[e]._rebuild()}},e.prototype.dispose=function(){for(var e in this._renderPipelines){if(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 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 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"),c=r(/*! ../Maths/math */"./Maths/math.ts"),l=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=function(e){function t(t,r,n,i,u,h){void 0===u&&(u=0),void 0===h&&(h=!1);var d=e.call(this,t.getEngine(),"bloom",function(){return d._effects},!0)||this;return d.bloomScale=r,d._effects=[],d._downscale=new o.ExtractHighlightsPostProcess("highlights",1,null,l.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,h),d._blurX=new s.BlurPostProcess("horizontal blur",new c.Vector2(1,0),10,r,null,l.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,void 0,h),d._blurX.alwaysForcePOT=!0,d._blurX.autoClear=!1,d._blurY=new s.BlurPostProcess("vertical blur",new c.Vector2(0,1),10,r,null,l.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,void 0,h),d._blurY.alwaysForcePOT=!0,d._blurY.autoClear=!1,d.kernel=i,d._effects=[d._downscale,d._blurX,d._blurY],d._merge=new a.BloomMergePostProcess("bloomMerge",d._downscale,d._blurY,n,r,null,l.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,u,h),d._merge.autoClear=!1,d._effects.push(d._merge),d}return n.__extends(t,e),Object.defineProperty(t.prototype,"threshold",{get:function(){return this._downscale.threshold},set:function(e){this._downscale.threshold=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this._merge.weight},set:function(e){this._merge.weight=e},enumerable:!0,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:!0,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,c,l,u,h,d){void 0===h&&(h=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1);var f=e.call(this,t,"bloomMerge",["bloomWeight"],["circleOfConfusionSampler","blurStep0","blurStep1","blurStep2","bloomBlur"],s,a,c,l,u,null,h,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)}),d||f.updateEffect(),f}return 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,c,l,u,h,d,f){void 0===c&&(c=o.Texture.BILINEAR_SAMPLINGMODE),void 0===h&&(h=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=""),void 0===f&&(f=!1);var p=e.call(this,t,"kernelBlur",["delta","direction","cameraMinMaxZ"],["circleOfConfusionSampler"],i,a,c,l,u,null,h,"kernelBlur",{varyingCount:0,depCount:0},!0)||this;return p.direction=r,p.blockCompilation=f,p._packedFloat=!1,p._staticDefines="",p._staticDefines=d,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 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:!0,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:!0,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,c=0;c<n;c++){var l=c/(n-1),u=this._gaussianWeight(2*l-1);o[c]=c-i,s[c]=u,a+=u}for(c=0;c<s.length;c++)s[c]/=a;var h=[],d=[],f=[];for(c=0;c<=i;c+=2){var p=Math.min(c+1,Math.floor(i));if(c===p)f.push({o:o[c],w:s[c]});else{var g=p===i,m=s[c]+s[p]*(g?.5:1),_=o[c]+1/(1+s[c]/s[p]);0===_?(f.push({o:o[c],w:s[c]}),f.push({o:o[c+1],w:s[c+1]})):(f.push({o:_,w:m}),f.push({o:-_,w:m}))}}for(c=0;c<f.length;c++)d[c]=f[c].o,h[c]=f[c].w;o=d,s=h;var v=this.getEngine().getCaps().maxVaryingVectors,A=Math.max(v,0)-1,y=Math.min(o.length,A),b="";b+=this._staticDefines,-1!=this._staticDefines.indexOf("DOF")&&(b+="#define CENTER_WEIGHT "+this._glslFloat(s[y-1])+"\r\n",y--);for(c=0;c<y;c++)b+="#define KERNEL_OFFSET"+c+" "+this._glslFloat(o[c])+"\r\n",b+="#define KERNEL_WEIGHT"+c+" "+this._glslFloat(s[c])+"\r\n";var T=0;for(c=A;c<o.length;c++)b+="#define KERNEL_DEP_OFFSET"+T+" "+this._glslFloat(o[c])+"\r\n",b+="#define KERNEL_DEP_WEIGHT"+T+" "+this._glslFloat(s[c])+"\r\n",T++;this.packedFloat&&(b+="#define PACKEDFLOAT 1"),this.blockCompilation=!1,e.prototype.updateEffect.call(this,b,null,null,{varyingCount:y,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 */"./Maths/math.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,c,l,u,h,d){void 0===h&&(h=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1);var f=e.call(this,t,"chromaticAberration",["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"],[],o,a,c,l,u,null,h,void 0,null,d)||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 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,c,l,u,h){void 0===u&&(u=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===h&&(h=!1);var d=e.call(this,t,"circleOfConfusion",["cameraMinMaxZ","focusDistance","cocPrecalculation"],["depthSampler"],n,i,a,c,l,null,u,void 0,null,h)||this;return d.lensSize=50,d.fStop=1.4,d.focusDistance=2e3,d.focalLength=50,d._depthTexture=null,d._depthTexture=r,d.onApplyObservable.add(function(e){if(d._depthTexture){e.setTexture("depthSampler",d._depthTexture);var t=d.lensSize/d.fStop*d.focalLength/(d.focusDistance-d.focalLength);e.setFloat("focusDistance",d.focusDistance),e.setFloat("cocPrecalculation",t),e.setFloat2("cameraMinMaxZ",d._depthTexture.activeCamera.minZ,d._depthTexture.activeCamera.maxZ)}else o.Logger.Warn("No depth texture set on CircleOfConfusionPostProcess")}),d}return n.__extends(t,e),Object.defineProperty(t.prototype,"depthTexture",{set:function(e){this._depthTexture=e},enumerable:!0,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,c){var l=e.call(this,t,"colorCorrection",null,["colorTable"],n,i,s,a,c)||this;return l._colorTableTexture=new o.Texture(r,i.getScene(),!0,!1,o.Texture.TRILINEAR_SAMPLINGMODE),l._colorTableTexture.anisotropicFilteringLevel=1,l._colorTableTexture.wrapU=o.Texture.CLAMP_ADDRESSMODE,l._colorTableTexture.wrapV=o.Texture.CLAMP_ADDRESSMODE,l.onApply=function(e){e.setTexture("colorTable",l._colorTableTexture)},l}return 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,c,l){void 0===l&&(l=o.Constants.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,t,"convolution",["kernel","screenSize"],null,n,i,s,a,c,null,l)||this;return u.kernel=r,u.onApply=function(e){e.setFloat2("screenSize",u.width,u.height),e.setArray("kernel",u.kernel)},u}return 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,c,l,u,h,d,f,p,g){void 0===u&&(u=null),void 0===h&&(h=i.Texture.BILINEAR_SAMPLINGMODE),void 0===p&&(p=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===g&&(g=!1);var m=e.call(this,t,n,o,a,c,h=s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,d,f,p=s.Constants.TEXTURETYPE_UNSIGNED_INT,"#define DOF 1\r\n",g)||this;return m.direction=n,m.onApplyObservable.add(function(e){null!=u&&e.setTextureFromPostProcess("textureSampler",u),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",l),r.activeCamera&&e.setFloat2("cameraMinMaxZ",r.activeCamera.minZ,r.activeCamera.maxZ)}),m}return 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 h});var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),c=r(/*! ./circleOfConfusionPostProcess */"./PostProcesses/circleOfConfusionPostProcess.ts"),l=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 h=function(e){function t(t,r,i,a,h){void 0===i&&(i=n.Low),void 0===a&&(a=0),void 0===h&&(h=!1);var d=e.call(this,t.getEngine(),"depth of field",function(){return d._effects},!0)||this;d._effects=[],d._circleOfConfusion=new c.CircleOfConfusionPostProcess("circleOfConfusion",r,1,null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,h),d._depthOfFieldBlurY=[],d._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 g=p/Math.pow(2,f-1),m=1,_=0;_<f;_++){var v=new l.DepthOfFieldBlurPostProcess("verticle blur",t,new o.Vector2(0,1),g,m,null,d._circleOfConfusion,0==_?d._circleOfConfusion:null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,h);v.autoClear=!1,m=.75/Math.pow(2,_);var A=new l.DepthOfFieldBlurPostProcess("horizontal blur",t,new o.Vector2(1,0),g,m,null,d._circleOfConfusion,null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,h);A.autoClear=!1,d._depthOfFieldBlurY.push(v),d._depthOfFieldBlurX.push(A)}d._effects=[d._circleOfConfusion];for(_=0;_<d._depthOfFieldBlurX.length;_++)d._effects.push(d._depthOfFieldBlurY[_]),d._effects.push(d._depthOfFieldBlurX[_]);return d._dofMerge=new u.DepthOfFieldMergePostProcess("dofMerge",d._circleOfConfusion,d._circleOfConfusion,d._depthOfFieldBlurX,m,null,s.Texture.BILINEAR_SAMPLINGMODE,t.getEngine(),!1,a,h),d._dofMerge.autoClear=!1,d._effects.push(d._dofMerge),d}return i.__extends(t,e),Object.defineProperty(t.prototype,"focalLength",{get:function(){return this._circleOfConfusion.focalLength},set:function(e){this._circleOfConfusion.focalLength=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fStop",{get:function(){return this._circleOfConfusion.fStop},set:function(e){this._circleOfConfusion.fStop=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focusDistance",{get:function(){return this._circleOfConfusion.focusDistance},set:function(e){this._circleOfConfusion.focusDistance=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lensSize",{get:function(){return this._circleOfConfusion.lensSize},set:function(e){this._circleOfConfusion.lensSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"depthTexture",{set:function(e){this._circleOfConfusion.depthTexture=e},enumerable:!0,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(){return function(){}}()),a=function(e){function t(t,r,n,i,s,a,c,l,u,h,d){void 0===h&&(h=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1);var f=e.call(this,t,"depthOfFieldMerge",[],["circleOfConfusionSampler","blurStep0","blurStep1","blurStep2"],s,a,c,l,u,null,h,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)})}),d||f.updateEffect(),f}return 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 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 */"./Maths/math.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,c,l,u){void 0===l&&(l=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===u&&(u=!1);var h=e.call(this,t,"extractHighlights",["threshold","exposure"],null,r,n,i,a,c,null,l,void 0,null,u)||this;return h.threshold=.9,h._exposure=1,h._inputPostProcess=null,h.onApplyObservable.add(function(e){h._inputPostProcess&&e.setTextureFromPostProcess("textureSampler",h._inputPostProcess),e.setFloat("threshold",Math.pow(h.threshold,o.ToGammaSpace)),e.setFloat("exposure",h._exposure)}),h}return 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 c=e.call(this,t,"filter",["kernelMatrix"],null,n,i,o,s,a)||this;return c.kernelMatrix=r,c.onApply=function(e){e.setMatrix("kernelMatrix",c.kernelMatrix)},c}return 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,c,l){void 0===n&&(n=null),void 0===l&&(l=s.Constants.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,t,"fxaa",["texelSize"],null,r,n,o||i.Texture.BILINEAR_SAMPLINGMODE,a,c,null,l,"fxaa",void 0,!0)||this,h=u._getDefines();return u.updateEffect(h),u.onApplyObservable.add(function(e){var t=u.texelSize;e.setFloat2("texelSize",t.x,t.y)}),u}return 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,c,l){void 0===c&&(c=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1);var u=e.call(this,t,"grain",["intensity","animatedSeed"],[],r,n,i,s,a,null,c,void 0,null,l)||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 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,c){return void 0===c&&(c=o.Constants.TEXTURETYPE_UNSIGNED_INT),e.call(this,t,"highlights",null,null,r,n,i,s,a,null,c)||this}return 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 l});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"),c=r(/*! ../Engines/constants */"./Engines/constants.ts"),l=(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,l){void 0===n&&(n=null),void 0===a&&(a=c.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},l?(l.applyByPostProcess=!0,u._attachImageProcessingConfiguration(l,!0),u.fromLinearSpace=!1):(u._attachImageProcessingConfiguration(null,!0),u.imageProcessingConfiguration.applyByPostProcess=!0),u.onApply=function(e){u.imageProcessingConfiguration.bind(e,u.aspectRatio)},u}return n.__extends(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e)},enumerable:!0,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(),o=this.getCamera();if(o)n=o.getScene();else if(i&&i.scenes){var s=i.scenes;n=s[s.length-1]}else n=a.EngineStore.LastCreatedScene;this._imageProcessingConfiguration=n.imageProcessingConfiguration}this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){r._updateParameters()})),t||this._updateParameters()}},Object.defineProperty(t.prototype,"colorCurves",{get:function(){return this.imageProcessingConfiguration.colorCurves},set:function(e){this.imageProcessingConfiguration.colorCurves=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"colorCurvesEnabled",{get:function(){return this.imageProcessingConfiguration.colorCurvesEnabled},set:function(e){this.imageProcessingConfiguration.colorCurvesEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"colorGradingTexture",{get:function(){return this.imageProcessingConfiguration.colorGradingTexture},set:function(e){this.imageProcessingConfiguration.colorGradingTexture=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"colorGradingEnabled",{get:function(){return this.imageProcessingConfiguration.colorGradingEnabled},set:function(e){this.imageProcessingConfiguration.colorGradingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exposure",{get:function(){return this.imageProcessingConfiguration.exposure},set:function(e){this.imageProcessingConfiguration.exposure=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"toneMappingEnabled",{get:function(){return this._imageProcessingConfiguration.toneMappingEnabled},set:function(e){this._imageProcessingConfiguration.toneMappingEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"toneMappingType",{get:function(){return this._imageProcessingConfiguration.toneMappingType},set:function(e){this._imageProcessingConfiguration.toneMappingType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contrast",{get:function(){return this.imageProcessingConfiguration.contrast},set:function(e){this.imageProcessingConfiguration.contrast=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteStretch",{get:function(){return this.imageProcessingConfiguration.vignetteStretch},set:function(e){this.imageProcessingConfiguration.vignetteStretch=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCentreX",{get:function(){return this.imageProcessingConfiguration.vignetteCentreX},set:function(e){this.imageProcessingConfiguration.vignetteCentreX=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCentreY",{get:function(){return this.imageProcessingConfiguration.vignetteCentreY},set:function(e){this.imageProcessingConfiguration.vignetteCentreY=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteWeight",{get:function(){return this.imageProcessingConfiguration.vignetteWeight},set:function(e){this.imageProcessingConfiguration.vignetteWeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteColor",{get:function(){return this.imageProcessingConfiguration.vignetteColor},set:function(e){this.imageProcessingConfiguration.vignetteColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteCameraFov",{get:function(){return this.imageProcessingConfiguration.vignetteCameraFov},set:function(e){this.imageProcessingConfiguration.vignetteCameraFov=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteBlendMode",{get:function(){return this.imageProcessingConfiguration.vignetteBlendMode},set:function(e){this.imageProcessingConfiguration.vignetteBlendMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vignetteEnabled",{get:function(){return this.imageProcessingConfiguration.vignetteEnabled},set:function(e){this.imageProcessingConfiguration.vignetteEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fromLinearSpace",{get:function(){return this._fromLinearSpace},set:function(e){this._fromLinearSpace!==e&&(this._fromLinearSpace=e,this._updateParameters())},enumerable:!0,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)},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, SharpenPostProcess, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, VRMultiviewToSingleview, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */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 c=r(/*! ./chromaticAberrationPostProcess */"./PostProcesses/chromaticAberrationPostProcess.ts");r.d(t,"ChromaticAberrationPostProcess",function(){return c.ChromaticAberrationPostProcess});var l=r(/*! ./circleOfConfusionPostProcess */"./PostProcesses/circleOfConfusionPostProcess.ts");r.d(t,"CircleOfConfusionPostProcess",function(){return l.CircleOfConfusionPostProcess});var u=r(/*! ./colorCorrectionPostProcess */"./PostProcesses/colorCorrectionPostProcess.ts");r.d(t,"ColorCorrectionPostProcess",function(){return u.ColorCorrectionPostProcess});var h=r(/*! ./convolutionPostProcess */"./PostProcesses/convolutionPostProcess.ts");r.d(t,"ConvolutionPostProcess",function(){return h.ConvolutionPostProcess});var d=r(/*! ./depthOfFieldBlurPostProcess */"./PostProcesses/depthOfFieldBlurPostProcess.ts");r.d(t,"DepthOfFieldBlurPostProcess",function(){return d.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 g=r(/*! ./displayPassPostProcess */"./PostProcesses/displayPassPostProcess.ts");r.d(t,"DisplayPassPostProcess",function(){return g.DisplayPassPostProcess});var m=r(/*! ./extractHighlightsPostProcess */"./PostProcesses/extractHighlightsPostProcess.ts");r.d(t,"ExtractHighlightsPostProcess",function(){return m.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 A=r(/*! ./grainPostProcess */"./PostProcesses/grainPostProcess.ts");r.d(t,"GrainPostProcess",function(){return A.GrainPostProcess});var y=r(/*! ./highlightsPostProcess */"./PostProcesses/highlightsPostProcess.ts");r.d(t,"HighlightsPostProcess",function(){return y.HighlightsPostProcess});var b=r(/*! ./imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts");r.d(t,"ImageProcessingPostProcess",function(){return b.ImageProcessingPostProcess});var T=r(/*! ./motionBlurPostProcess */"./PostProcesses/motionBlurPostProcess.ts");r.d(t,"MotionBlurPostProcess",function(){return T.MotionBlurPostProcess});var E=r(/*! ./passPostProcess */"./PostProcesses/passPostProcess.ts");r.d(t,"PassPostProcess",function(){return E.PassPostProcess}),r.d(t,"PassCubePostProcess",function(){return E.PassCubePostProcess});var x=r(/*! ./postProcess */"./PostProcesses/postProcess.ts");r.d(t,"PostProcess",function(){return x.PostProcess});var C=r(/*! ./postProcessManager */"./PostProcesses/postProcessManager.ts");r.d(t,"PostProcessManager",function(){return C.PostProcessManager});var P=r(/*! ./refractionPostProcess */"./PostProcesses/refractionPostProcess.ts");r.d(t,"RefractionPostProcess",function(){return P.RefractionPostProcess});var M=r(/*! ./RenderPipeline/index */"./PostProcesses/RenderPipeline/index.ts");r.d(t,"PostProcessRenderEffect",function(){return M.PostProcessRenderEffect}),r.d(t,"PostProcessRenderPipeline",function(){return M.PostProcessRenderPipeline}),r.d(t,"PostProcessRenderPipelineManager",function(){return M.PostProcessRenderPipelineManager}),r.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return M.PostProcessRenderPipelineManagerSceneComponent}),r.d(t,"DefaultRenderingPipeline",function(){return M.DefaultRenderingPipeline}),r.d(t,"LensRenderingPipeline",function(){return M.LensRenderingPipeline}),r.d(t,"SSAO2RenderingPipeline",function(){return M.SSAO2RenderingPipeline}),r.d(t,"SSAORenderingPipeline",function(){return M.SSAORenderingPipeline}),r.d(t,"StandardRenderingPipeline",function(){return M.StandardRenderingPipeline});var S=r(/*! ./sharpenPostProcess */"./PostProcesses/sharpenPostProcess.ts");r.d(t,"SharpenPostProcess",function(){return S.SharpenPostProcess});var R=r(/*! ./stereoscopicInterlacePostProcess */"./PostProcesses/stereoscopicInterlacePostProcess.ts");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}),r.d(t,"VRMultiviewToSingleview",function(){return D.VRMultiviewToSingleview})},"./PostProcesses/motionBlurPostProcess.ts":
- /*!************************************************!*\
- !*** ./PostProcesses/motionBlurPostProcess.ts ***!
- \************************************************/
- /*! exports provided: MotionBlurPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"MotionBlurPostProcess",function(){return l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Maths/math */"./Maths/math.ts"),s=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=r(/*! ../Rendering/geometryBufferRenderer */"./Rendering/geometryBufferRenderer.ts"),l=(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,l,u,h,d,f){void 0===d&&(d=a.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===f&&(f=!1);var p=e.call(this,t,"motionBlur",["motionStrength","motionScale","screenSize"],["velocitySampler"],n,s,l,u,h,"#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0",d,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(c.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 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:!0,configurable:!0}),t.prototype.dispose=function(t){this._geometryBufferRenderer&&(this._geometryBufferRenderer._previousTransformationMatrices={}),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 c});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,c,l){return void 0===n&&(n=null),void 0===c&&(c=i.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1),e.call(this,t,"pass",null,null,r,n,o,s,a,void 0,c,void 0,null,l)||this}return n.__extends(t,e),t}(o.PostProcess)),c=function(e){function t(t,r,n,o,s,a,c,l){void 0===n&&(n=null),void 0===c&&(c=i.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1);var u=e.call(this,t,"passCube",null,null,r,n,o,s,a,"#define POSITIVEX",c,void 0,null,l)||this;return u._face=0,u}return 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:!0,configurable:!0}),t}(o.PostProcess);s.Engine._RescalePostProcessFactory=function(e){return new a("rescale",1,null,s.Engine.TEXTURE_BILINEAR_SAMPLINGMODE,e,!1,s.Engine.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 c});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math */"./Maths/math.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=(r(/*! ../Shaders/postprocess.vertex */"./Shaders/postprocess.vertex.ts"),function(){function e(e,t,r,n,c,l,u,h,d,f,p,g,m,_){void 0===u&&(u=a.Constants.TEXTURE_NEAREST_SAMPLINGMODE),void 0===f&&(f=null),void 0===p&&(p=a.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===g&&(g="postprocess"),void 0===_&&(_=!1),this.name=e,this.width=-1,this.height=-1,this._outputTexture=null,this.autoClear=!0,this.alphaMode=a.Constants.ALPHA_DISABLE,this.animations=new Array,this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=a.Constants.SCALEMODE_FLOOR,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._reusable=!1,this._textures=new i.SmartArray(2),this._currentRenderTextureInd=0,this._scaleRatio=new s.Vector2(1,1),this._texelSize=s.Vector2.Zero(),this.onActivateObservable=new o.Observable,this.onSizeChangedObservable=new o.Observable,this.onApplyObservable=new o.Observable,this.onBeforeRenderObservable=new o.Observable,this.onAfterRenderObservable=new o.Observable,null!=l?(this._camera=l,this._scene=l.getScene(),l.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.postProcesses.push(this),this.uniqueId=this._scene.getUniqueId()):h&&(this._engine=h,this._engine.postProcesses.push(this)),this._options=c,this.renderTargetSamplingMode=u||a.Constants.TEXTURE_NEAREST_SAMPLINGMODE,this._reusable=d||!1,this._textureType=p,this._samplers=n||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=g,this._parameters=r||[],this._parameters.push("scale"),this._indexParameters=m,_||this.updateEffect(f)}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._samples},set:function(e){var t=this;this._samples=e,this._textures.forEach(function(e){e.samples!==t._samples&&t._engine.updateRenderTargetTextureSampleCount(e,t._samples)})},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSizeChanged",{set:function(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onApply",{set:function(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputTexture",{get:function(){return this._textures.data[this._currentRenderTextureInd]},set:function(e){this._forcedOutputTexture=e},enumerable:!0,configurable:!0}),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:!0,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 i.SmartArray(2)),this._shareOutputWithPostProcess=null},e.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._effect=this._engine.createEffect({vertex:this._vertexUrl,fragment: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 i=this;void 0===t&&(t=null);var o=(e=e||this._camera).getScene(),s=o.getEngine(),c=s.getCaps().maxTextureSize,l=(t?t.width:this._engine.getRenderWidth(!0))*this._options|0,u=(t?t.height:this._engine.getRenderHeight(!0))*this._options|0,h=e.parent;!h||h.leftCamera!=e&&h.rightCamera!=e||(l/=2);var d,f=this._options.width||l,p=this._options.height||u;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){var g=s.currentViewport;g&&(f*=g.width,p*=g.height)}if((this.renderTargetSamplingMode===a.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE||this.alwaysForcePOT)&&(this._options.width||(f=s.needPOTTextures?n.Tools.GetExponentOfTwo(f,c,this.scaleMode):f),this._options.height||(p=s.needPOTTextures?n.Tools.GetExponentOfTwo(p,c,this.scaleMode):p)),this.width!==f||this.height!==p){if(this._textures.length>0){for(var m=0;m<this._textures.length;m++)this._engine._releaseTexture(this._textures.data[m]);this._textures.reset()}this.width=f,this.height=p;var _={width:this.width,height:this.height},v={generateMipMaps:!1,generateDepthBuffer:r||0===e._postProcesses.indexOf(this),generateStencilBuffer:(r||0===e._postProcesses.indexOf(this))&&this._engine.isStencilEnable,samplingMode:this.renderTargetSamplingMode,type:this._textureType};this._textures.push(this._engine.createRenderTargetTexture(_,v)),this._reusable&&this._textures.push(this._engine.createRenderTargetTexture(_,v)),this._texelSize.copyFromFloats(1/this.width,1/this.height),this.onSizeChangedObservable.notifyObservers(this)}this._textures.forEach(function(e){e.samples!==i.samples&&i._engine.updateRenderTargetTextureSampleCount(e,i.samples)})}return this._shareOutputWithPostProcess?d=this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?(d=this._forcedOutputTexture,this.width=this._forcedOutputTexture.width,this.height=this._forcedOutputTexture.height):d=this.inputTexture,this.enablePixelPerfectMode?(this._scaleRatio.copyFromFloats(l/f,u/p),this._engine.bindFramebuffer(d,0,l,u,this.forceFullscreenViewport)):(this._scaleRatio.copyFromFloats(1,1),this._engine.bindFramebuffer(d,0,void 0,void 0,this.forceFullscreenViewport)),this.onActivateObservable.notifyObservers(e),this.autoClear&&this.alphaMode===a.Constants.ALPHA_DISABLE&&this._engine.clear(this.clearColor?this.clearColor:o.clearColor,o._allowPostProcessClearColor,!0,!0),this._reusable&&(this._currentRenderTextureInd=(this._currentRenderTextureInd+1)%2),d},Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._effect.isSupported},enumerable:!0,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:!0,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){if(e=e||this._camera,this._disposeTextures(),this._scene){var t=this._scene.postProcesses.indexOf(this);-1!==t&&this._scene.postProcesses.splice(t,1)}else{var r=this._engine.postProcesses.indexOf(this);-1!==r&&this._engine.postProcesses.splice(r,1)}if(e){if(e.detachPostProcess(this),0===e._postProcesses.indexOf(this)&&e._postProcesses.length>0){var n=this._camera._getFirstPostProcess();n&&n.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){void 0===t&&(t=null),void 0===r&&(r=!1),void 0===i&&(i=0),void 0===o&&(o=0);for(var s=this._scene.getEngine(),a=0;a<e.length;a++){a<e.length-1?e[a+1].activate(this._scene.activeCamera,t):t?s.bindFramebuffer(t,i,void 0,void 0,r,void 0,o):s.restoreDefaultFramebuffer();var c=e[a],l=c.apply();l&&(c.onBeforeRenderObservable.notifyObservers(l),this._prepareBuffers(),s.bindBuffers(this._vertexBuffers,this._indexBuffer,l),s.drawElementsType(n.Material.TriangleFillMode,0,6),c.onAfterRenderObservable.notifyObservers(l))}s.setDepthBuffer(!0),s.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 c=this._scene.getEngine(),l=0,u=i.length;l<u;l++){var h=i[l];if(l<u-1?h._outputTexture=i[l+1].activate(a,t):t?(c.bindFramebuffer(t,r,void 0,void 0,s),h._outputTexture=t):(c.restoreDefaultFramebuffer(),h._outputTexture=null),e)break;var d=h.apply();d&&(h.onBeforeRenderObservable.notifyObservers(d),this._prepareBuffers(),c.bindBuffers(this._vertexBuffers,this._indexBuffer,d),c.drawElementsType(n.Material.TriangleFillMode,0,6),h.onAfterRenderObservable.notifyObservers(d))}c.setDepthBuffer(!0),c.setDepthWrite(!0),c.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,c,l,u,h){var d=e.call(this,t,"refraction",["baseColor","depth","colorLevel"],["refractionSampler"],a,c,l,u,h)||this;return d.color=n,d.depth=o,d.colorLevel=s,d._ownRefractionTexture=!0,d.onActivateObservable.add(function(e){d._refTexture=d._refTexture||new i.Texture(r,e.getScene())}),d.onApplyObservable.add(function(e){e.setColor3("baseColor",d.color),e.setFloat("depth",d.depth),e.setFloat("colorLevel",d.colorLevel),e.setTexture("refractionSampler",d._refTexture)}),d}return 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:!0,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/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,c,l){void 0===c&&(c=o.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1);var u=e.call(this,t,"sharpen",["sharpnessAmounts","screenSize"],null,r,n,i,s,a,null,c,void 0,null,l)||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 n.__extends(t,e),t}(i.PostProcess))},"./PostProcesses/stereoscopicInterlacePostProcess.ts":
- /*!***********************************************************!*\
- !*** ./PostProcesses/stereoscopicInterlacePostProcess.ts ***!
- \***********************************************************/
- /*! exports provided: StereoscopicInterlacePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicInterlacePostProcess",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.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){var c=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,r[1],o,s,a,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 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,c,l){void 0===a&&(a=s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE),void 0===l&&(l=s.Constants.TEXTURETYPE_UNSIGNED_INT);var u=e.call(this,t,"tonemap",["_ExposureAdjustment"],null,1,o,a,c,!0,null,l)||this;u._operator=r,u.exposureAdjustment=i;var h="#define ";return u._operator===n.Hable?h+="HABLE_TONEMAPPING":u._operator===n.Reinhard?h+="REINHARD_TONEMAPPING":u._operator===n.HejiDawson?h+="OPTIMIZED_HEJIDAWSON_TONEMAPPING":u._operator===n.Photographic&&(h+="PHOTOGRAPHIC_TONEMAPPING"),u.updateEffect(h),u.onApply=function(e){e.setFloat("_ExposureAdjustment",u.exposureAdjustment)},u}return 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 m});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 */"./Maths/math.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),l=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),d=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),f=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),p=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),g=r(/*! ../Engines/constants */"./Engines/constants.ts"),m=(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.fragment */"./Shaders/volumetricLightScatteringPass.fragment.ts"),function(e){function t(r,n,i,o,a,c,l,u,h){void 0===a&&(a=100),void 0===c&&(c=d.Texture.BILINEAR_SAMPLINGMODE);var f=e.call(this,r,"volumetricLightScattering",["decay","exposure","weight","meshPositionOnScreen","density"],["lightScatteringSampler"],n.postProcessRatio||n,i,c,l,u,"#define NUM_SAMPLES "+a)||this;return f._screenCoordinates=s.Vector2.Zero(),f.customMeshPosition=s.Vector3.Zero(),f.useCustomMeshPosition=!1,f.invert=!0,f.excludedMeshes=new Array,f.exposure=.3,f.decay=.96815,f.weight=.58767,f.density=.926,l=(h=null===i?h:i.getScene()).getEngine(),f._viewPort=new s.Viewport(0,0,1,1).toGlobal(l.getRenderWidth(),l.getRenderHeight()),f.mesh=null!==o?o:t.CreateDefaultMesh("VolumetricLightScatteringMesh",h),f._createPass(h,n.passRatio||n),f.onActivate=function(e){f.isSupported||f.dispose(e),f.onActivate=null},f.onApplyObservable.add(function(e){f._updateMeshScreenCoordinates(h),e.setTexture("lightScatteringSampler",f._volumetricLightScatteringRTT),e.setFloat("exposure",f.exposure),e.setFloat("decay",f.decay),e.setFloat("weight",f.weight),e.setFloat("density",f.density),e.setVector2("meshPositionOnScreen",f._screenCoordinates)}),f}return 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:!0,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"),i.push("world0"),i.push("world1"),i.push("world2"),i.push("world3"));var s=n.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._volumetricLightScatteringPass=r.getScene().getEngine().createEffect({vertexElement:"depth",fragmentElement:"volumetricLightScatteringPass"},i,["world","mBones","viewProjection","diffuseMatrix"],["diffuseSampler"],s)),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 f.RenderTargetTexture("volumetricLightScatteringMap",{width:n.getRenderWidth()*t,height:n.getRenderHeight()*t},e,!1,!0,g.Constants.TEXTURETYPE_UNSIGNED_INT),this._volumetricLightScatteringRTT.wrapU=d.Texture.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.wrapV=d.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,a=function(e){var t=e.getRenderingMesh();if(!r._meshExcluded(t)){var n=e.getMaterial();if(n){var i=t.getScene(),o=i.getEngine();o.setState(n.backFaceCulling);var s=t._getInstancesRenderList(e._id);if(!s.mustReturn){var a=o.getCaps().instancedArrays&&null!==s.visibleInstances[e._id];if(r._isReady(e,a)){var c=r._volumetricLightScatteringPass;if(t===r.mesh&&(c=e.effect?e.effect:n.getEffect()),o.enableEffect(c),t._bind(e,c,u.Material.TriangleFillMode),t===r.mesh)n.bind(t.getWorldMatrix(),t);else{if(r._volumetricLightScatteringPass.setMatrix("viewProjection",i.getTransformMatrix()),n&&n.needAlphaTesting()){var l=n.getAlphaTestTexture();r._volumetricLightScatteringPass.setTexture("diffuseSampler",l),l&&r._volumetricLightScatteringPass.setMatrix("diffuseMatrix",l.getTextureMatrix())}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&r._volumetricLightScatteringPass.setMatrices("mBones",t.skeleton.getTransformMatrices(t))}t._processRendering(e,r._volumetricLightScatteringPass,u.Material.TriangleFillMode,s,a,function(e,t){return c.setMatrix("world",t)})}}}}},c=new s.Color4(0,0,0,1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function(){o=e.clearColor,e.clearColor=c}),this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function(){e.clearColor=o}),this._volumetricLightScatteringRTT.customRenderFunction=function(t,r,n,i){var o,s=e.getEngine();if(i.length){for(s.setColorWrite(!1),o=0;o<i.length;o++)a(i.data[o]);s.setColorWrite(!0)}for(o=0;o<t.length;o++)a(t.data[o]);for(o=0;o<r.length;o++)a(r.data[o]);if(n.length){for(o=0;o<n.length;o++){var c=n.data[o],l=c.getBoundingInfo();l&&e.activeCamera&&(c._alphaIndex=c.getMesh().alphaIndex,c._distanceToCamera=l.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}),s.setAlphaMode(g.Constants.ALPHA_COMBINE),o=0;o<u.length;o++)a(u[o]);s.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=l.Mesh.CreatePlane(e,1,t);r.billboardMode=c.AbstractMesh.BILLBOARDMODE_ALL;var n=new h.StandardMaterial(e+"Material",t);return n.emissiveColor=new s.Color3(1,1,1),r.material=n,r},n.__decorate([Object(i.serializeAsVector3)()],t.prototype,"customMeshPosition",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"useCustomMeshPosition",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"invert",void 0),n.__decorate([Object(i.serializeAsMeshReference)()],t.prototype,"mesh",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"excludedMeshes",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"exposure",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"decay",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"weight",void 0),n.__decorate([Object(i.serialize)()],t.prototype,"density",void 0),t}(p.PostProcess))},"./PostProcesses/vrDistortionCorrectionPostProcess.ts":
- /*!************************************************************!*\
- !*** ./PostProcesses/vrDistortionCorrectionPostProcess.ts ***!
- \************************************************************/
- /*! exports provided: VRDistortionCorrectionPostProcess, VRMultiviewToSingleview */function(e,t,r){"use strict";r.r(t),r.d(t,"VRDistortionCorrectionPostProcess",function(){return a}),r.d(t,"VRMultiviewToSingleview",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math */"./Maths/math.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 n.__extends(t,e),t}(s.PostProcess)),c=function(e){function t(t,r,n){var i=e.call(this,t,"vrMultiviewToSingleview",["imageIndex"],["multiviewSampler"],n,r,o.Texture.BILINEAR_SAMPLINGMODE)||this;return i.onSizeChangedObservable.add(function(){}),i.onApplyObservable.add(function(e){r._scene.activeCamera&&r._scene.activeCamera.isLeftCamera?e.setInt("imageIndex",0):e.setInt("imageIndex",1),e.setTexture("multiviewSampler",r._multiviewTexture)}),i}return n.__extends(t,e),t}(s.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 l});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 */"./Maths/math.ts"),a=r(/*! ../abstractScene */"./abstractScene.ts"),c=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 l=function(){function e(e,t,r,n,i){void 0===n&&(n=!0),void 0===i&&(i=!1);var a=this;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),this._renderTargetTexture=new o.RenderTargetTexture(e,t,r,n,!0,i?c.Constants.TEXTURETYPE_FLOAT:c.Constants.TEXTURETYPE_UNSIGNED_INT,!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:!0,configurable:!0}),Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._renderTargetTexture.refreshRate},set:function(e){this._renderTargetTexture.refreshRate=e},enumerable:!0,configurable:!0}),e.prototype.getScene=function(){return this._scene},Object.defineProperty(e.prototype,"cubeTexture",{get:function(){return this._renderTargetTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderList",{get:function(){return this._renderTargetTexture.renderList},enumerable:!0,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},n.__decorate([Object(i.serializeAsMeshReference)()],e.prototype,"_attachedMesh",void 0),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 d});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 */"./Maths/math.ts"),c=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),l=r(/*! ../sceneComponent */"./sceneComponent.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../Materials/shaderMaterial */"./Materials/shaderMaterial.ts");r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),r(/*! ../Shaders/color.fragment */"./Shaders/color.fragment.ts"),r(/*! ../Shaders/color.vertex */"./Shaders/color.vertex.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 d(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 d=function(){function e(e){this.name=l.SceneComponentConstants.NAME_BOUNDINGBOXRENDERER,this.frontColor=new a.Color3(1,1,1),this.backColor=new a.Color3(.1,.1,.1),this.showBackLines=!0,this.renderList=new c.SmartArray(32),this._vertexBuffers={},this.scene=e,e._addComponent(this)}return e.prototype.register=function(){this.scene._beforeEvaluateActiveMeshStage.registerStep(l.SceneComponentConstants.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER,this,this.reset),this.scene._activeMeshStage.registerStep(l.SceneComponentConstants.STEP_ACTIVEMESH_BOUNDINGBOXRENDERER,this,this._activeMesh),this.scene._evaluateSubMeshStage.registerStep(l.SceneComponentConstants.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER,this,this._evaluateSubMesh),this.scene._afterRenderingGroupDrawStage.registerStep(l.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 h.ShaderMaterial("colorShader",this.scene,"color",{attributes:[i.VertexBuffer.PositionKind],uniforms:["world","viewProjection","color"]});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()}},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){var i=n.minimum,o=n.maximum.subtract(i),s=i.add(o.scale(.5)),c=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(c),t.drawElementsType(u.Material.LineListDrawMode,0,24)),t.setDepthFunctionToLess(),this.scene.resetCachedMaterial(),this._colorShader.setColor4("color",this.frontColor.toColor4()),this._colorShader.bind(c),t.drawElementsType(u.Material.LineListDrawMode,0,24)}}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();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._indexBuffer,this._colorShader.getEffect()),t.setDepthFunctionToLess(),this.scene.resetCachedMaterial(),this._colorShader.bind(s),t.drawElementsType(u.Material.LineListDrawMode,0,24),this._colorShader.unbind(),t.setDepthFunctionToLessOrEqual(),t.setDepthWrite(!0),t.setColorWrite(!0)}},e.prototype.dispose=function(){if(this._colorShader){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)}},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 */"./Maths/math.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/material */"./Materials/material.ts"),c=r(/*! ../Engines/constants */"./Engines/constants.ts"),l=(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){void 0===r&&(r=c.Constants.TEXTURETYPE_FLOAT),void 0===i&&(i=null);var l=this;this.useOnlyInActiveCamera=!1,this._scene=t,e._SceneComponentInitialization(this._scene),this._camera=i;var u=t.getEngine();this._depthMap=new s.RenderTargetTexture("depthMap",{width:u.getRenderWidth(),height:u.getRenderHeight()},this._scene,!1,!0,r),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(new n.Color4(1,1,1,1),!0,!0,!0)});var h=function(e){var t=e.getRenderingMesh(),r=l._scene,n=r.getEngine(),i=e.getMaterial();if(i){n.setState(i.backFaceCulling,0,!1,r.useRightHandedSystem);var o=t._getInstancesRenderList(e._id);if(!o.mustReturn){var s=n.getCaps().instancedArrays&&null!==o.visibleInstances[e._id],c=l._camera||r.activeCamera;if(l.isReady(e,s)&&c){if(n.enableEffect(l._effect),t._bind(e,l._effect,a.Material.TriangleFillMode),l._effect.setMatrix("viewProjection",r.getTransformMatrix()),l._effect.setFloat2("depthValues",c.minZ,c.minZ+c.maxZ),i&&i.needAlphaTesting()){var u=i.getAlphaTestTexture();u&&(l._effect.setTexture("diffuseSampler",u),l._effect.setMatrix("diffuseMatrix",u.getTextureMatrix()))}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&l._effect.setMatrices("mBones",t.skeleton.getTransformMatrices(t)),t._processRendering(e,l._effect,a.Material.TriangleFillMode,o,s,function(e,t){return l._effect.setMatrix("world",t)})}}}};this._depthMap.customRenderFunction=function(e,t,r,n){var i;if(n.length){for(u.setColorWrite(!1),i=0;i<n.length;i++)h(n.data[i]);u.setColorWrite(!0)}for(i=0;i<e.length;i++)h(e.data[i]);for(i=0;i<t.length;i++)h(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"),t&&(n.push("#define INSTANCES"),o.push("world0"),o.push("world1"),o.push("world2"),o.push("world3"));var a=n.join("\n");return this._cachedDefines!==a&&(this._cachedDefines=a,this._effect=this._scene.getEngine().createEffect("depth",o,["world","mBones","viewProjection","diffuseMatrix","depthValues"],["diffuseSampler"],a)),this._effect.isReady()},e.prototype.getDepthMap=function(){return this._depthMap},e.prototype.dispose=function(){this._depthMap.dispose()},e._SceneComponentInitialization=function(e){throw l._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){if(!(e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){var t=0;if(this.getEngine().getCaps().textureHalfFloatRender)t=o.Constants.TEXTURETYPE_HALF_FLOAT;else{if(!this.getEngine().getCaps().textureFloatRender)throw"Depth renderer does not support int texture type";t=o.Constants.TEXTURETYPE_FLOAT}this._depthRenderer[e.id]=new i.DepthRenderer(this,t,e)}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.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.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 f}),r.d(t,"LineEdgesRenderer",function(){return p});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 */"./Maths/math.ts"),c=r(/*! ../Materials/material */"./Materials/material.ts"),l=r(/*! ../Materials/shaderMaterial */"./Materials/shaderMaterial.ts"),u=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),h=r(/*! ../Engines/constants */"./Engines/constants.ts");r(/*! ../Shaders/line.fragment */"./Shaders/line.fragment.ts"),r(/*! ../Shaders/line.vertex */"./Shaders/line.vertex.ts");o.AbstractMesh.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this},o.AbstractMesh.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new f(this,e,t),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 p(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 d=function(){return function(){this.edges=new Array,this.edgesConnectedCount=0}}(),f=function(){function e(e,t,r,n){void 0===t&&(t=.95),void 0===r&&(r=!1),void 0===n&&(n=!0);var i=this;this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this._source=e,this._checkVerticesInsteadOfIndices=r,this._epsilon=t,this._prepareRessources(),n&&this._generateEdgesLines(),this._meshRebuildObserver=this._source.onRebuildObservable.add(function(){i._rebuild()}),this._meshDisposeObserver=this._source.onDisposeObservable.add(function(){i.dispose()})}return e.prototype._prepareRessources=function(){this._lineShader||(this._lineShader=new l.ShaderMaterial("lineShader",this._source.getScene(),"line",{attributes:["position","normal"],uniforms:["worldViewProjection","color","width","aspectRatio"]}),this._lineShader.disableDepthWrite=!0,this._lineShader.backFaceCulling=!1)},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._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){return e.equalsWithEpsilon(r)&&t.equalsWithEpsilon(n)||e.equalsWithEpsilon(n)&&t.equalsWithEpsilon(r)?0:e.equalsWithEpsilon(n)&&t.equalsWithEpsilon(i)||e.equalsWithEpsilon(i)&&t.equalsWithEpsilon(n)?1:e.equalsWithEpsilon(i)&&t.equalsWithEpsilon(r)||e.equalsWithEpsilon(r)&&t.equalsWithEpsilon(i)?2:-1},e.prototype._checkEdge=function(e,t,r,n,i){var o;void 0===t?o=!0:o=a.Vector3.Dot(r[e],r[t])<this._epsilon;o&&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._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 d;var c=t[r],l=t[r+1],u=t[r+2];n.p0=new a.Vector3(e[3*c],e[3*c+1],e[3*c+2]),n.p1=new a.Vector3(e[3*l],e[3*l+1],e[3*l+2]),n.p2=new a.Vector3(e[3*u],e[3*u+1],e[3*u+2]);var h=a.Vector3.Cross(n.p1.subtract(n.p0),n.p2.subtract(n.p1));h.normalize(),s.push(h),o.push(n)}for(r=0;r<o.length;r++){n=o[r];for(var f=r+1;f<o.length;f++){var p=o[f];if(3===n.edgesConnectedCount)break;if(3!==p.edgesConnectedCount)for(var g=t[3*f],m=t[3*f+1],_=t[3*f+2],v=0;v<3;v++){var A=0;if(void 0===n.edges[v]){switch(v){case 0:A=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p0,n.p1,p.p0,p.p1,p.p2):this._processEdgeForAdjacencies(t[3*r],t[3*r+1],g,m,_);break;case 1:A=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p1,n.p2,p.p0,p.p1,p.p2):this._processEdgeForAdjacencies(t[3*r+1],t[3*r+2],g,m,_);break;case 2:A=this._checkVerticesInsteadOfIndices?this._processEdgeForAdjacenciesWithVertices(n.p2,n.p0,p.p0,p.p1,p.p2):this._processEdgeForAdjacencies(t[3*r+2],t[3*r],g,m,_)}if(-1!==A&&(n.edges[v]=f,p.edges[A]=r,n.edgesConnectedCount++,p.edgesConnectedCount++,3===n.edgesConnectedCount))break}}}}for(r=0;r<o.length;r++){var y=o[r];this._checkEdge(r,y.edges[0],s,y.p0,y.p1),this._checkEdge(r,y.edges[1],s,y.p1,y.p2),this._checkEdge(r,y.edges[2],s,y.p2,y.p0)}var b=this._source.getScene().getEngine();this._buffers[i.VertexBuffer.PositionKind]=new i.VertexBuffer(b,this._linesPositions,i.VertexBuffer.PositionKind,!1),this._buffers[i.VertexBuffer.NormalKind]=new i.VertexBuffer(b,this._linesNormals,i.VertexBuffer.NormalKind,!1,!1,4),this._ib=b.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},e.prototype.isReady=function(){return this._lineShader.isReady()},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(h.Constants.ALPHA_COMBINE):t.setAlphaMode(h.Constants.ALPHA_DISABLE),t.bindBuffers(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(c.Material.TriangleFillMode,0,this._indicesCount),this._lineShader.unbind()}},e}(),p=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 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.Tmp.Vector3[0],n=a.Tmp.Vector3[1],o=t.length-1,s=0,c=0;s<o;s+=2,c+=4)a.Vector3.FromArrayToRef(e,3*t[s],r),a.Vector3.FromArrayToRef(e,3*t[s+1],n),this.createLine(r,n,c);var l=this._source.getScene().getEngine();this._buffers[i.VertexBuffer.PositionKind]=new i.VertexBuffer(l,this._linesPositions,i.VertexBuffer.PositionKind,!1),this._buffers[i.VertexBuffer.NormalKind]=new i.VertexBuffer(l,this._linesNormals,i.VertexBuffer.NormalKind,!1,!1,4),this._ib=l.createIndexBuffer(this._linesIndices),this._indicesCount=this._linesIndices.length}},t}(f)},"./Rendering/geometryBufferRenderer.ts":
- /*!*********************************************!*\
- !*** ./Rendering/geometryBufferRenderer.ts ***!
- \*********************************************/
- /*! exports provided: GeometryBufferRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"GeometryBufferRenderer",function(){return u});var n=r(/*! ../Maths/math */"./Maths/math.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"),c=r(/*! ../Materials/material */"./Materials/material.ts"),l=(r(/*! ../Shaders/geometry.fragment */"./Shaders/geometry.fragment.ts"),r(/*! ../Shaders/geometry.vertex */"./Shaders/geometry.vertex.ts"),r(/*! ../Misc/devTools */"./Misc/devTools.ts")),u=function(){function e(t,r){void 0===r&&(r=1),this._previousTransformationMatrices={},this._enablePosition=!1,this._enableVelocity=!1,this._positionIndex=-1,this._velocityIndex=-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:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._multiRenderTarget.isSupported},enumerable:!0,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;default:return-1}},Object.defineProperty(e.prototype,"enablePosition",{get:function(){return this._enablePosition},set:function(e){this._enablePosition=e,this.dispose(),this._createRenderTargets()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableVelocity",{get:function(){return this._enableVelocity},set:function(e){this._enableVelocity=e,this.dispose(),this._createRenderTargets()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ratio",{get:function(){return this._ratio},enumerable:!0,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();r&&r.needAlphaTesting()&&(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"))),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)),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"),t&&(n.push("#define INSTANCES"),o.push("world0"),o.push("world1"),o.push("world2"),o.push("world3")),n.push("#define RENDER_TARGET_COUNT "+this._multiRenderTarget.textures.length);var a=n.join("\n");return this._cachedDefines!==a&&(this._cachedDefines=a,this._effect=this._scene.getEngine().createEffect("geometry",o,["world","mBones","viewProjection","diffuseMatrix","view","previousWorldViewProjection"],["diffuseSampler"],a,void 0,void 0,void 0,{buffersCount:this._enablePosition?3:2})),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:!0,configurable:!0}),e.prototype.dispose=function(){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._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 n.Color4(0,0,0,1),!0,!0,!0)});var i=function(t){var r=t.getRenderingMesh(),i=e._scene,o=i.getEngine(),s=t.getMaterial();if(s){e._previousTransformationMatrices[r.uniqueId]||(e._previousTransformationMatrices[r.uniqueId]=n.Matrix.Identity()),o.setState(s.backFaceCulling,0,!1,i.useRightHandedSystem);var a=r._getInstancesRenderList(t._id);if(!a.mustReturn){var l=o.getCaps().instancedArrays&&null!==a.visibleInstances[t._id];if(e.isReady(t,l)){if(o.enableEffect(e._effect),r._bind(t,e._effect,c.Material.TriangleFillMode),e._effect.setMatrix("viewProjection",i.getTransformMatrix()),e._effect.setMatrix("view",i.getViewMatrix()),s&&s.needAlphaTesting()){var u=s.getAlphaTestTexture();u&&(e._effect.setTexture("diffuseSampler",u),e._effect.setMatrix("diffuseMatrix",u.getTextureMatrix()))}r.useBones&&r.computeBonesUsingShaders&&r.skeleton&&e._effect.setMatrices("mBones",r.skeleton.getTransformMatrices(r)),e._effect.setMatrix("previousWorldViewProjection",e._previousTransformationMatrices[r.uniqueId]),r._processRendering(t,e._effect,c.Material.TriangleFillMode,a,l,function(t,r){return e._effect.setMatrix("world",r)})}e._previousTransformationMatrices[r.uniqueId]=r.getWorldMatrix().multiply(e._scene.getTransformMatrix())}}};this._multiRenderTarget.customRenderFunction=function(e,r,n,o){var s;if(o.length){for(t.setColorWrite(!1),s=0;s<o.length;s++)i(o.data[s]);t.setColorWrite(!0)}for(s=0;s<e.length;s++)i(e.data[s]);for(s=0;s<r.length;s++)i(r.data[s])}}},e.POSITION_TEXTURE_TYPE=1,e.VELOCITY_TEXTURE_TYPE=2,e._SceneComponentInitialization=function(e){throw l._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:(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, 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 c=r(/*! ./geometryBufferRendererSceneComponent */"./Rendering/geometryBufferRendererSceneComponent.ts");r.d(t,"GeometryBufferRendererSceneComponent",function(){return c.GeometryBufferRendererSceneComponent});var l=r(/*! ./outlineRenderer */"./Rendering/outlineRenderer.ts");r.d(t,"OutlineRenderer",function(){return l.OutlineRenderer});var u=r(/*! ./renderingGroup */"./Rendering/renderingGroup.ts");r.d(t,"RenderingGroup",function(){return u.RenderingGroup});var h=r(/*! ./renderingManager */"./Rendering/renderingManager.ts");r.d(t,"RenderingGroupInfo",function(){return h.RenderingGroupInfo}),r.d(t,"RenderingManager",function(){return h.RenderingManager});var d=r(/*! ./utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts");r.d(t,"UtilityLayerRenderer",function(){return d.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 l});var n=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),i=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),o=r(/*! ../scene */"./scene.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../sceneComponent */"./sceneComponent.ts"),c=r(/*! ../Materials/material */"./Materials/material.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 l(this)),this._outlineRenderer},Object.defineProperty(i.AbstractMesh.prototype,"renderOutline",{get:function(){return this._renderOutline},set:function(e){e&&this.getScene().getOutlineRenderer(),this._renderOutline=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.AbstractMesh.prototype,"renderOverlay",{get:function(){return this._renderOverlay},set:function(e){e&&this.getScene().getOutlineRenderer(),this._renderOverlay=e},enumerable:!0,configurable:!0});var l=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];if(this.isReady(e,s)){var a=e.getRenderingMesh(),l=e.getMaterial();if(l&&i.activeCamera){if(o.enableEffect(this._effect),l.useLogarithmicDepth&&this._effect.setFloat("logarithmicDepthConstant",2/(Math.log(i.activeCamera.maxZ+1)/Math.LN2)),this._effect.setFloat("offset",r?0:a.outlineWidth),this._effect.setColor4("color",r?a.overlayColor:a.outlineColor,r?a.overlayAlpha:l.alpha),this._effect.setMatrix("viewProjection",i.getTransformMatrix()),a.useBones&&a.computeBonesUsingShaders&&a.skeleton&&this._effect.setMatrices("mBones",a.skeleton.getTransformMatrices(a)),a._bind(e,this._effect,c.Material.TriangleFillMode),l&&l.needAlphaTesting()){var u=l.getAlphaTestTexture();u&&(this._effect.setTexture("diffuseSampler",u),this._effect.setMatrix("diffuseMatrix",u.getTextureMatrix()))}o.setZOffset(-this.zOffset),a._processRendering(e,this._effect,c.Material.TriangleFillMode,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"),t&&(r.push("#define INSTANCES"),i.push("world0"),i.push("world1"),i.push("world2"),i.push("world3"));var a=r.join("\n");return this._cachedDefines!==a&&(this._cachedDefines=a,this._effect=this.scene.getEngine().createEffect("outline",i,["world","mBones","viewProjection","diffuseMatrix","offset","color","logarithmicDepthConstant"],["diffuseSampler"],a)),this._effect.isReady()},e.prototype._beforeRenderingMesh=function(t,r,n){if(this._savedDepthWrite=this._engine.getDepthWrite(),t.renderOutline){var i=r.getMaterial();i&&i.needAlphaBlending&&(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.needAlphaBlending&&this._engine.restoreStencilState()}},e.prototype._afterRenderingMesh=function(e,t,r){if(e.renderOutline&&this._savedDepthWrite&&(this._engine.setDepthWrite(!0),this._engine.setColorWrite(!1),this.render(t,r),this._engine.setColorWrite(!0)),e.renderOverlay){var n=this._engine.getAlphaMode();this._engine.setAlphaMode(s.Constants.ALPHA_COMBINE),this.render(t,r,!0),this._engine.setAlphaMode(n)}},e._StencilReference=4,e}()},"./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 */"./Maths/math.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.SmartArray(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:!0,configurable:!0}),Object.defineProperty(e.prototype,"alphaTestSortCompareFn",{set:function(t){this._alphaTestSortCompareFn=t,this._renderAlphaTest=t?this.renderAlphaTestSorted:e.renderUnsorted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transparentSortCompareFn",{set:function(t){this._transparentSortCompareFn=t||e.defaultTransparentSortCompare,this._renderTransparent=this.renderTransparentSorted},enumerable:!0,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&&(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(e,t,r,n){for(var s,a=0,c=r?r.globalPosition:i.Vector3.Zero();a<e.length;a++)(s=e.data[a])._alphaIndex=s.getMesh().alphaIndex,s._distanceToCamera=s.getBoundingInfo().boundingSphere.centerWorld.subtract(c).length();var l=e.data.slice(0,e.length);for(t&&l.sort(t),a=0;a<l.length;a++){if(s=l[a],n){var u=s.getMaterial();if(u&&u.needDepthPrePass){var h=u.getScene().getEngine();h.setColorWrite(!1),h.setAlphaMode(o.Constants.ALPHA_DISABLE),s.render(!1),h.setColorWrite(!0)}}s.render(n)}},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._edgesRenderer&&t._edgesRenderer.isEnabled&&this._edgesRenderers.push(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}()},"./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(){return 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 c=this._renderingGroups[s];if(c){var l=Math.pow(2,s);if(o.renderingGroupId=s,this._scene.onBeforeRenderingGroupObservable.notifyObservers(o,l),e.AUTOCLEAR){var u=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(s):this._autoClearDepthStencil[s];u&&u.autoClear&&this._clearDepthStencilBuffer(u.depth,u.stencil)}for(var h=0,d=this._scene._beforeRenderingGroupDrawStage;h<d.length;h++){d[h].action(s)}c.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,l)}}},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/utilityLayerRenderer.ts":
- /*!*******************************************!*\
- !*** ./Rendering/utilityLayerRenderer.ts ***!
- \*******************************************/
- /*! exports provided: UtilityLayerRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"UtilityLayerRenderer",function(){return a});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=function(){function e(e,t){void 0===t&&(t=!0);var r=this;this.originalScene=e,this._pointerCaptures={},this._lastPointerEvents={},this.pickUtilitySceneFirst=!0,this.shouldRender=!0,this.onlyCheckPointerDownEvents=!0,this.processAllEvents=!1,this.onPointerOutObservable=new i.Observable,this.utilityLayerScene=new n.Scene(e.getEngine()),this.utilityLayerScene.useRightHandedSystem=e.useRightHandedSystem,this.utilityLayerScene._allowPostProcessClearColor=!1,e.getEngine().scenes.pop(),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)){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),c=t.event;a&&s&&(0===s.distance&&a.pickedMesh?r.mainSceneTrackerPredicate&&r.mainSceneTrackerPredicate(a.pickedMesh)?(r._notifyObservers(t,a,c),t.skipOnPointerObservable=!0):t.type===o.PointerEventTypes.POINTERDOWN?r._pointerCaptures[c.pointerId]=!0:r._lastPointerEvents[c.pointerId]&&(r.onPointerOutObservable.notifyObservers(c.pointerId),delete r._lastPointerEvents[c.pointerId]):!r._pointerCaptures[c.pointerId]&&(s.distance<a.distance||0===a.distance)?(r._notifyObservers(t,s,c),t.skipOnPointerObservable||(t.skipOnPointerObservable=s.distance>0)):!r._pointerCaptures[c.pointerId]&&s.distance>a.distance&&(r.mainSceneTrackerPredicate&&r.mainSceneTrackerPredicate(a.pickedMesh)?(r._notifyObservers(t,a,c),t.skipOnPointerObservable=!0):r._lastPointerEvents[c.pointerId]&&(r.onPointerOutObservable.notifyObservers(c.pointerId),delete r._lastPointerEvents[c.pointerId])),t.type===o.PointerEventTypes.POINTERUP&&r._pointerCaptures[c.pointerId]&&(r._pointerCaptures[c.pointerId]=!1))}}}}),this._originalPointerObserver&&e.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)),this.utilityLayerScene.autoClear=!1,this._afterRenderObserver=this.originalScene.onAfterRenderObservable.add(function(){r.shouldRender&&r.render()}),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add(function(){r.dispose()}),this._updateCamera()}return 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:!0,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:!0,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.onAfterRenderObservable.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.originalScene.activeCameras.length>1?this.utilityLayerScene.activeCamera=this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:this.utilityLayerScene.activeCamera=this.originalScene.activeCamera},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/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\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)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#else\nfloat normalScale=vBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vBumpUV);\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 BUMP\n#ifdef OBJECTSPACE_NORMALMAP\nnormalW=normalize(texture2D(bumpSampler,vBumpUV).xyz*2.0-1.0);\nnormalW=normalize(mat3(normalMatrix)*normalW);\n#else\nnormalW=perturbNormal(TBN,vBumpUV+uvOffset);\n#endif\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) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform mat4 normalMatrix;\n#endif\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv,sampler2D textureSampler,float scale)\n{\nvec3 map=texture2D(textureSampler,uv).xyz;\nmap=map*2.0-1.0;\n#ifdef NORMALXYSCALE\nmap=normalize(map*vec3(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*map);\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#ifdef 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,uv,bumpSampler,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/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)\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)\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";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";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";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";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";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";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#ifdef REFLECTIONMAP_SKYBOX\n#else\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION)\nuniform mat4 reflectionMatrix;\n#endif\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;\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/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\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;\nvec3 quaternionVectorRotation_ScaledSqrtTwo(vec4 Q,vec3 V){\nvec3 T=cross(Q.xyz,V);\nT+=Q.www*V;\nreturn cross(Q.xyz,T)+V;\n}\nvec3 environmentIrradianceJones(vec3 normal)\n{\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";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 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}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(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}";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\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/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#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#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}.vLightDiffuse.a,preInfo.lightDistance);\n#endif\n\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);\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,anisotropicTangent,anisotropicBitangent,anisotropy,specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n#endif\n\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\n\npreInfo.roughness=sheenIntensity;\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef CLEARCOAT\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearCoatRoughness,light{X}.vLightDiffuse.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearCoatNormalW,clearCoatAARoughnessFactors.x,clearCoatIntensity,light{X}.vLightDiffuse.rgb);\n#ifdef CLEARCOAT_TINT\n\nabsorption=computeClearCoatLightingAbsorption(clearCoatNdotVRefract,preInfo.L,clearCoatNormalW,clearCoatColor,clearCoatThickness,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*info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w*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,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,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,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 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*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\ndiffuseBase+=info.diffuse*shadow;\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 vec3 vLightSpecular{X};\n#else\nvec3 vLightSpecular{X}=vec3(0.);\n#endif\n#ifdef SHADOW{X}\n#if 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;\nvec3 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#if 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}\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#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#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/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,sampler2D brdfSampler) {\n\nvec2 UV=vec2(NdotV,perceptualRoughness);\n\nvec4 brdfLookup=texture2D(brdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;\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#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(REFLECTION)\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\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\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#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";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) {\nreturn;\n}\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) || defined(PARALLAX) || defined(ANISOTROPIC))\n\ngl_FragColor.rgb=TBN[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 4 && (defined(BUMP) || defined(PARALLAX) || 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=TBNClearCoat[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=TBNClearCoat[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 10 && defined(CLEARCOAT)\n\ngl_FragColor.rgb=clearCoatNormalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 11 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicNormal;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 12 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicTangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 13 && defined(ANISOTROPIC)\ngl_FragColor.rgb=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=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=surfaceMetallicColorMap.rgb;\n#elif DEBUGMODE == 26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)\ngl_FragColor.rgb=surfaceReflectivityColorMap.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)\ngl_FragColor.rgb=clearCoatMapData.rgb;\n#elif DEBUGMODE == 28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\ngl_FragColor.rgb=clearCoatTintMapData.rgb;\n#elif DEBUGMODE == 29 && defined(SHEEN) && defined(SHEEN_TEXTURE)\ngl_FragColor.rgb=sheenMapData.rgb;\n#elif DEBUGMODE == 30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)\ngl_FragColor.rgb=anisotropyMapData.rgb;\n\n#elif DEBUGMODE == 40 && defined(REFRACTION)\n\ngl_FragColor.rgb=environmentRefraction.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 41 && defined(REFLECTION)\ngl_FragColor.rgb=environmentRadiance.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 42 && defined(CLEARCOAT) && defined(REFLECTION)\ngl_FragColor.rgb=environmentClearCoatRadiance;\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=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=specularEnvironmentR0;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 62\ngl_FragColor.rgb=vec3(roughness);\n#elif DEBUGMODE == 63\ngl_FragColor.rgb=vec3(alphaG);\n#elif DEBUGMODE == 64\ngl_FragColor.rgb=vec3(NdotV);\n#elif DEBUGMODE == 65 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\ngl_FragColor.rgb=clearCoatColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 66 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearCoatRoughness);\n#elif DEBUGMODE == 67 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearCoatNdotV);\n\n#elif DEBUGMODE == 70 && defined(RADIANCEOCCLUSION)\ngl_FragColor.rgb=vec3(seo);\n#elif DEBUGMODE == 71 && defined(HORIZONOCCLUSION)\ngl_FragColor.rgb=vec3(eho);\n#elif DEBUGMODE == 72 && defined(MS_BRDF_ENERGY_CONSERVATION)\ngl_FragColor.rgb=vec3(energyConservationFactor);\n#elif DEBUGMODE == 73 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=specularEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 74 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=clearCoatEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 75 && defined(SHEEN) && defined(REFLECTION)\ngl_FragColor.rgb=sheenEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 76 && defined(ALPHABLEND)\ngl_FragColor.rgb=vec3(luminanceOverAlpha);\n#elif DEBUGMODE == 77\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#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}\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 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 visibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);\n#else\nfloat visibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);\n#endif\nvec3 specTerm=fresnel*distribution*visibility;\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 visibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);\nvec3 specTerm=fresnel*distribution*visibility;\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 visibility=visibility_Kelemen(info.VdotH);\nfloat clearCoatTerm=fresnel*distribution*visibility;\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\nvec3 fresnel=reflectance0;\nfloat distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);\nfloat visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);\nvec3 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 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.NdotL=saturateEps(dot(N,result.L));\nresult.VdotH=saturate(dot(V,result.H));\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.NdotL=saturateEps(dot(N,result.L));\nresult.VdotH=saturate(dot(V,result.H));\nreturn result;\n}\npreLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.NdotL=dot(N,lightData.xyz)*0.5+0.5;\nresult.NdotL=saturateEps(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 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(REFRACTION)\nuniform mat4 view;\n#endif\n\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\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_TEXTURE\nuniform vec2 vSheenInfos;\nuniform mat4 sheenMatrix;\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";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 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 REFRACTION\n#ifdef 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 samplerCube refractionSamplerLow;\nuniform samplerCube refractionSamplerHigh;\n#endif\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#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 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#endif\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\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#ifdef CLEARCOAT\n\n\n\n\nvec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {\nreturn exp(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(REFRACTION)\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {\nfloat microsurfaceAverageSlopeTexels=microsurfaceAverageSlope*cubeMapDimensionPixels;\nfloat lod=log2(microsurfaceAverageSlopeTexels);\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) {\n\nvec3 reflection=reflect(view,normal);\nfloat temp=saturate(1.0+1.1*dot(reflection,normal));\nreturn square(temp);\n}\n#endif\n\n\n\n\n#if defined(LODINREFLECTIONALPHA) || defined(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 vec4 vRefractionInfos;\nuniform vec2 vReflectionInfos;\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 refractionMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\nuniform vec4 vLightingIntensity;\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float pointSize;\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\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 vec2 vSheenInfos;\nuniform mat4 sheenMatrix;\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 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 REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\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";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/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="#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nvec3 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}\n#endif\nvec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvec3 direction=normalize(vDirectionW);\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;\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nreturn vec3(1.0-s,t,0);\n#else\nreturn vec3(s,t,0);\n#endif\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nvec3 cameraToVertex=normalize(worldPos.xyz-vEyePosition.xyz);\nvec3 r=normalize(reflect(cameraToVertex,worldNormal));\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#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\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#endif\n#ifdef REFLECTIONMAP_PLANAR\nvec3 viewDir=worldPos.xyz-vEyePosition.xyz;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n#endif\n#ifdef REFLECTIONMAP_CUBIC\nvec3 viewDir=normalize(worldPos.xyz-vEyePosition.xyz);\n\nvec3 coords=reflect(viewDir,worldNormal);\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\ncoords=parallaxCorrectNormal(worldPos.xyz,coords,vReflectionSize,vReflectionPosition);\n#endif\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn vec3(reflectionMatrix*(view*worldPos));\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn vPositionUVW;\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\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\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.0,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\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\nif (depth>shadow)\n{\nreturn darkness;\n}\nreturn 1.0;\n}\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}\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}\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}\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}\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\nif (shadowPixelDepth>shadow)\n{\nreturn computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff);\n}\nreturn 1.;\n}\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}\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}\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}\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}\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}\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#ifdef WEBGL2\n\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\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\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}\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\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}\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}\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\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}\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}\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}\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}\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}\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#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(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/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\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#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\n#ifdef REFLECTIONMAP_SKYBOX_TRANSFORMED\nvPositionUVW=(reflectionMatrix*vec4(position,1.0)).xyz;\n#else\nvPositionUVW=position;\n#endif\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\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\ngl_Position=viewProjection*worldPos;\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/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/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#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\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<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#ifdef ALPHATEST\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#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\nvec3 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset).rgb*vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n\nvec3 refractionColor=vec3(0.,0.,0.);\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).rgb;\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).rgb;\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor=toGammaSpace(refractionColor);\n#endif\nrefractionColor*=vRefractionInfos.x;\n#endif\n\nvec3 reflectionColor=vec3(0.,0.,0.);\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).rgb;\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW).rgb;\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).rgb;\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor=toGammaSpace(reflectionColor);\n#endif\nreflectionColor*=vReflectionInfos.x;\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor*=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*=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\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,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+emissiveColor+refractionColor,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+refractionColor,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor;\n#else\ncolor.rgb+=lightmapColor;\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\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 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(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#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\n#ifdef REFLECTIONMAP_SKYBOX_TRANSFORMED\nvPositionUVW=(reflectionMatrix*vec4(position,1.0)).xyz;\n#else\nvPositionUVW=position;\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n} else {\ngl_Position=viewProjectionR*finalWorld*vec4(positionUpdated,1.0);\n}\n#else\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#endif\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\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 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#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv,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(uv,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(uv,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(uv,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(uv,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(uv,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 o});var n="depthPixelShader",i="#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nvarying float vDepthMetric;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(vDepthMetric,vDepthMetric*vDepthMetric,0.0,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./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/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),"depthVertexShader"),o="\nattribute vec3 position;\n#include<bonesDeclaration>\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{\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\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"),"geometryPixelShader"),o="#extension GL_EXT_draw_buffers : require\nprecision highp float;\nprecision highp int;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef VELOCITY\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<mrtFragmentDeclaration>[RENDER_TARGET_COUNT]\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\ngl_FragData[1]=vec4(normalize(vNormalV),1.0);\n\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPosition,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=(a-b)*0.5+0.5;\nvelocity*=0.5+0.5;\nvelocity=vec2(pow(velocity.x,3.0),pow(velocity.y,3.0));\ngl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\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/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),"geometryVertexShader"),o="precision highp float;\nprecision highp int;\n#include<bonesDeclaration>\n#include<instancesDeclaration>\nattribute vec3 position;\nattribute vec3 normal;\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\n\nuniform mat4 viewProjection;\nuniform mat4 view;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef VELOCITY\nuniform mat4 previousWorldViewProjection;\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\nvoid main(void)\n{\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 pos=vec4(finalWorld*vec4(position,1.0));\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normal,0.0)));\nvViewPos=view*pos;\n#ifdef POSITION\nvPosition=pos.xyz/pos.w;\n#endif\n#ifdef VELOCITY\nvCurrentPosition=viewProjection*finalWorld*vec4(position,1.0);\nvPreviousPosition=previousWorldViewProjection*vec4(position,1.0);\n#endif\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\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\nuniform vec4 color;\nvoid main(void)\n{\nvec4 finalColor=color;\n\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\nfinalColor.a*=albedoTexture.a;\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 GLOW\ngl_FragColor.rgb*=gl_FragColor.a;\ngl_FragColor.a=1.0;\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#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(uv,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(uv,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(uv,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 textureSampler;\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(textureSampler,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\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;\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\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;\nreturn (position+worldOffset)+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+worldOffset)+alignedCorner;\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.;\nvec3 worldPos=rotate(normalize(yaxis),rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(worldPos,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;\nvec3 worldPos=rotateAlign(toCamera,rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(worldPos,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\nvec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;\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);\nvec3 worldPos=rotate(yaxis,rotatedCorner);\n\nvec4 viewPosition=view*vec4(worldPos,1.0);\n#endif\ngl_Position=projection*viewPosition;\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nvec4 worldPos=invView*viewPosition;\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;\nuniform mat4 emitterWM;\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;\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;\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 position;\nvec3 direction;\n\nvec4 randoms=getRandomVec4(seed.x);\n\noutLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;\noutAge=mod(newAge,outLife);\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);\nposition=vec3(0,0,0);\ndirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(BOXEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nposition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;\ndirection=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);\nposition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);\ndirection=position+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);\nposition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\ndirection=direction1+(direction2-direction1)*randoms3;\n#else\n\ndirection=position+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);\nposition=vec3(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\ndirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nangle=angle+((randoms3.x-0.5)*PI);\ndirection=vec3(cos(angle),randoms3.y-0.5,sin(angle));\ndirection=normalize(direction);\n#endif\n#elif defined(CONEEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nfloat s=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nfloat h=0.00001;\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;\nposition=vec3(randX,randY,randZ);\n\nif (abs(cos(coneAngle)) == 1.0) {\ndirection=vec3(0.,1.0,0.);\n} else {\nvec3 randoms3=getRandomVec3(seed.z);\ndirection=position+directionRandomizer*randoms3;\n}\n#else\n\nposition=vec3(0.,0.,0.);\n\ndirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));\n#endif\nfloat power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;\noutPosition=(emitterWM*vec4(position,1.)).xyz;\nvec3 initial=(emitterWM*vec4(direction,0.)).xyz;\noutDirection=initial*power;\n#ifndef BILLBOARD\noutInitialDirection=initial;\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\noutPosition=position+direction*directionScale;\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\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\nvec3 localPosition=outPosition-emitterWM[3].xyz;\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#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#endif\nfloat ratio=clamp(mod(offsetAge*cellInfos.z,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/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/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\nvec4 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}\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 o});var n="layerPixelShader",i="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./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 o});var n="lineVertexShader",i="\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 worldViewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\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}";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;\nvec2 velocity=vec2(pow(velocityColor.r,1.0/3.0),pow(velocityColor.g,1.0/3.0))*2.0-1.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);\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/instancesDeclaration */"./Shaders/ShadersInclude/instancesDeclaration.ts"),r(/*! ./ShadersInclude/logDepthDeclaration */"./Shaders/ShadersInclude/logDepthDeclaration.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\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 offsetPosition=position+normal*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(uv,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;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\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.;\nvec3 worldPos=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,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;\nvec3 worldPos=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,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;\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);\nvec3 worldPos=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(worldPos,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)\nvec4 worldPos=invView*vec4(viewPos,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/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/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/pbrDirectLightingFunctions */"./Shaders/ShadersInclude/pbrDirectLightingFunctions.ts"),r(/*! ./ShadersInclude/pbrIBLFunctions */"./Shaders/ShadersInclude/pbrIBLFunctions.ts"),r(/*! ./ShadersInclude/bumpFragmentFunctions */"./Shaders/ShadersInclude/bumpFragmentFunctions.ts"),r(/*! ./ShadersInclude/reflectionFunction */"./Shaders/ShadersInclude/reflectionFunction.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"),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#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision highp float;\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<pbrHelperFunctions>\n#include<imageProcessingFunctions>\n#include<shadowsFragmentFunctions>\n#include<harmonicsFunctions>\n#include<pbrDirectLightingSetupFunctions>\n#include<pbrDirectLightingFalloffFunctions>\n#include<pbrBRDFFunctions>\n#include<pbrDirectLightingFunctions>\n#include<pbrIBLFunctions>\n#include<bumpFragmentFunctions>\n#ifdef REFLECTION\n#include<reflectionFunction>\n#endif\n\nvoid main(void) {\n#include<clipPlaneFragment>\n\nvec3 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\n#ifdef CLEARCOAT\n\nvec3 clearCoatNormalW=normalW;\n#endif\n#include<bumpFragment>\n#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\n\nvec3 surfaceAlbedo=vAlbedoColor.rgb;\n\nfloat alpha=vAlbedoColor.a;\n#ifdef ALBEDO\nvec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\nsurfaceAlbedo*=toLinearSpace(albedoTexture.rgb);\nsurfaceAlbedo*=vAlbedoInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nsurfaceAlbedo*=vColor.rgb;\n#endif\n\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\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(LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\n#include<depthPrePass>\n\nvec3 ambientOcclusionColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#endif\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\n\nfloat microSurface=vReflectivityColor.a;\nvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\n#ifdef REFLECTIVITY\nvec4 surfaceMetallicColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicColorMap.r,surfaceMetallicColorMap.r,surfaceMetallicColorMap.r);\nambientOcclusionColor=mix(ambientOcclusionColor,aoStoreInMetalMap,vReflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicColorMap.g;\n#endif\n#endif\n#endif\n#ifdef MICROSURFACEMAP\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n\nmicroSurface=1.0-metallicRoughness.g;\n\nvec3 baseColor=surfaceAlbedo;\n#ifdef REFLECTANCE\n\n\n\n\n\nsurfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);\n#else\n\n\n\nconst vec3 DefaultSpecularReflectanceDielectric=vec3(0.04,0.04,0.04);\n\nsurfaceAlbedo=mix(baseColor.rgb*(1.0-DefaultSpecularReflectanceDielectric.r),vec3(0.,0.,0.),metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(DefaultSpecularReflectanceDielectric,baseColor,metallicRoughness.r);\n#endif\n#else\n#ifdef REFLECTIVITY\nvec4 surfaceReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\nsurfaceReflectivityColor*=toLinearSpace(surfaceReflectivityColorMap.rgb);\nsurfaceReflectivityColor*=vReflectivityInfos.y;\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceReflectivityColorMap.a;\nmicroSurface*=vReflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#endif\n#endif\n#endif\n\nmicroSurface=saturate(microSurface);\n\nfloat roughness=1.-microSurface;\n\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\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\nalpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\n#endif\n\nfloat 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#ifdef ANISOTROPIC\nfloat anisotropy=vAnisotropy.b;\nvec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);\n#ifdef ANISOTROPIC_TEXTURE\nvec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;\nanisotropy*=anisotropyMapData.b;\nanisotropyDirection.rg*=anisotropyMapData.rg*2.0-1.0;\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));\nvec3 anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy);\n#endif\n\n#ifdef REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\n#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicNormal,vRefractionInfos.y);\n#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\n#endif\n#ifdef REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n\n#ifdef 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 LODINREFRACTIONALPHA\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#else\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef 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\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\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 RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\n#endif\n#ifdef GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\n#endif\n\nenvironmentRefraction.rgb*=vRefractionInfos.x;\n#endif\n\n#ifdef REFLECTION\nvec4 environmentRadiance=vec4(0.,0.,0.,0.);\nvec3 environmentIrradiance=vec3(0.,0.,0.);\n#ifdef ANISOTROPIC\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),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\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#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\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\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,requestedReflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 environmentSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodReflectionNormalizedDoubled<1.0){\nenvironmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentSpecularMid,\nlodReflectionNormalizedDoubled\n);\n}else{\nenvironmentRadiance=mix(\nenvironmentSpecularMid,\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\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#ifdef ANISOTROPIC\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(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\nenvironmentIrradiance=environmentIrradianceJones(irradianceVector);\n#endif\n#endif\n\nenvironmentRadiance.rgb*=vReflectionInfos.x;\nenvironmentRadiance.rgb*=vReflectionColor.rgb;\nenvironmentIrradiance*=vReflectionColor.rgb;\n#endif\n\nfloat reflectance=max(max(surfaceReflectivityColor.r,surfaceReflectivityColor.g),surfaceReflectivityColor.b);\nfloat reflectance90=fresnelGrazingReflectance(reflectance);\nvec3 specularEnvironmentR0=surfaceReflectivityColor.rgb;\nvec3 specularEnvironmentR90=vec3(1.0,1.0,1.0)*reflectance90;\n\n#ifdef SHEEN\nfloat sheenIntensity=vSheenColor.a;\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData=texture2D(sheenSampler,vSheenUV+uvOffset)*vSheenInfos.y;\nsheenIntensity*=sheenMapData.a;\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);\nvec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);\nfloat sheenRoughness=sheenIntensity;\n\nsurfaceAlbedo.rgb*=sheenFactor;\n#else\nvec3 sheenColor=vSheenColor.rgb;\n#ifdef SHEEN_TEXTURE\nsheenColor.rgb*=toLinearSpace(sheenMapData.rgb);\n#endif\nfloat sheenRoughness=roughness;\n\nsheenIntensity*=(1.-reflectance);\n\nsheenColor*=sheenIntensity;\n#endif\n\n#if defined(REFLECTION)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\n#ifdef SPECULARAA\n\nsheenAlphaG+=AARoughnessFactors.y;\n#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);\n\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat sheenReflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,sheenAlphaG,NdotVUnclamped);\n#else\nfloat sheenReflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,sheenAlphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nsheenReflectionLOD=sheenReflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\nenvironmentSheenRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,sheenReflectionLOD);\n#else\nfloat lodSheenReflectionNormalized=saturate(sheenReflectionLOD/log2(vReflectionMicrosurfaceInfos.x));\nfloat lodSheenReflectionNormalizedDoubled=lodSheenReflectionNormalized*2.0;\nvec4 environmentSheenMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodSheenReflectionNormalizedDoubled<1.0){\nenvironmentSheenRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentSheenMid,\nlodSheenReflectionNormalizedDoubled\n);\n}else{\nenvironmentSheenRadiance=mix(\nenvironmentSheenMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodSheenReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentSheenRadiance.rgb=fromRGBD(environmentSheenRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentSheenRadiance.rgb=toLinearSpace(environmentSheenRadiance.rgb);\n#endif\n\nenvironmentSheenRadiance.rgb*=vReflectionInfos.x;\nenvironmentSheenRadiance.rgb*=vReflectionColor.rgb;\n#endif\n#endif\n\n#ifdef CLEARCOAT\n\nfloat clearCoatIntensity=vClearCoatParams.x;\nfloat clearCoatRoughness=vClearCoatParams.y;\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;\nclearCoatIntensity*=clearCoatMapData.x;\nclearCoatRoughness*=clearCoatMapData.y;\n#endif\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;\nfloat clearCoatThickness=vClearCoatTintParams.a;\n#ifdef CLEARCOAT_TINT_TEXTURE\nvec4 clearCoatTintMapData=texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset);\nclearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb);\nclearCoatThickness*=clearCoatTintMapData.a;\n#endif\nclearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);\n#endif\n\n\n\n\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\nspecularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);\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#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset).xyz*2.0-1.0);\nclearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\n#else\nclearCoatNormalW=perturbNormal(TBN,vClearCoatBumpUV+uvOffset,clearCoatBumpSampler,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\n\nvec2 clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);\n\nfloat clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);\n\nfloat clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\n\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\n#ifdef SPECULARAA\n\nclearCoatAlphaG+=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\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat clearCoatReflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,clearCoatAlphaG,clearCoatNdotVUnclamped);\n#else\nfloat clearCoatReflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,clearCoatAlphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nclearCoatReflectionLOD=clearCoatReflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\nfloat requestedClearCoatReflectionLOD=clearCoatReflectionLOD;\nenvironmentClearCoatRadiance=sampleReflectionLod(reflectionSampler,clearCoatReflectionCoords,requestedClearCoatReflectionLOD);\n#else\nfloat lodClearCoatReflectionNormalized=saturate(clearCoatReflectionLOD/log2(vReflectionMicrosurfaceInfos.x));\nfloat lodClearCoatReflectionNormalizedDoubled=lodClearCoatReflectionNormalized*2.0;\nvec4 environmentClearCoatMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodClearCoatReflectionNormalizedDoubled<1.0){\nenvironmentClearCoatRadiance=mix(\nsampleReflection(reflectionSamplerHigh,clearCoatReflectionCoords),\nenvironmentClearCoatMid,\nlodClearCoatReflectionNormalizedDoubled\n);\n}else{\nenvironmentClearCoatRadiance=mix(\nenvironmentClearCoatMid,\nsampleReflection(reflectionSamplerLow,clearCoatReflectionCoords),\nlodClearCoatReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentClearCoatRadiance.rgb=fromRGBD(environmentClearCoatRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentClearCoatRadiance.rgb=toLinearSpace(environmentClearCoatRadiance.rgb);\n#endif\n#ifdef CLEARCOAT_TINT\n\nvec3 clearCoatVRefract=-refract(vPositionW,clearCoatNormalW,vClearCoatRefractionParams.y);\n\nfloat clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\nvec3 absorption=vec3(0.);\n#endif\n\nenvironmentClearCoatRadiance.rgb*=vReflectionInfos.x;\nenvironmentClearCoatRadiance.rgb*=vReflectionColor.rgb;\n#endif\n#endif\n\n#if defined(ENVIRONMENTBRDF)\n\nvec3 environmentBrdf=getBRDFLookup(NdotV,roughness,environmentBrdfSampler);\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 energyConservationFactor=getEnergyConservationFactor(specularEnvironmentR0,environmentBrdf);\n#endif\n#endif\n\n\nvec3 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#ifdef LIGHTMAP\nvec3 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset).rgb;\n#ifdef GAMMALIGHTMAP\nlightmapColor=toLinearSpace(lightmapColor);\n#endif\nlightmapColor*=vLightmapInfos.y;\n#endif\n\npreLightingInfo preInfo;\nlightingInfo info;\nfloat shadow=1.;\n#include<lightFragment>[0..maxSimultaneousLights]\n\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(specularEnvironmentR0,environmentBrdf);\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nfloat ambientMonochrome=ambientOcclusionColor.r;\n#else\nfloat ambientMonochrome=getLuminance(ambientOcclusionColor);\n#endif\nfloat seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\nspecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat eho=environmentHorizonOcclusion(-viewDirectionW,normalW);\nspecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\n\nvec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));\n#endif\n\n#if defined(SHEEN) && defined(REFLECTION)\nvec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentBrdf);\n#ifdef RADIANCEOCCLUSION\nsheenEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nsheenEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#endif\n\n#ifdef CLEARCOAT\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness,environmentBrdfSampler);\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);\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#ifdef CLEARCOAT_TINT\n\nabsorption=computeClearCoatAbsorption(clearCoatNdotVRefract,clearCoatNdotVRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);\n#ifdef REFLECTION\nenvironmentIrradiance*=absorption;\n#endif\n#ifdef SHEEN\nsheenEnvironmentReflectance*=absorption;\n#endif\nspecularEnvironmentReflectance*=absorption;\n#endif\n\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnelIBLClearCoat*=clearCoatIntensity;\nfloat conservationFactor=(1.-fresnelIBLClearCoat);\n#ifdef REFLECTION\nenvironmentIrradiance*=conservationFactor;\n#endif\n#ifdef SHEEN\nsheenEnvironmentReflectance*=(conservationFactor*conservationFactor);\n#endif\nspecularEnvironmentReflectance*=(conservationFactor*conservationFactor);\n#endif\n\n#ifdef REFRACTION\nvec3 refractance=vec3(0.0,0.0,0.0);\nvec3 transmission=vec3(1.0,1.0,1.0);\n#ifdef LINKREFRACTIONTOTRANSPARENCY\n\ntransmission*=(1.0-alpha);\n\n\nvec3 mixedAlbedo=surfaceAlbedo;\nfloat maxChannel=max(max(mixedAlbedo.r,mixedAlbedo.g),mixedAlbedo.b);\nvec3 tint=saturate(maxChannel*mixedAlbedo);\n\nsurfaceAlbedo*=alpha;\n\nenvironmentIrradiance*=alpha;\n\nenvironmentRefraction.rgb*=tint;\n\nalpha=1.0;\n#endif\n\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\nspecularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,alpha);\n\ntransmission*=1.0-specularEnvironmentReflectance;\n\nrefractance=transmission;\n#endif\n\n\n\n#ifndef METALLICWORKFLOW\nsurfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;\n#endif\n\n#ifdef REFLECTION\nvec3 finalIrradiance=environmentIrradiance;\nfinalIrradiance*=surfaceAlbedo.rgb;\n#endif\n\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase;\nfinalSpecular=max(finalSpecular,0.0);\n\nvec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalSpecularScaled*=energyConservationFactor;\n#endif\n#endif\n\n#ifdef REFLECTION\nvec3 finalRadiance=environmentRadiance.rgb;\nfinalRadiance*=specularEnvironmentReflectance;\n\nvec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalRadianceScaled*=energyConservationFactor;\n#endif\n#endif\n\n#ifdef REFRACTION\nvec3 finalRefraction=environmentRefraction.rgb;\nfinalRefraction*=refractance;\n#endif\n\n#ifdef CLEARCOAT\nvec3 finalClearCoat=clearCoatBase;\nfinalClearCoat=max(finalClearCoat,0.0);\n\nvec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalClearCoatScaled*=energyConservationFactor;\n#endif\n\n#ifdef REFLECTION\nvec3 finalClearCoatRadiance=environmentClearCoatRadiance.rgb;\nfinalClearCoatRadiance*=clearCoatEnvironmentReflectance;\n\nvec3 finalClearCoatRadianceScaled=finalClearCoatRadiance*vLightingIntensity.z;\n#endif\n#ifdef REFRACTION\nfinalRefraction*=(conservationFactor*conservationFactor);\n#ifdef CLEARCOAT_TINT\nfinalRefraction*=absorption;\n#endif\n#endif\n#endif\n\n#ifdef SHEEN\nvec3 finalSheen=sheenBase*sheenColor;\nfinalSheen=max(finalSheen,0.0);\nvec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;\n\n\n\n\n\n#ifdef REFLECTION\nvec3 finalSheenRadiance=environmentSheenRadiance.rgb;\nfinalSheenRadiance*=sheenEnvironmentReflectance;\n\nvec3 finalSheenRadianceScaled=finalSheenRadiance*vLightingIntensity.z;\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(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#endif\n\n\nvec3 finalDiffuse=diffuseBase;\nfinalDiffuse*=surfaceAlbedo.rgb;\nfinalDiffuse=max(finalDiffuse,0.0);\n\nvec3 finalEmissive=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\nfinalEmissive*=toLinearSpace(emissiveColorTex.rgb);\nfinalEmissive*=vEmissiveInfos.y;\n#endif\n\n#ifdef AMBIENT\nvec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),ambientOcclusionColor,vAmbientInfos.w);\n#else\nvec3 ambientOcclusionForDirectDiffuse=ambientOcclusionColor;\n#endif\n\n\n\nvec4 finalColor=vec4(\nvAmbientColor*ambientOcclusionColor +\nfinalDiffuse*ambientOcclusionForDirectDiffuse*vLightingIntensity.x +\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance*ambientOcclusionColor*vLightingIntensity.z +\n#endif\n#ifdef SPECULARTERM\n\n\nfinalSpecularScaled +\n#endif\n#ifdef CLEARCOAT\n\n\nfinalClearCoatScaled +\n#endif\n#ifdef SHEEN\n\n\nfinalSheenScaled +\n#endif\n#ifdef REFLECTION\n\n\nfinalRadianceScaled +\n#ifdef CLEARCOAT\n\n\nfinalClearCoatRadianceScaled +\n#endif\n#ifdef SHEEN\n\n\nfinalSheenRadianceScaled +\n#endif\n#endif\n#ifdef REFRACTION\nfinalRefraction*vLightingIntensity.z +\n#endif\n#endif\nfinalEmissive*vLightingIntensity.y,\nalpha);\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor;\n#else\nfinalColor.rgb+=lightmapColor;\n#endif\n#endif\n#endif\n\nfinalColor=max(finalColor,0.0);\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#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\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\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#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nvarying vec2 vAlbedoUV;\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(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\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>\nvoid main(void) {\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\n#ifdef REFLECTIONMAP_SKYBOX_TRANSFORMED\nvPositionUVW=(reflectionMatrix*vec4(positionUpdated,1.0)).xyz;\n#else\nvPositionUVW=positionUpdated;\n#endif\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n} else {\ngl_Position=viewProjectionR*finalWorld*vec4(positionUpdated,1.0);\n}\n#else\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#endif\n#if DEBUGMODE>0\nvClipSpacePosition=gl_Position;\n#endif\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\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=environmentIrradianceJones(reflectionVector);\n#endif\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 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(ALBEDO) && ALBEDODIRECTUV == 0\nif (vAlbedoInfos.x == 0.)\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv,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(uv,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(uv,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(uv,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(uv,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(uv,1.0,0.0));\n}\nelse\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv,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(uv,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(uv,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(uv,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(uv,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(uv,1.0,0.0));\n}\nelse\n{\nvAnisotropyUV=vec2(anisotropyMatrix*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}";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/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 o});var n="shadowMapPixelShader",i="#ifndef FLOAT\nvec4 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}\n#endif\nvarying float vDepthMetric;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nfloat depth=vDepthMetric;\n#ifdef ESM\ndepth=clamp(exp(-min(87.,biasAndScale.z*depth)),0.,1.);\n#endif\n#ifdef FLOAT\ngl_FragColor=vec4(depth,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depth);\n#endif\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./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/morphTargetsVertex */"./Shaders/ShadersInclude/morphTargetsVertex.ts"),r(/*! ./ShadersInclude/instancesVertex */"./Shaders/ShadersInclude/instancesVertex.ts"),r(/*! ./ShadersInclude/bonesVertex */"./Shaders/ShadersInclude/bonesVertex.ts"),"shadowMapVertexShader"),o="\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\nuniform vec3 lightData;\n#endif\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\n#include<helperFunctions>\nuniform mat4 viewProjection;\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvarying float vDepthMetric;\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\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvec3 worldNor=normalize(normalWorld*normal);\n#ifdef DIRECTIONINLIGHTDATA\nvec3 worldLightDir=normalize(-lightData.xyz);\n#else\nvec3 directionToLight=lightData.xyz-worldPos.xyz;\nvec3 worldLightDir=normalize(directionToLight);\n#endif\nfloat ndl=dot(worldNor,worldLightDir);\nfloat sinNL=sqrt(1.0-ndl*ndl);\nfloat normalBias=biasAndScale.y*sinNL;\nworldPos.xyz-=worldNor*normalBias;\n#endif\n\ngl_Position=viewProjection*worldPos;\n#ifdef DEPTHTEXTURE\n\ngl_Position.z+=biasAndScale.x*gl_Position.w;\n#endif\n\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y))+biasAndScale.x;\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\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/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 vec4 cellInfo;\nattribute vec4 color;\n\nuniform vec2 textureInfos;\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;\nvec2 uvScale=textureInfos.xy;\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-cellInfo.x),1.0-abs(offset.y-cellInfo.y));\nvUV=(uvOffset+cellInfo.zw)*uvScale;\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;\nuniform sampler2D normalSampler;\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;\nfloat depth=texture2D(textureSampler,vUV).r;\nfloat depthSign=depth/abs(depth);\ndepth=depth*depthSign;\nvec3 normal=texture2D(normalSampler,vUV).rgb;\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\nfloat sampleDepth=abs(texture2D(textureSampler,offset.xy).r);\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 depthSampler;\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(depthSampler,uv).r);\nfloat sampleDepth;\nfloat weight;\nfloat weightSum=30.0;\ncolor+=texture2D(image,uv)*30.0;\nsampleDepth=abs(texture2D(depthSampler,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(depthSampler,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(depthSampler,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(depthSampler,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(depthSampler,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(depthSampler,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(depthSampler,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(depthSampler,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 o});var n="standardPixelShader",i="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\nvec4 pack(float value) {\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(value*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\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);\nvec4 adjustedColor=color/averageLuminance;\ncolor=adjustedColor;\ncolor.a=1.0;\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";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./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 useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\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\nuseCamB=vUV.y>0.5;\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\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else{\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}";r(/*! ../Materials/effect */"./Materials/effect.ts").Effect.ShadersStore[n]=i;var o={name:n,shader:i}},"./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/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}},"./Sprites/index.ts":
- /*!**************************!*\
- !*** ./Sprites/index.ts ***!
- \**************************/
- /*! exports provided: Sprite, SpriteManager, SpriteSceneComponent */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(/*! ./spriteManager */"./Sprites/spriteManager.ts");r.d(t,"SpriteManager",function(){return i.SpriteManager});var o=r(/*! ./spriteSceneComponent */"./Sprites/spriteSceneComponent.ts");r.d(t,"SpriteSceneComponent",function(){return o.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 i});var n=r(/*! ../Maths/math */"./Maths/math.ts"),i=function(){function e(e,t){this.name=e,this.color=new n.Color4(1,1,1,1),this.width=1,this.height=1,this.angle=0,this.cellIndex=0,this.invertU=0,this.invertV=0,this.animations=new Array,this.isPickable=!1,this._animationStarted=!1,this._loopAnimation=!1,this._fromIndex=0,this._toIndex=0,this._delay=0,this._direction=1,this._time=0,this.isVisible=!0,this._manager=t,this._manager.sprites.push(this),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:!0,configurable:!0}),e.prototype.playAnimation=function(e,t,r,n,i){this._fromIndex=e,this._toIndex=t,this._loopAnimation=r,this._delay=n,this._animationStarted=!0,this._direction=e<t?1:-1,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.cellIndex>this._toIndex&&(this._loopAnimation?this.cellIndex=this._fromIndex:(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)},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 f});var n=r(/*! ../scene */"./scene.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Maths/math */"./Maths/math.ts"),a=r(/*! ./spriteSceneComponent */"./Sprites/spriteSceneComponent.ts"),c=r(/*! ../Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),l=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../sceneComponent */"./sceneComponent.ts"),d=r(/*! ../Engines/constants */"./Engines/constants.ts"),f=(r(/*! ../Shaders/sprites.fragment */"./Shaders/sprites.fragment.ts"),r(/*! ../Shaders/sprites.vertex */"./Shaders/sprites.vertex.ts"),function(){function e(e,t,r,n,s,c,u){if(void 0===c&&(c=.01),void 0===u&&(u=l.Texture.TRILINEAR_SAMPLINGMODE),this.name=e,this.sprites=new Array,this.renderingGroupId=0,this.layerMask=268435455,this.fogEnabled=!0,this.isPickable=!1,this.onDisposeObservable=new i.Observable,this._vertexBuffers={},s._getComponent(h.SceneComponentConstants.NAME_SPRITE)||s._addComponent(new a.SpriteSceneComponent(s)),this._capacity=r,this._spriteTexture=new l.Texture(t,s,!0,!1,u),this._spriteTexture.wrapU=l.Texture.CLAMP_ADDRESSMODE,this._spriteTexture.wrapV=l.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=c,this._scene=s,this._scene.spriteManagers.push(this);for(var d=[],f=0,p=0;p<r;p++)d.push(f),d.push(f+1),d.push(f+2),d.push(f),d.push(f+2),d.push(f+3),f+=4;this._indexBuffer=s.getEngine().createIndexBuffer(d),this._vertexData=new Float32Array(16*r*4),this._buffer=new o.Buffer(s.getEngine(),this._vertexData,!0,16);var g=this._buffer.createVertexBuffer(o.VertexBuffer.PositionKind,0,4),m=this._buffer.createVertexBuffer("options",4,4),_=this._buffer.createVertexBuffer("cellInfo",8,4),v=this._buffer.createVertexBuffer(o.VertexBuffer.ColorKind,12,4);this._vertexBuffers[o.VertexBuffer.PositionKind]=g,this._vertexBuffers.options=m,this._vertexBuffers.cellInfo=_,this._vertexBuffers[o.VertexBuffer.ColorKind]=v,this._effectBase=this._scene.getEngine().createEffect("sprites",[o.VertexBuffer.PositionKind,"options","cellInfo",o.VertexBuffer.ColorKind],["view","projection","textureInfos","alphaTest"],["diffuseSampler"],""),this._effectFog=this._scene.getEngine().createEffect("sprites",[o.VertexBuffer.PositionKind,"options","cellInfo",o.VertexBuffer.ColorKind],["view","projection","textureInfos","alphaTest","vFogInfos","vFogColor"],["diffuseSampler"],"#define FOG")}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._spriteTexture},set:function(e){this._spriteTexture=e},enumerable:!0,configurable:!0}),e.prototype._appendSpriteVertex=function(e,t,r,n,i){var o=16*e;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._vertexData[o+8]=t.invertU?1:0,this._vertexData[o+9]=t.invertV?1:0;var s=t.cellIndex/i>>0;this._vertexData[o+10]=t.cellIndex-s*i,this._vertexData[o+11]=s,this._vertexData[o+12]=t.color.r,this._vertexData[o+13]=t.color.g,this._vertexData[o+14]=t.color.b,this._vertexData[o+15]=t.color.a},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,h=s.Vector3.Zero(),d=s.Vector3.Zero(),f=t.getViewMatrix(),p=0;p<i;p++){var g=this.sprites[p];if(g){if(r){if(!r(g))continue}else if(!g.isPickable)continue;if(s.Vector3.TransformCoordinatesToRef(g.position,f,d),o.copyFromFloats(d.x-g.width/2,d.y-g.height/2,d.z),a.copyFromFloats(d.x+g.width/2,d.y+g.height/2,d.z),e.intersectsBoxMinMax(o,a)){var m=s.Vector3.Distance(d,e.origin);if(l>m&&(l=m,u=g,n))break}}}if(u){var _=new c.PickingInfo;f.invertToRef(s.Tmp.Matrix[0]),_.hit=!0,_.pickedSprite=u,_.distance=l;var v=s.Tmp.Vector3[0];return v.copyFrom(e.direction),v.normalize(),v.scaleInPlace(l),e.origin.addToRef(v,h),_.pickedPoint=s.Vector3.TransformCoordinates(h,s.Tmp.Matrix[0]),_}return null},e.prototype.render=function(){if(this._effectBase.isReady()&&this._effectFog.isReady()&&this._spriteTexture&&this._spriteTexture.isReady()&&this.sprites.length){for(var e=this._scene.getEngine(),t=this._spriteTexture.getBaseSize(),r=e.getDeltaTime(),i=Math.min(this._capacity,this.sprites.length),o=t.width/this.cellWidth,s=0,a=!0,c=0;c<i;c++){var l=this.sprites[c];l&&l.isVisible&&(a=!1,l._animate(r),this._appendSpriteVertex(s++,l,0,0,o),this._appendSpriteVertex(s++,l,1,0,o),this._appendSpriteVertex(s++,l,1,1,o),this._appendSpriteVertex(s++,l,0,1,o))}if(!a){this._buffer.update(this._vertexData);var h=this._effectBase;this._scene.fogEnabled&&this._scene.fogMode!==n.Scene.FOGMODE_NONE&&this.fogEnabled&&(h=this._effectFog),e.enableEffect(h);var f=this._scene.getViewMatrix();h.setTexture("diffuseSampler",this._spriteTexture),h.setMatrix("view",f),h.setMatrix("projection",this._scene.getProjectionMatrix()),h.setFloat2("textureInfos",this.cellWidth/t.width,this.cellHeight/t.height),this._scene.fogEnabled&&this._scene.fogMode!==n.Scene.FOGMODE_NONE&&this.fogEnabled&&(h.setFloat4("vFogInfos",this._scene.fogMode,this._scene.fogStart,this._scene.fogEnd,this._scene.fogDensity),h.setColor3("vFogColor",this._scene.fogColor)),e.bindBuffers(this._vertexBuffers,this._indexBuffer,h),e.setDepthFunctionToLessOrEqual(),h.setBool("alphaTest",!0),e.setColorWrite(!1),e.drawElementsType(u.Material.TriangleFillMode,0,s/4*6),e.setColorWrite(!0),h.setBool("alphaTest",!1),e.setAlphaMode(d.Constants.ALPHA_COMBINE),e.drawElementsType(u.Material.TriangleFillMode,0,s/4*6),e.setAlphaMode(d.Constants.ALPHA_DISABLE)}}},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);var e=this._scene.spriteManagers.indexOf(this);this._scene.spriteManagers.splice(e,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()},e}())},"./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"),c=r(/*! ../Actions/actionEvent */"./Actions/actionEvent.ts"),l=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 c=a.intersects(e,n,t,r);if(c&&c.hit&&(r||null==i||!(c.distance>=i.distance))&&(i=c,r))break}}return i||new s.PickingInfo},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.setPointerOverSprite=function(e){this._pointerOverSprite!==e&&(this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(l.Constants.ACTION_OnPointerOutTrigger,c.ActionEvent.CreateNewFromSprite(this._pointerOverSprite,this)),this._pointerOverSprite=e,this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(l.Constants.ACTION_OnPointerOverTrigger,c.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._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(l.Constants.ACTION_OnLeftPickTrigger,c.ActionEvent.CreateNewFromSprite(r.pickedSprite,i,n));break;case 1:r.pickedSprite.actionManager.processTrigger(l.Constants.ACTION_OnCenterPickTrigger,c.ActionEvent.CreateNewFromSprite(r.pickedSprite,i,n));break;case 2:r.pickedSprite.actionManager.processTrigger(l.Constants.ACTION_OnRightPickTrigger,c.ActionEvent.CreateNewFromSprite(r.pickedSprite,i,n))}r.pickedSprite.actionManager&&r.pickedSprite.actionManager.processTrigger(l.Constants.ACTION_OnPickDownTrigger,c.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(l.Constants.ACTION_OnPickUpTrigger,c.ActionEvent.CreateNewFromSprite(o.pickedSprite,i,n)),o.pickedSprite.actionManager&&(this.scene._isPointerSwiping()||o.pickedSprite.actionManager.processTrigger(l.Constants.ACTION_OnPickTrigger,c.ActionEvent.CreateNewFromSprite(o.pickedSprite,i,n)))),i._pickedDownSprite&&i._pickedDownSprite.actionManager&&i._pickedDownSprite!==o.pickedSprite&&i._pickedDownSprite.actionManager.processTrigger(l.Constants.ACTION_OnPickOutTrigger,c.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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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:!0,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}()},"./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._BabylonFileParsers={},e._IndividualBabylonFileParsers={},e}()},"./assetContainer.ts":
- /*!***************************!*\
- !*** ./assetContainer.ts ***!
- \***************************/
- /*! exports provided: KeepAssets, AssetContainer */function(e,t,r){"use strict";r.r(t),r.d(t,"KeepAssets",function(){return s}),r.d(t,"AssetContainer",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./abstractScene */"./abstractScene.ts"),o=r(/*! ./Meshes/mesh */"./Meshes/mesh.ts"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t}(i.AbstractScene),a=function(e){function t(t){var r=e.call(this)||this;return r.scene=t,r.sounds=[],r.effectLayers=[],r.layers=[],r.lensFlareSystems=[],r.proceduralTextures=[],r.reflectionProbes=[],r}return n.__extends(t,e),t.prototype.addAllToScene=function(){var e=this;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.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.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,c=r;a<c.length;a++){if(o===c[a]){s=!1;break}}s&&t.push(o)}},t.prototype.moveAllFromScene=function(e){for(var t in void 0===e&&(e=new s),this)this.hasOwnProperty(t)&&(this[t]=this[t]||[],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}(i.AbstractScene)},"./index.ts":
- /*!******************!*\
- !*** ./index.ts ***!
- \******************/
- /*! exports provided: AbstractScene, KeepAssets, AssetContainer, Node, Scene, SceneComponentConstants, Stage, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction, Animatable, Animation, TargetedAnimation, AnimationGroup, AnimationPropertiesOverride, EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase, RuntimeAnimation, AnimationEvent, AnimationKeyInterpolation, AnimationRange, Analyser, AudioEngine, AudioSceneComponent, Sound, SoundTrack, WeightedSound, Bone, BoneIKController, BoneLookController, Skeleton, CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, BoundingBox, BoundingInfo, BoundingSphere, Ray, AxesViewer, BoneAxesViewer, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer, Constants, InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine, EngineStore, NullEngineOptions, NullEngine, KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome, EngineInstrumentation, SceneInstrumentation, _TimeToken, EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent, LensFlare, LensFlareSystem, LensFlareSystemSceneComponent, Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoader, SceneLoaderFlags, ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, InternalTexture, MirrorTexture, RawTexture, RenderTargetTexture, MultiviewRenderTarget, Texture, UniformBuffer, MaterialFlags, Scalar, ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp, SphericalPolynomial, SphericalHarmonics, AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, TrailMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, MorphTarget, MorphTargetManager, Database, BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, SubEmitterType, SubEmitter, PhysicsEngine, PhysicsEngineSceneComponent, PhysicsHelper, PhysicsRadialExplosionEventOptions, PhysicsUpdraftEventOptions, PhysicsVortexEventOptions, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode, PhysicsImpostor, PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint, 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, SharpenPostProcess, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, VRMultiviewToSingleview, ReflectionProbe, BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer, Sprite, SpriteManager, SpriteSceneComponent, _AlphaState, _DepthCullingState, _StencilState, AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, AssetsManager, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsMatrix, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, MeshExploder, FilesInput, CubeMapToSphericalPolynomialTools, 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, ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, WebRequest, InspectableType, AutoRotationBehavior, BouncingBehavior, FramingBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior, ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FollowCameraKeyboardMoveInput, FollowCameraMouseWheelInput, FollowCameraPointersInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, OnAfterEnteringVRObservableEvent, VRExperienceHelper, WebVRFreeCamera, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager, Octree, OctreeBlock, OctreeSceneComponent, _OcclusionDataStorage, _forceTransformFeedbackToBundle, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, ShadowGenerator, ShadowGeneratorSceneComponent, _BabylonLoaderRegistered, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, EquiRectangularCubeTexture, HDRCubeTexture, DummyInternalTextureTracker, MultiRenderTarget, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, DracoCompression, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, HDRTools, PanoramaToCubeMapTools, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTexture, ProceduralTextureSceneComponent, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */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,"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");r.d(t,"Animatable",function(){return o.Animatable}),r.d(t,"Animation",function(){return o.Animation}),r.d(t,"TargetedAnimation",function(){return o.TargetedAnimation}),r.d(t,"AnimationGroup",function(){return o.AnimationGroup}),r.d(t,"AnimationPropertiesOverride",function(){return o.AnimationPropertiesOverride}),r.d(t,"EasingFunction",function(){return o.EasingFunction}),r.d(t,"CircleEase",function(){return o.CircleEase}),r.d(t,"BackEase",function(){return o.BackEase}),r.d(t,"BounceEase",function(){return o.BounceEase}),r.d(t,"CubicEase",function(){return o.CubicEase}),r.d(t,"ElasticEase",function(){return o.ElasticEase}),r.d(t,"ExponentialEase",function(){return o.ExponentialEase}),r.d(t,"PowerEase",function(){return o.PowerEase}),r.d(t,"QuadraticEase",function(){return o.QuadraticEase}),r.d(t,"QuarticEase",function(){return o.QuarticEase}),r.d(t,"QuinticEase",function(){return o.QuinticEase}),r.d(t,"SineEase",function(){return o.SineEase}),r.d(t,"BezierCurveEase",function(){return o.BezierCurveEase}),r.d(t,"RuntimeAnimation",function(){return o.RuntimeAnimation}),r.d(t,"AnimationEvent",function(){return o.AnimationEvent}),r.d(t,"AnimationKeyInterpolation",function(){return o.AnimationKeyInterpolation}),r.d(t,"AnimationRange",function(){return o.AnimationRange});var s=r(/*! ./assetContainer */"./assetContainer.ts");r.d(t,"KeepAssets",function(){return s.KeepAssets}),r.d(t,"AssetContainer",function(){return s.AssetContainer});var a=r(/*! ./Audio/index */"./Audio/index.ts");r.d(t,"Analyser",function(){return a.Analyser}),r.d(t,"AudioEngine",function(){return a.AudioEngine}),r.d(t,"AudioSceneComponent",function(){return a.AudioSceneComponent}),r.d(t,"Sound",function(){return a.Sound}),r.d(t,"SoundTrack",function(){return a.SoundTrack}),r.d(t,"WeightedSound",function(){return a.WeightedSound});var c=r(/*! ./Behaviors/index */"./Behaviors/index.ts");r.d(t,"AutoRotationBehavior",function(){return c.AutoRotationBehavior}),r.d(t,"BouncingBehavior",function(){return c.BouncingBehavior}),r.d(t,"FramingBehavior",function(){return c.FramingBehavior}),r.d(t,"AttachToBoxBehavior",function(){return c.AttachToBoxBehavior}),r.d(t,"FadeInOutBehavior",function(){return c.FadeInOutBehavior}),r.d(t,"MultiPointerScaleBehavior",function(){return c.MultiPointerScaleBehavior}),r.d(t,"PointerDragBehavior",function(){return c.PointerDragBehavior}),r.d(t,"SixDofDragBehavior",function(){return c.SixDofDragBehavior});var l=r(/*! ./Bones/index */"./Bones/index.ts");r.d(t,"Bone",function(){return l.Bone}),r.d(t,"BoneIKController",function(){return l.BoneIKController}),r.d(t,"BoneLookController",function(){return l.BoneLookController}),r.d(t,"Skeleton",function(){return l.Skeleton});var u=r(/*! ./Cameras/index */"./Cameras/index.ts");r.d(t,"CameraInputTypes",function(){return u.CameraInputTypes}),r.d(t,"CameraInputsManager",function(){return u.CameraInputsManager}),r.d(t,"Camera",function(){return u.Camera}),r.d(t,"TargetCamera",function(){return u.TargetCamera}),r.d(t,"FreeCamera",function(){return u.FreeCamera}),r.d(t,"FreeCameraInputsManager",function(){return u.FreeCameraInputsManager}),r.d(t,"TouchCamera",function(){return u.TouchCamera}),r.d(t,"ArcRotateCamera",function(){return u.ArcRotateCamera}),r.d(t,"ArcRotateCameraInputsManager",function(){return u.ArcRotateCameraInputsManager}),r.d(t,"DeviceOrientationCamera",function(){return u.DeviceOrientationCamera}),r.d(t,"FlyCamera",function(){return u.FlyCamera}),r.d(t,"FlyCameraInputsManager",function(){return u.FlyCameraInputsManager}),r.d(t,"FollowCamera",function(){return u.FollowCamera}),r.d(t,"ArcFollowCamera",function(){return u.ArcFollowCamera}),r.d(t,"GamepadCamera",function(){return u.GamepadCamera}),r.d(t,"UniversalCamera",function(){return u.UniversalCamera}),r.d(t,"VirtualJoysticksCamera",function(){return u.VirtualJoysticksCamera}),r.d(t,"ArcRotateCameraGamepadInput",function(){return u.ArcRotateCameraGamepadInput}),r.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return u.ArcRotateCameraKeyboardMoveInput}),r.d(t,"ArcRotateCameraMouseWheelInput",function(){return u.ArcRotateCameraMouseWheelInput}),r.d(t,"ArcRotateCameraPointersInput",function(){return u.ArcRotateCameraPointersInput}),r.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return u.ArcRotateCameraVRDeviceOrientationInput}),r.d(t,"FlyCameraKeyboardInput",function(){return u.FlyCameraKeyboardInput}),r.d(t,"FlyCameraMouseInput",function(){return u.FlyCameraMouseInput}),r.d(t,"FollowCameraKeyboardMoveInput",function(){return u.FollowCameraKeyboardMoveInput}),r.d(t,"FollowCameraMouseWheelInput",function(){return u.FollowCameraMouseWheelInput}),r.d(t,"FollowCameraPointersInput",function(){return u.FollowCameraPointersInput}),r.d(t,"FreeCameraDeviceOrientationInput",function(){return u.FreeCameraDeviceOrientationInput}),r.d(t,"FreeCameraGamepadInput",function(){return u.FreeCameraGamepadInput}),r.d(t,"FreeCameraKeyboardMoveInput",function(){return u.FreeCameraKeyboardMoveInput}),r.d(t,"FreeCameraMouseInput",function(){return u.FreeCameraMouseInput}),r.d(t,"FreeCameraTouchInput",function(){return u.FreeCameraTouchInput}),r.d(t,"FreeCameraVirtualJoystickInput",function(){return u.FreeCameraVirtualJoystickInput}),r.d(t,"AnaglyphArcRotateCamera",function(){return u.AnaglyphArcRotateCamera}),r.d(t,"AnaglyphFreeCamera",function(){return u.AnaglyphFreeCamera}),r.d(t,"AnaglyphGamepadCamera",function(){return u.AnaglyphGamepadCamera}),r.d(t,"AnaglyphUniversalCamera",function(){return u.AnaglyphUniversalCamera}),r.d(t,"StereoscopicArcRotateCamera",function(){return u.StereoscopicArcRotateCamera}),r.d(t,"StereoscopicFreeCamera",function(){return u.StereoscopicFreeCamera}),r.d(t,"StereoscopicGamepadCamera",function(){return u.StereoscopicGamepadCamera}),r.d(t,"StereoscopicUniversalCamera",function(){return u.StereoscopicUniversalCamera}),r.d(t,"VRCameraMetrics",function(){return u.VRCameraMetrics}),r.d(t,"VRDeviceOrientationArcRotateCamera",function(){return u.VRDeviceOrientationArcRotateCamera}),r.d(t,"VRDeviceOrientationFreeCamera",function(){return u.VRDeviceOrientationFreeCamera}),r.d(t,"VRDeviceOrientationGamepadCamera",function(){return u.VRDeviceOrientationGamepadCamera}),r.d(t,"OnAfterEnteringVRObservableEvent",function(){return u.OnAfterEnteringVRObservableEvent}),r.d(t,"VRExperienceHelper",function(){return u.VRExperienceHelper}),r.d(t,"WebVRFreeCamera",function(){return u.WebVRFreeCamera}),r.d(t,"WebXRCamera",function(){return u.WebXRCamera}),r.d(t,"WebXREnterExitUIButton",function(){return u.WebXREnterExitUIButton}),r.d(t,"WebXREnterExitUIOptions",function(){return u.WebXREnterExitUIOptions}),r.d(t,"WebXREnterExitUI",function(){return u.WebXREnterExitUI}),r.d(t,"WebXRState",function(){return u.WebXRState}),r.d(t,"WebXRExperienceHelper",function(){return u.WebXRExperienceHelper}),r.d(t,"WebXRController",function(){return u.WebXRController}),r.d(t,"WebXRInput",function(){return u.WebXRInput}),r.d(t,"WebXRManagedOutputCanvas",function(){return u.WebXRManagedOutputCanvas}),r.d(t,"WebXRSessionManager",function(){return u.WebXRSessionManager});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});var d=r(/*! ./Culling/index */"./Culling/index.ts");r.d(t,"BoundingBox",function(){return d.BoundingBox}),r.d(t,"BoundingInfo",function(){return d.BoundingInfo}),r.d(t,"BoundingSphere",function(){return d.BoundingSphere}),r.d(t,"Ray",function(){return d.Ray}),r.d(t,"Octree",function(){return d.Octree}),r.d(t,"OctreeBlock",function(){return d.OctreeBlock}),r.d(t,"OctreeSceneComponent",function(){return d.OctreeSceneComponent});var f=r(/*! ./Debug/index */"./Debug/index.ts");r.d(t,"AxesViewer",function(){return f.AxesViewer}),r.d(t,"BoneAxesViewer",function(){return f.BoneAxesViewer}),r.d(t,"DebugLayer",function(){return f.DebugLayer}),r.d(t,"PhysicsViewer",function(){return f.PhysicsViewer}),r.d(t,"RayHelper",function(){return f.RayHelper}),r.d(t,"SkeletonViewer",function(){return f.SkeletonViewer});var p=r(/*! ./Engines/index */"./Engines/index.ts");r.d(t,"Constants",function(){return p.Constants}),r.d(t,"InstancingAttributeInfo",function(){return p.InstancingAttributeInfo}),r.d(t,"DepthTextureCreationOptions",function(){return p.DepthTextureCreationOptions}),r.d(t,"EngineCapabilities",function(){return p.EngineCapabilities}),r.d(t,"Engine",function(){return p.Engine}),r.d(t,"EngineStore",function(){return p.EngineStore}),r.d(t,"NullEngineOptions",function(){return p.NullEngineOptions}),r.d(t,"NullEngine",function(){return p.NullEngine}),r.d(t,"_OcclusionDataStorage",function(){return p._OcclusionDataStorage}),r.d(t,"_forceTransformFeedbackToBundle",function(){return p._forceTransformFeedbackToBundle});var g=r(/*! ./Events/index */"./Events/index.ts");r.d(t,"KeyboardEventTypes",function(){return g.KeyboardEventTypes}),r.d(t,"KeyboardInfo",function(){return g.KeyboardInfo}),r.d(t,"KeyboardInfoPre",function(){return g.KeyboardInfoPre}),r.d(t,"PointerEventTypes",function(){return g.PointerEventTypes}),r.d(t,"PointerInfoBase",function(){return g.PointerInfoBase}),r.d(t,"PointerInfoPre",function(){return g.PointerInfoPre}),r.d(t,"PointerInfo",function(){return g.PointerInfo}),r.d(t,"ClipboardEventTypes",function(){return g.ClipboardEventTypes}),r.d(t,"ClipboardInfo",function(){return g.ClipboardInfo});var m=r(/*! ./Gamepads/index */"./Gamepads/index.ts");r.d(t,"StickValues",function(){return m.StickValues}),r.d(t,"Gamepad",function(){return m.Gamepad}),r.d(t,"GenericPad",function(){return m.GenericPad}),r.d(t,"GamepadManager",function(){return m.GamepadManager}),r.d(t,"GamepadSystemSceneComponent",function(){return m.GamepadSystemSceneComponent}),r.d(t,"Xbox360Button",function(){return m.Xbox360Button}),r.d(t,"Xbox360Dpad",function(){return m.Xbox360Dpad}),r.d(t,"Xbox360Pad",function(){return m.Xbox360Pad}),r.d(t,"DaydreamController",function(){return m.DaydreamController}),r.d(t,"GearVRController",function(){return m.GearVRController}),r.d(t,"GenericController",function(){return m.GenericController}),r.d(t,"OculusTouchController",function(){return m.OculusTouchController}),r.d(t,"PoseEnabledControllerType",function(){return m.PoseEnabledControllerType}),r.d(t,"PoseEnabledControllerHelper",function(){return m.PoseEnabledControllerHelper}),r.d(t,"PoseEnabledController",function(){return m.PoseEnabledController}),r.d(t,"ViveController",function(){return m.ViveController}),r.d(t,"WebVRController",function(){return m.WebVRController}),r.d(t,"WindowsMotionController",function(){return m.WindowsMotionController});var _=r(/*! ./Gizmos/index */"./Gizmos/index.ts");r.d(t,"AxisDragGizmo",function(){return _.AxisDragGizmo}),r.d(t,"AxisScaleGizmo",function(){return _.AxisScaleGizmo}),r.d(t,"BoundingBoxGizmo",function(){return _.BoundingBoxGizmo}),r.d(t,"Gizmo",function(){return _.Gizmo}),r.d(t,"GizmoManager",function(){return _.GizmoManager}),r.d(t,"PlaneRotationGizmo",function(){return _.PlaneRotationGizmo}),r.d(t,"PositionGizmo",function(){return _.PositionGizmo}),r.d(t,"RotationGizmo",function(){return _.RotationGizmo}),r.d(t,"ScaleGizmo",function(){return _.ScaleGizmo}),r.d(t,"LightGizmo",function(){return _.LightGizmo});var v=r(/*! ./Helpers/index */"./Helpers/index.ts");r.d(t,"EnvironmentHelper",function(){return v.EnvironmentHelper}),r.d(t,"PhotoDome",function(){return v.PhotoDome}),r.d(t,"_forceSceneHelpersToBundle",function(){return v._forceSceneHelpersToBundle}),r.d(t,"VideoDome",function(){return v.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 y=r(/*! ./Layers/index */"./Layers/index.ts");r.d(t,"EffectLayer",function(){return y.EffectLayer}),r.d(t,"EffectLayerSceneComponent",function(){return y.EffectLayerSceneComponent}),r.d(t,"GlowLayer",function(){return y.GlowLayer}),r.d(t,"HighlightLayer",function(){return y.HighlightLayer}),r.d(t,"Layer",function(){return y.Layer}),r.d(t,"LayerSceneComponent",function(){return y.LayerSceneComponent});var b=r(/*! ./LensFlares/index */"./LensFlares/index.ts");r.d(t,"LensFlare",function(){return b.LensFlare}),r.d(t,"LensFlareSystem",function(){return b.LensFlareSystem}),r.d(t,"LensFlareSystemSceneComponent",function(){return b.LensFlareSystemSceneComponent});var T=r(/*! ./Lights/index */"./Lights/index.ts");r.d(t,"Light",function(){return T.Light}),r.d(t,"ShadowLight",function(){return T.ShadowLight}),r.d(t,"DirectionalLight",function(){return T.DirectionalLight}),r.d(t,"HemisphericLight",function(){return T.HemisphericLight}),r.d(t,"PointLight",function(){return T.PointLight}),r.d(t,"SpotLight",function(){return T.SpotLight}),r.d(t,"ShadowGenerator",function(){return T.ShadowGenerator}),r.d(t,"ShadowGeneratorSceneComponent",function(){return T.ShadowGeneratorSceneComponent});var E=r(/*! ./Loading/index */"./Loading/index.ts");r.d(t,"DefaultLoadingScreen",function(){return E.DefaultLoadingScreen}),r.d(t,"SceneLoaderProgressEvent",function(){return E.SceneLoaderProgressEvent}),r.d(t,"SceneLoader",function(){return E.SceneLoader}),r.d(t,"SceneLoaderFlags",function(){return E.SceneLoaderFlags}),r.d(t,"_BabylonLoaderRegistered",function(){return E._BabylonLoaderRegistered});var x=r(/*! ./Materials/index */"./Materials/index.ts");r.d(t,"ColorCurves",function(){return x.ColorCurves}),r.d(t,"EffectFallbacks",function(){return x.EffectFallbacks}),r.d(t,"EffectCreationOptions",function(){return x.EffectCreationOptions}),r.d(t,"Effect",function(){return x.Effect}),r.d(t,"FresnelParameters",function(){return x.FresnelParameters}),r.d(t,"ImageProcessingConfigurationDefines",function(){return x.ImageProcessingConfigurationDefines}),r.d(t,"ImageProcessingConfiguration",function(){return x.ImageProcessingConfiguration}),r.d(t,"Material",function(){return x.Material}),r.d(t,"MaterialDefines",function(){return x.MaterialDefines}),r.d(t,"MaterialHelper",function(){return x.MaterialHelper}),r.d(t,"MultiMaterial",function(){return x.MultiMaterial}),r.d(t,"PushMaterial",function(){return x.PushMaterial}),r.d(t,"ShaderMaterial",function(){return x.ShaderMaterial}),r.d(t,"StandardMaterialDefines",function(){return x.StandardMaterialDefines}),r.d(t,"StandardMaterial",function(){return x.StandardMaterial}),r.d(t,"BaseTexture",function(){return x.BaseTexture}),r.d(t,"CubeTexture",function(){return x.CubeTexture}),r.d(t,"InternalTexture",function(){return x.InternalTexture}),r.d(t,"MirrorTexture",function(){return x.MirrorTexture}),r.d(t,"RawTexture",function(){return x.RawTexture}),r.d(t,"RenderTargetTexture",function(){return x.RenderTargetTexture}),r.d(t,"MultiviewRenderTarget",function(){return x.MultiviewRenderTarget}),r.d(t,"Texture",function(){return x.Texture}),r.d(t,"UniformBuffer",function(){return x.UniformBuffer}),r.d(t,"MaterialFlags",function(){return x.MaterialFlags}),r.d(t,"BackgroundMaterial",function(){return x.BackgroundMaterial}),r.d(t,"PBRBaseMaterial",function(){return x.PBRBaseMaterial}),r.d(t,"PBRBaseSimpleMaterial",function(){return x.PBRBaseSimpleMaterial}),r.d(t,"PBRMaterial",function(){return x.PBRMaterial}),r.d(t,"PBRMetallicRoughnessMaterial",function(){return x.PBRMetallicRoughnessMaterial}),r.d(t,"PBRSpecularGlossinessMaterial",function(){return x.PBRSpecularGlossinessMaterial}),r.d(t,"ColorGradingTexture",function(){return x.ColorGradingTexture}),r.d(t,"DynamicTexture",function(){return x.DynamicTexture}),r.d(t,"EquiRectangularCubeTexture",function(){return x.EquiRectangularCubeTexture}),r.d(t,"HDRCubeTexture",function(){return x.HDRCubeTexture}),r.d(t,"DummyInternalTextureTracker",function(){return x.DummyInternalTextureTracker}),r.d(t,"MultiRenderTarget",function(){return x.MultiRenderTarget}),r.d(t,"RawCubeTexture",function(){return x.RawCubeTexture}),r.d(t,"RawTexture3D",function(){return x.RawTexture3D}),r.d(t,"RefractionTexture",function(){return x.RefractionTexture}),r.d(t,"VideoTexture",function(){return x.VideoTexture}),r.d(t,"_DDSTextureLoader",function(){return x._DDSTextureLoader}),r.d(t,"_ENVTextureLoader",function(){return x._ENVTextureLoader}),r.d(t,"_KTXTextureLoader",function(){return x._KTXTextureLoader}),r.d(t,"_TGATextureLoader",function(){return x._TGATextureLoader}),r.d(t,"CustomProceduralTexture",function(){return x.CustomProceduralTexture}),r.d(t,"NoiseProceduralTexture",function(){return x.NoiseProceduralTexture}),r.d(t,"ProceduralTexture",function(){return x.ProceduralTexture}),r.d(t,"ProceduralTextureSceneComponent",function(){return x.ProceduralTextureSceneComponent});var C=r(/*! ./Maths/index */"./Maths/index.ts");r.d(t,"Scalar",function(){return C.Scalar}),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,"Color3",function(){return C.Color3}),r.d(t,"Color4",function(){return C.Color4}),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,"Size",function(){return C.Size}),r.d(t,"Quaternion",function(){return C.Quaternion}),r.d(t,"Matrix",function(){return C.Matrix}),r.d(t,"Plane",function(){return C.Plane}),r.d(t,"Viewport",function(){return C.Viewport}),r.d(t,"Frustum",function(){return C.Frustum}),r.d(t,"Space",function(){return C.Space}),r.d(t,"Axis",function(){return C.Axis}),r.d(t,"BezierCurve",function(){return C.BezierCurve}),r.d(t,"Orientation",function(){return C.Orientation}),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,"PositionNormalVertex",function(){return C.PositionNormalVertex}),r.d(t,"PositionNormalTextureVertex",function(){return C.PositionNormalTextureVertex}),r.d(t,"Tmp",function(){return C.Tmp}),r.d(t,"SphericalPolynomial",function(){return C.SphericalPolynomial}),r.d(t,"SphericalHarmonics",function(){return C.SphericalHarmonics});var P=r(/*! ./Meshes/index */"./Meshes/index.ts");r.d(t,"AbstractMesh",function(){return P.AbstractMesh}),r.d(t,"Buffer",function(){return P.Buffer}),r.d(t,"VertexBuffer",function(){return P.VertexBuffer}),r.d(t,"CSG",function(){return P.CSG}),r.d(t,"Geometry",function(){return P.Geometry}),r.d(t,"GroundMesh",function(){return P.GroundMesh}),r.d(t,"TrailMesh",function(){return P.TrailMesh}),r.d(t,"InstancedMesh",function(){return P.InstancedMesh}),r.d(t,"LinesMesh",function(){return P.LinesMesh}),r.d(t,"InstancedLinesMesh",function(){return P.InstancedLinesMesh}),r.d(t,"MeshLODLevel",function(){return P.MeshLODLevel}),r.d(t,"_CreationDataStorage",function(){return P._CreationDataStorage}),r.d(t,"_InstancesBatch",function(){return P._InstancesBatch}),r.d(t,"Mesh",function(){return P.Mesh}),r.d(t,"VertexData",function(){return P.VertexData}),r.d(t,"MeshBuilder",function(){return P.MeshBuilder}),r.d(t,"SimplificationSettings",function(){return P.SimplificationSettings}),r.d(t,"SimplificationQueue",function(){return P.SimplificationQueue}),r.d(t,"SimplificationType",function(){return P.SimplificationType}),r.d(t,"SimplicationQueueSceneComponent",function(){return P.SimplicationQueueSceneComponent}),r.d(t,"Polygon",function(){return P.Polygon}),r.d(t,"PolygonMeshBuilder",function(){return P.PolygonMeshBuilder}),r.d(t,"BaseSubMesh",function(){return P.BaseSubMesh}),r.d(t,"SubMesh",function(){return P.SubMesh}),r.d(t,"TransformNode",function(){return P.TransformNode}),r.d(t,"BoxBuilder",function(){return P.BoxBuilder}),r.d(t,"SphereBuilder",function(){return P.SphereBuilder}),r.d(t,"CylinderBuilder",function(){return P.CylinderBuilder}),r.d(t,"LinesBuilder",function(){return P.LinesBuilder}),r.d(t,"PlaneBuilder",function(){return P.PlaneBuilder}),r.d(t,"DracoCompression",function(){return P.DracoCompression}),r.d(t,"DiscBuilder",function(){return P.DiscBuilder}),r.d(t,"RibbonBuilder",function(){return P.RibbonBuilder}),r.d(t,"TorusBuilder",function(){return P.TorusBuilder}),r.d(t,"TorusKnotBuilder",function(){return P.TorusKnotBuilder}),r.d(t,"PolygonBuilder",function(){return P.PolygonBuilder}),r.d(t,"ShapeBuilder",function(){return P.ShapeBuilder}),r.d(t,"LatheBuilder",function(){return P.LatheBuilder}),r.d(t,"GroundBuilder",function(){return P.GroundBuilder}),r.d(t,"TubeBuilder",function(){return P.TubeBuilder}),r.d(t,"PolyhedronBuilder",function(){return P.PolyhedronBuilder}),r.d(t,"IcoSphereBuilder",function(){return P.IcoSphereBuilder}),r.d(t,"DecalBuilder",function(){return P.DecalBuilder});var M=r(/*! ./Morph/index */"./Morph/index.ts");r.d(t,"MorphTarget",function(){return M.MorphTarget}),r.d(t,"MorphTargetManager",function(){return M.MorphTargetManager});var S=r(/*! ./node */"./node.ts");r.d(t,"Node",function(){return S.Node});var R=r(/*! ./Offline/index */"./Offline/index.ts");r.d(t,"Database",function(){return R.Database});var O=r(/*! ./Particles/index */"./Particles/index.ts");r.d(t,"BaseParticleSystem",function(){return O.BaseParticleSystem}),r.d(t,"GPUParticleSystem",function(){return O.GPUParticleSystem}),r.d(t,"Particle",function(){return O.Particle}),r.d(t,"ParticleHelper",function(){return O.ParticleHelper}),r.d(t,"ParticleSystem",function(){return O.ParticleSystem}),r.d(t,"_IDoNeedToBeInTheBuild",function(){return O._IDoNeedToBeInTheBuild}),r.d(t,"ParticleSystemSet",function(){return O.ParticleSystemSet}),r.d(t,"SolidParticle",function(){return O.SolidParticle}),r.d(t,"ModelShape",function(){return O.ModelShape}),r.d(t,"DepthSortedParticle",function(){return O.DepthSortedParticle}),r.d(t,"SolidParticleSystem",function(){return O.SolidParticleSystem}),r.d(t,"SubEmitterType",function(){return O.SubEmitterType}),r.d(t,"SubEmitter",function(){return O.SubEmitter}),r.d(t,"BoxParticleEmitter",function(){return O.BoxParticleEmitter}),r.d(t,"ConeParticleEmitter",function(){return O.ConeParticleEmitter}),r.d(t,"CylinderParticleEmitter",function(){return O.CylinderParticleEmitter}),r.d(t,"CylinderDirectedParticleEmitter",function(){return O.CylinderDirectedParticleEmitter}),r.d(t,"HemisphericParticleEmitter",function(){return O.HemisphericParticleEmitter}),r.d(t,"PointParticleEmitter",function(){return O.PointParticleEmitter}),r.d(t,"SphereParticleEmitter",function(){return O.SphereParticleEmitter}),r.d(t,"SphereDirectedParticleEmitter",function(){return O.SphereDirectedParticleEmitter});var I=r(/*! ./Physics/index */"./Physics/index.ts");r.d(t,"PhysicsEngine",function(){return I.PhysicsEngine}),r.d(t,"PhysicsEngineSceneComponent",function(){return I.PhysicsEngineSceneComponent}),r.d(t,"PhysicsHelper",function(){return I.PhysicsHelper}),r.d(t,"PhysicsRadialExplosionEventOptions",function(){return I.PhysicsRadialExplosionEventOptions}),r.d(t,"PhysicsUpdraftEventOptions",function(){return I.PhysicsUpdraftEventOptions}),r.d(t,"PhysicsVortexEventOptions",function(){return I.PhysicsVortexEventOptions}),r.d(t,"PhysicsRadialImpulseFalloff",function(){return I.PhysicsRadialImpulseFalloff}),r.d(t,"PhysicsUpdraftMode",function(){return I.PhysicsUpdraftMode}),r.d(t,"PhysicsImpostor",function(){return I.PhysicsImpostor}),r.d(t,"PhysicsJoint",function(){return I.PhysicsJoint}),r.d(t,"DistanceJoint",function(){return I.DistanceJoint}),r.d(t,"MotorEnabledJoint",function(){return I.MotorEnabledJoint}),r.d(t,"HingeJoint",function(){return I.HingeJoint}),r.d(t,"Hinge2Joint",function(){return I.Hinge2Joint}),r.d(t,"CannonJSPlugin",function(){return I.CannonJSPlugin}),r.d(t,"AmmoJSPlugin",function(){return I.AmmoJSPlugin}),r.d(t,"OimoJSPlugin",function(){return I.OimoJSPlugin});var D=r(/*! ./PostProcesses/index */"./PostProcesses/index.ts");r.d(t,"AnaglyphPostProcess",function(){return D.AnaglyphPostProcess}),r.d(t,"BlackAndWhitePostProcess",function(){return D.BlackAndWhitePostProcess}),r.d(t,"BloomEffect",function(){return D.BloomEffect}),r.d(t,"BloomMergePostProcess",function(){return D.BloomMergePostProcess}),r.d(t,"BlurPostProcess",function(){return D.BlurPostProcess}),r.d(t,"ChromaticAberrationPostProcess",function(){return D.ChromaticAberrationPostProcess}),r.d(t,"CircleOfConfusionPostProcess",function(){return D.CircleOfConfusionPostProcess}),r.d(t,"ColorCorrectionPostProcess",function(){return D.ColorCorrectionPostProcess}),r.d(t,"ConvolutionPostProcess",function(){return D.ConvolutionPostProcess}),r.d(t,"DepthOfFieldBlurPostProcess",function(){return D.DepthOfFieldBlurPostProcess}),r.d(t,"DepthOfFieldEffectBlurLevel",function(){return D.DepthOfFieldEffectBlurLevel}),r.d(t,"DepthOfFieldEffect",function(){return D.DepthOfFieldEffect}),r.d(t,"DepthOfFieldMergePostProcessOptions",function(){return D.DepthOfFieldMergePostProcessOptions}),r.d(t,"DepthOfFieldMergePostProcess",function(){return D.DepthOfFieldMergePostProcess}),r.d(t,"DisplayPassPostProcess",function(){return D.DisplayPassPostProcess}),r.d(t,"ExtractHighlightsPostProcess",function(){return D.ExtractHighlightsPostProcess}),r.d(t,"FilterPostProcess",function(){return D.FilterPostProcess}),r.d(t,"FxaaPostProcess",function(){return D.FxaaPostProcess}),r.d(t,"GrainPostProcess",function(){return D.GrainPostProcess}),r.d(t,"HighlightsPostProcess",function(){return D.HighlightsPostProcess}),r.d(t,"ImageProcessingPostProcess",function(){return D.ImageProcessingPostProcess}),r.d(t,"MotionBlurPostProcess",function(){return D.MotionBlurPostProcess}),r.d(t,"PassPostProcess",function(){return D.PassPostProcess}),r.d(t,"PassCubePostProcess",function(){return D.PassCubePostProcess}),r.d(t,"PostProcess",function(){return D.PostProcess}),r.d(t,"PostProcessManager",function(){return D.PostProcessManager}),r.d(t,"RefractionPostProcess",function(){return D.RefractionPostProcess}),r.d(t,"SharpenPostProcess",function(){return D.SharpenPostProcess}),r.d(t,"StereoscopicInterlacePostProcess",function(){return D.StereoscopicInterlacePostProcess}),r.d(t,"TonemappingOperator",function(){return D.TonemappingOperator}),r.d(t,"TonemapPostProcess",function(){return D.TonemapPostProcess}),r.d(t,"VolumetricLightScatteringPostProcess",function(){return D.VolumetricLightScatteringPostProcess}),r.d(t,"VRDistortionCorrectionPostProcess",function(){return D.VRDistortionCorrectionPostProcess}),r.d(t,"VRMultiviewToSingleview",function(){return D.VRMultiviewToSingleview}),r.d(t,"PostProcessRenderEffect",function(){return D.PostProcessRenderEffect}),r.d(t,"PostProcessRenderPipeline",function(){return D.PostProcessRenderPipeline}),r.d(t,"PostProcessRenderPipelineManager",function(){return D.PostProcessRenderPipelineManager}),r.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return D.PostProcessRenderPipelineManagerSceneComponent}),r.d(t,"DefaultRenderingPipeline",function(){return D.DefaultRenderingPipeline}),r.d(t,"LensRenderingPipeline",function(){return D.LensRenderingPipeline}),r.d(t,"SSAO2RenderingPipeline",function(){return D.SSAO2RenderingPipeline}),r.d(t,"SSAORenderingPipeline",function(){return D.SSAORenderingPipeline}),r.d(t,"StandardRenderingPipeline",function(){return D.StandardRenderingPipeline});var w=r(/*! ./Probes/index */"./Probes/index.ts");r.d(t,"ReflectionProbe",function(){return w.ReflectionProbe});var L=r(/*! ./Rendering/index */"./Rendering/index.ts");r.d(t,"BoundingBoxRenderer",function(){return L.BoundingBoxRenderer}),r.d(t,"DepthRenderer",function(){return L.DepthRenderer}),r.d(t,"DepthRendererSceneComponent",function(){return L.DepthRendererSceneComponent}),r.d(t,"EdgesRenderer",function(){return L.EdgesRenderer}),r.d(t,"LineEdgesRenderer",function(){return L.LineEdgesRenderer}),r.d(t,"GeometryBufferRenderer",function(){return L.GeometryBufferRenderer}),r.d(t,"GeometryBufferRendererSceneComponent",function(){return L.GeometryBufferRendererSceneComponent}),r.d(t,"OutlineRenderer",function(){return L.OutlineRenderer}),r.d(t,"RenderingGroup",function(){return L.RenderingGroup}),r.d(t,"RenderingGroupInfo",function(){return L.RenderingGroupInfo}),r.d(t,"RenderingManager",function(){return L.RenderingManager}),r.d(t,"UtilityLayerRenderer",function(){return L.UtilityLayerRenderer});var B=r(/*! ./scene */"./scene.ts");r.d(t,"Scene",function(){return B.Scene});var F=r(/*! ./sceneComponent */"./sceneComponent.ts");r.d(t,"SceneComponentConstants",function(){return F.SceneComponentConstants}),r.d(t,"Stage",function(){return F.Stage});var N=r(/*! ./Sprites/index */"./Sprites/index.ts");r.d(t,"Sprite",function(){return N.Sprite}),r.d(t,"SpriteManager",function(){return N.SpriteManager}),r.d(t,"SpriteSceneComponent",function(){return N.SpriteSceneComponent});var V=r(/*! ./States/index */"./States/index.ts");r.d(t,"_AlphaState",function(){return V._AlphaState}),r.d(t,"_DepthCullingState",function(){return V._DepthCullingState}),r.d(t,"_StencilState",function(){return V._StencilState});var U=r(/*! ./Misc/index */"./Misc/index.ts");r.d(t,"AndOrNotEvaluator",function(){return U.AndOrNotEvaluator}),r.d(t,"AssetTaskState",function(){return U.AssetTaskState}),r.d(t,"AbstractAssetTask",function(){return U.AbstractAssetTask}),r.d(t,"AssetsProgressEvent",function(){return U.AssetsProgressEvent}),r.d(t,"MeshAssetTask",function(){return U.MeshAssetTask}),r.d(t,"TextFileAssetTask",function(){return U.TextFileAssetTask}),r.d(t,"BinaryFileAssetTask",function(){return U.BinaryFileAssetTask}),r.d(t,"ImageAssetTask",function(){return U.ImageAssetTask}),r.d(t,"TextureAssetTask",function(){return U.TextureAssetTask}),r.d(t,"CubeTextureAssetTask",function(){return U.CubeTextureAssetTask}),r.d(t,"HDRCubeTextureAssetTask",function(){return U.HDRCubeTextureAssetTask}),r.d(t,"AssetsManager",function(){return U.AssetsManager}),r.d(t,"DDSTools",function(){return U.DDSTools}),r.d(t,"expandToProperty",function(){return U.expandToProperty}),r.d(t,"serialize",function(){return U.serialize}),r.d(t,"serializeAsTexture",function(){return U.serializeAsTexture}),r.d(t,"serializeAsColor3",function(){return U.serializeAsColor3}),r.d(t,"serializeAsFresnelParameters",function(){return U.serializeAsFresnelParameters}),r.d(t,"serializeAsVector2",function(){return U.serializeAsVector2}),r.d(t,"serializeAsVector3",function(){return U.serializeAsVector3}),r.d(t,"serializeAsMeshReference",function(){return U.serializeAsMeshReference}),r.d(t,"serializeAsColorCurves",function(){return U.serializeAsColorCurves}),r.d(t,"serializeAsColor4",function(){return U.serializeAsColor4}),r.d(t,"serializeAsImageProcessingConfiguration",function(){return U.serializeAsImageProcessingConfiguration}),r.d(t,"serializeAsQuaternion",function(){return U.serializeAsQuaternion}),r.d(t,"serializeAsMatrix",function(){return U.serializeAsMatrix}),r.d(t,"serializeAsCameraReference",function(){return U.serializeAsCameraReference}),r.d(t,"SerializationHelper",function(){return U.SerializationHelper}),r.d(t,"Deferred",function(){return U.Deferred}),r.d(t,"EnvironmentTextureTools",function(){return U.EnvironmentTextureTools}),r.d(t,"MeshExploder",function(){return U.MeshExploder}),r.d(t,"FilesInput",function(){return U.FilesInput}),r.d(t,"CubeMapToSphericalPolynomialTools",function(){return U.CubeMapToSphericalPolynomialTools}),r.d(t,"KhronosTextureContainer",function(){return U.KhronosTextureContainer}),r.d(t,"EventState",function(){return U.EventState}),r.d(t,"Observer",function(){return U.Observer}),r.d(t,"MultiObserver",function(){return U.MultiObserver}),r.d(t,"Observable",function(){return U.Observable}),r.d(t,"PerformanceMonitor",function(){return U.PerformanceMonitor}),r.d(t,"RollingAverage",function(){return U.RollingAverage}),r.d(t,"PromisePolyfill",function(){return U.PromisePolyfill}),r.d(t,"SceneOptimization",function(){return U.SceneOptimization}),r.d(t,"TextureOptimization",function(){return U.TextureOptimization}),r.d(t,"HardwareScalingOptimization",function(){return U.HardwareScalingOptimization}),r.d(t,"ShadowsOptimization",function(){return U.ShadowsOptimization}),r.d(t,"PostProcessesOptimization",function(){return U.PostProcessesOptimization}),r.d(t,"LensFlaresOptimization",function(){return U.LensFlaresOptimization}),r.d(t,"CustomOptimization",function(){return U.CustomOptimization}),r.d(t,"ParticlesOptimization",function(){return U.ParticlesOptimization}),r.d(t,"RenderTargetsOptimization",function(){return U.RenderTargetsOptimization}),r.d(t,"MergeMeshesOptimization",function(){return U.MergeMeshesOptimization}),r.d(t,"SceneOptimizerOptions",function(){return U.SceneOptimizerOptions}),r.d(t,"SceneOptimizer",function(){return U.SceneOptimizer}),r.d(t,"SceneSerializer",function(){return U.SceneSerializer}),r.d(t,"SmartArray",function(){return U.SmartArray}),r.d(t,"SmartArrayNoDuplicate",function(){return U.SmartArrayNoDuplicate}),r.d(t,"StringDictionary",function(){return U.StringDictionary}),r.d(t,"Tags",function(){return U.Tags}),r.d(t,"TextureTools",function(){return U.TextureTools}),r.d(t,"TGATools",function(){return U.TGATools}),r.d(t,"ColorGradient",function(){return U.ColorGradient}),r.d(t,"Color3Gradient",function(){return U.Color3Gradient}),r.d(t,"FactorGradient",function(){return U.FactorGradient}),r.d(t,"LoadFileError",function(){return U.LoadFileError}),r.d(t,"RetryStrategy",function(){return U.RetryStrategy}),r.d(t,"Tools",function(){return U.Tools}),r.d(t,"PerfCounter",function(){return U.PerfCounter}),r.d(t,"className",function(){return U.className}),r.d(t,"AsyncLoop",function(){return U.AsyncLoop}),r.d(t,"VideoRecorder",function(){return U.VideoRecorder}),r.d(t,"JoystickAxis",function(){return U.JoystickAxis}),r.d(t,"VirtualJoystick",function(){return U.VirtualJoystick}),r.d(t,"WorkerPool",function(){return U.WorkerPool}),r.d(t,"Logger",function(){return U.Logger}),r.d(t,"_TypeStore",function(){return U._TypeStore}),r.d(t,"FilesInputStore",function(){return U.FilesInputStore}),r.d(t,"DeepCopier",function(){return U.DeepCopier}),r.d(t,"PivotTools",function(){return U.PivotTools}),r.d(t,"PrecisionDate",function(){return U.PrecisionDate}),r.d(t,"ScreenshotTools",function(){return U.ScreenshotTools}),r.d(t,"WebRequest",function(){return U.WebRequest}),r.d(t,"InspectableType",function(){return U.InspectableType}),r.d(t,"HDRTools",function(){return U.HDRTools}),r.d(t,"PanoramaToCubeMapTools",function(){return U.PanoramaToCubeMapTools})},"./node.ts":
- /*!*****************!*\
- !*** ./node.ts ***!
- \*****************/
- /*! exports provided: Node */function(e,t,r){"use strict";r.r(t),r.d(t,"Node",function(){return l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./Maths/math */"./Maths/math.ts"),o=r(/*! ./Misc/decorators */"./Misc/decorators.ts"),s=r(/*! ./Misc/observable */"./Misc/observable.ts"),a=r(/*! ./Engines/engineStore */"./Engines/engineStore.ts"),c=r(/*! ./Misc/devTools */"./Misc/devTools.ts"),l=function(){function e(e,t,r){void 0===t&&(t=null),void 0===r&&(r=!0),this.state="",this.metadata=null,this.reservedDataStore=null,this.doNotSerialize=!1,this._isDisposed=!1,this.animations=new Array,this._ranges={},this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._currentRenderId=-1,this._parentRenderId=-1,this._childRenderId=-1,this._worldMatrix=i.Matrix.Identity(),this._worldMatrixDeterminant=0,this._sceneRootNodesIndex=-1,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new s.Observable,this._behaviors=new Array,this.name=e,this.id=e,this._scene=t||a.EngineStore.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),r&&this.addToSceneRootNodes()}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},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:!0,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:!0,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:!0,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)?this:(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:(this._behaviors[t].detach(),this._behaviors.splice(t,1),this)},Object.defineProperty(e.prototype,"behaviors",{get:function(){return this._behaviors},enumerable:!0,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._worldMatrixDeterminant},Object.defineProperty(e.prototype,"worldMatrixFromCache",{get:function(){return this._worldMatrix},enumerable:!0,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._parentRenderId=this._parentNode._childRenderId)},e.prototype.isSynchronizedWithParent=function(){return!this._parentNode||this._parentRenderId===this._parentNode._childRenderId&&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]},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._AnimationRangeFactory=function(e,t,r){throw c._DevTools.WarnImport("AnimationRange")},e._NodeConstructors={},n.__decorate([Object(o.serialize)()],e.prototype,"name",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"id",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"uniqueId",void 0),n.__decorate([Object(o.serialize)()],e.prototype,"state",void 0),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 I});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"),c=r(/*! ./Misc/stringDictionary */"./Misc/stringDictionary.ts"),l=r(/*! ./Misc/tags */"./Misc/tags.ts"),u=r(/*! ./Maths/math */"./Maths/math.ts"),h=r(/*! ./Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),d=r(/*! ./Cameras/camera */"./Cameras/camera.ts"),f=r(/*! ./abstractScene */"./abstractScene.ts"),p=r(/*! ./Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),g=r(/*! ./Materials/uniformBuffer */"./Materials/uniformBuffer.ts"),m=r(/*! ./Lights/light */"./Lights/light.ts"),_=r(/*! ./Collisions/pickingInfo */"./Collisions/pickingInfo.ts"),v=r(/*! ./Events/pointerEvents */"./Events/pointerEvents.ts"),A=r(/*! ./Events/keyboardEvents */"./Events/keyboardEvents.ts"),y=r(/*! ./Actions/actionEvent */"./Actions/actionEvent.ts"),b=r(/*! ./PostProcesses/postProcessManager */"./PostProcesses/postProcessManager.ts"),T=r(/*! ./Rendering/renderingManager */"./Rendering/renderingManager.ts"),E=r(/*! ./sceneComponent */"./sceneComponent.ts"),x=r(/*! ./Engines/constants */"./Engines/constants.ts"),C=r(/*! ./Misc/domManagement */"./Misc/domManagement.ts"),P=r(/*! ./Misc/logger */"./Misc/logger.ts"),M=r(/*! ./Engines/engineStore */"./Engines/engineStore.ts"),S=r(/*! ./Actions/abstractActionManager */"./Actions/abstractActionManager.ts"),R=r(/*! ./Misc/devTools */"./Misc/devTools.ts"),O=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:!0,configurable:!0}),Object.defineProperty(e.prototype,"doubleClick",{get:function(){return this._doubleClick},set:function(e){this._doubleClick=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasSwiped",{get:function(){return this._hasSwiped},set:function(e){this._hasSwiped=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ignore",{get:function(){return this._ignore},set:function(e){this._ignore=e},enumerable:!0,configurable:!0}),e}(),I=function(e){function t(r,n){var o=e.call(this)||this;return o._isScene=!0,o.autoClear=!0,o.autoClearDepthAndStencil=!0,o.clearColor=new u.Color4(.2,.2,.3,1),o.ambientColor=new u.Color3(0,0,0),o._forceWireframe=!1,o._forcePointsCloud=!1,o.animationsEnabled=!0,o._animationPropertiesOverride=null,o.useConstantAnimationDeltaTime=!1,o.constantlyUpdateMeshUnderPointer=!1,o.hoverCursor="pointer",o.defaultCursor="",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._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._registeredForLateAnimationBindings=new a.SmartArrayNoDuplicate(256),o.onPrePointerObservable=new s.Observable,o.onPointerObservable=new s.Observable,o._meshPickProceed=!1,o._currentPickResult=null,o._previousPickResult=null,o._totalPointersPressed=0,o._doubleClickOccured=!1,o.cameraToUseForPointers=null,o._pointerX=0,o._pointerY=0,o._startingPointerPosition=new u.Vector2(0,0),o._previousStartingPointerPosition=new u.Vector2(0,0),o._startingPointerTime=0,o._previousStartingPointerTime=0,o._pointerCaptures={},o._timeAccumulator=0,o._currentStepId=0,o._currentInternalStep=0,o.onPreKeyboardObservable=new s.Observable,o.onKeyboardObservable=new s.Observable,o._useRightHandedSystem=!1,o._fogEnabled=!0,o._fogMode=t.FOGMODE_NONE,o.fogColor=new u.Color3(.2,.2,.3),o.fogDensity=.1,o.fogStart=0,o.fogEnd=1e3,o._shadowsEnabled=!0,o._lightsEnabled=!0,o.activeCameras=new Array,o._texturesEnabled=!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 i.PerfCounter,o._activeIndices=new i.PerfCounter,o._activeParticles=new i.PerfCounter,o._activeBones=new i.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._transformMatrixR=u.Matrix.Zero(),o._wheelEventName="",o.requireLightSorting=!1,o._components=[],o._serializableComponents=[],o._transientComponents=[],o._beforeCameraUpdateStage=E.Stage.Create(),o._beforeClearStage=E.Stage.Create(),o._gatherRenderTargetsStage=E.Stage.Create(),o._gatherActiveCameraRenderTargetsStage=E.Stage.Create(),o._isReadyForMeshStage=E.Stage.Create(),o._beforeEvaluateActiveMeshStage=E.Stage.Create(),o._evaluateSubMeshStage=E.Stage.Create(),o._activeMeshStage=E.Stage.Create(),o._cameraDrawRenderTargetStage=E.Stage.Create(),o._beforeCameraDrawStage=E.Stage.Create(),o._beforeRenderTargetDrawStage=E.Stage.Create(),o._beforeRenderingGroupDrawStage=E.Stage.Create(),o._beforeRenderingMeshStage=E.Stage.Create(),o._afterRenderingMeshStage=E.Stage.Create(),o._afterRenderingGroupDrawStage=E.Stage.Create(),o._afterCameraDrawStage=E.Stage.Create(),o._afterRenderTargetDrawStage=E.Stage.Create(),o._afterRenderStage=E.Stage.Create(),o._pointerMoveStage=E.Stage.Create(),o._pointerDownStage=E.Stage.Create(),o._pointerUpStage=E.Stage.Create(),o.geometriesByUniqueId=null,o._defaultMeshCandidates={data:[],length:0},o._defaultSubMeshCandidates={data:[],length:0},o._preventFreeActiveMeshesAndRenderingGroups=!1,o._activeMeshesFrozen=!1,o._allowPostProcessClearColor=!0,o.getDeterministicFrameTime=function(){return 1e3/60},o._blockMaterialDirtyMechanism=!1,o._engine=r||M.EngineStore.LastCreatedEngine,o._engine.scenes.push(o),o._uid=null,o._renderingManager=new T.RenderingManager(o),b.PostProcessManager&&(o.postProcessManager=new b.PostProcessManager(o)),C.DomManagement.IsWindowObjectExist()&&o.attachControl(),o._createUbo(),p.ImageProcessingConfiguration&&(o._imageProcessingConfiguration=new p.ImageProcessingConfiguration),o.setDefaultCandidateProviders(),n&&!0===n.useGeometryUniqueIdsMap&&(o.geometriesByUniqueId={}),o.useMaterialMeshMap=n&&n.useGeometryUniqueIdsMap||!1,o.useClonedMeshhMap=n&&n.useClonedMeshhMap||!1,o._engine.onNewSceneAddedObservable.notifyObservers(o),o}return n.__extends(t,e),t.DefaultMaterialFactory=function(e){throw R._DevTools.WarnImport("StandardMaterial")},t.CollisionCoordinatorFactory=function(){throw R._DevTools.WarnImport("DefaultCollisionCoordinator")},Object.defineProperty(t.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"forceWireframe",{get:function(){return this._forceWireframe},set:function(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"forcePointsCloud",{get:function(){return this._forcePointsCloud},set:function(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"beforeCameraRender",{set:function(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"afterCameraRender",{set:function(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unTranslatedPointer",{get:function(){return new u.Vector2(this._unTranslatedPointerX,this._unTranslatedPointerY)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useRightHandedSystem",{get:function(){return this._useRightHandedSystem},set:function(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!0,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(x.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fogMode",{get:function(){return this._fogMode},set:function(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowsEnabled",{get:function(){return this._shadowsEnabled},set:function(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_LightDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lightsEnabled",{get:function(){return this._lightsEnabled},set:function(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_LightDirtyFlag))},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(t.prototype,"texturesEnabled",{get:function(){return this._texturesEnabled},set:function(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_TextureDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skeletonsEnabled",{get:function(){return this._skeletonsEnabled},set:function(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(x.Constants.MATERIAL_AttributesDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionCoordinator",{get:function(){return this._collisionCoordinator||(this._collisionCoordinator=t.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"frustumPlanes",{get:function(){return this._frustumPlanes},enumerable:!0,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&&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._pointerOverMesh},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointerX",{get:function(){return this._pointerX},set:function(e){this._pointerX=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointerY",{get:function(){return this._pointerY},set:function(e){this._pointerY=e},enumerable:!0,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:!0,configurable:!0}),t.prototype.getActiveIndices=function(){return this._activeIndices.current},Object.defineProperty(t.prototype,"totalActiveIndicesPerfCounter",{get:function(){return this._activeIndices},enumerable:!0,configurable:!0}),t.prototype.getActiveParticles=function(){return this._activeParticles.current},Object.defineProperty(t.prototype,"activeParticlesPerfCounter",{get:function(){return this._activeParticles},enumerable:!0,configurable:!0}),t.prototype.getActiveBones=function(){return this._activeBones.current},Object.defineProperty(t.prototype,"activeBonesPerfCounter",{get:function(){return this._activeBones},enumerable:!0,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._updatePointerPosition=function(e){var t=this._engine.getRenderingCanvasClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)},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._createMultiviewUbo=function(){this._multiviewSceneUbo=new g.UniformBuffer(this._engine,void 0,!0),this._multiviewSceneUbo.addUniform("viewProjection",16),this._multiviewSceneUbo.addUniform("viewProjectionR",16),this._multiviewSceneUbo.addUniform("view",16)},t.prototype._setRayOnPointerInfo=function(e){e.pickInfo&&!e.pickInfo._pickingUnavailable&&(e.pickInfo.ray||(e.pickInfo.ray=this.createPickingRay(e.event.offsetX,e.event.offsetY,u.Matrix.Identity(),this.activeCamera)))},t.prototype.simulatePointerMove=function(e,t){var r=new PointerEvent("pointermove",t);return this._checkPrePointerObservable(e,r,v.PointerEventTypes.POINTERMOVE)?this:this._processPointerMove(e,r)},t.prototype._processPointerMove=function(e,t){var r=this._engine.getRenderingCanvas();if(!r)return this;r.style.cursor=this.defaultCursor;var n=!!(e&&e.hit&&e.pickedMesh);n?(this.setPointerOverMesh(e.pickedMesh),this._pointerOverMesh&&this._pointerOverMesh.actionManager&&this._pointerOverMesh.actionManager.hasPointerTriggers&&(this._pointerOverMesh.actionManager.hoverCursor?r.style.cursor=this._pointerOverMesh.actionManager.hoverCursor:r.style.cursor=this.hoverCursor)):this.setPointerOverMesh(null);for(var i=0,o=this._pointerMoveStage;i<o.length;i++){e=o[i].action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,n,r)}if(e){var s=t.type===this._wheelEventName?v.PointerEventTypes.POINTERWHEEL:v.PointerEventTypes.POINTERMOVE;if(this.onPointerMove&&this.onPointerMove(t,e,s),this.onPointerObservable.hasObservers()){var a=new v.PointerInfo(s,t,e);this._setRayOnPointerInfo(a),this.onPointerObservable.notifyObservers(a,s)}}return this},t.prototype._checkPrePointerObservable=function(e,t,r){var n=new v.PointerInfoPre(r,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(n.ray=e.ray),this.onPrePointerObservable.notifyObservers(n,r),!!n.skipOnPointerObservable},t.prototype.simulatePointerDown=function(e,t){var r=new PointerEvent("pointerdown",t);return this._checkPrePointerObservable(e,r,v.PointerEventTypes.POINTERDOWN)?this:this._processPointerDown(e,r)},t.prototype._processPointerDown=function(e,r){var n=this;if(e&&e.hit&&e.pickedMesh){this._pickedDownMesh=e.pickedMesh;var i=e.pickedMesh.actionManager;if(i){if(i.hasPickTriggers)switch(i.processTrigger(x.Constants.ACTION_OnPickDownTrigger,y.ActionEvent.CreateNew(e.pickedMesh,r)),r.button){case 0:i.processTrigger(x.Constants.ACTION_OnLeftPickTrigger,y.ActionEvent.CreateNew(e.pickedMesh,r));break;case 1:i.processTrigger(x.Constants.ACTION_OnCenterPickTrigger,y.ActionEvent.CreateNew(e.pickedMesh,r));break;case 2:i.processTrigger(x.Constants.ACTION_OnRightPickTrigger,y.ActionEvent.CreateNew(e.pickedMesh,r))}i.hasSpecificTrigger(x.Constants.ACTION_OnLongPressTrigger)&&window.setTimeout(function(){var e=n.pick(n._unTranslatedPointerX,n._unTranslatedPointerY,function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.actionManager&&e.actionManager.hasSpecificTrigger(x.Constants.ACTION_OnLongPressTrigger)&&e==n._pickedDownMesh},!1,n.cameraToUseForPointers);e&&e.hit&&e.pickedMesh&&i&&0!==n._totalPointersPressed&&Date.now()-n._startingPointerTime>t.LongPressDelay&&!n._isPointerSwiping()&&(n._startingPointerTime=0,i.processTrigger(x.Constants.ACTION_OnLongPressTrigger,y.ActionEvent.CreateNew(e.pickedMesh,r)))},t.LongPressDelay)}}else for(var o=0,s=this._pointerDownStage;o<s.length;o++){e=s[o].action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,r)}if(e){var a=v.PointerEventTypes.POINTERDOWN;if(this.onPointerDown&&this.onPointerDown(r,e,a),this.onPointerObservable.hasObservers()){var c=new v.PointerInfo(a,r,e);this._setRayOnPointerInfo(c),this.onPointerObservable.notifyObservers(c,a)}}return this},t.prototype.simulatePointerUp=function(e,t,r){var n=new PointerEvent("pointerup",t),i=new O;return r?i.doubleClick=!0:i.singleClick=!0,this._checkPrePointerObservable(e,n,v.PointerEventTypes.POINTERUP)?this:this._processPointerUp(e,n,i)},t.prototype._processPointerUp=function(e,t,r){if(e&&e&&e.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(this.onPointerPick&&this.onPointerPick(t,e),r.singleClick&&!r.ignore&&this.onPointerObservable.hasObservers())){var n=v.PointerEventTypes.POINTERPICK,i=new v.PointerInfo(n,t,e);this._setRayOnPointerInfo(i),this.onPointerObservable.notifyObservers(i,n)}var o=e.pickedMesh._getActionManagerForTrigger();if(o&&!r.ignore){o.processTrigger(x.Constants.ACTION_OnPickUpTrigger,y.ActionEvent.CreateNew(e.pickedMesh,t)),!r.hasSwiped&&r.singleClick&&o.processTrigger(x.Constants.ACTION_OnPickTrigger,y.ActionEvent.CreateNew(e.pickedMesh,t));var s=e.pickedMesh._getActionManagerForTrigger(x.Constants.ACTION_OnDoublePickTrigger);r.doubleClick&&s&&s.processTrigger(x.Constants.ACTION_OnDoublePickTrigger,y.ActionEvent.CreateNew(e.pickedMesh,t))}}else if(!r.ignore)for(var a=0,c=this._pointerUpStage;a<c.length;a++){e=c[a].action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t)}if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){var l=this._pickedDownMesh._getActionManagerForTrigger(x.Constants.ACTION_OnPickOutTrigger);l&&l.processTrigger(x.Constants.ACTION_OnPickOutTrigger,y.ActionEvent.CreateNew(this._pickedDownMesh,t))}var u=0;if(this.onPointerObservable.hasObservers()){if(!r.ignore&&!r.hasSwiped&&(r.singleClick&&this.onPointerObservable.hasSpecificMask(v.PointerEventTypes.POINTERTAP)?u=v.PointerEventTypes.POINTERTAP:r.doubleClick&&this.onPointerObservable.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP)&&(u=v.PointerEventTypes.POINTERDOUBLETAP),u)){i=new v.PointerInfo(u,t,e);this._setRayOnPointerInfo(i),this.onPointerObservable.notifyObservers(i,u)}if(!r.ignore){u=v.PointerEventTypes.POINTERUP;i=new v.PointerInfo(u,t,e);this._setRayOnPointerInfo(i),this.onPointerObservable.notifyObservers(i,u)}}return this.onPointerUp&&!r.ignore&&this.onPointerUp(t,e,u),this},t.prototype.isPointerCaptured=function(e){return void 0===e&&(e=0),this._pointerCaptures[e]},t.prototype._isPointerSwiping=function(){return Math.abs(this._startingPointerPosition.x-this._pointerX)>t.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>t.DragMovementThreshold},t.prototype.attachControl=function(e,r,n){var o=this;void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===n&&(n=!0),this._initActionManager=function(e,t){if(!o._meshPickProceed){var r=o.pick(o._unTranslatedPointerX,o._unTranslatedPointerY,o.pointerDownPredicate,!1,o.cameraToUseForPointers);o._currentPickResult=r,r&&(e=r.hit&&r.pickedMesh?r.pickedMesh.actionManager:null),o._meshPickProceed=!0}return e},this._delayedSimpleClick=function(e,r,n){(Date.now()-o._previousStartingPointerTime>t.DoubleClickDelay&&!o._doubleClickOccured||e!==o._previousButtonPressed)&&(o._doubleClickOccured=!1,r.singleClick=!0,r.ignore=!1,n(r,o._currentPickResult))},this._initClickEvent=function(e,r,n,i){var s=new O;o._currentPickResult=null;var a=null,c=e.hasSpecificMask(v.PointerEventTypes.POINTERPICK)||r.hasSpecificMask(v.PointerEventTypes.POINTERPICK)||e.hasSpecificMask(v.PointerEventTypes.POINTERTAP)||r.hasSpecificMask(v.PointerEventTypes.POINTERTAP)||e.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP)||r.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP);!c&&S.AbstractActionManager&&(a=o._initActionManager(a,s))&&(c=a.hasPickTriggers);var l=!1;if(c){var u=n.button;if(s.hasSwiped=o._isPointerSwiping(),!s.hasSwiped){var h=!t.ExclusiveDoubleClickMode;h||(h=!e.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP)&&!r.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP))&&!S.AbstractActionManager.HasSpecificTrigger(x.Constants.ACTION_OnDoublePickTrigger)&&(a=o._initActionManager(a,s))&&(h=!a.hasSpecificTrigger(x.Constants.ACTION_OnDoublePickTrigger)),h?(Date.now()-o._previousStartingPointerTime>t.DoubleClickDelay||u!==o._previousButtonPressed)&&(s.singleClick=!0,i(s,o._currentPickResult),l=!0):(o._previousDelayedSimpleClickTimeout=o._delayedSimpleClickTimeout,o._delayedSimpleClickTimeout=window.setTimeout(o._delayedSimpleClick.bind(o,u,s,i),t.DoubleClickDelay));var d=e.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP)||r.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP);!d&&S.AbstractActionManager.HasSpecificTrigger(x.Constants.ACTION_OnDoublePickTrigger)&&(a=o._initActionManager(a,s))&&(d=a.hasSpecificTrigger(x.Constants.ACTION_OnDoublePickTrigger)),d&&(u===o._previousButtonPressed&&Date.now()-o._previousStartingPointerTime<t.DoubleClickDelay&&!o._doubleClickOccured?(s.hasSwiped||o._isPointerSwiping()?(o._doubleClickOccured=!1,o._previousStartingPointerTime=o._startingPointerTime,o._previousStartingPointerPosition.x=o._startingPointerPosition.x,o._previousStartingPointerPosition.y=o._startingPointerPosition.y,o._previousButtonPressed=u,t.ExclusiveDoubleClickMode?(o._previousDelayedSimpleClickTimeout&&clearTimeout(o._previousDelayedSimpleClickTimeout),o._previousDelayedSimpleClickTimeout=o._delayedSimpleClickTimeout,i(s,o._previousPickResult)):i(s,o._currentPickResult)):(o._previousStartingPointerTime=0,o._doubleClickOccured=!0,s.doubleClick=!0,s.ignore=!1,t.ExclusiveDoubleClickMode&&o._previousDelayedSimpleClickTimeout&&clearTimeout(o._previousDelayedSimpleClickTimeout),o._previousDelayedSimpleClickTimeout=o._delayedSimpleClickTimeout,i(s,o._currentPickResult)),l=!0):(o._doubleClickOccured=!1,o._previousStartingPointerTime=o._startingPointerTime,o._previousStartingPointerPosition.x=o._startingPointerPosition.x,o._previousStartingPointerPosition.y=o._startingPointerPosition.y,o._previousButtonPressed=u))}}l||i(s,o._currentPickResult)},this._onPointerMove=function(e){if(o._updatePointerPosition(e),!o._checkPrePointerObservable(null,e,e.type===o._wheelEventName?v.PointerEventTypes.POINTERWHEEL:v.PointerEventTypes.POINTERMOVE)&&(o.cameraToUseForPointers||o.activeCamera)){o.pointerMovePredicate||(o.pointerMovePredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(e.enablePointerMoveEvents||o.constantlyUpdateMeshUnderPointer||null!==e.actionManager&&void 0!==e.actionManager)&&(!o.cameraToUseForPointers||0!=(o.cameraToUseForPointers.layerMask&e.layerMask))});var t=o.pick(o._unTranslatedPointerX,o._unTranslatedPointerY,o.pointerMovePredicate,!1,o.cameraToUseForPointers);o._processPointerMove(t,e)}},this._onPointerDown=function(e){if(o._totalPointersPressed++,o._pickedDownMesh=null,o._meshPickProceed=!1,o._updatePointerPosition(e),o.preventDefaultOnPointerDown&&c&&(e.preventDefault(),c.focus()),o._startingPointerPosition.x=o._pointerX,o._startingPointerPosition.y=o._pointerY,o._startingPointerTime=Date.now(),!o._checkPrePointerObservable(null,e,v.PointerEventTypes.POINTERDOWN)&&(o.cameraToUseForPointers||o.activeCamera)){o._pointerCaptures[e.pointerId]=!0,o.pointerDownPredicate||(o.pointerDownPredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!o.cameraToUseForPointers||0!=(o.cameraToUseForPointers.layerMask&e.layerMask))}),o._pickedDownMesh=null;var t=o.pick(o._unTranslatedPointerX,o._unTranslatedPointerY,o.pointerDownPredicate,!1,o.cameraToUseForPointers);o._processPointerDown(t,e)}},this._onPointerUp=function(e){0!==o._totalPointersPressed&&(o._totalPointersPressed--,o._pickedUpMesh=null,o._meshPickProceed=!1,o._updatePointerPosition(e),o.preventDefaultOnPointerUp&&c&&(e.preventDefault(),c.focus()),o._initClickEvent(o.onPrePointerObservable,o.onPointerObservable,e,function(t,r){if(o.onPrePointerObservable.hasObservers()&&!t.ignore){if(!t.hasSwiped){if(t.singleClick&&o.onPrePointerObservable.hasSpecificMask(v.PointerEventTypes.POINTERTAP)&&o._checkPrePointerObservable(null,e,v.PointerEventTypes.POINTERTAP))return;if(t.doubleClick&&o.onPrePointerObservable.hasSpecificMask(v.PointerEventTypes.POINTERDOUBLETAP)&&o._checkPrePointerObservable(null,e,v.PointerEventTypes.POINTERDOUBLETAP))return}if(o._checkPrePointerObservable(null,e,v.PointerEventTypes.POINTERUP))return}o._pointerCaptures[e.pointerId]&&(o._pointerCaptures[e.pointerId]=!1,(o.cameraToUseForPointers||o.activeCamera)&&(o.pointerUpPredicate||(o.pointerUpPredicate=function(e){return e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!o.cameraToUseForPointers||0!=(o.cameraToUseForPointers.layerMask&e.layerMask))}),!o._meshPickProceed&&(S.AbstractActionManager&&S.AbstractActionManager.HasTriggers||o.onPointerObservable.hasObservers())&&o._initActionManager(null,t),r||(r=o._currentPickResult),o._processPointerUp(r,e,t),o._previousPickResult=o._currentPickResult))}))},this._onKeyDown=function(e){var t=A.KeyboardEventTypes.KEYDOWN;if(o.onPreKeyboardObservable.hasObservers()){var r=new A.KeyboardInfoPre(t,e);if(o.onPreKeyboardObservable.notifyObservers(r,t),r.skipOnPointerObservable)return}if(o.onKeyboardObservable.hasObservers()){r=new A.KeyboardInfo(t,e);o.onKeyboardObservable.notifyObservers(r,t)}o.actionManager&&o.actionManager.processTrigger(x.Constants.ACTION_OnKeyDownTrigger,y.ActionEvent.CreateNewFromScene(o,e))},this._onKeyUp=function(e){var t=A.KeyboardEventTypes.KEYUP;if(o.onPreKeyboardObservable.hasObservers()){var r=new A.KeyboardInfoPre(t,e);if(o.onPreKeyboardObservable.notifyObservers(r,t),r.skipOnPointerObservable)return}if(o.onKeyboardObservable.hasObservers()){r=new A.KeyboardInfo(t,e);o.onKeyboardObservable.notifyObservers(r,t)}o.actionManager&&o.actionManager.processTrigger(x.Constants.ACTION_OnKeyUpTrigger,y.ActionEvent.CreateNewFromScene(o,e))};var s=this.getEngine();this._onCanvasFocusObserver=s.onCanvasFocusObservable.add(function(){c&&(c.addEventListener("keydown",o._onKeyDown,!1),c.addEventListener("keyup",o._onKeyUp,!1))}),this._onCanvasBlurObserver=s.onCanvasBlurObservable.add(function(){c&&(c.removeEventListener("keydown",o._onKeyDown),c.removeEventListener("keyup",o._onKeyUp))});var a=i.Tools.GetPointerPrefix(),c=this._engine.getRenderingCanvas();c&&(n&&(c.addEventListener(a+"move",this._onPointerMove,!1),this._wheelEventName="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",c.addEventListener(this._wheelEventName,this._onPointerMove,!1)),r&&c.addEventListener(a+"down",this._onPointerDown,!1),e&&window.addEventListener(a+"up",this._onPointerUp,!1),c.tabIndex=1)},t.prototype.detachControl=function(){var e=this.getEngine(),t=i.Tools.GetPointerPrefix(),r=e.getRenderingCanvas();r&&(r.removeEventListener(t+"move",this._onPointerMove),r.removeEventListener(t+"down",this._onPointerDown),window.removeEventListener(t+"up",this._onPointerUp),this._onCanvasBlurObserver&&e.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onCanvasFocusObserver&&e.onCanvasFocusObservable.remove(this._onCanvasFocusObserver),r.removeEventListener(this._wheelEventName,this._onPointerMove),r.removeEventListener("keydown",this._onKeyDown),r.removeEventListener("keyup",this._onKeyUp),this.onKeyboardObservable.clear(),this.onPreKeyboardObservable.clear(),this.onPointerObservable.clear(),this.onPrePointerObservable.clear())},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="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===x.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 c=0,l=this.particleSystems;c<l.length;c++){if(!l[c].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:!0,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;if(this._registerTransientComponents(),this.isReady())return this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1);this._executeWhenReadyTimeoutId=setTimeout(function(){e._checkIsReady()},150)},Object.defineProperty(t.prototype,"animatables",{get:function(){return this._activeAnimatables},enumerable:!0,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),r&&n&&r.multiplyToRef(n,this._transformMatrixR),this._frustumPlanes?u.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=u.Frustum.GetPlanes(this._transformMatrix),r&&n&&(r.multiplyToRef(n,u.Tmp.Matrix[0]),u.Frustum.GetRightPlaneToRef(u.Tmp.Matrix[0],this._frustumPlanes[3])),this._multiviewSceneUbo&&this._multiviewSceneUbo.useUbo?(this._multiviewSceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._multiviewSceneUbo.updateMatrix("viewProjectionR",this._transformMatrixR),this._multiviewSceneUbo.updateMatrix("view",this._viewMatrix),this._multiviewSceneUbo.update()):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(){var e=t._uniqueIdCounter;return t._uniqueIdCounter++,e},t.prototype.addMesh=function(e,t){var r=this;void 0===t&&(t=!1),this.meshes.push(e),e._resyncLightSources(),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()),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){r.removeMesh(e)}),n},t.prototype.addTransformNode=function(e){e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),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()}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)}this.lights.splice(t,1),this.sortLightsByPriority()}return this.onLightRemovedObservable.notifyObservers(e),t},t.prototype.removeCamera=function(e){var t=this.cameras.indexOf(e);-1!==t&&this.cameras.splice(t,1);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.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){this.lights.push(e),this.sortLightsByPriority();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(m.Light.CompareLightsPriority)},t.prototype.addCamera=function(e){this.cameras.push(e),this.onNewCameraAddedObservable.notifyObservers(e)},t.prototype.addSkeleton=function(e){this.skeletons.push(e),this.onNewSkeletonAddedObservable.notifyObservers(e)},t.prototype.addParticleSystem=function(e){this.particleSystems.push(e)},t.prototype.addAnimation=function(e){this.animations.push(e)},t.prototype.addAnimationGroup=function(e){this.animationGroups.push(e)},t.prototype.addMultiMaterial=function(e){this.multiMaterials.push(e)},t.prototype.addMaterial=function(e){e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),this.onNewMaterialAddedObservable.notifyObservers(e)},t.prototype.addMorphTargetManager=function(e){this.morphTargetManagers.push(e)},t.prototype.addGeometry=function(e){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.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e)},t.prototype.switchActiveCamera=function(e,t){void 0===t&&(t=!0);var r=this._engine.getRenderingCanvas();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.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.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.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:!0,configurable:!0}),t.prototype.addExternalData=function(e,t){return this._externalData||(this._externalData=new c.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 c.StringDictionary),this._externalData.getOrAddWithFactory(e,t)},t.prototype.removeExternalData=function(e){return this._externalData.remove(e)},t.prototype._evaluateSubMesh=function(e,t){if(this.dispatchAllSubMeshesOfActiveMeshes||t.alwaysSelectAsActiveMesh||1===t.subMeshes.length||e.isInFrustum(this._frustumPlanes)){for(var r=0,n=this._evaluateSubMeshStage;r<n.length;r++){n[r].action(t,e)}var i=e.getMaterial();null!=i&&(i.hasRenderTargetTextures&&void 0!==i.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(i)&&(this._processedMaterials.push(i),this._renderTargets.concatWithNoDuplicate(i.getRenderTargetTextures())),this._activeIndices.addCount(e.indexCount,!1),this._renderingManager.dispatch(e,t,i))}},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:!0,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(){return this.activeCamera?(this._frustumPlanes||this.setTransformMatrix(this.activeCamera.getViewMatrix(),this.activeCamera.getProjectionMatrix()),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this):this},t.prototype.unfreezeActiveMeshes=function(){return this._activeMeshesFrozen=!1,this},t.prototype._evaluateActiveMeshes=function(){if((!this._activeMeshesFrozen||!this._activeMeshes.length)&&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 e=0,t=this._beforeEvaluateActiveMeshStage;e<t.length;e++){t[e].action()}for(var r=this.getActiveMeshCandidates(),n=r.length,i=0;i<n;i++){var o=r.data[i];if(!o.isBlocked&&(this._totalVertices.addCount(o.getTotalVertices(),!1),o.isReady()&&o.isEnabled())){o.computeWorldMatrix(),o.actionManager&&o.actionManager.hasSpecificTriggers2(x.Constants.ACTION_OnIntersectionEnterTrigger,x.Constants.ACTION_OnIntersectionExitTrigger)&&this._meshesForIntersections.pushNoDuplicate(o);var s=this.customLODSelector?this.customLODSelector(o,this.activeCamera):o.getLOD(this.activeCamera);null!=s&&(o._preActivate(),o.isVisible&&o.visibility>0&&0!=(o.layerMask&this.activeCamera.layerMask)&&(o.alwaysSelectAsActiveMesh||o.isInFrustum(this._frustumPlanes))&&(this._activeMeshes.push(o),this.activeCamera._activeMeshes.push(o),o._activate(this._renderId),s!==o&&s._activate(this._renderId),this._activeMesh(o,s)))}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(var a=0;a<this.particleSystems.length;a++){var c=this.particleSystems[a];if(c.isStarted()&&c.emitter){var l=c.emitter;l.position&&!l.isEnabled()||(this._activeParticleSystems.push(c),c.animate(),this._renderingManager.dispatchParticles(c))}}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)}},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):P.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)}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 l=this._renderTargets.data[c];if(l._shouldRender()){this._renderId++;var u=l.activeCamera&&l.activeCamera!==this.activeCamera;l.render(u,this.dumpNextRenderTargets)}}i.Tools.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}for(var h=0,d=this._cameraDrawRenderTargetStage;h<d.length;h++){d[h].action(this.activeCamera)}this._intermediateRendering=!1,this._bindFrameBuffer()}this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.postProcessManager&&!e._multiviewTexture&&this.postProcessManager._prepareFrame();for(var f=0,p=this._beforeCameraDrawStage;f<p.length;f++){p[f].action(this.activeCamera)}this.onBeforeDrawPhaseObservable.notifyObservers(this),this._renderingManager.render(null,null,!0,!0),this.onAfterDrawPhaseObservable.notifyObservers(this);for(var g=0,m=this._afterCameraDrawStage;g<m.length;g++){m[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===d.Camera.RIG_MODE_NONE||e.outputRenderTarget&&e.outputRenderTarget.getViewCount()>1&&this.getEngine().getCaps().multiview)this._renderForCamera(e);else{if(e._useMultiviewToSingleView){e._resizeOrCreateMultiviewTexture(this.getEngine().getRenderWidth(!0)/2,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._engine;this._activeCamera=e._rigCameras[t],r.setViewport(this._activeCamera.viewport),this.postProcessManager&&(this.postProcessManager._prepareFrame(),this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate))}}else for(t=0;t<e._rigCameras.length;t++)this._renderForCamera(e._rigCameras[t],e);this._activeCamera=e,this.setTransformMatrix(this._activeCamera.getViewMatrix(),this._activeCamera.getProjectionMatrix())}},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;r<t.actionManager.actions.length;r++){var n=t.actionManager.actions[r];if(n.trigger===x.Constants.ACTION_OnIntersectionEnterTrigger||n.trigger===x.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===x.Constants.ACTION_OnIntersectionEnterTrigger?(n._executeCurrent(y.ActionEvent.CreateNew(t,void 0,o)),t._intersectionsInProgress.push(o)):n.trigger===x.Constants.ACTION_OnIntersectionExitTrigger&&t._intersectionsInProgress.push(o):!s&&a>-1&&(n.trigger===x.Constants.ACTION_OnIntersectionExitTrigger&&n._executeCurrent(y.ActionEvent.CreateNew(t,void 0,o)),t.actionManager.hasSpecificTrigger(x.Constants.ACTION_OnIntersectionExitTrigger,function(e){var t=e instanceof h.AbstractMesh?e:e.mesh;return o===t})&&n.trigger!==x.Constants.ACTION_OnIntersectionExitTrigger||t._intersectionsInProgress.splice(a,1))}}}},t.prototype._advancePhysicsEngineStep=function(e){},t.prototype._animate=function(){},t.prototype.render=function(e){if(void 0===e&&(e=!0),!this.isDisposed){if(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(x.Constants.ACTION_OnEveryFrameTrigger),this._engine.isDeterministicLockStep()){var r=Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime))+this._timeAccumulator,n=this.getDeterministicFrameTime(),o=0,s=this._engine.getLockstepMaxSteps(),a=Math.floor(r/60);a=Math.min(a,s);do{this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=.06*n,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this._advancePhysicsEngineStep(n),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,o++,r-=n}while(r>0&&o<a);this._timeAccumulator=r<0?0:r}else{r=this.useConstantAnimationDeltaTime?16:Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime));this._animationRatio=.06*r,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this._advancePhysicsEngineStep(r)}for(var c=0,l=this._beforeCameraUpdateStage;c<l.length;c++){l[c].action()}if(e)if(this.activeCameras.length>0)for(var u=0;u<this.activeCameras.length;u++){var h=this.activeCameras[u];if(h.update(),h.cameraRigMode!==d.Camera.RIG_MODE_NONE)for(var f=0;f<h._rigCameras.length;f++)h._rigCameras[f].update()}else if(this.activeCamera&&(this.activeCamera.update(),this.activeCamera.cameraRigMode!==d.Camera.RIG_MODE_NONE))for(f=0;f<this.activeCamera._rigCameras.length;f++)this.activeCamera._rigCameras[f].update();this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);var p=this.getEngine(),g=this.activeCamera;if(this.renderTargetsEnabled){i.Tools.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._intermediateRendering=!0;for(var m=0;m<this.customRenderTargets.length;m++){var _=this.customRenderTargets[m];if(_._shouldRender()){if(this._renderId++,this.activeCamera=_.activeCamera||this.activeCamera,!this.activeCamera)throw new Error("Active camera not set");p.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),_.render(g!==this.activeCamera,this.dumpNextRenderTargets)}}i.Tools.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._intermediateRendering=!1,this._renderId++}this.activeCamera=g,this._bindFrameBuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(var v=0,A=this._beforeClearStage;v<A.length;v++){A[v].action()}(this.autoClearDepthAndStencil||this.autoClear)&&this._engine.clear(this.clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil);for(var y=0,b=this._gatherRenderTargetsStage;y<b.length;y++){b[y].action(this._renderTargets)}if(this.activeCameras.length>0)for(u=0;u<this.activeCameras.length;u++)u>0&&this._engine.clear(null,!1,!0,!0),this._processSubCameras(this.activeCameras[u]);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera)}this._checkIntersections();for(var T=0,E=this._afterRenderStage;T<E.length;T++){E[T].action()}if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(f=0;f<this._toBeDisposed.length;f++){var C=this._toBeDisposed[f];C&&C.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,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.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.getRenderingCanvas();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:!0,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(),o=n.boundingBox.minimumWorld,s=n.boundingBox.maximumWorld;i.Tools.CheckExtends(o,t,r),i.Tools.CheckExtends(s,t,r)}}),{min:t,max:r}},t.prototype.createPickingRay=function(e,t,r,n,i){throw void 0===i&&(i=!1),R._DevTools.WarnImport("Ray")},t.prototype.createPickingRayToRef=function(e,t,r,n,i,o){throw void 0===o&&(o=!1),R._DevTools.WarnImport("Ray")},t.prototype.createPickingRayInCameraSpace=function(e,t,r){throw R._DevTools.WarnImport("Ray")},t.prototype.createPickingRayInCameraSpaceToRef=function(e,t,r,n){throw R._DevTools.WarnImport("Ray")},t.prototype.pick=function(e,t,r,n,i,o){var s=new _.PickingInfo;return s._pickingUnavailable=!0,s},t.prototype.pickWithRay=function(e,t,r,n){throw R._DevTools.WarnImport("Ray")},t.prototype.multiPick=function(e,t,r,n,i){throw R._DevTools.WarnImport("Ray")},t.prototype.multiPickWithRay=function(e,t,r){throw R._DevTools.WarnImport("Ray")},t.prototype.setPointerOverMesh=function(e){var t;this._pointerOverMesh!==e&&(this._pointerOverMesh&&(t=this._pointerOverMesh._getActionManagerForTrigger(x.Constants.ACTION_OnPointerOutTrigger))&&t.processTrigger(x.Constants.ACTION_OnPointerOutTrigger,y.ActionEvent.CreateNew(this._pointerOverMesh)),this._pointerOverMesh=e,this._pointerOverMesh&&(t=this._pointerOverMesh._getActionManagerForTrigger(x.Constants.ACTION_OnPointerOverTrigger))&&t.processTrigger(x.Constants.ACTION_OnPointerOverTrigger,y.ActionEvent.CreateNew(this._pointerOverMesh)))},t.prototype.getPointerOverMesh=function(){return this._pointerOverMesh},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(x.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];l.Tags&&l.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(x.Constants.MATERIAL_AllDirtyFlag))},enumerable:!0,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,o,s){var a=this,c=i.Tools.LoadFile(e,t,r,n?this.offlineProvider:void 0,o,s);return this._activeRequests.push(c),c.onCompleteObservable.add(function(e){a._activeRequests.splice(a._activeRequests.indexOf(e),1)}),c},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._uniqueIdCounter=0,t.FOGMODE_NONE=0,t.FOGMODE_EXP=1,t.FOGMODE_EXP2=2,t.FOGMODE_LINEAR=3,t.MinDeltaTime=1,t.MaxDeltaTime=1e3,t.DragMovementThreshold=10,t.LongPressDelay=500,t.DoubleClickDelay=300,t.ExclusiveDoubleClickMode=!1,t}(f.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_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_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_AFTERRENDER_AUDIO=0,e.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=0,e.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1,e.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=2,e.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3,e.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=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 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;n++){if(e<this[n].index)break}this.splice(n,0,{index:e,component:t,action:r.bind(t)})},t.prototype.clear=function(){this.length=0},t}(Array)}})},e.exports=r()}).call(this,r(9))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25).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]?e(t[n],r[n]):void 0!==r[n]&&(t[n]=r[n]))})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!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 c=parseFloat(a);isNaN(c)||(a=c)}}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),c=t.map(a),l=i.kebabToCamel(a.nodeName.toLowerCase());if(a.attributes.getNamedItem("array")&&"true"===a.attributes.getNamedItem("array").nodeValue)r[l]=[];else if(e.attributes.getNamedItem("array")&&"true"===e.attributes.getNamedItem("array").nodeValue)r.push(c);else if(r[l]){e.setAttribute("array","true"),r=[r[l],c]}else r[l]=c;n(a,r[l]||c)}return r};return n(e,r),r},e}(),c=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=c,t.mapperManager=new c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!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:!0,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":
- /*!***********************************************************!*\
- !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
- \***********************************************************/
- /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */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 c}),r.d(t,"__metadata",function(){return l}),r.d(t,"__awaiter",function(){return u}),r.d(t,"__generator",function(){return h}),r.d(t,"__exportStar",function(){return d}),r.d(t,"__values",function(){return f}),r.d(t,"__read",function(){return p}),r.d(t,"__spread",function(){return g}),r.d(t,"__await",function(){return m}),r.d(t,"__asyncGenerator",function(){return _}),r.d(t,"__asyncDelegator",function(){return v}),r.d(t,"__asyncValues",function(){return A}),r.d(t,"__makeTemplateObject",function(){return y}),r.d(t,"__importStar",function(){return b}),r.d(t,"__importDefault",function(){return T});
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation. All rights reserved.
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of the
- License at http://www.apache.org/licenses/LICENSE-2.0
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
- MERCHANTABLITY OR NON-INFRINGEMENT.
- See the Apache Version 2.0 License for specific language governing permissions
- and limitations under the License.
- ***************************************************************************** */
- 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&&(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 c(e,t){return function(r,n){t(r,n,e)}}function l(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{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,a)}c((n=n.apply(e,t||[])).next())})}function h(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])}}}function d(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function f(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function p(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(p(arguments[t]));return e}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function _(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 m?Promise.resolve(r.value.v).then(c,l):u(o[0][2],r)}catch(e){u(o[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function v(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:m(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=f(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 y(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function b(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function T(e){return e&&e.__esModule?e:{default:e}}},"../../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(/*! ./objFileLoader */"./OBJ/objFileLoader.ts");r.d(t,"MTLFileLoader",function(){return n.MTLFileLoader}),r.d(t,"OBJFileLoader",function(){return n.OBJFileLoader})},"./OBJ/objFileLoader.ts":
- /*!******************************!*\
- !*** ./OBJ/objFileLoader.ts ***!
- \******************************/
- /*! exports provided: MTLFileLoader, OBJFileLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"MTLFileLoader",function(){return i}),r.d(t,"OBJFileLoader",function(){return o});var n=r(/*! babylonjs/Maths/math */"babylonjs/Misc/observable"),i=function(){function e(){this.materials=[]}return e.prototype.parseMTL=function(t,r,i){if(!(r instanceof ArrayBuffer)){for(var o,s=r.split("\n"),a=/\s+/,c=null,l=0;l<s.length;l++){var u=s[l].trim();if(0!==u.length&&"#"!==u.charAt(0)){var h=u.indexOf(" "),d=h>=0?u.substring(0,h):u;d=d.toLowerCase();var f=h>=0?u.substring(h+1).trim():"";"newmtl"===d?(c&&this.materials.push(c),c=new n.StandardMaterial(f,t)):"kd"===d&&c?(o=f.split(a,3).map(parseFloat),c.diffuseColor=n.Color3.FromArray(o)):"ka"===d&&c?(o=f.split(a,3).map(parseFloat),c.ambientColor=n.Color3.FromArray(o)):"ks"===d&&c?(o=f.split(a,3).map(parseFloat),c.specularColor=n.Color3.FromArray(o)):"ke"===d&&c?(o=f.split(a,3).map(parseFloat),c.emissiveColor=n.Color3.FromArray(o)):"ns"===d&&c?c.specularPower=parseFloat(f):"d"===d&&c?c.alpha=parseFloat(f):"map_ka"===d&&c?c.ambientTexture=e._getTexture(i,f,t):"map_kd"===d&&c?c.diffuseTexture=e._getTexture(i,f,t):"map_ks"===d&&c?c.specularTexture=e._getTexture(i,f,t):"map_ns"===d||("map_bump"===d&&c?c.bumpTexture=e._getTexture(i,f,t):"map_d"===d&&c&&(c.opacityTexture=e._getTexture(i,f,t)))}}c&&this.materials.push(c)}},e._getTexture=function(e,t,r){if(!t)return null;var i=e;if("file:"===e){var o=t.lastIndexOf("\\");-1===o&&(o=t.lastIndexOf("/")),i+=o>-1?t.substr(o+1):t}else i+=t;return new n.Texture(i,r)},e}(),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._meshLoadOptions=t||e.currentMeshLoadOptions}return Object.defineProperty(e,"currentMeshLoadOptions",{get:function(){return{ComputeNormals:e.COMPUTE_NORMALS,ImportVertexColors:e.IMPORT_VERTEX_COLORS,InvertY:e.INVERT_Y,MaterialLoadingFailsSilently:e.MATERIAL_LOADING_FAILS_SILENTLY,OptimizeWithUV:e.OPTIMIZE_WITH_UV,SkipMaterials:e.SKIP_MATERIALS}},enumerable:!0,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){return 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)}),r.removeAllFromScene(),r})},e.prototype._parseSolid=function(e,t,r,o){for(var s,a=this,c=[],l=[],u=[],h=[],d=[],f=[],p=[],g=[],m=[],_=[],v=[],A=0,y=!1,b=[],T=[],E=[],x=[],C=[],P="",M="",S=new i,R=1,O=!0,I=new n.Color4(.5,.5,.5,1),D=function(e,t,r,n,i,o,s){var c;-1==(c=a._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}(v,[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]}(v,[e,r]))?(f.push(p.length),p.push(n),g.push(i),_.push(o),void 0!==s&&m.push(s),v[e].normals.push(r),v[e].idx.push(A++),a._meshLoadOptions.OptimizeWithUV&&v[e].uv.push(t)):f.push(c)},w=function(){for(var e=0;e<p.length;e++)b.push(p[e].x,p[e].y,p[e].z),E.push(_[e].x,_[e].y,_[e].z),x.push(g[e].x,g[e].y);!0===a._meshLoadOptions.ImportVertexColors&&T.push(m[e].r,m[e].g,m[e].b,m[e].a),p=[],_=[],g=[],m=[],v=[],A=0},L=function(e,t){t+1<e.length&&(C.push(e[0],e[t],e[t+1]),L(e,t+=1))},B=function(e,t){L(e,t);for(var r=0;r<C.length;r++){var i=parseInt(C[r])-1;D(i,0,0,c[i],n.Vector2.Zero(),n.Vector3.Up(),!0===a._meshLoadOptions.ImportVertexColors?h[i]:void 0)}C=[]},F=function(e,t){L(e,t);for(var r=0;r<C.length;r++){var i=C[r].split("/"),o=parseInt(i[0])-1,s=parseInt(i[1])-1;D(o,s,0,c[o],u[s],n.Vector3.Up(),!0===a._meshLoadOptions.ImportVertexColors?h[o]:void 0)}C=[]},N=function(e,t){L(e,t);for(var r=0;r<C.length;r++){var n=C[r].split("/"),i=parseInt(n[0])-1,o=parseInt(n[1])-1,s=parseInt(n[2])-1;D(i,o,s,c[i],u[o],l[s])}C=[]},V=function(e,t){L(e,t);for(var r=0;r<C.length;r++){var i=C[r].split("//"),o=parseInt(i[0])-1,s=parseInt(i[1])-1;D(o,1,s,c[o],n.Vector2.Zero(),l[s],!0===a._meshLoadOptions.ImportVertexColors?h[o]:void 0)}C=[]},U=function(e,t){L(e,t);for(var r=0;r<C.length;r++){var n=C[r].split("/"),i=c.length+parseInt(n[0]),o=u.length+parseInt(n[1]),s=l.length+parseInt(n[2]);D(i,o,s,c[i],u[o],l[s],!0===a._meshLoadOptions.ImportVertexColors?h[i]:void 0)}C=[]},G=function(){d.length>0&&(s=d[d.length-1],w(),f.reverse(),s.indices=f.slice(),s.positions=b.slice(),s.normals=E.slice(),s.uvs=x.slice(),!0===a._meshLoadOptions.ImportVertexColors&&(s.colors=T.slice()),f=[],b=[],T=[],E=[],x=[])},k=r.split("\n"),z=0;z<k.length;z++){var H,j=k[z].trim();if(0!==j.length&&"#"!==j.charAt(0))if(this.vertexPattern.test(j))H=j.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(I));else if(null!==(H=this.normalPattern.exec(j)))l.push(new n.Vector3(parseFloat(H[1]),parseFloat(H[2]),parseFloat(H[3])));else if(null!==(H=this.uvPattern.exec(j)))u.push(new n.Vector2(parseFloat(H[1]),parseFloat(H[2])));else if(null!==(H=this.facePattern3.exec(j)))N(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern4.exec(j)))V(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern5.exec(j)))U(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern2.exec(j)))F(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern1.exec(j)))B(H[1].trim().split(" "),1);else if(this.group.test(j)||this.obj.test(j)){var X={name:j.substring(2).trim(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:""};G(),d.push(X),y=!0,O=!0,R=1}else if(this.usemtl.test(j)){if(P=j.substring(7).trim(),!O){G();X={name:"_mm"+R.toString(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:P};R++,d.push(X)}y&&O&&(d[d.length-1].materialName=P,O=!1)}else this.mtllib.test(j)?M=j.substring(7).trim():this.smooth.test(j)||console.log("Unhandled expression at line : "+j)}y&&(s=d[d.length-1],f.reverse(),w(),s.indices=f,s.positions=b,s.normals=E,s.uvs=x,!0===this._meshLoadOptions.ImportVertexColors&&(s.colors=T)),y||(f.reverse(),w(),d.push({name:n.Geometry.RandomId(),indices:f,positions:b,colors:T,normals:E,uvs:x,materialName:P}));for(var W=[],Y=new Array,Q=0;Q<d.length;Q++){if(e&&d[Q].name)if(e instanceof Array){if(-1==e.indexOf(d[Q].name))continue}else if(d[Q].name!==e)continue;s=d[Q];var K=new n.Mesh(d[Q].name,t);Y.push(d[Q].materialName);var Z=new n.VertexData;if(Z.uvs=s.uvs,Z.indices=s.indices,Z.positions=s.positions,!0===this._meshLoadOptions.ComputeNormals){var J=new Array;n.VertexData.ComputeNormals(s.positions,s.indices,J),Z.normals=J}else Z.normals=s.normals;!0===this._meshLoadOptions.ImportVertexColors&&(Z.colors=s.colors),Z.applyToMesh(K),this._meshLoadOptions.InvertY&&(K.scaling.y*=-1),W.push(K)}var q=[];return""!==M&&!1===this._meshLoadOptions.SkipMaterials&&q.push(new Promise(function(e,r){a._loadMTL(M,o,function(i){try{S.parseMTL(t,i,o);for(var s=0;s<S.materials.length;s++){for(var c,l=0,u=[];(c=Y.indexOf(S.materials[s].name,l))>-1;)u.push(c),l=c+1;if(-1==c&&0==u.length)S.materials[s].dispose();else for(var h=0;h<u.length;h++)W[u[h]].material=S.materials[s]}e()}catch(t){n.Tools.Warn("Error processing MTL file: '"+M+"'"),a._meshLoadOptions.MaterialLoadingFailsSilently?e():r(t)}},function(t,i){n.Tools.Warn("Error downloading MTL file: '"+M+"'"),a._meshLoadOptions.MaterialLoadingFailsSilently?e():r(i)})})),Promise.all(q).then(function(){return W})},e.OPTIMIZE_WITH_UV=!1,e.INVERT_Y=!1,e.IMPORT_VERTEX_COLORS=!1,e.COMPUTE_NORMALS=!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 c;if("string"!=typeof r){if(this._isBinary(r)){var l=new n.Mesh("stlmesh",t);return this._parseBinary(l,r),o&&o.push(l),!0}for(var u=new Uint8Array(r),h="",d=0;d<r.byteLength;d++)h+=String.fromCharCode(u[d]);r=h}for(;c=this.solidPattern.exec(r);){var f=c[1];if(f!=c[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";l=new n.Mesh(f,t);this._parseASCII(l,c[2]),o&&o.push(l)}return!0},e.prototype.load=function(e,t,r){var n=this.importMesh(null,e,t,r,null,null,null);return n&&(e.createDefaultLight(),e.createDefaultCameraOrLight()),n},e.prototype.loadAssetContainer=function(e,t,r,i){var o=new n.AssetContainer(e);return this.importMesh(null,e,t,r,o.meshes,null,null),o.removeAllFromScene(),o},e.prototype._isBinary=function(e){var t;if(50,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),c=new Uint32Array(3*i),l=0,u=0;u<i;u++){for(var h=84+50*u,d=r.getFloat32(h,!0),f=r.getFloat32(h+4,!0),p=r.getFloat32(h+8,!0),g=1;g<=3;g++){var m=h+12*g;s[o]=r.getFloat32(m,!0),s[o+2]=r.getFloat32(m+4,!0),s[o+1]=r.getFloat32(m+8,!0),a[o]=d,a[o+2]=f,a[o+1]=p,o+=3}c[l]=l++,c[l]=l++,c[l]=l++}e.setVerticesData(n.VertexBuffer.PositionKind,s),e.setVerticesData(n.VertexBuffer.NormalKind,a),e.setIndices(c),e.computeWorldMatrix(!0)},e.prototype._parseASCII=function(e,t){for(var r,i=[],o=[],s=[],a=0;r=this.facetsPattern.exec(t);){var c=r[1],l=this.normalPattern.exec(c);if(this.normalPattern.lastIndex=0,l){for(var u,h=[Number(l[1]),Number(l[5]),Number(l[3])];u=this.vertexPattern.exec(c);)i.push(Number(u[1]),Number(u[5]),Number(u[3])),o.push(h[0],h[1],h[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 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&&(r(this._bin),!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 c=a.extensions[this.name],l=e.bufferViews[c.bufferView];return r(o.GLTFUtils.GetBufferFromBufferView(e,l,0,l.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],c=e.bufferViews[a.bufferView],l=o.GLTFUtils.GetBufferFromBufferView(e,c,0,c.byteLength,s.EComponentType.UNSIGNED_BYTE);return setTimeout(function(){var e=o.GLTFUtils.DecodeBufferToText(l);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 */"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 c=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}(),l=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],u=["world","view","projection","worldView","worldViewProjection","mBones"],h=["translation","rotation","scale"],d=["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]},g=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},m=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 c=s[a];if(c.jointName){var l=c.children;for(i=0;i<l.length;i++){var u=e.nodes[l[i]];if(u.jointName&&u.jointName===r){var h=m(c),d=new o.Bone(c.name||"",n,_(e,t,c.jointName,n),h);return d.id=a,d}}}}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},A=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},y=function(e,t){for(var r=0;r<e.jointNames.length;r++)if(e.jointNames[r]===t)return!0;return!1},b=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&&!y(r,s.jointName)){var c=m(s),l=new o.Bone(s.name||"",t,null,c);l.id=a,n.push({bone:l,node:s,id:a})}}for(var u=0;u<n.length;u++)for(var h=n[u],d=h.node.children,f=0;f<d.length;f++){for(var p=null,g=0;g<n.length;g++)if(n[g].id===d[f]){p=n[g];break}p&&(p.bone._parent=h.bone,h.bone.children.push(p.bone))}}(e,n,t,s),n.bones=[];for(var c=0;c<t.jointNames.length;c++){if(C=A(e,t.jointNames[c])){var l=C.node;if(l){i=C.id;var u=e.scene.getBoneByID(i);if(u)n.bones.push(u);else{for(var h=!1,d=null,f=0;f<c;f++){var p=A(e,t.jointNames[f]);if(p){var g=p.node;if(g){var b=g.children;if(b){h=!1;for(var T=0;T<b.length;T++)if(b[T]===i){d=_(e,t,t.jointNames[f],n),h=!0;break}if(h)break}}else o.Tools.Warn("Joint named "+t.jointNames[f]+" does not exist when looking for parent")}}var E=m(l);!d&&s.length>0&&(d=v(s,i))&&-1===a.indexOf(d)&&a.push(d),new o.Bone(l.jointName||"",n,d,E).id=i}}else o.Tools.Warn("Joint named "+t.jointNames[c]+" does not exist")}}var x=n.bones;n.bones=[];for(c=0;c<t.jointNames.length;c++){var C;if(C=A(e,t.jointNames[c]))for(f=0;f<x.length;f++)if(x[f].id===C.id){n.bones.push(x[f]);break}}n.prepare();for(c=0;c<a.length;c++)n.bones.push(a[c]);return n},T=function(e,t,r,n,i){if(i||((i=new o.Mesh(t.name||"",e.scene)).id=n),!t.babylonNode)return i;for(var c,l=[],u=null,h=new Array,d=new Array,f=new Array,g=new Array,m=0;m<r.length;m++){var _=r[m];if(D=e.meshes[_])for(var v=0;v<D.primitives.length;v++){var A=new o.VertexData,y=D.primitives[v];y.mode;var b=y.attributes,T=null,E=null;for(var x in b)if(T=e.accessors[b[x]],E=s.GLTFUtils.GetBufferFromAccessor(e,T),"NORMAL"===x)A.normals=new Float32Array(E.length),A.normals.set(E);else if("POSITION"===x){if(a.GLTFFileLoader.HomogeneousCoordinates){A.positions=new Float32Array(E.length-E.length/4);for(var C=0;C<E.length;C+=4)A.positions[C]=E[C],A.positions[C+1]=E[C+1],A.positions[C+2]=E[C+2]}else A.positions=new Float32Array(E.length),A.positions.set(E);d.push(A.positions.length)}else if(-1!==x.indexOf("TEXCOORD_")){var P=Number(x.split("_")[1]),M=o.VertexBuffer.UVKind+(0===P?"":P+1),S=new Float32Array(E.length);S.set(E),p(S),A.set(S,M)}else"JOINT"===x?(A.matricesIndices=new Float32Array(E.length),A.matricesIndices.set(E)):"WEIGHT"===x?(A.matricesWeights=new Float32Array(E.length),A.matricesWeights.set(E)):"COLOR"===x&&(A.colors=new Float32Array(E.length),A.colors.set(E));if(T=e.accessors[y.indices])E=s.GLTFUtils.GetBufferFromAccessor(e,T),A.indices=new Int32Array(E.length),A.indices.set(E),g.push(A.indices.length);else{var R=[];for(C=0;C<A.positions.length/3;C++)R.push(C);A.indices=new Int32Array(R),g.push(A.indices.length)}u?u.merge(A):u=A;var O=e.scene.getMaterialByID(y.material);l.push(null===O?s.GLTFUtils.GetDefaultMaterial(e.scene):O),h.push(0===h.length?0:h[h.length-1]+d[d.length-2]),f.push(0===f.length?0:f[f.length-1]+g[g.length-2])}}l.length>1?(c=new o.MultiMaterial("multimat"+n,e.scene)).subMaterials=l:c=new o.StandardMaterial("multimat"+n,e.scene),1===l.length&&(c=l[0]),i.material||(i.material=c),new o.Geometry(n,e.scene,u,!1,i),i.computeWorldMatrix(!0),i.subMeshes=[];var I=0;for(m=0;m<r.length;m++){var D;_=r[m];if(D=e.meshes[_])for(v=0;v<D.primitives.length;v++)D.primitives[v].mode,o.SubMesh.AddToMesh(I,h[I],d[I],f[I],g[I],i,i,!0),I++}return i},E=function(e,t,r,n){e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=r),e.scaling&&(e.scaling=n)},x=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=b(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 c=e.cameras[t.camera];if(c)if("orthographic"===c.type){var l=new o.FreeCamera(t.camera,o.Vector3.Zero(),e.scene,!1);l.name=t.name||"",l.mode=o.Camera.ORTHOGRAPHIC_CAMERA,l.attachControl(e.scene.getEngine().getRenderingCanvas()),i=l}else if("perspective"===c.type){var u=c[c.type],h=new o.FreeCamera(t.camera,o.Vector3.Zero(),e.scene,!1);h.name=t.name||"",h.attachControl(e.scene.getEngine().getRenderingCanvas()),u.aspectRatio||(u.aspectRatio=e.scene.getEngine().getRenderWidth()/e.scene.getEngine().getRenderHeight()),u.znear&&u.zfar&&(h.maxZ=u.zfar,h.minZ=u.znear),i=h}}}else{var d=e.lights[t.light];if(d)if("ambient"===d.type){var f=d[d.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"===d.type){var g=d[d.type],m=new o.DirectionalLight(t.light,o.Vector3.Zero(),e.scene);m.name=t.name||"",g.color&&(m.diffuse=o.Color3.FromArray(g.color)),i=m}else if("point"===d.type){var _=d[d.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"===d.type){var A=d[d.type],y=new o.SpotLight(t.light,o.Vector3.Zero(),o.Vector3.Zero(),0,0,e.scene);y.name=t.name||"",A.color&&(y.diffuse=o.Color3.FromArray(A.color)),A.fallOfAngle&&(y.angle=A.fallOfAngle),A.fallOffExponent&&(y.exponent=A.fallOffExponent),i=y}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===i){var x=new o.Mesh(t.name||"",e.scene);t.babylonNode=x,i=x}}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),E(e,n,i,s)}else t.translation&&t.rotation&&t.scale&&E(e,o.Vector3.FromArray(t.translation),o.Quaternion.FromArray(t.rotation),o.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(i,t);else{var C=t.translation||[0,0,0],P=t.rotation||[0,0,0,1],M=t.scale||[1,1,1];E(i,o.Vector3.FromArray(C),o.Quaternion.FromArray(P),o.Vector3.FromArray(M))}i.updateCache(!0),t.babylonNode=i}return i},C=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=x(e,i,t))&&(o.id=t,o.parent=r),i.children)for(var s=0;s<i.children.length;s++)C(e,i.children[s],o,n)},P=function(e){var t=e.currentScene;if(t)for(var r=0;r<t.nodes.length;r++)C(e,t.nodes[r],null);else for(var n in e.scenes){t=e.scenes[n];for(r=0;r<t.nodes.length;r++)C(e,t.nodes[r],null)}!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],c=r.samplers[a.sampler];if(c){var l=null,u=null;r.parameters?(l=r.parameters[c.input],u=r.parameters[c.output]):(l=c.input,u=c.output);var f=s.GLTFUtils.GetBufferFromAccessor(e,e.accessors[l]),p=s.GLTFUtils.GetBufferFromAccessor(e,e.accessors[u]),g=a.target.id,m=e.scene.getNodeByID(g);if(null===m&&(m=e.scene.getNodeByName(g)),null!==m){var _=m instanceof o.Bone,v=a.target.path,A=h.indexOf(v);-1!==A&&(v=d[A]);var y=o.Animation.ANIMATIONTYPE_MATRIX;_||("rotationQuaternion"===v?(y=o.Animation.ANIMATIONTYPE_QUATERNION,m.rotationQuaternion=new o.Quaternion):y=o.Animation.ANIMATIONTYPE_VECTOR3);var b=null,T=[],E=0,x=!1;_&&n&&n.getKeys().length===f.length&&(b=n,x=!0),x||(b=new o.Animation(t,_?"_matrix":v,1,y,o.Animation.ANIMATIONLOOPMODE_CYCLE));for(var C=0;C<f.length;C++){var P=null;if("rotationQuaternion"===v?(P=o.Quaternion.FromArray([p[E],p[E+1],p[E+2],p[E+3]]),E+=4):(P=o.Vector3.FromArray([p[E],p[E+1],p[E+2]]),E+=3),_){var M=m,S=o.Vector3.Zero(),R=new o.Quaternion,O=o.Vector3.Zero(),I=M.getBaseMatrix();x&&n&&(I=n.getKeys()[C].value),I.decompose(O,R,S),"position"===v?S=P:"rotationQuaternion"===v?R=P:O=P,P=o.Matrix.Compose(O,R,S)}x?n&&(n.getKeys()[C].value=P):T.push({frame:f[C],value:P})}!x&&b&&(b.setKeys(T),m.animations.push(b)),n=b,e.scene.stopAnimation(m),e.scene.beginAnimation(m,0,f[f.length-1],!0,1)}else o.Tools.Warn("Creating animation named "+t+". But cannot find node named "+g+" to attach to")}}}}(e);for(r=0;r<e.scene.skeletons.length;r++){var i=e.scene.skeletons[r];e.scene.beginAnimation(i,0,Number.MAX_VALUE,!0,1)}},M=function(e,t,r,n,o,a){return function(c){!function(e,t,r,n,o){var a=n.values||r.parameters,c=r.uniforms;for(var l in o){var u=o[l],h=u.type,d=a[c[l]];if(void 0===d&&(d=u.value),d){var f=function(e){return function(r){u.value&&e&&(t.setTexture(e,r),delete o[e])}};h===i.EParameterType.SAMPLER_2D?D.LoadTextureAsync(e,n.values?d:u.value,f(l),function(){return f(null)}):u.value&&s.GLTFUtils.SetUniform(t,l,n.values?d:u.value,h)&&delete o[l]}}}(e,t,r,n,o),t.onBind=function(c){!function(e,t,r,n,o,a,c){var l=a.values||o.parameters;for(var u in r){var h=r[u],d=h.type;if(d===i.EParameterType.FLOAT_MAT2||d===i.EParameterType.FLOAT_MAT3||d===i.EParameterType.FLOAT_MAT4)if(!h.semantic||h.source||h.node){if(h.semantic&&(h.source||h.node)){var f=t.scene.getNodeByName(h.source||h.node||"");if(null===f&&(f=t.scene.getNodeByID(h.source||h.node||"")),null===f)continue;s.GLTFUtils.SetMatrix(t.scene,f,h,u,n.getEffect())}}else s.GLTFUtils.SetMatrix(t.scene,e,h,u,n.getEffect());else{var p=l[o.uniforms[u]];if(!p)continue;if(d===i.EParameterType.SAMPLER_2D){var g=t.textures[a.values?p:h.value].babylonTexture;if(null==g)continue;n.getEffect().setTexture(u,g)}else s.GLTFUtils.SetUniform(n.getEffect(),u,p,d)}}c(n)}(c,e,o,t,r,n,a)}}},S=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=l.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:[]};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 c=e.textures[t];if(c.babylonTexture)n(c.babylonTexture);else{var l=e.samplers[c.sampler],u=l.minFilter===i.ETextureFilterType.NEAREST_MIPMAP_NEAREST||l.minFilter===i.ETextureFilterType.NEAREST_MIPMAP_LINEAR||l.minFilter===i.ETextureFilterType.LINEAR_MIPMAP_NEAREST||l.minFilter===i.ETextureFilterType.LINEAR_MIPMAP_LINEAR,h=o.Texture.BILINEAR_SAMPLINGMODE,d=null==r?new Blob:new Blob([r]),f=URL.createObjectURL(d),p=function(){return URL.revokeObjectURL(f)},g=new o.Texture(f,e.scene,!u,!0,h,p,p);void 0!==l.wrapS&&(g.wrapU=s.GLTFUtils.GetWrapMode(l.wrapS)),void 0!==l.wrapT&&(g.wrapV=s.GLTFUtils.GetWrapMode(l.wrapT)),g.name=t,c.babylonTexture=g,n(g)}},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 h=e.techniques[a.technique];if(!h){var d=new o.StandardMaterial(t,e.scene);return d.diffuseColor=new o.Color3(.5,.5,.5),d.sideOrientation=o.Material.CounterClockWiseSideOrientation,void r(d)}var f=e.programs[h.program],p=h.states,m=o.Effect.ShadersStore[f.vertexShader+"VertexShader"],_=o.Effect.ShadersStore[f.fragmentShader+"PixelShader"],v="",A="",y=new c(m),b=new c(_),T={},E=[],x=[],C=[];for(var P in h.uniforms){var R=h.uniforms[P],O=h.parameters[R];if(T[P]=O,!O.semantic||O.node||O.source)O.type===i.EParameterType.SAMPLER_2D?C.push(P):E.push(P);else{var I=l.indexOf(O.semantic);-1!==I?(E.push(u[I]),delete T[P]):E.push(P)}}for(var D in h.attributes){var w=h.attributes[D];if((F=h.parameters[w]).semantic){var L=g(F);L&&x.push(L)}}for(;!y.isEnd()&&y.getNextToken();){if(y.currentToken===n.IDENTIFIER){var B=!1;for(var D in h.attributes){w=h.attributes[D];var F=h.parameters[w];if(y.currentIdentifier===D&&F.semantic){v+=g(F),B=!0;break}}B||(v+=S(y,h,T))}else v+=y.currentString}for(;!b.isEnd()&&b.getNextToken();){b.currentToken===n.IDENTIFIER?A+=S(b,h,T):A+=b.currentString}var N={vertex:f.vertexShader+t,fragment:f.fragmentShader+t},V={attributes:x,uniforms:E,samplers:C,needAlphaBlending:p&&p.enable&&-1!==p.enable.indexOf(3042)};o.Effect.ShadersStore[f.vertexShader+t+"VertexShader"]=v,o.Effect.ShadersStore[f.fragmentShader+t+"PixelShader"]=A;var U=new o.ShaderMaterial(t,e.scene,N,V);if(U.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,U,s),U.onCompiled=M(e,U,h,a,T,r),U.sideOrientation=o.Material.CounterClockWiseSideOrientation,p&&p.functions){var G=p.functions;G.cullFace&&G.cullFace[0]!==i.ECullingType.BACK&&(U.backFaceCulling=!1);var k=G.blendFuncSeparate;k&&(k[0]===i.EBlendingFunction.SRC_ALPHA&&k[1]===i.EBlendingFunction.ONE_MINUS_SRC_ALPHA&&k[2]===i.EBlendingFunction.ONE&&k[3]===i.EBlendingFunction.ONE?U.alphaMode=o.Engine.ALPHA_COMBINE:k[0]===i.EBlendingFunction.ONE&&k[1]===i.EBlendingFunction.ONE&&k[2]===i.EBlendingFunction.ZERO&&k[3]===i.EBlendingFunction.ONE?U.alphaMode=o.Engine.ALPHA_ONEONE:k[0]===i.EBlendingFunction.SRC_ALPHA&&k[1]===i.EBlendingFunction.ONE&&k[2]===i.EBlendingFunction.ZERO&&k[3]===i.EBlendingFunction.ONE?U.alphaMode=o.Engine.ALPHA_ADD:k[0]===i.EBlendingFunction.ZERO&&k[1]===i.EBlendingFunction.ONE_MINUS_SRC_COLOR&&k[2]===i.EBlendingFunction.ONE&&k[3]===i.EBlendingFunction.ONE?U.alphaMode=o.Engine.ALPHA_SUBTRACT:k[0]===i.EBlendingFunction.DST_COLOR&&k[1]===i.EBlendingFunction.ZERO&&k[2]===i.EBlendingFunction.ONE&&k[3]===i.EBlendingFunction.ONE?U.alphaMode=o.Engine.ALPHA_MULTIPLY:k[0]===i.EBlendingFunction.SRC_ALPHA&&k[1]===i.EBlendingFunction.ONE_MINUS_SRC_COLOR&&k[2]===i.EBlendingFunction.ONE&&k[3]===i.EBlendingFunction.ONE&&(U.alphaMode=o.Engine.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,c){var l=this;return t.useRightHandedSystem=!0,D.LoadRuntimeAsync(t,r,n,function(t){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],l._createNodes(t);var r=new Array,n=new Array;for(var c in t.nodes){var u=t.nodes[c];u.babylonNode instanceof o.AbstractMesh&&r.push(u.babylonNode)}for(var h in t.skins){var d=t.skins[h];d.babylonSkeleton instanceof o.Skeleton&&n.push(d.babylonSkeleton)}l._loadBuffersAsync(t,function(){l._loadShadersAsync(t,function(){R(t),P(t),!a.GLTFFileLoader.IncrementalLoading&&i&&i(r,n)})},s),a.GLTFFileLoader.IncrementalLoading&&i&&i(r,n)},c),!0},e.prototype.importMeshAsync=function(e,t,r,n,i){var o=this;return new Promise(function(s,a){o._importMeshAsync(e,t,r,n,function(e,t){s({meshes:e,particleSystems:[],skeletons:t,animationGroups:[]})},i,function(e){a(new Error(e))})})},e.prototype._loadAsync=function(e,t,r,n,i,o){var s=this;e.useRightHandedSystem=!0,D.LoadRuntimeAsync(e,t,r,function(e){D.LoadRuntimeExtensionsAsync(e,function(){s._createNodes(e),s._loadBuffersAsync(e,function(){s._loadShadersAsync(e,function(){R(e),P(e),a.GLTFFileLoader.IncrementalLoading||n()})}),a.GLTFFileLoader.IncrementalLoading&&n()},o)},o)},e.prototype.loadAsync=function(e,t,r,n){var i=this;return new Promise(function(o,s){i._loadAsync(e,t,r,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++)C(e,t.nodes[r],null);else for(var n in e.scenes){t=e.scenes[n];for(r=0;r<t.nodes.length;r++)C(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:!0,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,c,l,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 c}),r.d(t,"ECullingType",function(){return l}),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"}(c||(c={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(l||(l={})),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 */"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 */"babylonjs/Misc/observable"),s=function(e){function t(){return e.call(this,"KHR_materials_common")||this}return 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 c=new o.HemisphericLight(a.name,new o.Vector3(0,1,0),e.scene),l=a.ambient;l&&(c.diffuse=o.Color3.FromArray(l.color||[1,1,1]));break;case"point":var u=new o.PointLight(a.name,new o.Vector3(10,10,10),e.scene),h=a.point;h&&(u.diffuse=o.Color3.FromArray(h.color||[1,1,1]));break;case"directional":var d=new o.DirectionalLight(a.name,new o.Vector3(0,-1,0),e.scene),f=a.directional;f&&(d.diffuse=o.Color3.FromArray(f.color||[1,1,1]));break;case"spot":var p=a.spot;if(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.enabled=!0,this._loader=e}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;c._loader.logOpen(""+a);var l=n[t],u=i.ArrayItem.Get(a,c._loader.gltf.images,l);o.push(c._loader.loadImageAsync("#/images/"+l,u).then(function(e){s[r][t]=e})),c._loader.logClose()},l=0;l<n.length;l++)a(l)},c=this,l=0;l<t.specularImages.length;l++)a(l);this._loader.logClose(),t._loaded=Promise.all(o).then(function(){var e=new n.RawCubeTexture(r._loader.babylonScene,null,t.specularImageSize);if(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.scale(t.intensity),o.convertIrradianceToLambertianRadiance();var a=n.SphericalPolynomial.FromHarmonics(o),c=(s.length-1)/n.Scalar.Log2(t.specularImageSize);return e.updateRGBDAsync(s,a,c)})}return t._loaded.then(function(){return t._babylonTexture})},e}();i.GLTFLoader.RegisterExtension(o,function(e){return new s(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.enabled=n.DracoCompression.DecoderAvailable,this._loader=e}return e.prototype.dispose=function(){this._dracoCompression&&(this._dracoCompression.dispose(),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 c={},l=function(e,t){var n=a.attributes[e];null!=n&&(r._delayInfo=r._delayInfo||[],-1===r._delayInfo.indexOf(t)&&r._delayInfo.push(t),c[t]=n)};l("POSITION",n.VertexBuffer.PositionKind),l("NORMAL",n.VertexBuffer.NormalKind),l("TANGENT",n.VertexBuffer.TangentKind),l("TEXCOORD_0",n.VertexBuffer.UVKind),l("TEXCOORD_1",n.VertexBuffer.UV2Kind),l("JOINTS_0",n.VertexBuffer.MatricesIndicesKind),l("WEIGHTS_0",n.VertexBuffer.MatricesWeightsKind),l("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||(o._dracoCompression=new n.DracoCompression),o._dracoCompression.decodeMeshAsync(t,c).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 a});var n,i=r(/*! babylonjs/Maths/math */"babylonjs/Misc/observable"),o=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),s="KHR_lights_punctual";!function(e){e.DIRECTIONAL="directional",e.POINT="point",e.SPOT="spot"}(n||(n={}));var a=function(){function e(e){this.name=s,this.enabled=!0,this._loader=e}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 s=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(a,c){return s._loader.loadNodeAsync(e,t,function(e){var t,l=o.ArrayItem.Get(a,s._lights,c.light),u=l.name||e.name;switch(l.type){case n.DIRECTIONAL:t=new i.DirectionalLight(u,i.Vector3.Backward(),s._loader.babylonScene);break;case n.POINT:t=new i.PointLight(u,i.Vector3.Zero(),s._loader.babylonScene);break;case n.SPOT:var h=new i.SpotLight(u,i.Vector3.Zero(),i.Vector3.Backward(),0,1,s._loader.babylonScene);h.angle=2*(l.spot&&l.spot.outerConeAngle||Math.PI/4),h.innerAngle=2*(l.spot&&l.spot.innerConeAngle||0),t=h;break;default:throw new Error(a+": Invalid light type ("+l.type+")")}t.falloffType=i.Light.FALLOFF_GLTF,t.diffuse=l.color?i.Color3.FromArray(l.color):i.Color3.White(),t.intensity=null==l.intensity?1:l.intensity,t.range=null==l.range?Number.MAX_VALUE:l.range,t.parent=e,o.GLTFLoader.AddPointerMetadata(t,a),r(e)})})},e}();o.GLTFLoader.RegisterExtension(s,function(e){return new a(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 */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_pbrSpecularGlossiness",s=function(){function e(e){this.name=o,this.enabled=!0,this._loader=e}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_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 */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_unlit",s=function(){function e(e){this.name=o,this.enabled=!0,this._loader=e}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_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.enabled=!0,this._loader=e}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/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 */"babylonjs/Misc/observable"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="MSFT_audio_emitter",s=function(){function e(e){this.name=o,this.enabled=!0,this._loader=e}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,c=o.emitters;a<c.length;a++){var l=c[a],u=i.ArrayItem.Get(n+"/emitters",r._emitters,l);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 c=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))}}))},l=0,u=s.emitters;l<u.length;l++){c(u[l])}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 c=0,l=o.events;c<l.length;c++){var u=l[c];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},c=function(e){var c="#/extensions/"+l.name+"/clips",u=i.ArrayItem.Get(c,l._clips,t.clips[e].clip);o.push(l._loadClipAsync(c+"/"+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}))},l=this,u=0;u<t.clips.length;u++)c(u);var h=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:h}}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 c=s.targetedAnimations[0],l=o.emitter,u=i.ArrayItem.Get("#/extensions/"+this.name+"/emitters",this._emitters,l);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));c.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.enabled=!0,this.maxLODsToLoad=Number.MAX_VALUE,this.onNodeLODsLoadedObservable=new n.Observable,this.onMaterialLODsLoadedObservable=new n.Observable,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._loader=e}return e.prototype.dispose=function(){delete this._loader,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.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._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._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.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&&(r._babylonTransformNode.dispose(),delete r._babylonTransformNode,o._disposeUnusedMaterials())}return t.setEnabled(!0),t});0===e?i=r:o._nodeIndexLOD=null,o._nodePromiseLODs[e]=o._nodePromiseLODs[e]||[],o._nodePromiseLODs[e].push(r)},c=0;c<s.length;c++)a(c);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,c=s._getLODs(e,t,s._loader.gltf.materials,i.ids);s._loader.logOpen(""+e);for(var l=function(e){var t=c[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=c[e-1]._data;r[n]&&(r[n].babylonMaterial.dispose(),delete r[n])}return t});0===e?a=i:s._materialIndexLOD=null,s._materialPromiseLODs[e]=s._materialPromiseLODs[e]||[],s._materialPromiseLODs[e].push(i)},u=0;u<c.length;u++)l(u);return s._loader.logClose(),a})},e.prototype._loadUriAsync=function(e,t,r){var i=this;if(null!==this._materialIndexLOD){this._loader.log("deferred");var o=this._materialIndexLOD-1;return this._materialSignalLODs[o]=this._materialSignalLODs[o]||new n.Deferred,this._materialSignalLODs[o].promise.then(function(){return i._loader.loadUriAsync(e,t,r)})}if(null!==this._nodeIndexLOD){this._loader.log("deferred");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},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._disposeUnusedMaterials=function(){var e=this._loader.gltf.materials;if(e)for(var t=0,r=e;t<r.length;t++){var n=r[t];if(n._data)for(var i in n._data){var o=n._data[i];0===o.babylonMeshes.length&&(o.babylonMaterial.dispose(!1,!0),delete n._data[i])}}},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.enabled=!0,this._loader=e}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.enabled=!0,this._loader=e}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, KHR_draco_mesh_compression, KHR_lights, KHR_materials_pbrSpecularGlossiness, KHR_materials_unlit, KHR_texture_transform, MSFT_audio_emitter, MSFT_lod, MSFT_minecraftMesh, MSFT_sRGBFactors */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(/*! ./KHR_draco_mesh_compression */"./glTF/2.0/Extensions/KHR_draco_mesh_compression.ts");r.d(t,"KHR_draco_mesh_compression",function(){return i.KHR_draco_mesh_compression});var o=r(/*! ./KHR_lights_punctual */"./glTF/2.0/Extensions/KHR_lights_punctual.ts");r.d(t,"KHR_lights",function(){return o.KHR_lights});var s=r(/*! ./KHR_materials_pbrSpecularGlossiness */"./glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts");r.d(t,"KHR_materials_pbrSpecularGlossiness",function(){return s.KHR_materials_pbrSpecularGlossiness});var a=r(/*! ./KHR_materials_unlit */"./glTF/2.0/Extensions/KHR_materials_unlit.ts");r.d(t,"KHR_materials_unlit",function(){return a.KHR_materials_unlit});var c=r(/*! ./KHR_texture_transform */"./glTF/2.0/Extensions/KHR_texture_transform.ts");r.d(t,"KHR_texture_transform",function(){return c.KHR_texture_transform});var l=r(/*! ./MSFT_audio_emitter */"./glTF/2.0/Extensions/MSFT_audio_emitter.ts");r.d(t,"MSFT_audio_emitter",function(){return l.MSFT_audio_emitter});var u=r(/*! ./MSFT_lod */"./glTF/2.0/Extensions/MSFT_lod.ts");r.d(t,"MSFT_lod",function(){return u.MSFT_lod});var h=r(/*! ./MSFT_minecraftMesh */"./glTF/2.0/Extensions/MSFT_minecraftMesh.ts");r.d(t,"MSFT_minecraftMesh",function(){return h.MSFT_minecraftMesh});var d=r(/*! ./MSFT_sRGBFactors */"./glTF/2.0/Extensions/MSFT_sRGBFactors.ts");r.d(t,"MSFT_sRGBFactors",function(){return d.MSFT_sRGBFactors})},"./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._disposed=!1,this._state=null,this._extensions={},this._defaultBabylonMaterialData={},this._requests=new Array,this._parent=e}return e.RegisterExtension=function(t,r){e.UnregisterExtension(t)&&n.Tools.Warn("Extension with the name '"+t+"' already exists"),e._ExtensionFactories[t]=r,e._ExtensionNames.push(t)},e.UnregisterExtension=function(t){if(!e._ExtensionFactories[t])return!1;delete e._ExtensionFactories[t];var r=e._ExtensionNames.indexOf(t);return-1!==r&&e._ExtensionNames.splice(r,1),!0},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gltf",{get:function(){return this._gltf},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"babylonScene",{get:function(){return this._babylonScene},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootBabylonMesh",{get:function(){return this._rootBabylonMesh},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;for(var e=0,t=this._requests;e<t.length;e++){t[e].abort()}for(var r in this._requests.length=0,this._completePromises.length=0,this._extensions){this._extensions[r].dispose&&this._extensions[r].dispose()}this._extensions={},delete this._gltf,delete this._babylonScene,delete this._rootBabylonMesh,delete this._progressCallback,this._parent._clear()}},e.prototype.importMeshAsync=function(e,t,r,n,i,o){var s=this;return Promise.resolve().then(function(){s._babylonScene=t,s._rootUrl=n,s._fileName=o||"scene",s._progressCallback=i,s._loadData(r);var a=null;if(e){var c={};if(s._gltf.nodes)for(var l=0,u=s._gltf.nodes;l<u.length;l++){var h=u[l];h.name&&(c[h.name]=h.index)}a=(e instanceof Array?e:[e]).map(function(e){var t=c[e];if(void 0===t)throw new Error("Failed to find node '"+e+"'");return t})}return s._loadAsync(a,function(){return{meshes:s._getMeshes(),particleSystems:[],skeletons:s._getSkeletons(),animationGroups:s._getAnimationGroups()}})})},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._progressCallback=n,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 c=new Array;if(e)c.push(r.loadSceneAsync("/nodes",{nodes:e,index:-1}));else if(null!=r._gltf.scene||r._gltf.scenes&&r._gltf.scenes[0]){var l=o.Get("/scene",r._gltf.scenes,r._gltf.scene||0);c.push(r.loadSceneAsync("/scenes/"+l.index,l))}r._parent.compileMaterials&&c.push(r._compileMaterialsAsync()),r._parent.compileShadowGenerators&&c.push(r._compileShadowGeneratorsAsync());var u=Promise.all(c).then(function(){return r._rootBabylonMesh&&r._rootBabylonMesh.setEnabled(!0),r._setState(i.GLTFLoaderState.READY),r._extensionsOnReady(),r._startAnimations(),t()});return u.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()})})}),u},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.Tools.Warn("Binary buffer length ("+r.byteLength+") from JSON does not match chunk length ("+e.bin.byteLength+")"),r._data=Promise.resolve(e.bin)}else n.Tools.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((l=r[t]).children)for(var n=0,i=l.children;n<i.length;n++){e[i[n]]=l.index}}for(var s=this._createRootNode(),a=0,c=this._gltf.nodes;a<c.length;a++){var l,u=e[(l=c[a]).index];l.parent=void 0===u?s:this._gltf.nodes[u]}}},e.prototype._loadExtensions=function(){for(var t=0,r=e._ExtensionNames;t<r.length;t++){var n=r[t],i=e._ExtensionFactories[n](this);this._extensions[n]=i,this._parent.onExtensionLoadedObservable.notifyObservers(i)}this._parent.onExtensionLoadedObservable.clear()},e.prototype._checkExtensions=function(){if(this._gltf.extensionsRequired)for(var e=0,t=this._gltf.extensionsRequired;e<t.length;e++){var r=t[e],n=this._extensions[r];if(!n||!n.enabled)throw new Error("Require extension "+r+" is not available")}},e.prototype._setState=function(e){this._state=e,this.log(i.GLTFLoaderState[this._state])},e.prototype._createRootNode=function(){this._rootBabylonMesh=new n.Mesh("__root__",this._babylonScene),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 c=a[s],l=o.Get(e+"/nodes/"+c,this._gltf.nodes,c);i.push(this.loadNodeAsync("/nodes/"+l.index,l,function(e){e.parent=r._rootBabylonMesh}))}if(this._gltf.nodes)for(var u=0,h=this._gltf.nodes;u<h.length;u++){if((l=h[u])._babylonTransformNode&&l._babylonBones)for(var d=0,f=l._babylonBones;d<f.length;d++){f[d].linkTransformNode(l._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._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.Tools.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 c=new Array;this.logOpen(t+" "+(r.name||""));var l=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);c.push(s.loadCameraAsync("/cameras/"+a.index,a,function(e){e.parent=n}))}if(r.children)for(var l=0,u=r.children;l<u.length;l++){var h=u[l],d=o.Get(t+"/children/"+h,s._gltf.nodes,h);c.push(s.loadNodeAsync("/nodes/"+d.index,d,function(e){e.parent=n}))}i(n)};if(null==r.mesh){var u=r.name||"node"+r.index;r._babylonTransformNode=new n.TransformNode(u,this._babylonScene),l(r._babylonTransformNode)}else{var h=o.Get(t+"/mesh",this._gltf.meshes,r.mesh);c.push(this._loadMeshAsync("/meshes/"+h.index,r,h,l))}return this.logClose(),Promise.all(c).then(function(){return s._forEachPrimitive(r,function(e){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 c=t.name||"node"+t.index;if(1===s.length){var l=r.primitives[0];a.push(this._loadMeshPrimitiveAsync(e+"/primitives/"+l.index,c,t,r,l,function(e){t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]}))}else{t._babylonTransformNode=new n.TransformNode(c,this._babylonScene),t._primitiveBabylonMeshes=[];for(var u=0,h=s;u<h.length;u++){l=h[u];a.push(this._loadMeshPrimitiveAsync(e+"/primitives/"+l.index,c+"_primitive"+l.index,t,r,l,function(e){e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)}))}}if(null!=t.skin){var d=o.Get(e+"/skin",this._gltf.skins,t.skin);a.push(this._loadSkinAsync("/skins/"+d.index,t,d))}return i(t._babylonTransformNode),this.logClose(),Promise.all(a).then(function(){return t._babylonTransformNode})},e.prototype._loadMeshPrimitiveAsync=function(t,r,i,s,a,c){var l=this;this.logOpen(""+t);var u,h,d=null==i.skin&&!s.primitives[0].targets,f=a._instanceData;if(d&&f)u=f.babylonSourceMesh.createInstance(r),h=f.promise;else{var p=new Array,g=new n.Mesh(r,this._babylonScene);this._createMorphTargets(t,i,s,a,g),p.push(this._loadVertexDataAsync(t,a,g).then(function(e){return l._loadMorphTargetsAsync(t,a,g,e).then(function(){e.applyToMesh(g)})}));var m=e._GetDrawMode(t,a.mode);if(null==a.material){var _=this._defaultBabylonMaterialData[m];_||(_=this._createDefaultMaterial("__GLTFLoader._default",m),this._parent.onMaterialLoadedObservable.notifyObservers(_),this._defaultBabylonMaterialData[m]=_),g.material=_}else{var v=o.Get(t+"/material",this._gltf.materials,a.material);p.push(this._loadMaterialAsync("/materials/"+v.index,v,g,m,function(e){g.material=e}))}h=Promise.all(p),d&&(a._instanceData={babylonSourceMesh:g,promise:h}),u=g}return e.AddPointerMetadata(u,t),this._parent.onMeshLoadedObservable.notifyObservers(u),c(u),this.logClose(),h.then(function(){return u})},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 c=new Array,l=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);c.push(this._loadIndicesAccessorAsync("/accessors/"+u.index,u).then(function(e){l.setIndices(e)}))}var h=function(t,n,s){if(null!=a[t]){r._delayInfo=r._delayInfo||[],-1===r._delayInfo.indexOf(n)&&r._delayInfo.push(n);var u=o.Get(e+"/attributes/"+t,i._gltf.accessors,a[t]);c.push(i._loadVertexAccessorAsync("/accessors/"+u.index,u,n).then(function(e){l.setVerticesBuffer(e,u.count)})),s&&s(u)}};return h("POSITION",n.VertexBuffer.PositionKind),h("NORMAL",n.VertexBuffer.NormalKind),h("TANGENT",n.VertexBuffer.TangentKind),h("TEXCOORD_0",n.VertexBuffer.UVKind),h("TEXCOORD_1",n.VertexBuffer.UV2Kind),h("JOINTS_0",n.VertexBuffer.MatricesIndicesKind),h("WEIGHTS_0",n.VertexBuffer.MatricesWeightsKind),h("COLOR_0",n.VertexBuffer.ColorKind,function(e){"VEC4"===e.type&&(r.hasVertexAlpha=!0)}),Promise.all(c).then(function(){return l})},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");o.morphTargetManager=new n.MorphTargetManager;for(var s=0;s<i.targets.length;s++){var a=t.weights?t.weights[s]:r.weights?r.weights[s]:0;o.morphTargetManager.addTarget(new n.MorphTarget("morphTarget"+s,a))}}},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,c=function(n,i,c){if(null!=r[n]){var l=t.getVertexBuffer(i);if(l){var u=o.Get(e+"/"+n,s._gltf.accessors,r[n]);a.push(s._loadFloatAccessorAsync("/accessors/"+u.index,u).then(function(e){c(l,e)}))}}};return c("POSITION",n.VertexBuffer.PositionKind,function(e,t){e.forEach(t.length,function(e,r){t[r]+=e}),i.setPositions(t)}),c("NORMAL",n.VertexBuffer.NormalKind,function(e,t){e.forEach(t.length,function(e,r){t[r]+=e}),i.setNormals(t)}),c("TANGENT",n.VertexBuffer.TangentKind,function(e,t){var r=0;e.forEach(t.length/3*4,function(e,n){(n+1)%4!=0&&(t[r++]+=e)}),i.setTangents(t)}),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();if(e.matrix)n.Matrix.FromArray(e.matrix).decompose(o,i,r);else 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=function(e){i._forEachPrimitive(t,function(t){t.skeleton=e})};if(r._data)return o(r._data.babylonSkeleton),r._data.promise;var s="skeleton"+r.index,a=new n.Skeleton(r.name||s,s,this._babylonScene);a.overrideMesh=this._rootBabylonMesh,this._loadBones(e,r,a),o(a);var c=this._loadSkinInverseBindMatricesDataAsync(e,r).then(function(e){i._updateBoneMatrices(a,e)});return r._data={babylonSkeleton:a,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],c=o.Get(e+"/joints/"+a,this._gltf.nodes,a);this._loadBone(c,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 c=o.getParent();c&&s.multiplyToRef(c.getInvertedAbsoluteTransform(),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||""));var a=new n.FreeCamera(r.name||"camera"+r.index,n.Vector3.Zero(),this._babylonScene,!1);switch(a.rotation=new n.Vector3(0,Math.PI,0),r.type){case"perspective":var c=r.perspective;if(!c)throw new Error(t+": Camera perspective properties are missing");a.fov=c.yfov,a.minZ=c.znear,a.maxZ=c.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),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;var i=new n.AnimationGroup(t.name||"animation"+t.index,this._babylonScene);t._babylonAnimationGroup=i;var s=new Array;o.Assign(t.channels),o.Assign(t.samplers);for(var a=0,c=t.channels;a<c.length;a++){var l=c[a];s.push(this._loadAnimationChannelAsync(e+"/channels/"+l.index,e,t,l,i))}return Promise.all(s).then(function(){return i.normalize(0),i})},e.prototype._loadAnimationChannelAsync=function(e,t,r,i,s){var a=this;if(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 l=o.Get(e+"/sampler",r.samplers,i.sampler);return this._loadAnimationSamplerAsync(t+"/samplers/"+i.sampler,l).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 l,u,h=0;switch(r){case"position":l=function(){var e=n.Vector3.FromArray(t.output,h);return h+=3,e};break;case"rotationQuaternion":l=function(){var e=n.Quaternion.FromArray(t.output,h);return h+=4,e};break;case"scaling":l=function(){var e=n.Vector3.FromArray(t.output,h);return h+=3,e};break;case"influence":l=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":u=function(e){return{frame:t.input[e],value:l(),interpolation:n.AnimationKeyInterpolation.STEP}};break;case"LINEAR":u=function(e){return{frame:t.input[e],value:l()}};break;case"CUBICSPLINE":u=function(e){return{frame:t.input[e],inTangent:l(),value:l(),outTangent:l()}}}for(var d=new Array(t.input.length),f=0;f<t.input.length;f++)d[f]=u(f);if("influence"===r)for(var p=function(e){var t=s.name+"_channel"+s.targetedAnimations.length,i=new n.Animation(t,r,1,o);i.setKeys(d.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}})),a._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++)p(g);else{var m=s.name+"_channel"+s.targetedAnimations.length,_=new n.Animation(m,r,1,o);_.setKeys(d),c._babylonTransformNode.animations.push(_),s.addTargetedAnimation(_,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){if(t._data)return t._data;if(!t.uri)throw new Error(e+"/uri: Value is missing");return t._data=this.loadUriAsync(e+"/uri",t,t.uri),t._data},e.prototype.loadBufferViewAsync=function(e,t){if(t._data)return t._data;var r=o.Get(e+"/buffer",this._gltf.buffers,t.buffer);return t._data=this._loadBufferAsync("/buffers/"+r.index,r).then(function(r){try{return new Uint8Array(r.buffer,r.byteOffset+(t.byteOffset||0),t.byteLength)}catch(t){throw new Error(e+": "+t.message)}}),t._data},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;var n=o.Get(t+"/bufferView",this._gltf.bufferViews,r.bufferView);return r._data=this.loadBufferViewAsync("/bufferViews/"+n.index,n).then(function(n){return e._GetTypedArray(t,r.componentType,n,r.byteOffset,r.count)}),r._data},e.prototype._loadFloatAccessorAsync=function(t,r){var n=this;if(5126!==r.componentType)throw new Error("Invalid component type "+r.componentType);if(r._data)return r._data;var i=e._GetNumComponents(t,r.type),s=i*r.count;if(null==r.bufferView)r._data=Promise.resolve(new Float32Array(s));else{var a=o.Get(t+"/bufferView",this._gltf.bufferViews,r.bufferView);r._data=this.loadBufferViewAsync("/bufferViews/"+a.index,a).then(function(n){return e._GetTypedArray(t,r.componentType,n,r.byteOffset,s)})}if(r.sparse){var c=r.sparse;r._data=r._data.then(function(s){var a=s,l=o.Get(t+"/sparse/indices/bufferView",n._gltf.bufferViews,c.indices.bufferView),u=o.Get(t+"/sparse/values/bufferView",n._gltf.bufferViews,c.values.bufferView);return Promise.all([n.loadBufferViewAsync("/bufferViews/"+l.index,l),n.loadBufferViewAsync("/bufferViews/"+u.index,u)]).then(function(n){for(var o=n[0],s=n[1],l=e._GetTypedArray(t+"/sparse/indices",c.indices.componentType,o,c.indices.byteOffset,c.count),u=e._GetTypedArray(t+"/sparse/values",r.componentType,s,c.values.byteOffset,i*c.count),h=0,d=0;d<l.length;d++)for(var f=l[d]*i,p=0;p<i;p++)a[f++]=u[h++];return a})})}return r._data},e.prototype._loadVertexBufferViewAsync=function(e,t){var r=this;return e._babylonBuffer?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.Tools.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{var a=o.Get(t+"/bufferView",this._gltf.bufferViews,r.bufferView);r._babylonVertexBuffer=this._loadVertexBufferViewAsync(a,i).then(function(o){var c=e._GetNumComponents(t,r.type);return new n.VertexBuffer(s._babylonScene.getEngine(),o,i,!1,!1,a.byteStride,!1,r.byteOffset,c,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 c=this.createMaterial(t,r,i);a={babylonMaterial:c,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(t,r,c)},r._data[i]=a,e.AddPointerMetadata(c,t),this._parent.onMaterialLoadedObservable.notifyObservers(c),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){var r=new n.PBRMaterial(e,this._babylonScene);return r.sideOrientation=this._babylonScene.useRightHandedSystem?n.Material.CounterClockWiseSideOrientation:n.Material.ClockWiseSideOrientation,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;this.logOpen(""+t);var a=o.Get(t+"/index",this._gltf.textures,r.index),c=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(),c},e.prototype._loadTextureAsync=function(t,r,i){var s=this;void 0===i&&(i=function(){});var a=new Array;this.logOpen(t+" "+(r.name||""));var c=null==r.sampler?e._DefaultSampler:o.Get(t+"/sampler",this._gltf.samplers,r.sampler),l=this._loadSampler("/samplers/"+c.index,c),u=o.Get(t+"/source",this._gltf.images,r.source),h=null;u.uri&&(n.Tools.IsBase64(u.uri)?h=u.uri:this._babylonScene.getEngine().textureFormatInUse&&(h=this._rootUrl+u.uri));var d=new n.Deferred,f=new n.Texture(h,this._babylonScene,l.noMipMaps,!1,l.samplingMode,function(){s._disposed||d.resolve()},function(e,r){s._disposed||d.reject(new Error(t+": "+(r&&r.message?r.message:e||"Failed to load texture")))});return a.push(d.promise),h||a.push(this.loadImageAsync("/images/"+u.index,u).then(function(e){var t=u.uri||s._fileName+"#image"+u.index,r="data:"+s._uniqueRootUrl+t;f.updateURL(r,new Blob([e],{type:u.mimeType}))})),f.wrapU=l.wrapU,f.wrapV=l.wrapV,i(f),this.logClose(),Promise.all(a).then(function(){return f})},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,o){var s=this,a=this._extensionsLoadUriAsync(t,r,o);if(a)return a;if(!e._ValidateUri(o))throw new Error(t+": '"+o+"' is invalid");if(n.Tools.IsBase64(o)){var c=new Uint8Array(n.Tools.DecodeBase64(o));return this.log("Decoded "+o.substr(0,64)+"... ("+c.length+" bytes)"),Promise.resolve(c)}return this.log("Loading "+o),this._parent.preprocessUrlAsync(this._rootUrl+o).then(function(e){return new Promise(function(r,a){if(!s._disposed){var c=n.Tools.LoadFile(e,function(e){if(!s._disposed){var t=new Uint8Array(e);s.log("Loaded "+o+" ("+t.length+" bytes)"),r(t)}},function(e){if(!s._disposed&&(c&&(c._lengthComputable=e.lengthComputable,c._loaded=e.loaded,c._total=e.total),s._state===i.GLTFLoaderState.LOADING))try{s._onProgress()}catch(e){a(e)}},s._babylonScene.offlineProvider,!0,function(e,r){s._disposed||a(new n.LoadFileError(t+": Failed to load '"+o+"'"+(e?": "+e.status+" "+e.statusText:""),e))});s._requests.push(c)}})})},e.prototype._onProgress=function(){if(this._progressCallback){for(var e=!0,t=0,r=0,i=0,o=this._requests;i<o.length;i++){var s=o[i];if(void 0===s._lengthComputable||void 0===s._loaded||void 0===s._total)return;e=e&&s._lengthComputable,t+=s._loaded,r+=s._total}this._progressCallback(new n.SceneLoaderProgressEvent(e,t,e?r:0))}},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.Tools.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.Tools.Warn(e+"/minFilter: Invalid value ("+i+")"),n.Texture.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==r&&n.Tools.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.Tools.Warn(e+"/minFilter: Invalid value ("+i+")"),n.Texture.NEAREST_NEAREST_MIPNEAREST}},e._GetTypedArray=function(e,t,r,n,i){var o=r.buffer;n=r.byteOffset+(n||0);try{switch(t){case 5120:return new Int8Array(o,n,i);case 5121:return new Uint8Array(o,n,i);case 5122:return new Int16Array(o,n,i);case 5123:return new Uint16Array(o,n,i);case 5125:return new Uint32Array(o,n,i);case 5126:return new Float32Array(o,n,i);default:throw new Error("Invalid component type "+t)}}catch(t){throw new Error(e+": "+t)}},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,c=s.babylonMeshes;a<c.length;a++){var l=c[a];l.computeWorldMatrix(!0);var u=s.babylonMaterial;t.push(u.forceCompilationAsync(l)),this._parent.useClipPlane&&t.push(u.forceCompilationAsync(l,{clipPlane:!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(t){for(var r=0,n=e._ExtensionNames;r<n.length;r++){var i=n[r],o=this._extensions[i];o.enabled&&t(o)}},e.prototype._applyExtensions=function(t,r,n){for(var i=0,o=e._ExtensionNames;i<o.length;i++){var s=o[i],a=this._extensions[s];if(a.enabled){var c=s+"."+r,l=t;l._activeLoaderExtensionFunctions=l._activeLoaderExtensionFunctions||{};var u=l._activeLoaderExtensionFunctions;if(!u[c]){u[c]=!0;try{var h=n(a);if(h)return h}finally{delete u[c]}}}}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._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._extensionsLoadAnimationAsync=function(e,t){return this._applyExtensions(t,"loadAnimation",function(r){return r.loadAnimationAsync&&r.loadAnimationAsync(e,t)})},e.prototype._extensionsLoadUriAsync=function(e,t,r){return this._applyExtensions(t,"loadUri",function(n){return n._loadUriAsync&&n._loadUriAsync(e,t,r)})},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.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._DefaultSampler={index:-1},e._ExtensionNames=new Array,e._ExtensionFactories={},e}();i.GLTFFileLoader._CreateGLTF2Loader=function(e){return new s(e)}},"./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 ***!
- \***************************/
- /*! exports provided: ArrayItem, GLTFLoader, EXT_lights_image_based, KHR_draco_mesh_compression, KHR_lights, KHR_materials_pbrSpecularGlossiness, KHR_materials_unlit, KHR_texture_transform, MSFT_audio_emitter, MSFT_lod, MSFT_minecraftMesh, MSFT_sRGBFactors */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(/*! ./Extensions */"./glTF/2.0/Extensions/index.ts");r.d(t,"EXT_lights_image_based",function(){return i.EXT_lights_image_based}),r.d(t,"KHR_draco_mesh_compression",function(){return i.KHR_draco_mesh_compression}),r.d(t,"KHR_lights",function(){return i.KHR_lights}),r.d(t,"KHR_materials_pbrSpecularGlossiness",function(){return i.KHR_materials_pbrSpecularGlossiness}),r.d(t,"KHR_materials_unlit",function(){return i.KHR_materials_unlit}),r.d(t,"KHR_texture_transform",function(){return i.KHR_texture_transform}),r.d(t,"MSFT_audio_emitter",function(){return i.MSFT_audio_emitter}),r.d(t,"MSFT_lod",function(){return i.MSFT_lod}),r.d(t,"MSFT_minecraftMesh",function(){return i.MSFT_minecraftMesh}),r.d(t,"MSFT_sRGBFactors",function(){return i.MSFT_sRGBFactors})},"./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 a});var n,i,o,s=r(/*! babylonjs/Misc/observable */"babylonjs/Misc/observable");!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 a=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.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.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"onMeshLoaded",{set:function(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTextureLoaded",{set:function(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onMaterialLoaded",{set:function(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCameraLoaded",{set:function(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{set:function(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onError",{set:function(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onExtensionLoaded",{set:function(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"onValidated",{set:function(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._loader&&(this._loader.dispose(),this._loader=null),this._clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()},e.prototype._clear=function(){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()},e.prototype.importMeshAsync=function(e,t,r,n,i,o){var s=this;return this._parseAsync(t,r,n,o).then(function(r){return s._log("Loading "+(o||"")),s._loader=s._getLoader(r),s._loader.importMeshAsync(e,t,r,n,i,o)})},e.prototype.loadAsync=function(e,t,r,n,i){var o=this;return this._parseAsync(e,t,r,i).then(function(t){return 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 this._parseAsync(e,t,r,i).then(function(t){return o._log("Loading "+(i||"")),o._loader=o._getLoader(t),o._loader.importMeshAsync(null,e,t,r,n,i).then(function(t){var r=new s.AssetContainer(e);return Array.prototype.push.apply(r.meshes,t.meshes),Array.prototype.push.apply(r.particleSystems,t.particleSystems),Array.prototype.push.apply(r.skeletons,t.skeletons),Array.prototype.push.apply(r.animationGroups,t.animationGroups),r.removeAllFromScene(),r})})},e.prototype.canDirectLoad=function(e){return-1!==e.indexOf("scene")&&-1!==e.indexOf("node")},e.prototype.createPlugin=function(){return new e},Object.defineProperty(e.prototype,"loaderState",{get:function(){return this._loader?this._loader.state:null},enumerable:!0,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._parseAsync=function(e,t,r,n){var i=this;return Promise.resolve().then(function(){var o=t instanceof ArrayBuffer?i._unpackBinary(t):{json:t,bin:null};return i._validateAsync(e,o.json,r,n).then(function(){i._startPerformanceCounter("Parse JSON"),i._log("JSON length: "+o.json.length);var e={json:JSON.parse(o.json),bin:o.bin};return i._endPerformanceCounter("Parse JSON"),i.onParsedObservable.notifyObservers(e),i.onParsedObservable.clear(),e})})},e.prototype._validateAsync=function(e,t,r,n){var i=this;if(!this.validate||"undefined"==typeof GLTFValidator)return Promise.resolve();this._startPerformanceCounter("Validate JSON");var o={externalResourceFunction:function(t){return i.preprocessUrlAsync(r+t).then(function(t){return e._loadFileAsync(t,!0,!0)}).then(function(e){return new Uint8Array(e)})}};return n&&"data:"!==n.substr(0,5)&&(o.uri="file:"===r?n:""+r+n),GLTFValidator.validateString(t,o).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),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._unpackBinary=function(e){this._startPerformanceCounter("Unpack binary"),this._log("Binary length: "+e.byteLength);var t=new c(e),r=t.readUint32();if(1179937895!==r)throw new Error("Unexpected magic: "+r);var n,i=t.readUint32();switch(this.loggingEnabled&&this._log("Binary version: "+i),i){case 1:n=this._unpackBinaryV1(t);break;case 2:n=this._unpackBinaryV2(t);break;default:throw new Error("Unsupported version: "+i)}return this._endPerformanceCounter("Unpack binary"),n},e.prototype._unpackBinaryV1=function(t){var r=t.readUint32();if(r!=t.getLength())throw new Error("Length in header does not match actual data length: "+r+" != "+t.getLength());var n,i=t.readUint32(),o=t.readUint32();switch(o){case 0:n=e._decodeBufferToText(t.readUint8Array(i));break;default:throw new Error("Unexpected content format: "+o)}var s=t.getLength()-t.getPosition();return{json:n,bin:t.readUint8Array(s)}},e.prototype._unpackBinaryV2=function(t){var r=1313821514,n=5130562,i=t.readUint32();if(i!==t.getLength())throw new Error("Length in header does not match actual data length: "+i+" != "+t.getLength());var o=t.readUint32();if(t.readUint32()!==r)throw new Error("First chunk format is not JSON");for(var s=e._decodeBufferToText(t.readUint8Array(o)),a=null;t.getPosition()<t.getLength();){var c=t.readUint32();switch(t.readUint32()){case r:throw new Error("Unexpected JSON chunk");case n:a=t.readUint8Array(c);break;default:t.skipBytes(c)}}return{json:s,bin: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._decodeBufferToText=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",r=e.byteLength,n=0;n<r;n++)t+=String.fromCharCode(e[n]);return t},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.Tools.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._logSpaces=" ",e}(),c=function(){function e(e){this._arrayBuffer=e,this._dataView=new DataView(e),this._byteOffset=0}return e.prototype.getPosition=function(){return this._byteOffset},e.prototype.getLength=function(){return this._arrayBuffer.byteLength},e.prototype.readUint32=function(){var e=this._dataView.getUint32(this._byteOffset,!0);return this._byteOffset+=4,e},e.prototype.readUint8Array=function(e){var t=new Uint8Array(this._arrayBuffer,this._byteOffset,e);return this._byteOffset+=e,t},e.prototype.skipBytes=function(e){this._byteOffset+=e},e}();s.SceneLoader&&s.SceneLoader.RegisterPlugin(new a)},"./glTF/index.ts":
- /*!***********************!*\
- !*** ./glTF/index.ts ***!
- \***********************/
- /*! exports provided: GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader, 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(/*! ./1.0 */"./glTF/1.0/index.ts");r.d(t,"GLTF1",function(){return i});var o=r(/*! ./2.0 */"./glTF/2.0/index.ts");r.d(t,"GLTF2",function(){return o})},"./index.ts":
- /*!******************!*\
- !*** ./index.ts ***!
- \******************/
- /*! exports provided: GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader, 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,"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 */function(e,t,r){"use strict";r.r(t),function(e){var n=r(/*! ../glTF/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=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==i)for(var o in i.BABYLON=i.BABYLON||{},n)i.BABYLON[o]=n[o]}.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 c=[];for(var l in n)a.GLTF2.Loader.Extensions[l]=n[l],c.push(l);for(var l in i)a.GLTF2.Loader[l]=i[l],c.push(l);for(var l in o)c.indexOf(l)>-1||(a.GLTF2[l]=o[l])}}.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: GLTF1, GLTF2, GLTFLoaderCoordinateSystemMode, GLTFLoaderAnimationStartMode, GLTFLoaderState, GLTFFileLoader, 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});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(9))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(0),o=r(0),s=r(0),a=r(0),c=r(0),l=r(0),u=r(0),h=r(0),d=r(0),f=r(30),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 g=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 c=this._configurationContainer&&this._configurationContainer.scene;this.rootMesh=new i.AbstractMesh("modelRootMesh",c),this._pivotMesh=new i.AbstractMesh("pivotMesh",c),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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"loaderDone",{set:function(e){this._loaderDone=e,this._checkCompleteState()},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._modelConfiguration},set:function(e){this._modelConfiguration=e,this._configureModel()},enumerable:!0,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[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=0}),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&&3!==this.currentAnimation.state&&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 c.Quaternion)}),n("rotationQuaternion",this._modelConfiguration.rotation)):n("rotation",this._modelConfiguration.rotation)),this._modelConfiguration.rotationOffsetAxis){var u=new c.Vector3(0,0,0).copyFrom(this._modelConfiguration.rotationOffsetAxis);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){l.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=c.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 h.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 c.Vector3(1,1,1),o=t?new c.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,this.rootMesh.getScene().beginAnimation){var c=this.rootMesh.getScene().beginAnimation(this.rootMesh,0,this._frameRate*t,!1,1,function(){i&&i()});this._animatables.push(c)}},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 1:t=new a.CircleEase;break;case 2:t=new a.BackEase(.3);break;case 3:t=new a.BounceEase;break;case 4:t=new a.CubicEase;break;case 5:t=new a.ElasticEase;break;case 6:t=new a.ExponentialEase;break;case 7:t=new a.PowerEase;break;case 8:t=new a.QuadraticEase;break;case 9:t=new a.QuarticEase;break;case 10:t=new a.QuinticEase;break;case 11:t=new a.SineEase;break;default:d.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=g},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!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:!0,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:!0,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:!0,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";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(44)),n(r(46)),n(r(52))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(12),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});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});var o=r(0),s=r(0),a=r(0),c=r(26),l=r(28),u=r(0),h=r(0),d=r(1),f=r(65),p=r(66),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 c=t.dataset.value,l=t.querySelector("span.animation-label");l&&c&&n._updateAnimationType({value:c.trim(),label:l.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),1===n._currentAnimation.state?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 h.PBRMaterial("defaultMaterial",this.scene)),d.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 f.HDButtonPlugin(this)),this.registerTemplatePlugin(new p.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 c.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}(l.AbstractViewerWithTemplate);t.DefaultViewer=g},function(e,t,r){
- /**!
- @license
- handlebars v4.0.11
- 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),c=n(r(42)),l=n(r(39)),u=n(r(34)),h=i.default.create;function d(){var e=h();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=c.default,e.Parser=s.parser,e.parse=s.parse,e}var f=d();f.create=d,u.default(f),f.Visitor=l.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)),c=n(r(5)),l=n(r(22)),u=i(r(34));function h(){var e=new o.HandlebarsEnvironment;return c.extend(e,o),e.SafeString=s.default,e.Exception=a.default,e.Utils=c,e.escapeExpression=c.escapeExpression,e.VM=l,e.template=function(t){return l.template(t,e)},e}var d=h();d.create=h,u.default(d),d.default=d,t.default=d,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=l;var i=r(5),o=n(r(6)),s=r(10),a=r(18),c=n(r(20));t.VERSION="4.0.11";t.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"};function l(e,t,r){this.helpers=e||{},this.partials=t||{},this.decorators=r||{},s.registerDefaultHelpers(this),a.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:c.default,log:c.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=c.default.log;t.log=u,t.createFrame=i.createFrame,t.logger=c.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}if(!i.test(e))return e;return e.replace(n,o)},t.isEmpty=function(e){return!e&&0!==e||!(!l(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 c=function(e){return"function"==typeof e};c(/x/)&&(t.isFunction=c=function(e){return"function"==typeof e&&"[object Function]"===a.call(e)}),t.isFunction=c;var l=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===a.call(e)};t.isArray=l},function(e,t,r){"use strict";var n=r(7).default;t.__esModule=!0;var i=["description","fileName","lineNumber","message","name","number","stack"];function o(e,t){var r=t&&t.loc,s=void 0,a=void 0;r&&(e+=" - "+(s=r.start.line)+":"+(a=r.start.column));for(var c=Error.prototype.constructor.call(this,e),l=0;l<i.length;l++)this[i[l]]=c[i[l]];Error.captureStackTrace&&Error.captureStackTrace(this,o);try{r&&(this.lineNumber=s,n?Object.defineProperty(this,"column",{value:a,enumerable:!0}):this.column=a)}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),c.default(e),l.default(e),u.default(e)};var i=n(r(11)),o=n(r(12)),s=n(r(13)),a=n(r(14)),c=n(r(15)),l=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){"use strict";var n=r(1).default;t.__esModule=!0;var i=r(5),o=n(r(6));t.default=function(e){e.registerHelper("each",function(e,t){if(!t)throw new o.default("Must pass iterator to #each");var r=t.fn,n=t.inverse,s=0,a="",c=void 0,l=void 0;function u(t,n,o){c&&(c.key=t,c.index=n,c.first=0===n,c.last=!!o,l&&(c.contextPath=l+t)),a+=r(e[t],{data:c,blockParams:i.blockParams([e[t],t],[l+t,null])})}if(t.data&&t.ids&&(l=i.appendContextPath(t.data.contextPath,t.ids[0])+"."),i.isFunction(e)&&(e=e.call(this)),t.data&&(c=i.createFrame(t.data)),e&&"object"==typeof e)if(i.isArray(e))for(var h=e.length;s<h;s++)s in e&&u(s,s,s===e.length-1);else{var d=void 0;for(var f in e)e.hasOwnProperty(f)&&(void 0!==d&&u(d,s-1),d=f,s++);void 0!==d&&u(d,s-1,!0)}return 0===s&&(a=n(this)),a})},e.exports=t.default},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";t.__esModule=!0;var n=r(5);t.default=function(e){e.registerHelper("if",function(e,t){return n.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||n.isEmpty(e)?t.inverse(this):t.fn(this)}),e.registerHelper("unless",function(t,r){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&&e[t]})},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(5);t.default=function(e){e.registerHelper("with",function(e,t){n.isFunction(e)&&(e=e.call(this));var r=t.fn;if(n.isEmpty(e))return t.inverse(this);var i=t.data;return t.data&&t.ids&&((i=n.createFrame(t.data)).contextPath=n.appendContextPath(t.data.contextPath,t.ids[0])),r(e,{data:i,blockParams:n.blockParams([e],[i&&i.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=c.COMPILER_REVISION;if(t!==r){if(t<r){var n=c.REVISION_CHANGES[r],i=c.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={strict:function(e,t){if(!(t in e))throw new a.default('"'+t+'" not defined in '+e);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=t.VM.invokePartial.call(this,r,n,i);null==o&&t.compile&&(i.partials[i.name]=t.compile(r,e.compilerOptions,t),o=i.partials[i.name](n,i));if(null!=o){if(i.indent){for(var c=o.split("\n"),l=0,u=c.length;l<u&&(c[l]||l+1!==u);l++)c[l]=i.indent+c[l];o=c.join("\n")}return o}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=l(this,e,s,t,r,n,i):o||(o=this.programs[e]=l(this,e,s)),o},data:function(e,t){for(;e&&t--;)e=e._parent;return e},merge:function(e,t){var r=e||t;return e&&t&&e!==t&&(r=s.extend({},t,e)),r},nullContext:n({}),noop:t.VM.noop,compilerInfo:e.compiler};function i(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=n.data;i._setup(n),!n.partial&&e.useData&&(o=function(e,t){t&&"root"in t||((t=t?c.createFrame(t):{}).root=e);return t}(t,o));var s=void 0,a=e.useBlockParams?[]:void 0;function l(t){return""+e.main(r,t,r.helpers,r.partials,o,a,s)}return e.useDepths&&(s=n.depths?t!=n.depths[0]?[t].concat(n.depths):n.depths:[t]),(l=h(e.main,l,r,n.depths||[],o,a))(t,n)}return i.isTop=!0,i._setup=function(n){n.partial?(r.helpers=n.helpers,r.partials=n.partials,r.decorators=n.decorators):(r.helpers=r.merge(n.helpers,t.helpers),e.usePartial&&(r.partials=r.merge(n.partials,t.partials)),(e.usePartial||e.useDecorators)&&(r.decorators=r.merge(n.decorators,t.decorators)))},i._child=function(t,n,i,o){if(e.useBlockParams&&!i)throw new a.default("must pass block params");if(e.useDepths&&!o)throw new a.default("must pass parent depths");return l(r,t,e[t],n,0,i,o)},i},t.wrapProgram=l,t.resolvePartial=function(e,t,r){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];return 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;r.fn&&r.fn!==u&&function(){r.data=c.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=c.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);if(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=u;var s=i(r(5)),a=o(r(6)),c=r(4);function l(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=h(r,a,e,s,n,o)).program=t,a.depth=s?s.length:0,a.blockParams=i||0,a}function u(){return""}function h(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,c,l,u=e&s.F,h=e&s.G,d=e&s.S,f=e&s.P,p=e&s.B,g=e&s.W,m=h?i:i[t]||(i[t]={}),_=h?n:d?n[t]:(n[t]||{}).prototype;for(a in h&&(r=t),r)(c=!u&&_&&a in _)&&a in m||(l=c?_[a]:r[a],m[a]=h&&"function"!=typeof _[a]?r[a]:p&&c?o(l,n):g&&_[a]==l?function(e){var t=function(t){return this instanceof e?new e(t):e(t)};return t.prototype=e.prototype,t}(l):f&&"function"==typeof l?o(Function.call,l):l,f&&((m.prototype||(m.prototype={}))[a]=l))};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.parse=function(e,t){if("Program"===e.type)return e;return o.default.yy=l,l.locInfo=function(e){return new l.SourceLocation(t&&t.srcName,e)},new s.default(t).accept(o.default.parse(e))};var o=n(r(37)),s=n(r(38)),a=i(r(40)),c=r(5);t.parser=o.default;var l={};c.extend(l,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_repetition_plus0: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,1],[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 c=n.prepareBlock(o[a-2],o[a-1],o[a],o[a],!1,this._$),l=n.prepareProgram([c],o[a-1].loc);l.chained=!0,this.$={strip:o[a-2].strip,program:l,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.$=[o[a]];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]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],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:45,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: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:48,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:42,56:49,64:43,65:[1,44],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:50,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,51]},{72:[1,35],86:52},{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:53,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:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,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:65,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:66,47:[1,67]},{30:68,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:69,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:70,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:71,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:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],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,80]},{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,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],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:84,47:[1,67]},{47:[2,55]},{4:85,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:86,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:87,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:88,47:[1,67]},{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:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],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:92,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:93,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:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],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:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],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:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],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:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],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,106]},{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:107,72:[1,108],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,109],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,110]},{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:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,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,114]},{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:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],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,118]},{32:119,33:[2,62],74:120,75:[1,121]},{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:122,74:123,75:[1,121]},{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,124]},{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,125]},{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,109]},{20:75,63:126,64:76,65:[1,44],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:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],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,130]},{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,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[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:135,74:136,75:[1,121]},{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,138],77:[1,137]},{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,139]},{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],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[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,c=0,l=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 h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,f,p,g,m,_,v,A,y,b,T={};;){if(p=r[r.length-1],this.defaultActions[p]?g=this.defaultActions[p]:(null==d&&(b=void 0,"number"!=typeof(b=t.lexer.lex()||1)&&(b=t.symbols_[b]||b),d=b),g=o[p]&&o[p][d]),void 0===g||!g.length||!g[0]){var E="";if(!l){for(_ in y=[],o[p])this.terminals_[_]&&_>2&&y.push("'"+this.terminals_[_]+"'");E=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:u,expected:y})}}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+d);switch(g[0]){case 1:r.push(d),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),r.push(g[1]),d=null,f?(d=f,f=null):(c=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,l>0&&l--);break;case 2:if(v=this.productions_[g[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},h&&(T._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(m=this.performAction.call(T,s,c,a,this.yy,g[1],n,i)))return m;v&&(r=r.slice(0,-1*v*2),n=n.slice(0,-1*v),i=i.slice(0,-1*v)),r.push(this.productions_[g[1]][0]),n.push(T.$),i.push(T._$),A=o[r[r.length-2]][r[r.length-1]],r.push(A);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.substr(e,t.yyleng-r)}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:(t.yytext=t.yytext.substr(5,t.yyleng-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 c(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 l(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],h=this.accept(u);if(h){var d=s(n,i,r),f=a(n,i,r),p=h.openStandalone&&d,g=h.closeStandalone&&f,m=h.inlineStandalone&&d&&f;h.close&&c(n,i,!0),h.open&&l(n,i,!0),t&&m&&(c(n,i),l(n,i)&&"PartialStatement"===u.type&&(u.indent=/([ \t]+$)/.exec(n[i-1].original)[1])),t&&p&&(c((u.program||u.inverse).body),l(n,i)),t&&g&&(c(n,i),l((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&&c(t.body,null,!0),r){var u=e.inverseStrip;u.open&&l(t.body,null,!0),u.close&&c(n.body,null,!0),e.closeStrip.open&&l(i.body,null,!0),!this.options.ignoreStandalone&&s(t.body)&&a(n.body)&&(l(t.body),c(n.body))}else e.closeStrip.open&&l(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 c(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:c,PartialBlockStatement:function(e){c.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.substr(1,e.length-2):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,c=t.length;a<c;a++){var l=t[a].part,u=t[a].original!==l;if(n+=(t[a].separator||"")+l,u||".."!==l&&"."!==l&&"this"!==l)o.push(l);else{if(o.length>0)throw new i.default("Invalid path: "+n,{loc:r});".."===l&&(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 c=/\*/.test(e.open);t.blockParams=e.blockParams;var l=void 0,u=void 0;if(r){if(c)throw new i.default("Unexpected inverse block on decorator",r);r.chain&&(r.program.body[0].closeStrip=n.strip),u=r.strip,l=r.program}s&&(s=l,l=t,t=s);return{type:c?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:l,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=c,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){void 0===t&&(t={});if(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 c(){}function l(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(!l(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}}}c.prototype={compiler:c,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||!l(n.args,i.args))return!1}t=this.children.length;for(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)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 c(e){this.value=e}function l(){}l.prototype={nameLookup:function(e,t){return l.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,c=void 0,l=void 0;for(c=0,l=i.length;c<l;c++)s=i[c],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 h={compiler:this.compilerInfo(),main:u};this.decorators&&(h.main_d=this.decorators,h.useDecorators=!0);var d=this.context,f=d.programs,p=d.decorators;for(c=0,l=f.length;c<l;c++)f[c]&&(h[c]=f[c],p[c]&&(h[c+"_d"]=p[c],h.useDecorators=!0));return this.environment.usePartial&&(h.usePartial=!0),this.options.data&&(h.useData=!0),this.useDepths&&(h.useDepths=!0),this.useBlockParams&&(h.useBlockParams=!0),this.options.compat&&(h.compat=!0),n?h.compilerOptions=this.options:(h.compiler=JSON.stringify(h.compiler),this.source.currentLocation={start:{line:1,column:0}},h=this.objectLiteral(h),t.srcName?(h=h.toStringWithSourceMap({file:t.destName})).map=h.map&&h.map.toString():h=h.toString()),h},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("helpers.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("helpers.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;e&&s--;for(;o<s;o++)i=t.nameLookup(i,r[o],n);return e?[t.aliasable("container.strict"),"(",i,", ",t.quotedString(r[o]),")"]: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?[i.name," || "]:"",s=["("].concat(o,n);this.options.strict||s.push(" || ",this.aliasable("helpers.helperMissing")),s.push(")"),this.push(this.source.functionCall(s,"call",i.callParams))},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("helpers.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:l,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 c=this.context.programs.length;n.index=c,n.name="program"+c,this.context.programs[c]=i.compile(n,t,this.context,!this.precompile),this.context.decorators[c]=i.decorators,this.context.environments[c]=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 c||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new c(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 c)t=["(",r=[s.value]],i=!0;else{n=!0;var a=this.incrStack();t=["((",this.push(a)," = ",s,")"],r=this.topStack()}var l=e.call(this,r);i||this.popStack(),n&&this.stackSlot--,this.push(t.concat(l,")"))},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 c)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 c)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 c?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,c=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 l=this.popStack(),u=this.popStack();(u||l)&&(n.fn=u||"container.noop",n.inverse=l||"container.noop");for(var h=t;h--;)c=this.popStack(),r[h]=c,this.trackIds&&(s[h]=this.popStack()),this.stringParams&&(o[h]=this.popStack(),i[h]=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=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=l.RESERVED_WORDS={},r=0,n=e.length;r<n;r++)t[e[r]]=!0}(),l.isValidJavaScriptVariableName=function(e){return!l.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)},t.default=l,e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0;var n=r(5),i=void 0;try{}catch(e){}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});var n=r(0),i=r(0),o=r(0),s=r(0),a=r(14),c=r(29),l=r(3),u=r(16),h=r(1),d=r(19),f=r(36),p=r(37),g=r(6),m=r(10),_=function(){function e(e,t){void 0===t&&(t={});var r=this;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 c.ConfigurationContainer,this.observablesManager=new f.ObservablesManager,this.modelLoader=new d.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(),m.viewerManager.addViewer(this)}return Object.defineProperty(e.prototype,"onSceneInitObservable",{get:function(){return this.observablesManager.onSceneInitObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onEngineInitObservable",{get:function(){return this.observablesManager.onEngineInitObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onModelAddedObservable",{get:function(){return this.observablesManager.onModelAddedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onModelLoadedObservable",{get:function(){return this.observablesManager.onModelLoadedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onModelLoadProgressObservable",{get:function(){return this.observablesManager.onModelLoadProgressObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onModelLoadErrorObservable",{get:function(){return this.observablesManager.onModelLoadErrorObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onModelRemovedObservable",{get:function(){return this.observablesManager.onModelRemovedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLoaderInitObservable",{get:function(){return this.observablesManager.onLoaderInitObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onInitDoneObservable",{get:function(){return this.observablesManager.onViewerInitDoneObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onFrameRenderedObservable",{get:function(){return this.observablesManager.onFrameRenderedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onEnteringVRObservable",{get:function(){return this.observablesManager.onEnteringVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onExitingVRObservable",{get:function(){return this.observablesManager.onExitingVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canvas",{get:function(){return this._canvas},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"configurationContainer",{get:function(){return this._configurationContainer},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configurationContainer.configuration},enumerable:!0,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.copyFrom(this.configuration.vr.cameraPosition):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=h.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=h.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(),m.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(l.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=h.deepmerge({},this.configuration.model);r=h.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;g.telemetryManager.broadcast("Engine Capabilities",this.baseId,this.engine.getCaps()),g.telemetryManager.broadcast("Platform Details",this.baseId,{userAgent:navigator.userAgent,platform:navigator.platform}),g.telemetryManager.flushWebGLErrors(this.engine,this.baseId);var t=function(){g.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});var n=r(15);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){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&&(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=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});var n=r(2),i=r(14),o=r(1),s=r(0),a=r(17),c=r(18),l=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,c.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 c="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()),c=t||c}return r._loadFile(e)}return"object"==typeof s.configuration?(c=s.configuration.mapper||c,s.configuration.payload||{}):{}}).then(function(e){var r=n.mapperManager.getMapper(c),l=o.deepmerge(r.map(e),s),u=o.deepmerge(a,l);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=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!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={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});var n=r(4),i=r(0),o=r(0),s=r(0),a=r(5),c=r(31),l=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:!0,configurable:!0}),e.prototype.addPlugin=function(e){var t={};if("string"==typeof e){var r=c.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,c=new a.ViewerModel(this._observablesManager,e,this._configurationContainer);if(c.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 c.state=a.ModelState.ERROR,i.Tools.Error("No URL provided"),c;var l=e.loader,u=c.rootMesh.getScene();if(c.loader=o.SceneLoader.ImportMesh(void 0,this._baseUrl,t,u,function(e,t,n,i){e.forEach(function(e){s.Tags.AddTagsTo(e,"viewerMesh"),c.addMesh(e)}),c.particleSystems=t,c.skeletons=n;for(var o=0,a=i;o<a.length;o++){var l=a[o];c.addAnimationGroup(l)}r._checkAndRun("onLoaded",c),u.executeWhenReady(function(){c.onLoadedObservable.notifyObservers(c)})},function(e){r._checkAndRun("onProgress",e),c.onLoadProgressObservable.notifyObserversWithPromise(e)},function(e,t,n){c.state=a.ModelState.ERROR,i.Tools.Error("Load Error: There was an error loading the model. "+t),r._checkAndRun("onError",t,n),c.onLoadErrorObservable.notifyObserversWithPromise({message:t,exception:n})},l),"gltf"===c.loader.name){var h=c.loader;h.animationStartMode=n.GLTFLoaderAnimationStartMode.NONE,h.compileMaterials=!0,e.file||(h.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&&(h.useClipPlane=!0),Object.keys(h).filter(function(e){return 0===e.indexOf("on")&&-1!==e.indexOf("Observable")}).forEach(function(e){h[e].add(function(t){r._checkAndRun(e.replace("Observable",""),t)})}),h.onParsedObservable.add(function(e){e&&e.json&&e.json.asset&&(c.loadInfo=e.json.asset)}),h.onCompleteObservable.add(function(){c.loaderDone=!0})}else c.loaderDone=!0;return this._checkAndRun("onInit",c.loader,c),this._loaders.push(c.loader),c},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=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(15))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!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:!0,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:!0,configurable:!0}),e}();t.TextureCube=a;var c=function(){function e(){}return e.GetBabylonCubeTexture=function(t,r,s,c,l){if(void 0===c&&(c=!1),void 0===l&&(l=!1),!r)throw new Error("no texture cube provided");var u;u=c?l?e._EnvironmentSingleMipSampling:e._EnvironmentSampling:{magFilter:9728,minFilter:9728,wrapS:33071,wrapT:33071};var h=e.BabylonTextureKeyPrefix+u.magFilter+""+u.minFilter+u.wrapS+u.wrapT,d=r[h];if(!d){d=new n.CubeTexture("",t),c&&(d.lodGenerationOffset=e.EnvironmentLODOffset,d.lodGenerationScale=e.EnvironmentLODScale),d.gammaSpace=!1;var f=new i.InternalTexture(t.getEngine(),i.InternalTexture.DATASOURCE_CUBERAW),p=f._webGLTexture;f.isCube=!0,f.generateMipMaps=!1,d._texture=f,e.ApplySamplingParameters(d,u);for(var g=s?0:r.source.length-1,m=0,_=function(){return m===6*(g+1)},v=function(n,i,u){if(p){0===n&&0===i&&(f.width=u.width,f.height=u.height);var h=t.getEngine()._gl;if(h.bindTexture(h.TEXTURE_CUBE_MAP,p),t.getEngine()._unpackFlipY(!1),u instanceof HTMLElement||u instanceof ImageData)h.texImage2D(h.TEXTURE_CUBE_MAP_POSITIVE_X+n,i,r.internalFormat,r.internalFormat,r.type,u);else{var d=u;h.texImage2D(h.TEXTURE_CUBE_MAP_POSITIVE_X+n,i,r.internalFormat,d.width,d.height,0,d.format,r.type,d.data)}if(m++,_()){if(s){var g=u.width,v=u.height;0===(0!==g&&g&g-1)&&0===(0!==v&&v&v-1)&&h.generateMipmap(h.TEXTURE_CUBE_MAP)}if(c&&!t.getEngine().getCaps().textureLOD&&!l)for(var A=0;A<3;A++){var y=e.BabylonTextureKeyPrefix+"lod"+A,b=r[y];if(null==b&&r.Width){var T=1-A/2,E=(T*T+5e-4)*r.Width,x=e.EnvironmentLODScale*o.Scalar.Log2(E)+e.EnvironmentLODOffset,C=r.source.length-1,P=Math.min(Math.max(Math.round(x),0),C);b=e.GetBabylonCubeTexture(t,new a(6408,5121,[r.source[P]]),!1,!0,!0),0===A?f._lodTextureLow=b:1===A?f._lodTextureMid=b:f._lodTextureHigh=b,r[y]=b}}f.isReady=!0}h.bindTexture(h.TEXTURE_CUBE_MAP,null),t.getEngine().resetTextureCache()}},A=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)},y=0;y<=g;y++)A(y);t.getEngine().resetTextureCache(),d.isReady=function(){return _()},r[h]=d}return d},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 c=n.getExtension("EXT_texture_filter_anisotropic");if(c){var l=n.getParameter(c.MAX_TEXTURE_MAX_ANISOTROPY_EXT),u=Math.min(t.maxAnisotropy,l);n.texParameterf(i,c.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=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(40),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(24)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.mapperManager=n.mapperManager;var i=r(3);t.viewerGlobals=i.viewerGlobals;var o=r(10);t.viewerManager=o.viewerManager;var s=r(11);t.DefaultViewer=s.DefaultViewer;var a=r(13);t.AbstractViewer=a.AbstractViewer;var c=r(6);t.telemetryManager=c.telemetryManager;var l=r(19);t.ModelLoader=l.ModelLoader;var u=r(5);t.ViewerModel=u.ViewerModel,t.ModelState=u.ModelState;var h=r(8);t.AbstractViewerNavbarButton=h.AbstractViewerNavbarButton;var d=r(22);t.registerCustomOptimizer=d.registerCustomOptimizer;var f=r(0);t.BABYLON=f,r(4),r(67);var p=r(68);t.InitTags=p.InitTags,f.PromisePolyfill.Apply(),p.initListeners();var g=i.viewerGlobals.disableInit;t.disableInit=g,t.disposeAll=function(){o.viewerManager.dispose(),n.mapperManager.dispose(),c.telemetryManager.dispose()};var m=i.viewerGlobals.version;t.Version=m,console.log("Babylon.js viewer (v"+m+")");var _=r(4);t.GLTF2=_.GLTF2,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(20))},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 c=a;t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(0),o=r(1),s=r(12),a=r(27),c=r(1),l=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=l,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?c.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:!0,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});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});var o=r(13),s=r(41),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});var n=r(0),i=function(){return 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});var n=function(){function e(e){var t=this;this._animationGroup=e,this._state=0,this._playMode=1,this._animationGroup.onAnimationEndObservable.add(function(){t.stop(),t._state=4})}return Object.defineProperty(e.prototype,"name",{get:function(){return this._animationGroup.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._animationGroup.speedRatio},set:function(e){this._animationGroup.speedRatio=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frames",{get:function(){return this._animationGroup.to-this._animationGroup.from},enumerable:!0,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:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"playMode",{get:function(){return this._playMode},set:function(e){e!==this._playMode&&(this._playMode=e,1===this.state?this._animationGroup.play(1===this._playMode):(this._animationGroup.reset(),this._state=0))},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this._animationGroup.reset()},e.prototype.restart=function(){2===this.state?this._animationGroup.restart():this.start()},e.prototype.goToFrame=function(e){this._animationGroup.goToFrame(e+this._animationGroup.from)},e.prototype.start=function(){this._animationGroup.start(1===this.playMode,this.speedRatio),this._animationGroup.isStarted&&(this._state=1)},e.prototype.pause=function(){this._animationGroup.pause(),this._state=2},e.prototype.stop=function(){this._animationGroup.stop(),this._animationGroup.isStarted||(this._state=3)},e.prototype.dispose=function(){this._animationGroup.dispose()},e}();t.GroupModelAnimation=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(32);t.TelemetryLoaderPlugin=n.TelemetryLoaderPlugin;var i=r(33);t.MSFTLodLoaderPlugin=i.MSFTLodLoaderPlugin;var o=r(34);t.ApplyMaterialConfigPlugin=o.ApplyMaterialConfigPlugin;var s=r(35);t.ExtendedMaterialLoaderPlugin=s.ExtendedMaterialLoaderPlugin;var a=r(0),c={};t.getLoaderPluginByName=function(e){if(!c[e])switch(e){case"telemetry":c[e]=new n.TelemetryLoaderPlugin;break;case"msftLod":c[e]=new i.MSFTLodLoaderPlugin;break;case"applyMaterialConfig":c[e]=new o.ApplyMaterialConfigPlugin;break;case"extendedMaterial":c[e]=new s.ExtendedMaterialLoaderPlugin}return c[e]},t.addLoaderPlugin=function(e,t){c[e]&&a.Tools.Warn("Overwriting plugin with the same name - "+e),c[e]=t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),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});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});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});var n=r(0),i=function(){function e(){}return e.prototype.onMaterialLoaded=function(e){e.alphaMode=n.Engine.ALPHA_PREMULTIPLIED_PORTERDUFF},e}();t.ExtendedMaterialLoaderPlugin=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!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});var n=r(20),i=r(5),o=r(1),s=r(38),a=r(22),c=r(1),l=r(0),u=r(0),h=r(0),d=r(0),f=r(0),p=r(0),g=r(0),m=r(0),_=r(0),v=r(0),A=r(0),y=r(0),b=r(0),T=r(0),E=r(0),x=r(0),C=r(0),P=r(0),M=r(0),S=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 l.Observable,this.onLightsConfiguredObservable=new l.Observable,this.onModelsConfiguredObservable=new l.Observable,this.onSceneConfiguredObservable=new l.Observable,this.onSceneInitObservable=new l.Observable,this.onSceneOptimizerConfiguredObservable=new l.Observable,this.onEnvironmentConfiguredObservable=new l.Observable,this.onVRConfiguredObservable=new l.Observable,this._handleHardwareLimitations(),this.onSceneInitObservable.add(function(e){n.scene.animationPropertiesOverride=n.scene.animationPropertiesOverride||new v.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=A.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=A.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:!0,configurable:!0}),Object.defineProperty(e.prototype,"vrHelper",{get:function(){return this._vrHelper},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHdrSupported",{get:function(){return this._hdrSupport},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mainColor",{get:function(){return this._configurationContainer.mainColor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reflectionColor",{get:function(){return this._configurationContainer.reflectionColor},enumerable:!0,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:!0,configurable:!0}),Object.defineProperty(e.prototype,"observablesManager",{get:function(){return this._observablesManager},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processShadows",{get:function(){return this._processShadows},set:function(e){for(var t=e?A.RenderTargetTexture.REFRESHRATE_RENDER_ONEVERYFRAME:A.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:!0,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:!0,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:!0,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:!0,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 P.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 v.AnimationPropertiesOverride,_.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).copyFrom(e.lab.environmentMainColor);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 g.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:!0,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:!0,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=T.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.getRenderingCanvas();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=c.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 T.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)),c=1.5*s.length();isFinite(c)||(c=1,a.copyFromFloats(0,0,0));var l=new h.ArcRotateCamera("default camera",-Math.PI/2,Math.PI/2,c,a,this.scene);l.lowerRadiusLimit=.01*c,l.wheelPrecision=100/c,(r=l).minZ=.01*c,r.maxZ=1e3*c,r.speed=.2*c,this.scene.activeCamera=r;this.scene.getEngine().getRenderingCanvas()}var u=this.scene.getEngine().getRenderingCanvas();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 d=this.camera.position.clone();o.extendClassWithConfig(d,e.position),this.camera.setPosition(d)}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 g in e.behaviors)void 0!==e.behaviors[g]&&this._setCameraBehavior(g,e.behaviors[g]);var m=this.scene.getWorldExtends(function(e){return!t.environmentHelper||e!==t.environmentHelper.ground&&e!==t.environmentHelper.rootMesh&&e!==t.environmentHelper.skybox}),_=m.max.subtract(m.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 c=!0===e?{}:e;c.material&&c.material.imageProcessingConfiguration&&(n.setupImageProcessing=!1);var l=c.scale;l&&(n.skyboxSize=l),n.sizeAuto=!n.skyboxSize,c.color&&(n.skyboxColor=new p.Color3(c.color.r,c.color.g,c.color.b)),c.cubeTexture&&c.cubeTexture.url&&("string"==typeof c.cubeTexture.url?n.skyboxTexture=this._getAssetUrl(c.cubeTexture.url):a=!0),c.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 h=this.environmentHelper.groundMaterial._perceptualColor.toLinearSpace(),d=Math.pow(2,-this.scene.imageProcessingConfiguration.exposure)*Math.PI;h.scaleToRef(1/d,h),this.environmentHelper.groundMirror.clearColor.r=E.Scalar.Clamp(h.r),this.environmentHelper.groundMirror.clearColor.g=E.Scalar.Clamp(h.g),this.environmentHelper.groundMirror.clearColor.b=E.Scalar.Clamp(h.b),this.environmentHelper.groundMirror.clearColor.a=1,this.groundMirrorEnabled||(this.environmentHelper.groundMaterial.reflectionTexture=null)}var g=this.environmentHelper.skyboxMaterial;g&&(g._perceptualColor=this.mainColor,a&&"object"==typeof e&&e.material&&o.extendClassWithConfig(g,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(!(c=d.Light.GetConstructorFromName(a.type,a.name,t.scene)))return;s=c()}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 c;if(s.dispose(),!(c=d.Light.GetConstructorFromName(a.type,a.name,t.scene)))return;s=c()}if(!1!==e[r]){var l=void 0!==a.enabled?a.enabled:!a.disabled;if(s.setEnabled(l),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().copyFrom(a.target);s.setDirectionToTarget(u)}}else if(a.direction){var h=p.Vector3.Zero().copyFrom(a.direction);s.direction=h}var f=!1;if(s.getTypeID()===d.Light.LIGHTTYPEID_DIRECTIONALLIGHT)s.shadowFrustumSize=a.shadowFrustumSize||2,f=!0;else if(s.getTypeID()===d.Light.LIGHTTYPEID_SPOTLIGHT){var g=s;void 0!==a.spotAngle&&(g.angle=a.spotAngle*Math.PI/180),g.angle&&a.shadowFieldOfView&&(g.shadowAngleScale=a.shadowFieldOfView/g.angle),f=!0}else s.getTypeID()===d.Light.LIGHTTYPEID_POINTLIGHT&&(a.shadowFieldOfView&&(s.shadowAngle=a.shadowFieldOfView*Math.PI/180),f=!0);var m=s.getShadowGenerator();if(f&&a.shadowEnabled&&t._maxShadows){var _=a.shadowBufferSize||256;m||(m=new M.ShadowGenerator(_,s));var v=t.getBlurKernel(s,_);m.bias=t._shadowGeneratorBias,m.blurKernel=v,o.extendClassWithConfig(m,a.shadowConfig||{}),t._observablesManager&&t._observablesManager.onModelLoadedObservable.add(function(e){t._updateShadowRenderList(m,e)}),t._updateShadowRenderList(m)}else m&&m.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||this.scene.createDefaultLight(!0);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];C.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=x.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()===d.Light.LIGHTTYPEID_DIRECTIONALLIGHT?r/=e.shadowFrustumSize:e.getTypeID()===d.Light.LIGHTTYPEID_POINTLIGHT?r/=e.shadowAngle:e.getTypeID()===d.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=m.Engine.TEXTURETYPE_HALF_FLOAT,this._shadowGeneratorBias=.002):o?(this._defaultHighpTextureType=m.Engine.TEXTURETYPE_FLOAT,this._shadowGeneratorBias=.001):(this._defaultHighpTextureType=m.Engine.TEXTURETYPE_UNSIGNED_INT,this._shadowGeneratorBias=.001),this._defaultPipelineTextureType=this._hdrSupport?this._defaultHighpTextureType:m.Engine.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=S},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(39),i=r(0),o=r(0),s=r(21),a=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(i.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=i.Axis.Y),void 0===o&&(o=i.Vector3.Zero()),n.normalize(),r.subtractToRef(e.position,i.Tmp.Vector3[0]),i.Matrix.TranslationToRef(i.Tmp.Vector3[0].x,i.Tmp.Vector3[0].y,i.Tmp.Vector3[0].z,i.Tmp.Matrix[0]),i.Tmp.Matrix[0].invertToRef(i.Tmp.Matrix[2]),i.Matrix.RotationAxisToRef(n,t,i.Tmp.Matrix[1]),i.Tmp.Matrix[2].multiplyToRef(i.Tmp.Matrix[1],i.Tmp.Matrix[2]),i.Tmp.Matrix[2].multiplyToRef(i.Tmp.Matrix[0],i.Tmp.Matrix[2]),i.Tmp.Matrix[2].decompose(i.Tmp.Vector3[0],i.Tmp.Quaternion[0],i.Tmp.Vector3[1]),e.position.addInPlace(i.Tmp.Vector3[1]),e.setDirectionToTarget(o)},e}();t.ViewerLabs=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(0),o=r(21),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),c=0,l=0;l<s.length;l++)a.getUint8(c++)!==s[l]&&i.Tools.Error("Not a Spectre environment map");var u=a.getUint16(c,!1);c+=2,1!==u&&i.Tools.Warn('Unsupported Spectre environment map version "'+u+'"');for(var h="",d=0;d=a.getUint8(c++);)h+=String.fromCharCode(d);var f=JSON.parse(h),p=c;switch(f.irradiance.type){case"irradiance_sh_coefficients_9":var g=f.irradiance;e._ConvertSHIrradianceToLambertianRadiance(g),e._ConvertSHToSP(g,r.irradiancePolynomialCoefficients);break;default:i.Tools.Error("Unhandled MapType descriptor.irradiance.type ("+f.irradiance.type+")")}switch(f.specular.type){case"cubemap_faces":var m=f.specular,_=r.specularTexture=new o.TextureCube(6408,5121);r.textureIntensityScale=null!=m.multiplier?m.multiplier:1;for(var v=m.mipmaps,A=m.imageType,y=0;y<v.length;y++){var b=v[y];_.source[y]=[];for(l=0;l<6;l++){var T=b[l],E=new Uint8Array(t,p+T.pos,T.length);switch(A){case"png":var x=new Image,C=URL.createObjectURL(new Blob([E],{type:"image/png"}));x.src=C,_.source[y][l]=x;break;default:i.Tools.Error("Unhandled ImageType descriptor.specular.imageType ("+A+")")}}}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});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)return r=n.Scalar.Clamp(e.scene.getEngine().getHardwareScalingLevel()-.25,0,i),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)return r=n.Scalar.Clamp(e.scene.getEngine().getHardwareScalingLevel()+.25,0,1.25),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});var o=r(16),s=r(42),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});var n=r(43);t.minimalConfiguration=n.minimalConfiguration;var i=r(62);t.defaultConfiguration=i.defaultConfiguration;var o=r(17),s=r(63),a=r(64),c=r(1),l=function(e){var t={};return e.split(",").forEach(function(e){switch(e.trim()){case"environmentMap":t=c.deepmerge(t,a.environmentMapConfiguration);break;case"shadowDirectionalLight":t=c.deepmerge(t,s.shadowDirectionalLightConfiguration);break;case"shadowSpotLight":t=c.deepmerge(t,s.shadowSpotlLightConfiguration);break;case"default":t=c.deepmerge(t,i.defaultConfiguration);break;case"minimal":t=c.deepmerge(t,n.minimalConfiguration);break;case"none":break;case"extended":default:t=c.deepmerge(t,o.extendedConfiguration)}t.extends&&(t=c.deepmerge(t,l(t.extends)))}),t};t.getConfigurationType=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7);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=r(45)},function(e,t){e.exports="data:font/woff;charset=utf-8;base64,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"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.babylonLogo=r(47),t.close=r(48),t.fullscreen=r(49),t.helpCircle=r(50),t.loading=r(51)},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB7MAAAgHCAYAAABZmyd0AAAACXBIWXMAAC4jAAAuIwF4pT92AAAgAElEQVR42uzd7XEb6Zm24Wtc+5/IgO0IyDcCtiMQNwLBEYgTgaAIhhOBpQhMRSAwghEjWCoCixHw/fE0DIKiKAIE+vM4qlDi1I531/fYRDdOPHf/dn9/HwAAAAAmb5bkNMnSKAAAgD74HyMAAAAAmJwqJVyfJqmbP4+a/9m3JIskH40JAADo0m9OZgMAAACM2ukTr6MX/OtEbQAAoFNiNgAAAMB41FkH6yrJ2R7+d4raAABAJ8RsAAAAgOFZPd+6znpl+MmB/2+K2gAAQKvEbAAAAIB+q/LjmvDjDv//EbUBAIBWiNkAAAAA/bFaD746df3S51t3QdQGAAAOSswGAAAA6Mbj09ZnA/33IWoDAAAHIWYDAAAAHF6dzXB9MsJ/j6I2AACwV2I2AAAAwP7MsrkivOvnW3dB1AYAAPZCzAYAAADYTZV1sK6bvz42lv8StQEAgFcRswEAAAB+bRWtq6xPXR8Zy4uI2gAAwE7EbAAAAIBNddbh+jTJmZHshagNAABsRcwGAAAApmr1fOuHrxNjOThRGwAAeBExGwAAAJiCVbiusw7Xnm/dLVEbAAB4lpgNAAAAjE2VdbCu4/nWfSdqAwAATxKzAQAAgCF7vCbc862HS9QGAAA2iNkAAADAUNRZR+sqwvVYidoAAEASMRsAAADon4fPt66an0+MZXJEbQAAmDgxGwAAAOhSlR9XhR8bCw+I2gAAMFFiNgAAANCW1Xrw1anr0yRHxsILidoAADAxYjYAAABwCHU2T117vjX7ImoDAMBEiNkAAADAa9XZXBPu+da0QdQGAICRE7MBAACAl5plc0W451vTB6I2AACMlJgNAAAAPKXKOljXzV8L1/SZqA0AACMjZgMAAACnT7yOjIWBErUBAGAkxGwAAACYljolVlfNn2dGwkiJ2gAAMHBiNgAAAIzT6vnWD18nxsIEidoAADBQYjYAAAAMX9W86qzDtedbwyZRGwAABkbMBgAAgGGpsg7WdTzfGrYlagMAwECI2QAAANBfj9eEe7417I+oDQAAPSdmAwAAQD/UWUfrKsI1tEXUBgCAnhKzAQAAoF2zbK4Ir5KcGAt0TtQGAICeEbMBAADgcKr8uCr82Fig10RtAADoCTEbAAAA9mN1yvrhqesjY4HBErUBAKBjYjYAAABsr87mqWvPt4bxErUBAKAjYjYAAAA8r87mmnDPt4ZpErUBAKBlYjYAAAAUs2yuCPd8a+ApojYAALREzAYAAGCKqqyDdd38tXANbEPUBgCAAxOzAQAAGLvTJ15HxgLsiagNAAAHImYDAAAwJnVKrK6aP8+MBGiJqA0AAHsmZgMAADBED59vXTU/nxgL0AOiNgAA7ImYDQAAQN9VzavOek2451sDfSdqAwDAK4nZAAAA9EmVdbCu4/nWwPCJ2gAAsCMxGwAAgK6cPnp5vjUwZqI2AABsScwGAACgDXU2w7XnWwNTJWoDAMALidkAAADs0yybK8KrCNcATxG1AQDgF8RsAAAAdlXlx1Xhx8YCsBVRGwAAfkLMBgAA4CVWsbrK+tT1kbEA7I2oDQAAj4jZAAAAPFZn89T1mZEAtEbUBgCAhpgNAAAwbXU214R7vjVAP4jaAABMnpgNAAAwDbOUWF3H860BhkTUBgBgssRsAACA8amyDtZ1PN8aYAxEbQAAJkfMBgAAGLbTJ17CNcB4idoAAEyGmA0AADAcdUqsrpo/z4wEYLJEbQAARk/MBgAA6J+Hz7eump9PjAWAJ4jaAACMlpgNAADQrap51VmvCT82FgC2JGoDADA6YjYAAEB7Hq4Ir+P51gDsn6gNAMBoiNkAAACHcfro5fnWALRJ1AYAYPDEbAAAgNersxmuPd8agL4QtQEAGCwxGwAA4OVm2VwRXkW4BmAYRG0AAAZHzAYAAHhalfVJ67r562NjAWDgRG0AAAZDzAYAAFhH6yrrU9dHxgLAiInaAAD0npgNAABMTZ3NU9dnRgLAhInaAAD0lpgNAACM1er51g9fnm8NAE8TtQEA6B0xGwAAGINVuK6zDteebw0A2xO1AQDoDTEbAAAYmirrYF3H860B4BBEbQAAOidmAwAAfXb6xEu4BoD2iNoAAHRGzAYAAPqizjpYV0nOjAQAekPUBgCgdWI2AADQtofPt66an0+MBQAGQdQGAKA1YjYAAHBIVfOqsz51fWwsADB4ojYAAAcnZgMAAPuyWg++OnXt+dYAMH6iNgAAByNmAwAAuzh99PJ8awCYNlEbAIC9E7MBAIBfqbMZrj3fGgD4GVEbAIC9EbMBAICVWTZXhFcRrgGA3YjaAAC8mpgNAADTVGV90rpu/vrYWACAPRO1AQDYmZgNAADjt4rWVdanro+MBQBokagNAMDWxGwAABiXOutwfZrkzEgAgB4RtQEAeDExGwAAhmn1fOuHL8+3BgCGQtQGAOCXxGwAAOi/Vbiusw7Xnm8NAIyBqA0AwE+J2QAA0C9V1sG6judbAwDTIGoDAPADMRsAALrzeE2451sDAFMnagMA8F9iNgAAtKPOOlpXEa4BAJ4jagMAIGYDAMCePXy+ddX8fGIsAAA7EbUBACZMzAYAgN1V+XFV+LGxAADsnagNADBBYjYAALzMaj346tT1aZIjYwEAaJWoDQAwIWI2AAD86PFpa8+3BgDoF1EbAGACxGwAAKauzma49nxrAIDhELUBAEZMzAYAYCpm2VwR7vnWAADjIWoDAIyQmA0AwBhVWQfruvlr4RoAYPxEbQCAERGzAQAYulW0rrI+dX1kLAAAkyZqAwCMgJgNAMCQ1FmH69MkZ0YCAMAzRG0AgAETswEA6KPV860fvk6MBQCAHYnaAAADJGYDANC1Vbiusw7Xnm8NAMAhiNoAAAMiZgMA0KYq62Bdx/OtAQDohqgNADAAYjYAAIfyeE2451sDANA3ojYAQI+J2QAA7EOddbSuIlwDADAsojYAQA+J2QAAbOPx862rJCfGAgDASIjaAAA9ImYDAPAzVX5cFX5sLAAATICoDQDQA2I2AADJ+pT1w1PXR8YCAMDEidoAAB0SswEApqfO5qlrz7cGAIDnidoAAB0QswEAxq3O5ppwz7cGAIDdidoAAC0SswEAxmGWzRXhnm8NAACHI2oDALRAzAYAGJ4q62BdN38tXAMAQPtEbQCAAxKzAQD67fSJ15GxAABAr4jaAAAHIGYDAPRHnRKrq+bPMyMBAIBBEbUBAPZIzAYAaN/q+dYPXyfGAgAAoyFqAwDsgZgNAHBYVfOqsw7Xnm8NAADTIGoDALyCmA0AsD9V1sG6judbAwAAhagNALADMRsAYDeP14R7vjUAAPArojYAwBbEbACAX6uzjtZVhGsAAOB1RG0AgBcQswEA1mbZXBFeJTkxFgAA4EBEbQCAZ4jZAMBUVflxVfixsQAAAB0QtQEAniBmAwBT8HBFeN38fGQsAABAz4jaAAAPiNkAwNjU2Tx17fnWAADA0IjaAAARswGAYauzuSbc860BAIAxEbUBgEkTswGAIZilxOo6nm8NAABMj6gNAEySmA0A9E2VdbCu4/nWAAAAK6I2ADApYjYA0KXTJ17CNQAAwPNEbQBgEsRsAKAtdUqsrpo/z4wEAADgVURtAGDUxGwAYN8ePt+6an4+MRYAAICDEbUBgFESswGA16iaV531mvBjYwEAAOiEqA0AjIqYDQC8VJV1sK7j+dYAAAB9JWoDAKMgZgMATzl99PJ8awAAgOERtQGAQROzAYA6m+Ha860BAADGRdQGAAZJzAaA6Zhlc0V4FeEaAABgSkRtAGBQxGwAGKcqP64KPzYWAAAAImoDAAMhZgPA8K1idZX1qesjYwEAAOAXRG0AoNfEbAAYljqbp67PjAQAAIBXErUBgF4SswGgv+psrgn3fGsAAAAOSdQGAHpFzAaA7s1SYnUdz7cGAACge6I2ANALYjYAtKvKOljX8XxrAAAA+kvUBgA6JWYDwOGcPvESrgEAABgaURsA6ISYDQD7UWcdrKskZ0YCAADAyIjaAECrxGwA2M7D51tXzc8nxgIAAMCEiNoAQCvEbAD4uap51Vmfuj42FgAAAEgiagMAByZmA0CxWg++OnXt+dYAAADwMqI2AHAQYjYAU3T66OX51gAAAPB6ojYAsFdiNgBjVyU5zzpce741AAAAHJaoDQDshZgNwNhVSa4iYgMAAEDbRG0A4FX+ZgQAjNxtyonsP40CAAAAWnWc5F/NvfncOACAbTmZDcCUnKd8G/zIKAAAAKB1TmoDAFtxMhuAKblKOaV9bRQAAADQOie1AYCtiNkATM1tkjrJB6MAAABG6M4IGABRGwB4ETEbgKlaJPlHfNADAAAM23XKl3X/N8nfk8yaex0bqRgCURsAeJZnZgMwdbOU9eNnRgEAAPTcTZKvSZbNn19/8ffXKV/kdb/DUHimNgCwQcwGgOIiyR/GAAAA9MS3rIP1snntap4SCI+NlQH9538RURsAJk/MBoC105RT2j7gAQAA2nadzRPXtwf4vzGPqM2wiNoAMHFiNgBsmjU3yW+MAgAAOJBt14Xv20VKIDzyj4KBELUBYKLEbAB42jzJZXy4AwAAvM4+14Xv0ywlal+472Fg/31aRNQGgMkQswHg506bG+QTowAAAF6ojXXh+yRqM0SiNgBMhJgNAM+bpZzQfmsUAADAI12vC9+nKiUOuvdhSERtABg5MRsAXua8uTl2UgEAAKapr+vC962KqM0w//u5iKgNAKMjZgPAy1VJrmLtOAAAjN1dfjxxfTuxGZymbKk68x8HBkTUBoCREbMBYHuXSd4ZAwAAjMZNNsP1VyP5rzolDoraDImoDQAjIWYDwG6sHQcAgGFarQtfPviTX6tTvthrUxVD++/7IqI2AAyWmA0Au5ulrB13QgEAAPrp8brwZZLvxvIq85Q4eGwUDIioDQADJWYDwOstkrw3BgAA6Jx14e2ZR9RmeERtABgYMRsA9qNOOaVt7TgAALTDuvDuzZJcNC/3Qgzt98ciojYA9J6YDQD7M2tuhN8YBQAA7JV14f2/FxK1GSJRGwB6TswGgP27SPKHMQAAwM6sCx+mWUoYfGcUDIyoDQA9JWYDwGGcpqwd9/w4AAB4nnXh41OlhMG3RsEAfx8tImoDQG+I2QBwONaOAwDAJuvCp6VKcumeiAEStQGgJ8RsADi8ecoHOJ4dBwDA1FgXTpLUKWHwzCgYGFEbADomZgNAO06bm98TowAAYKSsC+dX6ojaDPf32yKiNgC0TswGgPbMUk5oe24cAABDZ104r3He3BsdGwUDI2oDQMvEbABo33lz42vtOAAAQ2FdOIcwTwmDojZDI2oDQEvEbADoRpXkKtaOAwDQP9aF07aLlDDoC78M8fflIqI2AByMmA0A3bpM8s4YAADoiHXh9MUsJWpfRNRmeERtADgQMRsAulennNL2gQ0AAIdmXTh9J2ozZKI2AOyZmA0A/TBLCdpnRgEAwJ5YF86QVSlR8K1RMNDfv4uI2gDwamI2APTLIsl7YwAAYEvWhTNWVURthkvUBoBXErMBoH/q5kb32CgAAPiJ66zXhC+T3BoJI3ea5DK2WTFMojYA7EjMBoB+mjU3uW+MAgBg8r5l8znXSyNhwuqUKChqM9Tf54uI2gDwYmI2APTbRZI/jAEAYDIergtfNj9bFw4/qlNOap8YBQMkagPAC4nZANB/p0muYu04AMAYWRcOrzNPiYLulxgiURsAfkHMBoBhmKWcOnhrFAAAg2VdOBzOPKI2w35/WETUBoAfiNkAMCzzlKh9ZBQAAL1mXTi0b5byqKYL90wMlKgNAI+I2QAwPKfNja1nwwEA9Id14dAfojZDJ2oDQEPMBoBhmjU3tu+MAgCgddaFg/smaOv9ZhFRG4AJE7MBYNjOm5tapw0AAA7DunAYviolCL41CgZK1AZgssRsABi+KslVrB0HANgH68Jh3PdOi4jaDJeoDcDkiNkAMB6XsT4PAGAb1oXDNNUpQfDMKBjw+9ciojYAEyBmQzdmSU6bV/Xg56Mkn5PMY20dsJs65ZS2teMAAJusCweeun9aRNRmuERtAEZPzIbDei5a/+pC9DzlwxWAXX73XMUHMgDAtFkXDrzUecqmq2OjYKBEbQBGS8yG/dg1Wv/K783NFMAuFkneGwMAMAHWhQP7MG/uo0Rthvx+uIioDcCIiNmwvTr7j9bPuU75hrD1d8AuTlNOafswBgAYC+vCgUObpxwu8PgmhkrUBmA0xGz4uTolWFcPfu4qBt2lBO2lfyzADmbNDewbowAABsi6cKCr+6iL5iVqM1SiNgCDJ2ZDv6L1r/zZ3EQB7OIiyR/GAAD0mHXhQN+I2ozl/XURURuAARKzmZI6w4nWz7lJOaV96x8psIPT5ub1xCgAgI5ZFw4MSZUSA98aBQMmagMwOGI2Y1RnHNH6OXcp3wh24QnsYpby/DcfwgAAbbIuHBiDKqI2wydqAzAYYjZDdtq8qow3Wv/Kp5So7fQCsIt5StS2Kg8A2LebbIbrr0YCjEyVEgLPjIIBE7UB6D0xmyFYBeuH8dp63LWblCDlwyFg19+xH/1eBQBe4S7rYL360xdugamoU2KgqM2QidoA9JaYTZ+I1q/ze8oJS4BdXCZ5ZwwAwAus1oUvmz9vjQQgdXNf5bMshkzUBqB3xGy6IFofzueUU9pOQQC7OG9uWK0dBwBWrAsH2M48JQYeGwUDJmoD0BtiNockWnfjLiVILY0C2EGV5MrvawCY7L3EMtaFA+zDPKI2wydqA9A5MZt9qLIO1qJ1f3xoLjYBdrFI8t4YAGDUrAsHaOfe6iI2YDFsojYAnRGz2UbVvOoHP58ZS69dp3wT+NYogB3UKae0fegCAMNnXThAd2YpQVvUZuhEbQBaJ2bzlCqi9ZjcpQTtK6MAdjBrfn94HwCAYd0DLGNdOEAf768WSd4ZBQMnagPQGjF72qqI1lPyZ3OR6UMsYBeLWDsOAH1lXTjAsFTNPdZbo2DgRG0ADk7Mns4FchXRmrJacB4rBYHdnKac0j42CgDo9JreunCAcagiajMOojYAByNmj+8CuIpozfPuUp7R5OIS2MWs+f3xxigAoJVr92WsCwcYuzolBPocj6ETtQHYOzF7mGYpp+NOU4L16ucjo2ELn1NOafswDNjFRZI/jAEA9sq6cIBpqyNqMw6iNgB7I2b3m2hNGxeW57GaENjNaXNjemIUALA168IB+JnzJJfxiCeGT9QG4NXE7H4Qrenah+bCEmCX97DLeMYbADzHunAAdjFP+bxG1GboRG0AdiZmt0u0ps+uU77560M1YBfzlKjtPQ0ArAsHwP0WPEXUBmBrYvZhiNYM1V1K0F4aBbCDKslVrB0HYFqsCwegDbMkF83LZ4wMnagNwIuJ2a9Xp3x4Xz342eofhu7P5uYIYBeXSd4ZAwAjZF04AF0TtRkTURuAXxKzX66OaM203KSc0r41CmAH583NqA9XABgy68IB6KsqJQK+NQpGQNQG4KfE7B/VEa1h5S7lm74uJIFdVM3vjzOjAGAArAsHYKj3XYuI2oyDqA3AD6Ycs+uI1vBSn1KithWKwC4WSd4bAwA98i2b4XppJAAMXBVfJmZc12qLiNoAZBoxu45oDfu6iDyPEyrA7u/HV7F2HIBuXGd92tq6cADGfu+1iKjNOIjaAIwqZp+mhOrTBz+f+EcMe/d7kktjAHYwSwnaPlQB4JBW68KXWcdrAJiaOuXzG5+PMgaiNsCEDTFmi9bQvc9J5rF2HNjNRZI/jAGAPbAuHACeN0+JgDZVMpZrv0VEbYBJ6XPMFq2h3+5S1o4vjQLY8X3+Kj5QAWA71oUDwG7mEbUZD1EbYEL6ELNFaxi2D83FI8C2Zs2N5xujAOAJ1oUDwP4tUrZlHRkFIyBqA0xAmzFbtIbxukk5pX1rFMAOLpqbTx+mAEyXdeEA0J5Zcx8majOma8lFRG2AUTpEzK6aV511vBatYfzuUlZWXRkFsIPT5qbTNQPANFgXDgDdW0Xt90bBSIjaACP0mphdZTNaV0nOjBQm78/movG7UQBbmiW5TPLWKABGxbpwAOi3KuWzHPdijIWoDTAiL4nZVURrYDs3Kae0fVAJ7GKeErWtuwMYHuvCAWC4qojajO/adBFRG2DQHsbsKqI1sD93zcXipVEAO6hSHltg7ThAv1kXDgDjU6d8puOzYcZC1AYYsN/u7+/nSf5lFMCBfE45ZWntOLCLyyTvjAGgF6wLB4BpqSNqMy6iNsAA/XZ/f79I8t4ogANfKJ7HB57Abs6bG01rxwHavX6zLhwASErU/pjk2CgY0bXuIqI2wCD8dn9/Xyf5YhRACz40F4oA26qam0wnAgAOw7pwAOBX5imf64jajIWoDTAAv93f358m+csogJZcp5yytHYc2MUiNsoAvJZ14QDAa8xTHgllexZjIWoD9Nhv9/f3SXJvFECL7pobnyujAHZQN78/fHAC8GvWhQMAhzBLctG83JsxpmvnRURtgF5ZxezbWA8DtO/P5qYHYFuz5ubyjVEAbLAuHABo+95M1GZsRG2AHlnF7GU8gxLoxk3KKW3rLYFdXCT5wxiACV9HWRcOAPTBLGX1+FujYEREbYAeWMXsjy40gA7dpQQpF4bALk5T1o7bMgOM2Wpd+PLBnwAAfVOlxD+fNTO2a/FFfHYJ0IlVzF4keW8cQMc+pUTt70YBbMnacWBM7vJjuHZ9BAAMSdXco9kGypiI2gAdWMXs8yT/Ng6gJxeF57EmE9jNPGW1nWe1AUNyk81V4a6DAICxqFPin6jNmIjaAC1axew6yRfjAHrk95QgBbCt0+aG8sQogB6yLhwAmKI6ojbjvLZfRNQGOKhVzE6Se+MAeuY65ZS2tZrAtmYpX4jxnDagS9aFAwBsmqfEv2OjYEREbYADehizv8dKTqB/7lKC9tIogB2cNzeTrnGANlgXDgDwMvOI2oyPqA1wAA9j9jLWvAD99aG5GATYVpXkKtaOA/tlXTgAwOstklzEF5AZ373CIqI2wF48jNlXSd4YCdBjNymnLG+NAtjBZZJ3xgDswLpwAIDDmaUEbVGbsRG1AfbgYcxeJHlvJEDP3aWsoroyCmAH1o4DL2FdOABA+1ZR22fUjI2oDfAKD2P2PMm/jAQYiE/NDY5TUcC2ZilfiPF4FSCxLhwAoG+qlPD31igY4b3HIqI2wFYexuw6yRcjAQbkJuWLOE5LAbtYxDf+YWqsCwcAGI4qojbjJGoDbOFhzJ4l+Y+RAANz11z8XRoFsIM65ZS2teMwTtaFAwCM475tEdu1GB9RG+AFHsbsJLk3EmCgPqec0na6CtjWrLlxfGMUMGjWhQMAjFsdUZvx3sssImoDPOlxzP6a5MRYgAFf+M3jw2tgNxdJ/jAGGATrwgEApqtOiX7HRsHIiNoAT3gcs5fxzTZg+D40F34A2zpNWTvuQxHoF+vCAQB4bJ7y+Y/7N8ZG1AZ44HHMXiR5byzACFwnOY9TWsD2rB2HblkXDgDANuZJLpMcGQUjvDdaRNQGJu5xzLZeExiTu+aG5soogB3M4wMRaOO92rpwAABea5by2faFezhGSNQGJu1xzK6TfDEWYGT+bG5mALZ12twsnhgF7IV14QAAHJKozZiJ2sAkPY7ZVZL/MxZghG5STln60BzY1qy5WXxnFLAV68IBAOjyPu4yyVujYKT3WouI2sBEPI7ZSXJvLMBI3aV8M9eFHrCL8+b3h2/3w9PvsatgvWx+ti4cAICuVSnRT9RmjERtYBKeitm3SY6NBhixzymntH3IDmyrSnIVa8fhOus14cvmHgIAAPp8L3eZ5I1RMEKiNjBqT8XsZZIzowEmcJF3HmvHgd1cxtpxpvWeucxmvAYAgCGqU6Kfz78Z673bIqI2MDJPxWwfzgJT8nvzew9gW3XKKW1rxxkT68IBAJjK/dwiojbjJGoDo/JUzF4keW80wIRcp5zS9mE9sK1ZStD2AQhDfg+0LhwAgKmap3we7rGbjJGoDYzCUzG7TvLFaICJuUsJ2kujAHawiC8D0n/WhQMAwNPmEbUZ973gIqI2MFBiNsCmP5NcGAOwg7q5MfThB31gXTgAAGzvIiX6eZwUYyRqA4P0VMxOknujASbsJuWU9q1RAFuaNTeFb4yCllkXDgAA+7uvu2heojZjJGoDg/KzmP3dGzUwcXcpK6aujALYwUWSP4yBA7EuHAAADm8VtT1SijHfWy4iagM997OYvUxyZjwA+dTcuFjNCmzrNOULMdaO8xrWhQMAQLeqlOD31igYKVEb6LWfxeyP3pwB/usm5ZT2V6MAtjRLcum6ii1YFw4AAP1URdRm3ERtoJd+FrMXsT4F4LHfU6IUwLbmze8Pj3HhIevCAQBgeE6b+zubTRnzveoiojbQEz+L2edJ/m08AD/4nBKlrHgFtnXa3AieGMUkWRcOAADjUqcEP1GbsRK1gV74Wcyuk3wxHoCfXsjN4wQdsL1ZcyP4zihGz7pwAACYhjol9h0bBSMlagOd+lnMniX5j/EAPOtDcyEHsK3z5ibQ2vHx3NgvY104AABM2TzlcyJRmzHf+y4iagMt+1nMTpJ74wH4pevmZuXWKIAtVUmuYu340FgXDgAAPGceUZtxE7WBVj0Xs5fxvA+Al7hrblSujALYwWWsHe8z68IBAIBtzZJcNC8buRgrURtoxXMx+yrJGyMCeLE/mws4J/SAbdXNtZcPObq/EV/GunAAAGA/RG2mci+9iKgNHMhzMXuR5L0RAWzlJuWU9lejALY0SwnaNuO0w7pwAACgzfu9yyRvjYIRE7WBg3guZl8k+cOIALZ21/wOdeEG7GIRXyg8hNW68GXz562RAAAALauaez5RmzETtYG9ei5m10m+GBHAzj6nnNJ20g/Y1mnKKe1jo9jJTTZXhduWAQAA9EmVclLbYz4ZM1Eb2LowcQIAACAASURBVIvnYnaV5P+MCODVF23nEVKA7c2aGz4fbjzvLutgvfrTl4gAAIAhqFNin8dNMWaiNvAqz8XsJLk3IoC9+NBctAFsy6NfNlkXDgAAjE0dUZvxE7WBnfwqZn9NcmJMAHtxnXJK24lBYFunzc3e1K7LrAsHAACmZJ4S+zxyijETtYGt/CpmL+PbYAD7dJcStJdGAWxplvJMtbcj/v24jHXhAAAA84jajJ+oDbzIr2L2Isl7YwLYuz9TVgcDbGueErWPBv7vw7pwAACA512kfEZ/ZBSMmKgNPEvMBujOTcop7VujALY0tLXj1oUDAADsZpYStS8iajNuojbwpF/F7DrJF2MCOJi75mbERRqwi8sk73r4e20Z68IBAAD2aRW1HT5j7ERtYMOvYvZpkr+MCeDgPjU3JIIPsK3z5gavq2/oWxcOAADQniol9L01CkZO1AaS/DpmJ8m9MQG04iblWbjW7wLbqpJc5fBrx60LBwAA6M994CKiNuMnasPEvSRm3yY5NiqA1vyesjoYYFuL7G/lnHXhAAAA/Xea8jnSmVEwcqI2TNRLYvbSGyFA6z6nnNIWjoBt1SmntLddO25dOAAAwLDvBRfxWT7jJ2rDxLwkZn+MVSUAXbhLeRbu0iiALc1SgvbPPsSwLhwAAGCc6pST2idGwciJ2jARL4nZi+xvXSUA2/vQ/C4G2NYiyUWsCwcAAJiaeXNP6BGijJ2oDSP3kph9nuTfRgXQqevmJuTWKAAAAAB4oXlEbaZB1IaR+tsL/h4ndwC6d5ZymvLcKAAAAAB4oY9JTlM2/90ZByN2nORfKYeB5sYB4/GSk9lJcm9UAL3xZ8q3DH3ZCAAAAICXmqU8iuoiyZFxMHJOasNIvDRmf/fmBtArNynfMPxqFAAAAABsYZYS+d4ZBRMgasPA/e2Ff59YAtAvJ0mWKd+kBQAAAICX+p7ymdLfk3wyDkbO+nEYuJfGbKtsAfrnKMkfSa5SvlELAAAAAC91mxL3/p7ks3EwcqI2DJST2QDD96b5PX1qFAAAAABs6TbJeZJ/JLk2DkZO1IaBeWnMvjUqgN5fhP2V8vwXAAAAANjWMkkdUZtpELVhIMRsgHF539x4WDsOAAAAwC6WKVH7f5N8Mw5GTtSGnrNmHGB8zrJeDwUAAAAAu7hKUiX5Z0Rtxk/Uhp56acz+blQAg3KU5N9JLo0CAAAAgFf4mBK1f09yZxyMnKgNPfPb/f39S//er0lOjAxgcG5STmnfGgUAAAAArzBLctG8joyDCfiWZJHypQ6gA3/b4u91OhtgmE5SvpA0NwoAAAAAXuF7StirknyIk9qMn5Pa0LFtYvbSuAAG66i56PqY8g1aAAAAANjVKmqfJvlkHEyAqA0dcTIbYFreppzSPjUKAAAAAF7pNiXs/T2iNtMgakPLtonZX40LYDQXXH+lPNsIAAAAAF7rNiXs/b8k18bBBIja0JJtYvatcQGMyh9JrmLtOAAAAAD78TVJneQfEbWZBlEbDuy3+/v7bf7+eyMDGJ27JOdJlkYBAAAAwB7VSS6TnBgFE/Et5XnyH40C9uNvO/yXEIBxOUrypbnIAgAAAIB9WSY5TfLP6AtMg5PasGfbxuxbIwMYrfcpq6AqowAAAABgjz6mfOYkajMVojbsybYx+6uRAYzaSfO7/twoAAAAANizjykntT+kPPoOxk7UhlfaNmZ/NzKA0TtK8u/m5mJmHAAAAADs0feUx91VEbWZDlEbdrRtzF4aGcBkvM36uUYAAAAAsE8Po/afxsFEiNqwpb8ZAQDPOEkJ2hdGAQAAAMABfE/57OnvST4ZBxMhasML/XZ/f7/tv+be2AAm6XNzYeWREwAAAAAcSpXkMskbo2BCvqVsKvhoFLBpl5PZnl8BME1vknxNUhsFAAAAAAdym+Q8yT+SXBsHE+GkNvzELjH7q7EBTPqi6kvKtwQBAAAA4FCWKYcqRG2mRNSGR3aJ2bfGBjB575sbiplRAAAAAHBAy5So/b8pq5hhCkRtaIjZAOzqLOu1TwAAAABwSFcpz9P+Z0RtpkPUZvLEbABe4yjJv5NcGgUAAAAALfiYddS+Mw4mQtRmssRsAPbhXZKvSU6NAgAAAIAWfEyJ2h8iajMdojaT89v9/f22/5pZkv8YHQBPuEty0dxMAAAAAEAbZimfSV2kbBKEqfiWZBGfxzJiu8TsJLk3OgCe8am5efhuFAAAAAC0pEoJe2+NgokRtRmtv+34r7s2OgCe8TbWjgMAAADQrtuU1ct/TzlsAVNh/TijtWvMdtIOgJdcQP2VckIbAAAAANpym3XUdjiPKRG1GZ1dY/ZXowPghf5Iskx5dhEAAAAAtOU2SZ3kHxG1mRZRm9FwMhuANpw9uHkAAAAAgDYts47aN8bBhIjaDJ6T2QC05SjJlySXRgEAAABAB5ZJTpP8M8k342BCRG0Ga9eYfWt0AOzoXcqXoiqjAAAAAKADH1M+mxK1mRpRm8ERswHowklK0D43CgAAYGKqlA+PL5v7ovvm55nRALTuY/N7+UOSO+NgQkRtBuO3+/v7Xf+1X1NiBAC8xqckF0m+GwUAADBCdfM6bf48+snfd5dkEY9mAujKLOUzqotnflfDWH1rrkM+GgV985qYvUxyZoQA7MFNyjcAvxoFAAAwYFU2w/UuB0G+pYSUK+ME6MQsJeq9MwomSNSmd14Tsy/9Mgdgz36PUwgAAMBw1HnZqetdXKd8mLw0ZoBOVM3v4bdGwQSJ2vTGa2L2Isl7IwRgzz6nnNK2dhwAAOiTKq8/db2LTymfw936RwDQ2e//RURtpknUpnOvidl1ki9GCMCBLpLOY+04AADQnTqHO3W9rbuULVaX8cVfgC7fFxbx+FWmSdSmM6+J2adJ/jJCAPZ4QbRMCdirPwEAANpQpZtT19u6S3me9kf/yAA6U0fUZrpEbVr3mpidJPdGCMAO7rKO1svmZ6cLAACAttTpz6nrXXxLeTzT0j9KgM6cp2zMODYKJkjUpjWvjdm3flED8AI3WUfr1QsAAKANVYZx6noX1ylR+9Y/ZoDOzFOinlbCFInaHNxrY/YyVmkA8OMFzCpYL+OkAAAA0K46wz51vYtPKevHbbwC6M485aT2kVEwQaI2B/PamP0xyVtjBJi062w+5/rWSAAAgJZUGe+p623dpUSUy4jaAF2ZpXy56CKiNtMkarN3r43ZiyTvjRFgUhcjy2zGawAAgLbUmd6p613u2xbxITJAl0RtXI+4HmFPXhuzz5P82xgBRukum6vCv8a3+wEAgPZUWUfr03jU3bauUz5EXhoFQKfvZYvYcMt0idq82mtjdp3kizECjMJN1tF69QIAAGhLnc14fWwke/E55WTgrVEAdKaKqM20idrs7LUxO0nujRFgcO6yuS58aSQAAECLqjh13bY/Uz5EtnELoNv3v4/e95gwUZutidkA03Cdzedc3xoJAADQojpOXffBXZLLlA+RAej2fXERUZvpErV5sX3E7KVfuAC9uxBYZr0qfGkkAABAi6o4dT2E+8aLJFdGAdCpOuVLRidGwYSvSRYRtXnGPmL2VZI3RgnQibtsnrhexso4AACgXXWcuh6q65QPkJdGAdCpefP72HsoUyVq81P7iNmLJO+NEqAVN9mM11+NBAAAaFEVp67H6FPKZ3y3RgHQqXlEbaZN1OYH+4jZ8yT/MkqAvbvL5onrpZEAAAAtq+PU9ZR8SFl3a+MXQLcWKY+DODIKJkrU5r/2EbPrJF+MEuDVrrN56vrWSAAAgBZVceqa8sXqi/jwGKBrs+b3sajNlIna7CVmz5L8xygBtn4TXma9KnxpJAAAQMvqOHXN8/etc/erAJ1bRW2Pe2Xq1yWLiNqTtI+YnST3RgnwU3fZPHG9jJVtAABAu6o4dc1urlMiylejAOj8vXyR5K1RMGGi9gTtK2Z/TXJinABJkptsxms3/AAAQNvqOHXNfn1Kidq+nA3QrSqiNojaE7KvmL2Mb/QC03SXzRPXSyMBAABaVsWpa9q7B75sXqI2QLfqlJjnfZ8pE7UnYF8xexHPawCm4Tqbz7m+NRIAAKBldZy6pls+OAbo13XBIqI2rk1cm4zUvmL2RZI/jBMY4Rvg42ddAwAAtKmKU9f0103K54LulwG6V6eEPF9yY8pE7RHaV8yuk3wxTmDgrrMZrq1MAwAA2lbHqWuG53NK1L41CoDOzVNinmsIpkzUHpF9xezTJH8ZJzAgN9k8df3VSAAAgJZVceqacfkz5YNjXw4H6N48yWWSI6NgwkTtEdhXzE6Se+MEeuoumyeuv7qxBgAAOlDHqWumcQ9+mfLBMQDdmqVszriIqM20fWv+e3BlFMOzz5h96yYM6InrrE9bL2PNGQAA0L4qTl0zbT40BugPUZupWj1adPVigPYZs5duzICObo4fnrj2hgQAAHShjlPX8JTrlFPa7tcBujdL2Z7x1igYqZusw7Uv1I3EPmP2ZZJ3Rgq0cBO8zDpcWxcOAAC0rYpT17CtTylR+9YoAHpxLbOIqM3wPYzXy+gFo7TPmL1I8t5IgT2/ET08df3VSAAAgA7Uceoa9uVDyqEYHzYDdK9K8jG+mMdwfMvmyWvXExOwz5hdJ/lipMCO7rIO18vmZ29EAABA26o4dQ1tfAawSInaAHSvbn4vu+6hbx7G62VseJkkMRvoymr9x1dvQgAAQIfqOHUNXfmWZB7P0wbo03XRIqI23bnL+tT1MroB2W/MTpJ7IwV+cnP6cF24m1QAAKALVZy6hj66TnIRjxcD6It5StT2JT8ObRWvVy/XAvxg3zH7e5IjYwU3odl8zvWtkQAAAB14GK7r+EAW+u5TSjy5NQqAXphH1Gb/Pke8Zgv7jtnL+FYzTM1N1tHamw8AANCVWTbDtc8nYJjuUp6lfZlycAaA7i1SNmg4zMguVoffVi/Yyr5j9sckb40VRn1D+TWb35pyYwkAAHTBqWsYt28p8eSjUQD0wiwlaIva/Ip4zV7tO2Yvkrw3VhiNm2w+5/rWSAAAgA44dQ3TdZMSTpZGAdCb67KLaEFsvlcvH7wcgGOv9h2z50n+ZawwWKtnVXx1kwgAAHTIqWvgseuUzx5vjQKgF6qUA4629U6PeE2r9h2z6yRfjBUGdSP48E0HAACgbU5dA9v4MyWe+OAcoB+qiNpj9y3rhnDlPZi27Ttmz5L8x1iht24evekAAAC0zalr4LXuklymxBMA+qFufi/7YuLwPYzXy9iKQsf2HbOT5N5YoXdvOlex7gMAAGifU9fAIX1LCScfjQKgN+qI2kNzl81DcLdGQp8cImYv/ZKCTt90ruIbUwAAQDecuga6cJ0STpZGAdAbdcqXjVwP9s/DeL1M8tVI6LNDxOyrJG+MFrzpAAAAo+bUNdA3n1Ki9q1RAPTGvPndLGp36zrrg3A6AoNyiJi9SPLeaOGgbzrL5o3Hmw4AANAWp66BofiQ8kxtj1sD6I9587v5yChaseoIqxcM1iFi9kWSP4wW9uYmm8+9BgAAODSnroGhu0s5dHNpFAC9usa8aF6i9n7dZPMRpDAah4jZdZIvRguvetNZPnj5FjEAAHBoTl0DY/UtJZpcGQVAb4jar6cjMBmHiNlVkv8zWtjqpurhm86tkQAAAAfk1DUwRdcp0cQj2wD6dV16meStUfySeM1kHSJmJ8m90cJP3T14w7mKeA0AAByWU9cAa59S1o/fGgVAb1TN72ZRe80hOGgcKmZ/TXJivPBf11k/r8I3gAEAgENx6hrg1+5STgJexsk2gD6pmt/Nbyb47128hp84VMxeumFm4q4fvfEAAAAcglPXALu7S1k9/tEoAHqlTjmpPebOZIMrvNChYvZlknfGy4R4XgUAAHBoTl0DHMZNStReGgVAr9QZT9R+GK+XscEVXux/DvS/V8hj7B6u/Ljyn3kAAOAAnLoGaMdJki8pm/bmcToOoC+WzXXwPCVqD+16eLXB9SriNezsUCez6+YCEMbi7sGbztJNDQAAsGdOXQP0x6eUk9oOLwD0yzz9jtoePwoHcKiYfZrkL+NlwKz8AAAADsmpa4B+u0t5lOLCKAB656L5/XzU8f8fq8ePrg7BAQdwqJidJPfGy8D41hQAAHAITl0DDNe3/8/e3V61kaRtAL6HM/9hI0BvBDAR0BOB2QiQI7AnAuMIzESAHIFxBBYRGCIYEcFABLw/qlksA0aCltQf13WOz3jXNh+3RHdVP1VPpRRMJqIAaN0Y+339a11F7bvi9d0vHTxgDVZZzJ7FynLa7ccbz5k4AACAhth1DdA/5ylF7akoAFrlrqj9YQUf+yr3u66nUbyGjVhlMXsaq81pFzceAACgaXZdAwzL15SiyUwUAK0ySll0dPSKj3GV+Z3XrvXQAqssZk9eedGA13LjAQAAmmbXNQBJ8jHlTG2bJQDaZZTFi9pqCNABqyxmH2c1bR3gKTc/3XguRAIAALzCTu6L1lXsugZg3k3KM9ATUQC0zn59fT746bo9jRoCdMoqi9mHSb6ImBU7z/2Z1248AADAa+xnfuf1nkgAWMBVSuvxM1EAtM7d2H4aNQTopFUWs6sk30RMwy4zf+41AADAS/y863o/ybZYAHiF85SitmIJAEBDVlnMTpJbEfNKl5lv++EcIgAA4CXsugZgXT6ntB+fiQIA4HUUs2mbq8wXrw36AQCAZdl1DcCm3aSc1XoSmzMAAF5s1cXsaZIDMbOAy5Rz1meiAAAAlmTXNQBtdZPSenwiCgCA5a26mH2W5I2YWcBlykMnAACAX7HrGoAuukoyTtn8AwDAglZdzD5O8kHMLPp+FAEAAPATu64B6JPzlKL2TBQAAM/7fcUf36AMAACARdl1DUDfHST5J8nnlPbjztMGAPiFVe/MrpJ8EzML+o8BPAAADIpd1wAM2U2Sk/qXZ2IAAI9YdTF7J8m/YmZBf8a5QQAA0Fd2XQPA465SjmuciAIAYN6qi9lJcitmFqSYDQAA/WHXNQAs5zylqD0VBQBA8fsaPsdlPLRgMSMRAABAJ9l1DQCvd5ByZOPXlPO0ZyIBAIZuHcVs572wqJEIAACgE+y6BoDVeVP/+jtlp7bnqwDAYK2jmD1NWVUIAABA99h1DQCb8S7JOKWgfSIOAGCI7MymTfZFAAAArRiX23UNAO2wneRTStvx90nORAIADMk6itkXYmZBOyIAAIC1j8HtugaA9ttN8iXJecpO7alIAIAhsDMbAABgOOy6BoBuO0jyLcnnlKL2TCQAQJ/9dnt7u47PcytqFn1PigAAABph1zUA9NtNylnaJ7GhCADoqXUVs2cprXDg2fekCAAA4EXsugaAYbpJOU97IgoAoG/WVcyeprTAgWffkyIAAIBn2XUNAPzsKsk4ztMGAHrk9zV9nosoZrOYyoAbAAAesOsaAHjObsp52ucpRe2ZSACArltXMduZLQAAAIux6xoAeI2DJP8k+ZzSftyzWQCgs9bVZrxKWRUIz/lvkjMxAAAwIHZdAwCrcpPkpP6lqA0AdM7vIqBl9qOYDQBAf9l1DQCs03aSDyltx4+TTEQCAHTJuorZU1EDAAADNMp84dquawBgE3aTnKa0HX8fz2sBgI5Y587sm9hxwPNGIgAAoMOq3BeuK3MgAKBl9lKOg/yaUtSeiQQAaLN1nZmdlNV+ByLnGecpD/0AAKDtRpkvXNt1DQB0zd8p7cedpw0AtNI6d2bPopgNAAB0VxW7rgGAfnmXcp72SUpRGwCgVdZdzIbnjEQAAEBLxqVV7LoGAPpvO8mHlKL2+yRnIgEA2kIxm7bZFQEAABtQxa5rAGDYdpN8STkG8Djl2EgAgI1a55nZVZJvImeR96UIAABYoVHsugYAeM7nlKL2TBQAwKass5i9k+RfkbOAP5JciAEAgIZUsesaAOClPqacqX0tCgBg3dZZzE6SW5GzgD+jjREAAC8zil3XAABNu0k5T3siCgBgndZdzJ4mORA7z1DMBgBgUftJDmPXNQDAOlwlGcezOwBgTbZEQAtVIgAAYEGjlF1Cb6KQDQCwartJvqUUs/fFAQCs2rqL2VORAwAADTpLeZB6KQoAgLU5SPI9pe34jjgAgFVZdzH7WuQAAEDDZikF7b9FAQCwVkf1WOw4itoAwAqsu5h9IXIWUIkAAIAXeJ/kv0luRAEAsDbbST6kPPsdiwMAaNK6i9kzkQMAACuk7TgAwGbsJjlNKWpX4gAAmqCYTRtpSQQAwGvnHdqOAwBsxl6Sb0mmSUbiAABeY2sDn9MOCRYZ8AIAwGtpOw4AsDkHSf5JchKbVwCAF9pEMfta7AAAwJpoOw4AsFnvUjrnHIsCAFjWJorZF2JnASMRAADQkFm0HQcA2KTtJB/qcdlYHADAouzMpq1GIgAAoGHajgMAbNZuktOU87QrcQAAz9lEMXsqdgAAYEO0HQcA2LyDJN+STGJTCwDwC3Zm01YGsQAArMos2o4DALTBUZJ/Us7T3hEHAPAzZ2bTViMRAACwYtqOAwC0w9152u9FAQD8aGtDn9fDIgAAoA20HQcAaIftJJ9SitqVOACAZHPFbLuzec6+CAAAWJNZtB0HAGiL3ZTztKfxjBAABm9TxeyZ6HmGM3IAAFg3bccBANrjIMn3JJM4khAABksxGwAA4J624wAA7XKU0unzODbAAMDgaDNOWx2IAACADZlF23EAgDbZTvIh5bnyWBwAMBybKmZfix4AAGg5bccBANplN8lpSlG7EgcA9N9vt7e3m/rct+LnGf+JhQ8AAGzeKKX9+J4oAABa5Txlp/ZMFADQT1sioMX2RQAAQAvMou04AEAbHST5J8lJnKcNAL20yWL2ufgBAIAO0XYcAKCd3qUsQDwWBQD0yyaL2dpH8xyrKQEAaJuzlF3al6IAAGiV7SQfUoraY3EAQD9ssph9IX6eoc04AABtNIu24wAAbbWb5DTJNEklDgDotk0Ws2fiBwAAOkzbcQCA9jpI8i2ls85IHADQTYrZtJlBJgAAbaftOABAu71J8k/KedqONQSAjlHMps1GIgAAoANm0XYcAKDt7s7Tfi8KAOgOxWwAAIBmaDsOANBu20k+pTybPhQHALTf1oY/v1Z8/Mq+CAAA6BhtxwEA2m83yZck03gGCQCttuli9rWXgF/YFgEAAB00i7bjAABdcJDke5JJHHkIAK206WL21EsAAAD0lLbjAADdcJTkIslxkh1xAEB72JlN22nzAwBAl2k7DgDQDdtJPqR02RmLAwDaYdPF7AsvAc+wEhIAgK6bRdtxAICu2E5ymvLsuhIHAGyWndkAAADroe04AEB37CX5lnJU5kgcALAZdmbTdpUIAADokbOUh6HnogAA6ISDJP8kmUQXSQBYu60WfA1XXgYAAGBArlMWbX4UBQBAZxylHB9zLAoAWJ82FLNnXgZ+wWpHAAD66jjJn9F2HACgK7aTfEh5pj0WBwCsXhuK2VqN8yv7IgCgxXaSHKYUpKbxMANY3jTajgMAdM1uktN6LFeJAwBW5/cWfA3XXgYAoCOqlIVWd//d/enPD1KK22NjHGDJOVGVsjDmgzgAADrjIMm3JF+TvI8upADQuN9ub283/TUcJvnipeAJl7E7G4DNGOW+aL2f8pBiUVf1GEcHGmBZVZKzlBaWAAB0y98pCxQtbgaAhrShmF2lrF6DJ9+nIgBgxXZyv+O6qn/fRCHpryQn4gVecE06y3KLaAAAaIeblIK2uSAANKANxewkufVS8Kv3qQgAaNiPrcL3k+yt8HN9jbbjwMscR9txAICuukppPX4mCgB4ubYUs6+jjR5P+784bwaAlxtlvni9iZ2ONyltx6deDmBJVbQdBwDosvOURYrmgwDwAm0pZk+jhR5P+9NgD4AlVJnfdb3boq/tY8pDDIBlaDsOANB9n+v54EwUALC4thSzJ0mOvBw8QTEbgKfs//CrymrbhTflPGWXtrbjwLKOo+04AECX3aScpX1iTggAi2lLMfs4HsrwtL/qAR4Aw7aT+x3Xd//tatvdm5RztJ2dBiyrirbjAABdd5NynvZEFADwa1st+TpmXgp+YUcEAINU/TC5nyX5N8mXlAVwB+l2IWe7/l4s1gKWNU0ySunyAABAd+eEp/VctxIHADzt95Z8HTMvBQAM2ijz51wP5VzYd/X3fWg8BCzhur52HEeHKwCALttN8i1loeLYvBAAHmpLm/GdlN1W8JivKQ/5AeiHncy3Cq+iXa4Wc8BLVdF2HACgLz7Xc0PnaQNArS3F7CS59XLwhPNotwPQZT8WrveT7InkSR5cAC+xk1LQPhAFAEDn3aQcSXVibggA7SpmT+PhC49TzAbojlHui9aVe/uLXKa0l7sQBbCk42g7DgDQF1f1+G4iCgCGTDGbzrxXRQDQSlXmd13viqQRNykPLU5EAbzguqztOABAf5zX88OpKAAYojYVs49jFwG/eK+KAGDj9jO/61q78NX7mrJLW2s5YBnajgMA9HN++D7JTBQADEmbitnvk3zykvCE/8SDfIB12sl90bqqf2+X32ZcJTmMtuPA8o5jwTAAQN/8XY/zPCsFYBDaVMyuknzzkvCEP6OVDsCq78M/7rrWLrx9/oq248DLru/ajgMA9IujqQAYjDYVs0dJ/vGS8ATFbIBm77l3Rev9aEPbJecpu7StwAeWoe04AEA/XaV0PD0TBQB91aZidpLcekl4wtskEzEALO3HduF3/7U7r9tuUgraU1EASzqOtuMAAH10Xo/1zBMB6J22FbMvkux5WXjEx3pABsCv/dgqfN991b0R4CdVtB0HAOirz/U8cSYKAPqibcXsabS+43Ee2AM8NMp88do9dHjOk4zjQQWwHG3HAQD67WPKedqOqAKg87Za9vVceEl4wkgEAKlyfxbWLMk/Sb6ktIxVkBimg3r8dCgKYAnX9T3loygAAHrpQ8pzg7EoAOi6tu3MPo4ztCiaogAAIABJREFU3HjcecoDN4ChGGX+nGvtwnnO3ymLHQCWUUXbcQCAPrtKKWpPRQFAF7WtmF0l+eZl4RGK2UCf7eS+aF3Vv1dU4CUuU3Zpz0QBLHkf0nYcAKDfzlMWQOuOCkCntK2YvZ/ku5eFR9ykPGQD6IO7wvXdf3dFQsP3zPdJJqIAlnQcnbIAAPrucz1ndJ42AJ3QtmJ2ktx6WXjq/SoCoINGmS9e2/XGunhAAbxEFW3HAQD67ibJSf3LnBGAVmtjMfs6HpzwxPtVBEAHVJnfde2exiZdppyNpo0csAxtxwEAhuEqpTvPRBQAtFUbi9nTeGjC4/6s3x8AbbGf+V3XeyKhhW5SHk6ciAJY0nG0HQcAGILLlM5eU1EA0DZtLGZPkhx5aXiEYjawSTuZ33Ft4RVd8zVll7YWcsAyqmg7DgAwpHnj+yQzUQDQFlst/JrcKAFog6qewJ3V96Z/k3xJ2aGmkE0XvUlpN74vCmAJ0ySjJOeiAAAYxLzxn5TOXjviAKAN2ljMdqYjT6lEAKzIKGXH6kl9H7pN8i3Jp3oitysiemI3yfeUhRoAi7qux+IfRQEAMAjvUhb2H4sCgE1rY5vxKqWAAD/7aAAFNGAn963Cq/r3WqcyROdJDqPtOLD8fE3bcQCA4bjKfec6AFi7Nhazk7IjDn72d+wkA5Z3V7jer3/tiQT+5yaloD0VBbCEnZSHmY7dAAAYjvOUjUbmjwCs075iNl0bMFViAH5hlPnitYfssBjdT4CXOE7yQQwAAIPyuR4HzkQBwAqMct9V9TDJrK3F7GkUIHhIMRv42U5Kx4a7XdfOtobX3WfH8UACWE4VbccBAIboY5KTOLoKgNfZyXzx+udn/OdbLf3C3QB5zEgEwCP3i1GSN1HIhtc6SHJRDxoBFjWt78XnogAAGJQPKYuhHQsJwLKqlC4fF0n+TfIlybs8/ox/2tZi9oXXkUcoVAGPGSd5KwZoxHY9eDwRBbCE63oi+lEUAACDm0N+SilqV+IA4An7KYufzlKOmv6Wsihqb5F/3NY24+Mkp15bHnvPigD4xb3jJNqcQlMuU59LIwpgCVW0HQcAGKrzlGKFzWoAwzbKfOvw1zwj+LOtxewqpSoPP/u/eKgOPG0/pd2pB+jQjJuUBxETUQBL2EkpaB+IAgBgkD6ntI+diQJgMM8Bqjx97vVr/NHWYvYoyT9eex7xZ0qhCuAp+ykP0B1NAM35nFLUvhYFsITjlLZhAAAMz01KB70Tc0mAXqpyX7zeW+Hn+a2txeyk9EyHnylmA4vYqa8Ve6KAxlymtPPXLg5YdnKr7TgAwHBdpSxynIgCoNP2c1/AfrOmz3mTZGerxaFcel/wxA8LwHOu65vqV1FAY/ZSFom8FwWwhGlK561zUQAADNJuktOUhdGVOAA6Y5SysWWS8rz9e5JPWV8hO/W9I20uZms9wmN2RAAscR85TGmPDDRjux60nrknA0vek6skH0UBADBYe0m+5X6xIwDtspPyPP0kySzlOOjTJEfZXLe1WdLuYvbU+waABoyT/CUGaNSblJWROqYAyzhOOTboShQAAIN1kFIgOYlF0gCbVtVz9WmSf5N8SfIupatGG8wSO7Pp5g8WwLJOkrwVAzRqN6W9kLbjwDKmKQthHAUCADBs71KKFMeiAFib/ZRneWcpddhvST6kLDRqo9a3Gb/wngKgQZMkfyS5EQU06lNKccqKemBRd0eB6JwCADBs2ylFlFlKZz0AmjXK/bnXs8yfe73dga//Okl+u729besXuF+HCj+6jJamwOvvL9OO3KyhS25SilNTUQBL3pfP0p4WZgAAbM557tvdArC8nZQOx3e/9jr+/fwnyXWbi9lJcut9xyN+EwHQwE192oObObTRx2gTByx/X56krAwHAIDP9bxyJgqAZ1U//Dro2ff2W9Lundmpb1ZW6PPomxfglXZSdoIdiAIad57SwmgmCmAJ71PanQEAQFIWS5+kbjMLQJLS4az64VdfO5Ce199f64vZ0ygy8NB/DGCABk2SHIkBGneTUtA+EwWw5KRc23EAAH6cWx6nFLUBhmiU+eL1UObL/ytmb7X8C73wHuURzswGmjROWekLNGs7yZd44AAsPwfcT/JVFAAA1HPLTymdvypxAAOwk+Qw5ZnaRZJ/kpymbMga0sLv6d1v2l7MtvsWgHU4TvJWDLAS7+qB90gUwBLzwMMkf4kCAIDabpJvKcUNm52AvqlSnlFPk/ybskHkXZK9gT8bSGJnNt00EgGwApMkf6a0rwKatVeP68aiAJZwkuSPJFeiAACgdpDke8pznJE4gI7aT/I+5Zit65TFOh/i6OUf/a9GbGc2XWSQAqzKNGUVnII2NG87pSXSJKVdEsCik1dtxwEA+NlRPVY8NscEOmAnZZPHJOXYhO8pRyi8SXlmxkOzu9/8dnt72/Yv9tbrxU8+1oMUgFUOLqYZdhsXWKXLegCvCw+wjPf1ZB8AAH50U48VJ6IAWuQwZeNUFc+ZX+K3//2mA8Xs61iVwLyv9UUAYJUUtGH1/kppIwywqP2UNmy7ogAA4CeXKUXtqSiADc1X7wrY2oW/zlV+6NK81YEv2I4dfqZtDLAO1/UA5LMoYGU+pRSl3NuBZeaH2o4DAPCYvZRzZ6dxVCWweqPMn3v9Pc69bsrsx//RhWK2c7MB2KRxkr/FACvzJvfFKYBF54iHKd0dAADgZwdJ/klpO27xNNCUn8+9/ifOvV6VuY3OdmbTRR52A+v2PslbMcDK7KasXj0WBbCEkyR/pLQfAwCAnx2lFJzMNYGXOqznnhdJ/k1yWl9bHH21WnMbnbtwZva4fnPA3HtXBMCGBi+TWGkHq3Re/6zpzgMsaqe+P78RBQAAT7hKKWpPRAH8gnOv2+G/Ke3bk3SjmF2lnHMBP1LMBjY5oJlGQRtW6aaeOExFASzhfUqLNwAAeMp5SlHbfBNIyrnXd8XrKp75tsWfP16nu1DM3knZug9PvpEBNjDIOUuyJwpYqY/RDg5Yzn59j9byDQCAX/mashhyJgoYlJ3MF6/NHdtpbkNrF4rZSXLrdeMnitlAGwY+0yhow6pd1pOMmSiAJe7Rk2g7DgDA8z6mnIfrqCvorx+L157ltt9NPa//n62OfOHnXjt+siMCYMOu6wHQZ1HASu0luagnHgCL3qMPk/wlCgAAnvEhZfH0e1FAb+zXP9PTlM2yX5K8i0J2V1z8/H9syYQOX4wANu06yTgK2rBq2/XE40QUwBJOkvyR5EoUAAA8M+f8lFLUtpAaumeU8oz2LOV57ff6Z/pANJ30oFNGV4rZU68dAC02TvJWDLBy71JWZ1rUBizq7prxVRQAADxjN2Uh9dS8E1rt7tzrScoilH+SnKYcNbUtnl7M4+d0pZjtvAoeu1gBtMkkpaB9IwpYqb2UBwtjUQBLzCe1HQcAYFEHKTs7Jyk7PoHNq1K6b10k+Tdl4clRyiIU+mX28//x2+3tbVfepN+8fvzgvH5fALTNfkqhzSpAWL3PKWcgWfgILHOfPosHHgAALOamHkPORAFrn7tVKQuTtQsflj/zU8furhSzRyltAuCOYjbQ9sHWJGUHKbBalym7tC9EASxop75PvxEFAAAL+E0EsHKj3Bevq9goNGT/yU8bV7pSzE6SW68fP7iKFi9Au+2krCBT0Ib1+Cul3RTAot4n+SQGAACeoZgNzdvJfPFa9yyevOZ2qZg982bGIALo4KDsJOX8FmD1vqbs0tZ2HFiUtuMAAPzKZT1mBF6vyn3x2gYgFr7mbnXoG5h5DQHomOuUwtpnUcBavElpN+5BA7Cou2vGV1EAAPAIi6Xh5fZTOmJNU7ovf0vyLgrZLHnN7VIx2zmIPHYhBOiCcUoLZGD1dpN8T3IsCmCJyfKhezUAAE+MFYHFjFKeg57VPzvfU452OhANC5o+9n/+7qZBh+2IAOiQk/pedioKWIsPuW9fZRwJLHqvnkbbcQAA7tlkB09z7jVr0aWd2VMvFwAdN0nyR5IbUcBaHKQcVVOJAliQtuMAAACLOUvyJclRFLJpxvSx/7NLxWw7aviZNuNAF12kFNauRAFrsZ1yJtOxKIAl5p7ajgMAkNiZDb8yEgErmI8/4MxsukybcaDLE6H9JJeigLX5UP/smWgBizpJ6ahiARoAwHDZZAdPsxubpj1aC97q2DehLSsAfZoMVdHGFNZprx4UH4oCWGIire04AMBwKWbD42w2pGlPLiTvWjHb7mx+VIkA6MGE6DDJZ1HA2mynnOd0Igpgyfu1tuMAAMOjJgGPcwwsTZs99QdbfflGAKDDxkk+igHW6l3ud1wCLELbcQAAAFiN2VN/oJhNl2ljAfTJcZK3YoC12ksyTVlQArAIbccBAIbjUgTwpEoENGz21B9oM06X7YkA6JlJkj+T3IgC1mY7yWn982ehHLAIbccBAIYz7gNgPZ6sAXetmO3mAUDfTVNWNipow3od1T9/2o4Di9J2HACg39Qj4GmVCFjXNdfObLpuJAKghy7q65t2VrBee0m+J3kvCmCJe7a24wAA/R3rAbDha66d2XTdSARAT12nrHA8FwWs3ackZ9F2HFj8nq3tOAAAMCQ627GKufWjtjr4zXioD8CQbuBVks+igLV7k/sdlwCL0HYcAKBf7MyGp22LgAb9svbbxWK23dn8aCQCYADGST6KAdZuN6Xt+LEogAVpOw4A0B9qEfA4C/9Z6/W2i8Vsq6H40UgEwEAcJ3krBtiID0mm0XYcWHwSru04AEA/xnXAQ56P0LRf1n67WMyeeU0BGKhJkv8muREFrN1BPQ6tRAEsSNtxAIBus7EOHjcSAQ3r3c7smdeUH2hnAQzNWUoxTUEb1m87ybdoOw4sTttxAACgb0YiYAVz5ycpZtN12lkAQ7257ye5FAVsxIf659DkDVjEj23HLUYDAOgGz1zgaSMR0LDZr/5QMRsAunuDr0yuYGP2Ugrah6IAFnTi3g0A0BnOy4anjURAw2a/+sOtjn5TJv/cORABMPCJ1X6Sz6KAjdhO8iWlQAWwiIuUgrZ7NwBAuylmw9N0zKVJV8/9ha4Ws91IAODeOMnfYoCNeZf79v8Ai8xnx0neRttxAIC2uhABPGlPBDRo9txf6Goxe+q1BYA571MeigObm8hNUwpUAIuYRNtxAAAAhu3ZxUNbMqIHKhEAJCkPxe3ygs3ZTnJa/yxquQUsOmmvou04AEAbx2nAQ5UIaNiz3bjtzAaAfpnUg0oFbdico3q8qu04sOjEfRwL0gAA2jZGA2D1ps/9BWdm0wd2PgHMu9vlpW0pbM5eku8pRwAALGLi/g0A0BpqEPC4SgSsW1eL2Vp88CO7ngAev1dW8UAcNu1TkrNYfAcsd//WdhwAYPPjMgBWb/rcX+jymdlXXl8A+KXreCAObfAm5UGIBXjAovfvcbQdBwAA2sezDZq00Jy3y8XsmdeY2kgEAE+6eyCuoA2btZvSdvxYFMCCJtFlBQBgE4y/4Gk6z9GkhbpgbPX9G2QQRiIAeNY4ZYcXsFkfUtonmfwBi857q1iUBgCwTs7LhqfZmc3ar7dbff8GAYD/mUTLUmiDg5QuQ5UogAXnvmP3cACAtY6/gMdti4AG2ZnNYIxEALCwSUoBzcNw2Pzk71uSE1EAS97Dtb0EAFgttQd43EgENGy2yF+yM5s+2BUBwNKTsirJlShg497VP5MmhMAy93BtxwEAgHUbiYCGzRb5S10uZk+9xgDwYhcpZ9zY3QWbt1f/TB6KAliAtuMAAKtlZzY8biQCNnG93er4N2nizp19EQAs7Tpld9dXUcDGbSf5ktJ2fEccwAIm0XYcAGAVdIWFx41EwCaut10vZlshxR0PfQFePmA4jHal0BbvUjoQWagHLDonrtzHAQAapZgNj1OHoUkLL8zuejHbTQUAmjFO8pcYoBX2UgraY1EAC86Lx9F2HACgKTbRweMsvKfpuexC7MymLyoRALzaScqDcGDztpOcprQRtvIZWMQk2o4DAADQDdNF/2LXi9kzrzUANGqS5I/Y2QVtcZSygNPqZ2AR2o4DALyOhYHwtAMR0KDB7Myeea0BoHF3D8IVtKEddpN8T/JeFMCCDwTG0XYcAOClYykAVm/h7tvajNMXlQgAGr/HjmJFMrTJpyRn0XYcWMwk2o4DACxLMRseV4mATV1vt4byjQIAL7rPVknORQGt8Sb33RMAnqPtOADA8uMnAFp0vd3qwTfrATuJHUoAq3JX0PYQHNpjN8m3JMeiABa8l4+j7TgAAPBy+yKgQVfL/OUtedETeyIAWKlxko9igFb5kGQai/qAxUyi7TgAwHPszIbHefZAk2bL/OU+FLOnXnMAWIvjlF1dQHsc1BOAShTAArQdBwD4NUebwuPszKZJs2X+ch+K2W4u3BmJAGDlJkn+jDal0CbbKW3HT0QBLDiHHkfbcQCAp8ZKwEN2ZtOk2TJ/uQ/FbG0/uDMSAcBaTFN2dXkADu3yrh4bGxMBi5hE23EAgJ+pN8DjRiJgU9faPhSzZ15zANjIgGMUD8Chbfbqn89DUQAL3s+raDsOAAD82q4IaNBSXTAUs+kTZzYArH/QUUVBG9pmO8mXlLbj2oABi9zPx9F2HADA8w143EgENGy6zF/e6sk3feV1Jx7WAmzCdcpiIju6oH3e1ZMDC/6ARUxikRoAMGzOy4bHjUTAJvWlmD3zUgLARo2T/C0GaJ29lIL2WBTAArQdBwCGTDEbHmcjIU06X/Yf9KWYfeG1J3YdAWza+5QWpUC7bCc5Tdl1aQIKPEfbcQBgqNQZ4HFqLzQ951zK1lC/cXrJw1mAzZsk+W88/IY2Okp5OGMSCix6T6+i7TgAAADNWXrhUF+K2VOvPQC0xlnKw28FbWif3STfUzopADxH23EAYGhjH+ChSgQ0yM5sBu1ABACtmgDux24uaKtPKQtPdLYBFplvj6PtOAAwjHEPAKu19MKh325vb/vyzd96/UnymwgAWmUnpYPKniigla5SilRTUQAL2E9pP+6+DgD00R+xOxseo/5Gk/4vyWyZf7DVo2/eCnESu4sA2uY62pNCm+0m+ZbkWBTAArQdBwD6PtYBYLVmy/6DPhWz3WhIyk4BANrlrj2pB9/QXh9SdmdbGAgsel/XdhwAAPpPzYUmvehIyj4Vs2feAwDQauOUB99AOx3UY+pKFMACJvX14lIUAEAPGNPA4yx6p0nXL/lHitm4sAKwTpPYyQVttp3SdvxEFMACtB0HAPriWgTwKDuzaXoOuTRtxnFhBWDdJikPvhW0ob3e1ePrkSiAZ2g7DgD0ZUwDPGQDIRu/1m4NPQAAYCPudnJp4wXttVf/rB6KAljAxL0dAOgwm+XgcSMR0KDpS/6Rndm4sAKwyXt3FQ+9oc22k3xJaTtuNTaw6L1d23EAAOiHkQjYNDuzcWEFYNP37yoeekPbvUtZPetIF2CRe/s42o4DAN1isxw8biQCGjR9yT/a6lkI594HANA5dw+9FbSh3fbqScdYFMACJtGBBQDoDpvl4HG7IqAhL17s3LdithsOdgsBdNc4yV9igFbbTnKaUqTSdhx4zl3b8b9FAQC0nNoCPGTeT9PzwxfZEgQ9sy0CgE47SWlLCrTbUT32tpAQeM51kvdJ/httxwGA9lJbgIfM+WnS7KX/cEsQAEDLTJL8EQ+8oe12k3xPKVIBPOcs5WGYtuMAAADDM3vpP1TMpo+sFgLovru2pFeigNb7lFKk0n4MWGTOvh9txwGAdrHYDh5XiYCG54MvophNH3mQCtAPdy2MTSqh/d7kfhEKwHO0HQcA2sR52QCrN3vpP1TMBgDaPqGsknwVBbTebpJvSY5FASxA23EAoC0Us+FxlQho0MVL/+FWD8MwEcYFFqB/k8rDJJ9FAZ3wIck0uuUAz5tF23EAYPMuRACwci9eOLQlDACgI8ZJPooBOuEgpUhViQJYgLbjAADQPvsioCGv2ojcx2L21Hti8OwCAuiv4yRvxQCdsJ3SdvxEFMACzlIWrgEArJud2fD0vB6a8KqNyFvyo4esFgLot0mSP2P3FnTFu5SHQyNRAM/QaQ0AMAaBdlBnoUnT1/xjO7MBgK7e76soaENX7KUUtA9FAQAAtIxiNjykAy6tuc46MxsXWQC66m6n56UooBO2k3xJ6a5gvAYAALSFNuPw0EgEtOU6uyUQemhPBACDcZ2yQ/tcFNAZRyndFbQsAwAAgHYaiYAG2Zn9iCvvCwAY1GCoSvJZFNAZeykF7bEoAACADdLtDR43EgENsjP7ETPvCxdaEQAMzjjJRzFAZ2wnOU1yFm3HAQCAzXBsKTxuJAIa8uoNyH0tZms1jgstwDAdJ3krBuiUN/X4XdtxAABg3RSz4XEWndOU2Ws/QF+L2W5AADBckyT/TXIjCuiM3STfk7wXBQAAsEY2xsHj9kRAW66zdmbTV3b2AAzbWco52gra0C2fou04AAAAQF+8egOyndn0lQegANy1Lb4UBXTKm5QWVJUoAACAFbMxDh4yH6dV19m+FrOn3hsAQO4LYgra0C3bSb4lORYFAACwQjbGAbT8OrvV43C0FR22SgQA/DBg2k/yWRTQOR9SFqrqugMAAKyCYjY8VImABk1f+wH6XMzWHgQA+NE4yd9igM45SOmycCgKAACgYeoIAC3X52K2FVUAwM/eJ3krBuic7SRfkpyIAgAAAFZqXwQ05LyJD2JnNn11IAIAnjBJKWg7kgS65109zh+JAgAAeKVLEcCjHPVFUxrZeNznYvbMewQAeMIk5fwfBW3onr2Ugra24wAAwGvo7gqPszObpjSy8Vgxmz6zegiA5wZTVazEhi66azs+MeYDAABeSDEbnp5zQxNmTXwQbcbpM6uHAFhkvFBFQRu66ijJ1LgPAAB4ATUEeGgkAho0a+KD9LmYbVUVALDomKFK8lkU0El7KQXtsSgAAADgVUYioEGzJj7IVs9DssvKRRcAFnGdUghT0IZu2k5ymuQs2o4DAACLsTMbHhqJgAbNmvggfS9m253togsAyxgneSsG6Kw3KQ+ktB0HAACeo34AD41EQEMa23Dc92L21HsFAFjSJKWgfSMK6KTdJN+TvBcFAADwC4rZ8JBuZ7TuGmtnNn02EgEALzRJOUdbQRu661O0HQcAAJ6mzTg8pNMZrbvGbgmKHhuJAIBXjiOqJFeigM56k3I+UyUKAAAAgLWxM3tBM+8VAOAV7s7evRQFdNZ2km9JjkUBAADUzPPhcQcioCHTpj6QYjZ9ph0GAE24TtnV+VUU0EnnSf5KaTkOAABwN9cHoAPX2d8HENZVkl3vmUHaFgEADQ6+DlPO0j4SB7R+/H+WsgJ4Gg+pAACAx+f5wLxKBDSosaOgh1DMnkUxGwBoxrgeiH0SBbTGTUrR+q6APRMJAADwjAsRAKzMTZMfbAjF7Ivo8T9kVRrsyw8ASU5SVnCfigI25jLzu68BAACA13F0K01pdMHQEIrZ2oUAbRsQWPkJ3Tepf5ancawFrMNV5ndfG+MDAACv4fkcPLQjAhoya/KDbQ0gsKn3DNAid2fuAv2Y+FZpuG0O8D9fk/yV5I8ko5Q2/2dRyAYAAF7PvAIesjObpsya/GC/y5Oeq2JBA+1zlPJQ/tDAGTrvov55nibZEwe8ymXu24afiQMAAFghz+TgITuzacqsyQ82hGL21HsGaKGD+vpUGTxDLybAVUrx7UAcsLCbzJ97PRMJAACwJtqMw0MjEdCQWZMfbCg7s2/iPMuhspKINg+U9+qLemUADZ13V9CepHRfAB53nvud1+59AAAA0B67IqAhjT7z+X1AodkpNUzOeKBtft6FvZ37Hdoe6kP3jVMWqXwQBSRJrjK/+1o3EgAAYNMuRQAPjERAgxp9/jOUYvYsitlAe20n+Z7kbcquTqDbjuuxx6koGKCbzJ97PRMJAADQMhbZwkMjEdCQ86Y/4JCK2bgAQ9udprTGPxEFdN6kHn+cxVEn9N9l5ndfAwAAtJliNjzkyFZaa0htxhkmZzzQNtNn/vxTSnv8saigFz/vVf1fBW365Crzu689CAIAALpEvQAecmQrTZk2/QGHUsz2gA3okqOUlXBj1y/oxQR5VA/i9sRBh33NfQHbgx8AAADoFzuzaUrjNQ07sxmCUbSap3ve5H5Xp4I2dH8AV0VBm265zPzuawAAgL5QL4CH7MymtdfYrYEEpxA0bCMR0DI3C/69vZQigoEE9GMssp/ksyho8b3pc5K3Sf6vfr++j0I2AADQzzk6AB25xv4+oPDOkxx4DwEtcLHE9eiuoF3FqlHog3E9oHsnCloyPp6mFKzdYwAAgKFQzIaH1M9oSuPPmIZUzHaDGq79rODAeVij7fo9/D7JRBzQee/rQd2pKFizq5TC9bT+ZXwMAAAMkcW8AKtxtYoPOqRi9kXKGbQMz44I6IHt3Be+JuKAzpukFBIn9c83rMJN5s+9nokEAAAA+IljLmnKbBUf1M5sgM1c0F/atuU0peX4WIzQeWf1z/M0Cto05zL3xeupOAAAAB7MmYB5NgTSlJV0vvhdgAxAJQJaZvbKf39U/3csSujF+GQ/pfC4Jw5e4Crzu68t4AQAAHiaORM8ZGc2rb7GDqmYPfMeAnrkqB5kVAbh0IsxSpVSjFTQZhHnud95bcEmAADA4jxHg4fszKYpdma/0sx7yIUYemYvpZBx6BoHvZhMV0lOct99Ae7ctQ6fphSxAQAAeBkLguGhkQhoiJ3ZDbiMHU9D5DWnz4PmvfrjVQbj0IvB3rj+vYL2sN1k/tzrmUgAAACAFRmJgIZMV/FBh1bM1kIE6OO1aDv3O7Sn4oXOG9c/y6eiGJTz3BewLU4CAABYDfMteGgkAtpsaMXsaZIDL/sg7cRiBvptO8m3JG+TTMQBnXf3c3xS/3zTP1eZ331tnAIAALB65l7w0K4IaMD5qj7w77JlIPYfkDXXAAAgAElEQVRjxyrDGDSfpqykOxYzdN4kZcX4NArafXDXOnyaUsCeiQQAAGDtFLNh3o4IaPv1dWtgQU69l4AWWHU7ow+xOxv6dL2oklyKopMuk/yd5M96cniYstt+JhoAAICNzbOBe/sioO3XV2dmMxQjETAwR/X7/tC1D3oxEKxSFuXtiaPV7lqHT1N2X7v+AgAAAG1mZzZNma3qAw+tmG3V1XCNRMAAHaQUVKooqEDXXdc/yycpi1Voj/Pcn3ttrAkAANBeup7BQ3Zm05TZqj7wEM/MvorD7IHhXIv2Uoorh1Fkga67TjKuf6+gvTmXmd99DQAAQHfm1QCsxmxVH/j3gYapmD08Vhcx5GvRbu53aCtoQ/eN65/lT6JYi5vcF66ncd41wCoZqwIAq6SYDQ9VIqAhs1V94KEWsw+8pwbHuQ8M3XaS70neJpmIAzrvpJ6En4piJS5TitdnUVgBWCcPmAGAVTK/A1iNlR7jMNRiNsBQnaYs7jgRBXTepJ6IT1MWrPByV5nffa2YAgAAAAyBrrY0YaXP0oZYzLb6ygUZ2nIt2lSXiE/1z8TYywC9uJZUKUVYx6gs52vuC9gzcQAAAAxiDg3Ms0GCJkxX+cGHWMy208YFGVyLkqP6v+9dF6EXk/H9etC4J44nXWZ+9zUAAADD4hkYzLMJkE4YYjF76mUHSFIK2vspuzoN5qH7E/IqpfX4G3EkSW5yX7g+c50DAAAwdxYBzNkRAQ2ZrvKDbw001Bvvq0GqRAAP7NU3GqvwoB+T8sMknwecwXmSv5L8UU/IxikFfg8sAAAA0GYc5o1EQENW+uxtqMVsNy1g06Yt+loUtKFfxkk+DuR7vUryd5L/JvktZeHaibEeAAAAwLNGIqAhK30W9/tAQ7U7Z5i0zICnbacUtN+n7GIEuu04ySzJac++r5vMn3s981IDAACwgEsRwAMjEdCAlXfDtjObIbHrFH5tO6XwNRYF9MIkyZ/p/vEqlyk7ze9ahx/W39vMSwwAAMCCbHCDh0YioAErr7kOdWf2zHsLMIB+0mnK4o/3XibovGlK6+1pyoKVLrjK/O5rDxwAAAB4LXNLeEg3W5owW/UnUMzGhRk2o+0dIt7VPzNjLxX04nozSikM77X0a/ya+wK2cRoAAACrmBsD8/ZEQANmq/4EQy1mu3ENkzbjsJyj+uemitWr0HXX9c/yWZKDFnw9l5nffQ0AAADA+tj8R1O0GV8RRRmAxeylFJoOY7ck9GH8U6WcN3205s99k/vC9ZmxGAAAAGtmgxvMs/mPpqz8Od/vAw73MlooDM1IBLTMVZLdDnyde/WAvzLwh14YpyxO+bDiz3Oe+wK2awcAAACbZFE1wGrYme3mRYN2RUDLzDr0vtzO/Q7tqZcOOu+4vgadNvgxr3JfvJ4aawEAAAC0ViUCGmJn9gpN044zIwG6YjvJtyRvU9oUA902qQebk/rne1k3mT/3eiZSAAAAWmoqAoDGna/jk9iZzdDsR6tTeK3TlLb9x6KAzjtLWYk7zWIF7cvM774GAAAAoHucmU1nDLmYraA5TDsioGXXoa52iPiQUtAeexmhF9ei/ZQi9d5Pf3aV+d3XFgMCAADQNVcigAfUSmjCdB2fZMjF7Jn3GLBhXS8KHdWDnnEUuKAP46Iq9+3Cp/Uvi/8AAADow5wXmGdnNk1YS11AMZshXqCnYoDGvKl/pqooaEMfBp8mMgAAAAD9ty0CGrCWjTBbAw9Ze5Hh0ToDmreX+zbFAAAAANAmUxHAnJEIaMhsHZ9kS8gABtIN2K2/HwVtAAAAAID2GomAhszW8UmGXsx2DuTwVCKAldlO8j3lDG0AAAAAaIOZCGDOSAQ0YG3dr4dezHa+K0DzTqOgDQAAAEA7zEQAc0YioEvX1qEXs6fea4PjzGzapM8Lak6TTLzEAAAAAACtok5CE9bW/XpL1gzMnggY4sV+Q45SCtoGRwAAAABsylQEMGdfBDRgbZv17MwGYJWO6mutgjYAAAAAwOZ5VksT7MxeoxsRDM5IBLBWeykFbSv+AAAAAFinKxHAAzrY0gQ7s9foQgSDMxIBBtQbGSBNo6ANAAAAwPrMRACwEtN1fSLFbDczwDVoXbbrG9yhlx0AAAAAYO0qEdCAtXa9VsxWzB6ikQhgY7aTfEkyFgUAAAAAKzYVAUDj1tr1WjFbm/EhGokANu40yYkYAAAAAADWxjGQNOF6nZ9MMXvNgQP8ZMgLat4lmXgLAAAAALAiMxHAnB0R0AA7s/scOK1g5RFtMvQFNUf1ddggCgAAAICmzUQAc9RH6Ny1VTFbIWmIFM2gXfZSzi/yswkAAAAAsDqewdKE2To/mWJ2cS4CYEMsqCn26huglYEAAAAANGUqApgzEgENmK3zkylmF4pJw3IgAlrEUQf3tusJRiUKAAAAAIDG7YqABszW+ckUswvFJIB22E7yLclYFAAAAAC8wpUIYM5IBDTgct2fUDG7sDMboF1OkxyLAQAAAIAXmokA5oxEQAPWXlNVzC7szB6eSgQYVLfehyQTMQAAAAAAvNqOCGjAdN2fUDG7mIkAcP1ppaMkZwZaAAAAACxpKgKYsy8Cukgxu5iJYHAUxqA73tSTDz+3AAAAAAAv4/kqTZiu+xMqZt+7FMGgWIEE3bKXciSEn10AAAAAFjETAczxbJUmODN7SOED1CymWcxuyqovgy4AAAAAnjMTAUDjLtb9CRWz701FMCgjEdAiFtMsbru+Xo9FAQAAAACwsAMR8EpXm/ikitkM1UgE0FnbSU6joA0AAADA06YiAGjUbBOfVDHbjQ2gq06TTMQAAAAAAPBLjm6kCbNNfFLF7Hva/A7LSAS0yFQEL3aUUtDeEQUAAAAAtSsRwBzPT2nCbBOfVDH73oUIBmVXBNAbRykLAgzIAAAAAEg2VHCBFrMzmyZspJaqmD3Pai2AbtpLKWiPRAEAAAAAMMdGIJqwkS7XitnzZiIYFCuRGPQNoIf2UlaG+dkGAAAAGLapCGDOSAQ0wM7sFpiJYFCsRGLQN4Ce2q4nK4eiAAAAAABIophNM+zMboGZCAA6bzvJlyRjUQAAAAAM0kwEMGckAl7pfFOfWDF7nt2Rw1KJAHrtNMmJGAAAAAAGZyYCmLMrAl5pY8elKma35IUADK5ZiXdJJmIAAOiMKxEAAECjHLlKEza2IVgxe95UBMAGzESwUkf19d2gDQDA2BgAGIapCOB/9kVAA+zMbpEbEQxGJQIYjIMoaAMAAAAAw+OZKE2wM9uLAcCK7aXs9LESEQAAAKC/HFsC8zwPpQmzTX1ixeyHnJs9HFYj0SaXIliL7ZQd2pUoAAAAAHppJgKA/lxbFbMfsjN7OPZEQItYSLM+20m+JRmLAgAAAADouUoEvNJGO14oZj80EwHAIJwmeS8GAAAAgF6ZigCgUbNNfnLF7Ja9IKzdSAQwaJ+STMQAAAD8P3v3ely3laYL+K2u+b85EQgTATkRaGdgnghIRWB1BO2JwOoISEfQ6ggGjMBkBAeM4JAZnB/YJC1bF1z2BVjreaqmNDUey8BLCbcX3wIAQKF8M5u5TrqqtTJ7YT8Qjq4RAQvRiuBkrpJ8TnImCgAAAIDV60QAX9iIgJlO+plUZfbCfiAAnMRP6V8oUGgDAAAArFsnAnhlKpt9aE/5H1dmf92DCBzIgeqc707KjgsAAAAAQAkM77B6yuyvM53tQA6OO3VSaAMAAACsWysCeNWIgLUfV5XZTnbAMtyLYDE2u/PAtSgAAAAAgBVrRMBMz6feAGX215mQrIfpS+BrNkluotAGAAAAWJNHEcAXGhEw08kH8ZTZC/3BcDSWGQe+5ybJrRgAAAAAVqETAXyhEQEznXwAWJm90B8M4EKbxbiKQhsAAAAAWB8DfcxlMtsPhhN7LwIWohPBol3tzg0u/gAAAACWqxUBfOFcBMzUnXoDlNnf5tsaAPz5wq+NpXkAAAAAgOUzmMM+dKfeAGX2gn84OKADi3OefkL7QhQAAAAAi9OJAF55hsk+WGZ8wVoROKDDkT2IYBU2u3PEpSgAAAAAFqUTAcBePZ16A5TZ3/ZLkjsxADWdFBhsk+RfSa5FAQAAAAAs0FYEzLSIATxl9vddxqRkDSwzDkx1k/7lJwAAAABOrxUBwN4sYgBPmf3jH9I2yaMoimaZcZwYmOMfSW7FAAAAAAAsiO6DudolbIQy+8ee0k9oP4sCOLB7EazW1e7EbqUHAAAAgNMwlAZf8qySIiizh7mPbwuUrBEBsAfvo9AGAAAAOJVOBPAFk9nM1S5hI5TZw90n+SCGIjUiAPbkfHfj5EIRAAAAADiljQiYyTezV+g2Cm3gcDoRFHOR2EahDQAAAHBMrQjgVSMC9mARn0ZVZo93m+Q3MRRF4cRSdCIoxibJ70muRQEAAAAAHFkjAmZ6XMqGKLOnuY5CuySW2gAO5SbJRzEAAAAAHFwnAnjViIBSjqnK7Ok+JnkQAwA/8Gv6VT0AAAAAOJxOBPCqEQGlHFOV2dM9JdlGoV0KS42zBPciKNZVks9JzkQBAAAAAByY55DM1S1lQ5TZ8zwluUzyLAoHdtjTMYVy/ZSkdbwBAAAAOIhWBPDKAB9zLWb4Tpk9X5d+QluhDcCPnO9urFxMAgAAAACHYqCGuRYzfKfM3o/7JNdiWLWtCIAjUWgDAAAA7NejCOAL5yJgpnYpG6LM3p/PST6IAZjpTgRV2OwuBq5FAQAAADBbJwKAMimz9+s2yf+IYZUsuQEc2ybJTRTaAAAAAMD+bEXATIsaulNm798vSX4Tw+pY7hc4lZskn8QAAAAAMFkrAoC9eVrSxiizD+M6lgoGCjhJcDQ/p1/dAwAAAABgDsN7zHW/pI1RZh/OZZIHMayGZcZxkuDUrnY/f8cjAAAAgHE6EcArzxeZy2R2RT/obZJHUazCuQiAhRyL2iSNKAAAAAAG60QAr0xmM5fJ7Io8pZ/QfhYFAAOd7y4WXHQCAAAAAGOZzGaubkkbo8w+vPv0E9osXyMCnCRYiE36CW3nDwAAAIAfa0UArxoRMFO3pI1RZh/HfZIPYnCAh7WdJDipTZL/TXItCgAAAABgoHciYIaHpW2QMvt4bqPQBmC8myS/iAEAAADgqx5FAK8aETDT09I2SJl9XLdJfhPDYvk+LbBU/9idQwAAAAD4UicCeNWIgJnul7ZByuzju45Ce6nORIATBQt2lf77T45VAAAAAMDXeHbIXCazSZJ8zALXnAecKFi891FoAwAAAPxRKwJ4ZQVaijumKrNP4ynJNgrtpdmKAFiB8/QT/C5MAQAAAIA/MgRDcZTZp/OU5DLJsygAGOld+jfkFNoAAABA7ToRwCvPC5mrXdoGKbNPf5LdRqENfOlOBAywSfJ7kmtRAAAAABXrRACwF4vsK5XZp3cfRcRSvBcBsEI3ST6KAQAAAACqp+dgjvslbpQyexk+J/kgBgAm+jXJrRgAAACACrUiANiLbokbpcxejtsk/yOGkzsTAQvwJAImuNqdSxzHAAAAAKA+vpfNXN0SN0qZvSy/JPlNDA72VO9eBEx0lf5tZIU2AAAAUINHEcArzwSZq1viRimzl+c6yZ0YAJjoPH2h7eUcAAAAoHSdCOCV54EUeUxVZi/TZZIHMZxEIwKgAAptAAAAAKiLyWzmWuSqscrsZXpKso0lUk6hEQEL0ImAPdikL7SvRQEArEgrAgDAtQNM0oiAmZ6WuFHK7GX/gblM8iwKqE4nAvZkk+QmCm0AAAAAKF0jAmZY7IrRyuxlu08/oY2DPcAcN0k+iQEAAAAoTCcCeNWIgBmelrphyuzlu0/yQQwO9gAz/ZzkVgwAAABAQToRwKt3ImCGdqkbpsxeh9sotKEm9yLgQK52f77ORAHAd1zEJyoAAADWxPM+5jKZzWy3SX4Tw8FdiAAnDQp3nv4tOxe4ALxo0pfXn3fXIb9HmQ0AwDq0IoAkug3mW+yQ3X/42azK9e7XK1EczEYEQAXO0y/DtY2VAABqdbk7D1zGUnQAAABrZ3CFuRY7ZKfMXp+P6d+wORcFFO05Xq7gsDbp316+jLeYAWpwkbfy+r04AAAowKMI4It7PphjsUNPlhlfn6f0D6EeRHEwWxHgxEElNkn+N5aSBSjR2e74fpt+NY7fk/waRTYAAOXoRACwF4t+Ochk9jo9pZ+ouI/JTQDmu0n/vdRfRAGwatu8TV9byQkAAKCu+0GYqlvyximz1/0Ha5t+aViFNgBz/SN9oX0tCoDVaPJWXm/dFwAAUJlWBAB70S154ywzvm73UTocwlYEOHlQqaskn9MvTQvAMl0m+bS7Vvi/6VfX+CmKbAAAgJr5ZjZzdEveOJPZ6/c5yYf0D7EAJw+Y66f0bzZv03/WAoDTusjb9LXvXQMAwJtOBPDKC87Mcb/kjVNml+E2/UOun0WxFyYSgdqd7y5gLpd+IQNQ6LXoy7Lhl/FAAgAAvqUTASQxlc18ix5qUmaX42P6B19XonDgB9iDd3mb0FZoAxzWNm8F9rk4AAAAGMGAHnO1S944ZXZZrpM0sfwglEB5yBJskvye/nMWt+IA2Jsmb+X1NqavAQBgilYE8HqPCcVSZpfncncSN9HhwM+6+VYxS3Kz+/VWFACTnOWtuL5Mv/oFAAAA7EMjAma4W/oGKrPL85T+IVkXEx5TebgI8Fc3u/PLtSgABrnIW3lt5SQAANivRxHAq0YEzLD4wTpldrl/8LbpJ7QV2gDsy9Xu14+xegDAn53lbenwS9fhAABwUJ0I4FUjAmZY/CdPldll/+Hbpv/WKdMO/i6IOKVWBCzUVd6mDRXaQO22eSuwfeYHAACAUzgTATN0S9/Av/kZFe0+yQcxTNKIAOCbztO/cHEhCqDCa8SPST6nf6Hnf5P8HEU2AAAcWysCeOWelDm6pW+gyezy3aZ/K+dXUQCw54vkNv004r04gEKd5cvp63ciAQAAYGH3rTBHt/QNNJldh09JfhPDKKYNWYJnEbBwm/SF9qUogMKuA3/ZHd/+X5J/pf/EgiIbAACWoxMBvN7DQtHHU5PZ9bje/XolikG8zcQS3Cd5LwYWbpO+6PmQfjUQgLVp0k9db9O/nLMRCQAALF4nAoDZHtawkcrsunxM/5aO7ycAsG83u3PMR1EAK7DN29Lhro0BAABY8/0tTPW0ho1UZtf3h3KbfslED+2cAAD27ef0K1tciwJYmCZv5fVP4gAAgNVrRQAw2/0aNlKZXZ+n9CVDG0sowtJ1scw463OVfkJ7m5W82QcU6SxfTl/73jUAAAAl8s1s5jCZzWLd521CW6H9db6ZzRJ0ImClznfnmG0U2sBxb+BfymsvgwEAQLkeRQCvdBnM0a5hI5XZ9bpPP6H9L1F8lWXYAeYfR7v0pdK9OIADaPLl9LWXNAEAoA6dCOCVyWzmMJnN4n1O8iHJjSgAOIBN+rf7LuNbVsB+vBTX23j5EAAAALzYzRy+mc0q3KZ/c+dnUfzFWSyPixMJ7OOC+n/Tvzx1Kw5gpIu8ldc/iQMAAIgX5uFFIwJmeF7LhiqzSZKP6YvbK1F84cKFESfmZQpKcrM713wSBfAdZ/ly6fB3IgEAAICvakTADKsZplNm8+J6d+B7LwoADuTX9C8KXYsC+IOL9OX1ZSwdDgAA/FgnAkiizKaSY6kymz96+aaph4hOBACHcpV+8vI6Vh+Amq+xtnmbvvZ9LwAAYIxOBPB6fw3FH0uV2fzRU/oHil08VHQiYAlaEVCon3Z/vrdRaEMtXorrbbw4CQAAAPtwJgJm6Nayocps/uyl0G6j0AbgcM7Tf5flMiv6Pgsw2EXepq99xgYAANinVgTweu8NU3Vr2VBlNl9zn/7h4+9OBAAc0Lu8TWgrtGHdzvLl9PU7kQAAAMDB78VhqtU8j1Vm870/xB+S3DgRwEk9xyoJlG2TvtD+mORWHLAq27xNX1s6HAAAOIZHEcAr9+LMsZrPPyqz+Z7b9IXur6KAk7mP5Vkp3yZvL0/digMWq8lbeb2Nl60AAIDj60QAMNvdmjZWmc2PfEq/3PZVhftumXGA47qJMhuW5qW4voylwwEAAGAptiKgFspshrje/VpboW3aCACozUXeymsrgwAAAEvTigCgrmOpMpuhPqZ/uOkbDHBcXZQJ1OUi/fL6wHGc5W36ehvT1wAAALAGVpZljqc1bawymzF/sLfp39aoqdB+2Wc4lU4EVOZMBHCU65uXAtuLigAAwJp0IoAknqExz6qGiZTZjPGUfsnxNpbgBgBYiyZfTl+7jgMAANaqEwEkMZnNPCazKdp93qaVa3gQ6u0mAGCN1y/bvE1gWzocAAAAyrv3h6lMZlPFH/LrJP+qYF8vknz2I8dJBYAVXLNs05fX78UBAAAUqhUBJOlXYYMpHte2wcpspvqc5EOSG1HAQT2JAICvOMvb0uGXsXQ4AAAA1MQqbEzVrW2DldnMcZt+CujngvfRUh0Ax9WIAL5pm7cC+1wcAABAZR5FAEk8P2Oe1a0Gq8xmro/pC9+rQvfvwo8YwMU4nPDvw0t5vY3pawAAoG6dCCCJ52fMs7rVYJXZ7MP17uDp+4ywf60IAKpxlrfi+jKWDAMAAAD+yoqyzGEym2pdpi/dSlvysvGjBQAO6CJv09deDAQAAPi2VgSQxIqyzGMym6r/8G/TL/VS0hKYJqIAgH1q8uX0taXDAQAAgDFMZjNHu7YNVmazTy+FdhsPZmGfHuPFCoA12+Zt+vpcHAAAAJN0IoAkJrOpjDKbfbtP/6D298JODPd+tJz4Ql2ZTS28WUoJmryV1z+JAwAAYC86EQDMcrfGjVZmcwj3ST4kuSlkfxQrAMfjzVLWeq2wzVuB7QUkAAAA4FDei4CJnta40cpsDuU2/YPdX0UBABToIm/ltZtIgP2xKhYA8C2tCADqu99SZnNIn9I/6L1a+X5cuFBiAScYRQnAaTXpi+tt+hJ7IxKAg3gSAQAAfJNVDZmjW+NGK7M5tOvdr2sutC0zzql5oAdwGi+T19sk5+IAAAA4mUcRQBJ9BfN0a9xoZTbH8DH920IeAgMAa3CR5HcxAAAALEYnAkhiMpsKj6V/83PjCJ7STzQ9rHT7t36EAFAVbzkDAAAAS+SZBXN0a9xoZTbH8pR+yfFnUcBorQioiO/Ds5TrFgAAAJbjXgSQJGlEwERrHThVZnP0C45t1ldoe9MJAOq7ZgEAAGA5vHQMvUYE1HYcVWZzbPfpv6G9Jr71DQAAAABwOsps6DUiYKLVDm8oszmF2yQfxAAu1gEAAABgACtoQe+dCJjIZDaMdJvknyva3saPDBfrAAAAAACciE+iMke71g1XZnNKH5P8tpJtbfy4AAAAAABOwrAHJBciYAaT2TDRdZIHMQDgwpyFeRQBAADAYvgMH5jMZh7fzIYZtll+od34MXFiShVcmMNxdSIAAABYhGcRQBIDIFR6HFVmswRP6QvtJf9lavyYOLFOBAAAAABUyBLjABUfR5XZLMUaCm0AAAAAAIBT2IqAibo1b7wymyW5T3K50G2zfAcAAAAAwPGZzAaYp1vzxiuzWZo2yYcFbpfvt+KiHQAAAACO70kEkMTQHdNZZhz27DbJ38UALtqpViMCXOQDAACw47kY9DYioMbjqDKbpfqU5LcFbc97PxKAo2lEgIt8AAAAdrxsDKayqfg4qsxmya6T/FsMAAAAAABAxXwKlTlMZsMBXSd5EAOkFQEAAAAAFTKZDVYyZLq7te+AMpule0qyzTIK7a0fBwAAAADAUfkMFCizqZgym7VcrFwneRYFAAAAAEA1PBOGXiMCJmrXvgPKbNbiPv1k9CkvXnyTglPyBio1cbzFhT4AAACJJcbhRSMCJlp9t6DMZm0XLh9P+N+/8CPAhTs43gIAAADAkRn+YKrVdwvKbNbmNskHMQAAAAAAFM+AB/TORcBE3dp3QJnNGt0m+ecJ/ruN6AEAAAAAjsan98BUNvN0a98BZTZr9THJb0f+bzZi58QeRQAAAABARZTZ4JN8TFdEp6DMZs2ukzyIgYp0IgBwzAUAAKiIZcYBputK2AllNmu3zfEK7UbcAOBiHwAAAOCItiJgoiJeCFJms3ZPuwP58xH+W+/EDXAU70UAAAAAxGQ2wBxFfKpBmU0pfxm3OU6hDS7eAQAAAOA4fDMbfDOb6Uxmw8L+Ql46aeDiHQAAAACKYHgJemciYCKT2bAwbZIPThoAAAAAAKtnlULoGbJjqraEnVBmU5rbJH8XAwCwBw8iAAAAAE5sIwImKGZ1C2U2JfqU5LcD/d5b8XJCrQgAjsrnHQAAAE7HZDYkjQio/RiqzKZU10n+LQaA1bJ8EgAAANTNC8agzMYxVJlN0a6z/+VBfTMb4DgcbwEAAKBuymxQZjOdyWxYycXONvsttE0KckqdCAAAAACohGXGQZnNdF0pO6LMpnRP6Se0n0WBkw8AAAAAACti9UKm6krZEWU2NbhPP6G9j0LbiQMA6tGKAAAA4GRMZoPVYpmuK2VHlNnUdOHzcQ+/z7koAQAAAAAOzjezwYAd03Wl7Igym5rcJvkgBlbuQQRUohEBAAAAVMtnI6FnwI4piuoRlNnU5jbJP2f+Ho0YOSFvpFILx1oAAAColyXGAaYrqkdQZlOjj0l+m/HvNyIEAAAAAAAOaCsCJmpL2hllNrW6juWaAYDv60QAAABwEiazAUiizKZu20wrtC9Exwm1IgA4mk4EAAAAJ+FTe6CLYLq2pJ1RZlP7BdE2yfPIf+9MdAAAAAAAB6PMBl0EjqFJlNkwtdAGwMU6AAAAcBiWGQeT2TiGJlFmw8tf6ksnEFbCW6m4WAcAAACA8hn2YIrihjeV2dBrk3xwAmEFvJUKAAAAQOk8A4OkEQGOn8ps+KPbJH8XAwBQ6sU/AADASlidEJJ3ImCCrrQdUmbDlz4l+e0H/z/vxQQAVfDwBAAA4PieRQCmspmsKwtJEGYAACAASURBVG2HlNnwV9dJ/i0GnIgAAAAA4OiskgXKbBxDXymz4euukzx855/7bjan0okAAAAAAKBoOgimKm6lQWU2fPsv+zbJ4zf++YWIAA7KJx0AoN57MQCgbiazQQeBY+grZTZ821OSy/hGCwAAwLF4eA0AeLkNTGbjGPpKmQ3fd59+QvvZiYQFeRABwNHciQAAAOColNlgMptpinyOpcyGH7tP8tGJBBf0AAAAAHBwVmoBmKbI7kCZDcPcJvkgBgAAAAAA4MDei4AJinwZSJkNw90m+W33vzfiAAAAAADYO5PZANOYzAZynb7QbkTBCbUioBI+6QAAAAD18Yk9aueZGFOZzAaS9IW2twMBDu9MBCyAhygAAADH8ywC8EyMyboSd0qZDdN8FAEAVMELbAAAAO7B4JhMZjNVV+JOKbMB1seUIAAAAABAmUxmM8VjqTumzAZYH2+oAgAAAFAiz70gaUTABF2pO6bMBgAAAAAAlsCKhKDMZppiXwZSZgMALtwBAACAJVBmg2diOH5+QZkNsD6dCHDhDkdjiTsAAAD3YHBM70TABG2pO6bMBlifTgQAR2MqAAAAADiWMxHAl5TZAAAAAADAEpjMpnYXImCittQdU2YDAAAAAABLYHUsamcymymeS945ZTbAOj2IAAAAAICCPIsATGYzSdGrWiizAdbJW6rUwJuoAAAAUA9LjANMU3RfoMwGAJbKm6gsQSsCAAAA4Ei2ImACk9kAAAAAAAAHZDIbYJqu5J1TZgOsUysCAAAAAAris3pgpUKm6UreOWU2AAAAAABwaspsSDYiYALLjAMAAAAAAByQZcapnalspir6ZSBlNsA6dSIAOJpnEQAAAAAHdiYCJngofQeV2QDr1ImACrwXAQthOgAAAMC9FxxaIwImKP4TDcpsAAAAAADg1Hwzm9o1ImCCtvQdVGYDAAAAAACn5PNOoMyGr1JmA6yTZZcAAAAAKIVnXaDMZpq29B1UZgOsk2WXAAAAAADKcSYCJvDNbAAAqFwnAgAAgIMymQ3JuQhw/PwrZTYAsGQXImABOhEAAAAclFUIqZ2pbKZ4rGEnldkA63UnAlzIAwAAAAVQZlM7Ax1M0dWwk8psAAAAAADglCwzDjBeV8NOKrMBAAAAAADgdLYiYIKuhp1UZgOsl+WXAAAAACiByWwAx86vUmYDOFEB8H2tCAAAAA7K0Aa1881sHDu/QZkNACxZIwIAAAAo2rMIIGciYAKT2QAAJ9aIAAAAAIpm9UEwmc00JrMBWLROBAAAAAAAq7cRASPd1bKjymyA9epEAAAAAMDKmcymdo0ImOCplh1VZgMAgJsDAAAA91xwGo0ImKCaF4GU2QAA4OYAAADgVJTZ1K4RAY6d36bMBlgv5QoAAAAAa+cZF7VrRIBj57cpswHWy1ur1GArAgAAAAAKdiYCJuhq2VFlNgAAAAAAcComs6ndhQiYoKtlR5XZAAAAAADAqVh9kNqZzGash5p2VpkNsG53IgA4ikcRAAAA7N2zCCDnImCkql4CUmYDAMCPdSIAAADYO0uMAzh2fpcyGwAAAAAAAI5vKwImMJkNgJMWLMSFCAAAAKBYJrMBxmtr2lllNoALfliyjQgAAACgWAY1qJ1BDvgBZTYAAAAAAHAKymxqdyYCJmhr2lllNgAAuEkAAAA4BasOUjuT2Yz1XNsOK7MB1q0TAQAAAADAKpnMZqzqXgJSZgOsWycCAAAAAFbKZDa1a0TASF1tO6zMBgBc1AMAS3InAgCohm9mU7t3ImCkrrYdVmYDAEvXiAAAAACK8ywCKteIgAm62nZYmQ2wbpZiAjgO0wIAAAD75bkWtWtEwARdbTuszAZYN+UKwHF4yAIAAADs05kImKC6Z1TKbAAAAAAA4Ni8NEztLkTABNUNuCmzAQAAAACAY7PiILUzmc1YDzXutDIbYP3uRIALewAAAGBllNnUzmQ2jpsDKLMBABf2AAAAwLFZZhxgnLbGnVZmAwDAj3UiAAAAAPbovQgYyWQ2AE5gAHxVJwIAAIC9MpkN4Lj5Q8psACcwAAAAADg2AxrUzGf1cNwcSJkNAAAAAAAc07MIqNyZCJjAZDYAAAAAAMCBWWmQ2pnMZqzHWndcmQ3g4h+WbisCAAAAAApiMpuxulp3XJkNsH6+LwRwHA8iAAAA2AvDGdSuEQEjdbXuuDIbAACG8fIQAACA+yvYh0YEjNTVuuPKbAAAAAAA4JiU2dSuEQEjVbuihTIbYP1aEQAAAACwIpYZp3bvRMBI1b4EpMwGAAAAAACA4zgTARO0te64MhsAWLoLEbAQlsEDAADYD5PZ1MyzLhhBmQ1QhmcRULCNCFgID1sAAAD2w8vC1MxkNmPd1bzzymyAMihYAAAAAFgDQxnUzmQ2Y1X9ApAyGwAAAAAAOBZDGQCOm4MpswEAAAAAAOA4tiJgJJPZAKxeJwIAAAAAVsBkNoDj5mDKbIAydCKgcI0IcKwFAAAowpMIqJxvZjNWV/POK7MBgDVoRIAbBwAAgCIos6ndRgSM1NW888psAAAAAADgWCwzTs1MZTPWQ+0BKLMB3AQAAAAAAHB4ZyJgpOpXs1BmAzihAQAAAMCxGMqgZo0IcMwcR5kNAAAAAAAci6EMataIAMfMcZTZAMAaWIKJJTA9AAAAMM+zCKhcIwJGamsPQJkN4IQGa3AhAhbA9AAAAMA8XhKmdo0IYBxlNgAAAAAAABye1QcZq609AGU2AAAAAABwDCazqd25CBjBpxmizAZwYgMAAACA4/D5JmpmKpuxvAAUZTaAExsAAAAAHIcym5pdiICROhEoswEAYIw7EQAAAExmGANguE4EymwAYB22IgAAAABgxbYiYKROBMpsACc2AAAAADgOk9kAw3UiUGYDOLEBAAAAwHH4ZjY1881sxvICUJTZAAAAAADA4T2LgMqdiYCRvAAUZTYAAIzRiQAAAGASE4bUzmQ2Y9yJoKfMBnBDAMBwnQgAAACACTYigPGU2QDlsOQIJfPmKgAAAKybQQxq1oiAkVoR9JTZAMAaeHMVAAAA1s0gBjVrRIBj5jTKbAAAAAAA4NAUM9SsEQEjWc1iR5kNUI5WBAAAAAAslGKGmjUiYCQvAO0oswEAYDgPXwAAAICxzkTASJ5B7SizAQBgOG/FAgAATNOJgIpdiIARHkXwRpkNUJZnEVCwRgQAAACwWp0IqJjJbBwvJ1JmA5TF0iOUrBEBAAAAACt0LgJG8Jz/D5TZAAAAAADAId2JAGAwn7n7A2U2AAAAAAAAHMZWBIxkMvsPlNkATnIADNeKAAAAYLROBACDmcz+A2U2gJMcAAAsiRc0AaA8nQio2IUIGKkVwRtlNgCwFmciAIAqeEETAICSeKYFMyizAYC18BYrAAAArFMrAirmmRZj3IngS8psADcGAAAAAAAchslsxrBS1Z8oswEAYJxHEQAAAIzSiYCKNSJghHsRfEmZDQAA43QiAAAAcB8FA70TAY6X0ymzAcpiCRIAAAAAgGVoRMBInQi+pMwGKIslSAAAAABYkjsRULFGBIzUieBLymwAYC22IgAAAABgRc5EwEidCL6kzAYAAAAAAA6lEwEVuxABIzyI4K+U2QDleRQBwEH5pAMAAMBwnQiomMlsxngSwV8pswHcIADgxgIAAADYP5PZjGGA4iuU2QAAAAAAwKG0IgAYxADFVyizAQAAAAAAYP/ei4ARWhH8lTIboDyWIqFUlmUCAACA9elEADCIyeyvUGYDOOHBWmxEAAAAAKvTiYBKGcxgLINqX6HMBgCAcVoRAAAAAD9wJgJGeBbB1ymzAQAAAACAQ7gTARUzmc0YprK/QZkNUJ5WBAAAAAAAJ2UymzE6EXydMhsAAAAAADiETgRUrBEBjpfzKbMBADcBAAAAwCF0IqBijQhwvJxPmQ1QnicR4CYAHGcBAACAk2pEwAidCL5OmQ1QnnsRADjOAgAALEArAir2TgSM4HnTNyizAQAAAAAAYH/ORMBIVgL8BmU2AAAAAABwCJ0IqNSFCBjhTgTfpswGKNOjCAAAAAA4sU4EVMpkNuyJMns9bkUAuFEANwIAAAAALJ7JbMZoRfBtyuz1uEpyLQYA3AjAIjyIAAAA4LssmwswjO9lf4cyez0ektxEoQ0A4CYDAAAAWLKtCBjhXgTfpsxej5cHpgptwMkPAAAAgKXrRADgeDmXMns9/lhMfYplVoHvMzEIAAAAwCl1IqBiOhwcL/dEmb0efyymNuk/Bu9gCAAAAAAAsCwbETDQowi+T5m9Hu1XDoRtFNoAAAAAACxPKwIqpbdhjE4E36fMXrdNktskZ6IA3CxQia0IcJwFAAAAFkxnwxj3Ivg+ZfZ6tN/4v5/v/pmDIwAAAAAAS9GJgEo1ImCEJxF8nzK7DAptAAAAAACWpBMBlWpEwAgms39Amb0ud9/5Z+dJPokI2PE2FwAAAADA8TUiYATP8n9AmV2Wq/Tf0AbwNhcAAAAAp3InAirWiIARWhF8nzK7vD/QCm0AgMPz1iwAAADwNT4Jy1DPIvgxZXaZrpJ8FAMABboQAQthBQwAAIBv60RAxc5FwECeLw2gzF6XdsT/769JrkUGVXsQAQXaiAAAAAAWrxMBlTKVzRhW/htAmV22myi0wYkQAAAAAIBjsKogY5jMHkCZvS7thH/nxsETAAAAAIAjakUA8EOdCH5MmV3PhYNCGwAAAAAA4HC2ImCETgQ/psxen7sJ/84mCm2oUSsCgIOxDBQAAMC3dSIAcKzcB2V2PTZJPic5EwUAK9eIgAV4EgEAAMA3dSKgUoYKcazcM2X2+rQz/t13u39foQ3AmjUiAAAAAGCB9C8M9SCCYZTZ9TmPQhtqYWoQAAAAgGO7EwEVM5nNUJ7fD6TMXp92D7/HeZJbUULxfM8VAAAAAOB4NiJgoFYEwyiz6/VTFNoAAAAAAOxXJwIq1YgA9k+ZvT7tHn+vqyi0AQCmsnQeAADAX3UioFKNCBihFcEwymyukvwiBnDjACtyJgIAAAAAFqYRASP4ZvZAyux12vcU0D+SXIsVitOJgEJdiAAAAAAWqxUBlWpEwAj3IhhGmc2Lmyi0AQAAAAAAprCaIEM9i2A4ZfY6tQf6fW+SbMULAAAAAMBEnQiolNUEGcpU9gjKbP7sswMuFOVBBAAH49tGAI6vAMBfdSKgUiazcZw8AGX2OrUH/L03u99foQ1l8CAQ4HC8RQvg+AoAAC/ORcBAnQiGU2bzNS+FtreIAAAAAAAY6k4EAD/kBd4RlNnr1B7hv6HQBmCptiIAAAAAYEG2ImAEK6qOoMzme86j0Ia1a0UAAAAAwJF0IgD4IZPZIyiz1+tYy7WcJ/ksbgAAAAAAfqATAZW6EAEjmMweQZnNEO+T3IoBAOALnQgAAACAWOGW4e5EMI4ye73aI//3rqLQhjXyhhfA4XQiAAAA+EIrAiplMhsORJnNGFdJfhEDrIpvbwAAAAAAHJbJbIZqRTCOMtsf9rH+keRa/ACckDddAQAAYJk6EVCpRgQMZDXVkZTZTHEThTYAp7MRAQAAACxSJwIq9U4EDGQ11ZGU2evVnvi/f5Pk0o8B3EAAAAAAAFSsEQEjdCIYR5nNHLex1Cs4MQLUqxUBAADAqzsRUKlGBIzQiWAcZbaLgzk26R/iKrQBAAAAAIAanYmAgR5FMJ4ym7leCu1GFAAAAAAA1epEQKUM/OE4eUDK7HVrF7IdmySf4+0jWKoHEVCgRgQAAACwKJ0IqJRuhKHuRTCeMpt9OU9frjtow/I8iYACNSIAAAAAYAFMZjOUZ/UTKLPXrV3Y9pwvcJsAAA7pWQQAAABJPBsGcJw8AGU2+3ae5FYMAEAlLA8FAAAAdXsvAjgcZfa6tQvdrqsotMGxAgAAAICadCIA+K5WBOMpszmUqySfxAAAAAAAUIVOBFTI97IZyqfqJlJmr9/dgrft5yTXfkQAHMCZCAAAAAA4Mc+oGMqn6iZSZnNoN1Fow6k9iYACeesVAAAAluNOBFTKMyqG8px+ImX2+rUr2EaFNpyWN74ADqcTAQAAAFTLZDZDeU4/kTKbY/kUbygBAOXpRAAAAODeiGo1IsBx8rCU2evXrmQ7N7ttVWgDAAAAAJSlEwGVakSA4+RhKbM5JoU2OEkCAAAAAJSiEQEDWWZ8ImX2+rUr295Nktv4jgQcUycCAAAAAA6oFQGVeicCBnoSwTTKbE7hfHdxo9AGYKqtCAAAAAA4IR0HQz2IYDpldhnuVrjNCm0AoASWiAIAALAyIHXySVWGMpU9gzKbUzpP8kkMcBR3IgBwMwIAAHAgnQiokGE9hmpFMJ0y21+CU7tK/w1tAAAAAACAtTCZDUegzGYJFNoAAAAAAOtkRUCA72tFMJ0y21+CpbhKcu1HCQdjGVwAAAAAgP3ZioCBPJ+fQZnNktxEoQ2Hci8CCmMZJ9yMAAAALEMnAoDv8nx+BmV2GdqC9kWhDcAQGxHgZgQAAODkHpN8FgOVMmzB0OMkMyizWaJPTgIAAAAAAIv0mOSfSf47SRNlNvUybMEQnQjm+Q8RFOMuyfuCTgBt+u9NmHYCJ0wAAAAATutlAvs2ntlCYiCP4ToRzKPMZqkU2uCECQAAAMDpKLDh285EwECdCOZRZpejTTmT2S82u4uliyRPfsQAAAAAAAelwIZhGhEwkGPpTMpslu5d3ia0FdoA/PmmoRMDC/C4u2YBAABY6z2NAhvGaUTAQLqtmf4mgmK0Be/b+W7/LNsB07kRwU0DHE4nAgAAYGUek/wzyX/v7q8/xvMjGKMRAQM5ts5kMpu1OE//ZuClKGASb38BAAAA1O0h/QT25yhXYK5GBAzk2fxMyuxytBXs40/pC+1rP24AAAAAgB96SP9M9XOsKgX7ZCVZhrgTwXzKbNbmavfrtSgAAAAAAP5CgQ2Hdy4CBjCVvQe+mV2WWt7wuEr/DRfAMQIAAACAvsD+e5L/SnKR5FMU2XAoprIZyicd9sBkNmv1a/o3Wm5FAeDGARZwY/JeDAAAwJGZwIbTuBABA5nM3gOT2WVpK9vfm1huHMCNA7gxAQAA6mECG2A9TGbvgcls1u5mdzBwQIAfU7YAAAAArI8JbFiWrQgYyDF7D0xml6WteL9N58GPeekDAAAAYB1MYAOsn+P2HpjMpgSb9IX2Nso6AAAAAGCdTGDDOhiuY4hHEeyHMrssbcX7/lJoN7GUMgBwXK49AACAqf6dvrz+7N4CVuNMBAzQiWA/lNmU5I8T2i78wMkT4FisDAMAAIyhwIZ1M5nNEJ4X7Ykyuzx3Sd5XvP/nUWjDt3QioDBbEQAAALASCmwox0YEDOBYvyfKbEp0vrso3IoCAAAAADgRBTaUpxEBA7Ui2I+/icBfjkK9T3IrBgAAAADgiP6d5EOS/0xymf4ZpSIbytGIAI7LZDYlu9r9ei0KSOIbHQAArEMrAgBWxgQ21KMRAe5rjstktr8cpbtK8osYIHEzBXAwnQgAAKA6JrChTo0IGOBZBPtjMpsa/CP9Q+ZbUQAAB9CJAAAAqmACGzgTAQNYJXWPlNnlaUXwVTe7X29FAVCMCxEAAABwQM/pi+s2Cmyg53kUQzhf7JEym5rcpJ+cakVBxe6SvBcDhdiIAAAAgD17KbBf/gfgj0xmM4TJ7D1SZpdJWfVtn5NsHUgAAAAAgB0FNjDUuQgYoBPB/iizqc0m/WT2NgptAAAAAKiVAhuAQ+lEsD9/E0GRWhF810uhbTkQauRbHQCH8SACAABYvOckvyX5P+mfDV5HkQ0MtxUBAxmm3CNlNrVSaOMkCsA+eVkIAACWSYENwLF5TrRHyuwytSIY5DwKbYC1a0QAAADAnyiwgUO4EAEDWL1vz3wzm9q9FNpOQgDr1MQ3aAAAAPANbODwDMYxhKnsPVNml6kVwSjnSW7Tv6EJpetEAAAAABRCgQ0ck6E4hmhFsF/K7LIv5DZiGOxq9+u1KChcJwIAAABgxR7TF9e3Se7FARyRyWyGMJm9Z76ZXS4XcuNdJfkkBgBgglYEAABwMI9J/pnkv9N/bupjPP8Ejq8RAQM4P+2ZyexyefNjmp93B5pbUQAAAADAyZjABpbmnQgYQD+3Z8rsct0n+UkMk9zsfr0VBQVqRQAAAAAslAIbWKpGBAzk/LVnyuxyefNjnptdhp9FAbBo23hJAwAAYM0U2MAaNCJg4DmNPVNml8uF33y36UsSWQIAAADA/iiwgbU5EwEDdCLYP2V2uUxmz7dJP+23dVFNYZ53f74BcLMCAADHosAG1uxCBAzQiWD/lNnlckG4Hy+F9oWDEIUdH96LAcDNCgAAHJgCGyiFyWyG6ESwf8rsspm+3I/N7qJ7GxPvAAAAAPA9D+mHQ26jwAbKYTKbIZz3DkCZXf5fGtOX+3GetyXHFdoAAAAA8OYhfXn9OabSAKiX/ugAlNn+0jCcQptSdPGiC+XwViwAAMBpKLCBmnieyhCtCPbvbyIomuUM9u88yScxsHJuMCmJ7xUBAAAcz0OSvyf5r/QvF3+K5wwAwAGZzC6b6eHDuNr9ei0KAGDHS4QAAJTKBDZQOysDMsSdCA5DmV02D1UPR6ENAPyRlwgBACiJAhvgjZUBGcKzoQNRZvuLw3RX6b9/cCsKVsaLLgAAAMCfKbABvs5kNkN47n4gymx/cZjnZvfrrShYES+6AAAAAIkCG2AIk9kM4bn7gSizy/ecZCOGg1JoA5xOIwIAAIBRFNgA4zQiYAADpgeizK7jL897MRzcp13WDlYAx/VOBAAAAD/07/TldRsFNsBYjQgYwPn1QJTZ5bOswXFsdjcD2yi0Wb5WBAAHcRcvEQIAsBwvBfbneEYIMEcjAgboRHAYfxNB8RSrx/NSaF+IAgAAAIAT+HeSD0n+M8ll+uXEFdkA81gZkB95EMHhmMwun4vV49rsbhK2sgcAAADgCExgAxzOmQgYwPn3gJTZ5TOZfXzneVty/P+zd4fHbVvruoDf6zn/xVRgngqkVCCeCsxdgegKrFRgpwIrFYipIHIFoSswVcGGKohUwb4/FrilOLZFSSSxADzPjEYzd+7ZgV+KJIAX61s+wKjVXcrDFwAAAED/KLABDsMkVrahi9sjY8aHz8lsNzaFtqe28OUK++ezFgAAGAMjxAEOz30ntuH7eI+U2cOnsOrOcZILMQDsnSdkceECAMBQKbABuuW+E9tYiWB/jBkfB+OEu3PW/l6IAgAGb53kjRgAAHghI8QBAFrK7HFYJzkVQ2cU2tSo8bkAAAAAVbhLWdGlwAaoz0wEbGElgv1RZo+DE+DunaU8VGDsOLVoRAAAAACduct9eX0lDgDo9Xc6e6TMHgcjL+vwMeXBgqUoAAAAAEZHgQ3QP/bM5jFrEeyXMnscrMyux2X7eykKAAAAgMFTYAP025EIeEQjgv1SZo+Dp0Lqctm+Jl4XfC7AbsxiXxp8tgIAUA8FNsAwWJXNNhoR7JcyexyszK7PKqV8cdMbnwsAPlsBAOg/BTbA8ExEwBYaEeyXMnscFKb1OYpCGwAAAKDPFNgAwzYVAVtoRLBfyuxxnVzb26EuR+2Fzkms5AIAAADoAwU2wHhMRcAWLFjcM2X2uN5Mp2Kozuvcr9BWaHNIKxEAAADAVhTYAOM0FQFb0O3smTLbm4nuHUehDQAAAFCTm9yX1ytxAIzSVAQ84loE+/dKBKNhzEHdjpMsxQDwLCcioBIrEQAA9NpNkt+S/JxSYJw7xwMYtYkIeIQFigdgZbY3FPV4k1JoL0TBgdyl7N0OLiwAAICx2qzAXsZiEAD+7lgEPGIlgv1TZo+Hk/F+OGt/L0TBgT4XTsUAAADAyCiwAXiMxRNsw0LSA1Bme0NRn7MkTZIPogAAAADYCQU2AE9hWzu24ZziAJTZ3lDU6X1Kob0UBQAAAMCzKLABgH2ykPQAlNnjYn/cfrlsfy9FwZ40MWYcwPkWAMCwKLAB2IWZCNiCc40DeCUCbyqqdulLkz1qRMBATEWA8y0AgFG7SfJbkp/b64Nz52UAwAHOPzgAK7PHxbiDfrpKKbRdhAF822sRAADA6FwnWcUKbAD2w57ZPKYRwWFYmT0uTuz76ai9OPPlCQAAjIVVDsC3XCf5Jcn/ptwnsQIbgH2ZiIBHOAc5EGX2uFiZ3V+bQtsXKLu0EgEAAJVqRAC0vi6wL3xGAHAAFpfxGJ3bgRgzPi6eEum3TaE98yEJAAAADNh1yvjwqyiuAejGkQh4hM7tQJTZ46IA7b/jKLQBoPYLmVMxAAA8mQIbgFpMRcAWdDQHosweF0+JDMNxe2E3EwW+bOG/Jv6m8dkKANA7CmwAajQVAVtYieAw7Jk9PnciGITT9mIPXsIDLgyJfYwAAKAf7IENQO2mIoB6WJk9PkZfDsdZ+3shCgAAAKBiVmAD0CdTEfCIzyI4HGX2+Bh9OSxn7UXgB1EAAAAAFVFgA9BXExHwCF3bASmzx2ed5I0YBuV9e1G4FAXPcJPktRgAAADYgU8p5fUqCmwA+st2djzGFp4HZM/s8fG0yDBdxrhxnqcRAcBOrUQAAIzMpyRvk/yUZJ7ysL1rTQD6zMpsHuNc54CszB4fT4sM12XKwwpXogAAAAD2aLMC+yoWTgAwPMci4BGNCA5HmT0+LjCGbZlkFg8tAOMzixWxAACwTwpsAICiEcHhKLPHR8k5bEcpZc7Ma80TPhNOxQAAAMA3KLABGJuZCNhCI4LDUWaP011K6ckwbQrtEx+obMHNCAAAAB5SYAMAfN+1CA5LmT1OVmIO31F70Tlz4QkAB+V7FwDoIwU2ABQnIuARzpUOTJntjcZwHed+5LjXHAAOwzYfAEBfKLAB4J8mIuAR7v0c2CsReKMxaJtCG77H3wcAAMA43KUU2G+T/JRknmQZRTYAPGRlNo9x7nRgVmZ7ozF8x+3F6UIUgAsNAAAYlbvcr76+EgcAPMrKbB6zK/xArQAAIABJREFUEsFhKbPHycrs8Tlrfy9EAbjQAACAQVNgA8DzTUXAIywYPTBltjca43HWvvbnosDnAQAAwKAosAFgN16LgEdYMHpgymxvNMblXfv6L0WBzwOAvblx8QsAHIACGwB2ayoCtjj/4sCU2eN+wx2JYZQu299LUQDAXjRRZgMA+6HABoD9mYqAR1gc1gFl9rjfcKdiGC2FNgAAAPSDAhsADmMiAh7RiODwlNnjZZ9cLlIeavAkEcbhMgRTEQAAMCAKbAA4vBMR8IhGBIf3SgSjpcDkKMnKFzS+gBkID2QAANB3d0l+T/KvlJVhiyiyAeCQrMzmMY0IDs/K7PGyMpvkvtCexQMOAAAAcGg3uV99vRIHAHTKwi8e04jg8JTZ46W4ZOMoZe/sWTzkAAC7sEpyKgYA4Ds2BfYy7s8AAPSJc7cOKLPHS2nJQ8e5X6Htb2OcX8BKFwAAgP1RYANA/dwj5TH6kw4os8fLhRNfU2j7AgYAAGB3FNgAAMPxWQTdUGaP213KiGnYOE5ykWQhCqCHJvFwBgAA3VJgA0A/2S8bKqXMHjejhfmWs/b3QhRADy86VmIAAODAFNgA0H8TEfCIlQi6ocweN6vX+B6F9vi+hN+LAcA5FgCwNQU2AAyLldk8xv2ejrwSwai52OJHzqLMBgDnWADAxk2S35L8nGSa5Nz3PgAMhpXZPMZ5X0eszB43T5HwmMv291IUAAAAjNB1yjSrZdzABIAhm4qAR+jUOqLMHjcXYWxDoe1LGAAAYEyu22vgqySNOABgFKYi4BE6tY4os8dNgcW2LtoPah/WvoQBAACGSIENAOM2FQE/cCOC7iizx02BxbaOUsaqzfzdABWbtZ9VAACwDQU2ALDxWgT8gHPFDimzuUspKuExCm0AcIEDAH2nwAYAvjYRAY/QiXTolQi8AUXAExy1F/y+3IfHmBSA3WlEAABVuU7yS5L/TXKSspWW72sAYONEBDzCtr0dsjIbb0Ce6nXuV2j7+xmOJkbpAAAAw2EFNgCwLYu3eIyFoR2yMhtvQJ7jOKXQ9iUPAABALazABgCew8psHmNhX4eszMYbkOc6TnnKfS4KAAAAOmIFNgAA+7YSQXeszMbKbF7iTcpNA3wZQw08RQsAMA6fkryNFdgAwG7MRMAP3ImgW1ZmY2U2L3XW/l6IAuiYrQ+oyeckp2IAgJ35lLL6+iruZQAAcDgWhXZMmY03Ibtw1v4tXYgCAACAHVFgAwCHYNofP+I8tGPKbJIyIuFIDLzQx/ZDfSkKX8gAAADPpMAGAA5NP8KPWBTaMWU2mzeiMZjswmX7eykKX8gAAABbUmADAF2xKpvHNCLoljKbuFBkxy5TilHlKAAAAN+jwAYAajARAY9oRNCtVyIgSkd2bxVPtAGHNxUBFXFTHgD+6VOSt0l+SjJPmerlOxMA6NJUBDyiEUG3lNnEhSN7cBSFti9kOLzXIqAiHhYEgEKBDQDUbCoCHtGIoFvGjJO42cp+bArtadyo8IUMAACMiRHiAEBfTEXAD1yLoHvKbBIl1hjcpJsVi5tCexY3MAAAAIbqLvfl9ZU4AIAemYqAH9BrVMCYcRJl9hjMU24udOE4pdCeeBkAAAAG4y7J70n+1V7vLaLIBgD6x31rfmQlgu4ps9m4EcGgrVNuLHTlOG5q9IGRKQAAwI8osAGAoTkWAdRNmc1GI4JBm6bcYHjb4TGcJll6KapmZApD4GlanFsBwG4psAGAoXIficesRNA9ZTYbjQgGbdr+XqbchOjKWRTawH6diADnVgCD4EHLbimwAYAxcB8J1yU9oMxmoxHBaCySfO7wv3+W5IOXAQAA+IG1CA5OgQ0AAK5LqqPMZqMRwajM0+3+yO/T7R7efNtKBAAAMCoKbABgzGYi4JFzZSrwPyKg1YhgVG5TCu11kqOOjuGy/b30cgAAABzMXUphvfkBAAD+yarsSiiz2WhEMMrXfJbkS4fHcNkex8rLAQAAsDc3KcX1KgpsAIANe2bzI40I6mDMON6U4zD7zv/7Osnbjo/tyklDNW5FALAznt4FoGs3SX5L8nOSaZLzKLIBAB6aiIAfaERQB2U2X1/oMj7LlBscXTlKWR2g0O6e4oUhmImASnhACICuruu/LrCd5wMAfJt70vyI8+hKGDPOQ02S12IYpfOUp9DOOvrvbwrtadz8BwAAeIrNCPFl3HADAHiKIxHwA7qKSliZzUONCEbtPMl1xycOqxjtAgAA8BgrsAEAXmYqAh7h/LoSVmbzUCOCUbtNGc/bpLsn0o5TCu1ZPPXkMwAAAHjICmwAgN2YJ1mIgUfoKCqhzOahRgSDNX3Ch/MspVDuutC2X4nPAIC+u4uRZQC8jAIbAGA35g9+XKvzmM8iqIcym4caEQzW9An/f9cpT6X90eHxHqfcrFl46QDosXWSUzEA8EQKbACA3ThJucc8T/JaHNBPymweakRA6yrJL0k+dngMZ+3vhZcDeOJFCgBA3yiwAQB2Q4HNLqxEUA9lNg81IuCBi/aL/6zDYzhLGX1+7uU4mOuUlfHQVxMRAAA9OvdeppTYrscBAJ5Pgc2u2S+7Ispsvnbjw54HFu2JQJfl5ruUlQlLL4cvaQAA6DkFNgDAbkxTFkEpsNkH05Iqoszma40Pfr4ySxmp0WWhfdn+Xno5AACAnlFgAwDsxjSlvF7EdEn2y3l7RZTZfOsNeiqGwXnJa3rbnhyskhx1+G+4bI/lyssJgPMqACqnwAYA2I1pFNgcnnP4iiiz8QZlG+v2hOHPjo9jmbJS3IiP/VlF8QLgvAqA51BgAwDsxjQKbLpzI4K6KLP5mgtuvmeV5G3uR3534ag9jlkU2sD3L3YAAA5FgQ0AsBuT3BfYFtvQJef1lVFm403KUyyTnCR51+ExbArtE3+vwDe8FgEAsGcKbACA3dgU2PMkb8RBJSykq4wym6+5EOcx5ykrH7s8uThKuXE0S9lHm92RJwAA/JMCGwBgNxTY1M498soos/mai/Lhmu7w9V2krI7ucr+S49yPHPflsjueOgMAgOJTe82hwAYAeBkFNn3iHnlllNl8y02MaR2iaXZ3A+a2PfFYp6yS7opCGwAXPwDs0qeU8vrKNQYAwIvNH/wciYOecB1QGWU239JEmc12fyezlDK560L7ImW1OAC4+AHgqRTYAAC7o8Cm71YiqIsym29pkpyKgS2sU/bQvuz4OM7a3wsvyU7e/9B3k7gRDQD8mAIbAGB3FNgMxZ0I6qPM5lsaEfAEy5QR5u87Pg6Ftvc/bJzEE5QAwD8psAEAdmeWci9Wgc2Q2DKuQspsvqURAU/0IaXQPuv4OM5SCqyllwQAAIgCGwBgl05yX2DbqpQhcs1QIWU239KIYJBm2e9KxUV7MnPc8b9zM/J86SUHAIBRUmADAOyOApsxsTK7QspsvqURAc80az/suz6pUWi/zHW6fygBYAhWIgA4GAU2AMDuKLAZq0YE9VFm483KLt22JzirdL9PykVKse5Jque9jgAAUDsFNgDA7kxTCuxFFNiMVyOC+iiz+Z4bX1g807o94fmj4+M4SinVZ1FoAwDAENzlvry+EgcAwItNUxYnLWJSIyS6hCops/meJspsnu8qydvcj/vuikL7eaxqoe9mMd4ZAIZCgQ0AsFvTKLDhe9wbr5Aym+9pkpyKYXAnKYe0TCmUzjr+dx89OBZfRNtZJ3kjBgAAOrRqz0sV2AAALzeNAhsecy2COimz+Z5GBIM8YTm0Rfvf7frBiOPcr9BWaANwSLZuAXielQgAAF5kklJgz2PhCmxDd1CpVyLgOxoRsCPz1PFE06bQnnhJAHBOBQAAwABNUhYYXSX5K2UbSEU2bGclgjops/meRgTsyG1KoX1XwbEcJ7nwknj/AwAAAMBAKLCBQTNmnO9pRMCO/55mSb5UcCybPbwXXhbvfwAAAADoqUWMEIddWomgTspsvqcRATu2TvI25cnArim0YdhORAAAAAAM0PzBz5E4YKfsmV0pZTY/cpPktRgG47SCY1imlEzvKjiWs5SC3dhxGJ6JCAAAAICBUGDDYaxFUCdlNj/SRJnN7p2nFE1nFRzLx5SnrZZeFl/aAHv8TD0VAwAAAE+gwIbDuhFBvV6JgB9oRMCenCe5ruRYLmPc+NeMUwHwmQoAAMBhnaQsurlN8kfKYiBFNhxGI4J6WZmNNy9duE0ya//Gajghu0xZOWdFMgAAAABwKCcpC23mMSUVutSIoF5WZuPNS1c2hfZdJcezak8eAQAAAAD25STJRcr99y9J3kWRDV1rRFAvZTbevOMyrex41qlnxPdRFNoPfRYBPusAAAAAdkKBDXUztbViymx+pBHB4EwrPKarJL9UcixH7fFM/KlAr7kYBAAAALo2TXIeBTb0wa0I6qXM5kcaEXAgF0l+r+RYXqes0FZoA7ALKxEAAACMxjSlwF4n+XeSj1FgQx9YmV0xZTaPuREBB7JIcl3JsRxHoe1JNAAAAAB43DT/LLCPxQK94n54xZTZPKYRAQc0S12F9nLEr4Un0QAAAADg2yZRYMNQfBZB3ZTZPKYRAQd0m7JC+66S43mTcRfaAAAAAEAxSbl3eZXkryiwYSisyq6cMpvHNCIYlFkPjnGdZF7R8ZxFoQ19vcAEAAAAeImvC+zLlAUwwHCYUlo5ZTaPaURAB1ZJ3lZ0PGdJPnjvQ6+ciACfpwAAADyDAhvGxcrsyv2PCHhEIwI6skwpo95Vcjzv2/fD0nsfAJ+nAAAAgzNPKbEV1zAuVmZXTpnNYxoR0KHzJNOKTiAv299LLw0AAAAA9N78wc+ROGCUGhHUTZmNNzG1W6SMHT+u5Hgu2/fFyksDAAAAAL2jwAYeakRQN2U227hJ8loMgzDt4THfJpm1Xyi1nFxetcc05PEjRqsAAAAAMBQKbOBbbkRQv1ciYAuNCAZj2tPj3hTad5Ucz1HKyuyTAf+t3Hq7AAAAANBjJ0kuUu5z/ZHkLIps4O8aEdRPmY03M32xTtlDuxabQnvipYEqzURARa5FAAAAcBCbArtJ8iXJuyiwge8zobQHjBlnG40IqMQyZXX5+0qOZ1Noz2IlMwDf5zsCAABgf06SLFJGiNsuE3gK92x6wMpsttGIgIp8SPJ7RcdznOGu0P7szw0AAACACn1rBbYiG3iqlQjqZ2U222hEQGUW7QnrcSXHc5zkKsYaAwAAAMC+TFNWXy9Sz31BAPbMymy20YhgME4H9G+ZJbmpLNulPzEAAAAA2JlpkvOUfW3/neRjFNnA7qxEUD8rs9lGIwIqdJvyJOYqZe/qGpy1vxcDyhgAAAAADmkaK7CB/bsTQT9Ymc22bkRAhdbtiW1NzlL29R5KvtBXJyKgIisRAAAA/NAkpby2Ahs4FPe/e0KZzbYaEVCpVZK3lR3T+wxndTb0+SIYAAAAqPvafZHkKslfSS6jwAYOx2TSnjBmnG01GdZ+ywzLMmUP7bOKjunywbEBAAAAAKXAnrc/b8QBdMjK7J5QZrOtRgSDMR3o67lo/201PXRxmfJ015X3PQAAAAAjpcAGatSIoB+MGcebenymA/63zZNcV3ZMy/R3717vewAAAACea55yb2wzQlyRDdSkEUE/WJmNNzVDctueJK+THFVyTEcp+3rPYmwJwJi/nwAAAMZg/uDnSBxAxdyv7wllNttqRECP/lZnSb5UdEybQvvEewkOZioCXBwBAAAchAIb6COLD3rCmHG21YiAHlkneVvZMR2l7J096VmO0FevRQAAAAB7sxkhfpvkjyRnUWQD/XEtgv6wMpunuIlygP5YpqzMfF/RMR3nfuR4H5768mQaAAAAABsnSRYpRbb7xECfuffdI1Zm8xSNCAZhNqJ/64ckv1d2TJtCGwAAAABqd5LkIuXe8Jck76LIBvpvJYL+UGbzFI0I6KHz1Dcy5Dhl5Xgf3PkTAgAAABgVBTYA1TBmnKdoREAP3aasRm9S1749Z+3vReX5rZOc+jMCePFnKQAAQM2mKYtCjBAHxmAlgv5QZvMUjQjoqU2hvUp9hfZte6EA7N4k9r+hnu8hAACA2kxTyutFyiRBgLFwr6ZHjBnnKRoR0GPr1LkK+l3qX50NfXUiAgAAAPibacrCinWSfyf5GEU2MD6m6PWIMpunaEQwmBPWsbpK8kuFx3WZegtt73sAAACAfptGgQ2wcSOCfjFmnKdoRDCYk9cxu0hZrXlW2XFdtr+X3vcAAAAAvNAk9yPET8UB8F+NCPpFmc1T3SR5LQZ6bpFS6td2In+R8oSsEScAAAAAPNWmwJ4neSMOgG9qRNAvxozjTc5YzZNcV3ZMR0lWsc8vwBB9FgEAALAHk5SFG1dJ/kqZ/qfIBvi+RgT9oszGm5yxum1P9O8qO67aCm2rxAEAAADqosAGeD73vHtGmc1TNSJgYF9a8wqP6yhl7+xJBcdy68+EHpuJAAAAgAGZp9wzaqLABngu97x7RpnNUzUi6L1TEfzNKsnbCo/ruD22iZcIAAAAYLQ2BfZtkj+SnKUshADgeVYi6Jf/EQFP1IiAAVqmjPV+V9lxbQrtWTwtBgAAADAW8wc/imsARs3KbJ6qEQEDdZ7kU4XHdZzkosP//sqfBsBOeCgJAAD4kVmswAbYt88i6B9lNk/ViIABWyS5rvC4ztqLGQD6ay0CAADgKycpixiaJH9GgQ2wbxYb9JAx4zzHTZLXYmCgX2Sz9gKitguHs/b3wssEAAAA0FsnKfd35nGPFeDQLDboISuzeY5GBL03FcF3bQrtuwqP7SzdlNl3/izo8Q0CAAAAqOH6dLMC+0uSd1FkA3TByuweUmbzHI0Iem8qgh9ap+yhXaPLHL7Q9rQafTURAQAAAB2ZJvkQBTZATdzr7iFjxnmORgSMwLK96Hhf4bFdPjhGAAAAAOowTRkfvkhyLA6A6jQi6B9lNs/hyRXG4kN7EXJW4bFdtO9F70cAF0sAAEB3plFgA/RFI4L+MWac57CnAGOySHJd4XEdJVnlMHsC+4IH8FkKAADcm6ZsUbdO8u8kH6PIBqjdtQj6ycpsnsNKUMZm1v7d17av0abQnu35fdn4EwAAAABGbpKyAnue5I04AHrHQs2esjIbb/hxmongyX/z8yR3FR7bUZKr9oIK+DvvCwAAAF56XblIuffyV5LLKLIB+uZzkrcp9/jpISuzea7rGJ3DuKzbL7s/Kzy217lfoe1hE7jnewoAAICnsgIboP9ukizbn0Yc/abM5rkUZozRKuUJrssKj+04+yu0bS0AAAAADN0iCmyAvvs9ZZrGlSiGw5hxnku5xVgt2y/EGh23x7drHl4BeLmVCAAAoDrzlHsptzFCHKCvrlMWof2U+60hGBArs3ku5RZjtkgyTXJa4bG9aS/CFl4mAAAAgH+YP/g5EgdAL92klNYXMUZ88JTZPJeV2f02FcFOLnxWqXNP3rP298LLBAAAAKDABhgIY8RHSJnNc1mZ3W9TEezkPTBPebCjxougs/bYLnbwv7XycgMAAAA9c5LkPApsgL67TrnPfRXd1Cgps3kuK7OhjC+ZJflS6fF9bL/cl14qRmwWD2QAAACMxUnKpLp5ktfiAOgtY8T5L2U2z+XpFyjWSd4muaz0+DbHtfRSAXTuLlaEAADArimwAYbDGHH+QZnNS1ynzv2C4dCWKaPb31d6fJcppftLJiooYABebp3kVAwAAPBiCmyA4TBGnB9SZvMSPlTg3oeUQvus0uNbpYxbfm6hrYABAAAAujRNKa/Po8AG6Lu7lEVixojzKGU2L6Hc6i+v236cpzwZXOPEgqO8vNAGAAAAOKRpSoG9iAmRAEPwKaXENkacrSmzeQkrs+Gf74lZypNkNY7k3hTaU+9fAAAAoFLTKLABhuQ6pcBexn1pnuGVCHgBqzvhnzaF9l2lx7cptCdP/L9rvLT01IkIAAAAqjdJmXi3TvLvJB+jyAbos7skvyX5OeX+3EUU2TyTMpuX8MED37ZOeXq4Vsd5eqHdeFnpqYkIqIjPUgAA+Pv12iJl1OxfUWADDMGnJP/K3x9SghcxZpyX8CEE33eV5Jf2QqxGx+0xzrxUAAfTiAAAgJGbpIwQnyd5Iw6AQTBGnL1SZvMSPpT6bRo31fftImWEylmlx3fanmAsvFQAAADAniiwAYbnLvcFtoWP7JUym5e6jvE/fTWNMvsQFm3Wp5Ue39mD4/wRJyQAAADAU8xT7jcosAGG41NKgX0lCg5Fmc1LWZ0N2128rVLvgx9nKQ82fPBeBwAAAF5g/uDnSBwAg2CMOJ1SZvNS69S74hRqcZvyJPKq4gu59ymF9tLLxcBMRQAAALBXCmyA4TFGnGoos3kpT+HAdtbtRd2fFR/jZft76b3OgExFQEVWKQ8PAQBA3ymwAYbpU8oI8aUoqIUym5fyRA5sb5Xkbe5L4xpdpqzQXnmvAwAAAA+cpEyeW0SBDTAkN0kuUkrsRhzURpnNS1mt2V+z/LOwZP+W7cXfu4qP8ar9+1BgAwAAwLhtCux5ktfiABiMu5T7wBdxH5jKKbN5KR9y8HTnKaOP31R6fEcpDzrMvMcBAABgdBTYAMNljDi9o8zmpazMhudZpBTGx5Ue36bQnj54n9+4iAUAAIBBUmADDJcx4vSaMptduE69hRzU6jZl5XOTeveZerhC+7Y9Vhe09M1EBFT22Q8AALWYppTXi7i3BzA0xogzGMpsdsGNWXj+e2eWUhjXWmgf577Qhj5yQ4aauHgEAKBr0yiwAYbMGHEGR5nNLqyTnIqhlxcv1PH+OU9yWfExbgptD64AAABA/0yjwAYYMmPEGTRlNrug4OrvhQx1WKaMQv5Y8TG62AUAAID+mKQU2Oeu6QEGyRhxRkOZzS74oISXu0hykuRMFAAAAMAzbArseZI34gAYpM8pi6OuYqEhI6HMZhd8YMJuLFIKbU9MAwAAANtQYAMM301Kgb2MMeKMkDKbXbAyG3Zn1r6nXosCYLAXoD7jAQB4CQU2wPBtxogvk6zEwZgps9kFK7Nht++neXuCciQO2ImZk34q0kSZDQDA82wKbFuUAQyXMeLwFWU2u3Ido5H75lQE1Vq3F6d/igIAAABGbf7gx0PvAMNkjDj8gDKbXfGEEOzWKsnbJJeiAAAAgFFRYAMMnzHisCVlNruyjpW+sGvLlPHIxocBAADAsCmwAcbBGHF4ImU2u+JDF/ZjkWSS5I0oAAAAYFBO2uv+eZLX4gAYLGPE4QWU2ezKWgSwN4uUUTP2pQcYxjmTaTYAAOOlwAYYB2PEYUeU2eyKldn9NI0nwfry/pqnFCBGjcHTnbhowDkTAAAdX5MsosAGGIPrJBcxRhx2RpnNrliZ3U/TKLP7oknZP/uLKODJJiIAAAAObJrkPApsgDG4SSmvL+J+O+ycMptd8YQR7N86ydskl6IAAACA6kxTyutFbBUGMAa/p5TYV6KA/VFms0vXTtRh75btxfF7UQAAAEDnplFgA4yJMeJwYMpsdskHNxzGh/Zi+UwUAM6XAAA4uGkU2ABjYow4dEiZzS6tk5yKAQ7iPMmJi2aAXp4vAQDQP5PcF9jufwGMgzHiUAFlNrtkpVH/zJKsxNDb99sspRR5LQ74oakIAACAZ9gU2PMkb8QBMArGiENllNnskpVGcFi37QX1KsmROOC7piIAAAC2pMAGGB9jxKFiymx2yVNKcHjrlBFnf4gCAAAAnkWBDTBOxohDDyiz2SUrs6EbV0l+SfJRFAAAALC1+YMfE88AxuE6ybL9sUAPekCZzS754IfuXCQ5SXImCoCqNSIAAOiUAhtgfO5yX2BblAc9o8xm16wO7ZepCAZl0b6mp6IAqFYjAgCAg1NgA4zTp5QC2xhx6DFlNrtmdWi/TEUwyAv0VZJjUcB/TUQAAACjM0t56FuBDTAuxojDwCiz2YfzlEJbmQaHd9terK9crMN/+T4CAIBxOMl9gf1aHACjYYw4DJgym31QpkG31ilPoH8RBQAAAAOnwAYYL2PEYQSU2ezLOmWF9qUooLP34FvvQQAAAAZIgQ0wXsaIw8gos9mnZXtx8U4U4D0IwN8uvI2/BwB4mmlKgb2IAhtgbIwRhxH7f//5z3+kwL6t44Zt1Z8DIhi8qyRvxIDPOqjGKsmpGKjc55RtSwCgS9OU1deLuLcEMEbGiANWZnMQ85RC2/7Z0I1FSnHiwh8AAIDaTaPABhizmyQXMUYcaCmzOYSmvQj5UxTQiduUlVVNPFTCeM1SHuoAAADqM40CG2DM7lJWX1/EGHHgK8psDmWV5Nck70UBndgU2qsotAEAAOjeJKXAnsfWWABj9SmlxF6KAvgeZTaH9CGlTLNHJHRjneQ8yaUoADplTBoAMFYKbAA2Y8SvUiZJAvyQMptD2+yf/VoU1Zg6aRiVZcrNg4+iAOjMOm7eAgDjocAGwBhx4NmU2RzabXvx8kUU1ZhGmT02F0lOkpyJAgAAgD1ZRIENMHbGiAMvpsymC+skv8TKUOjSIqXQPhYFAAAAOzJ/8HMkDoBRMkYc2CllNl2xMhS6N4ux/4zHSZKVGAAAYOcU2AAYIw7sjTKbLp3HylDo0mbs/ypuODB8ExEAAMDOKLABSIwRBw5AmU2XblNGHa9c+EBn1ik3H/4UBcDBNCIAAHroJGVhggIbYNxuUsrrpetb4BBeiYCOrdsLIbozE8HorZK8FQPAwbjYBwD64iRlZGyT5EvKdnGKbIDxuUvye5L/SzJN8sG1LXAoVmZTg2V7cfROFNDp+3AW+9gDAACM3UnKJL15ktfiABi1zyn3Da9SJq0CHJwym1qcpxRp9s+G7ixS9hV+IwoAAIBRUWADsGGMOFAVZTY1maeMHTeuCrqzSBk77sEShmYqAgAA+Mc58jxlgYECG2Dc7lJWXy9T7g0CVEOZTU2a9iLqT1FAZ27jwRKGaSoCAAD4b4G9iIeYATBGHOgBZTa1WSX5NcnvsRsxAAAgAElEQVR7URz0QhYealLG/n8RBcBerEUAABz4ul+BDcCGMeJAryizqdGHlCLtVBQHu6iFr62TvE1yKQqAnfO0OwCwb5OU8noRBTYAxogDPabMplabMcf2bILuLFMedjApAQAAoH6TlPsp8yRvxAFAjBEHBkCZTa02+/Yacwzd+pBSaJ+JAgAAoDoKbAC+Zow4MCjKbGq2TvJLko+igE6dJzmJ0XT020QEAAAM6NxWgQ3A135PWYF9JQpgSJTZ1O4ipUSzKhS6c5uyj73R//SZhzEAAOi7ecoe2ApsADauU+6hGyMODNb/+89//iMFajdJsooiYq+fBSJgCyfte/FIFPisgxdbJTkVAxX7nPIwGwDdmj/4cS0GQFLGiF+llNiNOIChszKbPrhNefJ45cINOrVu34t/iAIAAGBvFNgAfIsx4sAovRIBPbFO2bcX6NZVyl72AAAA7M48yTLlgf4/UrZbU2QDcJ3kbZKfUhaZKLKB0bEymz5Zpow5ficK6JS97AEAAF7uJKWYWERxDcA9Y8QBHlBm0zfnKXv32T8burVIMo39XgEAAJ5iU2DPk7wWBwAPGCMO8A3GjNNH8yR3YtipiQh45nvxWgz0yEwEVKQRAQCMxknuV9d9SZk4p8gGIDFGHOBRymz6qEkp0djthTU81W17ku3hEoDnnc8AAMO+zlZgA/Atd0l+S/K/7ffFMuU+GwDfYMw4fbVK8muS96KATq1TVrt+EQUAADBy05SH7xexPRoA//Qppbi2+hrgCZTZ9NmHlBLNnr3QrXXKOKRLUQAAACMzjQIbgO+7Timwl7H6GuBZlNn03TylSDOqC7q1TBmL9E4UAADAwE2jwAbg++5yX2CvxQHwMsps+u62vYA04hi6d55yU+eNKAAAgIGZpNx/OI8CG4BvM0YcYA9eiYABWCf5RQwvciICdmSRMj4JfNbB4+cvAEDdJu01zlWSv1K2VlJkA/DQdcq96Z9SHnpSZAPsmJXZDMVFSklxJopnX6DDLtym7GXfJDkSBz7r4IeflwBAneeM8/bH1CkAvsUYcYADUmYzJOcphbanpKFbm0J7FYU2AABQPwU2ANswRhygA8pshuQ2ZfzXKgo06No65QGTS1EAAACV2hTYprwB8D3XuV+FbcIWQAeU2QyNAg3qsUxZ4fBRFAAAQCXmD348CA/At9ylrL6+iDHiAJ1TZjNEy5Rx4+9EsTX7yLIv9rMHAAC6psAGYBufUkrspSgA6qHMZqjOU/bstX/2dk5EwB4tYj976jAVARVZiQAA9kqBDcA2blIWY1wlacQBUB9lNkO/cF27aIUqzFKKG4U2XZqKAABg0E5SHqadJ3ktDgC+wxhxgB5RZjNkTXsB+6cooHO3KTeVVvGACQAAsDsKbAC2ZYw4QA8psxm6VZJfk7wXBXRuHQ+YAAAAL6fABmBbxogD9JwymzH4kDLi+FQU0LlVkrdJLkUBAAA8wTTJeRTYADzOGHGAAVFmMxab/bNd8H7biQg4oGXKAyZnogBG7i62XgCAH5m21/OLJMfiAOARxogDDJAym7G4bS+Av4jim9xI59AWSSZJ3oiCA5qIgMqsY3IMAHxtGgU2ANszRhxg4JTZjMk6yS9JPooCqrBIGTvuBhWH4m8NAKBO0yiwAdieMeIAI6LMZmwuUkZqG28M3dtMTFjHdAAAABibSe4LbJNKANjG55QR4lcp95UAGAFlNmN0nlJoe9obutek7J+9ikIbAACGblNgz2PLIQC2c5NSYC9jjDjAKCmzGaPb3I83Vp7dm8QTjXRjnfKQyaUoAABgkNeaCmwAnmIzRnyZcg8XgBF7JQJGalOece9EBHRomeRXMQAjPB8BgCGapDxEfpXkr5QHVxXZADzmc5K3Saa5X4wEwMhZmc2YLVMK3HeigCp8aC9W7GkPjIWJKAAMzfzBj0loAGzDGHEAfkiZzdidp+zXa/9sqOc9aU979mkWT3YDAOySAhuApzJGHICtKbOhXHCvXXRDFW5TysZ1ktfiAACAaq+jFdgAPNXnlAL7KiZVAbAlZTaU8TXzJH+KAqpw274nV3FjDAAAajFL2b9UgQ3AUxgjDsCLvBIBJCml2a8jz+DEnwEVWafcKAMAALq9TrxIKR/+THIWRTYA2/k9yf8lmSb5EEU2AM+kzIZ7H1JG3YzVxJ8AlblK8lYMwICtRABAhR4W2F+SvIstgADYznXKvZyfUhYpuOYB4MWMGYe/2+yf7UId6rBMGWd4JgoAANibk9yPEHc9DMBT3KQsSNg8CAUAO6XMhr/b7NX7RRRQjUXKSKpTUbADJ/FkOABA2nPsRfujwAbgqX5PKbGvRAHAPimz4Z/WSX5J8lEUUI15SgF5LApeyJYKAMCYTdtz64VzawCe4TplBfZVyqIgANg7ZTZ820XK6r0xjTZW8FCz29zvtXQkDgAA2No0CmwAns8YcQA6pcyG7ztPKbTHcrF/4iWncuuU/bNtAwAMhZUMAOzLNApsAF7GGHEAqqDMhu+zEhTqs07yNsmlKICBfKYBwK5MUgrseZI34gDgGYwRB6A6ymz4sXXKCm3FGdRjmTJJ4J0oAAAYOQU2AC9ljDgAVVNmw+OWUZxBbc5TbtydiYInmooAAOg5BTYAu2CMOAC9oMyG7Zyn7NVrrzGo63154n3JE01FAAD01CIKbABe5jpl4c4yxogD0BPKbNjePGXs+FD3zz7xEtMztykPmTSxrz0AAMO9Dt38OOcF4Dnucl9gr8UBQN8os2F7TcoNhD8H+u9zY4Q+2hTaK3/DQE9dx4QJAP5OgQ3ALnxKKbCNEQeg116JAJ5kleRXMUBV1ikjxwH6yGg/AJJSXC/b74U/kpxFkQ3A010n+SXJT+13iyIbgN6zMhue7kPKStBTUUA1lkkmST6KAgCAnjhJeSjTCmwAXsIYcQAGTZkNz7PZP/u1KKAaFyk3BM9EwQ9MRAAAdOgkyaK9pnQ9CcBLGCMOwCgos+F5blNuPnwZ2L9rEuNO6bdFyg1C+8/yPf42AIBDU2ADsCvXuV+F7R4eAKNgz2x4vnXKHjRDcuJlZQBm7cUdAAB0eW11kaRJeQj6XRTZADzPXZLfkvz84PtFkQ3AaFiZDS9jrDHU5zZl5csq9h4E6rdKcioGgEGYpqy+Po/iGoCXM0YcAKLMhl04j7HGUJt1yo3EP0UBAMAeTdvzzoVrQgB24CZl8cxVynQPABg9ZTa8nFWgUKdVkrdJLkUBAMAOTaPABmB37lLK64uUh/MBgAeU2bAb65QV2kozqMsyZQ9tWwEAAPASk5TyehEFNgC78SmlxF6KAgC+T5kNu7NMGTf+rsf/hpOU1awwJIuUm49vREFr5rMOANjCJGUF9ty5JAA7Yow4ADyRMht26zylJOnrk/oTLyEDtUgpL62iAWpzKwKA6q6JFNgA7JIx4gDwAsps2L15e2Jq/2yox633JlApN7MAuqfABmAfjBEHgB1QZsPuNSk3Qf4UBVT33pylrNBWaAMAME+Z4KPABmBXjBEHgB17JQLYi1WSX8UA1VmnbAcAAMA4zVNWyN0m+SOKbABe7i7J70l+TjJNKbMbsQDAbliZDfvzIWUV6GmPjtme2YzBsr24fC8KAIBRmD/4MaEHgF0xRhwADkCZDfu12aP3dU+O98RLxkh8SCm0z0QxSicpEzQAgGFfiymwAdi1m5TyehmrrwHgIJTZsF+3KTdPvogCqnOeUmoei2J0TKGgJo0IAHbmJGUP7EUU2ADszl3uV2CvxAEAh6XMhv1bJ/klyUdRQFVuU7YC6NP0BGB4GhEAvMimwJ47pwNgxz6nFNhXKfcQAIAOKLPhMC5SbrIYaQx12UxPWMXqHQCAvlBgA7AvxogDQGWU2XA4RhpDndYpN0P/EAUAQLUU2ADsizHiAFAxZTYczm3KzZdV6l0BeuJlYqSukrxNcikKAIBqTFPK60U8FAzA7hkjDgA9oMyGw1qnrNCutTAzZpkxW6bsoW07gOGbigAAqv6eVmADsC/GiANAzyiz4fCWKSug34kCqrNIuYF6KopBm4qAynz2uQP4blZgA7A3xogDQI8ps6Eb5ykrQN2ogfrM24tb708AgP2ZtOdd5867ANgTY8QBYACU2dCdecrYcaO9oS592N8eAKCPNgX2PMkbcQCwBzcp5fVFjBEHgEFQZkN3mpSbOH9WdlyTeFoV1inTE76IAgDgxdcXCmwA9u33lBL7ShQAMCyvRACdWiX5tbJjOvGyQJJSaL8VAwDAk01SJt1cJfkryWUU2QDs3nV73f7Tg+8dAGBgrMyG7n1IWQF6KgqozjLlAY93ohiUiQiojIkowFBsVmCfiQKAPTFGHABGRpkNddjsn/1aFFCd85Ty003Z4TgWAZVZx4pFoN/XMpufI3EAsCfGiAPASCmzoQ63KTd/7M8LdTpPWaGtBAUAUGADcBjXKSuwr2KaEQCMljIb6rFO8kuSj6KA6tymbAfQxA1bAGCcFNgAHIIx4gDA3yizoS4XKas/uxxnfJJk5aWAf9gU2qu4gQsAjMNJkkVKgW1LJAD2yRhxAOCblNlQn67HGU+8BPBd65Qbun+IAgAYKAU2AIdijDgA8ChlNtTnNuXm0SpWf0KNrmJLAGC3GhEAHVNgA3Aod0mW7c9aHADAY16JAKq0TlmhDdTpImUEGv01EwEVaUQAdGCa+/1IvyR5F0U2APvzKcm/UiYCnkeRDQBsycpsqNcyZYXEO1FAlRbpdksAAICnmqasvl44hwHgAK5zvwrbGHEA4FmU2VC385TVg4e80WTPbNjeLGVLADeDAYBaTaPABuBwjBEHAHZKmQ31m7cn/4faP/tE5LA1e9wDADWaRoENwGF9Simwr0QBAOySMhvq16TciPpTFFCltfcoAFCBSe4L7FNxAHAAxogDAHv3SgTQC6skv4oBqn6PvhUD8EzGLwLPNUkpr6+S/JXkMopsAPbrLslvSX5Ome53EUU2ALBHVmZDf3xI2Z/XzSmo07K9kH8nil44SXkIAWrg5h/wFJsV2PMkb8QBwIEYIw4AdEKZDf2y2T/7tSigSucpe1S6sVy/iQgA6Nn3lgIbgEMzRhwA6JwyG/rlNuUG1pc9/jdOxAwvskhZ8XssCgDgheYPfo7EAcAB3KWsvr6I7XAAgAoos6F/1kl+SfJxT//7bpLBy2weOll7PwEAz6DABqALn1JK7KUoAICaKLOhny5SVlCfiQKq1KTscb+Km9DAdu58XsCoKbAB6MJNyj2mq/Y6FgCgOq9EAL11nrJ3EVCndfs+Bdj2MwMYl1nu9yD9I+VBVUU2APt2l+T3JD8nmaaU2Y1YAIBaWZkN/XWb+7153fSCOi1Tbg68F0V1piIAoAMn7Tn8PMlrcQBwQMaIAwC9pMyGftus/Lzc8f/uJKUsB17uQ0pxaluAukxFAMCBKLAB6Iox4gBA7ymzof+WKTfI3u3wf/MkZcU3sBuL9n11LAoAGAUFNgBduUspry9iKxsAYACU2TAM5yl77inKoF6zlBsJbmgDwDBNUwrshe97ADpgjDgAMEjKbBiOeUpRZv9sqNNt+z5deZ8C39AkORUD9M60/X5fxIOlAByeMeIAwOAps2E4mpQbaX+KAqq1TrnZ/YcogG98jwP9MI0CG4DubMaIL2OLOABgBJTZMCyrJL8meS8KqNZVkrdJLkXRqYkIAHiCaRTYAHTrc0qBfZUy+QsAYBSU2TA8H1L25n3JqNKTeLoX9mnZvk/PRNEZRQQAj5mkFNjzJG/EAUAHbtrrx2VM8gEARkqZDcO02T/79TP/761YhP1bpKzyskcuANRDgQ1A14wRBwB4QJkNw3SbcgPuiyigavOUmxNWCQNAdxTYANTAGHEAgG9QZsNwrZP8kuSjKKBamwdP1kmOxAGj/94GDmsRBTYA3TJGHADgEcpsGLaLlP2v7csL9WpS9s82SQHGzeobOIz5gx8PkgHQBWPEAQCeQJkNw3eeUmg/ZYyxPbPhsNZJ3ia5FAUA7JwCG4AaGCMOAPAMymwYvtuUEYr/n727PW7kSrMEfGpj/4trgbgWiLKAlAVTbQFRFlTJAlVbILQFBC0QaUGBFhRgwQAWDGEB98cFl/VBAiCIj5s3nydC0RM9My3mi1bxIk++J8fZ/ObdmbHBwY2W/+x9NIqDuYhNCIBWCbABqIEacQCANxJmQz9MUja0bX1C3T6lNCN4NQAAvN7Z8nepABuAY7uOGnEAWOc0HvZiA8Js6I9RbH1CF2zzagCg+1RNwnbOUlqI3if51TgAOKJpkmHUiAPAKifL73CD5e/LCyNhHWE29Mun5S8HIRnU6/EQN4utMuiTiRHAxgTYANRinhJeD2OzDABWeb/8Hvdf3/x718bCJoTZ0M9fGpMIyaBmj4H22D+rAJBEgA1AXa5TQuwbowCAtd/jBnn+HufMiNiEMBv6Z5ZyE/DLml8ywHFNlge9f4wCgJ46XZ5bP0WADcDxqREHgPW+rRFf1xA7Ni428b+MAHppnOTfK/73NkGhDjdJ/jSGvfHgDkB9TlPC60mS/07ydwTZABzPPMl/kvzf5feHUQTZAPCc9yn3Mv9n+T1uk1edzoyNTdjMhv76nFJjfG4UULVhyk2TS6PYuRMjAKjCaZ7en/abcQBQATXiALDeuhrxdWZGyCaE2dBvj+/Ptu0CdRssD4du8EPb5n4n0yOnEWADUBc14gCw3mtqxFe5M0o2JcyGfrtPuYn41Sigehcprwhwwx/aNYswm7adLM+e75P8l3EAUIF5Sng9jO0wAFjl8WHkXX2X8+AYGxNmA5OUd/L+/cO/f+IXClTlfnlgHMd77QHoDgE2ADW6TXn/tRpxAHjZW2vEV5kYL5sSZgPJ8+/kPUsJzYB6TFLCgC9GAUDFBNgA1GiaEmCP4uF9AFj1fW6Q/b8SSpjNxoTZwKNP8U5e6IJxkg9JroxiJ4dzAHZn17VzAPBWizwF2G6aA0A93+dmRs6mhNnAIxXG0B2jlIdPPhrFm5wZAcCbvf/mL2dIAGqhRhwA1ttnjfg6HjJjY8Js4MdfIJ9i4xO64FOS09h+g9Z+D58bAx0gwAagRmrEAWC9Q9WIr/udDRsTZgM/GsW2InTFIKVNwesBoA1uulIzATYANVIjDgCbf6cbpI7FmJmPg9cQZgPPedz4BOp2vzyITiJYAGD3jlk5BwCrqBEHgO5+p/MAGq8izAZeMjMC6Mw/qxfxvnsAdus8yVdjAKAiasQBYL0aasTXmfmYeA1hNgB0n/fdAwAALVIjDgCbqalGfJ2Zj4vXEGYDQBtGKa8H+MsoNnZuBAAAUCU14gCwXldfDTX20fEa7x4eHkwBANoxSnJpDJufhYyAilwk+WIMAEBPzZMMUwLsmXEAwLO6UCO+7vf9qY+R17CZDQBtGaQ8lfmbUQAAAJVbpITXw6gRB4BVulQjvsrMR8lrCbMBoD0XKTeCfjUKAACgQrcpIfbIKADgRV2tEV9l7GPltYTZANCe+5SnNccNHXQBAIBuUyMOAOt1vUZ8HWcAXk2YDQBtmiwPvf8YBQAAcCRqxAFgM63UiK8z81HzWu8eHh5MAQDaNUhyZQwv+j1uqlGP0yT/bQwAQAPUiAPAei3WiK/zf1JaJWFjNrMBoG2jlHdoXxrFs06MgIrMjAAA6DA14gCwXus14qssIshmC8JsAGjfIGXj89woAACAHVIjDgCb6UuN+CrOCmxFmA0A/Tkwj9O/Jz4BAIDdu0tpgRoZBQC8qI814qsIs9mKMBsA+uE+JdCeODwDAABbmOcpwJ4ZBwA8q8814us4P7AVYTYA9OvAeJHkq1EAAAAbeKwRH6U0PQEAz1Mjvp7NbLYizAaA/h0aPyS5Mook5V3iUJNpPLkNABzfY434TUrLEwDwMzXirzMzArYhzAaA/hktD9sfjUKYTXXcLAYAjkWNOACsp0Z8e84XbEWYDQD99Gl5+L40CgAA6C014gCwGTXib3NnBGxLmA0A/fUpZUPbU6QAANAvasQBYD014rszMwK2JcwGgP66T3KxPEw6kAMAQNvUiAPAemrE98PZg60JswGg3x4D7XEE2gAA0Bo14gCwGTXi++UcwtaE2QDAZHlY/6eH137i46fCL3fnxgAAvJEacQBYT4344cyMgG0JswGApNzk+jPJ3z380gIAAC2YL8/1w7hhDAAvUSN+HM4mbE2YDQA8GqaEu5dGAQAAnXGdEmLfGAUAvEiN+PFMjYC3EGYDAN8aJDmNmmMAAKjZNOVhVDXiAPAyNeJ1mBkBbyHMBgB+9D7lvb2qlgAAoB5qxAFgPTXi9ZkYAW8hzAYAfnS/PPCP46lVOLSZEQAAP1AjDgDrqRGvlzCbNxFmAwAvHTLfJ/liFHBQMyMAAKJGHAA2oUa8G2ZGwFu8e3h4MAUA4CWDJFetn4d8zFTkIh4iAYC+UiMOAOupEe8e9954E5vZAMAqo5SnXD8aBQAA7IUacQBYT414N02NgLcSZgMA63xKcurLAgAA7IwacQBYT4149znn8GbCbABgE4Mk46hvAgCAbS1Smo9GSSbGAQDPUiPelrER8FbCbABgE/cp7/KdxZOwsE9ubANAe25TAmw14gDwMjXibZoZAW8lzAYANvUYaI8j0IZ9/nMGAHTfNE9b2H6/A8Dz1Ii3b2YEvNW7h4cHUwAAXmOQ5Kqh6/k9tmGpiwM6AHSTGnEAWE+NeL+8MwLeymY2APBaoySnSf5q6EsUAABsS404AKynRrx/5kbALgizAYBtfE4JtC+NAgCAHlIjDgDrqRHvt5kRsAvCbABgW4PllxKVUAAA9IEacQBYT404j5yX2AlhNgDwFhfLg+mvRgE7c5fk3BgAoBpqxAFgPTXi/GhmBOyCMBsAeIv75ZeVcdRFAQDQjnmSYdSIA8AqasRZxWY2OyHMBgB2cTB9n+RLR3/+Ux8hAAApNeI3KSG2m68A8Dw14mzKeYqdEGYDALswTvIhyVUHf/ZTHx8AQK/dpoTYI6MAgBepEec1FtFuw44IswGAXRmlvEP70igAAKjcY434TbzPEQBeokacbdnKZmeE2QDALg1SNp3PjQK25sllANgPNeIAsJ4acXbBWYudEWYDALv2PqV23Bce2P4Ln9o2ANgdNeIAsJ4acXbJg/rsjDAbANjHYfV9SiCnggoAgGNQIw4A66kRZ1/GRsCuCLMBgH2Ypbw/+2sHftYTHxcAQBPUiAPAemrEOYSZEbArwmwAYF8mST4kuar85zzzUQEAdJoacQBYT404hzQzAnZFmA0A7NMoyWmSv4wCAIAdUiMOAOupEecY7oyAXRJmAwD79jkl0L40CtiIWlQAeN5jjfgo3sMIAC9RI86xzYyAXRJmAwCH8CnlaWBfomC9eyMAgO/cpQTYN35PAsCL1IhTi5kRsEvCbADgEO6TXCwPs2qtAABYZ54SYI/ihigAvESNODUaGwG7JMwGAA7lMdAe+4IFAMAz1IgDwHpqxKmdJh126t3Dw4MpAACH9D7JP7WdiXwsVOQiyRdjAKBH1IgDwHpqxOkK99nYKZvZAMCh3ST5M8nfRgEA0FtqxAFgPTXidM3UCNg1YTYAcAzD5ReyS6OAn4yNAIBGqREHgPXUiNNlMyNg14TZAMCxDJKcJjk3CgCApqkRB4D11IjTgokRsGvCbADg2F/UxvGkMQBAa9SIA8B6asRpjTCbnRNmAwDHdL/8wjb2pQ0AoAnXKRvYN0YBAM9SI07LtPCwc+8eHh5MAQA4toskX4749/89nhylLg7pAHTJNMkwasQBYBU14vTBOyNg12xmAwA1GCf5kOTqSH//Ex8BlVlEWwEAdZunhNfDqBEHgJeoEadv50PYOWE2AFCL0fJL3kejgEySnBsDABVSIw4Aq6kRp69mRsA+CLMBgJp8SnIalVsAADVRIw4A66kRp+/GRsA+CLMBgNoMlodfTy8DAByPGnEAWE+NODxxZmQvhNkAQG3uk1wsD8C+CAIAHJYacQBYTY04PG9mBOyDMBsAqNFjoD3OYQLtUyMHAHpMjTgArKdGHFYbGwH7IMwGAGo1SXmH9tUB/l6nxk1lZknOjQGAPVIjDgDrqRGHzSyMgH0RZgMANRulBM1/GQU9MzMCAPbkdnnGUiMOAM9TIw6vNzEC9kWYDQDU7nNKoH1pFAAAW5mmBNijqBEHgJeoEYftCbPZG2E2ANAFg5RqL09EAwBsZpGnANvNRQB4nhpx2I2ZEbAvwmwAoCsuUm7E/moUAAAvUiMOAKupEYfd8/AkeyPMBgC64j6l8muc3T8tfWK8AECHqREHgPXUiMP+CLPZm3cPDw+mAAB0yUWSLzv+z7xb/udCy/89B6AtasQBYD014nCYc6lFEfbGZjYA0DXjJB+SXBkFANBDasQBYDU14nBYHqxkr4TZAEAXjVI2Vy+NAgDoATXiALCeGnE4jpkRsE/CbACgqwZJTpOcGwUA0CA14gCwnhpxOL6ZEbBPwmwAoMvep9SOqw0DAFpxm1IhPjIKAHiWGnGoy9gI2CdhNgDQZfcpgfYknsCmvf9uA9Af8yTDlBB7ZhwA8Cw14lAn51f26t3Dw4MpAABdd5bk61vPRcZIZRzUAdq2SAmvh1EjDgCrvu8PokYcauaeGntlMxsAaMEkyYckV0YBAFROjTgArKZGHLrjzgjYN2E2ANCKUZLTJH8ZBQBQGTXiALCeGnHoHmdb9k6YDQC05HNKoH1pFADAkakRB4D11IhDt82MgH0TZgMArfm0/DKsigwAOAY14gCwmhpxaIeHNtk7YTYA0Jr7JBfLw/SvxkGHzf13GKBTf2arEQeA1dSIQ3ucfdm7dw8PD6YAALToLMk4m9eU/R5Pk1KXcZJzYwColhpxANjsu/kgasShVe+MgH2zmQ0AtGqy/LL8z4b/9ydGBgBs4C6lQnxkFADw4vfrQdSIQ+umRsAhCLMBgDVtZ8AAACAASURBVJbdJPkzyd9GAQC8wTxPAfbMOADgWWrEoV+cizkIYTYA0LphSq3ZpVEAAK/wWCM+Snn1AwDwMzXi0F9etcNBCLMBgD4YJDmN9w8DAOs91ojfJLk3DgD4iRpxILGZzYEIswGAvnifslXlizZdMY4HMAAORY04AGz2vXoQNeJA4dzMQQizAYC+uF9+6R7n+eqzUyMCgF5RIw4A66kRB17iDM1BCLMBgD6ZJLlI8vWZ/92p8QBAL6gRB4DV1IgD68yNgEMRZgMAfTNJ8iHJlVEAQG+oEQeA9dSIA5typuZghNkAQB+NUqrSPhoFADRLjTgArKdGHNiG8zUHI8wGAPrqU0q1uCfOqZXqW4DtTJMMo0YcAF6iRhx4q5kRcCjCbACgzwYpT5L68k6NJkYAsLF5Sng9jBtrAPASNeLArjhzczDCbACgz+6TXCwP4CfGAQCdc50SYt8YBQA8S404sA8ewOdghNkAQN89BtqfjQIAOkGNOACspkYc2KeFcziHJMwGAChPk34yBgColhpxAFhPjThwCLayOShhNgBAMTMCAKiOGnEAWE2NOHAoizw9YAoHI8wGAIA6zYwA6Ck14gCwmhpx4JDmy/P5yPmcY3j38PBgCgAAUCeHdaAv1IgDwHpqxIFDuk4JsMdGwTHZzAYAAACORY04AKymRhw4JFvYVEeYDQAAABzSNOXm2ChukAHAc9SIA4dmC5tqCbMBAACAfVvkKcCeGAcAPEuNOHBI82/O6DPjoFbCbAAAAGBfblNujqkRB4DnqREHnNFhBWE2AADUaxq1gkA3/+waRY04ALxEjThwaLaw6SxhNgAA1EsIBHSFGnEAWE+NOHBod0mGsYVNhwmzAQAAgG2pKASA1dSIA4f2+KDpMLawaYAwGwAAAHgNNeIAsJoaceAY7r45p0MzhNkAAADAOmrEAWA9NeLAsc7ptrBpljAbAADqZeMRODY14gCwmhpx4BhsYdMbwmwAAKjXJLY6gMObp2x2jOKhGgB4jhpx4BgWKQ+ZDqMtiR4RZgMAAABujAHAemrEgWOYLs/pN/GwKT0kzAYAAID+uk25KTYyCgB4lhpx4Bg8bApLwmwAAADol8ca8ZskM+MAgJ+oEQeOeVb/HFvY8P8JswEAAKB9NjsAYD014sCxXKe0JY2NAr4nzAYAgHrNjAB4IzXiALCaGnHgWB4bk0axhQ0vEmYDAEC9ZkYAbEGNOACspkYcOCZb2PAKwmwAAADoPjXiALCeGnHgWGxhw5aE2QAAANBdasQBYDU14sCxz+uj5Zkd2IIwGwAAALplnnJDbBQ14gDwHDXigPM6NEKYDQAAAPV7rBEfxbv1AOAlasSBY7KFDXvw7uHhwRQAAKBOJ0n+xxig1+7ydEPMu/UA4GdqxIFjWuTpXdgz44DdE2YDAEDdHNihf9QSAsBqasSBY7v75swO7JGacQAAADg+NeIAsJ4aceDYZ/ZRyib2zDjgMITZAAAAcDxqxAFgNTXiQC1n9pFRwOEJswEAAOCw1IgDwGpqxIFje2xO+uzMDsclzAYAAID9UyMOAOupEQeObZpSI645CSohzAYAgLrdJTk3Buj0P8OjuBkGAC9RIw4c2+ODp8MkE+OAugizAQAAYLfUiAPAamrEgRrYwoYOEGYDAADAblyn3Ai7MQoAeJYacaCWc7stbOgIYTYAAABszzYHAKymRhyowXx5bh85t0O3CLMBAADgdeZ5eqfezDgA4CdqxIFaXKcE2GOjgG4SZgMAQN1mSc6NAaqgRhwAVlMjDtTAFjY0RJgNAAB1mxkBHJUacQBYTY04UIvb5dl9bBTQDmE2AAAAfE+NOACspkYcqOnsPlr+5ewODRJmAwAAQKFGHABWUyMO1OI2JcB2dofGCbMBAADoMzXiALCaGnGgFrawoYeE2QAAAPTNIuUGmBpxAHieGnGgJnd5egAV6BlhNgAA1G1iBLAzqggBYDU14kAtPIAKJBFmAwBA7dQew9tM81RF6J8nAPiZGnGgJnffnN8BhNkAAAA053GLYxTtBgDwHDXiQI3nd1vYwE+E2QAAALRCjTgArKZGHKjJNCXAHhkF8BJhNgAAAF2mRhwAVlMjDtRkkfLw6TBalIANCLMBAADoGjXiALCaGnGgNo9b2DfxECrwCu8eHh5MAQAA6ubQDoUacQBYTY04UBNb2MCb2cwGAACgZmrEAWA1NeJAbeZ5ehe2MzzwJsJsAAAAaqNGHABWUyMO1Oh6eYYfGwWwK8JsAAAAanGbUkM4MgoAeJYacaA2trCBvRJmAwAAcEyPN79uksyMAwB+okYcqJEtbOAghNkAAFC/eZJfjYGGLFLC62HUiAPAc9SIA7V+Nx0tz/G2sIGDEGYDAED9ZhFm0wY14gCwmhpxoNZz/Gh5lgc4KGE2AAAA+6RGHABWUyMO1HqOHy3/co4HjkaYDQAAwK6pEQeA1dSIA7WyhQ1URZgNAADArqgRB4DV1IgDNVrk6V3YM+MAaiLMBgAA4C3UiAPAamrEgVrd5alKHKBKwmwAAKjfJMm5MVARNeIAsJoacaDms/wotrCBjhBmAwBA/e6NgEo8bm7c+O8lADxLjThQ+1l+ZBRAlwizAQAAWGWep5teM+MAgJ+oEQdq9dio9NlZHugqYTYAAAA/erzpNUoyNg4A+IkacaBm05QacY1KQOcJswEAAHikRhwAVlMjDtTq8YHUYZKJcQCtEGYDAAD0mxpxAFhNjThQM1vYQNPePTw8mAIAANTtIskXY2CH1IgDwGpqxIHaXTvPA31gMxsAAKA/1IgDwGpqxIGazVO2sEfO80BfCLMBAADapkYcAFZTIw7UzhY20FvCbAAAgDa54QUAL1MjDtTOFjZAhNkAAAAtmabc8FIjDgDPUyMO1O42T68GAug9YTYAANRPKMkq85QbXcOoEQeA56gRB7pwph/Fq4EAfvLu4eHBFAAAoH4O7vzoOiXEtrEBAD9TIw50gS1sgDVsZgMAAHSHGnEAWE2NOFA7W9gAryDMBgAAqJsacQBYTY040AV3eQqxAdiQMBuALjtZ/qvNNABapEYcAFZ/HxxEjThQt0VKeO3BVIAtCbMB6LJvn74HgBaoEQeA1dSIA11gCxtgR4TZAHTZfZLL5b9+Mg6gcdPYOmqVGnEAWE2NONAFtrAB9kCYDUCXTZb/+nH5P4+MBGiYLd32qBEHgJepEQe6QrsSwB4JswFoxVXKU69jowCgYtM81Q260QUAP1MjDnTBIk/tShPjANgfYTYALblJcuFLBACVeawbHPkdBQDPUiMOdIUtbIADE2YD0JJfUoKCC18oAKjA7fL3khpxAPiZGnGgK2xhAxyRMBuAFr5QfPvk/m8pVeNnRgPAEagRB4DV1IgDXTFPCbCd7QGOSJgNQNdNkpz/8O/9tvyiMTAeoCHjZ/68ow5qxAFgNTXiQJdcL8/2Y6MAOD5hNgCtukwyS/LZKADYEzXiAPAyNeJAl9jCBqiUMBuAlv2VEmiPjAKAHVEjDgCrqREHusQWNkDlhNkAtG6YUvmq9hWAbakRB4DV1IgDXTL/5nw/Mw6AugmzAei6dVtxv6Q8XXvmCwoAr6RGHABepkYccL4HYO+E2QB03STr6+t+WX5RuYhKWKC7/Pl1GI/vyruJh6AA4DlqxIGune9HsYUN0FnCbAD64rc8BdoAXaTeen8Wy98RQ3MGgGepEQe65i5PD6kC0GHCbAD65DzlSdyBUQCQUjN4s/zdAAB8T4040DWL5dl+GFvYAM0QZgPQN5cp79AeGQVAL6kRB4DV1IgDXXOXpypxABojzAag67Z5h+zV8v9P1RRAP6gRB4DV1IgDXTzjj2ILG6B5wmwAum7bUGKU8v5soQZAu9SIA8DL1IgDXWQLG6BnhNkA9NUvKXXjp9luuxvg0Dx8sxk14gCwmhpxoGs0LQH0mDAbgD57DLQvItAG6ufPqZe5uQUAq6kRB7pomqcHVX0fAugpYTYAfffb8ovRwCgAOkeNOAC8TI040EUeVAXgO8JsALpuF0/mXi7/cz4ZJ0D15nl6R97MOADgJ2rEga6e8z/HFjYAP3j38PBgCgB03a5+mX2I7T6gH3/edc3jdsYo5fUQAMD31IgDXXXtnA/AKsJsAFqwy19mf/gCBfTkz7suuEu5sWU7AwB+pkYc6Kp5So34yDkfgHWE2QC0YJe/zBZJLuK9TECdxknOG79GNeIAsJoacaCrbGED8GremQ0A3/tl+cXqIp4OBjgUNeIAsJoacaCrbGED8CbCbABasMhub+j8lhKmnBktwF6pEQeAl6kRB7rs9puzPgBsTZgNQAsm2X3t7m/LL10D4wXYKTXiALCaGnHAWR8AloTZAPCyy+WXr89GAfAmasQBYDU14kCX2cIGYG+E2QCw2l8pgfbIKIAKdK2KW404ALxMjTjQZYs8vQt7ZhwA7IswGwDWG6ZUmU+MAjiySeqvHJ2nhNfDuKkFAM9RIw502eMDqyOjAOAQhNkAtGDf236/pNTinkUwA/CS65QQW7UgAPxMjTjQZYuU8NoDqwAcnDAbgBYcYlPxl5SA5iKqcgEeTVNuaKkRB4CfqREHus4WNgBHJ8wGgM39lqdAG6Cv1IgDwGpqxIEuWyzP+5+d9wGogTAbAF7nPOWJ5IFRAD2jRhwAXqZGHOg6rUsAVEmYDQCvd5nyDu2RUQAHNjvw388NLQB4mRpxoOset7CHKa9wA4DqCLMBaMExApar5d/XhiJwSLMD/D3UiAPAamrEga7z0CoAnSHMBqAFx3p6eJTy/mxPLwMtUCMOAC9TIw60cua3hQ1ApwizAWB7v6TUjZ/Gk8xAN9nIAICXqREHWjBfnvlHzvwAdJEwGwDe5jHQvvClEOiIRcqNLDXiAPA8NeJAC66X5/6xUQDQZcJsAHi731JCoYFRABW7TbmZpUYcAH6mRhxogS1sAJojzAagBTV8Qbtc/hyffBzAHo1f+X8/TbmRNYqbWQDwIzXiQCtuU0LssVEA0Jp3Dw8PpgBAC2r5hfYhJTQCONafd4814qMkE+MCgJ+oEQdaMP/m3D8zDgBaJcwGoBU1/UL7I56GBg7/550acQB4mRpxoBXO/QD0ijAbgFbU9AttkeQiNiKB/f95p0YcAF6mRhxohS1sAHpLmA1AK2r7hTZNCbSFS8Cu3UeNOACsokYcaMVdyruwbWED0FvCbABacZ/66gKnKXWGAADAfqkRB1qxSHlwdRhb2AAgzAagGeMk5xX+XNcpN9QAAIDdUiMOtOQuTw1MAMDS/zYCANiry5QnqT8bBQAA7IQacaAVtrABYA1hNgDs31/LL6UjowAAgK2oEQdaMk0JsEdGAQCrCbMB4DCGSSbLvwAAgPXUiAMtWSS5ydP9AQBgA8JsAFpxX/nP90vKe73PojoMAABWUSMOtORxC/sm9d+7AIDqCLMBaMUk9d/s+mX55fXCF1gAAPiOGnGgJbawAWBHhNkAcFi/5SnQBgCAPlMjDrRmnqd3YXuIHQB2QJgNAId3vvxiOzAKAAB6SI040Jrr5ff8sVEAwG4JswHgOC6XX3JHRgEAQA+oEQdaYwsbAA5AmA1AK7r4xfFq+XPf+PgAAGiQGnGgRbawAeCA3j08PJgCAC04S/K1gz/3IuX92RMfIQAAjVAjDrRmnhJgD2MLGwAOSpgNQEuGST528OdeJDn1hRgAgA5TIw606DYlxNaoBgBHIswGoDXjJOcd/LmnKRvaAm0AALpCjTjQosct7FGSmXEAwHEJswFozUlKZfevHfzZb1MqGQEAoGZqxIEW2cIGgAoJswFoUVffn50k/0nyyUcIAECFZ+xB1IgDbVnk6V3YM+MAgPoIswFo1SDJVUd/9g/LL9MAAHBMasSBVt3lqUocAKiYMBuAlo2SXHb0Z/8j5f3fAABwaGrEgRbZwgaADhJmA9C6Sbq5RbJIcrH8+QEAYN/UiAOtsoUNAB0mzAagdScpT1x38YbcPOWm4r2PEQCAPZ2VB1EjDrRnkeQmyefYwgaAThNmA9AHZ0m+dvRnny5/fgAA2BU14kCrpik14jfxYDgANEGYDUBfDJJcdfRnv17+/AAAsC014kCrHrewh/GqLgBojjAbgD4ZJbns6M/+75R6NAAA2JQacaBltrABoAeE2QD0yUmScbp7I+9DSiAPAACrqBEHWna9/G48NgoAaJ8wG4C+OU2pHetqteLvUZsGAMDP1IgDLZunbGGPYgsbAHpFmA1AH10k+dLRn32RcqNy5mMEAOg9NeJA62xhA0DPCbMB6KtPSf7u6M8+TQnkPY0OANBPasSBltnCBgD+P2E2AH02SnLZ0Z/9LiXQBgCgH9SIA627XX5PvzEKAOCRMBuAPjtJqSrraiXjdcrNTAAA2j2vDqJGHGjXPCXAHsXrtACAZwizAei7s5RAu6vbLX+m1K8BANAONeJA62xhAwAbEWYDQLlZ+E+Hf/5/uQEAANB5asSB1tnCBgBeTZgNAMXnJH919GdfpLw/e+JjBADoFDXiQB/c5SnEBgB4FWE2ADy5SXerHBdJTpPc+xgBAKqnRhxo3SIlvB7GFjYA8AbCbAB4cpLy/uyubsVMUza0BdoAAPVRIw70gS1sAGCnhNkA8L2zlEC7qzcYb1M2fQAAOD414kAf2MIGAPZGmA0APxskuerwz/+fJJ98jAAAR6NGHOiDaUqAfRMNYQDAngizAeB5wyQfO/zzf4haNwCAQ1IjDvTBIiW8HiaZGAcAsG/CbAB42TjJeYd//j+W1wAAwH6oEQf6whY2AHAUwmwAeNlJypPmv3b0518kuYin5QEAdk2NONAHtrABgKMTZgPAamcp281drYqcL6/Bk/MAAG8/Fw6iRhxo3zwlwB75LgkAHJswGwDWGyS56vDPP025+QoAwOuoEQf65DolwB4bBQBQC2E2AGxmmORjh3/+65SbsAAArKdGHOgLW9gAQNWE2QCwuUm6vZHz7ySffYwAAM9SIw70iS1sAKAThNkAsLmTJLN0++bmh5QbFgAAqBEH+mW+/D44Wn63BQConjAbAF7nLMnXjl/D7ylb5gAAfaVGHOiT25QA+8YoAICuEWYDwOsNklx1+OdfpITyMx8lANAjasSBPrGFDQA0QZgNANsZJbns8M8/TXKR5N5HCQA0TI040Dd3SYaxhQ0ANEKYDQDbm6TbN0XvUgJtAIDWqBEH+mSR8sD1MLawAYDGCLMBYHunKYF2l2sqr1Nu9AIAdJ0acaBv7vJUJQ4A0CRhNgC8zUWSLx2/hj9TnuAHAOgaNeJA39jCBgB6RZgNAG/3KcnfHb+Gf8U71QCA7lAjDvSNLWwAoJeE2QCwG6Mklx3++RcpW+YTHyUAUCk14kDfLFIeOh76rgYA9JUwGwB24yTJON2ut1ykvAf83scJAFR0xhpEjTjQL9OUAPvG9zMAoO+E2QCwO6cpT8t3eVNomrKh7YYJAHBMasSBvrGFDQDwDGE2AOzW+yT/dPwabpfXAQBwSGrEgT6aJ/kcW9gAAM8SZgPA7n1O8lfHr+E/ST75KAGAPVMjDvTVdZJRyuuqAAB4gTAbAPbjJt2vxfyQcnMFAGDX1IgDfTRPqREfxRY2AMBGhNkAsB8nKU/Yd33D6I/YFAAAdkONONBXtrABALYkzAaA/TlLuVnR5Zu1iyQXSSY+TgBgC2rEgb6yhQ0AsAPCbADYr/dJ/un4NcxTgnk3YACA15yBBlEjDvTPbUqAfWMUAABvJ8wGgP37nOSvjl/DNCXQBgB4iRpxoK/mKQH2KMnMOAAAdkeYDQCHMU5y3vFruE65OQ0A8EiNONBntrABAPZMmA0Ah3GS8t7pXzt+Hf9O2TQHAPpNjTjQV4s8vQt7ZhwAAPslzAaAwzlL2dDueu3mh5QbNwBA/84yg6gRB/rpLk9V4gAAHIgwGwAOa5DkqoHr+D1l0xwAaJsacaDPFinh9TC2sAEAjkKYDQCHN0zysePXsEjZzpr5OAGgSWrEgT6zhQ0AUAlhNgAcxzjJecevYZrkIsm9jxMAmqBGHOizRZKbJJ/joV0AgGoIswHgOE5SbpB0/UbxXUqgDQB090wyiBpxoL+mKe1ZN/GgLgBAdYTZAHA8Z0m+NnAd1yk3wAGA7lAjDvTZ4xb2MMnEOAAA6iXMBoDjGiS5auA6/ky5EQQA1EuNONB3trABADpGmA0AxzdKctnAdfwr5aYQAFAPNeIApU3KFjYAQAcJswGgDpN0/wbzIuX92W4QAcDxqREH+m6eEmCPYgsbAKCzhNkAUIeTJLN0v/JzkeQ0bhYBwDGoEQcoW9ijJGOjAADoPmE2ANTjLMnXBq5jmrKhLdAGgP1TIw5gCxsAoFnCbACoy6ckfzdwHbcp9aYAwH6oEQco3zuGsYUNANAsYTYA1GeU5LKB67hOuckOAOyGGnGAsoU9Wv41Mw4AgLYJswGgPicpmwUtVIV+SLnJBABsfy4YRI04wO3yu8WNUQAA9IcwGwDqdJpkkja2rv6I2j8AeC014gC2sAEAek+YDQD1ukjypYHrWCyvZeIjBYCV1IgDFHcp78K2hQ0A0HPCbACo26ckfzdwHfOUG/T3PlIA+I4acYBikbKBPYwtbAAAloTZAFC/m7RRMTpN2dAWaAOAGnGAR3d5qhIHAIDvCLMBoH4nKe+cbmFb6zrlxj0A9JEacYDCFjYAABsRZgNAN5ylBNot3Pj+d5LPPlIAekKNOMCTaUqAPTIKAAA2IcwGgO54n+SfRq7lQ9zAAqD939uDqBEHWKS8OmmYZGIcAAC8hjAbALrlc5K/GrmW3+NmFgBtUSMO8ORxC/smyb1xAACwDWE2AHTPTdrY8lokuYhAG4BuUyMO8P0Z3xY2AAA7I8wGgO45Sbkx9GsD1zJNCbRtagDQNWrEAZ7M8/QubGd7AAB2RpgNAN10lmScNipM71ICbQDowu/fQdSIAzy6Tgmwx0YBAMA+CLMBoLsGSa4auZbr5fUAQG3UiAN8zxY2AAAHI8wGgG4bJvnYyLX8ubweAKiBGnGA79nCBgDg4ITZANB94yTnjVzLh5QbZABwDGrEAb43X57Ph7GFDQDAEQizAaD7TpJMkvzawLUsUt6fPfGxAnDA36ODqBEH+NZtSoh9YxQAAByTMBsA2nCWsqHdwhbZIslpbH4AsF9qxAG+97iFPUoyMw4AAGogzAaAdgySXDVyLdOUDW2BNgC7pEYc4Ge2sAEAqJYwGwDaMkpy2ci13KZszQHAW6gRB/jZIk/vwp4ZBwAAtRJmA0B7JmnnZv11SvgAAK+lRhzgZ3d5qhIHAIDqCbMBoD0nKdsVrdSnfoibbQBsRo04wM9sYQMA0FnCbABo01mSrw1dzx9Jxj5WAJ6hRhzgebawAQDoPGE2ALRrkOSqkWtZJLlIqVAHgESNOMBL5+abJJ9jCxsAgAYIswGgbaMkl41cyzxl4/zexwrQW2rEAZ43TakRv3FeBgCgJcJsAGjbSUo9dyu1q9OUDW036AD69btsEDXiAD963MIeRoMRAACNEmYDQPtOU25utbLBdp0SaADQNjXiAM+zhQ0AQG8IswGgHy6SfGnoev6d8h5AANqiRhzgZdcprxEaGwUAAH0hzAaA/viU5O+GrudDys08ALpNjTjAy+YpW9ij2MIGAKCHhNkA0C+jJJcNXc/v8X5AgK5SIw7wMlvYAAAQYTYA9M1Jyg2xVjbfFikV6gJtgG5QIw7wMlvYAADwA2E2APTPWUqg3UqIME0JtN3wA6iTGnGA1W5TAuwbowAAgO8JswGgn94n+aeh67lLCbQBqOt3zSBqxAGeM08JsEdJZsYBAADPE2YDQH99TvJXQ9dznRKaAHA8asQBVrOFDQAAryDMBoB+u0lbG3N/prxnEIDDUSMOsJotbAAA2JIwGwD67STl/dkthQ8fUm4UArBfasQBVrvLU4gNAABsQZgNAJylBNqt1MEuUt6fPfHRAuzld8YgasQBVp1FRyltQTPjAACAtxFmAwBJ2a77p6HrWSQ5TXLvowV4MzXiAOvZwgYAgD0QZgMAj4ZJPjZ0PdOUDW2BNsB21IgDrGYLGwAA9kyYDQB8a5zkvKHruU0JYwDYjBpxgPWmKQH2TTw4CQAAeyXMBgC+dZLyrulfG7qm65RQBoCX/+wfRI04wCqLlPB6uDwvAwAAByDMBgB+dJayod3SRt6HeH8hwI/UiAOsZwsbAACOSJgNADxnkOSqsWv6IyWkB+gzNeIA69nCBgCASgizAYCXDJN8bOh6Fkku4oYk0D9qxAE2M1+egUexhQ0AAFUQZgMAq0zSVvAxT9lKdHMS6AM14gCbuU4JsMdGAQAAdRFmAwCrnCSZpa0q2mnKhrZAG2iRGnGAzdjCBgCADhBmAwDrnCX52tg1XacEPQAtUCMO8Lpz4Ci2sAEAoBOE2QDAJgZJrhq7pn8n+eyjBTpMjTjAZuYpAfYopXUIAADoCGE2ALCpUZLLxq7pw/K6ALpCjTjA5m6XZ70bowAAgG4SZgMArzFJexW2vy+vC6BWasQBNmcLGwAAGiLMBgBe4zQl+G1pG3CR5CICbaA+asQBNneXZBhb2AAA0BRhNgDwWhdJvjR2TdPldd37eIEjUyMOsLlFygb2MLawAQCgScJsAGAbn5L83dg13aUE2gCHpkYc4PXnttHyLwAAoGHCbABgW6Mkl41d03VKmARwCGrEATZnCxsAAHpImA0AbOskyTjtbRH+mXKTFGAf1IgDvI4tbAAA6DFhNgDwFqdJJmkvkPkQN0yB3VEjDvA6iyQ3KQ8YTowDAAD6S5gNALzVRZIvjV3TYnldbp4Cb6FGHOB1pikB9k2Se+MAAACE2QDALnxO8ldj17RIqQOe+XiBV1AjDvD6M5ctbAAA4FnCbABgV27S3vbhNGVD22YQsIoacYDXm6c8EGkLGwAAeJEwGwDYlZMk47QX5NymsHvB4AAAFSJJREFUVAUD/EiNOMDrXScZLc+NAAAAKwmzAYBdOku5Mdlate51SmAFoEYc4PXmKTXio9jCBgAAXkGYDQDs2vsk/zR4XR9SbsAC/aNGHGA7trABAIA3EWYDAPvwOclfDV7Xv1Le6wj0gxpxgNezhQ0AAOyMMBsA2JdxkvPGrmmR5CLJxMcLzVIjDrCd25QA24N/AADAzgizAYB9OUkJfX9t7LrmKWGXTSNo68+rQdSIA2xzLhot/5oZBwAAsGvCbABgn85SNrRb226cpmxoC7Sh29SIA2zHFjYAAHAQwmwAYN8GSa4avK7r5bUB3aJGHGA7izy9C3tmHAAAwCEIswGAQxgm+djgdf0nyScfL1RPjTjA9u7yVCUOAABwUMJsAOBQxknOG7yuD3FzF2qlRhxgO4vl+WYYW9gAAMARCbMBgEM5SbkZ2mKt7+9JJj5iqIIacYDt2cIGAACqIswGAA7pLMnXBq9rkeQiAm04FjXiAG87x9wk+Rxb2AAAQGWE2QDAoQ2SXDV4XdOUQPveRwwHo0Yc4G1nl2FKkO38AgAAVEmYDQAcwyjJZYPXNU3ZPgf2R404wPYet7CH0SgDAAB0gDAbADiWSdqsA75OCdmA3VEjDvA2trABAIBOEmYDAMdykvJexhY3K/9MuWEMvI0acYC3uY4tbAAAoMOE2QDAMZ0l+drotX1IqVMHXv/nwiBqxAG2NU8JsEexhQ0AAHScMBsAOLZPSf5u8LoWSS5iEwo2oUYc4O2uUwLssVEAAACtEGYDADUYJbls8LoWKVumMx8xPEuNOMDb2MIGAACaJswGAGpwkrJF1OJG5jRlQ9sNZijUiAO83W1KiD02CgAAoGXCbACgFqcpldwthlu3KRuo0FdqxAHebp6ygT2K1hcAAKAnhNkAQE0uknxp9NquU4I86BM14gBvd5sSYN8YBQAA0DfCbACgNp+S/N3otX1IuRkNLVMjDvy/9u73vIkz7wLwuWjA6gDeCqxUgN8KQiqwqACoAG8FUSrwqALkCpArQOrA6sDqYD88NkqyBvxnRpp55r4/7XVtssscQZzLx+c3vJwVNgAAQJTZAEA/LVPvkvOPWFZRH2fEAdpxnfIubP+uAAAAEGU2ANBPkySr1FmK7VLOqa99zFTAGXGAdv7doEkpsW/EAQAAsKfMBgD6appSaNd4pnh793y3PmYG+mdzFmfEAV7qOvtT4gAAADxAmQ0A9Nm7JF8qfbZNykJboc0QOCMO0A4rbAAAgCdQZgMAfXeR5HOlz7ZIKQehr5wRB2jHJqXAbkQBAADweMpsAGAIlqm3TPsryUcfMT3ijDhAO3Z3/w4zT7IWBwAAwNMpswGAIZikfBP4daXP9z6WWhz/z9gszogDtOF+hb2M14kAAAC8iDIbABiKaZJV6l2K/harLQ7PGXGAdlhhAwAAdECZDQAMySzJZaXPtktyFt8Ap3vOiAO0Z5v9u7CtsAEAAFqmzAYAhmae5EOlz7ZJKbR9M5y2OSMO0K5FSoG9EgUAAEB3lNkAwBCtkryt9Nk2KctZaIMz4gDtscIGAAA4MGU2ADBEk5Rz3K8rfb5FSgEJz+GMOED7X5ebWGEDAAAcnDIbABiqaco3lWst6z6lrL/gMZwRB2jXNqXAnscKGwAA4GiU2QDAkM2SXFb8fO9TvpEOP+KMOEC7ru6+9i5FAQAAcHzKbABg6Jok55U+2y7JWcpJdbjnjDhAu+5X2E2SG3EAAAD0hzIbAKjBOvWeVt6llJc3PuZRc0YcoH1W2AAAAD2nzAYAajBJKXtrXaluUhba3tk5Ps6IA7Rrl/27sG/EAQAA0G/KbACgFtMk3yp+vquUYpNx/F6exRlxgDZdZ39KHAAAgIFQZgMANZkluaz4+RZ3z0h9nBEHaJ8VNgAAwMApswGA2jRJzit+vvexKquJM+IA7bPCBgAAqIQyGwCozSTJKnWvW/9IsvRRD5Yz4gDt2919bbyIFTYAAEA1lNkAQI3eJFmn3qJwl+Ts7hkZBmfEAbqxSTkjvkxyKw4AAIC6KLMBgFqdJfla8fNtUxa+vnHfb86IA7TvfoU9jx/sAgAAqJoyGwCo2cckf1b8fJuU0l6h3S/OiAN093XPChsAAGBElNkAQO2aJOcVP98ipTTluJwRB+j2a12TZCUKAACAcVFmAwC1m6R887vmgvGvlBU6h+eMOEA3tikr7CZW2AAAAKOlzAYAxmCaUmjXfPL5fco3/DnM76dZnBEH6IIVNgAAAN8pswGAsXiX5Evlz/hbkrWPuhPOiAN0xwobAACABymzAYAxuUjyueLn2yU5i0K7Tc6IA3TnKqXAXooCAACAhyizAYCxWabuYnKTUmhbtj2fM+IA3dmmFNhNkhtxAAAA8DPKbABgbCYp7+Gs+VT0JqWQ5Wm/L2ZxRhygK1bYAAAAPJkyGwAYo2lKoV3z6naRUszyc86IA3THChsAAIAXUWYDAGP1LsmXyp/xU5K5j/p/OCMO0K3r7EtsAAAAeDZlNgAwZvMkHyp/xvdRJiTOiAN0bXf39WYeK2wAAABaoswGAMZuleRtxc+3S3KWZD3Sz9cZcYBuWWEDAADQGWU2ADB2k5Si93XFz7hLOa19M5LP1BlxgO6/rjSxwgYAAKBjymwAgFJ+rlJ38blJWWjfVvp8zogDHOZryTzJsuKvJwAAAPSIMhsAoJgluaz8Ga9TCu2aOCMO0K1dSnk9z3hfWQEAAMCRKLMBAPbmST5U/oyLlPJ3yJwRB+ieFTYAAABHp8wGAPindeo/U/0+5V2nQ+KMOED3rLABAADoFWU2AMA/TZLcpP7F7x8phUXfOSMO0L1tSoHdxAobAACAHlFmAwD8r2mSb5U/4y7l/dnrnuY/izPiAF1bpBTYK1EAAADQR8psAICHzZJcVv6MuyRv0o8VnjPiAIdhhQ0AAMBgKLMBAH6sSXJe+TNuUhbaxyo0nBEHOAwrbAAAAAZHmQ0A8HPr1L8UXqQUyofijDjAYWxTCuwmyY04AAAAGBplNgDAz01SCoDaS9e/knzsOMdZnBEHOISrlAJ7KQoAAACGTJkNAPBrZ0m+juA536eUH21yRhzgMKywAQAAqI4yGwDgcT4m+XMEz/n/efn7VJ0RBzic6yTzWGEDAABQIWU2AMDjNUnOK3/GXcoSff3Ev88ZcYDD/rO6SSmxb8QBAABArZTZAACPN0lZLdde1m5SCu3bR/y1zogDHM519qfEAQAAoHrKbACAp3mTslqu/Xz2JuVc+EOcEQc4HCtsAAAARkuZDQDwdGdJvo7gORcphXXijDjAoVlhAwAAMHrKbACA57lI8nkEz7lIKbKdEQfo3i7JMmWFvRYHAAAAY6fMBgB4vmWUvAC83CalwF4muRUHAAAAFMpsAIDnmyRZxdltAJ7OChsAAAB+QZkNAPAy05RC+0QUADzCNuVVFVbYAAAA8AvKbACAl3uX5IsYAPiJRZIm5QegAAAAgEdQZgMAtOMiyWcxAPA325Qz4k2ssAEAAODJlNkAAO1ZJXkrBoDRs8IGAACAFiizAQDaM0myTvJaFACjY4UNAAAALVNmAwC0a5qyxDsRBcAoXKUU2EtRAAAAQLuU2QAA7ZsluRQDQLW2KQV2k+RGHAAAANANZTYAQDfmST6IAaAqVtgAAABwQMpsAIDurJK8FQPAoO2yfxf2jTgAAADgcJTZAADdmSRZJ3ktCoDBuc7+lDgAAABwBMpsAIBuTZN8EwPAIOxSyut5rLABAADg6JTZAADdmyW5FANAb1lhAwAAQA8pswEADqNJci4GgN7YJVkmuYgVNgAAAPSSMhsA4HDWSU7FAHBUm5Qz4sskt+IAAACA/lJmAwAcziRl/XciCoCDul9hz1N+sAgAAAAYAGU2AMBhTZN8EwPAQVhhAwAAwIC9EgEAwEGtk3wSA0CnFkl+S/kBoiaKbAAAABgky2wAgONokpyLAaA125QVdhPlNQAAAFRBmQ0AcByTJKskp6IAeJFFSoG9EgUAAADURZkNAHA8b1LOjp+IAuBJrLABAABgBJTZAADHdZbkqxgAHuUqpcReiQIAAADqp8wGADi+j0n+FAPAg7YpC+wmyY04AAAAYDyU2QAA/bBM8rsYAL67Simwl6IAAACAcVJmAwD0wyTlbO6pKIARs8IGAAAAvlNmAwD0xzSl0D4RBTAy1ynvwrbCBgAAAL5TZgMA9Mu7JF/EAIzALmWBPY8VNgAAAPAAZTYAQP9cJPksBqBS19mfEgcAAAD4IWU2AEA/LZP8LgagElbYAAAAwJMpswEA+mmS8v7sU1EAA7ZJKbAbUQAAAABPpcwGAOivaUqhfSIKYEB2Kdcl5knW4gAAAACeS5kNANBvsySXYgAG4H6FvUxyKw4AAADgpZTZAAD9N0/yQQxAD1lhAwAAAJ1RZgMADMMqyVsxAD2xzf5d2FbYAAAAQCeU2QAAwzBJWT2+FgVwRIuUAnslCgAAAKBrymwAgOGYphRIJ6IADsgKGwAAADgKZTYAwLDMklyKATgAK2wAAADgqJTZAADD0yQ5FwPQge3dP2PmscIGAAAAjkyZDQAwTOskp2IAWnKVUmIvRQEAAAD0hTIbAGCYJklu4v3ZwPPdr7Cbu3+eAAAAAPSKMhsAYLimSb6JAXgiK2wAAABgEJTZAADDNktyKQbgF3bZvwv7RhwAAADAECizAQCGr0lyLgbgAdfZnxIHAAAAGBRlNgDA8E2SrJKcigKIFTYAAABQCWU2AEAd3iRZJzkRBYyWFTYAAABQFWU2AEA9zpJ8FQOMyi7JMslFrLABAACAyrwSAQBANVZJPokBRmGT5H3KVYZZFNkAAABAhSyzAQDq0yQ5FwNU536FPU95rQAAAABA1ZTZAAD1maSstE9FAVXYpBTYyyS34gAAAADGQpkNAFCnNynLzRNRwGAtUi4trEQBAAAAjJEyGwCgXu+SfBEDDMo2ZYXdxAobAAAAGDllNgBA3S6SfBYD9J4VNgAAAMC/KLMBAOq3TPK7GKB3rLABAAAAfkKZDQBQv0nK2vNUFNALVykF9lIUAAAAAD+mzAYAGIdpSqF9Igo4im1Kgd0kuREHAAAAwK8pswEAxuNdki9igIOywgYAAAB4JmU2AMC4zJN8EAN0ygobAAAAoAXKbACA8VkleSsGaN119iU2AAAAAC+kzAYAGJ9JknWS16KAF9ullNfzWGEDAAAAtEqZDQAwTtOUhfaJKOBZrLABAAAAOqbMBgAYr1mSSzHAo1lhAwAAAByQMhsAYNzmST6IAX5qc/dnZZnkVhwAAAAAh6HMBgBgneRUDPAPu5Tyen73ZwQAAACAA1NmAwAwSTmZ7P3ZYIUNAAAA0BvKbAAAkmSa5JsYGCkrbAAAAIAeUmYDAHBvluRSDIzINqXAbmKFDQAAANA7ymwAAP6uSXIuBiq3uPu9vhIFAAAAQH8pswEA+Ld1klMxUBkrbAAAAICBUWYDAPBvkyQ3SU5EQQWssAEAAAAGSpkNAMBDzpJ8FQMDtU0psJuUH8wAAAAAYICU2QAA/MjHJH+KgQG5Simwl6IAAAAAGD5lNgAAP9MkORcDPWaFDQAAAFApZTYAAD8zSXnX8Kko6JnrJPNYYQMAAABUS5kNAMCvvEmyTnIiCo5sl7LAnscKGwAAAKB6ymwAAB7jLMlXMXAk19mfEgcAAABgJF6JAACAR1gl+Y8YOKBdkr+S/F/KD1M0IgEAAAAYF8tsAACeYpnkdzHQIStsAAAAAJIoswEAeJpJykr7VBS0aJfygxLzlPezAwAAAIAyGwCAJ5umFNonouCFNikF9jLJrTgAAAAA+DtlNgAAz/EuyRcx8AxW2AAAAAA8yisRAADwDMsk/xEDT7BN8j7JmySzKLIBAAAA+AXLbAAAXmKV5K0Y+IlFkubu9woAAAAAPJoyGwCAl5ikLGxfi4K/2aacEW/iXdgAAAAAPJMyGwCAl5qmrG5PRDF6VtgAAAAAtEaZDQBAG2ZJLsUwSlbYAAAAAHRCmQ0AQFvmST6IYTSuUgrspSgAAAAA6IIyGwCANq2SvBVDtbYpBXaT5EYcAAAAAHRJmQ0AQJsmSdZJXouiKlbYAAAAABycMhsAgLZNk3wTw+Dtsn8X9o04AAAAADg0ZTYAAF2YJbkUwyBdZ39KHAAAAACORpkNAEBXmiTnYhiE3d3nNY8VNgAAAAA9ocwGAKBL6ySnYugtK2wAAAAAekuZDQBAlyYpS98TUfTGLskyyUWssAEAAADoMWU2AABdmyb5Joaj26ScEV8muRUHAAAAAH33SgQAAHRsneSTGI5il2SR5LeUHypoosgGAAAAYCAsswEAOJQmybkYDsIKGwAAAIDBU2YDAHAokySrJKei6MwipcReiwIAAACAoVNmAwBwSG9SitYTUbRmm1JgN7HCBgAAAKAiymwAAA7tLMlXMbzYIqXAXokCAAAAgBopswEAOIaPSf4Uw5NZYQMAAAAwGspsAACOpUlyLoZHuUopsVeiAAAAAGAslNkAABzLJKWcPRXFg7YphX+T5EYcAAAAAIyNMhsAgGOaphTaJ6L47iqlwF6KAgAAAIAxU2YDAHBs75J8GXkGVtgAAAAA8C/KbAAA+uAiyecRPvd1yruwrbABAAAA4F+U2QAA9MUyye8jeM5dygJ7HitsAAAAAPghZTYAAH0xSXl/9mmlz3ed/SlxAAAAAOAXlNkAAPTJNKXQPqnkeaywAQAAAOCZlNkAAPTNLMnlwJ9hk1JgNz5OAAAAAHgeZTYAAH00T/JhYL/mXcp7v+dJ1j5CAAAAAHgZZTYAAH21SvJ2AL/O+xX2Msmtjw0AAAAA2qHMBgCgryYpC+fXPfy1WWEDAAAAQMeU2QAA9Nk0ZaF90pNfzzb7d2FbYQMAAABAh5TZAAD03SzJ5ZF/DYuUAnvl4wAAAACAw1BmAwAwBE2S8wP/f1phAwAAAMARKbMBABiKdZLTA/z/WGEDAAAAQA8oswEAGIpJkpt08/7sbUqBPY8VNgAAAAD0gjIbAIAhmSb51uL/3lVKib0ULQAAAAD0izIbAIChmSW5fMHff7/CblKW3gAAAABADymzAQAYoibJ+RP/HitsAAAAABgQZTYAAEO1TnL6i79ml/27sG9EBgAAAADDocwGAGCo3qQU2icP/HfX2Z8SBwAAAAAGSJkNAMCQnSX5evefrbABAAAAoCLKbAAAhu5dkkmssAEAAACgKv8F3qtfY+YVvDIAAAAASUVORK5CYII="},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,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"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTemplate=r(53),t.defaultViewer=r(54),t.error=r(55),t.fillContainer=r(56),t.help=r(57),t.loadingScreen=r(58),t.navbar=r(59),t.overlay=r(60),t.share=r(61)},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 2s linear infinite;animation:spin 2s 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 src={{loadingImage}}>"},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}.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});var n=r(7),i=r(7),o=r(18),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}},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.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={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});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(8).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});var o=r(8),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++)o=e[s],i[o]=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},c="undefined"!=typeof SVGElementInstance,l={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],!c||"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))}};l.boundHandler=l.eventHandler.bind(l);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)}},h=Array.prototype.forEach.call.bind(Array.prototype.forEach),d=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),g=window.MutationObserver||window.WebKitMutationObserver,m={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),g&&(this.observer=new g(this.mutationWatcher.bind(this)))}function v(e){return"body /shadow-deep/ "+A(e)}function A(e){return'[touch-action="'+e+'"]'}function y(e){return"{ -ms-touch-action: "+e+"; touch-action: "+e+"; }"}_.prototype={watchSubtree:function(e){this.observer&&u.canTarget(e)&&this.observer.observe(e,m)},enableOnSubtree:function(e){this.watchSubtree(e),e===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(e)},installNewSubtree:function(e){h(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=d(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){if("childList"===e.type){var t=this.flattenMutationTree(e.addedNodes);t.forEach(this.addElement,this);var r=this.flattenMutationTree(e.removedNodes);r.forEach(this.removeElement,this)}else"attributes"===e.type&&this.elementChanged(e.target,e.oldValue)}};var b=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],T="",E=window.PointerEvent||window.MSPointerEvent,x=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,C=l.pointermap,P=[1,4,2,8,16],M=!1;try{M=1===new MouseEvent("test",{buttons:1}).buttons}catch(e){}var S,R={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(e){l.listen(e,this.events)},unregister:function(e){l.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),c=Math.abs(i-t.y);if(a<=25&&c<=25)return!0}},prepareEvent:function(e){var t=l.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=C.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=C.get(this.POINTER_ID),r=this.prepareEvent(e);M||(r.buttons=P[r.button],t&&(r.buttons|=t.buttons),e.buttons=r.buttons),C.set(this.POINTER_ID,e),t&&0!==t.buttons?l.move(r):l.down(r)}},mousemove:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);M||this.prepareButtonsForMove(t,e),t.button=-1,C.set(this.POINTER_ID,e),l.move(t)}},mouseup:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=C.get(this.POINTER_ID),r=this.prepareEvent(e);if(!M){var n=P[r.button];r.buttons=t?t.buttons&~n:0,e.buttons=r.buttons}C.set(this.POINTER_ID,e),r.buttons&=~P[r.button],0===r.buttons?l.up(r):l.move(r)}},mouseover:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);M||this.prepareButtonsForMove(t,e),t.button=-1,C.set(this.POINTER_ID,e),l.enterOver(t)}},mouseout:function(e){if(!this.isEventSimulatedFromTouch(e)){var t=this.prepareEvent(e);M||this.prepareButtonsForMove(t,e),t.button=-1,l.leaveOut(t)}},cancel:function(e){var t=this.prepareEvent(e);l.cancel(t),this.deactivateMouse()},deactivateMouse:function(){C.delete(this.POINTER_ID)}},O=l.captureInfo,I=u.findTarget.bind(u),D=u.allShadows.bind(u),w=l.pointermap,L={events:["touchstart","touchmove","touchend","touchcancel"],register:function(e){S.enableOnSubtree(e)},unregister:function(){},elementAdded:function(e){var t=e.getAttribute("touch-action"),r=this.touchActionToScrollType(t);r&&(e._scrollType=r,l.listen(e,this.events),D(e).forEach(function(e){e._scrollType=r,l.listen(e,this.events)},this))},elementRemoved:function(e){e._scrollType=void 0,l.unlisten(e,this.events),D(e).forEach(function(e){e._scrollType=void 0,l.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===w.size||1===w.size&&w.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=l.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",s=Math.abs(n["client"+i]-this.firstXY[i]),a=Math.abs(n["client"+o]-this.firstXY[o]);t=s>=a}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(w.size>=t.length){var r=[];w.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){w.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),l.enterOver(e),l.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=w.get(t.pointerId);if(r){var n=r.out,i=r.outTarget;l.move(t),n&&i!==t.target&&(n.relatedTarget=t.target,t.relatedTarget=i,n.target=i,t.target?(l.leaveOut(n),l.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||(l.up(e),l.leaveOut(e)),this.cleanUpPointer(e)},touchcancel:function(e){this.processTouches(e,this.cancelOut)},cancelOut:function(e){l.cancel(e),l.leaveOut(e),this.cleanUpPointer(e)},cleanUpPointer:function(e){w.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)}}};S=new _(L.elementAdded,L.elementRemoved,L.elementChanged,L);var B,F,N,V=l.pointermap,U=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,G={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(e){l.listen(e,this.events)},unregister:function(e){l.unlisten(e,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(e){var t=e;return U&&((t=l.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);l.down(t)},MSPointerMove:function(e){var t=this.prepareEvent(e);l.move(t)},MSPointerUp:function(e){var t=this.prepareEvent(e);l.up(t),this.cleanup(e.pointerId)},MSPointerOut:function(e){var t=this.prepareEvent(e);l.leaveOut(t)},MSPointerOver:function(e){var t=this.prepareEvent(e);l.enterOver(t)},MSPointerCancel:function(e){var t=this.prepareEvent(e);l.cancel(t),this.cleanup(e.pointerId)},MSLostPointerCapture:function(e){var t=l.makeEvent("lostpointercapture",e);l.dispatchEvent(t)},MSGotPointerCapture:function(e){var t=l.makeEvent("gotpointercapture",e);l.dispatchEvent(t)}};function k(e){if(!l.pointermap.has(e)){var t=new Error("InvalidPointerId");throw t.name="InvalidPointerId",t}}function z(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 H(e){var t=l.pointermap.get(e);return 0!==t.buttons}return window.navigator.msPointerEnabled?(B=function(e){k(e),z(this),H(e)&&(l.setCapture(e,this,!0),this.msSetPointerCapture(e))},F=function(e){k(e),l.releaseCapture(e,!0),this.msReleasePointerCapture(e)}):(B=function(e){k(e),z(this),H(e)&&l.setCapture(e,this)},F=function(e){k(e),l.releaseCapture(e)}),N=function(e){return!!l.captureInfo[e]},function(){if(E){b.forEach(function(e){String(e)===e?(T+=A(e)+y(e)+"\n",x&&(T+=v(e)+y(e)+"\n")):(T+=e.selectors.map(A)+y(e.rule)+"\n",x&&(T+=e.selectors.map(v)+y(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}),l.registerSource("ms",G)}else Object.defineProperty(window.navigator,"maxTouchPoints",{value:0,enumerable:!0}),l.registerSource("mouse",R),void 0!==window.ontouchstart&&l.registerSource("touch",L);l.register(document)}}(),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:B},releasePointerCapture:{value:F},hasPointerCapture:{value:N}}),{dispatcher:l,Installer:_,PointerEvent:r,PointerMap:n,targetFinding:u}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(11),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){document.removeEventListener("DOMContentLoaded",e),o.viewerGlobals.disableInit||s()})},t.InitTags=s}]);
-
- return BabylonViewer;
- });
|