(function universalModuleDefinition(root, factory) { var amdDependencies = []; if(typeof exports === 'object' && typeof module === 'object') { module.exports = factory(); } else if(typeof define === 'function' && define.amd) { define("babylonjs-viewer", amdDependencies, factory); } else if(typeof exports === 'object') { exports["babylonjs-viewer"] = factory(); } else { root["BabylonViewer"] = factory(); } })(this, function() { var BabylonViewer=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}([function(e,t,r){(function(t){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./Legacy/legacy.ts")}({"../node_modules/tslib/tslib.es6.js": /*!******************************************!*\ !*** ../node_modules/tslib/tslib.es6.js ***! \******************************************/ /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __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 m}),r.d(t,"__spreadArrays",function(){return g}),r.d(t,"__await",function(){return _}),r.d(t,"__asyncGenerator",function(){return v}),r.d(t,"__asyncDelegator",function(){return A}),r.d(t,"__asyncValues",function(){return y}),r.d(t,"__makeTemplateObject",function(){return b}),r.d(t,"__importStar",function(){return T}),r.d(t,"__importDefault",function(){return M}); /*! ***************************************************************************** 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=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]=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 m(){for(var e=[],t=0;t1||a(e,t)})})}function a(e,t){try{(r=i[e](t)).value instanceof _?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 A(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:_(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function y(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 b(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function T(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 M(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 a});var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=function(){function e(e,t){this.triggerOptions=e,this.onBeforeExecuteObservable=new n.Observable,e.parameter?(this.trigger=e.trigger,this._triggerParameter=e.parameter):e.trigger?this.trigger=e.trigger:this.trigger=e,this._nextActiveAction=this,this._condition=t}return e.prototype._prepare=function(){},e.prototype.getTriggerParameter=function(){return this._triggerParameter},e.prototype._executeCurrent=function(e){if(this._nextActiveAction._condition){var t=this._nextActiveAction._condition,r=this._actionManager.getScene().getRenderId();if(t._evaluationId===r){if(!t._currentResult)return}else{if(t._evaluationId=r,!t.isValid())return void(t._currentResult=!1);t._currentResult=!0}}this.onBeforeExecuteObservable.notifyObservers(this),this._nextActiveAction.execute(e),this.skipToNextActiveAction()},e.prototype.execute=function(e){},e.prototype.skipToNextActiveAction=function(){this._nextActiveAction._child?(this._nextActiveAction._child._actionManager||(this._nextActiveAction._child._actionManager=this._actionManager),this._nextActiveAction=this._nextActiveAction._child):this._nextActiveAction=this},e.prototype.then=function(e){return this._child=e,e._actionManager=this._actionManager,e._prepare(),e},e.prototype._getProperty=function(e){return this._actionManager._getProperty(e)},e.prototype._getEffectiveTarget=function(e,t){return this._actionManager._getEffectiveTarget(e,t)},e.prototype.serialize=function(e){},e.prototype._serialize=function(e,t){var r={type:1,children:[],name:e.name,properties:e.properties||[]};if(this._child&&this._child.serialize(r),this._condition){var n=this._condition.serialize();return n.children.push(r),t&&t.children.push(n),n}return t&&t.children.push(r),r},e._SerializeValueAsString=function(e){return"number"==typeof e?e.toString():"boolean"==typeof e?e?"true":"false":e instanceof i.Vector2?e.x+", "+e.y:e instanceof i.Vector3?e.x+", "+e.y+", "+e.z:e instanceof o.Color3?e.r+", "+e.g+", "+e.b:e instanceof o.Color4?e.r+", "+e.g+", "+e.b+", "+e.a:e},e._GetTargetProperty=function(e){return{name:"target",targetType:e._isMesh?"MeshProperties":e._isLight?"LightProperties":e._isCamera?"CameraProperties":"SceneProperties",value:e._isScene?"Scene":e.name}},e}();s._TypeStore.RegisteredTypes["BABYLON.Action"]=a},"./Actions/actionEvent.ts": /*!********************************!*\ !*** ./Actions/actionEvent.ts ***! \********************************/ /*! exports provided: ActionEvent */function(e,t,r){"use strict";r.r(t),r.d(t,"ActionEvent",function(){return n});var n=function(){function e(e,t,r,n,i,o){this.source=e,this.pointerX=t,this.pointerY=r,this.meshUnderPointer=n,this.sourceEvent=i,this.additionalData=o}return e.CreateNew=function(t,r,n){var i=t.getScene();return new e(t,i.pointerX,i.pointerY,i.meshUnderPointer||t,r,n)},e.CreateNewFromSprite=function(t,r,n,i){return new e(t,r.pointerX,r.pointerY,r.meshUnderPointer,n,i)},e.CreateNewFromScene=function(t,r){return new e(null,t.pointerX,t.pointerY,t.meshUnderPointer,r)},e.CreateNewFromPrimitive=function(t,r,n,i){return new e(t,r.x,r.y,null,n,i)},e}()},"./Actions/actionManager.ts": /*!**********************************!*\ !*** ./Actions/actionManager.ts ***! \**********************************/ /*! exports provided: ActionManager */function(e,t,r){"use strict";r.r(t),r.d(t,"ActionManager",function(){return m});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ./condition */"./Actions/condition.ts"),a=r(/*! ./action */"./Actions/action.ts"),c=r(/*! ./directActions */"./Actions/directActions.ts"),l=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../Misc/logger */"./Misc/logger.ts"),h=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),d=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),f=r(/*! ./abstractActionManager */"./Actions/abstractActionManager.ts"),p=r(/*! ../Engines/constants */"./Engines/constants.ts"),m=function(e){function t(t){var r=e.call(this)||this;return r._scene=t||l.EngineStore.LastCreatedScene,t.actionManagers.push(r),r}return Object(n.__extends)(t,e),t.prototype.dispose=function(){for(var e=this._scene.actionManagers.indexOf(this),r=0;r-1&&this._scene.actionManagers.splice(e,1)},t.prototype.getScene=function(){return this._scene},t.prototype.hasSpecificTriggers=function(e){for(var t=0;t-1)return!0}return!1},t.prototype.hasSpecificTriggers2=function(e,t){for(var r=0;r=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=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?(u.Logger.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"),null):(this.actions.push(e),t.Triggers[e.trigger]?t.Triggers[e.trigger]++:t.Triggers[e.trigger]=1,e._actionManager=this,e._prepare(),e)},t.prototype.unregisterAction=function(e){var r=this.actions.indexOf(e);return-1!==r&&(this.actions.splice(r,1),t.Triggers[e.trigger]-=1,0===t.Triggers[e.trigger]&&delete t.Triggers[e.trigger],delete e._actionManager,!0)},t.prototype.processTrigger=function(e,r){for(var n=0;n0;if(2===e.type?f.push(a):f.push(r),g){for(var _=new Array,v=0;v0){var m=p.properties[0].value,g=null===p.properties[0].targetType?m:n.getMeshByName(m);g._meshId&&(g.mesh=n.getMeshByID(g._meshId)),f={trigger:t[p.name],parameter:g}}else f=t[p.name];for(var _=0;_this.value;case t.IsLesser:return this._effectiveTarget[this._property]-1&&(this._scene._activeAnimatables.splice(t,1),this._scene._activeAnimatables.push(this))}return this},e.prototype.getAnimations=function(){return this._runtimeAnimations},e.prototype.appendAnimations=function(e,t){for(var r=this,n=0;n-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;n0)return;this._animationTimeLast=e}this.deltaTime=this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=e;var t=this._activeAnimatables;if(0!==t.length){this._animationTime+=this.deltaTime;for(var r=this._animationTime,n=0;nr&&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;fn&&o>0&&(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=u&&a.frame<=h&&(i?(l=a.value.clone(),g?(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: _IAnimationState, Animation */function(e,t,r){"use strict";r.r(t),r.d(t,"_IAnimationState",function(){return d}),r.d(t,"Animation",function(){return f});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),a=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),c=r(/*! ./animationKey */"./Animations/animationKey.ts"),l=r(/*! ./animationRange */"./Animations/animationRange.ts"),u=r(/*! ../node */"./node.ts"),h=r(/*! ../Maths/math.size */"./Maths/math.size.ts"),d=function(){},f=function(){function e(t,r,n,i,o,s){this.name=t,this.targetProperty=r,this.framePerSecond=n,this.dataType=i,this.loopMode=o,this.enableBlending=s,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this.targetPropertyPath=r.split("."),this.dataType=i,this.loopMode=void 0===o?e.ANIMATIONLOOPMODE_CYCLE:o}return e._PrepareAnimation=function(t,r,o,s,a,c,l,u){var d=void 0;if(!isNaN(parseFloat(a))&&isFinite(a)?d=e.ANIMATIONTYPE_FLOAT:a instanceof n.Quaternion?d=e.ANIMATIONTYPE_QUATERNION:a instanceof n.Vector3?d=e.ANIMATIONTYPE_VECTOR3:a instanceof n.Vector2?d=e.ANIMATIONTYPE_VECTOR2:a instanceof i.Color3?d=e.ANIMATIONTYPE_COLOR3:a instanceof i.Color4?d=e.ANIMATIONTYPE_COLOR4:a instanceof h.Size&&(d=e.ANIMATIONTYPE_SIZE),null==d)return null;var f=new e(t,r,o,d,l),p=[{frame:0,value:a},{frame:s,value:c}];return f.setKeys(p),void 0!==u&&f.setEasingFunction(u),f},e.CreateAnimation=function(t,r,n,i){var o=new e(t+"Animation",t,n,r,e.ANIMATIONLOOPMODE_CONSTANT);return o.setEasingFunction(i),o},e.CreateAndStartAnimation=function(t,r,n,i,o,s,a,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=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;t0)return r.highLimitValue.clone?r.highLimitValue.clone():r.highLimitValue;var n=this._keys;if(1===n.length)return this._getKeyValue(n[0].value);var i=r.key;if(n[i].frame>=t)for(;i-1>=0&&n[i].frame>=t;)i--;for(var o=i;o=t){r.key=o;var a=n[o],l=this._getKeyValue(a.value);if(a.interpolation===c.AnimationKeyInterpolation.STEP)return l;var u=this._getKeyValue(s.value),h=void 0!==a.outTangent&&void 0!==s.inTangent,d=s.frame-a.frame,f=(t-a.frame)/d,p=this.getEasingFunction();switch(null!=p&&(f=p.ease(f)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var m=h?this.floatInterpolateFunctionWithTangents(l,a.outTangent*d,u,s.inTangent*d,f):this.floatInterpolateFunction(l,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return m;case e.ANIMATIONLOOPMODE_RELATIVE:return r.offsetValue*r.repeatCount+m}break;case e.ANIMATIONTYPE_QUATERNION:var g=h?this.quaternionInterpolateFunctionWithTangents(l,a.outTangent.scale(d),u,s.inTangent.scale(d),f):this.quaternionInterpolateFunction(l,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return g;case e.ANIMATIONLOOPMODE_RELATIVE:return g.addInPlace(r.offsetValue.scale(r.repeatCount))}return g;case e.ANIMATIONTYPE_VECTOR3:var _=h?this.vector3InterpolateFunctionWithTangents(l,a.outTangent.scale(d),u,s.inTangent.scale(d),f):this.vector3InterpolateFunction(l,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return _;case e.ANIMATIONLOOPMODE_RELATIVE:return _.add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_VECTOR2:var v=h?this.vector2InterpolateFunctionWithTangents(l,a.outTangent.scale(d),u,s.inTangent.scale(d),f):this.vector2InterpolateFunction(l,u,f);switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return v;case e.ANIMATIONLOOPMODE_RELATIVE:return v.add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_SIZE:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(l,u,f);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(l,u,f).add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_COLOR3:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(l,u,f);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(l,u,f).add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_COLOR4:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color4InterpolateFunction(l,u,f);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color4InterpolateFunction(l,u,f).add(r.offsetValue.scale(r.repeatCount))}case e.ANIMATIONTYPE_MATRIX:switch(r.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:if(e.AllowMatricesInterpolation)return this.matrixInterpolateFunction(l,u,f,r.workValue);case e.ANIMATIONLOOPMODE_RELATIVE:return l}}break}}return this._getKeyValue(n[n.length-1].value)},e.prototype.matrixInterpolateFunction=function(t,r,i,o){return e.AllowMatrixDecomposeForInterpolation?o?(n.Matrix.DecomposeLerpToRef(t,r,i,o),o):n.Matrix.DecomposeLerp(t,r,i):o?(n.Matrix.LerpToRef(t,r,i,o),o):n.Matrix.Lerp(t,r,i)},e.prototype.clone=function(){var t=new e(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,this._keys&&t.setKeys(this._keys),this._ranges)for(var r in t._ranges={},this._ranges){var n=this._ranges[r];n&&(t._ranges[r]=n.clone())}return t},e.prototype.setKeys=function(e){this._keys=e.slice(0)},e.prototype.serialize=function(){var t={};t.name=this.name,t.property=this.targetProperty,t.framePerSecond=this.framePerSecond,t.dataType=this.dataType,t.loopBehavior=this.loopMode,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed;var r=this.dataType;t.keys=[];for(var n=this.getKeys(),i=0;i=1&&(l=h.values[1]),h.values.length>=2&&(u=h.values[2]);break;case e.ANIMATIONTYPE_QUATERNION:if(r=n.Quaternion.FromArray(h.values),h.values.length>=8){var d=n.Quaternion.FromArray(h.values.slice(4,8));d.equals(n.Quaternion.Zero())||(l=d)}if(h.values.length>=12){var f=n.Quaternion.FromArray(h.values.slice(8,12));f.equals(n.Quaternion.Zero())||(u=f)}break;case e.ANIMATIONTYPE_MATRIX:r=n.Matrix.FromArray(h.values);break;case e.ANIMATIONTYPE_COLOR3:r=i.Color3.FromArray(h.values);break;case e.ANIMATIONTYPE_COLOR4:r=i.Color4.FromArray(h.values);break;case e.ANIMATIONTYPE_VECTOR3:default:r=n.Vector3.FromArray(h.values)}var p={};p.frame=h.frame,p.value=r,null!=l&&(p.inTangent=l),null!=u&&(p.outTangent=u),c.push(p)}if(s.setKeys(c),t.ranges)for(o=0;on[0].frame&&(this._from=n[0].frame),this._toe){var s={frame:e,value:i.value,inTangent:i.inTangent,outTangent:i.outTangent,interpolation:i.interpolation};n.splice(0,0,s)}if(o.framen&&this._speedRatio>0&&(this._speedRatio=-t);return this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.pause=function(){if(!this._isStarted)return this;this._isPaused=!0;for(var e=0;e-1&&this._scene.animationGroups.splice(e,1),this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()},e.prototype._checkAnimationGroupEnded=function(e){var t=this._animatables.indexOf(e);t>-1&&this._animatables.splice(t,1),0===this._animatables.length&&(this._isStarted=!1,this.onAnimationGroupEndObservable.notifyObservers(this))},e.prototype.clone=function(t,r){for(var n=new e(t||this.name,this._scene),i=0,o=this._targetedAnimations;i=.5?.5*(1-this.easeInCore(2*(1-t)))+.5:.5*this.easeInCore(2*t)},e.EASINGMODE_EASEIN=0,e.EASINGMODE_EASEOUT=1,e.EASINGMODE_EASEINOUT=2,e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e=Math.max(0,Math.min(1,e)),1-Math.sqrt(1-e*e)},t}(o),a=function(e){function t(t){void 0===t&&(t=1);var r=e.call(this)||this;return r.amplitude=t,r}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.amplitude);return Math.pow(e,3)-e*t*Math.sin(3.141592653589793*e)},t}(o),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 Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.bounces),r=this.bounciness;r<=1&&(r=1.001);var n=Math.pow(r,t),i=1-r,o=(1-n)/i+.5*n,s=e*o,a=Math.log(-s*(1-r)+1)/Math.log(r),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 Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e*e},t}(o),u=function(e){function t(t,r){void 0===t&&(t=3),void 0===r&&(r=3);var n=e.call(this)||this;return n.oscillations=t,n.springiness=r,n}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.oscillations),r=Math.max(0,this.springiness);return(0==r?e:(Math.exp(r*e)-1)/(Math.exp(r)-1))*Math.sin((6.283185307179586*t+1.5707963267948966)*e)},t}(o),h=function(e){function t(t){void 0===t&&(t=2);var r=e.call(this)||this;return r.exponent=t,r}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)},t}(o),d=function(e){function t(t){void 0===t&&(t=2);var r=e.call(this)||this;return r.power=t,r}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.power);return Math.pow(e,t)},t}(o),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e},t}(o),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e*e*e},t}(o),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return e*e*e*e*e},t}(o),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return 1-Math.sin(1.5707963267948966*(1-e))},t}(o),_=function(e){function t(t,r,n,i){void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===i&&(i=1);var o=e.call(this)||this;return o.x1=t,o.y1=r,o.x2=n,o.y2=i,o}return Object(n.__extends)(t,e),t.prototype.easeInCore=function(e){return i.BezierCurve.Interpolate(e,this.x1,this.y1,this.x2,this.y2)},t}(o)},"./Animations/index.ts": /*!*****************************!*\ !*** ./Animations/index.ts ***! \*****************************/ /*! exports provided: Animatable, _IAnimationState, 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,"_IAnimationState",function(){return i._IAnimationState}),r.d(t,"Animation",function(){return i.Animation});var o=r(/*! ./animationGroup */"./Animations/animationGroup.ts");r.d(t,"TargetedAnimation",function(){return o.TargetedAnimation}),r.d(t,"AnimationGroup",function(){return o.AnimationGroup});var s=r(/*! ./animationPropertiesOverride */"./Animations/animationPropertiesOverride.ts");r.d(t,"AnimationPropertiesOverride",function(){return s.AnimationPropertiesOverride});var a=r(/*! ./easing */"./Animations/easing.ts");r.d(t,"EasingFunction",function(){return a.EasingFunction}),r.d(t,"CircleEase",function(){return a.CircleEase}),r.d(t,"BackEase",function(){return a.BackEase}),r.d(t,"BounceEase",function(){return a.BounceEase}),r.d(t,"CubicEase",function(){return a.CubicEase}),r.d(t,"ElasticEase",function(){return a.ElasticEase}),r.d(t,"ExponentialEase",function(){return a.ExponentialEase}),r.d(t,"PowerEase",function(){return a.PowerEase}),r.d(t,"QuadraticEase",function(){return a.QuadraticEase}),r.d(t,"QuarticEase",function(){return a.QuarticEase}),r.d(t,"QuinticEase",function(){return a.QuinticEase}),r.d(t,"SineEase",function(){return a.SineEase}),r.d(t,"BezierCurveEase",function(){return a.BezierCurveEase});var 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 d});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ./animation */"./Animations/animation.ts"),s=r(/*! ../Maths/math.size */"./Maths/math.size.ts"),a=Object.freeze(new n.Quaternion(0,0,0,0)),c=Object.freeze(n.Vector3.Zero()),l=Object.freeze(n.Vector2.Zero()),u=Object.freeze(s.Size.Zero()),h=Object.freeze(i.Color3.Black()),d=function(){function e(e,t,r,i){var s=this;if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._ratioOffset=0,this._previousDelay=0,this._previousRatio=0,this._targetIsArray=!1,this._animation=t,this._target=e,this._scene=r,this._host=i,this._activeTargets=[],t._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===o.Animation.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=n.Matrix.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minValue=this._keys[0].value,this._maxValue=this._keys[this._keys.length-1].value,0!==this._minFrame){var a={frame:0,value:this._minValue};this._keys.splice(0,0,a)}if(this._target instanceof Array){for(var c=0,l=0,u=this._target;l0&&d.forEach(function(e){s._events.push(e._clone())}),this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!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._currentActiveTarget},enumerable:!0,configurable:!0}),e.prototype._preparePath=function(e,t){void 0===t&&(t=0);var r=this._animation.targetPropertyPath;if(r.length>1){for(var n=e[r[0]],i=1;i-1&&this._animation.runtimeAnimations.splice(e,1)},e.prototype.setValue=function(e,t){if(this._targetIsArray)for(var r=0;rt[t.length-1].frame&&(e=t[t.length-1].frame);var r=this._events;if(r.length)for(var n=0;nthis._maxFrame)&&(t=this._minFrame),(rthis._maxFrame)&&(r=this._maxFrame);var m,g,_=r-t,v=e*(d.framePerSecond*i)/1e3+this._ratioOffset,A=0;if(this._previousDelay=e,this._previousRatio=v,!n&&r>=t&&v>=_)p=!1,A=d._getKeyValue(this._maxValue);else if(!n&&t>=r&&v<=_)p=!1,A=d._getKeyValue(this._minValue);else if(this._animationState.loopMode!==o.Animation.ANIMATIONLOOPMODE_CYCLE){var y=r.toString()+t.toString();if(!this._offsetsCache[y]){this._animationState.repeatCount=0,this._animationState.loopMode=o.Animation.ANIMATIONLOOPMODE_CYCLE;var b=d._interpolate(t,this._animationState),T=d._interpolate(r,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),d.dataType){case o.Animation.ANIMATIONTYPE_FLOAT:this._offsetsCache[y]=T-b;break;case o.Animation.ANIMATIONTYPE_QUATERNION:this._offsetsCache[y]=T.subtract(b);break;case o.Animation.ANIMATIONTYPE_VECTOR3:this._offsetsCache[y]=T.subtract(b);case o.Animation.ANIMATIONTYPE_VECTOR2:this._offsetsCache[y]=T.subtract(b);case o.Animation.ANIMATIONTYPE_SIZE:this._offsetsCache[y]=T.subtract(b);case o.Animation.ANIMATIONTYPE_COLOR3:this._offsetsCache[y]=T.subtract(b)}this._highLimitsCache[y]=T}A=this._highLimitsCache[y],m=this._offsetsCache[y]}if(void 0===m)switch(d.dataType){case o.Animation.ANIMATIONTYPE_FLOAT:m=0;break;case o.Animation.ANIMATIONTYPE_QUATERNION:m=a;break;case o.Animation.ANIMATIONTYPE_VECTOR3:m=c;break;case o.Animation.ANIMATIONTYPE_VECTOR2:m=l;break;case o.Animation.ANIMATIONTYPE_SIZE:m=u;break;case o.Animation.ANIMATIONTYPE_COLOR3:m=h}if(this._host&&this._host.syncRoot){var M=this._host.syncRoot;g=t+(r-t)*((M.masterFrame-M.fromFrame)/(M.toFrame-M.fromFrame))}else g=p&&0!==_?t+v%_:r;var x=this._events;if((_>0&&this.currentFrame>g||_<0&&this.currentFrame>0,this._animationState.highLimitValue=A,this._animationState.offsetValue=m;var E=d._interpolate(g,this._animationState);if(this.setValue(E,s),x.length)for(P=0;P0&&g>=x[P].frame&&x[P].frame>=t||_<0&&g<=x[P].frame&&x[P].frame<=t){var C=x[P];C.isDone||(C.onlyOnce&&(x.splice(P,1),P--),C.isDone=!0,C.action(g))}return p||(this._stopped=!0),p},e}()},"./Audio/analyser.ts": /*!***************************!*\ !*** ./Audio/analyser.ts ***! \***************************/ /*! exports provided: Analyser */function(e,t,r){"use strict";r.r(t),r.d(t,"Analyser",function(){return i});var n=r(/*! ../Engines/engine */"./Engines/engine.ts"),i=function(){function e(e){this.SMOOTHING=.75,this.FFT_SIZE=512,this.BARGRAPHAMPLITUDE=256,this.DEBUGCANVASPOS={x:20,y:20},this.DEBUGCANVASSIZE={width:320,height:200},this._scene=e,this._audioEngine=n.Engine.audioEngine,this._audioEngine.canUseWebAudio&&this._audioEngine.audioContext&&(this._webAudioAnalyser=this._audioEngine.audioContext.createAnalyser(),this._webAudioAnalyser.minDecibels=-140,this._webAudioAnalyser.maxDecibels=0,this._byteFreqs=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._byteTime=new Uint8Array(this._webAudioAnalyser.frequencyBinCount),this._floatFreqs=new Float32Array(this._webAudioAnalyser.frequencyBinCount))}return e.prototype.getFrequencyBinCount=function(){return this._audioEngine.canUseWebAudio?this._webAudioAnalyser.frequencyBinCount:0},e.prototype.getByteFrequencyData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)),this._byteFreqs},e.prototype.getByteTimeDomainData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)),this._byteTime},e.prototype.getFloatFrequencyData=function(){return this._audioEngine.canUseWebAudio&&(this._webAudioAnalyser.smoothingTimeConstant=this.SMOOTHING,this._webAudioAnalyser.fftSize=this.FFT_SIZE,this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)),this._floatFreqs},e.prototype.drawDebugCanvas=function(){var e=this;if(this._audioEngine.canUseWebAudio&&(this._debugCanvas||(this._debugCanvas=document.createElement("canvas"),this._debugCanvas.width=this.DEBUGCANVASSIZE.width,this._debugCanvas.height=this.DEBUGCANVASSIZE.height,this._debugCanvas.style.position="absolute",this._debugCanvas.style.top=this.DEBUGCANVASPOS.y+"px",this._debugCanvas.style.left=this.DEBUGCANVASPOS.x+"px",this._debugCanvasContext=this._debugCanvas.getContext("2d"),document.body.appendChild(this._debugCanvas),this._registerFunc=function(){e.drawDebugCanvas()},this._scene.registerBeforeRender(this._registerFunc)),this._registerFunc&&this._debugCanvasContext)){var t=this.getByteFrequencyData();this._debugCanvasContext.fillStyle="rgb(0, 0, 0)",this._debugCanvasContext.fillRect(0,0,this.DEBUGCANVASSIZE.width,this.DEBUGCANVASSIZE.height);for(var r=0;r0?t.activeCameras[0]:t.activeCamera){this._cachedCameraPosition.equals(i.globalPosition)||(this._cachedCameraPosition.copyFrom(i.globalPosition),r.audioContext.listener.setPosition(i.globalPosition.x,i.globalPosition.y,i.globalPosition.z)),i.rigCameras&&i.rigCameras.length>0&&(i=i.rigCameras[0]);var a=s.Matrix.Invert(i.getViewMatrix()),c=s.Vector3.TransformNormal(new s.Vector3(0,0,-1),a);c.normalize(),isNaN(c.x)||isNaN(c.y)||isNaN(c.z)||this._cachedCameraDirection.equals(c)||(this._cachedCameraDirection.copyFrom(c),r.audioContext.listener.setOrientation(c.x,c.y,c.z,0,1,0))}else r.audioContext.listener.setPosition(0,0,0)}var l;for(l=0;l0&&(p=!0,this._soundLoaded(r));break;case"String":f.push(r);case"Array":0===f.length&&(f=r);for(var m=0;m0&&(this._htmlAudioElement.currentTime=0)):this._streamingSource.disconnect(),this.isPlaying=!1;else if(s.Engine.audioEngine.audioContext&&this._soundSource){var r=e?s.Engine.audioEngine.audioContext.currentTime+e:s.Engine.audioEngine.audioContext.currentTime;this._soundSource.stop(r),this._soundSource.onended=function(){t.isPlaying=!1},this.isPaused||(this._startOffset=0)}},e.prototype.pause=function(){this.isPlaying&&(this.isPaused=!0,this._streaming?this._htmlAudioElement?this._htmlAudioElement.pause():this._streamingSource.disconnect():s.Engine.audioEngine.audioContext&&(this.stop(0),this._startOffset+=s.Engine.audioEngine.audioContext.currentTime-this._startTime))},e.prototype.setVolume=function(e,t){s.Engine.audioEngine.canUseWebAudio&&this._soundGain&&(t&&s.Engine.audioEngine.audioContext?(this._soundGain.gain.cancelScheduledValues(s.Engine.audioEngine.audioContext.currentTime),this._soundGain.gain.setValueAtTime(this._soundGain.gain.value,s.Engine.audioEngine.audioContext.currentTime),this._soundGain.gain.linearRampToValueAtTime(e,s.Engine.audioEngine.audioContext.currentTime+t)):this._soundGain.gain.value=e),this._volume=e},e.prototype.setPlaybackRate=function(e){this._playbackRate=e,this.isPlaying&&(this._streaming&&this._htmlAudioElement?this._htmlAudioElement.playbackRate=this._playbackRate:this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate))},e.prototype.getVolume=function(){return this._volume},e.prototype.attachToMesh=function(e){var t=this;this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=e,this.spatialSound||(this.spatialSound=!0,this._createSpatialParameters(),this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._offset,this._length))),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=function(e){return t._onRegisterAfterWorldMatrixUpdate(e)},this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)},e.prototype.detachFromMesh=function(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)},e.prototype._onRegisterAfterWorldMatrixUpdate=function(e){if(e.getBoundingInfo){var t=e;if(this._positionInEmitterSpace)t.worldMatrixFromCache.invertToRef(o.TmpVectors.Matrix[0]),this.setPosition(o.TmpVectors.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(0,t._offset,t._length)):window.setTimeout(r,300)},n={autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,useCustomAttenuation:this.useCustomAttenuation,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel},i=new e(this.name+"_cloned",new ArrayBuffer(0),this._scene,null,n);return this.useCustomAttenuation&&i.setAttenuationFunction(this._customAttenuationFunction),i.setPosition(this._position),i.setPlaybackRate(this._playbackRate),r(),i},e.prototype.getAudioBuffer=function(){return this._audioBuffer},e.prototype.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(0,c._offset,c._length)):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._isInitialized=!1,this._scene=e,this.soundCollection=new Array,this._options=t,!this._options.mainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1)}return e.prototype._initializeSoundTrackAudioGraph=function(){n.Engine.audioEngine.canUseWebAudio&&n.Engine.audioEngine.audioContext&&(this._outputAudioNode=n.Engine.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(n.Engine.audioEngine.masterGain),this._options&&this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._isInitialized=!0)},e.prototype.dispose=function(){if(n.Engine.audioEngine&&n.Engine.audioEngine.canUseWebAudio){for(this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas();this.soundCollection.length;)this.soundCollection[0].dispose();this._outputAudioNode&&this._outputAudioNode.disconnect(),this._outputAudioNode=null}},e.prototype.AddSound=function(e){this._isInitialized||this._initializeSoundTrackAudioGraph(),n.Engine.audioEngine.canUseWebAudio&&this._outputAudioNode&&e.connectToSoundTrackAudioNode(this._outputAudioNode),e.soundTrackId&&(-1===e.soundTrackId?this._scene.mainSoundTrack.RemoveSound(e):this._scene.soundTracks&&this._scene.soundTracks[e.soundTrackId].RemoveSound(e)),this.soundCollection.push(e),e.soundTrackId=this.id},e.prototype.RemoveSound=function(e){var t=this.soundCollection.indexOf(e);-1!==t&&this.soundCollection.splice(t,1)},e.prototype.setVolume=function(e){n.Engine.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=e)},e.prototype.switchPanningModelToHRTF=function(){if(n.Engine.audioEngine.canUseWebAudio)for(var e=0;e0?1/i:0,c=0;c0},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 c});var n=r(/*! ../../Animations/easing */"./Animations/easing.ts"),i=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),o=r(/*! ../../Misc/precisionDate */"./Misc/precisionDate.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Animations/animation */"./Animations/animation.ts"),c=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 s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new s.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),o=0;ol.upperRadiusLimit?l.upperRadiusLimit:c),c):0},e.prototype._maintainCameraAboveGround=function(){var t=this;if(!(this._elevationReturnTime<0)){var r=o.PrecisionDate.Now-this._lastInteractionTime,n=.5*Math.PI-this._defaultElevation,i=.5*Math.PI;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>i&&r>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=a.Animation.CreateAnimation("beta",a.Animation.ANIMATIONTYPE_FLOAT,60,e.EasingFunction));var s=a.Animation.TransitionTo("beta",n,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,function(){t._clearAnimationLocks(),t.stopAllAnimations()});s&&this._animatables.push(s)}}},e.prototype._getFrustumSlope=function(){var e=this._attachedCamera;if(!e)return s.Vector2.Zero();var t=e.getScene().getEngine().getAspectRatio(e),r=Math.tan(e.fov/2),n=r*t;return new s.Vector2(n,r)},e.prototype._clearAnimationLocks=function(){this._betaIsAnimating=!1},e.prototype._applyUserInteraction=function(){this.isUserIsMoving&&(this._lastInteractionTime=o.PrecisionDate.Now,this.stopAllAnimations(),this._clearAnimationLocks())},e.prototype.stopAllAnimations=function(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()},Object.defineProperty(e.prototype,"isUserIsMoving",{get:function(){return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)},enumerable:!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.vector */"./Maths/math.vector.ts"),i=function(e,t,r,i){void 0===t&&(t=new n.Vector3),void 0===r&&(r=0),void 0===i&&(i=!1),this.direction=e,this.rotatedDirection=t,this.diff=r,this.ignore=i},o=function(){function e(e){this.ui=e,this.name="AttachToBoxBehavior",this.distanceAwayFromFace=.15,this.distanceAwayFromBottomOfFace=.15,this._faceVectors=[new i(n.Vector3.Up()),new i(n.Vector3.Down()),new i(n.Vector3.Left()),new i(n.Vector3.Right()),new i(n.Vector3.Forward()),new i(n.Vector3.Forward().scaleInPlace(-1))],this._tmpMatrix=new n.Matrix,this._tmpVector=new n.Vector3,this._zeroVector=n.Vector3.Zero(),this._lookAtTmpMatrix=new n.Matrix}return e.prototype.init=function(){},e.prototype._closestFace=function(e){var t=this;return this._faceVectors.forEach(function(r){t._target.rotationQuaternion||(t._target.rotationQuaternion=n.Quaternion.RotationYawPitchRoll(t._target.rotation.y,t._target.rotation.x,t._target.rotation.z)),t._target.rotationQuaternion.toRotationMatrix(t._tmpMatrix),n.Vector3.TransformCoordinatesToRef(r.direction,t._tmpMatrix,r.rotatedDirection),r.diff=n.Vector3.GetAngleBetweenVectors(r.rotatedDirection,e,n.Vector3.Cross(r.rotatedDirection,e))}),this._faceVectors.reduce(function(e,t){return e.ignore?t:t.ignore?e:e.diff1)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.vector */"./Maths/math.vector.ts"),o=function(){function e(){this._startDistance=0,this._initialScale=new i.Vector3(0,0,0),this._targetScale=new i.Vector3(0,0,0),this._sceneRenderObserver=null,this._dragBehaviorA=new n.PointerDragBehavior({}),this._dragBehaviorA.moveAttached=!1,this._dragBehaviorB=new n.PointerDragBehavior({}),this._dragBehaviorB.moveAttached=!1}return Object.defineProperty(e.prototype,"name",{get:function(){return"MultiPointerScale"},enumerable:!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.vector */"./Maths/math.vector.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.startAndReleaseDragOnPointerEvents=!0,this.detachCameraControls=!0,this.useObjectOrientationForDragging=!0,this.validateDrag=function(e){return!0},this._tmpVector=new s.Vector3(0,0,0),this._alternatePickedPoint=new s.Vector3(0,0,0),this._worldDragAxis=new s.Vector3(0,0,0),this._targetPosition=new s.Vector3(0,0,0),this._attachedElement=null,this._startDragRay=new 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,"options",{get:function(){return this._options},set:function(e){this._options=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return"PointerDrag"},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t,r){var o=this;this._scene=t.getScene(),this.attachedNode=t,e._planeScene||(this._debugMode?e._planeScene=this._scene:(e._planeScene=new i.Scene(this._scene.getEngine(),{virtual:!0}),e._planeScene.detachControl(),this._scene.onDisposeObservable.addOnce(function(){e._planeScene.dispose(),e._planeScene=null}))),this._dragPlane=n.Mesh.CreatePlane("pointerDragPlane",this._debugMode?1:1e4,e._planeScene,!1,n.Mesh.DOUBLESIDE),this.lastDragPosition=new s.Vector3(0,0,0);var u=r||function(e){return o.attachedNode==e||e.isDescendantOf(o.attachedNode)};this._pointerObserver=this._scene.onPointerObservable.add(function(t,r){if(o.enabled)if(t.type==a.PointerEventTypes.POINTERDOWN)o.startAndReleaseDragOnPointerEvents&&!o.dragging&&t.pickInfo&&t.pickInfo.hit&&t.pickInfo.pickedMesh&&t.pickInfo.pickedPoint&&t.pickInfo.ray&&u(t.pickInfo.pickedMesh)&&o._startDrag(t.event.pointerId,t.pickInfo.ray,t.pickInfo.pickedPoint);else if(t.type==a.PointerEventTypes.POINTERUP)o.startAndReleaseDragOnPointerEvents&&o.currentDraggingPointerID==t.event.pointerId&&o.releaseDrag();else if(t.type==a.PointerEventTypes.POINTERMOVE){var n=t.event.pointerId;o.currentDraggingPointerID===e._AnyMouseID&&n!==e._AnyMouseID&&"mouse"==t.event.pointerType&&(o._lastPointerRay[o.currentDraggingPointerID]&&(o._lastPointerRay[n]=o._lastPointerRay[o.currentDraggingPointerID],delete o._lastPointerRay[o.currentDraggingPointerID]),o.currentDraggingPointerID=n),o._lastPointerRay[n]||(o._lastPointerRay[n]=new c.Ray(new s.Vector3,new s.Vector3)),t.pickInfo&&t.pickInfo.ray&&(o._lastPointerRay[n].origin.copyFrom(t.pickInfo.ray.origin),o._lastPointerRay[n].direction.copyFrom(t.pickInfo.ray.direction),o.currentDraggingPointerID==n&&o.dragging&&o._moveDrag(t.pickInfo.ray))}}),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(function(){o._moving&&o.moveAttached&&(l.PivotTools._RemoveAndStorePivotPoint(o.attachedNode),o._targetPosition.subtractToRef(o.attachedNode.absolutePosition,o._tmpVector),o._tmpVector.scaleInPlace(o.dragDeltaRatio),o.attachedNode.getAbsolutePosition().addToRef(o._tmpVector,o._tmpVector),o.validateDrag(o._tmpVector)&&o.attachedNode.setAbsolutePosition(o._tmpVector),l.PivotTools._RestorePivotPoint(o.attachedNode))})},e.prototype.releaseDrag=function(){this.dragging&&(this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerID}),this.dragging=!1),this.currentDraggingPointerID=-1,this._moving=!1,this.detachCameraControls&&this._attachedElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera&&this._scene.activeCamera.attachControl(this._attachedElement,!this._scene.activeCamera.inputs||this._scene.activeCamera.inputs.noPreventDefault)},e.prototype.startDrag=function(t,r,n){void 0===t&&(t=e._AnyMouseID),this._startDrag(t,r,n);var i=this._lastPointerRay[t];t===e._AnyMouseID&&(i=this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]),i&&this._moveDrag(i)},e.prototype._startDrag=function(e,t,r){if(this._scene.activeCamera&&!this.dragging&&this.attachedNode){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.inputs&&!this._scene.activeCamera.leftCamera&&(this._scene.activeCamera.inputs.attachedElement?(this._attachedElement=this._scene.activeCamera.inputs.attachedElement,this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement)):this._attachedElement=null)),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?(this.useObjectOrientationForDragging?s.Vector3.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis):this._worldDragAxis.copyFrom(this._options.dragAxis),t.subtractToRef(this.lastDragPosition,this._tmpVector),r=s.Vector3.Dot(this._tmpVector,this._worldDragAxis),this._worldDragAxis.scaleToRef(r,this._dragDelta)):(r=this._dragDelta.length(),t.subtractToRef(this.lastDragPosition,this._dragDelta)),this._targetPosition.addInPlace(this._dragDelta),this.onDragObservable.notifyObservers({dragDistance:r,delta:this._dragDelta,dragPlanePoint:t,dragPlaneNormal:this._dragPlane.forward,pointerId:this.currentDraggingPointerID}),this.lastDragPosition.copyFrom(t)}},e.prototype._pickWithRayOnDragPlane=function(t){var r=this;if(!t)return null;var n=Math.acos(s.Vector3.Dot(this._dragPlane.forward,t.direction));if(n>Math.PI/2&&(n=Math.PI-n),this.maxDragAngle>0&&n>this.maxDragAngle){if(this._useAlternatePickedPointAboveMaxDragAngle){this._tmpVector.copyFrom(t.direction),this.attachedNode.absolutePosition.subtractToRef(t.origin,this._alternatePickedPoint),this._alternatePickedPoint.normalize(),this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed*s.Vector3.Dot(this._alternatePickedPoint,this._tmpVector)),this._tmpVector.addInPlace(this._alternatePickedPoint);var i=s.Vector3.Dot(this._dragPlane.forward,this._tmpVector);return this._dragPlane.forward.scaleToRef(-i,this._alternatePickedPoint),this._alternatePickedPoint.addInPlace(this._tmpVector),this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition),this._alternatePickedPoint}return null}var o=e._planeScene.pickWithRay(t,function(e){return e==r._dragPlane});return o&&o.hit&&o.pickedMesh&&o.pickedPoint?o.pickedPoint:null},e.prototype._updateDragPlanePosition=function(e,t){this._pointA.copyFrom(t),this._options.dragAxis?(this.useObjectOrientationForDragging?s.Vector3.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragAxis),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.useObjectOrientationForDragging?s.Vector3.TransformCoordinatesToRef(this._options.dragPlaneNormal,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragPlaneNormal),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._localAxis,this._lookAt),this._dragPlane.lookAt(this._lookAt)):(this._dragPlane.position.copyFrom(this._pointA),this._dragPlane.lookAt(e.origin)),this._dragPlane.position.copyFrom(this.attachedNode.absolutePosition),this._dragPlane.computeWorldMatrix(!0)},e.prototype.detach=function(){this._pointerObserver&&this._scene.onPointerObservable.remove(this._pointerObserver),this._beforeRenderObserver&&this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver),this.releaseDrag()},e._AnyMouseID=-2,e}())},"./Behaviors/Meshes/sixDofDragBehavior.ts": /*!************************************************!*\ !*** ./Behaviors/Meshes/sixDofDragBehavior.ts ***! \************************************************/ /*! exports provided: SixDofDragBehavior */function(e,t,r){"use strict";r.r(t),r.d(t,"SixDofDragBehavior",function(){return u});var n=r(/*! ../../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),i=r(/*! ../../scene */"./scene.ts"),o=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Misc/observable */"./Misc/observable.ts"),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(){},Object.defineProperty(e.prototype,"_pointerCamera",{get:function(){return this._scene.cameraToUseForPointers?this._scene.cameraToUseForPointers:this._scene.activeCamera},enumerable:!0,configurable:!0}),e.prototype.attach=function(t){var r=this;this._ownerNode=t,this._scene=this._ownerNode.getScene(),e._virtualScene||(e._virtualScene=new i.Scene(this._scene.getEngine()),e._virtualScene.detachControl(),this._scene.getEngine().scenes.pop());var a=null,u=new s.Vector3(0,0,0);this._virtualOriginMesh=new n.AbstractMesh("",e._virtualScene),this._virtualOriginMesh.rotationQuaternion=new s.Quaternion,this._virtualDragMesh=new n.AbstractMesh("",e._virtualScene),this._virtualDragMesh.rotationQuaternion=new s.Quaternion;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._pointerCamera&&r._pointerCamera.cameraRigMode==c.Camera.RIG_MODE_NONE&&e.pickInfo.ray.origin.copyFrom(r._pointerCamera.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._pointerCamera&&!r._pointerCamera.leftCamera&&(r._pointerCamera.inputs.attachedElement?(h=r._pointerCamera.inputs.attachedElement,r._pointerCamera.detachControl(r._pointerCamera.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._pointerCamera&&!r._pointerCamera.leftCamera&&r._pointerCamera.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._pointerCamera&&r._pointerCamera.cameraRigMode==c.Camera.RIG_MODE_NONE&&(e.pickInfo.ray.origin.copyFrom(r._pointerCamera.globalPosition),i=0);var d=e.pickInfo.ray.origin.subtract(u);u.copyFrom(e.pickInfo.ray.origin);var 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 c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),s=r(/*! ../node */"./node.ts"),a=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),c=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())||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._waitingTransformNodeId=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 Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"_matrix",{get:function(){return this._compose(),this._localMatrix},set:function(e){this._localMatrix.copyFrom(e),this._needToDecompose=!0},enumerable:!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.getIndex=function(){return null===this._index?this.getSkeleton().bones.indexOf(this):this._index},t.prototype.setParent=function(e,t){if(void 0===t&&(t=!0),this._parent!==e){if(this._parent){var r=this._parent.children.indexOf(this);-1!==r&&this._parent.children.splice(r,1)}this._parent=e,this._parent&&this._parent.children.push(this),t&&this._updateDifferenceMatrix(),this.markAsDirty()}},t.prototype.getLocalMatrix=function(){return this._compose(),this._localMatrix},t.prototype.getBaseMatrix=function(){return this._baseMatrix},t.prototype.getRestPose=function(){return this._restPose},t.prototype.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++},t.prototype.getTransformNode=function(){return this._linkedTransformNode},Object.defineProperty(t.prototype,"position",{get:function(){return this._decompose(),this._localPosition},set:function(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()},enumerable:!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._localScaling?(this._needToCompose=!1,i.Matrix.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix)):this._needToCompose=!1)},t.prototype.updateMatrix=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0),this._baseMatrix.copyFrom(e),t&&this._updateDifferenceMatrix(),r?(this._localMatrix.copyFrom(e),this._markAsDirtyAndDecompose()):this.markAsDirty()},t.prototype._updateDifferenceMatrix=function(e,t){if(void 0===t&&(t=!0),e||(e=this._baseMatrix),this._parent?e.multiplyToRef(this._parent._absoluteTransform,this._absoluteTransform):this._absoluteTransform.copyFrom(e),this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform),t)for(var r=0;r0&&(this._rightHandedSystem=!0,this._bendAxis.x=0,this._bendAxis.y=0,this._bendAxis.z=-1,o.x>o.y&&o.x>o.z&&(this._adjustRoll=.5*Math.PI,this._bendAxis.z=1)),this._bone1.length){var s=this._bone1.getScale(),a=this._bone2.getScale();this._bone1Length=this._bone1.length*s.y*this.mesh.scaling.y,this._bone2Length=this._bone2.length*a.y*this.mesh.scaling.y}else if(this._bone1.children[0]){e.computeWorldMatrix(!0);var c=this._bone2.children[0].getAbsolutePosition(e),l=this._bone2.getAbsolutePosition(e),u=this._bone1.getAbsolutePosition(e);this._bone1Length=n.Vector3.Distance(c,l),this._bone2Length=n.Vector3.Distance(l,u)}this._bone1.getRotationMatrixToRef(i.Space.WORLD,e,this._bone1Mat),this.maxAngle=Math.PI,r&&(r.targetMesh&&(this.targetMesh=r.targetMesh,this.targetMesh.computeWorldMatrix(!0)),r.poleTargetMesh?(this.poleTargetMesh=r.poleTargetMesh,this.poleTargetMesh.computeWorldMatrix(!0)):r.poleTargetBone?this.poleTargetBone=r.poleTargetBone:this._bone1.getParent()&&(this.poleTargetBone=this._bone1.getParent()),r.poleTargetLocalOffset&&this.poleTargetLocalOffset.copyFrom(r.poleTargetLocalOffset),r.poleAngle&&(this.poleAngle=r.poleAngle),r.bendAxis&&this._bendAxis.copyFrom(r.bendAxis),r.maxAngle&&(this.maxAngle=r.maxAngle),r.slerpAmount&&(this.slerpAmount=r.slerpAmount))}}return Object.defineProperty(e.prototype,"maxAngle",{get:function(){return this._maxAngle},set:function(e){this._setMaxAngle(e)},enumerable:!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,o=this.poleTargetPosition,s=e._tmpMats[0],a=e._tmpMats[1];this.targetMesh&&r.copyFrom(this.targetMesh.getAbsolutePosition()),this.poleTargetBone?this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset,this.mesh,o):this.poleTargetMesh&&n.Vector3.TransformCoordinatesToRef(this.poleTargetLocalOffset,this.poleTargetMesh.getWorldMatrix(),o);var c=e._tmpVecs[0],l=e._tmpVecs[1],u=e._tmpVecs[2],h=e._tmpVecs[3],d=e._tmpVecs[4],f=e._tmpQuat;t.getAbsolutePositionToRef(this.mesh,c),o.subtractToRef(c,d),0==d.x&&0==d.y&&0==d.z?d.y=1:d.normalize(),r.subtractToRef(c,h),h.normalize(),n.Vector3.CrossToRef(h,d,l),l.normalize(),n.Vector3.CrossToRef(h,l,u),u.normalize(),n.Matrix.FromXYZAxesToRef(u,h,l,s);var p=this._bone1Length,m=this._bone2Length,g=n.Vector3.Distance(c,r);this._maxReach>0&&(g=Math.min(this._maxReach,g));var _=(m*m+g*g-p*p)/(2*m*g),v=(g*g+p*p-m*m)/(2*g*p);_>1&&(_=1),v>1&&(v=1),_<-1&&(_=-1),v<-1&&(v=-1);var A=Math.acos(_),y=Math.acos(v),b=-A-y;if(this._rightHandedSystem)n.Matrix.RotationYawPitchRollToRef(0,0,this._adjustRoll,a),a.multiplyToRef(s,s),n.Matrix.RotationAxisToRef(this._bendAxis,y,a),a.multiplyToRef(s,s);else{var T=e._tmpVecs[5];T.copyFrom(this._bendAxis),T.x*=-1,n.Matrix.RotationAxisToRef(T,-y,a),a.multiplyToRef(s,s)}this.poleAngle&&(n.Matrix.RotationAxisToRef(h,this.poleAngle,a),s.multiplyToRef(a,s)),this._bone1&&(this.slerpAmount<1?(this._slerping||n.Quaternion.FromRotationMatrixToRef(this._bone1Mat,this._bone1Quat),n.Quaternion.FromRotationMatrixToRef(s,f),n.Quaternion.SlerpToRef(this._bone1Quat,f,this.slerpAmount,this._bone1Quat),b=this._bone2Ang*(1-this.slerpAmount)+b*this.slerpAmount,this._bone1.setRotationQuaternion(this._bone1Quat,i.Space.WORLD,this.mesh),this._slerping=!0):(this._bone1.setRotationMatrix(s,i.Space.WORLD,this.mesh),this._bone1Mat.copyFrom(s),this._slerping=!1)),this._bone2.setAxisAngle(this._bendAxis,b,i.Space.LOCAL),this._bone2Ang=b}},e._tmpVecs=[n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero(),n.Vector3.Zero()],e._tmpQuat=n.Quaternion.Identity(),e._tmpMats=[n.Matrix.Identity(),n.Matrix.Identity()],e}()},"./Bones/boneLookController.ts": /*!*************************************!*\ !*** ./Bones/boneLookController.ts ***! \*************************************/ /*! exports provided: BoneLookController */function(e,t,r){"use strict";r.r(t),r.d(t,"BoneLookController",function(){return s});var n=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),s=function(){function e(e,t,r,n){if(this.upAxis=i.Vector3.Up(),this.upAxisSpace=o.Space.LOCAL,this.adjustYaw=0,this.adjustPitch=0,this.adjustRoll=0,this.slerpAmount=1,this._boneQuat=i.Quaternion.Identity(),this._slerping=!1,this._firstFrameSkipped=!1,this._fowardAxis=i.Vector3.Forward(),this.mesh=e,this.bone=t,this.target=r,n&&(n.adjustYaw&&(this.adjustYaw=n.adjustYaw),n.adjustPitch&&(this.adjustPitch=n.adjustPitch),n.adjustRoll&&(this.adjustRoll=n.adjustRoll),null!=n.maxYaw?this.maxYaw=n.maxYaw:this.maxYaw=Math.PI,null!=n.minYaw?this.minYaw=n.minYaw:this.minYaw=-Math.PI,null!=n.maxPitch?this.maxPitch=n.maxPitch:this.maxPitch=Math.PI,null!=n.minPitch?this.minPitch=n.minPitch:this.minPitch=-Math.PI,null!=n.slerpAmount&&(this.slerpAmount=n.slerpAmount),null!=n.upAxis&&(this.upAxis=n.upAxis),null!=n.upAxisSpace&&(this.upAxisSpace=n.upAxisSpace),null!=n.yawAxis||null!=n.pitchAxis)){var s=o.Axis.Y,a=o.Axis.X;null!=n.yawAxis&&(s=n.yawAxis.clone()).normalize(),null!=n.pitchAxis&&(a=n.pitchAxis.clone()).normalize();var c=i.Vector3.Cross(a,s);this._transformYawPitch=i.Matrix.Identity(),i.Matrix.FromXYZAxesToRef(a,s,c,this._transformYawPitch),this._transformYawPitchInv=this._transformYawPitch.clone(),this._transformYawPitch.invert()}t.getParent()||this.upAxisSpace!=o.Space.BONE||(this.upAxisSpace=o.Space.LOCAL)}return Object.defineProperty(e.prototype,"minYaw",{get:function(){return this._minYaw},set:function(e){this._minYaw=e,this._minYawSin=Math.sin(e),this._minYawCos=Math.cos(e),null!=this._maxYaw&&(this._midYawConstraint=.5*this._getAngleDiff(this._minYaw,this._maxYaw)+this._minYaw,this._yawRange=this._maxYaw-this._minYaw)},enumerable:!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,s=e._tmpMats[0],a=e._tmpMats[1],c=this.mesh,l=t.getParent(),u=e._tmpVecs[1];u.copyFrom(this.upAxis),this.upAxisSpace==o.Space.BONE&&l?(this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(u,this._transformYawPitchInv,u),l.getDirectionToRef(u,this.mesh,u)):this.upAxisSpace==o.Space.LOCAL&&(c.getDirectionToRef(u,u),1==c.scaling.x&&1==c.scaling.y&&1==c.scaling.z||u.normalize());var h=!1,d=!1;if(this._maxYaw==Math.PI&&this._minYaw==-Math.PI||(h=!0),this._maxPitch==Math.PI&&this._minPitch==-Math.PI||(d=!0),h||d){var f=e._tmpMats[2],p=e._tmpMats[3];if(this.upAxisSpace==o.Space.BONE&&1==u.y&&l)l.getRotationMatrixToRef(o.Space.WORLD,this.mesh,f);else if(this.upAxisSpace!=o.Space.LOCAL||1!=u.y||l){(g=e._tmpVecs[2]).copyFrom(this._fowardAxis),this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(g,this._transformYawPitchInv,g),l?l.getDirectionToRef(g,this.mesh,g):c.getDirectionToRef(g,g);var m=i.Vector3.Cross(u,g);m.normalize();var g=i.Vector3.Cross(m,u);i.Matrix.FromXYZAxesToRef(m,u,g,f)}else f.copyFrom(c.getWorldMatrix());f.invertToRef(p);var _=null;if(d){var v=e._tmpVecs[3];n.subtractToRef(r,v),i.Vector3.TransformCoordinatesToRef(v,p,v),_=Math.sqrt(v.x*v.x+v.z*v.z);var A=Math.atan2(v.y,_),y=A;A>this._maxPitch?(v.y=this._maxPitchTan*_,y=this._maxPitch):Athis._maxYaw||bMath.PI?this._isAngleBetween(b,this._maxYaw,this._midYawConstraint)?(v.z=this._maxYawCos*_,v.x=this._maxYawSin*_,T=this._maxYaw):this._isAngleBetween(b,this._midYawConstraint,this._minYaw)&&(v.z=this._minYawCos*_,v.x=this._minYawSin*_,T=this._minYaw):b>this._maxYaw?(v.z=this._maxYawCos*_,v.x=this._maxYawSin*_,T=this._maxYaw):bMath.PI){var M=e._tmpVecs[8];M.copyFrom(o.Axis.Z),this._transformYawPitch&&i.Vector3.TransformCoordinatesToRef(M,this._transformYawPitchInv,M);var x=e._tmpMats[4];this._boneQuat.toRotationMatrix(x),this.mesh.getWorldMatrix().multiplyToRef(x,x),i.Vector3.TransformCoordinatesToRef(M,x,M),i.Vector3.TransformCoordinatesToRef(M,p,M);var P=Math.atan2(M.x,M.z);if(this._getAngleBetween(P,b)>this._getAngleBetween(P,this._midYawConstraint)){null==_&&(_=Math.sqrt(v.x*v.x+v.z*v.z));var E=this._getAngleBetween(P,this._maxYaw);this._getAngleBetween(P,this._minYaw)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&&er&&e0}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},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(e){return this.needInitialSkinMatrix&&e._transformMatrixTexture?e._transformMatrixTexture:this._transformMatrixTexture},e.prototype.getScene=function(){return this._scene},e.prototype.toString=function(e){var t="Name: "+this.name+", nBones: "+this.bones.length;if(t+=", nAnimationRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var r=!0;for(var n in this._ranges)r&&(t+=", ",r=!1),t+=n;t+="}"}return t},e.prototype.getBoneIndexByName=function(e){for(var t=0,r=this.bones.length;t-1&&this._meshesWithPoseMatrix.splice(t,1)},e.prototype._computeTransformMatrices=function(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(var r=0;r0)for(var e=0,t=this.bones;e0&&(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-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)),void 0!==c.linkedTransformNodeId&&null!==c.linkedTransformNodeId&&(s._hasWaitingData=!0,h._waitingTransformNodeId=c.linkedTransformNodeId)}if(t.ranges)for(i=0;i0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e},e.prototype.sortBones=function(){for(var e=new Array,t=new Array(this.bones.length),r=0;r.005&&(e.inertialAlphaOffset+=r)}if(0!=t.y){var n=t.y/this.gamepadRotationSensibility*this._yAxisScale;0!=n&&Math.abs(n)>.005&&(e.inertialBetaOffset+=n)}}var i=this.gamepad.leftStick;if(i&&0!=i.y){var o=i.y/this.gamepadMoveSensibility;0!=o&&Math.abs(o)>.005&&(this.camera.inertialRadiusOffset-=o)}}},e.prototype.getClassName=function(){return"ArcRotateCameraGamepadInput"},e.prototype.getSimpleName=function(){return"gamepad"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadRotationSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadMoveSensibility",void 0),e}();o.CameraInputTypes.ArcRotateCameraGamepadInput=a},"./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts": /*!************************************************************!*\ !*** ./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts ***! \************************************************************/ /*! exports provided: ArcRotateCameraKeyboardMoveInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/keyboardEvents */"./Events/keyboardEvents.ts"),a=function(){function e(){this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.panningSensibility=50,this.zoomingSensibility=25,this.useAltToZoom=!0,this.angularSpeed=.01,this._keys=new Array}return e.prototype.attachControl=function(e,t){var r=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){r._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(e){var n,i=e.event;i.metaKey||(e.type===s.KeyboardEventTypes.KEYDOWN?(r._ctrlPressed=i.ctrlKey,r._altPressed=i.altKey,(-1!==r.keysUp.indexOf(i.keyCode)||-1!==r.keysDown.indexOf(i.keyCode)||-1!==r.keysLeft.indexOf(i.keyCode)||-1!==r.keysRight.indexOf(i.keyCode)||-1!==r.keysReset.indexOf(i.keyCode))&&(-1===(n=r._keys.indexOf(i.keyCode))&&r._keys.push(i.keyCode),i.preventDefault&&(t||i.preventDefault()))):-1===r.keysUp.indexOf(i.keyCode)&&-1===r.keysDown.indexOf(i.keyCode)&&-1===r.keysLeft.indexOf(i.keyCode)&&-1===r.keysRight.indexOf(i.keyCode)&&-1===r.keysReset.indexOf(i.keyCode)||((n=r._keys.indexOf(i.keyCode))>=0&&r._keys.splice(n,1),i.preventDefault&&(t||i.preventDefault())))}))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){if(this._onKeyboardObserver)for(var e=this.camera,t=0;t0?r/(1+this.wheelDeltaPercentage):r*(1+this.wheelDeltaPercentage)},e.prototype.attachControl=function(e,t){var r=this;this._wheel=function(e,n){if(e.type===s.PointerEventTypes.POINTERWHEEL){var i=e.event,o=0,c=i,l=0;if(l=c.wheelDelta?c.wheelDelta:60*-(i.deltaY||i.detail),r.wheelDeltaPercentage){if((o=r.computeDeltaFromMouseWheelLegacyEvent(l,r.camera.radius))>0){for(var u=r.camera.radius,h=r.camera.inertialRadiusOffset+o,d=0;d<20&&Math.abs(h)>.001;d++)u-=h,h*=r.camera.inertia;u=a.Scalar.Clamp(u,0,Number.MAX_VALUE),o=r.computeDeltaFromMouseWheelLegacyEvent(l,u)}}else o=l/(40*r.wheelPrecision);o&&(r.camera.inertialRadiusOffset+=o),i.preventDefault&&(t||i.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,s.PointerEventTypes.POINTERWHEEL)},e.prototype.detachControl=function(e){this._observer&&e&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._wheel=null)},e.prototype.getClassName=function(){return"ArcRotateCameraMouseWheelInput"},e.prototype.getSimpleName=function(){return"mousewheel"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelDeltaPercentage",void 0),e}();o.CameraInputTypes.ArcRotateCameraMouseWheelInput=c},"./Cameras/Inputs/arcRotateCameraPointersInput.ts": /*!********************************************************!*\ !*** ./Cameras/Inputs/arcRotateCameraPointersInput.ts ***! \********************************************************/ /*! exports provided: ArcRotateCameraPointersInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraPointersInput",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[0,1,2],t.angularSensibilityX=1e3,t.angularSensibilityY=1e3,t.pinchPrecision=12,t.pinchDeltaPercentage=0,t.useNaturalPinchZoom=!1,t.panningSensibility=1e3,t.multiTouchPanning=!0,t.multiTouchPanAndZoom=!0,t.pinchInwards=!0,t._isPanClick=!1,t._twoFingerActivityCount=0,t._isPinching=!1,t}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"ArcRotateCameraPointersInput"},t.prototype.onTouch=function(e,t,r){0!==this.panningSensibility&&(this._ctrlKey&&this.camera._useCtrlForPanning||this._isPanClick)?(this.camera.inertialPanningX+=-t/this.panningSensibility,this.camera.inertialPanningY+=r/this.panningSensibility):(this.camera.inertialAlphaOffset-=t/this.angularSensibilityX,this.camera.inertialBetaOffset-=r/this.angularSensibilityY)},t.prototype.onDoubleTap=function(e){this.camera.useInputToRestoreState&&this.camera.restoreState()},t.prototype.onMultiTouch=function(e,t,r,n,i,o){if(!(0===r&&null===i||0===n&&null===o)){var s=this.pinchInwards?1:-1;if(this.multiTouchPanAndZoom){if(this.useNaturalPinchZoom?this.camera.radius=this.camera.radius*Math.sqrt(r)/Math.sqrt(n):this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=.001*(n-r)*this.camera.radius*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(n-r)/(this.pinchPrecision*s*(this.angularSensibilityX+this.angularSensibilityY)/2),0!==this.panningSensibility&&i&&o){var a=o.x-i.x,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},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"buttons",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityX",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchDeltaPercentage",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useNaturalPinchZoom",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"panningSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"multiTouchPanning",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"multiTouchPanAndZoom",void 0),t}(r(/*! ../../Cameras/Inputs/BaseCameraPointersInput */"./Cameras/Inputs/BaseCameraPointersInput.ts").BaseCameraPointersInput);o.CameraInputTypes.ArcRotateCameraPointersInput=s},"./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts": /*!*******************************************************************!*\ !*** ./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts ***! \*******************************************************************/ /*! exports provided: ArcRotateCameraVRDeviceOrientationInput */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return s});var n=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),i=r(/*! ../../Cameras/arcRotateCameraInputsManager */"./Cameras/arcRotateCameraInputsManager.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts");i.ArcRotateCameraInputsManager.prototype.addVRDeviceOrientation=function(){return this.add(new s),this};var s=function(){function e(){this.alphaCorrection=1,this.gammaCorrection=1,this._alpha=0,this._gamma=0,this._dirty=!1,this._deviceOrientationHandler=this._onOrientationEvent.bind(this)}return e.prototype.attachControl=function(e,t){var r=this;this.camera.attachControl(e,t);var n=this.camera.getScene().getEngine().getHostWindow();n&&("undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(e){"granted"===e?n.addEventListener("deviceorientation",r._deviceOrientationHandler):o.Tools.Warn("Permission not granted.")}).catch(function(e){o.Tools.Error(e)}):n.addEventListener("deviceorientation",this._deviceOrientationHandler))},e.prototype._onOrientationEvent=function(e){null!==e.alpha&&(this._alpha=(0|+e.alpha)*this.alphaCorrection),null!==e.gamma&&(this._gamma=(0|+e.gamma)*this.gammaCorrection),this._dirty=!0},e.prototype.checkInputs=function(){this._dirty&&(this._dirty=!1,this._gamma<0&&(this._gamma=180+this._gamma),this.camera.alpha=-this._alpha/180*Math.PI%Math.PI*2,this.camera.beta=this._gamma/180*Math.PI)},e.prototype.detachControl=function(e){window.removeEventListener("deviceorientation",this._deviceOrientationHandler)},e.prototype.getClassName=function(){return"ArcRotateCameraVRDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"VRDeviceOrientation"},e}();n.CameraInputTypes.ArcRotateCameraVRDeviceOrientationInput=s},"./Cameras/Inputs/flyCameraKeyboardInput.ts": /*!**************************************************!*\ !*** ./Cameras/Inputs/flyCameraKeyboardInput.ts ***! \**************************************************/ /*! exports provided: FlyCameraKeyboardInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FlyCameraKeyboardInput",function(){return 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.vector */"./Maths/math.vector.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=0&&r._keys.splice(n,1),i.preventDefault&&(t||i.preventDefault())))}))},e.prototype.detachControl=function(e){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys=[]},e.prototype.checkInputs=function(){var e=this;this._onKeyboardObserver&&this._keys.forEach(function(t){-1!==e.keysHeightOffsetIncr.indexOf(t)&&e._modifierHeightOffset()?e.camera.heightOffset+=e.heightSensibility:-1!==e.keysHeightOffsetDecr.indexOf(t)&&e._modifierHeightOffset()?e.camera.heightOffset-=e.heightSensibility:-1!==e.keysRotationOffsetIncr.indexOf(t)&&e._modifierRotationOffset()?(e.camera.rotationOffset+=e.rotationSensibility,e.camera.rotationOffset%=360):-1!==e.keysRotationOffsetDecr.indexOf(t)&&e._modifierRotationOffset()?(e.camera.rotationOffset-=e.rotationSensibility,e.camera.rotationOffset%=360):-1!==e.keysRadiusIncr.indexOf(t)&&e._modifierRadius()?e.camera.radius+=e.radiusSensibility:-1!==e.keysRadiusDecr.indexOf(t)&&e._modifierRadius()&&(e.camera.radius-=e.radiusSensibility)})},e.prototype.getClassName=function(){return"FollowCameraKeyboardMoveInput"},e.prototype.getSimpleName=function(){return"keyboard"},e.prototype._modifierHeightOffset=function(){return this.keysHeightOffsetModifierAlt===this._altPressed&&this.keysHeightOffsetModifierCtrl===this._ctrlPressed&&this.keysHeightOffsetModifierShift===this._shiftPressed},e.prototype._modifierRotationOffset=function(){return this.keysRotationOffsetModifierAlt===this._altPressed&&this.keysRotationOffsetModifierCtrl===this._ctrlPressed&&this.keysRotationOffsetModifierShift===this._shiftPressed},e.prototype._modifierRadius=function(){return this.keysRadiusModifierAlt===this._altPressed&&this.keysRadiusModifierCtrl===this._ctrlPressed&&this.keysRadiusModifierShift===this._shiftPressed},Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetIncr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetDecr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierAlt",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierCtrl",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysHeightOffsetModifierShift",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetIncr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetDecr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierAlt",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierCtrl",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRotationOffsetModifierShift",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusIncr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusDecr",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusModifierAlt",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusModifierCtrl",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"keysRadiusModifierShift",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"heightSensibility",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"rotationSensibility",void 0),Object(n.__decorate)([Object(o.serialize)()],e.prototype,"radiusSensibility",void 0),e}();i.CameraInputTypes.FollowCameraKeyboardMoveInput=a},"./Cameras/Inputs/followCameraMouseWheelInput.ts": /*!*******************************************************!*\ !*** ./Cameras/Inputs/followCameraMouseWheelInput.ts ***! \*******************************************************/ /*! exports provided: FollowCameraMouseWheelInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCameraMouseWheelInput",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=r(/*! ../../Events/pointerEvents */"./Events/pointerEvents.ts"),a=function(){function e(){this.axisControlRadius=!0,this.axisControlHeight=!1,this.axisControlRotation=!1,this.wheelPrecision=3,this.wheelDeltaPercentage=0}return e.prototype.attachControl=function(e,t){var r=this;this._wheel=function(e,n){if(e.type===s.PointerEventTypes.POINTERWHEEL){var i=e.event,o=0,a=Math.max(-1,Math.min(1,i.deltaY||i.wheelDelta||-i.detail));r.wheelDeltaPercentage?(console.assert(r.axisControlRadius+r.axisControlHeight+r.axisControlRotation<=1,"wheelDeltaPercentage only usable when mouse wheel controlls ONE axis. Currently enabled: axisControlRadius: "+r.axisControlRadius+", axisControlHeightOffset: "+r.axisControlHeight+", axisControlRotationOffset: "+r.axisControlRotation),r.axisControlRadius?o=.01*a*r.wheelDeltaPercentage*r.camera.radius:r.axisControlHeight?o=.01*a*r.wheelDeltaPercentage*r.camera.heightOffset:r.axisControlRotation&&(o=.01*a*r.wheelDeltaPercentage*r.camera.rotationOffset)):o=a*r.wheelPrecision,o&&(r.axisControlRadius?r.camera.radius+=o:r.axisControlHeight?r.camera.heightOffset-=o:r.axisControlRotation&&(r.camera.rotationOffset-=o)),i.preventDefault&&(t||i.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,s.PointerEventTypes.POINTERWHEEL)},e.prototype.detachControl=function(e){this._observer&&e&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._wheel=null)},e.prototype.getClassName=function(){return"ArcRotateCameraMouseWheelInput"},e.prototype.getSimpleName=function(){return"mousewheel"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"axisControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"axisControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"axisControlRotation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"wheelDeltaPercentage",void 0),e}();o.CameraInputTypes.FollowCameraMouseWheelInput=a},"./Cameras/Inputs/followCameraPointersInput.ts": /*!*****************************************************!*\ !*** ./Cameras/Inputs/followCameraPointersInput.ts ***! \*****************************************************/ /*! exports provided: FollowCameraPointersInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCameraPointersInput",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.angularSensibilityX=1,t.angularSensibilityY=1,t.pinchPrecision=1e4,t.pinchDeltaPercentage=0,t.axisXControlRadius=!1,t.axisXControlHeight=!1,t.axisXControlRotation=!0,t.axisYControlRadius=!1,t.axisYControlHeight=!0,t.axisYControlRotation=!1,t.axisPinchControlRadius=!0,t.axisPinchControlHeight=!1,t.axisPinchControlRotation=!1,t.warningEnable=!0,t._warningCounter=0,t}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FollowCameraPointersInput"},t.prototype.onTouch=function(e,t,r){this._warning(),this.axisXControlRotation?this.camera.rotationOffset+=t/this.angularSensibilityX:this.axisYControlRotation&&(this.camera.rotationOffset+=r/this.angularSensibilityX),this.axisXControlHeight?this.camera.heightOffset+=t/this.angularSensibilityY:this.axisYControlHeight&&(this.camera.heightOffset+=r/this.angularSensibilityY),this.axisXControlRadius?this.camera.radius-=t/this.angularSensibilityY:this.axisYControlRadius&&(this.camera.radius-=r/this.angularSensibilityY)},t.prototype.onMultiTouch=function(e,t,r,n,i,o){if(!(0===r&&null===i||0===n&&null===o)){var s=(n-r)/(this.pinchPrecision*(this.angularSensibilityX+this.angularSensibilityY)/2);this.pinchDeltaPercentage?(s*=.01*this.pinchDeltaPercentage,this.axisPinchControlRotation&&(this.camera.rotationOffset+=s*this.camera.rotationOffset),this.axisPinchControlHeight&&(this.camera.heightOffset+=s*this.camera.heightOffset),this.axisPinchControlRadius&&(this.camera.radius-=s*this.camera.radius)):(this.axisPinchControlRotation&&(this.camera.rotationOffset+=s),this.axisPinchControlHeight&&(this.camera.heightOffset+=s),this.axisPinchControlRadius&&(this.camera.radius-=s))}},t.prototype._warning=function(){if(this.warningEnable&&this._warningCounter++%100==0){var e="It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: ";console.assert(this.axisXControlRotation+this.axisXControlHeight+this.axisXControlRadius<=1,e+"axisXControlRotation: "+this.axisXControlRotation+", axisXControlHeight: "+this.axisXControlHeight+", axisXControlRadius: "+this.axisXControlRadius),console.assert(this.axisYControlRotation+this.axisYControlHeight+this.axisYControlRadius<=1,e+"axisYControlRotation: "+this.axisYControlRotation+", axisYControlHeight: "+this.axisYControlHeight+", axisYControlRadius: "+this.axisYControlRadius),console.assert(this.axisPinchControlRotation+this.axisPinchControlHeight+this.axisPinchControlRadius<=1,e+"axisPinchControlRotation: "+this.axisPinchControlRotation+", axisPinchControlHeight: "+this.axisPinchControlHeight+", axisPinchControlRadius: "+this.axisPinchControlRadius)}},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityX",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"angularSensibilityY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchPrecision",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchDeltaPercentage",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisXControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisXControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisXControlRotation",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisYControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisYControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisYControlRotation",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisPinchControlRadius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisPinchControlHeight",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"axisPinchControlRotation",void 0),t}(r(/*! ../../Cameras/Inputs/BaseCameraPointersInput */"./Cameras/Inputs/BaseCameraPointersInput.ts").BaseCameraPointersInput);o.CameraInputTypes.FollowCameraPointersInput=s},"./Cameras/Inputs/freeCameraDeviceOrientationInput.ts": /*!************************************************************!*\ !*** ./Cameras/Inputs/freeCameraDeviceOrientationInput.ts ***! \************************************************************/ /*! exports provided: FreeCameraDeviceOrientationInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraDeviceOrientationInput",function(){return c});var n=r(/*! ../../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Cameras/freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts"),a=r(/*! ../../Misc/observable */"./Misc/observable.ts");s.FreeCameraInputsManager.prototype.addDeviceOrientation=function(){return this._deviceOrientationInput||(this._deviceOrientationInput=new c,this.add(this._deviceOrientationInput)),this};var c=function(){function e(){var e=this;this._screenOrientationAngle=0,this._screenQuaternion=new i.Quaternion,this._alpha=0,this._beta=0,this._gamma=0,this._onDeviceOrientationChangedObservable=new a.Observable,this._orientationChanged=function(){e._screenOrientationAngle=void 0!==window.orientation?+window.orientation:window.screen.orientation&&window.screen.orientation.angle?window.screen.orientation.angle:0,e._screenOrientationAngle=-o.Tools.ToRadians(e._screenOrientationAngle/2),e._screenQuaternion.copyFromFloats(0,Math.sin(e._screenOrientationAngle),0,Math.cos(e._screenOrientationAngle))},this._deviceOrientation=function(t){e._alpha=null!==t.alpha?t.alpha:0,e._beta=null!==t.beta?t.beta:0,e._gamma=null!==t.gamma?t.gamma:0,null!==t.alpha&&e._onDeviceOrientationChangedObservable.notifyObservers()},this._constantTranform=new i.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this._orientationChanged()}return e.WaitForOrientationChangeAsync=function(e){return new Promise(function(t,r){var n=!1,i=function(){window.removeEventListener("deviceorientation",i),n=!0,t()};e&&setTimeout(function(){n||(window.removeEventListener("deviceorientation",i),r("WaitForOrientationChangeAsync timed out"))},e),"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(e){"granted"==e?window.addEventListener("deviceorientation",i):o.Tools.Warn("Permission not granted.")}).catch(function(e){o.Tools.Error(e)}):window.addEventListener("deviceorientation",i)})},Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},set:function(e){var t=this;this._camera=e,null==this._camera||this._camera.rotationQuaternion||(this._camera.rotationQuaternion=new i.Quaternion),this._camera&&this._camera.onDisposeObservable.add(function(){t._onDeviceOrientationChangedObservable.clear()})},enumerable:!0,configurable:!0}),e.prototype.attachControl=function(e,t){var r=this,n=this.camera.getScene().getEngine().getHostWindow();if(n){var i=function(){n.addEventListener("orientationchange",r._orientationChanged),n.addEventListener("deviceorientation",r._deviceOrientation),r._orientationChanged()};"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(e){"granted"===e?i():o.Tools.Warn("Permission not granted.")}).catch(function(e){o.Tools.Error(e)}):i()}},e.prototype.detachControl=function(e){window.removeEventListener("orientationchange",this._orientationChanged),window.removeEventListener("deviceorientation",this._deviceOrientation),this._alpha=0},e.prototype.checkInputs=function(){this._alpha&&(i.Quaternion.RotationYawPitchRollToRef(o.Tools.ToRadians(this._alpha),o.Tools.ToRadians(this._beta),-o.Tools.ToRadians(this._gamma),this.camera.rotationQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion),this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform),this._camera.rotationQuaternion.z*=-1,this._camera.rotationQuaternion.w*=-1)},e.prototype.getClassName=function(){return"FreeCameraDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"deviceOrientation"},e}();n.CameraInputTypes.FreeCameraDeviceOrientationInput=c},"./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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),c=function(){function e(){this.gamepadAngularSensibility=200,this.gamepadMoveSensibility=40,this._yAxisScale=1,this._cameraTransform=s.Matrix.Identity(),this._deltaTransform=s.Vector3.Zero(),this._vector3=s.Vector3.Zero(),this._vector2=s.Vector2.Zero()}return Object.defineProperty(e.prototype,"invertYAxis",{get:function(){return 1!==this._yAxisScale},set:function(e){this._yAxisScale=e?-1:1},enumerable:!0,configurable:!0}),e.prototype.attachControl=function(e,t){var r=this,n=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=n.onGamepadConnectedObservable.add(function(e){e.type!==a.Gamepad.POSE_ENABLED&&(r.gamepad&&e.type!==a.Gamepad.XBOX||(r.gamepad=e))}),this._onGamepadDisconnectedObserver=n.onGamepadDisconnectedObservable.add(function(e){r.gamepad===e&&(r.gamepad=null)}),this.gamepad=n.getGamepadByType(a.Gamepad.XBOX)},e.prototype.detachControl=function(e){this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver),this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver),this.gamepad=null},e.prototype.checkInputs=function(){if(this.gamepad&&this.gamepad.leftStick){var e=this.camera,t=this.gamepad.leftStick,r=t.x/this.gamepadMoveSensibility,n=t.y/this.gamepadMoveSensibility;t.x=Math.abs(r)>.005?0+r:0,t.y=Math.abs(n)>.005?0+n:0;var i=this.gamepad.rightStick;if(i){var o=i.x/this.gamepadAngularSensibility,a=i.y/this.gamepadAngularSensibility*this._yAxisScale;i.x=Math.abs(o)>.001?0+o:0,i.y=Math.abs(a)>.001?0+a:0}else i={x:0,y:0};e.rotationQuaternion?e.rotationQuaternion.toRotationMatrix(this._cameraTransform):s.Matrix.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,this._cameraTransform);var 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"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadAngularSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"gamepadMoveSensibility",void 0),e}();o.CameraInputTypes.FreeCameraGamepadInput=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.vector */"./Maths/math.vector.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;t1)e.cameraRotation.x+=-this._offsetY/this.touchAngularSensibility;else{var t=e._computeLocalCameraSpeed(),r=new a.Vector3(0,0,t*this._offsetY/this.touchMoveSensibility);a.Matrix.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(a.Vector3.TransformCoordinates(r,e._cameraRotationMatrix))}}},e.prototype.getClassName=function(){return"FreeCameraTouchInput"},e.prototype.getSimpleName=function(){return"touch"},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"touchAngularSensibility",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"touchMoveSensibility",void 0),e}();o.CameraInputTypes.FreeCameraTouchInput=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.vector */"./Maths/math.vector.ts");r(/*! ../../Cameras/freeCameraInputsManager */"./Cameras/freeCameraInputsManager.ts").FreeCameraInputsManager.prototype.addVirtualJoystick=function(){return this.add(new s),this};var s=function(){function e(){}return e.prototype.getLeftJoystick=function(){return this._leftjoystick},e.prototype.getRightJoystick=function(){return this._rightjoystick},e.prototype.checkInputs=function(){if(this._leftjoystick){var e=this.camera,t=50*e._computeLocalCameraSpeed(),r=o.Matrix.RotationYawPitchRoll(e.rotation.y,e.rotation.x,0),n=o.Vector3.TransformCoordinates(new o.Vector3(this._leftjoystick.deltaPosition.x*t,this._leftjoystick.deltaPosition.y*t,this._leftjoystick.deltaPosition.z*t),r);e.cameraDirection=e.cameraDirection.add(n),e.cameraRotation=e.cameraRotation.addVector3(this._rightjoystick.deltaPosition),this._leftjoystick.pressed||(this._leftjoystick.deltaPosition=this._leftjoystick.deltaPosition.scale(.9)),this._rightjoystick.pressed||(this._rightjoystick.deltaPosition=this._rightjoystick.deltaPosition.scale(.9))}},e.prototype.attachControl=function(e,t){this._leftjoystick=new n.VirtualJoystick(!0),this._leftjoystick.setAxisForUpDown(n.JoystickAxis.Z),this._leftjoystick.setAxisForLeftRight(n.JoystickAxis.X),this._leftjoystick.setJoystickSensibility(.15),this._rightjoystick=new n.VirtualJoystick(!1),this._rightjoystick.setAxisForUpDown(n.JoystickAxis.X),this._rightjoystick.setAxisForLeftRight(n.JoystickAxis.Y),this._rightjoystick.reverseUpDown=!0,this._rightjoystick.setJoystickSensibility(.05),this._rightjoystick.setJoystickColor("yellow")},e.prototype.detachControl=function(e){this._leftjoystick.releaseCanvas(),this._rightjoystick.releaseCanvas()},e.prototype.getClassName=function(){return"FreeCameraVirtualJoystickInput"},e.prototype.getSimpleName=function(){return"virtualJoystick"},e}();i.CameraInputTypes.FreeCameraVirtualJoystickInput=s},"./Cameras/Inputs/index.ts": /*!*********************************!*\ !*** ./Cameras/Inputs/index.ts ***! \*********************************/ /*! exports provided: ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FollowCameraKeyboardMoveInput, FollowCameraMouseWheelInput, FollowCameraPointersInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./arcRotateCameraGamepadInput */"./Cameras/Inputs/arcRotateCameraGamepadInput.ts");r.d(t,"ArcRotateCameraGamepadInput",function(){return n.ArcRotateCameraGamepadInput});var i=r(/*! ./arcRotateCameraKeyboardMoveInput */"./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts");r.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return i.ArcRotateCameraKeyboardMoveInput});var o=r(/*! ./arcRotateCameraMouseWheelInput */"./Cameras/Inputs/arcRotateCameraMouseWheelInput.ts");r.d(t,"ArcRotateCameraMouseWheelInput",function(){return o.ArcRotateCameraMouseWheelInput});var s=r(/*! ./arcRotateCameraPointersInput */"./Cameras/Inputs/arcRotateCameraPointersInput.ts");r.d(t,"ArcRotateCameraPointersInput",function(){return s.ArcRotateCameraPointersInput});var a=r(/*! ./arcRotateCameraVRDeviceOrientationInput */"./Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts");r.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return a.ArcRotateCameraVRDeviceOrientationInput});var 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 m=r(/*! ./freeCameraKeyboardMoveInput */"./Cameras/Inputs/freeCameraKeyboardMoveInput.ts");r.d(t,"FreeCameraKeyboardMoveInput",function(){return m.FreeCameraKeyboardMoveInput});var g=r(/*! ./freeCameraMouseInput */"./Cameras/Inputs/freeCameraMouseInput.ts");r.d(t,"FreeCameraMouseInput",function(){return g.FreeCameraMouseInput});var _=r(/*! ./freeCameraTouchInput */"./Cameras/Inputs/freeCameraTouchInput.ts");r.d(t,"FreeCameraTouchInput",function(){return _.FreeCameraTouchInput});var v=r(/*! ./freeCameraVirtualJoystickInput */"./Cameras/Inputs/freeCameraVirtualJoystickInput.ts");r.d(t,"FreeCameraVirtualJoystickInput",function(){return v.FreeCameraVirtualJoystickInput})},"./Cameras/RigModes/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,r=e.cameraRigMode===n.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED;e._rigCameras[0]._rigPostProcess=new i.PassPostProcess(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new o.StereoscopicInterlacePostProcessI(e.name+"_stereoInterlace",e._rigCameras,t,r)}},"./Cameras/RigModes/vrRigMode.ts": /*!***************************************!*\ !*** ./Cameras/RigModes/vrRigMode.ts ***! \***************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../camera */"./Cameras/camera.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../PostProcesses/vrDistortionCorrectionPostProcess */"./PostProcesses/vrDistortionCorrectionPostProcess.ts"),s=r(/*! ../../PostProcesses/vrMultiviewToSingleviewPostProcess */"./PostProcesses/vrMultiviewToSingleviewPostProcess.ts"),a=r(/*! ../VR/vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),c=r(/*! ../../Misc/logger */"./Misc/logger.ts"),l=r(/*! ../../Maths/math.viewport */"./Maths/math.viewport.ts");n.Camera._setVRRigMode=function(e,t){var r=t.vrCameraMetrics||a.VRCameraMetrics.GetDefault();e._rigCameras[0]._cameraRigParams.vrMetrics=r,e._rigCameras[0].viewport=new l.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 l.Viewport(.5,0,.5,1),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new i.Matrix,e._rigCameras[1]._cameraRigParams.vrHMatrix=r.rightHMatrix,e._rigCameras[1]._cameraRigParams.vrPreViewMatrix=r.rightPreViewMatrix,e._rigCameras[1].getProjectionMatrix=e._rigCameras[1]._getVRProjectionMatrix,r.multiviewEnabled&&(e.getScene().getEngine().getCaps().multiview?(e._useMultiviewToSingleView=!0,e._rigPostProcess=new s.VRMultiviewToSingleviewPostProcess("VRMultiviewToSingleview",e,r.postProcessScaleFactor)):(c.Logger.Warn("Multiview is not supported, falling back to standard rendering"),r.multiviewEnabled=!1)),r.compensateDistortion&&(e._rigCameras[0]._rigPostProcess=new o.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left",e._rigCameras[0],!1,r),e._rigCameras[1]._rigPostProcess=new o.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right",e._rigCameras[1],!0,r))}},"./Cameras/RigModes/webVRRigMode.ts": /*!******************************************!*\ !*** ./Cameras/RigModes/webVRRigMode.ts ***! \******************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../camera */"./Cameras/camera.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.viewport */"./Maths/math.viewport.ts");n.Camera._setWebVRRigMode=function(e,t){if(t.vrDisplay){var r=t.vrDisplay.getEyeParameters("left"),n=t.vrDisplay.getEyeParameters("right");e._rigCameras[0].viewport=new o.Viewport(0,0,.5,1),e._rigCameras[0].setCameraRigParameter("left",!0),e._rigCameras[0].setCameraRigParameter("specs",t.specs),e._rigCameras[0].setCameraRigParameter("eyeParameters",r),e._rigCameras[0].setCameraRigParameter("frameData",t.frameData),e._rigCameras[0].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new i.Matrix,e._rigCameras[0].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[0].parent=e,e._rigCameras[0]._getViewMatrix=e._getWebVRViewMatrix,e._rigCameras[1].viewport=new o.Viewport(.5,0,.5,1),e._rigCameras[1].setCameraRigParameter("eyeParameters",n),e._rigCameras[1].setCameraRigParameter("specs",t.specs),e._rigCameras[1].setCameraRigParameter("frameData",t.frameData),e._rigCameras[1].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new i.Matrix,e._rigCameras[1].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[1].parent=e,e._rigCameras[1]._getViewMatrix=e._getWebVRViewMatrix}}},"./Cameras/Stereoscopic/anaglyphArcRotateCamera.ts": /*!*********************************************************!*\ !*** ./Cameras/Stereoscopic/anaglyphArcRotateCamera.ts ***! \*********************************************************/ /*! exports provided: AnaglyphArcRotateCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphArcRotateCamera",function(){return 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts");a.Node.AddNodeConstructor("AnaglyphArcRotateCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphArcRotateCamera"},t}(o.ArcRotateCamera)},"./Cameras/Stereoscopic/anaglyphFreeCamera.ts": /*!****************************************************!*\ !*** ./Cameras/Stereoscopic/anaglyphFreeCamera.ts ***! \****************************************************/ /*! exports provided: AnaglyphFreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphFreeCamera",function(){return 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts");a.Node.AddNodeConstructor("AnaglyphFreeCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphFreeCamera"},t}(o.FreeCamera)},"./Cameras/Stereoscopic/anaglyphGamepadCamera.ts": /*!*******************************************************!*\ !*** ./Cameras/Stereoscopic/anaglyphGamepadCamera.ts ***! \*******************************************************/ /*! exports provided: AnaglyphGamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphGamepadCamera",function(){return 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts");a.Node.AddNodeConstructor("AnaglyphGamepadCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphGamepadCamera"},t}(o.GamepadCamera)},"./Cameras/Stereoscopic/anaglyphUniversalCamera.ts": /*!*********************************************************!*\ !*** ./Cameras/Stereoscopic/anaglyphUniversalCamera.ts ***! \*********************************************************/ /*! exports provided: AnaglyphUniversalCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"AnaglyphUniversalCamera",function(){return 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicAnaglyphRigMode */"./Cameras/RigModes/stereoscopicAnaglyphRigMode.ts");a.Node.AddNodeConstructor("AnaglyphUniversalCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"AnaglyphUniversalCamera"},t}(o.UniversalCamera)},"./Cameras/Stereoscopic/index.ts": /*!***************************************!*\ !*** ./Cameras/Stereoscopic/index.ts ***! \***************************************/ /*! exports provided: AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./anaglyphArcRotateCamera */"./Cameras/Stereoscopic/anaglyphArcRotateCamera.ts");r.d(t,"AnaglyphArcRotateCamera",function(){return n.AnaglyphArcRotateCamera});var i=r(/*! ./anaglyphFreeCamera */"./Cameras/Stereoscopic/anaglyphFreeCamera.ts");r.d(t,"AnaglyphFreeCamera",function(){return i.AnaglyphFreeCamera});var o=r(/*! ./anaglyphGamepadCamera */"./Cameras/Stereoscopic/anaglyphGamepadCamera.ts");r.d(t,"AnaglyphGamepadCamera",function(){return o.AnaglyphGamepadCamera});var s=r(/*! ./anaglyphUniversalCamera */"./Cameras/Stereoscopic/anaglyphUniversalCamera.ts");r.d(t,"AnaglyphUniversalCamera",function(){return s.AnaglyphUniversalCamera});var a=r(/*! ./stereoscopicArcRotateCamera */"./Cameras/Stereoscopic/stereoscopicArcRotateCamera.ts");r.d(t,"StereoscopicArcRotateCamera",function(){return a.StereoscopicArcRotateCamera});var 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts");a.Node.AddNodeConstructor("StereoscopicArcRotateCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicArcRotateCamera"},t}(o.ArcRotateCamera)},"./Cameras/Stereoscopic/stereoscopicFreeCamera.ts": /*!********************************************************!*\ !*** ./Cameras/Stereoscopic/stereoscopicFreeCamera.ts ***! \********************************************************/ /*! exports provided: StereoscopicFreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicFreeCamera",function(){return 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts");a.Node.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicFreeCamera"},t}(o.FreeCamera)},"./Cameras/Stereoscopic/stereoscopicGamepadCamera.ts": /*!***********************************************************!*\ !*** ./Cameras/Stereoscopic/stereoscopicGamepadCamera.ts ***! \***********************************************************/ /*! exports provided: StereoscopicGamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicGamepadCamera",function(){return 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts");a.Node.AddNodeConstructor("StereoscopicGamepadCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicGamepadCamera"},t}(o.GamepadCamera)},"./Cameras/Stereoscopic/stereoscopicUniversalCamera.ts": /*!*************************************************************!*\ !*** ./Cameras/Stereoscopic/stereoscopicUniversalCamera.ts ***! \*************************************************************/ /*! exports provided: StereoscopicUniversalCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicUniversalCamera",function(){return 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.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../RigModes/stereoscopicRigMode */"./Cameras/RigModes/stereoscopicRigMode.ts");a.Node.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,r){return function(){return new 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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"StereoscopicUniversalCamera"},t}(o.UniversalCamera)},"./Cameras/VR/index.ts": /*!*****************************!*\ !*** ./Cameras/VR/index.ts ***! \*****************************/ /*! exports provided: VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, OnAfterEnteringVRObservableEvent, VRExperienceHelper, WebVRFreeCamera */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts");r.d(t,"VRCameraMetrics",function(){return n.VRCameraMetrics});var i=r(/*! ./vrDeviceOrientationArcRotateCamera */"./Cameras/VR/vrDeviceOrientationArcRotateCamera.ts");r.d(t,"VRDeviceOrientationArcRotateCamera",function(){return i.VRDeviceOrientationArcRotateCamera});var o=r(/*! ./vrDeviceOrientationFreeCamera */"./Cameras/VR/vrDeviceOrientationFreeCamera.ts");r.d(t,"VRDeviceOrientationFreeCamera",function(){return o.VRDeviceOrientationFreeCamera});var s=r(/*! ./vrDeviceOrientationGamepadCamera */"./Cameras/VR/vrDeviceOrientationGamepadCamera.ts");r.d(t,"VRDeviceOrientationGamepadCamera",function(){return s.VRDeviceOrientationGamepadCamera});var a=r(/*! ./vrExperienceHelper */"./Cameras/VR/vrExperienceHelper.ts");r.d(t,"OnAfterEnteringVRObservableEvent",function(){return a.OnAfterEnteringVRObservableEvent}),r.d(t,"VRExperienceHelper",function(){return a.VRExperienceHelper});var 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.vector */"./Maths/math.vector.ts"),i=function(){function e(){this.compensateDistortion=!0,this.multiviewEnabled=!1}return Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return this.hResolution/(2*this.vResolution)},enumerable:!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.vector */"./Maths/math.vector.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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationArcRotateCamera"},t}(o.ArcRotateCamera)},"./Cameras/VR/vrDeviceOrientationFreeCamera.ts": /*!*****************************************************!*\ !*** ./Cameras/VR/vrDeviceOrientationFreeCamera.ts ***! \*****************************************************/ /*! exports provided: VRDeviceOrientationFreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"VRDeviceOrientationFreeCamera",function(){return 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.vector */"./Maths/math.vector.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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationFreeCamera"},t}(o.DeviceOrientationCamera)},"./Cameras/VR/vrDeviceOrientationGamepadCamera.ts": /*!********************************************************!*\ !*** ./Cameras/VR/vrDeviceOrientationGamepadCamera.ts ***! \********************************************************/ /*! exports provided: VRDeviceOrientationGamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"VRDeviceOrientationGamepadCamera",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./vrDeviceOrientationFreeCamera */"./Cameras/VR/vrDeviceOrientationFreeCamera.ts"),o=r(/*! ./vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../node */"./node.ts");r(/*! ../../Gamepads/gamepadSceneComponent */"./Gamepads/gamepadSceneComponent.ts");a.Node.AddNodeConstructor("VRDeviceOrientationGamepadCamera",function(e,t){return function(){return new c(e,s.Vector3.Zero(),t)}});var c=function(e){function t(t,r,n,i,s){void 0===i&&(i=!0),void 0===s&&(s=o.VRCameraMetrics.GetDefault());var a=e.call(this,t,r,n,i,s)||this;return a.inputs.addGamepad(),a}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationGamepadCamera"},t}(i.VRDeviceOrientationFreeCamera)},"./Cameras/VR/vrExperienceHelper.ts": /*!******************************************!*\ !*** ./Cameras/VR/vrExperienceHelper.ts ***! \******************************************/ /*! exports provided: OnAfterEnteringVRObservableEvent, VRExperienceHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"OnAfterEnteringVRObservableEvent",function(){return B}),r.d(t,"VRExperienceHelper",function(){return w});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.vector */"./Maths/math.vector.ts"),f=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),p=r(/*! ../../Gamepads/gamepad */"./Gamepads/gamepad.ts"),m=r(/*! ../../Gamepads/Controllers/poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),g=r(/*! ../../Gamepads/Controllers/webVRController */"./Gamepads/Controllers/webVRController.ts"),_=r(/*! ../../Gamepads/xboxGamepad */"./Gamepads/xboxGamepad.ts"),v=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),A=r(/*! ../../Culling/ray */"./Culling/ray.ts"),y=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),b=r(/*! ../../Materials/standardMaterial */"./Materials/standardMaterial.ts"),T=r(/*! ../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),M=r(/*! ../../PostProcesses/imageProcessingPostProcess */"./PostProcesses/imageProcessingPostProcess.ts"),x=r(/*! ../../Animations/easing */"./Animations/easing.ts"),P=r(/*! ../../Animations/animation */"./Animations/animation.ts"),E=r(/*! ../../Cameras/VR/vrCameraMetrics */"./Cameras/VR/vrCameraMetrics.ts"),C=(r(/*! ../../Meshes/Builders/groundBuilder */"./Meshes/Builders/groundBuilder.ts"),r(/*! ../../Meshes/Builders/torusBuilder */"./Meshes/Builders/torusBuilder.ts"),r(/*! ../../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),r(/*! ../../Gamepads/gamepadSceneComponent */"./Gamepads/gamepadSceneComponent.ts"),r(/*! ../../Animations/animatable */"./Animations/animatable.ts"),r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts")),S=r(/*! ../../XR/webXRSessionManager */"./XR/webXRSessionManager.ts"),R=r(/*! ../../XR/webXRTypes */"./XR/webXRTypes.ts"),O=function(){function e(t,r){if(void 0===r&&(r=null),this.scene=t,this._pointerDownOnMeshAsked=!1,this._isActionableMesh=!1,this._teleportationRequestInitiated=!1,this._teleportationBackRequestInitiated=!1,this._rotationRightAsked=!1,this._rotationLeftAsked=!1,this._dpadPressed=!0,this._activePointer=!1,this._id=e._idCounter++,r)this._gazeTracker=r.clone("gazeTracker");else{this._gazeTracker=v.Mesh.CreateTorus("gazeTracker",.0035,.0025,20,t,!1),this._gazeTracker.bakeCurrentTransformIntoVertices(),this._gazeTracker.isPickable=!1,this._gazeTracker.isVisible=!1;var n=new b.StandardMaterial("targetMat",t);n.specularColor=f.Color3.Black(),n.emissiveColor=new f.Color3(.7,.7,.7),n.backFaceCulling=!1,this._gazeTracker.material=n}}return e.prototype._getForwardRay=function(e){return new A.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}(),I=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;i.webVRController=t,i._laserPointer=v.Mesh.CreateCylinder("laserPointer",1,.004,2e-4,20,1,r,!1);var o=new b.StandardMaterial("laserPointerMat",r);if(o.emissiveColor=new f.Color3(.7,.7,.7),o.alpha=.6,i._laserPointer.material=o,i._laserPointer.rotation.x=Math.PI/2,i._laserPointer.position.z=-.5,i._laserPointer.isVisible=!1,i._laserPointer.isPickable=!1,!t.mesh){var s=new v.Mesh("preloadControllerMesh",r),a=new v.Mesh(m.PoseEnabledController.POINTING_POSE,r);a.rotation.x=-.7,s.addChild(a),t.attachToMesh(s)}return i._setLaserPointerParent(t.mesh),i._meshAttachedObserver=t._meshAttachedObservable.add(function(e){i._setLaserPointerParent(e)}),i}return Object(n.__extends)(t,e),t.prototype._getForwardRay=function(e){return this.webVRController.getForwardRay(e)},t.prototype._activatePointer=function(){e.prototype._activatePointer.call(this),this._laserPointer.isVisible=!0},t.prototype._deactivatePointer=function(){e.prototype._deactivatePointer.call(this),this._laserPointer.isVisible=!1},t.prototype._setLaserPointerColor=function(e){this._laserPointer.material.emissiveColor=e},t.prototype._setLaserPointerLightingDisabled=function(e){this._laserPointer.material.disableLighting=e},t.prototype._setLaserPointerParent=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach(function(e){t(e)})};t(e);var r=e.getChildren(void 0,!1),n=e;this.webVRController._pointingPoseNode=null;for(var i=0;i=0){n=r[i],this.webVRController._pointingPoseNode=n;break}this._laserPointer.parent=n},t.prototype._updatePointerDistance=function(e){void 0===e&&(e=100),this._laserPointer.scaling.y=e,this._laserPointer.position.z=-e/2},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._laserPointer.dispose(),this._meshAttachedObserver&&this.webVRController._meshAttachedObservable.remove(this._meshAttachedObserver)},t}(O),D=function(e){function t(t,r){var n=e.call(this,r)||this;return n.getCamera=t,n}return Object(n.__extends)(t,e),t.prototype._getForwardRay=function(e){var t=this.getCamera();return t?t.getForwardRay(e):new A.Ray(d.Vector3.Zero(),d.Vector3.Forward())},t}(O),B=function(){},w=function(){function e(t,r){var n=this;if(void 0===r&&(r={}),this.webVROptions=r,this._webVRsupported=!1,this._webVRready=!1,this._webVRrequesting=!1,this._webVRpresenting=!1,this._fullscreenVRpresenting=!1,this.enableGazeEvenWhenNoPointerLock=!1,this.exitVROnDoubleTap=!0,this.onEnteringVRObservable=new o.Observable,this.onAfterEnteringVRObservable=new o.Observable,this.onExitingVRObservable=new o.Observable,this.onControllerMeshLoadedObservable=new o.Observable,this._useCustomVRButton=!1,this._teleportationRequested=!1,this._teleportActive=!1,this._floorMeshesCollection=[],this._teleportationMode=e.TELEPORTATIONMODE_CONSTANTTIME,this._teleportationTime=122,this._teleportationSpeed=20,this._rotationAllowed=!0,this._teleportBackwardsVector=new 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._gazeColor=new f.Color3(.7,.7,.7),this._laserColor=new f.Color3(.7,.7,.7),this._pickedLaserColor=new f.Color3(.2,.2,1),this._pickedGazeColor=new f.Color3(0,0,1),this.onNewMeshSelected=new o.Observable,this.onMeshSelectedWithController=new o.Observable,this.onNewMeshPicked=new o.Observable,this.onBeforeCameraTeleport=new o.Observable,this.onAfterCameraTeleport=new o.Observable,this.onSelectedMeshUnselected=new o.Observable,this.teleportationEnabled=!0,this._teleportationInitialized=!1,this._interactionsEnabled=!1,this._interactionsRequested=!1,this._displayGaze=!0,this._displayLaserPointer=!0,this.updateGazeTrackerScale=!0,this.updateGazeTrackerColor=!0,this.updateControllerLaserColor=!0,this.requestPointerLockOnFullScreen=!0,this.xrTestDone=!1,this._onResize=function(){n.moveButtonToBottomRight(),n._fullscreenVRpresenting&&n._webVRready&&n.exitVR()},this._onFullscreenChange=function(){var e=document;void 0!==e.fullscreen?n._fullscreenVRpresenting=document.fullscreen:void 0!==e.mozFullScreen?n._fullscreenVRpresenting=e.mozFullScreen:void 0!==e.webkitIsFullScreen?n._fullscreenVRpresenting=e.webkitIsFullScreen:void 0!==e.msIsFullScreen?n._fullscreenVRpresenting=e.msIsFullScreen:void 0!==document.msFullscreenElement&&(n._fullscreenVRpresenting=document.msFullscreenElement),!n._fullscreenVRpresenting&&n._inputElement&&(n.exitVR(),!n._useCustomVRButton&&n._btnVR&&(n._btnVR.style.top=n._inputElement.offsetTop+n._inputElement.offsetHeight-70+"px",n._btnVR.style.left=n._inputElement.offsetLeft+n._inputElement.offsetWidth-100+"px",n.updateButtonVisibility()))},this._cachedAngularSensibility={angularSensibilityX:null,angularSensibilityY:null,angularSensibility:null},this.beforeRender=function(){n._leftController&&n._leftController._activePointer&&n._castRayAndSelectObject(n._leftController),n._rightController&&n._rightController._activePointer&&n._castRayAndSelectObject(n._rightController),n._noControllerIsActive&&(n._scene.getEngine().isPointerLock||n.enableGazeEvenWhenNoPointerLock)?n._castRayAndSelectObject(n._cameraGazer):n._cameraGazer._gazeTracker.isVisible=!1},this._onNewGamepadConnected=function(e){if(e.type!==p.Gamepad.POSE_ENABLED)e.leftStick&&e.onleftstickchanged(function(e){n._teleportationInitialized&&n.teleportationEnabled&&(!n._leftController&&!n._rightController||n._leftController&&!n._leftController._activePointer&&n._rightController&&!n._rightController._activePointer)&&(n._checkTeleportWithRay(e,n._cameraGazer),n._checkTeleportBackwards(e,n._cameraGazer))}),e.rightStick&&e.onrightstickchanged(function(e){n._teleportationInitialized&&n._checkRotate(e,n._cameraGazer)}),e.type===p.Gamepad.XBOX&&(e.onbuttondown(function(e){n._interactionsEnabled&&e===_.Xbox360Button.A&&n._cameraGazer._selectionPointerDown()}),e.onbuttonup(function(e){n._interactionsEnabled&&e===_.Xbox360Button.A&&n._cameraGazer._selectionPointerUp()}));else{var t=e,r=new I(t,n._scene,n._cameraGazer._gazeTracker);"right"===t.hand||n._leftController&&n._leftController.webVRController!=t?n._rightController=r:n._leftController=r,n._tryEnableInteractionOnController(r)}},this._tryEnableInteractionOnController=function(e){n._interactionsRequested&&!e._interactionsEnabled&&n._enableInteractionOnController(e),n._teleportationRequested&&!e._teleportationEnabled&&n._enableTeleportationOnController(e)},this._onNewGamepadDisconnected=function(e){e instanceof g.WebVRController&&("left"===e.hand&&null!=n._leftController&&(n._leftController.dispose(),n._leftController=null),"right"===e.hand&&null!=n._rightController&&(n._rightController.dispose(),n._rightController=null))},this._workingVector=d.Vector3.Zero(),this._workingQuaternion=d.Quaternion.Identity(),this._workingMatrix=d.Matrix.Identity(),this._scene=t,this._inputElement=t.getEngine().getInputElement(),"getVRDisplays"in navigator||(r.useXR=!0),void 0===r.createFallbackVRDeviceOrientationFreeCamera&&(r.createFallbackVRDeviceOrientationFreeCamera=!0),void 0===r.createDeviceOrientationCamera&&(r.createDeviceOrientationCamera=!0),void 0===r.laserToggle&&(r.laserToggle=!0),void 0===r.defaultHeight&&(r.defaultHeight=1.7),r.useCustomVRButton&&(this._useCustomVRButton=!0,r.customVRButton&&(this._btnVR=r.customVRButton)),r.rayLength&&(this._rayLength=r.rayLength),this._defaultHeight=r.defaultHeight,r.positionScale&&(this._rayLength*=r.positionScale,this._defaultHeight*=r.positionScale),this._hasEnteredVR=!1,this._scene.activeCamera?this._position=this._scene.activeCamera.position.clone():this._position=new d.Vector3(0,this._defaultHeight,0),r.createDeviceOrientationCamera||!this._scene.activeCamera){if(this._deviceOrientationCamera=new c.DeviceOrientationCamera("deviceOrientationVRHelper",this._position.clone(),t),this._scene.activeCamera&&(this._deviceOrientationCamera.minZ=this._scene.activeCamera.minZ,this._deviceOrientationCamera.maxZ=this._scene.activeCamera.maxZ,this._scene.activeCamera instanceof a.TargetCamera&&this._scene.activeCamera.rotation)){var s=this._scene.activeCamera;s.rotationQuaternion?this._deviceOrientationCamera.rotationQuaternion.copyFrom(s.rotationQuaternion):this._deviceOrientationCamera.rotationQuaternion.copyFrom(d.Quaternion.RotationYawPitchRoll(s.rotation.y,s.rotation.x,s.rotation.z)),this._deviceOrientationCamera.rotation=s.rotation.clone()}this._scene.activeCamera=this._deviceOrientationCamera,this._inputElement&&this._scene.activeCamera.attachControl(this._inputElement)}else this._existingCamera=this._scene.activeCamera;this.webVROptions.useXR&&navigator.xr?S.WebXRSessionManager.IsSessionSupportedAsync("immersive-vr").then(function(e){e?(i.Logger.Log("Using WebXR. It is recommended to use the WebXRDefaultExperience directly"),t.createDefaultXRExperienceAsync({floorMeshes:r.floorMeshes||[]}).then(function(e){n.xr=e,n.xrTestDone=!0,n._cameraGazer=new D(function(){return n.xr.baseExperience.camera},t),n.xr.baseExperience.onStateChangedObservable.add(function(e){switch(e){case R.WebXRState.ENTERING_XR:n.onEnteringVRObservable.notifyObservers(n),n._interactionsEnabled||n.xr.pointerSelection.detach(),n.xr.pointerSelection.displayLaserPointer=n._displayLaserPointer;break;case R.WebXRState.EXITING_XR:n.onExitingVRObservable.notifyObservers(n),n._scene.getEngine().resize();break;case R.WebXRState.IN_XR:n._hasEnteredVR=!0;break;case R.WebXRState.NOT_IN_XR:n._hasEnteredVR=!1}})})):n.completeVRInit(t,r)}):this.completeVRInit(t,r)}return Object.defineProperty(e.prototype,"onEnteringVR",{get:function(){return this.onEnteringVRObservable},enumerable:!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,"vrButton",{get:function(){return this._btnVR},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.completeVRInit=function(e,t){var r=this;if(this.xrTestDone=!0,t.createFallbackVRDeviceOrientationFreeCamera&&(t.useMultiview&&(t.vrDeviceOrientationCameraMetrics||(t.vrDeviceOrientationCameraMetrics=E.VRCameraMetrics.GetDefault()),t.vrDeviceOrientationCameraMetrics.multiviewEnabled=!0),this._vrDeviceOrientationCamera=new 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 D(function(){return r.currentVRCamera},e),!this._useCustomVRButton){this._btnVR=document.createElement("BUTTON"),this._btnVR.className="babylonVRicon",this._btnVR.id="babylonVRiconbtn",this._btnVR.title="Click to switch to VR";var n=".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A":"https://cdn.babylonjs.com/Assets/vrButton.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";n+=".babylonVRicon.vrdisplaypresenting { display: none; }";var i=document.createElement("style");i.appendChild(document.createTextNode(n)),document.getElementsByTagName("head")[0].appendChild(i),this.moveButtonToBottomRight()}this._btnVR&&this._btnVR.addEventListener("click",function(){r.isInVRMode?r._scene.getEngine().disableVR():r.enterVR()});var o=this._scene.getEngine().getHostWindow();o&&(o.addEventListener("resize",this._onResize),document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",this._onFullscreenChange,!1),document.onmsfullscreenchange=this._onFullscreenChange,t.createFallbackVRDeviceOrientationFreeCamera?this.displayVRButton():this._scene.getEngine().onVRDisplayChangedObservable.add(function(e){e.vrDisplay&&r.displayVRButton()}),this._onKeyDown=function(e){27===e.keyCode&&r.isInVRMode&&r.exitVR()},document.addEventListener("keydown",this._onKeyDown),this._scene.onPrePointerObservable.add(function(){r._hasEnteredVR&&r.exitVROnDoubleTap&&(r.exitVR(),r._fullscreenVRpresenting&&r._scene.getEngine().exitFullscreen())},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),o.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),e.onDisposeObservable.add(function(){r.dispose()}),this._webVRCamera.onControllerMeshLoadedObservable.add(function(e){return r._onDefaultMeshLoaded(e)}),this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected),this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected),this.updateButtonVisibility(),this._circleEase=new x.CircleEase,this._circleEase.setEasingMode(x.EasingFunction.EASINGMODE_EASEINOUT),this._teleportationEasing=this._circleEase,e.onPointerObservable.add(function(t){r._interactionsEnabled&&e.activeCamera===r.vrDeviceOrientationCamera&&"mouse"===t.event.pointerType&&(t.type===h.PointerEventTypes.POINTERDOWN?r._cameraGazer._selectionPointerDown():t.type===h.PointerEventTypes.POINTERUP&&r._cameraGazer._selectionPointerUp())}),this.webVROptions.floorMeshes&&this.enableTeleportation({floorMeshes:this.webVROptions.floorMeshes}))},e.prototype._onDefaultMeshLoaded=function(e){this._leftController&&this._leftController.webVRController==e&&e.mesh&&this._leftController._setLaserPointerParent(e.mesh),this._rightController&&this._rightController.webVRController==e&&e.mesh&&this._rightController._setLaserPointerParent(e.mesh);try{this.onControllerMeshLoadedObservable.notifyObservers(e)}catch(e){i.Logger.Warn("Error in your custom logic onControllerMeshLoaded: "+e)}},Object.defineProperty(e.prototype,"isInVRMode",{get:function(){return this.xr&&this.webVROptions.useXR&&this.xr.baseExperience.state===R.WebXRState.IN_XR||this._webVRpresenting||this._fullscreenVRpresenting},enumerable:!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(){if(this._inputElement&&!this._useCustomVRButton&&this._btnVR){var e=this._inputElement.getBoundingClientRect();this._btnVR.style.top=e.top+e.height-70+"px",this._btnVR.style.left=e.left+e.width-100+"px"}},e.prototype.displayVRButton=function(){this._useCustomVRButton||this._btnVRDisplayed||!this._btnVR||(document.body.appendChild(this._btnVR),this._btnVRDisplayed=!0)},e.prototype.updateButtonVisibility=function(){this._btnVR&&!this._useCustomVRButton&&(this._btnVR.className="babylonVRicon",this.isInVRMode?this._btnVR.className+=" vrdisplaypresenting":(this._webVRready&&(this._btnVR.className+=" vrdisplayready"),this._webVRsupported&&(this._btnVR.className+=" vrdisplaysupported"),this._webVRrequesting&&(this._btnVR.className+=" vrdisplayrequesting")))},e.prototype.enterVR=function(){var e=this;if(this.xr)this.xr.baseExperience.enterXRAsync("immersive-vr","local-floor",this.xr.renderTarget);else{if(this.onEnteringVRObservable)try{this.onEnteringVRObservable.notifyObservers(this)}catch(e){i.Logger.Warn("Error in your custom logic onEnteringVR: "+e)}if(this._scene.activeCamera){if(this._position=this._scene.activeCamera.position.clone(),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.rotation=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._inputElement&&this._scene.activeCamera.attachControl(this._inputElement),this._interactionsEnabled&&this._scene.registerBeforeRender(this.beforeRender),this._displayLaserPointer&&[this._leftController,this._rightController].forEach(function(e){e&&e._activatePointer()}),this._hasEnteredVR=!0)}},e.prototype.exitVR=function(){if(this.xr)this.xr.baseExperience.exitXRAsync();else if(this._hasEnteredVR){if(this.onExitingVRObservable)try{this.onExitingVRObservable.notifyObservers(this)}catch(e){i.Logger.Warn("Error in your custom logic onExitingVR: "+e)}this._webVRpresenting&&this._scene.getEngine().disableVR(),this._scene.activeCamera&&(this._position=this._scene.activeCamera.position.clone()),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._deviceOrientationCamera?(this._deviceOrientationCamera.position=this._position,this._scene.activeCamera=this._deviceOrientationCamera,this._cachedAngularSensibility.angularSensibilityX&&(this._deviceOrientationCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._deviceOrientationCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._deviceOrientationCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)):this._existingCamera&&(this._existingCamera.position=this._position,this._scene.activeCamera=this._existingCamera,this._inputElement&&this._scene.activeCamera.attachControl(this._inputElement),this._cachedAngularSensibility.angularSensibilityX&&(this._existingCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._existingCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._existingCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)),this.updateButtonVisibility(),this._interactionsEnabled&&(this._scene.unregisterBeforeRender(this.beforeRender),this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1)),this._scene.getEngine().resize(),[this._leftController,this._rightController].forEach(function(e){e&&e._deactivatePointer()}),this._hasEnteredVR=!1;var e=this._scene.getEngine();e._onVrDisplayPresentChange&&e._onVrDisplayPresentChange()}},Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._scene.activeCamera&&(this._scene.activeCamera.position=e)},enumerable:!0,configurable:!0}),e.prototype.enableInteractions=function(){var e=this;if(!this._interactionsEnabled){if(this._interactionsRequested=!0,this.xr)return void(this.xr.baseExperience.state===R.WebXRState.IN_XR&&this.xr.pointerSelection.attach());this._leftController&&this._enableInteractionOnController(this._leftController),this._rightController&&this._enableInteractionOnController(this._rightController),this.raySelectionPredicate=function(t){return t.isVisible&&(t.isPickable||t.name===e._floorMeshName)},this.meshSelectionPredicate=function(){return!0},this._raySelectionPredicate=function(t){return!!(e._isTeleportationFloor(t)||-1===t.name.indexOf("gazeTracker")&&-1===t.name.indexOf("teleportationTarget")&&-1===t.name.indexOf("torusTeleportation"))&&e.raySelectionPredicate(t)},this._interactionsEnabled=!0}},Object.defineProperty(e.prototype,"_noControllerIsActive",{get:function(){return!(this._leftController&&this._leftController._activePointer||this._rightController&&this._rightController._activePointer)},enumerable:!0,configurable:!0}),e.prototype._isTeleportationFloor=function(e){for(var t=0;t-1||this._floorMeshesCollection.push(e))},e.prototype.removeFloorMesh=function(e){if(this._floorMeshesCollection){var t=this._floorMeshesCollection.indexOf(e);-1!==t&&this._floorMeshesCollection.splice(t,1)}},e.prototype.enableTeleportation=function(e){var t=this;if(void 0===e&&(e={}),!this._teleportationInitialized){if(this._teleportationRequested=!0,this.enableInteractions(),this.webVROptions.useXR&&(e.floorMeshes||e.floorMeshName)){var r=e.floorMeshes||[];if(!r.length){var n=this._scene.getMeshByName(e.floorMeshName);n&&r.push(n)}if(this.xr)return r.forEach(function(e){t.xr.teleportation.addFloorMesh(e)}),void(this.xr.teleportation.attached||this.xr.teleportation.attach());if(!this.xrTestDone){var i=function(){t.xrTestDone&&(t._scene.unregisterBeforeRender(i),t.xr?t.xr.teleportation.attached||t.xr.teleportation.attach():t.enableTeleportation(e))};return void this._scene.registerBeforeRender(i)}}e.floorMeshName&&(this._floorMeshName=e.floorMeshName),e.floorMeshes&&(this._floorMeshesCollection=e.floorMeshes),e.teleportationMode&&(this._teleportationMode=e.teleportationMode),e.teleportationTime&&e.teleportationTime>0&&(this._teleportationTime=e.teleportationTime),e.teleportationSpeed&&e.teleportationSpeed>0&&(this._teleportationSpeed=e.teleportationSpeed),void 0!==e.easingFunction&&(this._teleportationEasing=e.easingFunction),null!=this._leftController&&this._enableTeleportationOnController(this._leftController),null!=this._rightController&&this._enableTeleportationOnController(this._rightController);var o=new y.ImageProcessingConfiguration;o.vignetteColor=new f.Color4(0,0,0,0),o.vignetteEnabled=!0,this._postProcessMove=new M.ImageProcessingPostProcess("postProcessMove",1,this._webVRCamera,void 0,void 0,void 0,void 0,o),this._webVRCamera.detachPostProcess(this._postProcessMove),this._teleportationInitialized=!0,this._isDefaultTeleportationTarget&&(this._createTeleportationCircles(),this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor))}},e.prototype._enableInteractionOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled=!0,this.isInVRMode&&this._displayLaserPointer&&e._activatePointer(),this.webVROptions.laserToggle&&e.webVRController.onMainButtonStateChangedObservable.add(function(r){t._displayLaserPointer&&1===r.value&&(e._activePointer?e._deactivatePointer():e._activatePointer(),t.displayGaze&&(e._gazeTracker.isVisible=e._activePointer))}),e.webVRController.onTriggerStateChangedObservable.add(function(r){var n=e;t._noControllerIsActive&&(n=t._cameraGazer),n._pointerDownOnMeshAsked?r.valuet._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&&(t._rotationLeftAsked=!1):e.x<-this._padSensibilityUp&&t._dpadPressed&&(t._rotationLeftAsked=!0,this._rotationAllowed&&this._rotateCamera(!1)),t._rotationRightAsked?e.xthis._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 A.Ray(n,this._workingVector),o=this._scene.pickWithRay(i,this._raySelectionPredicate);o&&o.pickedPoint&&o.pickedMesh&&this._isTeleportationFloor(o.pickedMesh)&&o.distance<5&&this.teleportCamera(o.pickedPoint),t._teleportationBackRequestInitiated=!0}}else t._teleportationBackRequestInitiated=!1},e.prototype._enableTeleportationOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled||this._enableInteractionOnController(e),e._interactionsEnabled=!0,e._teleportationEnabled=!0,e.webVRController.controllerType===m.PoseEnabledControllerType.VIVE&&(e._dpadPressed=!1,e.webVRController.onPadStateChangedObservable.add(function(t){e._dpadPressed=t.pressed,e._dpadPressed||(e._rotationLeftAsked=!1,e._rotationRightAsked=!1,e._teleportationBackRequestInitiated=!1)})),e.webVRController.onPadValuesChangedObservable.add(function(r){t.teleportationEnabled&&(t._checkTeleportBackwards(r,e),t._checkTeleportWithRay(r,e)),t._checkRotate(r,e)}))},e.prototype._createTeleportationCircles=function(){this._teleportationTarget=v.Mesh.CreateGround("teleportationTarget",2,2,2,this._scene),this._teleportationTarget.isPickable=!1;var e=new T.DynamicTexture("DynamicTexture",512,this._scene,!0);e.hasAlpha=!0;var t=e.getContext();t.beginPath(),t.arc(256,256,200,0,2*Math.PI,!1),t.fillStyle=this._teleportationFillColor,t.fill(),t.lineWidth=10,t.strokeStyle=this._teleportationBorderColor,t.stroke(),t.closePath(),e.update();var r=new b.StandardMaterial("TextPlaneMaterial",this._scene);r.diffuseTexture=e,this._teleportationTarget.material=r;var n=v.Mesh.CreateTorus("torusTeleportation",.75,.1,25,this._scene,!1);n.isPickable=!1,n.parent=this._teleportationTarget;var i=new P.Animation("animationInnerCircle","position.y",30,P.Animation.ANIMATIONTYPE_FLOAT,P.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 x.SineEase;s.setEasingMode(x.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 P.Animation("animationRotation","rotationQuaternion",90,P.Animation.ANIMATIONTYPE_QUATERNION,P.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 P.Animation("animationPP","vignetteWeight",90,P.Animation.ANIMATIONTYPE_FLOAT,P.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 P.Animation("animationPP2","vignetteStretch",90,P.Animation.ANIMATIONTYPE_FLOAT,P.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(C.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(t){var r=this;if(this.currentVRCamera instanceof s.FreeCamera){this.webVRCamera.leftCamera?(this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition),this._workingVector.subtractInPlace(this.webVRCamera.position),t.subtractToRef(this._workingVector,this._workingVector)):this._workingVector.copyFrom(t),this.isInVRMode?this._workingVector.y+=this.webVRCamera.deviceDistanceToRoomGround()*this._webVRCamera.deviceScaleFactor:this._workingVector.y+=this._defaultHeight,this.onBeforeCameraTeleport.notifyObservers(this._workingVector);var n,i;if(this._teleportationMode==e.TELEPORTATIONMODE_CONSTANTSPEED){i=90;var o=d.Vector3.Distance(this.currentVRCamera.position,this._workingVector);n=this._teleportationSpeed/o}else i=Math.round(90*this._teleportationTime/1e3),n=1;this.currentVRCamera.animations=[];var a=new P.Animation("animationCameraTeleportation","position",90,P.Animation.ANIMATIONTYPE_VECTOR3,P.Animation.ANIMATIONLOOPMODE_CONSTANT),c=[{frame:0,value:this.currentVRCamera.position},{frame:i,value:this._workingVector}];a.setKeys(c),a.setEasingFunction(this._teleportationEasing),this.currentVRCamera.animations.push(a),this._postProcessMove.animations=[];var l=Math.round(i/2),u=new P.Animation("animationPP","vignetteWeight",90,P.Animation.ANIMATIONTYPE_FLOAT,P.Animation.ANIMATIONLOOPMODE_CONSTANT),h=[];h.push({frame:0,value:0}),h.push({frame:l,value:8}),h.push({frame:i,value:0}),u.setKeys(h),this._postProcessMove.animations.push(u);var f=new P.Animation("animationPP2","vignetteStretch",90,P.Animation.ANIMATIONTYPE_FLOAT,P.Animation.ANIMATIONLOOPMODE_CONSTANT),p=[];p.push({frame:0,value:0}),p.push({frame:l,value:10}),p.push({frame:i,value:0}),f.setKeys(p),this._postProcessMove.animations.push(f),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,i,!1,n,function(){r._webVRCamera.detachPostProcess(r._postProcessMove)}),this._scene.beginAnimation(this.currentVRCamera,0,i,!1,n,function(){r.onAfterCameraTeleport.notifyObservers(r._workingVector)}),this._hideTeleportationTarget()}},e.prototype._convertNormalToDirectionOfRay=function(e,t){e&&(Math.acos(d.Vector3.Dot(e,t.direction))=2&&e.onControllersAttachedObservable.notifyObservers(e.controllers)}}})},t}(o.FreeCamera)},"./Cameras/arcRotateCamera.ts": /*!************************************!*\ !*** ./Cameras/arcRotateCamera.ts ***! \************************************/ /*! exports provided: ArcRotateCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCamera",function(){return g});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../node */"./node.ts"),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"),m=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts");a.Node.AddNodeConstructor("ArcRotateCamera",function(e,t){return function(){return new g(e,0,0,1,s.Vector3.Zero(),t)}});var g=function(e){function t(t,r,n,i,a,c,l){void 0===l&&(l=!0);var u=e.call(this,t,s.Vector3.Zero(),c,l)||this;return u._upVector=s.Vector3.Up(),u.inertialAlphaOffset=0,u.inertialBetaOffset=0,u.inertialRadiusOffset=0,u.lowerAlphaLimit=null,u.upperAlphaLimit=null,u.lowerBetaLimit=.01,u.upperBetaLimit=Math.PI-.01,u.lowerRadiusLimit=null,u.upperRadiusLimit=null,u.inertialPanningX=0,u.inertialPanningY=0,u.pinchToPanMaxDistance=20,u.panningDistanceLimit=null,u.panningOriginTarget=s.Vector3.Zero(),u.panningInertia=.9,u.zoomOnFactor=1,u.targetScreenOffset=s.Vector2.Zero(),u.allowUpsideDown=!0,u.useInputToRestoreState=!0,u._viewMatrix=new s.Matrix,u.panningAxis=new s.Vector3(1,1,0),u.onMeshTargetChangedObservable=new o.Observable,u.checkCollisions=!1,u.collisionRadius=new s.Vector3(.5,.5,.5),u._previousPosition=s.Vector3.Zero(),u._collisionVelocity=s.Vector3.Zero(),u._newPosition=s.Vector3.Zero(),u._computationVector=s.Vector3.Zero(),u._onCollisionPositionChange=function(e,t,r){void 0===r&&(r=null),r?(u.setPosition(t),u.onCollide&&u.onCollide(r)):u._previousPosition.copyFrom(u._position);var n=Math.cos(u.alpha),i=Math.sin(u.alpha),o=Math.cos(u.beta),s=Math.sin(u.beta);0===s&&(s=1e-4);var a=u._getTargetPosition();u._computationVector.copyFromFloats(u.radius*n*s,u.radius*o,u.radius*i*s),a.addToRef(u._computationVector,u._newPosition),u._position.copyFrom(u._newPosition);var 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 Object(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,"upVector",{get:function(){return this._upVector},set:function(e){this._upToYMatrix||(this._YToUpMatrix=new s.Matrix,this._upToYMatrix=new s.Matrix,this._upVector=s.Vector3.Zero()),e.normalize(),this._upVector.copyFrom(e),this.setMatUp()},enumerable:!0,configurable:!0}),t.prototype.setMatUp=function(){s.Matrix.RotationAlignToRef(s.Vector3.UpReadOnly,this._upVector,this._YToUpMatrix),s.Matrix.RotationAlignToRef(this._upVector,s.Vector3.UpReadOnly,this._upToYMatrix)},Object.defineProperty(t.prototype,"angularSensibilityX",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)},enumerable:!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,"useNaturalPinchZoom",{get:function(){var e=this.inputs.attached.pointers;return!!e&&e.useNaturalPinchZoom},set:function(e){var t=this.inputs.attached.pointers;t&&(t.useNaturalPinchZoom=e)},enumerable:!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(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0)},t.prototype._isSynchronizedViewMatrix=function(){return!!e.prototype._isSynchronizedViewMatrix.call(this)&&(this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset))},t.prototype.attachControl=function(e,t,r,n){var i=this;void 0===r&&(r=!0),void 0===n&&(n=2),this._useCtrlForPanning=r,this._panningMouseButton=n,this.inputs.attachElement(e,t),this._reset=function(){i.inertialAlphaOffset=0,i.inertialBetaOffset=0,i.inertialRadiusOffset=0,i.inertialPanningX=0,i.inertialPanningY=0}},t.prototype.detachControl=function(e){this.inputs.detachElement(e),this._reset&&this._reset()},t.prototype._checkInputs=function(){if(!this._collisionTriggered){if(this.inputs.checkInputs(),0!==this.inertialAlphaOffset||0!==this.inertialBetaOffset||0!==this.inertialRadiusOffset){var t=this.inertialAlphaOffset;this.beta<=0&&(t*=-1),this.getScene().useRightHandedSystem&&(t*=-1),this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(t*=-1),this.alpha+=t,this.beta+=this.inertialBetaOffset,this.radius-=this.inertialRadiusOffset,this.inertialAlphaOffset*=this.inertia,this.inertialBetaOffset*=this.inertia,this.inertialRadiusOffset*=this.inertia,Math.abs(this.inertialAlphaOffset)Math.PI&&(this.beta=this.beta-2*Math.PI):this.betathis.upperBetaLimit&&(this.beta=this.upperBetaLimit),null!==this.lowerAlphaLimit&&this.alphathis.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),null!==this.lowerRadiusLimit&&this.radiusthis.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0)},t.prototype.rebuildAnglesAndRadius=function(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||s.Vector3.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4),0===this._computationVector.x&&0===this._computationVector.z?this.alpha=Math.PI/2:this.alpha=Math.acos(this._computationVector.x/Math.sqrt(Math.pow(this._computationVector.x,2)+Math.pow(this._computationVector.z,2))),this._computationVector.z<0&&(this.alpha=2*Math.PI-this.alpha),this.beta=Math.acos(this._computationVector.y/this.radius),this._checkLimits()},t.prototype.setPosition=function(e){this._position.equals(e)||(this._position.copyFrom(e),this.rebuildAnglesAndRadius())},t.prototype.setTarget=function(e,t,r){if(void 0===t&&(t=!1),void 0===r&&(r=!1),e.getBoundingInfo)this._targetBoundingCenter=t?e.getBoundingInfo().boundingBox.centerWorld.clone():null,e.computeWorldMatrix(),this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{var n=e,i=this._getTargetPosition();if(i&&!r&&i.equals(n))return;this._targetHost=null,this._target=n,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}this.rebuildAnglesAndRadius()},t.prototype._getViewMatrix=function(){var e=Math.cos(this.alpha),t=Math.sin(this.alpha),r=Math.cos(this.beta),n=Math.sin(this.beta);0===n&&(n=1e-4);var i=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*n,this.radius*r,this.radius*t*n),0===this._upVector.x&&1===this._upVector.y&&0===this._upVector.z||s.Vector3.TransformCoordinatesToRef(this._computationVector,this._YToUpMatrix,this._computationVector),i.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){var o=this.getScene().collisionCoordinator;this._collider||(this._collider=o.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,o.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);var a=this.upVector;this.allowUpsideDown&&n<0&&(a=a.negate()),this._computeViewMatrix(this._position,i,a),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget=i,this._viewMatrix},t.prototype.zoomOn=function(e,t){void 0===t&&(t=!1),e=e||this.getScene().meshes;var r=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_STEREOSCOPIC_INTERLACED: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.isRigCamera=!0,i.rigParent=this,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_STEREOSCOPIC_INTERLACED: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"},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"alpha",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"beta",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"radius",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)("target")],t.prototype,"_target",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)("upVector")],t.prototype,"_upVector",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialAlphaOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialBetaOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialRadiusOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerAlphaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperAlphaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerBetaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperBetaLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialPanningX",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"inertialPanningY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"pinchToPanMaxDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"panningDistanceLimit",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"panningOriginTarget",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"panningInertia",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"zoomOnFactor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"targetScreenOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"allowUpsideDown",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useInputToRestoreState",void 0),t}(f.TargetCamera)},"./Cameras/arcRotateCameraInputsManager.ts": /*!*************************************************!*\ !*** ./Cameras/arcRotateCameraInputsManager.ts ***! \*************************************************/ /*! exports provided: ArcRotateCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"ArcRotateCameraInputsManager",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Cameras/Inputs/arcRotateCameraPointersInput */"./Cameras/Inputs/arcRotateCameraPointersInput.ts"),o=r(/*! ../Cameras/Inputs/arcRotateCameraKeyboardMoveInput */"./Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts"),s=r(/*! ../Cameras/Inputs/arcRotateCameraMouseWheelInput */"./Cameras/Inputs/arcRotateCameraMouseWheelInput.ts"),a=function(e){function t(t){return e.call(this,t)||this}return Object(n.__extends)(t,e),t.prototype.addMouseWheel=function(){return this.add(new s.ArcRotateCameraMouseWheelInput),this},t.prototype.addPointers=function(){return this.add(new i.ArcRotateCameraPointersInput),this},t.prototype.addKeyboard=function(){return this.add(new o.ArcRotateCameraKeyboardMoveInput),this},t}(r(/*! ../Cameras/cameraInputsManager */"./Cameras/cameraInputsManager.ts").CameraInputsManager)},"./Cameras/camera.ts": /*!***************************!*\ !*** ./Cameras/camera.ts ***! \***************************/ /*! exports provided: Camera */function(e,t,r){"use strict";r.r(t),r.d(t,"Camera",function(){return m});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),s=r(/*! ../Misc/tools */"./Misc/tools.ts"),a=r(/*! ../Misc/observable */"./Misc/observable.ts"),c=r(/*! ../Maths/math.vector */"./Maths/math.vector.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(/*! ../Maths/math.viewport */"./Maths/math.viewport.ts"),p=r(/*! ../Maths/math.frustum */"./Maths/math.frustum.ts"),m=function(e){function t(r,n,i,s){void 0===s&&(s=!0);var 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 f.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.onViewMatrixChangedObservable=new a.Observable,l.onProjectionMatrixChangedObservable=new a.Observable,l.onAfterCheckInputsObservable=new a.Observable,l.onRestoreStateObservable=new a.Observable,l.isRigCamera=!1,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=!1,l.getScene().addCamera(l),s&&!l.getScene().activeCamera&&(l.getScene().activeCamera=l),l.position=n,l}return Object(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.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-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._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._computedViewMatrix)},t.prototype.freezeProjectionMatrix=function(e){this._doNotComputeProjectionMatrix=!0,void 0!==e&&(this._projectionMatrix=e)},t.prototype.unfreezeProjectionMatrix=function(){this._doNotComputeProjectionMatrix=!1},t.prototype.getProjectionMatrix=function(e){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);var i=r.useReverseDepthBuffer;(n.useRightHandedSystem?i?c.Matrix.PerspectiveFovReverseRHToRef:c.Matrix.PerspectiveFovRHToRef:i?c.Matrix.PerspectiveFovReverseLHToRef:c.Matrix.PerspectiveFovLHToRef)(this.fov,r.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED)}else{var o=r.getRenderWidth()/2,s=r.getRenderHeight()/2;n.useRightHandedSystem?c.Matrix.OrthoOffCenterRHToRef(this.orthoLeft||-o,this.orthoRight||o,this.orthoBottom||-s,this.orthoTop||s,this.minZ,this.maxZ,this._projectionMatrix):c.Matrix.OrthoOffCenterLHToRef(this.orthoLeft||-o,this.orthoRight||o,this.orthoBottom||-s,this.orthoTop||s,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?p.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=p.Frustum.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)},t.prototype.isInFrustum=function(e,t){if(void 0===t&&(t=!1),this._updateFrustumPlanes(),t&&this.rigCameras.length>0){var r=!1;return this.rigCameras.forEach(function(t){t._updateFrustumPlanes(),r=r||e.isInFrustum(t._frustumPlanes)}),r}return e.isInFrustum(this._frustumPlanes)},t.prototype.isCompletelyInFrustum=function(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)},t.prototype.getForwardRay=function(e,t,r){throw void 0===e&&(e=100),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:case t.RIG_MODE_STEREOSCOPIC_INTERLACED:t._setStereoscopicRigMode(this);break;case t.RIG_MODE_VR:t._setVRRigMode(this,r);break;case t.RIG_MODE_WEBVR:t._setWebVRRigMode(this,r)}this._cascadePostProcessesToRigCams(),this.update()}},t._setStereoscopicRigMode=function(e){throw"Import Cameras/RigModes/stereoscopicRigMode before using stereoscopic rig mode"},t._setStereoscopicAnaglyphRigMode=function(e){throw"Import Cameras/RigModes/stereoscopicAnaglyphRigMode before using stereoscopic anaglyph rig mode"},t._setVRRigMode=function(e,t){throw"Import Cameras/RigModes/vrRigMode before using VR rig mode"},t._setWebVRRigMode=function(e,t){throw"Import Cameras/RigModes/WebVRRigMode before using Web VR rig mode"},t.prototype._getVRProjectionMatrix=function(){return 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;es.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 Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"angularSensibility",{get:function(){var e=this.inputs.attached.mouse;return e?e.angularSensibility:0},set:function(e){var t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)},enumerable:!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"},Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoid",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoidOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"checkCollisions",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"applyGravity",void 0),t}(a.TargetCamera)},"./Cameras/flyCameraInputsManager.ts": /*!*******************************************!*\ !*** ./Cameras/flyCameraInputsManager.ts ***! \*******************************************/ /*! exports provided: FlyCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"FlyCameraInputsManager",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./cameraInputsManager */"./Cameras/cameraInputsManager.ts"),o=r(/*! ../Cameras/Inputs/flyCameraMouseInput */"./Cameras/Inputs/flyCameraMouseInput.ts"),s=r(/*! ../Cameras/Inputs/flyCameraKeyboardInput */"./Cameras/Inputs/flyCameraKeyboardInput.ts"),a=function(e){function t(t){return e.call(this,t)||this}return Object(n.__extends)(t,e),t.prototype.addKeyboard=function(){return this.add(new s.FlyCameraKeyboardInput),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this.add(new o.FlyCameraMouseInput(e)),this},t}(i.CameraInputsManager)},"./Cameras/followCamera.ts": /*!*********************************!*\ !*** ./Cameras/followCamera.ts ***! \*********************************/ /*! exports provided: FollowCamera, ArcFollowCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCamera",function(){return u}),r.d(t,"ArcFollowCamera",function(){return 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.vector */"./Maths/math.vector.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 Object(n.__extends)(t,e),t.prototype._follow=function(e){if(e){var t;if(e.rotationQuaternion){var r=new a.Matrix;e.rotationQuaternion.toRotationMatrix(r),t=Math.atan2(r.m[8],r.m[10])}else t=e.rotation.y;var n=o.Tools.ToRadians(this.rotationOffset)+t,i=e.getAbsolutePosition(),s=i.x+Math.sin(n)*this.radius,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.radiusthis.upperRadiusLimit&&(this.radius=this.upperRadiusLimit),null!==this.lowerHeightOffsetLimit&&this.heightOffsetthis.upperHeightOffsetLimit&&(this.heightOffset=this.upperHeightOffsetLimit),null!==this.lowerRotationOffsetLimit&&this.rotationOffsetthis.upperRotationOffsetLimit&&(this.rotationOffset=this.upperRotationOffsetLimit)},t.prototype.getClassName=function(){return"FollowCamera"},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"radius",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperRadiusLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"rotationOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerRotationOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperRotationOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"heightOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"lowerHeightOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"upperHeightOffsetLimit",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"cameraAcceleration",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"maxCameraSpeed",void 0),Object(n.__decorate)([Object(i.serializeAsMeshReference)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(s.TargetCamera),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 Object(n.__extends)(t,e),t.prototype._follow=function(){if(this.target){this._cartesianCoordinates.x=this.radius*Math.cos(this.alpha)*Math.cos(this.beta),this._cartesianCoordinates.y=this.radius*Math.sin(this.beta),this._cartesianCoordinates.z=this.radius*Math.sin(this.alpha)*Math.cos(this.beta);var e=this.target.getAbsolutePosition();this.position=e.add(this._cartesianCoordinates),this.setTarget(e)}},t.prototype._checkInputs=function(){e.prototype._checkInputs.call(this),this._follow()},t.prototype.getClassName=function(){return"ArcFollowCamera"},t}(s.TargetCamera)},"./Cameras/followCameraInputsManager.ts": /*!**********************************************!*\ !*** ./Cameras/followCameraInputsManager.ts ***! \**********************************************/ /*! exports provided: FollowCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"FollowCameraInputsManager",function(){return 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 Object(n.__extends)(t,e),t.prototype.addKeyboard=function(){return this.add(new o.FollowCameraKeyboardMoveInput),this},t.prototype.addMouseWheel=function(){return this.add(new s.FollowCameraMouseWheelInput),this},t.prototype.addPointers=function(){return this.add(new a.FollowCameraPointersInput),this},t.prototype.addVRDeviceOrientation=function(){return console.warn("DeviceOrientation support not yet implemented for FollowCamera."),this},t}(i.CameraInputsManager)},"./Cameras/freeCamera.ts": /*!*******************************!*\ !*** ./Cameras/freeCamera.ts ***! \*******************************/ /*! exports provided: FreeCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCamera",function(){return l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../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 Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"angularSensibility",{get:function(){var e=this.inputs.attached.mouse;return e?e.angularSensibility:0},set:function(e){var t=this.inputs.attached.mouse;t&&(t.angularSensibility=e)},enumerable:!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"},Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoid",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"ellipsoidOffset",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"checkCollisions",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"applyGravity",void 0),t}(a.TargetCamera)},"./Cameras/freeCameraInputsManager.ts": /*!********************************************!*\ !*** ./Cameras/freeCameraInputsManager.ts ***! \********************************************/ /*! exports provided: FreeCameraInputsManager */function(e,t,r){"use strict";r.r(t),r.d(t,"FreeCameraInputsManager",function(){return 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){var r=e.call(this,t)||this;return r._mouseInput=null,r}return Object(n.__extends)(t,e),t.prototype.addKeyboard=function(){return this.add(new o.FreeCameraKeyboardMoveInput),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this._mouseInput||(this._mouseInput=new s.FreeCameraMouseInput(e),this.add(this._mouseInput)),this},t.prototype.removeMouse=function(){return this._mouseInput&&this.remove(this._mouseInput),this},t.prototype.addTouch=function(){return this.add(new a.FreeCameraTouchInput),this},t.prototype.clear=function(){e.prototype.clear.call(this),this._mouseInput=null},t}(i.CameraInputsManager)},"./Cameras/gamepadCamera.ts": /*!**********************************!*\ !*** ./Cameras/gamepadCamera.ts ***! \**********************************/ /*! exports provided: GamepadCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"GamepadCamera",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./universalCamera */"./Cameras/universalCamera.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts");r(/*! ../node */"./node.ts").Node.AddNodeConstructor("GamepadCamera",function(e,t){return function(){return new s(e,o.Vector3.Zero(),t)}});var s=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"GamepadCamera"},t}(i.UniversalCamera)},"./Cameras/index.ts": /*!**************************!*\ !*** ./Cameras/index.ts ***! \**************************/ /*! exports provided: CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, FollowCameraInputsManager, 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 */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 m=r(/*! ./followCamera */"./Cameras/followCamera.ts");r.d(t,"FollowCamera",function(){return m.FollowCamera}),r.d(t,"ArcFollowCamera",function(){return m.ArcFollowCamera});var g=r(/*! ./followCameraInputsManager */"./Cameras/followCameraInputsManager.ts");r.d(t,"FollowCameraInputsManager",function(){return g.FollowCameraInputsManager});var _=r(/*! ./gamepadCamera */"./Cameras/gamepadCamera.ts");r.d(t,"GamepadCamera",function(){return _.GamepadCamera});var v=r(/*! ./Stereoscopic/index */"./Cameras/Stereoscopic/index.ts");r.d(t,"AnaglyphArcRotateCamera",function(){return v.AnaglyphArcRotateCamera}),r.d(t,"AnaglyphFreeCamera",function(){return v.AnaglyphFreeCamera}),r.d(t,"AnaglyphGamepadCamera",function(){return v.AnaglyphGamepadCamera}),r.d(t,"AnaglyphUniversalCamera",function(){return v.AnaglyphUniversalCamera}),r.d(t,"StereoscopicArcRotateCamera",function(){return v.StereoscopicArcRotateCamera}),r.d(t,"StereoscopicFreeCamera",function(){return v.StereoscopicFreeCamera}),r.d(t,"StereoscopicGamepadCamera",function(){return v.StereoscopicGamepadCamera}),r.d(t,"StereoscopicUniversalCamera",function(){return v.StereoscopicUniversalCamera});var A=r(/*! ./universalCamera */"./Cameras/universalCamera.ts");r.d(t,"UniversalCamera",function(){return A.UniversalCamera});var y=r(/*! ./virtualJoysticksCamera */"./Cameras/virtualJoysticksCamera.ts");r.d(t,"VirtualJoysticksCamera",function(){return y.VirtualJoysticksCamera});var b=r(/*! ./VR/index */"./Cameras/VR/index.ts");r.d(t,"VRCameraMetrics",function(){return b.VRCameraMetrics}),r.d(t,"VRDeviceOrientationArcRotateCamera",function(){return b.VRDeviceOrientationArcRotateCamera}),r.d(t,"VRDeviceOrientationFreeCamera",function(){return b.VRDeviceOrientationFreeCamera}),r.d(t,"VRDeviceOrientationGamepadCamera",function(){return b.VRDeviceOrientationGamepadCamera}),r.d(t,"OnAfterEnteringVRObservableEvent",function(){return b.OnAfterEnteringVRObservableEvent}),r.d(t,"VRExperienceHelper",function(){return b.VRExperienceHelper}),r.d(t,"WebVRFreeCamera",function(){return b.WebVRFreeCamera})},"./Cameras/targetCamera.ts": /*!*********************************!*\ !*** ./Cameras/targetCamera.ts ***! \*********************************/ /*! exports provided: TargetCamera */function(e,t,r){"use strict";r.r(t),r.d(t,"TargetCamera",function(){return l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ./camera */"./Cameras/camera.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),c=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),l=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 Object(n.__extends)(t,e),t.prototype.getFrontPosition=function(e){this.getWorldMatrix();var t=this.getTarget().subtract(this.position);return t.normalize(),t.scaleInPlace(e),this.globalPosition.add(t)},t.prototype._getLockedTargetPosition=function(){return this.lockedTarget?(this.lockedTarget.absolutePosition&&this.lockedTarget.computeWorldMatrix(),this.lockedTarget.absolutePosition||this.lockedTarget):null},t.prototype.storeState=function(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0)},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.lockedTarget=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new s.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new s.Quaternion(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this);var r=this._getLockedTargetPosition();r?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(r):this._cache.lockedTarget=r.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)},t.prototype._isSynchronizedViewMatrix=function(){if(!e.prototype._isSynchronizedViewMatrix.call(this))return!1;var t=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(t):!t)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))},t.prototype._computeLocalCameraSpeed=function(){var e=this.getEngine();return this.speed*Math.sqrt(e.getDeltaTime()/(100*e.getFps()))},t.prototype.setTarget=function(e){this.upVector.normalize(),this._initialFocalDistance=e.subtract(this.position).length(),this.position.z===e.z&&(this.position.z+=a.Epsilon),s.Matrix.LookAtLHToRef(this.position,e,this._defaultUp,this._camMatrix),this._camMatrix.invert(),this.rotation.x=Math.atan(this._camMatrix.m[6]/this._camMatrix.m[10]);var t=e.subtract(this.position);t.x>=0?this.rotation.y=-Math.atan(t.z/t.x)+Math.PI/2:this.rotation.y=-Math.atan(t.z/t.x)-Math.PI/2,this.rotation.z=0,isNaN(this.rotation.x)&&(this.rotation.x=0),isNaN(this.rotation.y)&&(this.rotation.y=0),isNaN(this.rotation.z)&&(this.rotation.z=0),this.rotationQuaternion&&s.Quaternion.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion)},t.prototype.getTarget=function(){return this._currentTarget},t.prototype._decideIfNeedsToMove=function(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0},t.prototype._updatePosition=function(){if(this.parent)return this.parent.getWorldMatrix().invertToRef(s.TmpVectors.Matrix[0]),s.Vector3.TransformNormalToRef(this.cameraDirection,s.TmpVectors.Matrix[0],s.TmpVectors.Vector3[0]),void this.position.addInPlace(s.TmpVectors.Vector3[0]);this.position.addInPlace(this.cameraDirection)},t.prototype._checkInputs=function(){var t=this._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){this.rotation.x>1.570796&&(this.rotation.x=1.570796),this.rotation.x<-1.570796&&(this.rotation.x=-1.570796)}}t&&(Math.abs(this.cameraDirection.x)c){var l=c;c=a,a=l}return a>0&&a0&&c=0))},e.prototype._canDoCollision=function(e,t,r,n){var o=i.Vector3.Distance(this._basePointWorld,e),s=Math.max(this._radius.x,this._radius.y,this._radius.z);return!(o>this._velocityWorldLength+s+t)&&!!function(e,t,r,n){return!(e.x>r.x+n||r.x-n>t.x||e.y>r.y+n||r.y-n>t.y||e.z>r.z+n||r.z-n>t.z)}(r,n,this._basePointWorld,this._velocityWorldLength+s)},e.prototype._testTriangle=function(e,t,r,n,a,c,l){var u,h=!1;t||(t=[]),t[e]||(t[e]=new o.Plane(0,0,0,0),t[e].copyFromPoints(r,n,a));var d=t[e];if(c||d.isFrontFacingTo(this._normalizedVelocity,0)){var f=d.signedDistanceTo(this._basePoint),p=i.Vector3.Dot(d.normal,this._velocity);if(0==p){if(Math.abs(f)>=1)return;h=!0,u=0}else{var m=(1-f)/p;if((u=(-1-f)/p)>m){var g=m;m=u,u=g}if(u>1||m<0)return;u<0&&(u=0),u>1&&(u=1)}this._collisionPoint.copyFromFloats(0,0,0);var _=!1,v=1;if(h||(this._basePoint.subtractToRef(d.normal,this._planeIntersectionPoint),this._velocity.scaleToRef(u,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,r,n,a,d.normal)&&(_=!0,v=u,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!_){var A=this._velocity.lengthSquared(),y=A;this._basePoint.subtractToRef(r,this._tempVector);var b=2*i.Vector3.Dot(this._velocity,this._tempVector),T=this._tempVector.lengthSquared()-1,M=s(y,b,T,v);M.found&&(v=M.root,_=!0,this._collisionPoint.copyFrom(r)),this._basePoint.subtractToRef(n,this._tempVector),b=2*i.Vector3.Dot(this._velocity,this._tempVector),T=this._tempVector.lengthSquared()-1,(M=s(y,b,T,v)).found&&(v=M.root,_=!0,this._collisionPoint.copyFrom(n)),this._basePoint.subtractToRef(a,this._tempVector),b=2*i.Vector3.Dot(this._velocity,this._tempVector),T=this._tempVector.lengthSquared()-1,(M=s(y,b,T,v)).found&&(v=M.root,_=!0,this._collisionPoint.copyFrom(a)),n.subtractToRef(r,this._edge),r.subtractToRef(this._basePoint,this._baseToVertex);var x=this._edge.lengthSquared(),P=i.Vector3.Dot(this._edge,this._velocity),E=i.Vector3.Dot(this._edge,this._baseToVertex);if(y=x*-A+P*P,b=x*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*P*E,T=x*(1-this._baseToVertex.lengthSquared())+E*E,(M=s(y,b,T,v)).found){var C=(P*M.root-E)/x;C>=0&&C<=1&&(v=M.root,_=!0,this._edge.scaleInPlace(C),r.addToRef(this._edge,this._collisionPoint))}a.subtractToRef(n,this._edge),n.subtractToRef(this._basePoint,this._baseToVertex),x=this._edge.lengthSquared(),P=i.Vector3.Dot(this._edge,this._velocity),E=i.Vector3.Dot(this._edge,this._baseToVertex),y=x*-A+P*P,b=x*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*P*E,T=x*(1-this._baseToVertex.lengthSquared())+E*E,(M=s(y,b,T,v)).found&&(C=(P*M.root-E)/x)>=0&&C<=1&&(v=M.root,_=!0,this._edge.scaleInPlace(C),n.addToRef(this._edge,this._collisionPoint)),r.subtractToRef(a,this._edge),a.subtractToRef(this._basePoint,this._baseToVertex),x=this._edge.lengthSquared(),P=i.Vector3.Dot(this._edge,this._velocity),E=i.Vector3.Dot(this._edge,this._baseToVertex),y=x*-A+P*P,b=x*(2*i.Vector3.Dot(this._velocity,this._baseToVertex))-2*P*E,T=x*(1-this._baseToVertex.lengthSquared())+E*E,(M=s(y,b,T,v)).found&&(C=(P*M.root-E)/x)>=0&&C<=1&&(v=M.root,_=!0,this._edge.scaleInPlace(C),a.addToRef(this._edge,this._collisionPoint))}if(_){var S=v*this._velocity.length();(!this.collisionFound||S=n)i.copyFrom(e);else{var c=s?s.collisionMask:r.collisionMask;r._initialize(e,t,a);for(var l=0;lthis.capacity&&this._depth-1&&this.entries.splice(r,1)}},e.prototype.addEntries=function(e){for(var t=0;tu-n)&&(!(c-hh-i)&&!(l-dd-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,m=t.z;return!(af)&&(!(cp)&&!(lm))},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.vector */"./Maths/math.vector.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.vector */"./Maths/math.vector.ts"),o=function(){function e(e,t,r){this.center=i.Vector3.Zero(),this.centerWorld=i.Vector3.Zero(),this.minimum=i.Vector3.Zero(),this.maximum=i.Vector3.Zero(),this.reConstruct(e,t,r)}return e.prototype.reConstruct=function(e,t,r){this.minimum.copyFrom(e),this.maximum.copyFrom(t);var n=i.Vector3.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=.5*n,this._update(r||i.Matrix.IdentityReadOnly)},e.prototype.scale=function(t){var r=this.radius*t,n=e.TmpVector3,i=n[0].setAll(r),o=this.center.subtractToRef(i,n[1]),s=this.center.addToRef(i,n[2]);return this.reConstruct(o,s,this._worldMatrix),this},e.prototype.getWorldMatrix=function(){return this._worldMatrix},e.prototype._update=function(t){if(t.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{i.Vector3.TransformCoordinatesToRef(this.center,t,this.centerWorld);var r=e.TmpVector3[0];i.Vector3.TransformNormalFromFloatsToRef(1,1,1,t,r),this.radiusWorld=Math.max(Math.abs(r.x),Math.abs(r.y),Math.abs(r.z))*this.radius}},e.prototype.isInFrustum=function(e){for(var t=this.centerWorld,r=this.radiusWorld,n=0;n<6;n++)if(e[n].dotCoordinate(t)<=-r)return!1;return!0},e.prototype.isCenterInFrustum=function(e){for(var t=this.centerWorld,r=0;r<6;r++)if(e[r].dotCoordinate(t)<0)return!1;return!0},e.prototype.intersectsPoint=function(e){var t=i.Vector3.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorldl.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.yl.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.zl.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 m=i.Vector3.Dot(a,u)*d;return m>this.length?null:new s.IntersectionInfo(1-f-p,f,m)},e.prototype.intersectsPlane=function(e){var t,r=i.Vector3.Dot(e.normal,this.direction);if(Math.abs(r)<9.99999997475243e-7)return null;var n=i.Vector3.Dot(e.normal,this.origin);return(t=(-e.d-n)/r)<0?t<-9.99999997475243e-7?null:0:t},e.prototype.intersectsAxis=function(e,t){switch(void 0===t&&(t=0),e){case"y":return(r=(this.origin.y-t)/this.direction.y)>0?null:new i.Vector3(this.origin.x+this.direction.x*-r,t,this.origin.z+this.direction.z*-r);case"x":return(r=(this.origin.x-t)/this.direction.x)>0?null:new i.Vector3(t,this.origin.y+this.direction.y*-r,this.origin.z+this.direction.z*-r);case"z":var r;return(r=(this.origin.z-t)/this.direction.z)>0?null:new i.Vector3(this.origin.x+this.direction.x*-r,this.origin.y+this.direction.y*-r,t);default:return null}},e.prototype.intersectsMesh=function(t,r){var n=i.TmpVectors.Matrix[0];return t.getWorldMatrix().invertToRef(n),this._tmpRay?e.TransformToRef(this,n,this._tmpRay):this._tmpRay=e.Transform(this,n),t.intersects(this._tmpRay,r)},e.prototype.intersectsMeshes=function(e,t,r){r?r.length=0:r=[];for(var n=0;nt.distance?1:0},e.prototype.intersectionSegment=function(t,r,n){var o=this.origin,s=i.TmpVectors.Vector3[0],a=i.TmpVectors.Vector3[1],c=i.TmpVectors.Vector3[2],l=i.TmpVectors.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),m=i.Vector3.Dot(s,c),g=i.Vector3.Dot(c,c),_=i.Vector3.Dot(s,l),v=i.Vector3.Dot(c,l),A=p*g-m*m,y=A,b=A;Ay&&(h=y,f=v+m,b=g)),f<0?(f=0,-_<0?h=0:-_>p?h=y:(h=-_,y=p)):f>b&&(f=b,-_+m<0?h=0:-_+m>p?h=y:(h=-_+m,y=p)),u=Math.abs(h)0&&d<=this.length&&x.lengthSquared()=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-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 l.StandardMaterial("",e),this._debugMaterial.wireframe=!0,this._debugMaterial.emissiveColor=a.Color3.White(),this._debugMaterial.disableLighting=!0),this._debugMaterial},e.prototype._getDebugBoxMesh=function(e){return this._debugBoxMesh||(this._debugBoxMesh=i.BoxBuilder.CreateBox("physicsBodyBoxViewMesh",{size:1},e),this._debugBoxMesh.rotationQuaternion=s.Quaternion.Identity(),this._debugBoxMesh.material=this._getDebugMaterial(e),this._debugBoxMesh.setEnabled(!1)),this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugSphereMesh=function(e){return this._debugSphereMesh||(this._debugSphereMesh=o.SphereBuilder.CreateSphere("physicsBodySphereViewMesh",{diameter:1},e),this._debugSphereMesh.rotationQuaternion=s.Quaternion.Identity(),this._debugSphereMesh.material=this._getDebugMaterial(e),this._debugSphereMesh.setEnabled(!1)),this._debugSphereMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugCylinderMesh=function(e){return this._debugCylinderMesh||(this._debugCylinderMesh=d.CylinderBuilder.CreateCylinder("physicsBodyCylinderViewMesh",{diameterTop:1,diameterBottom:1,height:1},e),this._debugCylinderMesh.rotationQuaternion=s.Quaternion.Identity(),this._debugCylinderMesh.material=this._getDebugMaterial(e),this._debugCylinderMesh.setEnabled(!1)),this._debugCylinderMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugMeshMesh=function(e,t){var r=new n.Mesh(e.name,t,null,e);return r.position=s.Vector3.Zero(),r.setParent(e),r.material=this._getDebugMaterial(t),this._debugMeshMeshes.push(r),r},e.prototype._getDebugMesh=function(e,t){var r=this;if(!this._utilityLayer)return null;if(t&&t.parent&&t.parent.physicsImpostor)return null;var n=null,i=this._utilityLayer.utilityLayerScene;switch(e.type){case u.PhysicsImpostor.BoxImpostor:n=this._getDebugBoxMesh(i),e.getBoxSizeToRef(n.scaling);break;case u.PhysicsImpostor.SphereImpostor:n=this._getDebugSphereMesh(i);var o=e.getRadius();n.scaling.x=2*o,n.scaling.y=2*o,n.scaling.z=2*o;break;case u.PhysicsImpostor.MeshImpostor:t&&(n=this._getDebugMeshMesh(t,i));break;case u.PhysicsImpostor.NoImpostor:if(t)t.getChildMeshes().filter(function(e){return e.physicsImpostor?1:0}).forEach(function(e){r._getDebugBoxMesh(i).parent=e});break;case u.PhysicsImpostor.CylinderImpostor:n=this._getDebugCylinderMesh(i);var s=e.object.getBoundingInfo();n.scaling.x=s.boundingBox.maximum.x-s.boundingBox.minimum.x,n.scaling.y=s.boundingBox.maximum.y-s.boundingBox.minimum.y,n.scaling.z=s.boundingBox.maximum.z-s.boundingBox.minimum.z}return n},e.prototype.dispose=function(){for(var e=this._numMeshes,t=0;t=0;a--){var c=e[a],l=c.getParent();if(l){var u=this._debugLines[i];u||(u=[n.Vector3.Zero(),n.Vector3.Zero()],this._debugLines[i]=u),c.getAbsolutePositionToRef(o,u[0]),l.getAbsolutePositionToRef(o,u[1]),u[0].subtractInPlace(s),u[1].subtractInPlace(s),i++}}},e.prototype.update=function(){if(this._utilityLayer){this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteTransforms();var e=this.mesh._effectiveMesh;void 0===this.skeleton.bones[0].length?this._getLinesForBonesNoLength(this.skeleton.bones,e.getWorldMatrix()):this._getLinesForBonesWithLength(this.skeleton.bones,e.getWorldMatrix());var t=this._utilityLayer.utilityLayerScene;this._debugMesh?o.LinesBuilder.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:this._debugMesh},t):(this._debugMesh=o.LinesBuilder.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:null},t),this._debugMesh.renderingGroupId=this.renderingGroupId),this._debugMesh.position.copyFrom(this.mesh.position),this._debugMesh.color=this.color}},e.prototype.dispose=function(){this.isEnabled=!1,this._debugMesh&&(this.isEnabled=!1,this._debugMesh.dispose(),this._debugMesh=null),this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null)},e}()},"./Engines/Extensions/engine.alpha.ts": /*!********************************************!*\ !*** ./Engines/Extensions/engine.alpha.ts ***! \********************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),i=r(/*! ../constants */"./Engines/constants.ts");n.ThinEngine.prototype.setAlphaConstants=function(e,t,r,n){this._alphaState.setAlphaBlendConstants(e,t,r,n)},n.ThinEngine.prototype.setAlphaMode=function(e,t){if(void 0===t&&(t=!1),this._alphaMode!==e){switch(e){case i.Constants.ALPHA_DISABLE:this._alphaState.alphaBlend=!1;break;case i.Constants.ALPHA_PREMULTIPLIED:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_COMBINE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ONEONE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ADD:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_SUBTRACT:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_MULTIPLY:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR,this._gl.ZERO,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_MAXIMIZED:this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_INTERPOLATE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR,this._gl.ONE_MINUS_CONSTANT_COLOR,this._gl.CONSTANT_ALPHA,this._gl.ONE_MINUS_CONSTANT_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_SCREENMODE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ONEONE_ONEONE:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ONE),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ALPHATOCOLOR:this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA,this._gl.ONE,this._gl.ZERO,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_REVERSEONEMINUS:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ONE_MINUS_DST_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_ONEONE_ONEZERO:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE,this._gl.ONE,this._gl.ONE,this._gl.ZERO),this._alphaState.alphaBlend=!0;break;case i.Constants.ALPHA_EXCLUSION:this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR,this._gl.ONE_MINUS_SRC_COLOR,this._gl.ZERO,this._gl.ONE),this._alphaState.alphaBlend=!0}t||(this.depthCullingState.depthMask=e===i.Constants.ALPHA_DISABLE),this._alphaMode=e}},n.ThinEngine.prototype.getAlphaMode=function(){return this._alphaMode},n.ThinEngine.prototype.setAlphaEquation=function(e){if(this._alphaEquation!==e){switch(e){case i.Constants.ALPHA_EQUATION_ADD:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_ADD,this._gl.FUNC_ADD);break;case i.Constants.ALPHA_EQUATION_SUBSTRACT:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_SUBTRACT,this._gl.FUNC_SUBTRACT);break;case i.Constants.ALPHA_EQUATION_REVERSE_SUBTRACT:this._alphaState.setAlphaEquationParameters(this._gl.FUNC_REVERSE_SUBTRACT,this._gl.FUNC_REVERSE_SUBTRACT);break;case i.Constants.ALPHA_EQUATION_MAX:this._alphaState.setAlphaEquationParameters(this._gl.MAX,this._gl.MAX);break;case i.Constants.ALPHA_EQUATION_MIN:this._alphaState.setAlphaEquationParameters(this._gl.MIN,this._gl.MIN);break;case i.Constants.ALPHA_EQUATION_DARKEN:this._alphaState.setAlphaEquationParameters(this._gl.MIN,this._gl.FUNC_ADD)}this._alphaEquation=e}},n.ThinEngine.prototype.getAlphaEquation=function(){return this._alphaEquation}},"./Engines/Extensions/engine.cubeTexture.ts": /*!**************************************************!*\ !*** ./Engines/Extensions/engine.cubeTexture.ts ***! \**************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),o=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),s=r(/*! ../../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../../Misc/fileTools */"./Misc/fileTools.ts");i.ThinEngine.prototype._createDepthStencilCubeTexture=function(e,t){var r=new o.InternalTexture(this,o.InternalTextureSource.Unknown);if(r.isCube=!0,1===this.webGLVersion)return s.Logger.Error("Depth cube texture is not supported by WebGL 1."),r;var i=Object(n.__assign)({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),a=this._gl;this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,r,!0),this._setupDepthStencilTexture(r,e,i.generateStencil,i.bilinearFiltering,i.comparisonFunction);for(var c=0;c<6;c++)i.generateStencil?a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,a.DEPTH24_STENCIL8,e,e,0,a.DEPTH_STENCIL,a.UNSIGNED_INT_24_8,null):a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,a.DEPTH_COMPONENT24,e,e,0,a.DEPTH_COMPONENT,a.UNSIGNED_INT,null);return this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,null),r},i.ThinEngine.prototype._partialLoadFile=function(e,t,r,n,i){void 0===i&&(i=null);this._loadFile(e,function(e){r[t]=e,r._internalCount++,6===r._internalCount&&n(r)},void 0,void 0,!0,function(e,t){i&&e&&i(e.status+" "+e.statusText,t)})},i.ThinEngine.prototype._cascadeLoadFiles=function(e,t,r,n){void 0===n&&(n=null);var i=[];i._internalCount=0;for(var o=0;o<6;o++)this._partialLoadFile(r[o],o,i,t,n)},i.ThinEngine.prototype._cascadeLoadImgs=function(e,t,r,n,i){void 0===n&&(n=null);var o=[];o._internalCount=0;for(var s=0;s<6;s++)this._partialLoadImg(r[s],s,o,e,t,n,i)},i.ThinEngine.prototype._partialLoadImg=function(e,t,r,n,i,o,s){var c;void 0===o&&(o=null);c=a.FileTools.LoadImage(e,function(){c&&(r[t]=c,r._internalCount++,n&&n._removePendingData(c)),6===r._internalCount&&i(r)},function(e,t){n&&n._removePendingData(c),o&&o(e,t)},n?n.offlineProvider:null,s),n&&c&&n._addPendingData(c)},i.ThinEngine.prototype._setCubeMapTextureParams=function(e){var t=this._gl;t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,null)},i.ThinEngine.prototype.createCubeTexture=function(e,t,r,n,a,c,l,u,h,d,f,p){var m=this;void 0===a&&(a=null),void 0===c&&(c=null),void 0===u&&(u=null),void 0===h&&(h=!1),void 0===d&&(d=0),void 0===f&&(f=0),void 0===p&&(p=null);var g=this._gl,_=p||new o.InternalTexture(this,o.InternalTextureSource.Cube);_.isCube=!0,_.url=e,_.generateMipMaps=!n,_._lodGenerationScale=d,_._lodGenerationOffset=f,this._doNotHandleContextLost||(_._extension=u,_._files=r);for(var v=e.lastIndexOf("."),A=u||(v>-1?e.substring(v).toLowerCase():""),y=null,b=0,T=i.ThinEngine._TextureLoaders;b1?"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;o1?"COLOR_ATTACHMENT"+o:"COLOR_ATTACHMENT"+o+"_WEBGL"];n.drawBuffers(i)}for(o=0;o1?"COLOR_ATTACHMENT"+b:"COLOR_ATTACHMENT"+b+"_WEBGL"];v.push(P),A.push(E),p.activeTexture(p["TEXTURE"+b]),p.bindTexture(p.TEXTURE_2D,P._webGLTexture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,x.mag),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,x.min),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(M),g,_,0,p.RGBA,this._getWebGLTextureType(M),null),p.framebufferTexture2D(p.DRAW_FRAMEBUFFER,E,p.TEXTURE_2D,P._webGLTexture,0),r&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(p.TEXTURE_2D,null),P._framebuffer=m,P._depthStencilBuffer=y,P.baseWidth=g,P.baseHeight=_,P.width=g,P.height=_,P.isReady=!0,P.samples=1,P.generateMipMaps=r,P.samplingMode=T,P.type=M,P._generateDepthBuffer=s,P._generateStencilBuffer=a,P._attachments=A,this._internalTexturesCache.push(P)}if(c&&this._caps.depthTextureExtension){var C=new n.InternalTexture(this,n.InternalTextureSource.MultiRenderTarget);p.activeTexture(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,C._webGLTexture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,this.webGLVersion<2?p.DEPTH_COMPONENT:p.DEPTH_COMPONENT16,g,_,0,p.DEPTH_COMPONENT,p.UNSIGNED_SHORT,null),p.framebufferTexture2D(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.TEXTURE_2D,C._webGLTexture,0),C._framebuffer=m,C.baseWidth=g,C.baseHeight=_,C.width=g,C.height=_,C.isReady=!0,C.samples=1,C.generateMipMaps=r,C.samplingMode=p.NEAREST,C._generateDepthBuffer=s,C._generateStencilBuffer=a,v.push(C),this._internalTexturesCache.push(C)}return p.drawBuffers(A),this._bindUnboundFramebuffer(null),this.resetTextureCache(),v},s.ThinEngine.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,this.getCaps().maxMSAASamples),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;n1&&r.renderbufferStorageMultisample){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;n1?"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}},"./Engines/Extensions/engine.multiview.ts": /*!************************************************!*\ !*** ./Engines/Extensions/engine.multiview.ts ***! \************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Cameras/camera */"./Cameras/camera.ts"),i=r(/*! ../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../scene */"./scene.ts"),s=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../../Materials/uniformBuffer */"./Materials/uniformBuffer.ts"),l=r(/*! ../../Materials/Textures/MultiviewRenderTarget */"./Materials/Textures/MultiviewRenderTarget.ts"),u=r(/*! ../../Maths/math.frustum */"./Maths/math.frustum.ts");i.Engine.prototype.createMultiviewRenderTargetTexture=function(e,t){var r=this._gl;if(!this.getCaps().multiview)throw"Multiview is not supported";var n=new s.InternalTexture(this,s.InternalTextureSource.Unknown,!0);return n.width=e,n.height=t,n._framebuffer=r.createFramebuffer(),n._colorTextureArray=r.createTexture(),r.bindTexture(r.TEXTURE_2D_ARRAY,n._colorTextureArray),r.texStorage3D(r.TEXTURE_2D_ARRAY,1,r.RGBA8,e,t,2),n._depthStencilTextureArray=r.createTexture(),r.bindTexture(r.TEXTURE_2D_ARRAY,n._depthStencilTextureArray),r.texStorage3D(r.TEXTURE_2D_ARRAY,1,r.DEPTH32F_STENCIL8,e,t,2),n.isReady=!0,n},i.Engine.prototype.bindMultiviewFramebuffer=function(e){var t=this._gl,r=this.getCaps().oculusMultiview||this.getCaps().multiview;if(this.bindFramebuffer(e,void 0,void 0,void 0,!0),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,e._framebuffer),!e._colorTextureArray||!e._depthStencilTextureArray)throw"Invalid multiview frame buffer";this.getCaps().oculusMultiview?(r.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,e._colorTextureArray,0,e.samples,0,2),r.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,e._depthStencilTextureArray,0,e.samples,0,2)):(r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,e._colorTextureArray,0,0,2),r.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,e._depthStencilTextureArray,0,0,2))},n.Camera.prototype._useMultiviewToSingleView=!1,n.Camera.prototype._multiviewTexture=null,n.Camera.prototype._resizeOrCreateMultiviewTexture=function(e,t){this._multiviewTexture?this._multiviewTexture.getRenderWidth()==e&&this._multiviewTexture.getRenderHeight()==t||(this._multiviewTexture.dispose(),this._multiviewTexture=new l.MultiviewRenderTarget(this.getScene(),{width:e,height:t})):this._multiviewTexture=new l.MultiviewRenderTarget(this.getScene(),{width:e,height:t})},o.Scene.prototype._transformMatrixR=a.Matrix.Zero(),o.Scene.prototype._multiviewSceneUbo=null,o.Scene.prototype._createMultiviewUbo=function(){this._multiviewSceneUbo=new c.UniformBuffer(this.getEngine(),void 0,!0),this._multiviewSceneUbo.addUniform("viewProjection",16),this._multiviewSceneUbo.addUniform("viewProjectionR",16),this._multiviewSceneUbo.addUniform("view",16)},o.Scene.prototype._updateMultiviewUbo=function(e,t){e&&t&&e.multiplyToRef(t,this._transformMatrixR),e&&t&&(e.multiplyToRef(t,a.TmpVectors.Matrix[0]),u.Frustum.GetRightPlaneToRef(a.TmpVectors.Matrix[0],this._frustumPlanes[3])),this._multiviewSceneUbo&&(this._multiviewSceneUbo.updateMatrix("viewProjection",this.getTransformMatrix()),this._multiviewSceneUbo.updateMatrix("viewProjectionR",this._transformMatrixR),this._multiviewSceneUbo.updateMatrix("view",this._viewMatrix),this._multiviewSceneUbo.update())},o.Scene.prototype._renderMultiviewToSingleView=function(e){e._resizeOrCreateMultiviewTexture(e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.width>0?e._rigPostProcess.width:this.getEngine().getRenderWidth(!0),e._rigPostProcess&&e._rigPostProcess&&e._rigPostProcess.height>0?e._rigPostProcess.height:this.getEngine().getRenderHeight(!0)),this._multiviewSceneUbo||this._createMultiviewUbo(),e.outputRenderTarget=e._multiviewTexture,this._renderForCamera(e),e.outputRenderTarget=null;for(var t=0;te.occlusionRetryCount))return!1;e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=e.occlusionType!==i.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC&&e.isOccluded}var n=this.getScene();if(n.getBoundingBoxRenderer){var o=n.getBoundingBoxRenderer();this._occlusionQuery||(this._occlusionQuery=t.createQuery()),t.beginOcclusionQuery(e.occlusionQueryAlgorithmType,this._occlusionQuery),o.renderOcclusionBoundingBox(this),t.endOcclusionQuery(e.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0}return e.isOccluded}},"./Engines/Extensions/engine.rawTexture.ts": /*!*************************************************!*\ !*** ./Engines/Extensions/engine.rawTexture.ts ***! \*************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),i=r(/*! ../../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../constants */"./Engines/constants.ts"),a=r(/*! ../engine */"./Engines/engine.ts");function c(e){return function(t,r,i,o,a,c,l,u,h,d){void 0===h&&(h=null),void 0===d&&(d=s.Constants.TEXTURETYPE_UNSIGNED_INT);var f=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,p=e?n.InternalTextureSource.Raw3D:n.InternalTextureSource.Raw2DArray,m=new n.InternalTexture(this,p);m.baseWidth=r,m.baseHeight=i,m.baseDepth=o,m.width=r,m.height=i,m.depth=o,m.format=a,m.type=d,m.generateMipMaps=c,m.samplingMode=u,e?m.is3D=!0:m.is2DArray=!0,this._doNotHandleContextLost||(m._bufferView=t),e?this.updateRawTexture3D(m,t,a,l,h,d):this.updateRawTexture2DArray(m,t,a,l,h,d),this._bindTextureDirectly(f,m,!0);var g=this._getSamplingParameters(u,c);return this._gl.texParameteri(f,this._gl.TEXTURE_MAG_FILTER,g.mag),this._gl.texParameteri(f,this._gl.TEXTURE_MIN_FILTER,g.min),c&&this._gl.generateMipmap(f),this._bindTextureDirectly(f,null),this._internalTexturesCache.push(m),m}}function l(e){return function(t,r,n,i,o,a){void 0===o&&(o=null),void 0===a&&(a=s.Constants.TEXTURETYPE_UNSIGNED_INT);var c=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,l=this._getWebGLTextureType(a),u=this._getInternalFormat(n),h=this._getRGBABufferInternalSizedFormat(a,n);this._bindTextureDirectly(c,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(c,0,this.getCaps().s3tc[o],t.width,t.height,t.depth,0,r):this._gl.texImage3D(c,0,h,t.width,t.height,t.depth,0,u,l,r),t.generateMipMaps&&this._gl.generateMipmap(c),this._bindTextureDirectly(c,null),t.isReady=!0}}a.Engine.prototype.updateRawTexture=function(e,t,r,n,i,o){if(void 0===i&&(i=null),void 0===o&&(o=s.Constants.TEXTURETYPE_UNSIGNED_INT),e){var a=this._getRGBABufferInternalSizedFormat(o,r),c=this._getInternalFormat(r),l=this._getWebGLTextureType(o);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(e._bufferView=t,e.format=r,e.type=o,e.invertY=n,e._compression=i),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),i&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[i],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,e.width,e.height,0,c,l,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}},a.Engine.prototype.createRawTexture=function(e,t,r,i,o,a,c,l,u){void 0===l&&(l=null),void 0===u&&(u=s.Constants.TEXTURETYPE_UNSIGNED_INT);var h=new n.InternalTexture(this,n.InternalTextureSource.Raw);h.baseWidth=t,h.baseHeight=r,h.width=t,h.height=r,h.format=i,h.generateMipMaps=o,h.samplingMode=c,h.invertY=a,h._compression=l,h.type=u,this._doNotHandleContextLost||(h._bufferView=e),this.updateRawTexture(h,e,i,a,l,u),this._bindTextureDirectly(this._gl.TEXTURE_2D,h,!0);var d=this._getSamplingParameters(c,o);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,d.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,d.min),o&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(h),h},a.Engine.prototype.createRawCubeTexture=function(e,t,r,a,c,l,u,h){void 0===h&&(h=null);var d=this._gl,f=new n.InternalTexture(this,n.InternalTextureSource.CubeRaw);f.isCube=!0,f.format=r,f.type=a,this._doNotHandleContextLost||(f._bufferViewArray=e);var p=this._getWebGLTextureType(a),m=this._getInternalFormat(r);m===d.RGB&&(m=d.RGBA),p!==d.FLOAT||this._caps.textureFloatLinearFiltering?p!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?p!==d.FLOAT||this._caps.textureFloatRender?p!==d.HALF_FLOAT||this._caps.colorBufferFloat||(c=!1,i.Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(c=!1,i.Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(c=!1,u=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE,i.Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(c=!1,u=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE,i.Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively."));var g=t,_=g;f.width=g,f.height=_,!this.needPOTTextures||o.Tools.IsExponentOfTwo(f.width)&&o.Tools.IsExponentOfTwo(f.height)||(c=!1),e&&this.updateRawCubeTexture(f,e,r,a,l,h),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,f,!0),e&&c&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);var v=this._getSamplingParameters(u,c);return d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MAG_FILTER,v.mag),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MIN_FILTER,v.min),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,null),f.generateMipMaps=c,f},a.Engine.prototype.updateRawCubeTexture=function(e,t,r,n,i,s,a){void 0===s&&(s=null),void 0===a&&(a=0),e._bufferViewArray=t,e.format=r,e.type=n,e.invertY=i,e._compression=s;var c=this._gl,l=this._getWebGLTextureType(n),u=this._getInternalFormat(r),h=this._getRGBABufferInternalSizedFormat(n),d=!1;u===c.RGB&&(u=c.RGBA,d=!0),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===i||!!i),e.width%4!=0&&c.pixelStorei(c.UNPACK_ALIGNMENT,1);for(var f=0;f<6;f++){var p=t[f];s?c.compressedTexImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+f,a,this.getCaps().s3tc[s],e.width,e.height,0,p):(d&&(p=this._convertRGBtoRGBATextureData(p,e.width,e.height,n)),c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+f,a,h,e.width,e.height,0,u,l,p))}(!this.needPOTTextures||o.Tools.IsExponentOfTwo(e.width)&&o.Tools.IsExponentOfTwo(e.height))&&e.generateMipMaps&&0===a&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},a.Engine.prototype.createRawCubeTextureFromUrl=function(e,t,r,n,i,o,a,c,l,u,h,d){var f=this;void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=s.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===d&&(d=!1);var p=this._gl,m=this.createRawCubeTexture(null,r,n,i,!o,d,h,null);t._addPendingData(m),m.url=e,this._internalTexturesCache.push(m);return this._loadFile(e,function(e){!function(e){var r=m.width,o=a(e);if(o){if(c){var s=f._getWebGLTextureType(i),u=f._getInternalFormat(n),h=f._getRGBABufferInternalSizedFormat(i),g=!1;u===p.RGB&&(u=p.RGBA,g=!0),f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,m,!0),f._unpackFlipY(!1);for(var _=c(o),v=0;v<_.length;v++)for(var A=r>>v,y=0;y<6;y++){var b=_[v][y];g&&(b=f._convertRGBtoRGBATextureData(b,A,A,i)),p.texImage2D(y,v,h,A,A,0,u,s,b)}f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null)}else f.updateRawCubeTexture(m,o,n,i,d);m.isReady=!0,t._removePendingData(m),l&&l()}}(e)},void 0,t.offlineProvider,!0,function(e,r){t._removePendingData(m),u&&e&&u(e.status+" "+e.statusText,r)}),m},a.Engine.prototype.createRawTexture2DArray=c(!1),a.Engine.prototype.createRawTexture3D=c(!0),a.Engine.prototype.updateRawTexture2DArray=l(!1),a.Engine.prototype.updateRawTexture3D=l(!0)},"./Engines/Extensions/engine.renderTarget.ts": /*!***************************************************!*\ !*** ./Engines/Extensions/engine.renderTarget.ts ***! \***************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),o=r(/*! ../../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),a=r(/*! ../constants */"./Engines/constants.ts"),c=r(/*! ../thinEngine */"./Engines/thinEngine.ts");c.ThinEngine.prototype.createRenderTargetTexture=function(e,t){var r=new s.RenderTargetCreationOptions;void 0!==t&&"object"==typeof t?(r.generateMipMaps=t.generateMipMaps,r.generateDepthBuffer=!!t.generateDepthBuffer,r.generateStencilBuffer=!!t.generateStencilBuffer,r.type=void 0===t.type?a.Constants.TEXTURETYPE_UNSIGNED_INT:t.type,r.samplingMode=void 0===t.samplingMode?a.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:t.samplingMode,r.format=void 0===t.format?a.Constants.TEXTUREFORMAT_RGBA:t.format):(r.generateMipMaps=t,r.generateDepthBuffer=!0,r.generateStencilBuffer=!1,r.type=a.Constants.TEXTURETYPE_UNSIGNED_INT,r.samplingMode=a.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,r.format=a.Constants.TEXTUREFORMAT_RGBA),(r.type!==a.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(r.type!==a.Constants.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=a.Constants.TEXTURE_NEAREST_SAMPLINGMODE),r.type!==a.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloat||(r.type=a.Constants.TEXTURETYPE_UNSIGNED_INT,o.Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var n=this._gl,c=new i.InternalTexture(this,i.InternalTextureSource.RenderTarget),l=e.width||e,u=e.height||e,h=e.layers||0,d=this._getSamplingParameters(r.samplingMode,!!r.generateMipMaps),f=0!==h?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D,p=this._getRGBABufferInternalSizedFormat(r.type,r.format),m=this._getInternalFormat(r.format),g=this._getWebGLTextureType(r.type);this._bindTextureDirectly(f,c),0!==h?(c.is2DArray=!0,n.texImage3D(f,0,p,l,u,h,0,m,g,null)):n.texImage2D(f,0,p,l,u,0,m,g,null),n.texParameteri(f,n.TEXTURE_MAG_FILTER,d.mag),n.texParameteri(f,n.TEXTURE_MIN_FILTER,d.min),n.texParameteri(f,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(f,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),r.generateMipMaps&&this._gl.generateMipmap(f),this._bindTextureDirectly(f,null);var _=n.createFramebuffer();return this._bindUnboundFramebuffer(_),c._depthStencilBuffer=this._setupFramebufferDepthAttachments(!!r.generateStencilBuffer,r.generateDepthBuffer,l,u),c.is2DArray||n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,c._webGLTexture,0),this._bindUnboundFramebuffer(null),c._framebuffer=_,c.baseWidth=l,c.baseHeight=u,c.width=l,c.height=u,c.depth=h,c.isReady=!0,c.samples=1,c.generateMipMaps=!!r.generateMipMaps,c.samplingMode=r.samplingMode,c.type=r.type,c.format=r.format,c._generateDepthBuffer=r.generateDepthBuffer,c._generateStencilBuffer=!!r.generateStencilBuffer,this._internalTexturesCache.push(c),c},c.ThinEngine.prototype.createDepthStencilTexture=function(e,t){if(t.isCube){var r=e.width||e;return this._createDepthStencilCubeTexture(r,t)}return this._createDepthStencilTexture(e,t)},c.ThinEngine.prototype._createDepthStencilTexture=function(e,t){var r=this._gl,s=e.layers||0,a=0!==s?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D,c=new i.InternalTexture(this,i.InternalTextureSource.Depth);if(!this._caps.depthTextureExtension)return o.Logger.Error("Depth texture is not supported by your browser or hardware."),c;var l=Object(n.__assign)({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t);this._bindTextureDirectly(a,c,!0),this._setupDepthStencilTexture(c,e,l.generateStencil,l.bilinearFiltering,l.comparisonFunction);var u=l.generateStencil?r.UNSIGNED_INT_24_8:r.UNSIGNED_INT,h=l.generateStencil?r.DEPTH_STENCIL:r.DEPTH_COMPONENT,d=h;return this.webGLVersion>1&&(d=l.generateStencil?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24),c.is2DArray?r.texImage3D(a,0,d,c.width,c.height,s,0,h,u,null):r.texImage2D(a,0,d,c.width,c.height,0,h,u,null),this._bindTextureDirectly(a,null),c}},"./Engines/Extensions/engine.renderTargetCube.ts": /*!*******************************************************!*\ !*** ./Engines/Extensions/engine.renderTargetCube.ts ***! \*******************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),o=r(/*! ../../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../constants */"./Engines/constants.ts");r(/*! ../thinEngine */"./Engines/thinEngine.ts").ThinEngine.prototype.createRenderTargetCubeTexture=function(e,t){var r=Object(n.__assign)({generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:s.Constants.TEXTURETYPE_UNSIGNED_INT,samplingMode:s.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,format:s.Constants.TEXTUREFORMAT_RGBA},t);r.generateStencilBuffer=r.generateDepthBuffer&&r.generateStencilBuffer,(r.type!==s.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(r.type!==s.Constants.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE);var a=this._gl,c=new i.InternalTexture(this,i.InternalTextureSource.RenderTarget);this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,c,!0);var l=this._getSamplingParameters(r.samplingMode,r.generateMipMaps);r.type!==s.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloat||(r.type=s.Constants.TEXTURETYPE_UNSIGNED_INT,o.Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,l.mag),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,l.min),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE);for(var u=0;u<6;u++)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,this._getRGBABufferInternalSizedFormat(r.type,r.format),e,e,0,this._getInternalFormat(r.format),this._getWebGLTextureType(r.type),null);var h=a.createFramebuffer();return this._bindUnboundFramebuffer(h),c._depthStencilBuffer=this._setupFramebufferDepthAttachments(r.generateStencilBuffer,r.generateDepthBuffer,e,e),r.generateMipMaps&&a.generateMipmap(a.TEXTURE_CUBE_MAP),this._bindTextureDirectly(a.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),c._framebuffer=h,c.width=e,c.height=e,c.isReady=!0,c.isCube=!0,c.samples=1,c.generateMipMaps=r.generateMipMaps,c.samplingMode=r.samplingMode,c.type=r.type,c.format=r.format,c._generateDepthBuffer=r.generateDepthBuffer,c._generateStencilBuffer=r.generateStencilBuffer,this._internalTexturesCache.push(c),c}},"./Engines/Extensions/engine.transformFeedback.ts": /*!********************************************************!*\ !*** ./Engines/Extensions/engine.transformFeedback.ts ***! \********************************************************/ /*! exports provided: _forceTransformFeedbackToBundle */function(e,t,r){"use strict";r.r(t),r.d(t,"_forceTransformFeedbackToBundle",function(){return i});var n=r(/*! ../../Engines/engine */"./Engines/engine.ts"),i=!0;n.Engine.prototype.createTransformFeedback=function(){return this._gl.createTransformFeedback()},n.Engine.prototype.deleteTransformFeedback=function(e){this._gl.deleteTransformFeedback(e)},n.Engine.prototype.bindTransformFeedback=function(e){this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK,e)},n.Engine.prototype.beginTransformFeedback=function(e){void 0===e&&(e=!0),this._gl.beginTransformFeedback(e?this._gl.POINTS:this._gl.TRIANGLES)},n.Engine.prototype.endTransformFeedback=function(){this._gl.endTransformFeedback()},n.Engine.prototype.setTranformFeedbackVaryings=function(e,t){this._gl.transformFeedbackVaryings(e,t,this._gl.INTERLEAVED_ATTRIBS)},n.Engine.prototype.bindTransformFeedbackBuffer=function(e){this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER,0,e?e.underlyingResource:null)}},"./Engines/Extensions/engine.uniformBuffer.ts": /*!****************************************************!*\ !*** ./Engines/Extensions/engine.uniformBuffer.ts ***! \****************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),i=r(/*! ../../Meshes/WebGL/webGLDataBuffer */"./Meshes/WebGL/webGLDataBuffer.ts");n.ThinEngine.prototype.createUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");var r=new i.WebGLDataBuffer(t);return this.bindUniformBuffer(r),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),r.references=1,r},n.ThinEngine.prototype.createDynamicUniformBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");var r=new i.WebGLDataBuffer(t);return this.bindUniformBuffer(r),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),r.references=1,r},n.ThinEngine.prototype.updateUniformBuffer=function(e,t,r,n){this.bindUniformBuffer(e),void 0===r&&(r=0),void 0===n?t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,t):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,new Float32Array(t)):t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,t.subarray(r,r+n)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(t).subarray(r,r+n)),this.bindUniformBuffer(null)},n.ThinEngine.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e?e.underlyingResource:null)},n.ThinEngine.prototype.bindUniformBufferBase=function(e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e?e.underlyingResource:null)},n.ThinEngine.prototype.bindUniformBlock=function(e,t,r){var n=e.program,i=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,i,r)}},"./Engines/Extensions/engine.videoTexture.ts": /*!***************************************************!*\ !*** ./Engines/Extensions/engine.videoTexture.ts ***! \***************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Engines/thinEngine */"./Engines/thinEngine.ts"),i=r(/*! ../../Misc/canvasGenerator */"./Misc/canvasGenerator.ts");n.ThinEngine.prototype.updateVideoTexture=function(e,t,r){if(e&&!e._isDisabled){var n=this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0);this._unpackFlipY(!r);try{if(void 0===this._videoTextureSupported&&(this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t),0!==this._gl.getError()?this._videoTextureSupported=!1:this._videoTextureSupported=!0),this._videoTextureSupported)this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t);else{if(!e._workingCanvas){e._workingCanvas=i.CanvasGenerator.CreateCanvas(e.width,e.height);var o=e._workingCanvas.getContext("2d");if(!o)throw new Error("Unable to get 2d context");e._workingContext=o,e._workingCanvas.width=e.width,e._workingCanvas.height=e.height}e._workingContext.drawImage(t,0,0,t.videoWidth,t.videoHeight,0,0,e.width,e.height),this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,e._workingCanvas)}e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),n||this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}catch(t){e._isDisabled=!0}}}},"./Engines/Extensions/engine.views.ts": /*!********************************************!*\ !*** ./Engines/Extensions/engine.views.ts ***! \********************************************/ /*! exports provided: EngineView */function(e,t,r){"use strict";r.r(t),r.d(t,"EngineView",function(){return i});var n=r(/*! ../engine */"./Engines/engine.ts"),i=function(){};n.Engine.prototype.getInputElement=function(){return this.inputElement||this.getRenderingCanvas()},n.Engine.prototype.registerView=function(e,t){var r=this;this.views||(this.views=[]);for(var n=0,i=this.views;n17)throw new Error("Exceeded maximum custom attributes");var i=l[r];if(void 0===i)throw new Error("Can't find bgfx name mapping");return t=t.replace(r,i),this._replacements.push({searchValue:new RegExp("\\b"+r+"\\b","g"),replaceValue:""+i}),"layout(location="+n+") "+e.prototype.attributeProcessor.call(this,t)},t.prototype.varyingProcessor=function(t,r){var n;return r?n=this._varyingLocationMap[t]:(n=this._varyingLocationCount++,this._varyingLocationMap[t]=n),"layout(location="+n+") "+e.prototype.varyingProcessor.call(this,t,r)},t.prototype.uniformProcessor=function(e){var t=e.match(/uniform\s+([^\s]+)\s+([^\s]+)\s*(?:\[.+\])?\s*;/),r=t[1],n=t[2];switch(r){case"sampler2D":case"samplerCube":var i=r.substr(7),o=this._textureCount++;return this._replacements.push({searchValue:new RegExp("\\b"+n+"\\b"),replaceValue:"sampler"+i+"("+n+"Texture, "+n+")"}),"layout(binding="+o+") uniform texture"+i+" "+n+"Texture;\nlayout(binding="+o+") uniform sampler "+n+";";case"float":this._replacements.push({searchValue:new RegExp("\\b"+n+"\\b"),replaceValue:n+".x"}),e="uniform vec4 "+n+";";break;case"vec2":this._replacements.push({searchValue:new RegExp("\\b"+n+"\\b"),replaceValue:n+".xy"}),e="uniform vec4 "+n+";";break;case"vec3":this._replacements.push({searchValue:new RegExp("\\b"+n+"\\b"),replaceValue:n+".xyz"}),e="uniform vec4 "+n+";"}return this._uniforms.push(e),1===this._uniforms.length?"":""},t.prototype.preProcessor=function(e,t,r){return this._genericAttributeLocation=10,r||(this._varyingLocationCount=0,this._varyingLocationMap={}),this._replacements=[],this._textureCount=0,this._uniforms=[],e},t.prototype.postProcessor=function(t,r,n){return t=(t=(t=e.prototype.postProcessor.call(this,t,r,n)).replace("","layout(binding=0) uniform Frame {\n"+this._uniforms.join("\n")+"\n};")).replace("out vec4 glFragColor","layout(location=0) out vec4 glFragColor")},t}(s.WebGL2ShaderProcessor)},"./Engines/Processors/Expressions/Operators/shaderDefineAndOperator.ts": /*!*****************************************************************************!*\ !*** ./Engines/Processors/Expressions/Operators/shaderDefineAndOperator.ts ***! \*****************************************************************************/ /*! exports provided: ShaderDefineAndOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineAndOperator",function(){return i});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.ts": /*!************************************************************************************!*\ !*** ./Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.ts ***! \************************************************************************************/ /*! exports provided: ShaderDefineArithmeticOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineArithmeticOperator",function(){return i});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(t,r,n){var i=e.call(this)||this;return i.define=t,i.operand=r,i.testValue=n,i}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){var t=e[this.define];void 0===t&&(t=this.define);var r=!1,n=parseInt(t),i=parseInt(this.testValue);switch(this.operand){case">":r=n>i;break;case"<":r=n=":r=n>=i;break;case"==":r=n===i}return r},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.ts": /*!***********************************************************************************!*\ !*** ./Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.ts ***! \***********************************************************************************/ /*! exports provided: ShaderDefineIsDefinedOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineIsDefinedOperator",function(){return i});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(t,r){void 0===r&&(r=!1);var n=e.call(this)||this;return n.define=t,n.not=r,n}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){var t=void 0!==e[this.define];return this.not&&(t=!t),t},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/Operators/shaderDefineOrOperator.ts": /*!****************************************************************************!*\ !*** ./Engines/Processors/Expressions/Operators/shaderDefineOrOperator.ts ***! \****************************************************************************/ /*! exports provided: ShaderDefineOrOperator */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineOrOperator",function(){return i});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.isTrue=function(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)},t}(r(/*! ../shaderDefineExpression */"./Engines/Processors/Expressions/shaderDefineExpression.ts").ShaderDefineExpression)},"./Engines/Processors/Expressions/shaderDefineExpression.ts": /*!******************************************************************!*\ !*** ./Engines/Processors/Expressions/shaderDefineExpression.ts ***! \******************************************************************/ /*! exports provided: ShaderDefineExpression */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderDefineExpression",function(){return n});var n=function(){function e(){}return e.prototype.isTrue=function(e){return!0},e}()},"./Engines/Processors/shaderCodeConditionNode.ts": /*!*******************************************************!*\ !*** ./Engines/Processors/shaderCodeConditionNode.ts ***! \*******************************************************/ /*! exports provided: ShaderCodeConditionNode */function(e,t,r){"use strict";r.r(t),r.d(t,"ShaderCodeConditionNode",function(){return i});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.process=function(e,t){for(var r=0;r=","<=","<",">"];i-1));i++);if(-1===n)return new a.ShaderDefineIsDefinedOperator(e);var s=e.substring(0,n).trim(),c=e.substring(n+r.length).trim();return new u.ShaderDefineArithmeticOperator(s,r,c)},e._BuildSubExpression=function(e){var t=e.indexOf("||");if(-1===t){var r=e.indexOf("&&");if(r>-1){var n=new l.ShaderDefineAndOperator,i=e.substring(0,r).trim(),o=e.substring(r+2).trim();return n.leftOperand=this._BuildSubExpression(i),n.rightOperand=this._BuildSubExpression(o),n}return this._ExtractOperation(e)}var s=new c.ShaderDefineOrOperator;i=e.substring(0,t).trim(),o=e.substring(t+2).trim();return s.leftOperand=this._BuildSubExpression(i),s.rightOperand=this._BuildSubExpression(o),s},e._BuildExpression=function(e,t){var r=new s.ShaderCodeTestNode,n=e.substring(0,t),i=e.substring(t).trim();return r.testExpression="#ifdef"===n?new a.ShaderDefineIsDefinedOperator(i):"#ifndef"===n?new a.ShaderDefineIsDefinedOperator(i,!0):this._BuildSubExpression(i),r},e._MoveCursorWithinIf=function(e,t,r){for(var i=e.currentLine;this._MoveCursor(e,r);){var o=(i=e.currentLine).substring(0,5).toLowerCase();if("#else"===o){var s=new n.ShaderCodeNode;return t.children.push(s),void this._MoveCursor(e,s)}if("#elif"===o){var a=this._BuildExpression(i,5);t.children.push(a),r=a}}},e._MoveCursor=function(e,t){for(;e.canRead;){e.lineIndex++;var r=e.currentLine,i=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/.exec(r);if(i&&i.length){switch(i[0]){case"#ifdef":var s=new o.ShaderCodeConditionNode;t.children.push(s);var a=this._BuildExpression(r,6);s.children.push(a),this._MoveCursorWithinIf(e,s,a);break;case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":s=new o.ShaderCodeConditionNode;t.children.push(s);a=this._BuildExpression(r,7);s.children.push(a),this._MoveCursorWithinIf(e,s,a);break;case"#if":s=new o.ShaderCodeConditionNode,a=this._BuildExpression(r,3);t.children.push(s),s.children.push(a),this._MoveCursorWithinIf(e,s,a)}}else{var c=new n.ShaderCodeNode;if(c.line=r,t.children.push(c),"#"===r[0]&&"d"===r[1]){var l=r.replace(";","").split(" ");c.additionalDefineKey=l[1],3===l.length&&(c.additionalDefineValue=l[2])}}}return!1},e._EvaluatePreProcessors=function(e,t,r){var o=new n.ShaderCodeNode,s=new i.ShaderCodeCursor;return s.lineIndex=-1,s.lines=e.split("\n"),this._MoveCursor(s,o),o.process(t,r)},e._PreparePreProcessors=function(e){for(var t={},r=0,n=e.defines;r1?i[1]:""}return t.GL_ES="true",t.__VERSION__=e.version,t[e.platformName]="true",t},e._ProcessShaderConversion=function(e,t){var r=this._ProcessPrecision(e,t);if(!t.processor)return r;if(-1!==r.indexOf("#version 3"))return r.replace("#version 300 es","");var n=t.defines,i=this._PreparePreProcessors(t);return t.processor.preProcessor&&(r=t.processor.preProcessor(r,n,t.isFragment)),r=this._EvaluatePreProcessors(r,i,t),t.processor.postProcessor&&(r=t.processor.postProcessor(r,n,t.isFragment)),r},e._ProcessIncludes=function(t,r,n){for(var i=this,o=/#include<(.+)>(\((.*)\))*(\[(.*)\])*/g,s=o.exec(t),a=new String(t);null!=s;){var c=s[1];if(-1!==c.indexOf("__decl__")&&(c=c.replace(/__decl__/,""),r.supportsUniformBuffers&&(c=(c=c.replace(/Vertex/,"Ubo")).replace(/Fragment/,"Ubo")),c+="Declaration"),!r.includesShadersStore[c]){var l=r.shadersRepository+"ShadersInclude/"+c+".fx";return void e._FileToolsLoadFile(l,function(e){r.includesShadersStore[c]=e,i._ProcessIncludes(a,r,n)})}var u=r.includesShadersStore[c];if(s[2])for(var h=s[3].split(","),d=0;d0?this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this.isVRPresenting()?this._requestVRFrame():this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1},t.prototype._renderViews=function(){return!1},t.prototype.switchFullscreen=function(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)},t.prototype.enterFullscreen=function(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&t._RequestFullscreen(this._renderingCanvas))},t.prototype.exitFullscreen=function(){this.isFullscreen&&t._ExitFullscreen()},t.prototype.enterPointerlock=function(){this._renderingCanvas&&t._RequestPointerlock(this._renderingCanvas)},t.prototype.exitPointerlock=function(){t._ExitPointerlock()},t.prototype.beginFrame=function(){this._measureFps(),this.onBeginFrameObservable.notifyObservers(this),e.prototype.beginFrame.call(this)},t.prototype.endFrame=function(){e.prototype.endFrame.call(this),this._submitVRFrame(),this.onEndFrameObservable.notifyObservers(this)},t.prototype.resize=function(){this.isVRPresenting()||e.prototype.resize.call(this)},t.prototype.setSize=function(t,r){if(this._renderingCanvas&&(e.prototype.setSize.call(this,t,r),this.scenes)){for(var n=0;n=i&&0===r?t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,new Float32Array(t)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,t):t instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,new Float32Array(t).subarray(r,r+n)):(t=t instanceof ArrayBuffer?new Uint8Array(t,r,n):new Uint8Array(t.buffer,t.byteOffset+r,n),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t)),this._resetVertexBufferBinding()},t.prototype._deletePipelineContext=function(t){var r=t;r&&r.program&&r.transformFeedback&&(this.deleteTransformFeedback(r.transformFeedback),r.transformFeedback=null),e.prototype._deletePipelineContext.call(this,t)},t.prototype.createShaderProgram=function(t,r,n,i,o,s){void 0===s&&(s=null),o=o||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);var a=e.prototype.createShaderProgram.call(this,t,r,n,i,o,s);return this.onAfterShaderCompilationObservable.notifyObservers(this),a},t.prototype._createShaderProgram=function(e,t,r,n,i){void 0===i&&(i=null);var o=n.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");if(n.attachShader(o,t),n.attachShader(o,r),this.webGLVersion>1&&i){var s=this.createTransformFeedback();this.bindTransformFeedback(s),this.setTranformFeedbackVaryings(o,i),e.transformFeedback=s}return n.linkProgram(o),this.webGLVersion>1&&i&&this.bindTransformFeedback(null),e.context=n,e.vertexShader=t,e.fragmentShader=r,e.isParallelCompiled||this._finalizePipelineContext(e),o},t.prototype._releaseTexture=function(t){e.prototype._releaseTexture.call(this,t),this.scenes.forEach(function(e){e.postProcesses.forEach(function(e){e._outputTexture==t&&(e._outputTexture=null)}),e.cameras.forEach(function(e){e._postProcesses.forEach(function(e){e&&e._outputTexture==t&&(e._outputTexture=null)})})})},t.prototype._rescaleTexture=function(e,r,n,i,o){var s=this;this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);var a=this.createRenderTargetTexture({width:r.width,height:r.height},{generateMipMaps:!1,type:l.Constants.TEXTURETYPE_UNSIGNED_INT,samplingMode:l.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,generateDepthBuffer:!1,generateStencilBuffer:!1});!this._rescalePostProcess&&t._RescalePostProcessFactory&&(this._rescalePostProcess=t._RescalePostProcessFactory(this)),this._rescalePostProcess.getEffect().executeWhenCompiled(function(){s._rescalePostProcess.onApply=function(t){t._bindTexture("textureSampler",e)};var t=n;t||(t=s.scenes[s.scenes.length-1]),t.postProcessManager.directRender([s._rescalePostProcess],a,!0),s._bindTextureDirectly(s._gl.TEXTURE_2D,r,!0),s._gl.copyTexImage2D(s._gl.TEXTURE_2D,0,i,0,0,r.width,r.height,0),s.unBindFramebuffer(a),s._releaseTexture(a),o&&o()})},t.prototype.getFps=function(){return this._fps},t.prototype.getDeltaTime=function(){return this._deltaTime},t.prototype._measureFps=function(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0},t.prototype._uploadImageToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=this._gl,o=this._getWebGLTextureType(e.type),s=this._getInternalFormat(e.format),a=this._getRGBABufferInternalSizedFormat(e.type,s),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)},t.prototype.updateDynamicIndexBuffer=function(e,t,r){var n;void 0===r&&(r=0),this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(e),n=t instanceof Uint16Array||t instanceof Uint32Array?t:e.is32Bits?new Uint32Array(t):new Uint16Array(t),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,n,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},t.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;var r=this._gl;if(t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(r.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(r.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(r.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null),t>1&&r.renderbufferStorageMultisample){var n=r.createFramebuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=n,this._bindUnboundFramebuffer(e._MSAAFramebuffer);var i=r.createRenderbuffer();if(!i)throw new Error("Unable to create multi sampled framebuffer");r.bindRenderbuffer(r.RENDERBUFFER,i),r.renderbufferStorageMultisample(r.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(e.type),e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i),e._MSAARenderBuffer=i}else this._bindUnboundFramebuffer(e._framebuffer);return e.samples=t,e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t),this._bindUnboundFramebuffer(null),t},t.prototype.updateTextureComparisonFunction=function(e,t){if(1!==this.webGLVersion){var r=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),0===t?(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,l.Constants.LEQUAL),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),0===t?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,l.Constants.LEQUAL),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}else f.Logger.Error("WebGL 1 does not support texture comparison.")},t.prototype.createInstancesBuffer=function(e){var t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");var r=new d.WebGLDataBuffer(t);return r.capacity=e,this.bindArrayBuffer(r),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),r},t.prototype.deleteInstancesBuffer=function(e){this._gl.deleteBuffer(e)},t.prototype._clientWaitAsync=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=10);var n=this._gl;return new Promise(function(i,o){var s=function(){var a=n.clientWaitSync(e,t,0);a!=n.WAIT_FAILED?a!=n.TIMEOUT_EXPIRED?i():setTimeout(s,r):o()};s()})},t.prototype._readPixelsAsync=function(e,t,r,n,i,o,s){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");var a=this._gl,c=a.createBuffer();a.bindBuffer(a.PIXEL_PACK_BUFFER,c),a.bufferData(a.PIXEL_PACK_BUFFER,s.byteLength,a.STREAM_READ),a.readPixels(e,t,r,n,i,o,0),a.bindBuffer(a.PIXEL_PACK_BUFFER,null);var l=a.fenceSync(a.SYNC_GPU_COMMANDS_COMPLETE,0);return l?(a.flush(),this._clientWaitAsync(l,0,10).then(function(){return a.deleteSync(l),a.bindBuffer(a.PIXEL_PACK_BUFFER,c),a.getBufferSubData(a.PIXEL_PACK_BUFFER,0,s),a.bindBuffer(a.PIXEL_PACK_BUFFER,null),a.deleteBuffer(c),s})):null},t.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},t.prototype.dispose=function(){for(this.hideLoadingUI(),this.onNewSceneAddedObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(this._rescalePostProcess&&this._rescalePostProcess.dispose();this.scenes.length;)this.scenes[0].dispose();1===t.Instances.length&&t.audioEngine&&t.audioEngine.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.disableVR(),o.DomManagement.IsWindowObjectExist()&&(window.removeEventListener("blur",this._onBlur),window.removeEventListener("focus",this._onFocus),this._renderingCanvas&&(this._renderingCanvas.removeEventListener("focus",this._onCanvasFocus),this._renderingCanvas.removeEventListener("blur",this._onCanvasBlur),this._renderingCanvas.removeEventListener("pointerout",this._onCanvasPointerOut)),document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange)),e.prototype.dispose.call(this);var r=t.Instances.indexOf(this);r>=0&&t.Instances.splice(r,1),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()},t.prototype._disableTouchAction=function(){this._renderingCanvas&&this._renderingCanvas.setAttribute&&(this._renderingCanvas.setAttribute("touch-action","none"),this._renderingCanvas.style.touchAction="none",this._renderingCanvas.style.msTouchAction="none")},t.prototype.displayLoadingUI=function(){if(o.DomManagement.IsWindowObjectExist()){var e=this.loadingScreen;e&&e.displayLoadingUI()}},t.prototype.hideLoadingUI=function(){if(o.DomManagement.IsWindowObjectExist()){var e=this._loadingScreen;e&&e.hideLoadingUI()}},Object.defineProperty(t.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=t.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){this._loadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loadingUIText",{set:function(e){this.loadingScreen.loadingUIText=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"loadingUIBackgroundColor",{set:function(e){this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!0,configurable:!0}),t._RequestPointerlock=function(e){e.requestPointerLock=e.requestPointerLock||e.msRequestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock,e.requestPointerLock&&e.requestPointerLock()},t._ExitPointerlock=function(){var e=document;document.exitPointerLock=document.exitPointerLock||e.msExitPointerLock||e.mozExitPointerLock||e.webkitExitPointerLock,document.exitPointerLock&&document.exitPointerLock()},t._RequestFullscreen=function(e){var t=e.requestFullscreen||e.msRequestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen;t&&t.call(e)},t._ExitFullscreen=function(){var e=document;document.exitFullscreen?document.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen?e.webkitCancelFullScreen():e.msCancelFullScreen&&e.msCancelFullScreen()},t.ALPHA_DISABLE=l.Constants.ALPHA_DISABLE,t.ALPHA_ADD=l.Constants.ALPHA_ADD,t.ALPHA_COMBINE=l.Constants.ALPHA_COMBINE,t.ALPHA_SUBTRACT=l.Constants.ALPHA_SUBTRACT,t.ALPHA_MULTIPLY=l.Constants.ALPHA_MULTIPLY,t.ALPHA_MAXIMIZED=l.Constants.ALPHA_MAXIMIZED,t.ALPHA_ONEONE=l.Constants.ALPHA_ONEONE,t.ALPHA_PREMULTIPLIED=l.Constants.ALPHA_PREMULTIPLIED,t.ALPHA_PREMULTIPLIED_PORTERDUFF=l.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,t.ALPHA_INTERPOLATE=l.Constants.ALPHA_INTERPOLATE,t.ALPHA_SCREENMODE=l.Constants.ALPHA_SCREENMODE,t.DELAYLOADSTATE_NONE=l.Constants.DELAYLOADSTATE_NONE,t.DELAYLOADSTATE_LOADED=l.Constants.DELAYLOADSTATE_LOADED,t.DELAYLOADSTATE_LOADING=l.Constants.DELAYLOADSTATE_LOADING,t.DELAYLOADSTATE_NOTLOADED=l.Constants.DELAYLOADSTATE_NOTLOADED,t.NEVER=l.Constants.NEVER,t.ALWAYS=l.Constants.ALWAYS,t.LESS=l.Constants.LESS,t.EQUAL=l.Constants.EQUAL,t.LEQUAL=l.Constants.LEQUAL,t.GREATER=l.Constants.GREATER,t.GEQUAL=l.Constants.GEQUAL,t.NOTEQUAL=l.Constants.NOTEQUAL,t.KEEP=l.Constants.KEEP,t.REPLACE=l.Constants.REPLACE,t.INCR=l.Constants.INCR,t.DECR=l.Constants.DECR,t.INVERT=l.Constants.INVERT,t.INCR_WRAP=l.Constants.INCR_WRAP,t.DECR_WRAP=l.Constants.DECR_WRAP,t.TEXTURE_CLAMP_ADDRESSMODE=l.Constants.TEXTURE_CLAMP_ADDRESSMODE,t.TEXTURE_WRAP_ADDRESSMODE=l.Constants.TEXTURE_WRAP_ADDRESSMODE,t.TEXTURE_MIRROR_ADDRESSMODE=l.Constants.TEXTURE_MIRROR_ADDRESSMODE,t.TEXTUREFORMAT_ALPHA=l.Constants.TEXTUREFORMAT_ALPHA,t.TEXTUREFORMAT_LUMINANCE=l.Constants.TEXTUREFORMAT_LUMINANCE,t.TEXTUREFORMAT_LUMINANCE_ALPHA=l.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA,t.TEXTUREFORMAT_RGB=l.Constants.TEXTUREFORMAT_RGB,t.TEXTUREFORMAT_RGBA=l.Constants.TEXTUREFORMAT_RGBA,t.TEXTUREFORMAT_RED=l.Constants.TEXTUREFORMAT_RED,t.TEXTUREFORMAT_R=l.Constants.TEXTUREFORMAT_R,t.TEXTUREFORMAT_RG=l.Constants.TEXTUREFORMAT_RG,t.TEXTUREFORMAT_RED_INTEGER=l.Constants.TEXTUREFORMAT_RED_INTEGER,t.TEXTUREFORMAT_R_INTEGER=l.Constants.TEXTUREFORMAT_R_INTEGER,t.TEXTUREFORMAT_RG_INTEGER=l.Constants.TEXTUREFORMAT_RG_INTEGER,t.TEXTUREFORMAT_RGB_INTEGER=l.Constants.TEXTUREFORMAT_RGB_INTEGER,t.TEXTUREFORMAT_RGBA_INTEGER=l.Constants.TEXTUREFORMAT_RGBA_INTEGER,t.TEXTURETYPE_UNSIGNED_BYTE=l.Constants.TEXTURETYPE_UNSIGNED_BYTE,t.TEXTURETYPE_UNSIGNED_INT=l.Constants.TEXTURETYPE_UNSIGNED_INT,t.TEXTURETYPE_FLOAT=l.Constants.TEXTURETYPE_FLOAT,t.TEXTURETYPE_HALF_FLOAT=l.Constants.TEXTURETYPE_HALF_FLOAT,t.TEXTURETYPE_BYTE=l.Constants.TEXTURETYPE_BYTE,t.TEXTURETYPE_SHORT=l.Constants.TEXTURETYPE_SHORT,t.TEXTURETYPE_UNSIGNED_SHORT=l.Constants.TEXTURETYPE_UNSIGNED_SHORT,t.TEXTURETYPE_INT=l.Constants.TEXTURETYPE_INT,t.TEXTURETYPE_UNSIGNED_INTEGER=l.Constants.TEXTURETYPE_UNSIGNED_INTEGER,t.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=l.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4,t.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=l.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1,t.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=l.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,t.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=l.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV,t.TEXTURETYPE_UNSIGNED_INT_24_8=l.Constants.TEXTURETYPE_UNSIGNED_INT_24_8,t.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=l.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV,t.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=l.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV,t.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=l.Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV,t.TEXTURE_NEAREST_SAMPLINGMODE=l.Constants.TEXTURE_NEAREST_SAMPLINGMODE,t.TEXTURE_BILINEAR_SAMPLINGMODE=l.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,t.TEXTURE_TRILINEAR_SAMPLINGMODE=l.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,t.TEXTURE_NEAREST_NEAREST_MIPLINEAR=l.Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR,t.TEXTURE_LINEAR_LINEAR_MIPNEAREST=l.Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST,t.TEXTURE_LINEAR_LINEAR_MIPLINEAR=l.Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR,t.TEXTURE_NEAREST_NEAREST_MIPNEAREST=l.Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST,t.TEXTURE_NEAREST_LINEAR_MIPNEAREST=l.Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST,t.TEXTURE_NEAREST_LINEAR_MIPLINEAR=l.Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR,t.TEXTURE_NEAREST_LINEAR=l.Constants.TEXTURE_NEAREST_LINEAR,t.TEXTURE_NEAREST_NEAREST=l.Constants.TEXTURE_NEAREST_NEAREST,t.TEXTURE_LINEAR_NEAREST_MIPNEAREST=l.Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST,t.TEXTURE_LINEAR_NEAREST_MIPLINEAR=l.Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR,t.TEXTURE_LINEAR_LINEAR=l.Constants.TEXTURE_LINEAR_LINEAR,t.TEXTURE_LINEAR_NEAREST=l.Constants.TEXTURE_LINEAR_NEAREST,t.TEXTURE_EXPLICIT_MODE=l.Constants.TEXTURE_EXPLICIT_MODE,t.TEXTURE_SPHERICAL_MODE=l.Constants.TEXTURE_SPHERICAL_MODE,t.TEXTURE_PLANAR_MODE=l.Constants.TEXTURE_PLANAR_MODE,t.TEXTURE_CUBIC_MODE=l.Constants.TEXTURE_CUBIC_MODE,t.TEXTURE_PROJECTION_MODE=l.Constants.TEXTURE_PROJECTION_MODE,t.TEXTURE_SKYBOX_MODE=l.Constants.TEXTURE_SKYBOX_MODE,t.TEXTURE_INVCUBIC_MODE=l.Constants.TEXTURE_INVCUBIC_MODE,t.TEXTURE_EQUIRECTANGULAR_MODE=l.Constants.TEXTURE_EQUIRECTANGULAR_MODE,t.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=l.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,t.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=l.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,t.SCALEMODE_FLOOR=l.Constants.SCALEMODE_FLOOR,t.SCALEMODE_NEAREST=l.Constants.SCALEMODE_NEAREST,t.SCALEMODE_CEILING=l.Constants.SCALEMODE_CEILING,t._RescalePostProcessFactory=null,t}(c.ThinEngine))},"./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(){return this._LastCreatedScene},enumerable:!0,configurable:!0}),e.Instances=new Array,e._LastCreatedScene=null,e.UseFallbackTexture=!0,e.FallbackTexture="",e}()},"./Engines/index.ts": /*!**************************!*\ !*** ./Engines/index.ts ***! \**************************/ /*! exports provided: Constants, ThinEngine, Engine, EngineStore, NullEngineOptions, NullEngine, WebGLPipelineContext, WebGL2ShaderProcessor, NativeEngine, _OcclusionDataStorage, _forceTransformFeedbackToBundle, EngineView */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(/*! ./thinEngine */"./Engines/thinEngine.ts");r.d(t,"ThinEngine",function(){return i.ThinEngine});var o=r(/*! ./engine */"./Engines/engine.ts");r.d(t,"Engine",function(){return o.Engine});var s=r(/*! ./engineStore */"./Engines/engineStore.ts");r.d(t,"EngineStore",function(){return s.EngineStore});var a=r(/*! ./nullEngine */"./Engines/nullEngine.ts");r.d(t,"NullEngineOptions",function(){return a.NullEngineOptions}),r.d(t,"NullEngine",function(){return a.NullEngine});var c=r(/*! ./Extensions/index */"./Engines/Extensions/index.ts");r.d(t,"_OcclusionDataStorage",function(){return c._OcclusionDataStorage}),r.d(t,"_forceTransformFeedbackToBundle",function(){return c._forceTransformFeedbackToBundle}),r.d(t,"EngineView",function(){return c.EngineView});var l=r(/*! ./WebGL/webGLPipelineContext */"./Engines/WebGL/webGLPipelineContext.ts");r.d(t,"WebGLPipelineContext",function(){return l.WebGLPipelineContext});var u=r(/*! ./WebGL/webGL2ShaderProcessors */"./Engines/WebGL/webGL2ShaderProcessors.ts");r.d(t,"WebGL2ShaderProcessor",function(){return u.WebGL2ShaderProcessor});var h=r(/*! ./nativeEngine */"./Engines/nativeEngine.ts");r.d(t,"NativeEngine",function(){return h.NativeEngine})},"./Engines/nativeEngine.ts": /*!*********************************!*\ !*** ./Engines/nativeEngine.ts ***! \*********************************/ /*! exports provided: NativeEngine */function(e,t,r){"use strict";r.r(t),r.d(t,"NativeEngine",function(){return T});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),s=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../Meshes/dataBuffer */"./Meshes/dataBuffer.ts"),c=r(/*! ../Misc/tools */"./Misc/tools.ts"),l=r(/*! ../Misc/environmentTextureTools */"./Misc/environmentTextureTools.ts"),u=r(/*! ../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),h=r(/*! ./Native/nativeShaderProcessor */"./Engines/Native/nativeShaderProcessor.ts"),d=r(/*! ../Misc/logger */"./Misc/logger.ts"),f=r(/*! ./constants */"./Engines/constants.ts"),p=r(/*! ./thinEngine */"./Engines/thinEngine.ts"),m=function(){function e(){this.isAsync=!1,this.isReady=!1}return e.prototype._handlesSpectorRebuildCallback=function(e){throw new Error("Not implemented")},e}(),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t}(a.DataBuffer),_=function(){function e(){}return e.POINT=0,e.MINPOINT_MAGPOINT_MIPPOINT=e.POINT,e.BILINEAR=1,e.MINLINEAR_MAGLINEAR_MIPPOINT=e.BILINEAR,e.TRILINEAR=2,e.MINLINEAR_MAGLINEAR_MIPLINEAR=e.TRILINEAR,e.ANISOTROPIC=3,e.POINT_COMPARE=4,e.TRILINEAR_COMPARE=5,e.MINBILINEAR_MAGPOINT=6,e.MINLINEAR_MAGPOINT_MIPLINEAR=e.MINBILINEAR_MAGPOINT,e.MINPOINT_MAGPOINT_MIPLINEAR=7,e.MINPOINT_MAGLINEAR_MIPPOINT=8,e.MINPOINT_MAGLINEAR_MIPLINEAR=9,e.MINLINEAR_MAGPOINT_MIPPOINT=10,e}(),v=function(){function e(){}return e.CLEAR_COLOR=1,e.CLEAR_DEPTH=2,e.CLEAR_STENCIL=4,e}(),A=function(){function e(){}return e.WRAP=0,e.MIRROR=1,e.CLAMP=2,e.BORDER=3,e.MIRROR_ONCE=4,e}(),y=function(){function e(){}return e.RGBA8=0,e.RGBA32F=1,e}(),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getInternalTexture=function(){return this},t.prototype.getViewCount=function(){return 1},t}(o.InternalTexture),T=function(e){function t(){var t=e.call(this,null)||this;return t._native=new _native.Engine,t.INVALID_HANDLE=65535,t._webGLVersion=2,t.disableUniformBuffers=!0,t._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:512,maxCubemapTextureSize:512,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!0,astc:null,pvrtc:null,etc1:null,etc2:null,maxAnisotropy:16,uintIndices:!1,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,textureFloat:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloat:!1,textureHalfFloatLinearFiltering:!1,textureHalfFloatRender:!1,textureLOD:!0,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!0,instancedArrays:!1,canUseTimestampForTimerQuery:!1,blendMinMax:!1,maxMSAASamples:1},c.Tools.Log("Babylon Native (v"+i.Engine.Version+") launched"),"undefined"==typeof URL&&(window.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(window.Blob=function(){}),t._shaderProcessor=new h.NativeShaderProcessor,t}return Object(n.__extends)(t,e),t.prototype.getHardwareScalingLevel=function(){return 1},t.prototype._queueNewFrame=function(e,t){return t.requestAnimationFrame?t.requestAnimationFrame(e):this._native.requestAnimationFrame(e),0},t.prototype._bindUnboundFramebuffer=function(e){this._currentFramebuffer!==e&&(this._currentFramebuffer&&this._native.unbindFramebuffer(this._currentFramebuffer),e&&this._native.bindFramebuffer(e),this._currentFramebuffer=e)},t.prototype.getHostDocument=function(){return null},t.prototype.clear=function(e,t,r,n){void 0===n&&(n=!1);var i=0;t&&e&&(this._native.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),i|=v.CLEAR_COLOR),r&&(this._native.clearDepth(1),i|=v.CLEAR_DEPTH),n&&(this._native.clearStencil(0),i|=v.CLEAR_STENCIL),this._native.clear(i)},t.prototype.createIndexBuffer=function(e){var t=this._normalizeIndexData(e),r=new g;if(r.references=1,r.is32Bits=4===t.BYTES_PER_ELEMENT,r.nativeIndexBuffer=this._native.createIndexBuffer(t),r.nativeVertexBuffer===this.INVALID_HANDLE)throw new Error("Could not create a native index buffer.");return r},t.prototype.createVertexBuffer=function(e){var t=new g;if(t.references=1,t.nativeVertexBuffer=this._native.createVertexBuffer(ArrayBuffer.isView(e)?e:new Float32Array(e)),t.nativeVertexBuffer===this.INVALID_HANDLE)throw new Error("Could not create a native vertex buffer.");return t},t.prototype.recordVertexArrayObject=function(e,t,r){var n=this._native.createVertexArray();t&&this._native.recordIndexBuffer(n,t.nativeIndexBuffer);for(var i=r.getAttributesNames(),o=0;o=0){var a=e[i[o]];if(a){var c=a.getBuffer();c&&this._native.recordVertexBuffer(n,c.nativeVertexBuffer,s,a.byteOffset,a.byteStride,a.getSize(),a.type,a.normalized)}}}return n},t.prototype.bindVertexArrayObject=function(e){this._native.bindVertexArray(e)},t.prototype.releaseVertexArrayObject=function(e){this._native.deleteVertexArray(e)},t.prototype.getAttributes=function(e,t){var r=e;return this._native.getAttributes(r.nativeProgram,t)},t.prototype.drawElementsType=function(e,t,r,n){this._drawCalls.addCount(1,!1),this._native.drawIndexed(e,t,r)},t.prototype.drawArraysType=function(e,t,r,n){this._drawCalls.addCount(1,!1),this._native.draw(e,t,r)},t.prototype.createPipelineContext=function(){return new m},t.prototype._preparePipelineContext=function(e,t,r,n,i,o,s){var a=e;a.nativeProgram=n?this.createRawShaderProgram(e,t,r,void 0,s):this.createShaderProgram(e,t,r,o,void 0,s)},t.prototype._isRenderingStateCompiled=function(e){return!0},t.prototype._executeWhenRenderingStateIsCompiled=function(e,t){t()},t.prototype.createRawShaderProgram=function(e,t,r,n,i){throw void 0===i&&(i=null),new Error("Not Supported")},t.prototype.createShaderProgram=function(e,t,r,n,i,o){void 0===o&&(o=null),this.onBeforeShaderCompilationObservable.notifyObservers(this);var s=this._native.createProgram(p.ThinEngine._ConcatenateShader(t,n),p.ThinEngine._ConcatenateShader(r,n));return this.onAfterShaderCompilationObservable.notifyObservers(this),s},t.prototype._setProgram=function(e){this._currentProgram!==e&&(this._native.setProgram(e),this._currentProgram=e)},t.prototype._releaseEffect=function(e){},t.prototype._deletePipelineContext=function(e){},t.prototype.getUniforms=function(e,t){var r=e;return this._native.getUniforms(r.nativeProgram,t)},t.prototype.bindUniformBlock=function(e,t,r){throw new Error("Not Implemented")},t.prototype.bindSamplers=function(e){var t=e.getPipelineContext();this._setProgram(t.nativeProgram);for(var r=e.getSamplers(),n=0;n-1?_.substring(b).toLowerCase():""),M=null,x=0,P=i.Engine._TextureLoaders;x-1?e.substring(A).toLowerCase():""))){if(r&&6===r.length)throw new Error("Multi-file loading not allowed on env files.");this._loadFile(e,function(e){return function(e){var t=l.EnvironmentTextureTools.GetEnvInfo(e);if(v.width=t.width,v.height=t.width,l.EnvironmentTextureTools.UploadEnvSpherical(v,t),1!==t.version)throw new Error('Unsupported babylon environment map version "'+t.version+'"');var r=t.specular;if(!r)throw new Error("Nothing else parsed so far");v._lodGenerationScale=r.lodGenerationScale;var n=l.EnvironmentTextureTools.CreateImageDataArrayBufferViews(e,t);if(v.format=f.Constants.TEXTUREFORMAT_RGBA,v.type=f.Constants.TEXTURETYPE_UNSIGNED_INT,v.generateMipMaps=!0,v.getEngine().updateTextureSamplingMode(s.Texture.TRILINEAR_SAMPLINGMODE,v),v._isRGBD=!0,v.invertY=!0,!_._native.loadEnvTexture(v._webGLTexture,n))throw new Error("Could not load a native cube texture.");v.isReady=!0,i&&i()}(new Uint8Array(e))},void 0,void 0,!0,function(e,t){a&&e&&a(e.status+" "+e.statusText,t)})}else{if(!r||6!==r.length)throw new Error("Cannot load cubemap because 6 files were not defined");var y=[r[0],r[3],r[1],r[4],r[2],r[5]];Promise.all(y.map(function(e){return c.Tools.LoadFileAsync(e).then(function(e){return new Uint8Array(e)})})).then(function(e){_._native.loadCubeTexture(v._webGLTexture,e,!n)}).then(function(){v.isReady=!0,i&&i()},function(e){a&&a("Failed to load cubemap: "+e.message,e)})}return this._internalTexturesCache.push(v),v},t.prototype._getSamplingFilter=function(e){switch(e){case f.Constants.TEXTURE_BILINEAR_SAMPLINGMODE:return _.MINLINEAR_MAGLINEAR_MIPPOINT;case f.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:return _.MINLINEAR_MAGLINEAR_MIPLINEAR;case f.Constants.TEXTURE_NEAREST_SAMPLINGMODE:return _.MINPOINT_MAGPOINT_MIPLINEAR;case f.Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST:return _.MINPOINT_MAGPOINT_MIPPOINT;case f.Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST:return _.MINLINEAR_MAGPOINT_MIPPOINT;case f.Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR:case f.Constants.TEXTURE_NEAREST_LINEAR:return _.MINLINEAR_MAGPOINT_MIPLINEAR;case f.Constants.TEXTURE_NEAREST_NEAREST:return _.MINPOINT_MAGPOINT_MIPPOINT;case f.Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST:return _.MINPOINT_MAGLINEAR_MIPPOINT;case f.Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR:return _.MINPOINT_MAGLINEAR_MIPLINEAR;case f.Constants.TEXTURE_LINEAR_LINEAR:return _.MINLINEAR_MAGLINEAR_MIPLINEAR;case f.Constants.TEXTURE_LINEAR_NEAREST:return _.MINPOINT_MAGLINEAR_MIPLINEAR;default:throw new Error("Unexpected sampling mode: "+e+".")}},t._GetNativeTextureFormat=function(e,t){if(e==f.Constants.TEXTUREFORMAT_RGBA&&t==f.Constants.TEXTURETYPE_UNSIGNED_INT)return y.RGBA8;if(e==f.Constants.TEXTUREFORMAT_RGBA&&t==f.Constants.TEXTURETYPE_FLOAT)return y.RGBA32F;throw new Error("Unexpected texture format or type: format "+e+", type "+t+".")},t.prototype.createRenderTargetTexture=function(e,r){var n=new u.RenderTargetCreationOptions;void 0!==r&&"object"==typeof r?(n.generateMipMaps=r.generateMipMaps,n.generateDepthBuffer=void 0===r.generateDepthBuffer||r.generateDepthBuffer,n.generateStencilBuffer=n.generateDepthBuffer&&r.generateStencilBuffer,n.type=void 0===r.type?f.Constants.TEXTURETYPE_UNSIGNED_INT:r.type,n.samplingMode=void 0===r.samplingMode?f.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE:r.samplingMode,n.format=void 0===r.format?f.Constants.TEXTUREFORMAT_RGBA:r.format):(n.generateMipMaps=r,n.generateDepthBuffer=!0,n.generateStencilBuffer=!1,n.type=f.Constants.TEXTURETYPE_UNSIGNED_INT,n.samplingMode=f.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,n.format=f.Constants.TEXTUREFORMAT_RGBA),(n.type!==f.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(n.type!==f.Constants.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(n.samplingMode=f.Constants.TEXTURE_NEAREST_SAMPLINGMODE);var i=new b(this,o.InternalTextureSource.RenderTarget),s=e.width||e,a=e.height||e;n.type!==f.Constants.TEXTURETYPE_FLOAT||this._caps.textureFloat||(n.type=f.Constants.TEXTURETYPE_UNSIGNED_INT,d.Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type"));var c=this._native.createFramebuffer(i._webGLTexture,s,a,t._GetNativeTextureFormat(n.format,n.type),n.samplingMode,!!n.generateStencilBuffer,n.generateDepthBuffer,!!n.generateMipMaps);return i._framebuffer=c,i.baseWidth=s,i.baseHeight=a,i.width=s,i.height=a,i.isReady=!0,i.samples=1,i.generateMipMaps=!!n.generateMipMaps,i.samplingMode=n.samplingMode,i.type=n.type,i.format=n.format,i._generateDepthBuffer=n.generateDepthBuffer,i._generateStencilBuffer=!!n.generateStencilBuffer,this._internalTexturesCache.push(i),i},t.prototype.updateTextureSamplingMode=function(e,t){if(t._webGLTexture){var r=this._getSamplingFilter(e);this._native.setTextureSampling(t._webGLTexture,r)}t.samplingMode=e},t.prototype.bindFramebuffer=function(e,t,r,n,i){if(t)throw new Error("Cuboid frame buffers are not yet supported in NativeEngine.");if(r||n)throw new Error("Required width/height for frame buffers not yet supported in NativeEngine.");if(i)throw new Error("forceFullscreenViewport for frame buffers not yet supported in NativeEngine.");this._bindUnboundFramebuffer(e._framebuffer)},t.prototype.unBindFramebuffer=function(e,t,r){void 0===t&&(t=!1),t&&d.Logger.Warn("Disabling mipmap generation not yet supported in NativeEngine. Ignoring."),r&&r(),this._bindUnboundFramebuffer(null)},t.prototype.createDynamicVertexBuffer=function(e){throw new Error("createDynamicVertexBuffer not yet implemented.")},t.prototype.updateDynamicIndexBuffer=function(e,t,r){throw void 0===r&&(r=0),new Error("updateDynamicIndexBuffer not yet implemented.")},t.prototype.updateDynamicVertexBuffer=function(e,t,r,n){throw new Error("updateDynamicVertexBuffer not yet implemented.")},t.prototype._setTexture=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);var i,o=this._boundUniforms[e];if(!o)return!1;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._native.setTexture(o,null)),!1;if(t.video)this._activeChannel=e,t.update();else if(t.delayLoadState===f.Constants.DELAYLOADSTATE_NOTLOADED)return t.delayLoad(),!1;return i=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,this._activeChannel=e,!(!i||!i._webGLTexture)&&(this._native.setTextureWrapMode(i._webGLTexture,this._getAddressMode(t.wrapU),this._getAddressMode(t.wrapV),this._getAddressMode(t.wrapR)),this._updateAnisotropicLevel(t),this._native.setTexture(o,i._webGLTexture),!0)},t.prototype._updateAnisotropicLevel=function(e){var t=e.getInternalTexture(),r=e.anisotropicFilteringLevel;t&&t._webGLTexture&&t._cachedAnisotropicFilteringLevel!==r&&(this._native.setTextureAnisotropicLevel(t._webGLTexture,r),t._cachedAnisotropicFilteringLevel=r)},t.prototype._getAddressMode=function(e){switch(e){case f.Constants.TEXTURE_WRAP_ADDRESSMODE:return A.WRAP;case f.Constants.TEXTURE_CLAMP_ADDRESSMODE:return A.CLAMP;case f.Constants.TEXTURE_MIRROR_ADDRESSMODE:return A.MIRROR;default:throw new Error("Unexpected wrap mode: "+e+".")}},t.prototype._bindTexture=function(e,t){throw new Error("_bindTexture not implemented.")},t.prototype._deleteBuffer=function(e){e.nativeIndexBuffer&&(this._native.deleteIndexBuffer(e.nativeIndexBuffer),delete e.nativeIndexBuffer),e.nativeVertexBuffer&&(this._native.deleteVertexBuffer(e.nativeVertexBuffer),delete e.nativeVertexBuffer)},t.prototype.releaseEffects=function(){},t.prototype._uploadCompressedDataToTextureDirectly=function(e,t,r,n,i,o,s){throw void 0===o&&(o=0),void 0===s&&(s=0),new Error("_uploadCompressedDataToTextureDirectly not implemented.")},t.prototype._uploadDataToTextureDirectly=function(e,t,r,n){throw void 0===r&&(r=0),void 0===n&&(n=0),new Error("_uploadDataToTextureDirectly not implemented.")},t.prototype._uploadArrayBufferViewToTexture=function(e,t,r,n){throw void 0===r&&(r=0),void 0===n&&(n=0),new Error("_uploadArrayBufferViewToTexture not implemented.")},t.prototype._uploadImageToTexture=function(e,t,r,n){throw void 0===r&&(r=0),void 0===n&&(n=0),new Error("_uploadArrayBufferViewToTexture not implemented.")},t}(i.Engine)},"./Engines/nullEngine.ts": /*!*******************************!*\ !*** ./Engines/nullEngine.ts ***! \*******************************/ /*! exports provided: NullEngineOptions, NullEngine */function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"NullEngineOptions",function(){return u}),r.d(t,"NullEngine",function(){return h});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../Materials/Textures/renderTargetCreationOptions */"./Materials/Textures/renderTargetCreationOptions.ts"),a=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),c=r(/*! ./constants */"./Engines/constants.ts"),l=r(/*! ../Meshes/dataBuffer */"./Meshes/dataBuffer.ts"),u=function(){this.renderWidth=512,this.renderHeight=256,this.textureSize=512,this.deterministicLockstep=!1,this.lockstepMaxSteps=4},h=function(t){function r(r){void 0===r&&(r=new u);var n=t.call(this,null)||this;o.Engine.Instances.push(n),void 0===r.deterministicLockstep&&(r.deterministicLockstep=!1),void 0===r.lockstepMaxSteps&&(r.lockstepMaxSteps=4),n._options=r,n._caps={maxTexturesImageUnits:16,maxVertexTextureImageUnits:16,maxCombinedTexturesImageUnits:32,maxTextureSize:512,maxCubemapTextureSize:512,maxRenderTextureSize:512,maxVertexAttribs:16,maxVaryingVectors:16,maxFragmentUniformVectors:16,maxVertexUniformVectors:16,standardDerivatives:!1,astc:null,pvrtc:null,etc1:null,etc2:null,maxAnisotropy:0,uintIndices:!1,fragmentDepthSupported:!1,highPrecisionShaderSupported:!0,colorBufferFloat:!1,textureFloat:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloat:!1,textureHalfFloatLinearFiltering:!1,textureHalfFloatRender:!1,textureLOD:!1,drawBuffersExtension:!1,depthTextureExtension:!1,vertexArrayObject:!1,instancedArrays:!1,canUseTimestampForTimerQuery:!1,maxMSAASamples:1,blendMinMax:!1},i.Logger.Log("Babylon.js v"+o.Engine.Version+" - Null engine");var s="undefined"!=typeof self?self:void 0!==e?e:window;return"undefined"==typeof URL&&(s.URL={createObjectURL:function(){},revokeObjectURL:function(){}}),"undefined"==typeof Blob&&(s.Blob=function(){}),n}return Object(n.__extends)(r,t),r.prototype.isDeterministicLockStep=function(){return this._options.deterministicLockstep},r.prototype.getLockstepMaxSteps=function(){return this._options.lockstepMaxSteps},r.prototype.getHardwareScalingLevel=function(){return 1},r.prototype.createVertexBuffer=function(e){var t=new l.DataBuffer;return t.references=1,t},r.prototype.createIndexBuffer=function(e){var t=new l.DataBuffer;return t.references=1,t},r.prototype.clear=function(e,t,r,n){void 0===n&&(n=!1)},r.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._options.renderWidth},r.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._options.renderHeight},r.prototype.setViewport=function(e,t,r){this._cachedViewport=e},r.prototype.createShaderProgram=function(e,t,r,n,i){return{__SPECTOR_rebuildProgram:null}},r.prototype.getUniforms=function(e,t){return[]},r.prototype.getAttributes=function(e,t){return[]},r.prototype.bindSamplers=function(e){this._currentEffect=null},r.prototype.enableEffect=function(e){this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e)},r.prototype.setState=function(e,t,r,n){void 0===t&&(t=0),void 0===n&&(n=!1)},r.prototype.setIntArray=function(e,t){},r.prototype.setIntArray2=function(e,t){},r.prototype.setIntArray3=function(e,t){},r.prototype.setIntArray4=function(e,t){},r.prototype.setFloatArray=function(e,t){},r.prototype.setFloatArray2=function(e,t){},r.prototype.setFloatArray3=function(e,t){},r.prototype.setFloatArray4=function(e,t){},r.prototype.setArray=function(e,t){},r.prototype.setArray2=function(e,t){},r.prototype.setArray3=function(e,t){},r.prototype.setArray4=function(e,t){},r.prototype.setMatrices=function(e,t){},r.prototype.setMatrix3x3=function(e,t){},r.prototype.setMatrix2x2=function(e,t){},r.prototype.setFloat=function(e,t){},r.prototype.setFloat2=function(e,t,r){},r.prototype.setFloat3=function(e,t,r,n){},r.prototype.setBool=function(e,t){},r.prototype.setFloat4=function(e,t,r,n,i){},r.prototype.setAlphaMode=function(e,t){void 0===t&&(t=!1),this._alphaMode!==e&&(this.alphaState.alphaBlend=e!==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,d,f){void 0===i&&(i=c.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===o&&(o=null),void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===d&&(d=null);var p=new a.InternalTexture(this,a.InternalTextureSource.Url),m=String(e);return p.url=m,p.generateMipMaps=!t,p.samplingMode=i,p.invertY=r,p.baseWidth=this._options.textureSize,p.baseHeight=this._options.textureSize,p.width=this._options.textureSize,p.height=this._options.textureSize,h&&(p.format=h),p.isReady=!0,o&&o(),this._internalTexturesCache.push(p),p},r.prototype.createRenderTargetTexture=function(e,t){var r=new s.RenderTargetCreationOptions;void 0!==t&&"object"==typeof t?(r.generateMipMaps=t.generateMipMaps,r.generateDepthBuffer=void 0===t.generateDepthBuffer||t.generateDepthBuffer,r.generateStencilBuffer=r.generateDepthBuffer&&t.generateStencilBuffer,r.type=void 0===t.type?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.InternalTextureSource.RenderTarget),i=e.width||e,o=e.height||e;return n._depthStencilBuffer={},n._framebuffer={},n.baseWidth=i,n.baseHeight=o,n.width=i,n.height=o,n.isReady=!0,n.samples=1,n.generateMipMaps=!!r.generateMipMaps,n.samplingMode=r.samplingMode,n.type=r.type,n._generateDepthBuffer=r.generateDepthBuffer,n._generateStencilBuffer=!!r.generateStencilBuffer,this._internalTexturesCache.push(n),n},r.prototype.updateTextureSamplingMode=function(e,t){t.samplingMode=e},r.prototype.bindFramebuffer=function(e,t,r,n,i){this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._currentFramebuffer=e._MSAAFramebuffer?e._MSAAFramebuffer:e._framebuffer,this._cachedViewport&&!i&&this.setViewport(this._cachedViewport,r,n)},r.prototype.unBindFramebuffer=function(e,t,r){void 0===t&&(t=!1),this._currentRenderTarget=null,r&&(e._MSAAFramebuffer&&(this._currentFramebuffer=e._framebuffer),r()),this._currentFramebuffer=null},r.prototype.createDynamicVertexBuffer=function(e){var t=new l.DataBuffer;return t.references=1,t.capacity=1,t},r.prototype.updateDynamicTexture=function(e,t,r,n,i){void 0===n&&(n=!1)},r.prototype.areAllEffectsReady=function(){return!0},r.prototype.getError=function(){return 0},r.prototype._getUnpackAlignement=function(){return 1},r.prototype._unpackFlipY=function(e){},r.prototype.updateDynamicIndexBuffer=function(e,t,r){void 0===r&&(r=0)},r.prototype.updateDynamicVertexBuffer=function(e,t,r,n){},r.prototype._bindTextureDirectly=function(e,t){return this._boundTexturesCache[this._activeChannel]!==t&&(this._boundTexturesCache[this._activeChannel]=t,!0)},r.prototype._bindTexture=function(e,t){e<0||this._bindTextureDirectly(0,t)},r.prototype._deleteBuffer=function(e){},r.prototype.releaseEffects=function(){},r.prototype.displayLoadingUI=function(){},r.prototype.hideLoadingUI=function(){},r.prototype._uploadCompressedDataToTextureDirectly=function(e,t,r,n,i,o,s){void 0===o&&(o=0),void 0===s&&(s=0)},r.prototype._uploadDataToTextureDirectly=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0)},r.prototype._uploadArrayBufferViewToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0)},r.prototype._uploadImageToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0)},r}(o.Engine)}.call(this,r(/*! ./../../node_modules/webpack/buildin/global.js */"../node_modules/webpack/buildin/global.js"))},"./Engines/thinEngine.ts": /*!*******************************!*\ !*** ./Engines/thinEngine.ts ***! \*******************************/ /*! exports provided: ThinEngine */function(e,t,r){"use strict";r.r(t),r.d(t,"ThinEngine",function(){return A});var n=r(/*! ./engineStore */"./Engines/engineStore.ts"),i=r(/*! ../Materials/effect */"./Materials/effect.ts"),o=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../States/depthCullingState */"./States/depthCullingState.ts"),c=r(/*! ../States/stencilState */"./States/stencilState.ts"),l=r(/*! ../States/alphaCullingState */"./States/alphaCullingState.ts"),u=r(/*! ./constants */"./Engines/constants.ts"),h=r(/*! ../Materials/Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),d=r(/*! ../Misc/logger */"./Misc/logger.ts"),f=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),p=r(/*! ./WebGL/webGL2ShaderProcessors */"./Engines/WebGL/webGL2ShaderProcessors.ts"),m=r(/*! ../Meshes/WebGL/webGLDataBuffer */"./Meshes/WebGL/webGLDataBuffer.ts"),g=r(/*! ./WebGL/webGLPipelineContext */"./Engines/WebGL/webGLPipelineContext.ts"),_=r(/*! ../Misc/canvasGenerator */"./Misc/canvasGenerator.ts"),v=function(){},A=function(){function e(t,r,n,i){var o=this;void 0===i&&(i=!1),this.forcePOTTextures=!1,this.isFullscreen=!1,this.cullBackFaces=!0,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this.validateShaderPrograms=!1,this.useReverseDepthBuffer=!1,this.disableUniformBuffers=!1,this._uniformBuffers=new Array,this._webGLVersion=1,this._windowIsBackground=!1,this._highPrecisionShadersAllowed=!0,this._badOS=!1,this._badDesktopOS=!1,this._renderingQueueLaunched=!1,this._activeRenderLoops=new Array,this.onContextLostObservable=new s.Observable,this.onContextRestoredObservable=new s.Observable,this._contextWasLost=!1,this._doNotHandleContextLost=!1,this.disableVertexArrayObjects=!1,this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new a.DepthCullingState,this._stencilState=new c.StencilState,this._alphaState=new l.AlphaState,this._alphaMode=u.Constants.ALPHA_ADD,this._alphaEquation=u.Constants.ALPHA_DISABLE,this._internalTexturesCache=new Array,this._activeChannel=0,this._currentTextureChannel=-1,this._boundTexturesCache={},this._compiledEffects={},this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._activeRequests=new Array,this._texturesSupported=new Array,this.premultipliedAlpha=!0,this.onBeforeTextureInitObservable=new s.Observable,this._viewportCached={x:0,y:0,z:0,w:0},this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._getDepthStencilBuffer=function(e,t,r,n,i,s){var a=o._gl,c=a.createRenderbuffer();return a.bindRenderbuffer(a.RENDERBUFFER,c),r>1&&a.renderbufferStorageMultisample?a.renderbufferStorageMultisample(a.RENDERBUFFER,r,i,e,t):a.renderbufferStorage(a.RENDERBUFFER,n,e,t),a.framebufferRenderbuffer(a.FRAMEBUFFER,s,a.RENDERBUFFER,c),a.bindRenderbuffer(a.RENDERBUFFER,null),c},this._boundUniforms={};var h=null;if(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.timeStep&&(n.timeStep=1/60),void 0===n.preserveDrawingBuffer&&(n.preserveDrawingBuffer=!1),void 0===n.audioEngine&&(n.audioEngine=!0),void 0===n.stencil&&(n.stencil=!0),!1===n.premultipliedAlpha&&(this.premultipliedAlpha=!1),this._doNotHandleContextLost=!!n.doNotHandleContextLost,navigator&&navigator.userAgent)for(var m=navigator.userAgent,g=0,_=e.ExceptionList;g<_.length;g++){var A=_[g],y=A.key,b=A.targets;if(new RegExp(y).test(m)){if(A.capture&&A.captureConstraint){var T=A.capture,M=A.captureConstraint,x=new RegExp(T).exec(m);if(x&&x.length>0)if(parseInt(x[x.length-1])>=M)continue}for(var P=0,E=b;P1&&(this._shaderProcessor=new p.WebGL2ShaderProcessor),this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),this._creationOptions=n,console.log("Babylon.js v"+e.Version+" - "+this.description)}}return Object.defineProperty(e,"NpmPackage",{get:function(){return"babylonjs@4.1.0"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"Version",{get:function(){return"4.1.0"},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 i.Effect.ShadersRepository},set:function(e){i.Effect.ShadersRepository=e},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,"_supportsHardwareTextureRescaling",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"framebufferDimensionsObject",{set:function(e){this._framebufferDimensionsObject=e},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,u.Constants.TEXTUREFORMAT_RGBA,!1,!1,u.Constants.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,u.Constants.TEXTUREFORMAT_RGBA,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture3D},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture2DArray",{get:function(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,u.Constants.TEXTUREFORMAT_RGBA,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture2DArray},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyCubeTexture",{get:function(){if(!this._emptyCubeTexture){var e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,u.Constants.TEXTUREFORMAT_RGBA,u.Constants.TEXTURETYPE_UNSIGNED_INT,!1,!1,u.Constants.TEXTURE_NEAREST_SAMPLINGMODE)}return this._emptyCubeTexture},enumerable:!0,configurable:!0}),e.prototype._rebuildInternalTextures=function(){for(var e=0,t=this._internalTexturesCache.slice();e1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile"),standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float"),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1},this._glVersion=this._gl.getParameter(this._gl.VERSION);var e=this._gl.getExtension("WEBGL_debug_renderer_info");if(null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor="Unknown vendor"),this._glRenderer||(this._glRenderer="Unknown renderer"),this._gl.HALF_FLOAT_OES=36193,34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._webGLVersion>1&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._gl.getParameter(this._gl.MAX_SAMPLES);else{var t=this._gl.getExtension("WEBGL_draw_buffers");if(null!==t){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=t.drawBuffersWEBGL.bind(t),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(var r=0;r<16;r++)this._gl["COLOR_ATTACHMENT"+r+"_WEBGL"]=t["COLOR_ATTACHMENT"+r+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{var n=this._gl.getExtension("WEBGL_depth_texture");null!=n&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=n.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{var i=this._gl.getExtension("OES_vertex_array_object");null!=i&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=i.createVertexArrayOES.bind(i),this._gl.bindVertexArray=i.bindVertexArrayOES.bind(i),this._gl.deleteVertexArray=i.deleteVertexArrayOES.bind(i))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{var o=this._gl.getExtension("ANGLE_instanced_arrays");null!=o?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=o.drawArraysInstancedANGLE.bind(o),this._gl.drawElementsInstanced=o.drawElementsInstancedANGLE.bind(o),this._gl.vertexAttribDivisor=o.vertexAttribDivisorANGLE.bind(o)):this._caps.instancedArrays=!1}if(this._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)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{var c=this._gl.getExtension("EXT_blend_minmax");null!=c&&(this._caps.blendMinMax=!0,this._gl.MAX=c.MAX_EXT,this._gl.MIN=c.MIN_EXT)}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(var l=0;l=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;t0?this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1},e.prototype.getRenderingCanvas=function(){return this._renderingCanvas},e.prototype.getHostWindow=function(){return f.DomManagement.IsWindowObjectExist()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null},e.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth},e.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight},e.prototype._queueNewFrame=function(t,r){return e.QueueNewFrame(t,r)},e.prototype.runRenderLoop=function(e){-1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._boundRenderFunction=this._renderLoop.bind(this),this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())))},e.prototype.clear=function(e,t,r,n){void 0===n&&(n=!1),this.applyStates();var i=0;t&&e&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),i|=this._gl.COLOR_BUFFER_BIT),r&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GREATER,this._gl.clearDepth(0)):this._gl.clearDepth(1),i|=this._gl.DEPTH_BUFFER_BIT),n&&(this._gl.clearStencil(0),i|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(i)},e.prototype._viewport=function(e,t,r,n){e===this._viewportCached.x&&t===this._viewportCached.y&&r===this._viewportCached.z&&n===this._viewportCached.w||(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=r,this._viewportCached.w=n,this._gl.viewport(e,t,r,n))},e.prototype.setViewport=function(e,t,r){var n=t||this.getRenderWidth(),i=r||this.getRenderHeight(),o=e.x||0,s=e.y||0;this._cachedViewport=e,this._viewport(o*n,s*i,n*e.width,i*e.height)},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){this._badOS&&this.flushFramebuffer()},e.prototype.resize=function(){var e,t;f.DomManagement.IsWindowObjectExist()?(e=this._renderingCanvas?this._renderingCanvas.clientWidth:window.innerWidth,t=this._renderingCanvas?this._renderingCanvas.clientHeight:window.innerHeight):(e=this._renderingCanvas?this._renderingCanvas.width:100,t=this._renderingCanvas?this._renderingCanvas.height:100),this.setSize(e/this._hardwareScalingLevel,t/this._hardwareScalingLevel)},e.prototype.setSize=function(e,t){this._renderingCanvas&&(e|=0,t|=0,this._renderingCanvas.width===e&&this._renderingCanvas.height===t||(this._renderingCanvas.width=e,this._renderingCanvas.height=t))},e.prototype.bindFramebuffer=function(e,t,r,n,i,o,s){void 0===t&&(t=0),void 0===o&&(o=0),void 0===s&&(s=0),this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(e._MSAAFramebuffer?e._MSAAFramebuffer:e._framebuffer);var a=this._gl;e.is2DArray?a.framebufferTextureLayer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,e._webGLTexture,o,s):e.isCube&&a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+t,e._webGLTexture,o);var c=e._depthStencilTexture;if(c){var l=c._generateStencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;e.is2DArray?a.framebufferTextureLayer(a.FRAMEBUFFER,l,c._webGLTexture,o,s):e.isCube?a.framebufferTexture2D(a.FRAMEBUFFER,l,a.TEXTURE_CUBE_MAP_POSITIVE_X+t,c._webGLTexture,o):a.framebufferTexture2D(a.FRAMEBUFFER,l,a.TEXTURE_2D,c._webGLTexture,o)}this._cachedViewport&&!i?this.setViewport(this._cachedViewport,r,n):(r||(r=e.width,o&&(r/=Math.pow(2,o))),n||(n=e.height,o&&(n/=Math.pow(2,o))),this._viewport(0,0,r,n)),this.wipeCaches()},e.prototype._bindUnboundFramebuffer=function(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)},e.prototype.unBindFramebuffer=function(e,t,r){void 0===t&&(t=!1),this._currentRenderTarget=null;var n=this._gl;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.flushFramebuffer=function(){this._gl.flush()},e.prototype.restoreDefaultFramebuffer=function(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()},e.prototype._resetVertexBufferBinding=function(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null},e.prototype.createVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)},e.prototype._createVertexBuffer=function(e,t){var r=this._gl.createBuffer();if(!r)throw new Error("Unable to create vertex buffer");var n=new m.WebGLDataBuffer(r);return this.bindArrayBuffer(n),e instanceof Array?this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.STATIC_DRAW),this._resetVertexBufferBinding(),n.references=1,n},e.prototype.createDynamicVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)},e.prototype._resetIndexBufferBinding=function(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null},e.prototype.createIndexBuffer=function(e,t){var r=this._gl.createBuffer(),n=new m.WebGLDataBuffer(r);if(!r)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);var i=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=4===i.BYTES_PER_ELEMENT,n},e.prototype._normalizeIndexData=function(e){if(e instanceof Uint16Array)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(var t=0;t=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)},e.prototype.bindArrayBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ARRAY_BUFFER)},e.prototype.bindUniformBlock=function(e,t,r){var n=e.program,i=this._gl.getUniformBlockIndex(n,t);this._gl.uniformBlockBinding(n,i,r)},e.prototype.bindIndexBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)},e.prototype.bindBuffer=function(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)},e.prototype.updateArrayBuffer=function(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)},e.prototype._vertexAttribPointer=function(e,t,r,n,i,o,s){var a=this._currentBufferPointers[t],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=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=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;t1?"#version 300 es\n#define WEBGL2 \n":"",a=this._compileShader(t,"vertex",n,s),c=this._compileShader(r,"fragment",n,s);return this._createShaderProgram(e,a,c,i,o)},e.prototype.createPipelineContext=function(){var e=new g.WebGLPipelineContext;return e.engine=this,this._caps.parallelShaderCompile&&(e.isParallelCompiled=!0),e},e.prototype._createShaderProgram=function(e,t,r,n,i){void 0===i&&(i=null);var o=n.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");return n.attachShader(o,t),n.attachShader(o,r),n.linkProgram(o),e.context=n,e.vertexShader=t,e.fragmentShader=r,e.isParallelCompiled||this._finalizePipelineContext(e),o},e.prototype._finalizePipelineContext=function(e){var t=e.context,r=e.vertexShader,n=e.fragmentShader,i=e.program;if(!t.getProgramParameter(i,t.LINK_STATUS)){var o,s;if(!this._gl.getShaderParameter(r,this._gl.COMPILE_STATUS))if(o=this._gl.getShaderInfoLog(r))throw e.vertexCompilationError=o,new Error("VERTEX SHADER "+o);if(!this._gl.getShaderParameter(n,this._gl.COMPILE_STATUS))if(o=this._gl.getShaderInfoLog(n))throw e.fragmentCompilationError=o,new Error("FRAGMENT SHADER "+o);if(s=t.getProgramInfoLog(i))throw e.programLinkError=s,new Error(s)}if(this.validateShaderPrograms&&(t.validateProgram(i),!t.getProgramParameter(i,t.VALIDATE_STATUS)&&(s=t.getProgramInfoLog(i))))throw e.programValidationError=s,new Error(s);t.deleteShader(r),t.deleteShader(n),e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)},e.prototype._preparePipelineContext=function(e,t,r,n,i,o,s){var a=e;a.program=n?this.createRawShaderProgram(a,t,r,void 0,s):this.createShaderProgram(a,t,r,o,void 0,s),a.program.__SPECTOR_rebuildProgram=i},e.prototype._isRenderingStateCompiled=function(e){var t=e;return!!this._gl.getProgramParameter(t.program,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)&&(this._finalizePipelineContext(t),!0)},e.prototype._executeWhenRenderingStateIsCompiled=function(e,t){var r=e;if(r.isParallelCompiled){var n=r.onCompiled;r.onCompiled=n?function(){n(),t()}:t}else t()},e.prototype.getUniforms=function(e,t){for(var r=new Array,n=e,i=0;i-1?_.substring(T).toLowerCase():""),x=null,P=0,E=e._TextureLoaders;Pc||e.height>c||!g._supportsHardwareTextureRescaling)return g._prepareWorkingCanvas(),!(!g._workingCanvas||!g._workingContext)&&(g._workingCanvas.width=t,g._workingCanvas.height=r,g._workingContext.drawImage(e,0,0,e.width,e.height,0,0,t,r),i.texImage2D(i.TEXTURE_2D,0,a,a,i.UNSIGNED_BYTE,g._workingCanvas),b.width=t,b.height=r,!1);var l=new h.InternalTexture(g,h.InternalTextureSource.Temp);return g._bindTextureDirectly(i.TEXTURE_2D,l,!0),i.texImage2D(i.TEXTURE_2D,0,a,a,i.UNSIGNED_BYTE,e),g._rescaleTexture(l,b,o,a,function(){g._releaseTexture(l),g._bindTextureDirectly(i.TEXTURE_2D,b,!0),n()}),!0},s)};!v||y?l&&(l.decoding||l.close)?I(l):e._FileToolsLoadImage(_,I,R,o?o.offlineProvider:null,m):"string"==typeof l||l instanceof ArrayBuffer||ArrayBuffer.isView(l)||l instanceof Blob?e._FileToolsLoadImage(l,I,R,o?o.offlineProvider:null,m):l&&I(l)}return b},e._FileToolsLoadImage=function(e,t,r,n,i){throw o._DevTools.WarnImport("FileTools")},e.prototype._rescaleTexture=function(e,t,r,n,i){},e.prototype.createRawTexture=function(e,t,r,n,i,s,a,c,l){throw void 0===c&&(c=null),void 0===l&&(l=u.Constants.TEXTURETYPE_UNSIGNED_INT),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype.createRawCubeTexture=function(e,t,r,n,i,s,a,c){throw void 0===c&&(c=null),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype.createRawTexture3D=function(e,t,r,n,i,s,a,c,l,h){throw void 0===l&&(l=null),void 0===h&&(h=u.Constants.TEXTURETYPE_UNSIGNED_INT),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype.createRawTexture2DArray=function(e,t,r,n,i,s,a,c,l,h){throw void 0===l&&(l=null),void 0===h&&(h=u.Constants.TEXTURETYPE_UNSIGNED_INT),o._DevTools.WarnImport("Engine.RawTexture")},e.prototype._unpackFlipY=function(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))},e.prototype._getUnpackAlignement=function(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)},e.prototype._getTextureTarget=function(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D},e.prototype.updateTextureSamplingMode=function(e,t,r){void 0===r&&(r=!1);var n=this._getTextureTarget(t),i=this._getSamplingParameters(e,t.generateMipMaps||r);this._setTextureParameterInteger(n,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(n,this._gl.TEXTURE_MIN_FILTER,i.min),r&&(t.generateMipMaps=!0,this._gl.generateMipmap(n)),this._bindTextureDirectly(n,null),t.samplingMode=e},e.prototype.updateTextureWrappingMode=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var i=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(i,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==r&&(this._setTextureParameterInteger(i,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r),e),e._cachedWrapV=r),(e.is2DArray||e.is3D)&&null!==n&&(this._setTextureParameterInteger(i,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(n),e),e._cachedWrapR=n),this._bindTextureDirectly(i,null)},e.prototype._setupDepthStencilTexture=function(e,t,r,n,i){var o=t.width||t,s=t.height||t,a=t.layers||0;e.baseWidth=o,e.baseHeight=s,e.width=o,e.height=s,e.is2DArray=a>0,e.depth=a,e.isReady=!0,e.samples=1,e.generateMipMaps=!1,e._generateDepthBuffer=!0,e._generateStencilBuffer=r,e.samplingMode=n?u.Constants.TEXTURE_BILINEAR_SAMPLINGMODE:u.Constants.TEXTURE_NEAREST_SAMPLINGMODE,e.type=u.Constants.TEXTURETYPE_UNSIGNED_INT,e._comparisonFunction=i;var c=this._gl,l=this._getTextureTarget(e),h=this._getSamplingParameters(e.samplingMode,!1);c.texParameteri(l,c.TEXTURE_MAG_FILTER,h.mag),c.texParameteri(l,c.TEXTURE_MIN_FILTER,h.min),c.texParameteri(l,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(l,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),0===i?(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,u.Constants.LEQUAL),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.NONE)):(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,i),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE))},e.prototype._uploadCompressedDataToTextureDirectly=function(e,t,r,n,i,o,s){void 0===o&&(o=0),void 0===s&&(s=0);var a=this._gl,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,i,o){void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=!1);var s=this._gl,a=this._getWebGLTextureType(e.type),c=this._getInternalFormat(e.format),l=void 0===i?this._getRGBABufferInternalSizedFormat(e.type,e.format):this._getInternalFormat(i);this._unpackFlipY(e.invertY);var u=s.TEXTURE_2D;e.isCube&&(u=s.TEXTURE_CUBE_MAP_POSITIVE_X+r);var h=Math.round(Math.log(e.width)*Math.LOG2E),d=Math.round(Math.log(e.height)*Math.LOG2E),f=o?e.width:Math.pow(2,Math.max(h-n,0)),p=o?e.height:Math.pow(2,Math.max(d-n,0));s.texImage2D(u,n,l,f,p,0,c,a,t)},e.prototype.updateTextureData=function(e,t,r,n,i,o,s,a){void 0===s&&(s=0),void 0===a&&(a=0);var c=this._gl,l=this._getWebGLTextureType(e.type),u=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);var h=c.TEXTURE_2D;e.isCube&&(h=c.TEXTURE_CUBE_MAP_POSITIVE_X+s),c.texSubImage2D(h,a,r,n,i,o,u,l,t)},e.prototype._uploadArrayBufferViewToTexture=function(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=0);var i=this._gl,o=e.isCube?i.TEXTURE_CUBE_MAP:i.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,r,n),this._bindTextureDirectly(o,null,!0)},e.prototype._prepareWebGLTextureContinuation=function(e,t,r,n,i){var o=this._gl;if(o){var s=this._getSamplingParameters(i,!r);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,s.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,s.min),r||n||o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null),t&&t._removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}},e.prototype._prepareWebGLTexture=function(t,r,n,i,o,s,a,c,l){var h=this;void 0===l&&(l=u.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE);var d=this.getCaps().maxTextureSize,f=Math.min(d,this.needPOTTextures?e.GetExponentOfTwo(n,d):n),p=Math.min(d,this.needPOTTextures?e.GetExponentOfTwo(i,d):i),m=this._gl;m&&(t._webGLTexture?(this._bindTextureDirectly(m.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===o||!!o),t.baseWidth=n,t.baseHeight=i,t.width=f,t.height=p,t.isReady=!0,c(f,p,function(){h._prepareWebGLTextureContinuation(t,r,s,a,l)})||this._prepareWebGLTextureContinuation(t,r,s,a,l)):r&&r._removePendingData(t))},e.prototype._setupFramebufferDepthAttachments=function(e,t,r,n,i){void 0===i&&(i=1);var o=this._gl;if(e&&t)return this._getDepthStencilBuffer(r,n,i,o.DEPTH_STENCIL,o.DEPTH24_STENCIL8,o.DEPTH_STENCIL_ATTACHMENT);if(t){var s=o.DEPTH_COMPONENT16;return this._webGLVersion>1&&(s=o.DEPTH_COMPONENT32F),this._getDepthStencilBuffer(r,n,i,s,s,o.DEPTH_ATTACHMENT)}return e?this._getDepthStencilBuffer(r,n,i,o.STENCIL_INDEX8,o.STENCIL_INDEX8,o.STENCIL_ATTACHMENT):null},e.prototype._releaseFramebufferObjects=function(e){var t=this._gl;e._framebuffer&&(t.deleteFramebuffer(e._framebuffer),e._framebuffer=null),e._depthStencilBuffer&&(t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(t.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(t.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null)},e.prototype._releaseTexture=function(e){this._releaseFramebufferObjects(e),this._deleteTexture(e._webGLTexture),this.unbindAllTextures();var t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()},e.prototype._deleteTexture=function(e){this._gl.deleteTexture(e)},e.prototype._setProgram=function(e){this._currentProgram!==e&&(this._gl.useProgram(e),this._currentProgram=e)},e.prototype.bindSamplers=function(e){var t=e.getPipelineContext();this._setProgram(t.program);for(var r=e.getSamplers(),n=0;n-1;return r&&o&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||n?(this._activateCurrentTexture(),t&&t.isMultiview?this._gl.bindTexture(e,t?t._colorTextureArray:null):this._gl.bindTexture(e,t?t._webGLTexture:null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)):r&&(i=!0,this._activateCurrentTexture()),o&&!r&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),i},e.prototype._bindTexture=function(e,t){void 0!==e&&(t&&(t._associatedChannel=e),this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,t))},e.prototype.unbindAllTextures=function(){for(var e=0;e1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))},e.prototype.setTexture=function(e,t,r){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,r))},e.prototype._bindSamplerUniformToChannel=function(e,t){var r=this._boundUniforms[e];r&&r._currentState!==t&&(this._gl.uniform1i(r,t),r._currentState=t)},e.prototype._getTextureWrapMode=function(e){switch(e){case u.Constants.TEXTURE_WRAP_ADDRESSMODE:return this._gl.REPEAT;case u.Constants.TEXTURE_CLAMP_ADDRESSMODE:return this._gl.CLAMP_TO_EDGE;case u.Constants.TEXTURE_MIRROR_ADDRESSMODE:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT},e.prototype._setTexture=function(e,t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!1),!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video)this._activeChannel=e,t.update();else if(t.delayLoadState===u.Constants.DELAYLOADSTATE_NOTLOADED)return t.delayLoad(),!1;var i;i=n?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!r&&i&&(i._associatedChannel=e);var o=!0;this._boundTexturesCache[e]===i&&(r||this._bindSamplerUniformToChannel(i._associatedChannel,e),o=!1),this._activeChannel=e;var s=this._getTextureTarget(i);if(o&&this._bindTextureDirectly(s,i,r),i&&!i.isMultiview){if(i.isCube&&i._cachedCoordinatesMode!==t.coordinatesMode){i._cachedCoordinatesMode=t.coordinatesMode;var a=t.coordinatesMode!==u.Constants.TEXTURE_CUBIC_MODE&&t.coordinatesMode!==u.Constants.TEXTURE_SKYBOX_MODE?u.Constants.TEXTURE_WRAP_ADDRESSMODE:u.Constants.TEXTURE_CLAMP_ADDRESSMODE;t.wrapU=a,t.wrapV=a}i._cachedWrapU!==t.wrapU&&(i._cachedWrapU=t.wrapU,this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),i)),i._cachedWrapV!==t.wrapV&&(i._cachedWrapV=t.wrapV,this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),i)),i.is3D&&i._cachedWrapR!==t.wrapR&&(i._cachedWrapR=t.wrapR,this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),i)),this._setAnisotropicLevel(s,i,t.anisotropicFilteringLevel)}return!0},e.prototype.setTextureArray=function(e,t,r){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===r.length||(this._textureUnits=new Int32Array(r.length));for(var n=0;n=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}},e.prototype.releaseEffects=function(){for(var e in this._compiledEffects){var t=this._compiledEffects[e].getPipelineContext();this._deletePipelineContext(t)}this._compiledEffects={}},e.prototype.dispose=function(){this.stopRenderLoop(),this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this.releaseEffects(),this.unbindAllAttributes(),this._boundUniforms=[],f.DomManagement.IsWindowObjectExist()&&this._renderingCanvas&&(this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers=[],this._renderingCanvas=null,this._currentProgram=null,this._boundRenderFunction=null,i.Effect.ResetCache();for(var e=0,t=this._activeRequests;e1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(u.Constants.TEXTURETYPE_FLOAT)},e.prototype._canRenderToHalfFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(u.Constants.TEXTURETYPE_HALF_FLOAT)},e.prototype._canRenderToFramebuffer=function(e){for(var t=this._gl;t.getError()!==t.NO_ERROR;);var r=!0,n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);var i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0);var o=t.checkFramebufferStatus(t.FRAMEBUFFER);if((r=(r=r&&o===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),r=r&&t.getError()===t.NO_ERROR),r){t.bindFramebuffer(t.FRAMEBUFFER,null);var s=t.RGBA,a=t.UNSIGNED_BYTE,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(e){if(1===this._webGLVersion){switch(e){case u.Constants.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case u.Constants.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT_OES;case u.Constants.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case u.Constants.TEXTURETYPE_BYTE:return this._gl.BYTE;case u.Constants.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case u.Constants.TEXTURETYPE_SHORT:return this._gl.SHORT;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT:return this._gl.UNSIGNED_SHORT;case u.Constants.TEXTURETYPE_INT:return this._gl.INT;case u.Constants.TEXTURETYPE_UNSIGNED_INTEGER:return this._gl.UNSIGNED_INT;case u.Constants.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case u.Constants.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5;case u.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case u.Constants.TEXTURETYPE_UNSIGNED_INT_24_8:return this._gl.UNSIGNED_INT_24_8;case u.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case u.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case u.Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE},e.prototype._getInternalFormat=function(e){var t=this._gl.RGBA;switch(e){case u.Constants.TEXTUREFORMAT_ALPHA:t=this._gl.ALPHA;break;case u.Constants.TEXTUREFORMAT_LUMINANCE:t=this._gl.LUMINANCE;break;case u.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:t=this._gl.LUMINANCE_ALPHA;break;case u.Constants.TEXTUREFORMAT_RED:t=this._gl.RED;break;case u.Constants.TEXTUREFORMAT_RG:t=this._gl.RG;break;case u.Constants.TEXTUREFORMAT_RGB:t=this._gl.RGB;break;case u.Constants.TEXTUREFORMAT_RGBA:t=this._gl.RGBA}if(this._webGLVersion>1)switch(e){case u.Constants.TEXTUREFORMAT_RED_INTEGER:t=this._gl.RED_INTEGER;break;case u.Constants.TEXTUREFORMAT_RG_INTEGER:t=this._gl.RG_INTEGER;break;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:t=this._gl.RGB_INTEGER;break;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:t=this._gl.RGBA_INTEGER}return t},e.prototype._getRGBABufferInternalSizedFormat=function(e,t){if(1===this._webGLVersion){if(void 0!==t)switch(t){case u.Constants.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case u.Constants.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case u.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB}return this._gl.RGBA}switch(e){case u.Constants.TEXTURETYPE_BYTE:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R8_SNORM;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG8_SNORM;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB8_SNORM;case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8I;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8I;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8I;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case u.Constants.TEXTURETYPE_UNSIGNED_BYTE:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R8;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG8;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB8;case u.Constants.TEXTUREFORMAT_RGBA:return this._gl.RGBA8;case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8UI;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8UI;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8UI;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8UI;case u.Constants.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case u.Constants.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case u.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case u.Constants.TEXTURETYPE_SHORT:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16I;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16I;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16I;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16I}case u.Constants.TEXTURETYPE_UNSIGNED_SHORT:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16UI;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16UI;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16UI;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16UI}case u.Constants.TEXTURETYPE_INT:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32I;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32I;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32I;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32I}case u.Constants.TEXTURETYPE_UNSIGNED_INTEGER:switch(t){case u.Constants.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32UI;case u.Constants.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32UI;case u.Constants.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32UI;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32UI}case u.Constants.TEXTURETYPE_FLOAT:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R32F;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG32F;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB32F;case u.Constants.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA32F}case u.Constants.TEXTURETYPE_HALF_FLOAT:switch(t){case u.Constants.TEXTUREFORMAT_RED:return this._gl.R16F;case u.Constants.TEXTUREFORMAT_RG:return this._gl.RG16F;case u.Constants.TEXTUREFORMAT_RGB:return this._gl.RGB16F;case u.Constants.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA16F}case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.RGB565;case u.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.R11F_G11F_B10F;case u.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.RGB9_E5;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.RGBA4;case u.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.RGB5_A1;case u.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:switch(t){case u.Constants.TEXTUREFORMAT_RGBA:return this._gl.RGB10_A2;case u.Constants.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return this._gl.RGBA8},e.prototype._getRGBAMultiSampleBufferFormat=function(e){return e===u.Constants.TEXTURETYPE_FLOAT?this._gl.RGBA32F:e===u.Constants.TEXTURETYPE_HALF_FLOAT?this._gl.RGBA16F:this._gl.RGBA8},e.prototype._loadFile=function(t,r,n,i,o,s){var a=this,c=e._FileToolsLoadFile(t,r,n,i,o,s);return this._activeRequests.push(c),c.onCompleteObservable.add(function(e){a._activeRequests.splice(a._activeRequests.indexOf(e),1)}),c},e._FileToolsLoadFile=function(e,t,r,n,i,s){throw o._DevTools.WarnImport("FileTools")},e.prototype.readPixels=function(e,t,r,n,i){void 0===i&&(i=!0);var o=i?4:3,s=i?this._gl.RGBA:this._gl.RGB,a=new Uint8Array(n*r*o);return this._gl.readPixels(e,t,r,n,s,this._gl.UNSIGNED_BYTE,a),a},e.isSupported=function(){if(null===this._isSupported)try{var e=_.CanvasGenerator.CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._isSupported=null!=t&&!!window.WebGLRenderingContext}catch(e){this._isSupported=!1}return this._isSupported},e.CeilingPOT=function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},e.FloorPOT=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)-(e>>1)},e.NearestPOT=function(t){var r=e.CeilingPOT(t),n=e.FloorPOT(t);return r-t>t-n?n:r},e.GetExponentOfTwo=function(t,r,n){var i;switch(void 0===n&&(n=u.Constants.SCALEMODE_NEAREST),n){case u.Constants.SCALEMODE_FLOOR:i=e.FloorPOT(t);break;case u.Constants.SCALEMODE_NEAREST:i=e.NearestPOT(t);break;case u.Constants.SCALEMODE_CEILING:default:i=e.CeilingPOT(t)}return Math.min(i,r)},e.QueueNewFrame=function(e,t){return f.DomManagement.IsWindowObjectExist()?(t||(t=window),t.requestAnimationFrame?t.requestAnimationFrame(e):t.msRequestAnimationFrame?t.msRequestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.mozRequestAnimationFrame?t.mozRequestAnimationFrame(e):t.oRequestAnimationFrame?t.oRequestAnimationFrame(e):window.setTimeout(e,16)):"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e,16)},e.prototype.getHostDocument=function(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:document},e.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]}],e._TextureLoaders=[],e.CollisionsEpsilon=.001,e._isSupported=null,e}()},"./Events/clipboardEvents.ts": /*!***********************************!*\ !*** ./Events/clipboardEvents.ts ***! \***********************************/ /*! exports provided: ClipboardEventTypes, ClipboardInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"ClipboardEventTypes",function(){return n}),r.d(t,"ClipboardInfo",function(){return i});var n=function(){function e(){}return e.COPY=1,e.CUT=2,e.PASTE=3,e}(),i=function(){function e(e,t){this.type=e,this.event=t}return e.GetTypeFromCharacter=function(e){switch(e){case 67:return n.COPY;case 86:return n.PASTE;case 88:return n.CUT;default:return-1}},e}()},"./Events/index.ts": /*!*************************!*\ !*** ./Events/index.ts ***! \*************************/ /*! exports provided: KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./keyboardEvents */"./Events/keyboardEvents.ts");r.d(t,"KeyboardEventTypes",function(){return n.KeyboardEventTypes}),r.d(t,"KeyboardInfo",function(){return n.KeyboardInfo}),r.d(t,"KeyboardInfoPre",function(){return n.KeyboardInfoPre});var i=r(/*! ./pointerEvents */"./Events/pointerEvents.ts");r.d(t,"PointerEventTypes",function(){return i.PointerEventTypes}),r.d(t,"PointerInfoBase",function(){return i.PointerInfoBase}),r.d(t,"PointerInfoPre",function(){return i.PointerInfoPre}),r.d(t,"PointerInfo",function(){return i.PointerInfo});var o=r(/*! ./clipboardEvents */"./Events/clipboardEvents.ts");r.d(t,"ClipboardEventTypes",function(){return o.ClipboardEventTypes}),r.d(t,"ClipboardInfo",function(){return o.ClipboardInfo})},"./Events/keyboardEvents.ts": /*!**********************************!*\ !*** ./Events/keyboardEvents.ts ***! \**********************************/ /*! exports provided: KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre */function(e,t,r){"use strict";r.r(t),r.d(t,"KeyboardEventTypes",function(){return i}),r.d(t,"KeyboardInfo",function(){return o}),r.d(t,"KeyboardInfoPre",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(){function e(){}return e.KEYDOWN=1,e.KEYUP=2,e}(),o=function(e,t){this.type=e,this.event=t},s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type=t,n.event=r,n.skipOnPointerObservable=!1,n}return Object(n.__extends)(t,e),t}(o)},"./Events/pointerEvents.ts": /*!*********************************!*\ !*** ./Events/pointerEvents.ts ***! \*********************************/ /*! exports provided: PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo */function(e,t,r){"use strict";r.r(t),r.d(t,"PointerEventTypes",function(){return o}),r.d(t,"PointerInfoBase",function(){return s}),r.d(t,"PointerInfoPre",function(){return a}),r.d(t,"PointerInfo",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=function(){function e(){}return e.POINTERDOWN=1,e.POINTERUP=2,e.POINTERMOVE=4,e.POINTERWHEEL=8,e.POINTERPICK=16,e.POINTERTAP=32,e.POINTERDOUBLETAP=64,e}(),s=function(e,t){this.type=e,this.event=t},a=function(e){function t(t,r,n,o){var s=e.call(this,t,r)||this;return s.ray=null,s.skipOnPointerObservable=!1,s.localPosition=new i.Vector2(n,o),s}return Object(n.__extends)(t,e),t}(s),c=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.pickInfo=n,i}return Object(n.__extends)(t,e),t}(s)},"./Gamepads/Controllers/daydreamController.ts": /*!****************************************************!*\ !*** ./Gamepads/Controllers/daydreamController.ts ***! \****************************************************/ /*! exports provided: DaydreamController */function(e,t,r){"use strict";r.r(t),r.d(t,"DaydreamController",function(){return 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 Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n=this;o.SceneLoader.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),r&&r(n._defaultModel)})},t.prototype._handleButtonChange=function(e,t,r){if(0===e){var n=this.onTriggerStateChangedObservable;n&&n.notifyObservers(t)}else i.Logger.Warn("Unrecognized Daydream button index: "+e)},t.MODEL_BASE_URL="https://controllers.babylonjs.com/generic/",t.MODEL_FILENAME="generic.babylon",t.GAMEPAD_ID_PREFIX="Daydream",t}(s.WebVRController);a.PoseEnabledControllerHelper._ControllerFactories.push({canCreate:function(e){return 0===e.id.indexOf(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.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../../Loading/sceneLoader */"./Loading/sceneLoader.ts"),a=r(/*! ./webVRController */"./Gamepads/Controllers/webVRController.ts"),c=r(/*! ./poseEnabledController */"./Gamepads/Controllers/poseEnabledController.ts"),l=function(e){function t(t){var r=e.call(this,t)||this;return r._buttonIndexToObservableNameMap=["onPadStateChangedObservable","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 Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n=this;s.SceneLoader.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,function(t){var i=new o.Mesh("",e);t[1].parent=i,t[1].position.z=-.15,n._defaultModel=i,n.attachToMesh(n._defaultModel),r&&r(n._defaultModel)})},t.prototype._handleButtonChange=function(e,t,r){if(ethis._maxRotationDistFromHeadset){var n=r-(r<0?-this._maxRotationDistFromHeadset:this._maxRotationDistFromHeadset);this._draggedRoomRotation+=n;var i=Math.sin(-n),o=Math.cos(-n);this._calculatedPosition.x=this._calculatedPosition.x*o-this._calculatedPosition.z*i,this._calculatedPosition.z=this._calculatedPosition.x*i+this._calculatedPosition.z*o}}s.Vector3.TransformCoordinatesToRef(this._calculatedPosition,this._deviceToWorld,this.devicePosition),this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix),s.Quaternion.FromRotationMatrixToRef(this._workingMatrix,this.deviceRotationQuaternion),this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation),this._mesh&&(this._mesh.position.copyFrom(this.devicePosition),this._mesh.rotationQuaternion&&this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion))}},t.prototype.updateFromDevice=function(e){if(!this.isXR&&e){this.rawPose=e,e.position&&(this._deviceRoomPosition.copyFromFloats(e.position[0],e.position[1],-e.position[2]),this._mesh&&this._mesh.getScene().useRightHandedSystem&&(this._deviceRoomPosition.z*=-1),this._trackPosition&&this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor,this._calculatedPosition),this._calculatedPosition.addInPlace(this.position));var t=this.rawPose;e.orientation&&t.orientation&&4===t.orientation.length&&(this._deviceRoomRotationQuaternion.copyFromFloats(t.orientation[0],t.orientation[1],-t.orientation[2],-t.orientation[3]),this._mesh&&(this._mesh.getScene().useRightHandedSystem?(this._deviceRoomRotationQuaternion.z*=-1,this._deviceRoomRotationQuaternion.w*=-1):this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion,this._deviceRoomRotationQuaternion)),this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion,this._calculatedRotation))}},t.prototype.attachToMesh=function(e){if(this._mesh&&(this._mesh.parent=null),this._mesh=e,this._poseControlledCamera&&(this._mesh.parent=this._poseControlledCamera),this._mesh.rotationQuaternion||(this._mesh.rotationQuaternion=new s.Quaternion),!this.isXR&&(this._updatePoseAndMesh(),this._pointingPoseNode)){for(var t=[],r=this._pointingPoseNode;r.parent;)t.push(r.parent),r=r.parent;t.reverse().forEach(function(e){e.computeWorldMatrix(!0)})}this._meshAttachedObservable.notifyObservers(e)},t.prototype.attachToPoseControlledCamera=function(e){this._poseControlledCamera=e,this._mesh&&(this._mesh.parent=this._poseControlledCamera)},t.prototype.dispose=function(){this._mesh&&this._mesh.dispose(),this._mesh=null,e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"mesh",{get:function(){return this._mesh},enumerable:!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 Object(n.__extends)(t,e),t.prototype.initControllerMesh=function(e,r){var n=this;i.SceneLoader.ImportMesh("",t.MODEL_BASE_URL,t.MODEL_FILENAME,e,function(e){n._defaultModel=e[1],n.attachToMesh(n._defaultModel),r&&r(n._defaultModel)})},Object.defineProperty(t.prototype,"onLeftButtonStateChangedObservable",{get:function(){return this.onMainButtonStateChangedObservable},enumerable:!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 Object(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=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.DUALSHOCK=4,e}(),a=function(e){function t(t,r,n){var o=e.call(this,t,r,n)||this;return o.onButtonDownObservable=new i.Observable,o.onButtonUpObservable=new i.Observable,o.type=s.GENERIC,o._buttons=new Array(n.buttons.length),o}return Object(n.__extends)(t,e),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype._setButtonValue=function(e,t,r){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(r),this.onButtonDownObservable.notifyObservers(r)),0===e&&(this._onbuttonup&&this._onbuttonup(r),this.onButtonUpObservable.notifyObservers(r))),e},t.prototype.update=function(){e.prototype.update.call(this);for(var t=0;tl.snapDistance){var t=Math.floor(Math.abs(f)/l.snapDistance);f%=l.snapDistance,g.normalizeToRef(p),p.scaleInPlace(l.snapDistance*t),l.attachedMesh.position.addInPlace(p),m.snapDistance=l.snapDistance*t,l.onSnapObservable.notifyObservers(m)}}),l._pointerObserver=s.utilityLayerScene.onPointerObservable.add(function(e){if(!l._customMeshSet){var t=e.pickInfo&&-1!=l._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?l._hoverMaterial:l._coloredMaterial;l._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.diffuseColor)})}});var v=s._getSharedGizmoLight();return v.includedOnlyMeshes=v.includedOnlyMeshes.concat(l._rootMesh.getChildMeshes(!1)),l}return Object(n.__extends)(t,e),t._CreateArrow=function(e,t){var r=new s.TransformNode("arrow",e),n=a.CylinderBuilder.CreateCylinder("cylinder",{diameterTop:0,height:.075,diameterBottom:.0375,tessellation:96},e),i=a.CylinderBuilder.CreateCylinder("cylinder",{diameterTop:.005,height:.275,diameterBottom:.005,tessellation:96},e);return i.material=t,n.parent=r,i.parent=r,n.material=t,n.rotation.x=Math.PI/2,n.position.z+=.3,i.position.z+=.1375,i.rotation.x=Math.PI/2,r},t._CreateArrowInstance=function(e,t){for(var r=new s.TransformNode("arrow",e),n=0,i=t.getChildMeshes();np.snapDistance?(i=Math.floor(Math.abs(_)/p.snapDistance),_<0&&(i*=-1),_%=p.snapDistance,v.scaleToRef(p.snapDistance*i,v),n=!0):v.scaleInPlace(0)),p.attachedMesh.scaling.addInPlace(v),n&&(A.snapDistance=p.snapDistance*i,p.onSnapObservable.notifyObservers(A))}}),p._pointerObserver=n.utilityLayerScene.onPointerObservable.add(function(e){if(!p._customMeshSet){var t=e.pickInfo&&-1!=p._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?p._hoverMaterial:p._coloredMaterial;p._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.diffuseColor)})}});var y=n._getSharedGizmoLight();return y.includedOnlyMeshes=y.includedOnlyMeshes.concat(p._rootMesh.getChildMeshes()),p}return Object(n.__extends)(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh):this.attachedMesh=null},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._arrow&&this._arrow.dispose(),[this._coloredMaterial,this._hoverMaterial].forEach(function(e){e&&e.dispose()}),e.prototype.dispose.call(this)},t.prototype.setCustomMesh=function(t,r){var n=this;void 0===r&&(r=!1),e.prototype.setCustomMesh.call(this,t),r&&(this._rootMesh.getChildMeshes().forEach(function(e){e.material=n._coloredMaterial,e.color&&(e.color=n._coloredMaterial.diffuseColor)}),this._customMeshSet=!1)},t}(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 A});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),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"),m=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),g=r(/*! ../Misc/pivotTools */"./Misc/pivotTools.ts"),_=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),v=r(/*! ../Maths/math.constants */"./Maths/math.constants.ts"),A=function(e){function t(t,r){void 0===t&&(t=_.Color3.Gray()),void 0===r&&(r=p.UtilityLayerRenderer.DefaultKeepDepthUtilityLayer);var n=e.call(this,r)||this;n._boundingDimensions=new s.Vector3(1,1,1),n._renderObserver=null,n._pointerObserver=null,n._scaleDragSpeed=.2,n._tmpQuaternion=new s.Quaternion,n._tmpVector=new s.Vector3(0,0,0),n._tmpRotationMatrix=new s.Matrix,n.ignoreChildren=!1,n.includeChildPredicate=null,n.rotationSphereSize=.1,n.scaleBoxSize=.1,n.fixedDragMeshScreenSize=!1,n.fixedDragMeshScreenSizeDistanceFactor=10,n.onDragStartObservable=new i.Observable,n.onScaleBoxDragObservable=new i.Observable,n.onScaleBoxDragEndObservable=new i.Observable,n.onRotationSphereDragObservable=new i.Observable,n.onRotationSphereDragEndObservable=new i.Observable,n.scalePivot=null,n._existingMeshScale=new s.Vector3,n._dragMesh=null,n.pointerDragBehavior=new d.PointerDragBehavior,n.updateScale=!1,n._anchorMesh=new a.AbstractMesh("anchor",r.utilityLayerScene),n.coloredMaterial=new m.StandardMaterial("",r.utilityLayerScene),n.coloredMaterial.disableLighting=!0,n.hoverColoredMaterial=new m.StandardMaterial("",r.utilityLayerScene),n.hoverColoredMaterial.disableLighting=!0,n._lineBoundingBox=new a.AbstractMesh("",r.utilityLayerScene),n._lineBoundingBox.rotationQuaternion=new s.Quaternion;var 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=v.coloredMaterial,(T=new d.PointerDragBehavior({})).moveAttached=!1,T.updateDragPlane=!1,t.addBehavior(T);var i=new s.Vector3(1,0,0),a=0;T.onDragStartObservable.add(function(){i.copyFrom(t.forward),a=0}),T.onDragObservable.add(function(t){if(n.onRotationSphereDragObservable.notifyObservers({}),n.attachedMesh){var r=n.attachedMesh.parent;if(r&&r.scaling&&r.scaling.isNonUniformWithinEpsilon(.001))return void o.Logger.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");g.PivotTools._RemoveAndStorePivotPoint(n.attachedMesh);var 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(),g.PivotTools._RestorePivotPoint(n.attachedMesh)}n._updateDummy()}),T.onDragStartObservable.add(function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(t)}),T.onDragEndObservable.add(function(){n.onRotationSphereDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()}),v._rotateSpheresParent.addChild(t)},v=this,A=0;A<12;A++)f(A);n._rootMesh.addChild(n._rotateSpheresParent),n._scaleBoxesParent=new a.AbstractMesh("",r.utilityLayerScene),n._scaleBoxesParent.rotationQuaternion=new s.Quaternion;for(var y=0;y<2;y++)for(var b=0;b<2;b++)for(var T,M=function(){var e=u.BoxBuilder.CreateBox("",{size:1},r.utilityLayerScene);e.material=x.coloredMaterial;var t=new s.Vector3(0==y?-1:1,0==b?-1:1,0==P?-1:1);(T=new d.PointerDragBehavior({dragAxis:t})).moveAttached=!1,e.addBehavior(T),T.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");g.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),g.PivotTools._RestorePivotPoint(n.attachedMesh)}n._updateDummy()}),T.onDragStartObservable.add(function(){n.onDragStartObservable.notifyObservers({}),n._selectNode(e)}),T.onDragEndObservable.add(function(){n.onScaleBoxDragEndObservable.notifyObservers({}),n._selectNode(null),n._updateDummy()}),x._scaleBoxesParent.addChild(e)},x=this,P=0;P<2;P++)M();n._rootMesh.addChild(n._scaleBoxesParent);var E=new Array;return n._pointerObserver=r.utilityLayerScene.onPointerObservable.add(function(e){E[e.event.pointerId]?e.pickInfo&&e.pickInfo.pickedMesh!=E[e.event.pointerId]&&(E[e.event.pointerId].material=n.coloredMaterial,delete E[e.event.pointerId]):n._rotateSpheresParent.getChildMeshes().concat(n._scaleBoxesParent.getChildMeshes()).forEach(function(t){e.pickInfo&&e.pickInfo.pickedMesh==t&&(E[e.event.pointerId]=t,t.material=n.hoverColoredMaterial)})}),n._renderObserver=n.gizmoLayer.originalScene.onBeforeRenderObservable.add(function(){n.attachedMesh&&!n._existingMeshScale.equals(n.attachedMesh.scaling)?n.updateBoundingBox():n.fixedDragMeshScreenSize&&(n._updateRotationSpheres(),n._updateScaleBoxes()),n._dragMesh&&n.attachedMesh&&n.pointerDragBehavior.dragging&&(n._lineBoundingBox.position.rotateByQuaternionToRef(n._rootMesh.rotationQuaternion,n._tmpVector),n.attachedMesh.setAbsolutePosition(n._dragMesh.position.add(n._tmpVector.scale(-1))))}),n.updateBoundingBox(),n}return Object(n.__extends)(t,e),t.prototype.setColor=function(e){this.coloredMaterial.emissiveColor=e,this.hoverColoredMaterial.emissiveColor=e.clone().add(new _.Color3(.3,.3,.3)),this._lineBoundingBox.getChildren().forEach(function(t){t.color&&(t.color=e)})},t.prototype._attachedMeshChanged=function(e){var t=this;if(e){g.PivotTools._RemoveAndStorePivotPoint(e);var r=e.parent;this._anchorMesh.addChild(e),this._anchorMesh.removeChild(e),e.setParent(r),g.PivotTools._RestorePivotPoint(e),this.updateBoundingBox(),e.getChildMeshes(!1).forEach(function(e){e.markAsDirty("scaling")}),this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(function(){t._updateDummy()})}},t.prototype._selectNode=function(e){this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach(function(t){t.isVisible=!e||t==e})},t.prototype.updateBoundingBox=function(){if(this.attachedMesh){g.PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);var e=this.attachedMesh.parent;this.attachedMesh.setParent(null);var t=null;this.attachedMesh.skeleton&&(t=this.attachedMesh.skeleton.overrideMesh,this.attachedMesh.skeleton.overrideMesh=null),this._update(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._anchorMesh.rotationQuaternion||(this._anchorMesh.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(this._anchorMesh.rotation.y,this._anchorMesh.rotation.x,this._anchorMesh.rotation.z)),this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpVector.copyFrom(this.attachedMesh.position),this.attachedMesh.rotationQuaternion.set(0,0,0,1),this.attachedMesh.position.set(0,0,0);var r=this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren,this.includeChildPredicate);r.max.subtractToRef(r.min,this._boundingDimensions),this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions),this._lineBoundingBox.position.set((r.max.x+r.min.x)/2,(r.max.y+r.min.y)/2,(r.max.z+r.min.z)/2),this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position),this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position),this._lineBoundingBox.computeWorldMatrix(),this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition),this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion),this.attachedMesh.position.copyFrom(this._tmpVector),this.attachedMesh.setParent(e),this.attachedMesh.skeleton&&(this.attachedMesh.skeleton.overrideMesh=t)}this._updateRotationSpheres(),this._updateScaleBoxes(),this.attachedMesh&&(this._existingMeshScale.copyFrom(this.attachedMesh.scaling),g.PivotTools._RestorePivotPoint(this.attachedMesh))},t.prototype._updateRotationSpheres=function(){for(var e=this._rotateSpheresParent.getChildMeshes(),t=0;t<3;t++)for(var r=0;r<2;r++)for(var n=0;n<2;n++){var i=4*t+2*r+n;if(0==t&&(e[i].position.set(this._boundingDimensions.x/2,this._boundingDimensions.y*r,this._boundingDimensions.z*n),e[i].position.addInPlace(new s.Vector3(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[i].lookAt(s.Vector3.Cross(e[i].position.normalizeToNew(),s.Vector3.Right()).normalizeToNew().add(e[i].position))),1==t&&(e[i].position.set(this._boundingDimensions.x*r,this._boundingDimensions.y/2,this._boundingDimensions.z*n),e[i].position.addInPlace(new s.Vector3(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[i].lookAt(s.Vector3.Cross(e[i].position.normalizeToNew(),s.Vector3.Up()).normalizeToNew().add(e[i].position))),2==t&&(e[i].position.set(this._boundingDimensions.x*r,this._boundingDimensions.y*n,this._boundingDimensions.z/2),e[i].position.addInPlace(new s.Vector3(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[i].lookAt(s.Vector3.Cross(e[i].position.normalizeToNew(),s.Vector3.Forward()).normalizeToNew().add(e[i].position))),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[i].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var o=this.rotationSphereSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[i].scaling.set(o,o,o)}else e[i].scaling.set(this.rotationSphereSize,this.rotationSphereSize,this.rotationSphereSize)}},t.prototype._updateScaleBoxes=function(){for(var e=this._scaleBoxesParent.getChildMeshes(),t=0;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.useObjectOrientationForDragging=!1,this._dragMesh.addBehavior(this.pointerDragBehavior)},t.prototype.dispose=function(){this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver),this._lineBoundingBox.dispose(),this._rotateSpheresParent.dispose(),this._scaleBoxesParent.dispose(),this._dragMesh&&this._dragMesh.dispose(),e.prototype.dispose.call(this)},t.MakeNotPickableAndWrapInBoundingBox=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach(function(e){t(e)})};t(e),e.rotationQuaternion||(e.rotationQuaternion=s.Quaternion.RotationYawPitchRoll(e.rotation.y,e.rotation.x,e.rotation.z));var r=e.position.clone(),n=e.rotationQuaternion.clone();e.rotationQuaternion.set(0,0,0,1),e.position.set(0,0,0);var i=u.BoxBuilder.CreateBox("box",{size:1},e.getScene()),o=e.getHierarchyBoundingVectors();return o.max.subtractToRef(o.min,i.scaling),0===i.scaling.y&&(i.scaling.y=v.Epsilon),0===i.scaling.x&&(i.scaling.x=v.Epsilon),0===i.scaling.z&&(i.scaling.z=v.Epsilon),i.position.set((o.max.x+o.min.x)/2,(o.max.y+o.min.y)/2,(o.max.z+o.min.z)/2),e.addChild(i),e.rotationQuaternion.copyFrom(n),e.position.copyFrom(r),e.removeChild(i),i.addChild(e),i.visibility=0,i},t.prototype.setCustomMesh=function(e){o.Logger.Error("Custom meshes are not supported on this gizmo")},t}(f.Gizmo)},"./Gizmos/gizmo.ts": /*!*************************!*\ !*** ./Gizmos/gizmo.ts ***! \*************************/ /*! exports provided: Gizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"Gizmo",function(){return s});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),o=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),s=function(){function e(e){var t=this;void 0===e&&(e=o.UtilityLayerRenderer.DefaultUtilityLayer),this.gizmoLayer=e,this._attachedMesh=null,this.scaleRatio=1,this._customMeshSet=!1,this.updateGizmoRotationToMatchAttachedMesh=!0,this.updateGizmoPositionToMatchAttachedMesh=!0,this.updateScale=!0,this._interactionsEnabled=!0,this._tempVector=new n.Vector3,this._rootMesh=new i.Mesh("gizmoRootNode",e.utilityLayerScene),this._rootMesh.rotationQuaternion=n.Quaternion.Identity(),this._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function(){t._update()})}return Object.defineProperty(e.prototype,"attachedMesh",{get:function(){return this._attachedMesh},set:function(e){this._attachedMesh=e,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.updateGizmoPositionToMatchAttachedMesh&&this._rootMesh.position.copyFrom(e.absolutePosition),this.updateGizmoRotationToMatchAttachedMesh?e.getWorldMatrix().decompose(void 0,this._rootMesh.rotationQuaternion):this._rootMesh.rotationQuaternion.set(0,0,0,1),this.updateScale){var t=this.gizmoLayer.utilityLayerScene.activeCamera,r=t.globalPosition;t.devicePosition&&(r=t.devicePosition),this._rootMesh.position.subtractToRef(r,this._tempVector);var n=this._tempVector.length()*this.scaleRatio;this._rootMesh.scaling.set(n,n,n),e._getWorldMatrixDeterminant()<0&&(this._rootMesh.scaling.y*=-1)}else this._rootMesh.scaling.setAll(this.scaleRatio)}},e.prototype.dispose=function(){this._rootMesh.dispose(),this._beforeRenderObserver&&this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)},e}()},"./Gizmos/gizmoManager.ts": /*!********************************!*\ !*** ./Gizmos/gizmoManager.ts ***! \********************************/ /*! exports provided: GizmoManager */function(e,t,r){"use strict";r.r(t),r.d(t,"GizmoManager",function(){return f});var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Events/pointerEvents */"./Events/pointerEvents.ts"),o=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),s=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),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 Object.defineProperty(e.prototype,"keepDepthUtilityLayer",{get:function(){return this._defaultKeepDepthUtilityLayer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"utilityLayer",{get:function(){return this._defaultUtilityLayer},enumerable:!0,configurable:!0}),e.prototype.attachToMesh=function(e){for(var t in this._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),this._attachedMesh=e,this.gizmos){var r=this.gizmos[t];r&&this._gizmosEnabled[t]&&(r.attachedMesh=e)}this.boundingBoxGizmoEnabled&&this._attachedMesh&&this._attachedMesh.addBehavior(this.boundingBoxDragBehavior),this.onAttachedToMeshObservable.notifyObservers(e)},Object.defineProperty(e.prototype,"positionGizmoEnabled",{get:function(){return this._gizmosEnabled.positionGizmo},set:function(e){e?(this.gizmos.positionGizmo||(this.gizmos.positionGizmo=new u.PositionGizmo(this._defaultUtilityLayer)),this.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._attachedMesh&&this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior),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, PlaneDragGizmo */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./axisDragGizmo */"./Gizmos/axisDragGizmo.ts");r.d(t,"AxisDragGizmo",function(){return n.AxisDragGizmo});var i=r(/*! ./axisScaleGizmo */"./Gizmos/axisScaleGizmo.ts");r.d(t,"AxisScaleGizmo",function(){return i.AxisScaleGizmo});var o=r(/*! ./boundingBoxGizmo */"./Gizmos/boundingBoxGizmo.ts");r.d(t,"BoundingBoxGizmo",function(){return o.BoundingBoxGizmo});var s=r(/*! ./gizmo */"./Gizmos/gizmo.ts");r.d(t,"Gizmo",function(){return s.Gizmo});var a=r(/*! ./gizmoManager */"./Gizmos/gizmoManager.ts");r.d(t,"GizmoManager",function(){return a.GizmoManager});var 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});var f=r(/*! ./planeDragGizmo */"./Gizmos/planeDragGizmo.ts");r.d(t,"PlaneDragGizmo",function(){return f.PlaneDragGizmo})},"./Gizmos/lightGizmo.ts": /*!******************************!*\ !*** ./Gizmos/lightGizmo.ts ***! \******************************/ /*! exports provided: LightGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"LightGizmo",function(){return g});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),l=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),u=r(/*! ../Lights/hemisphericLight */"./Lights/hemisphericLight.ts"),h=r(/*! ../Lights/directionalLight */"./Lights/directionalLight.ts"),d=r(/*! ../Meshes/Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts"),f=r(/*! ../Meshes/Builders/hemisphereBuilder */"./Meshes/Builders/hemisphereBuilder.ts"),p=r(/*! ../Lights/spotLight */"./Lights/spotLight.ts"),m=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),g=function(e){function t(t){var r=e.call(this,t)||this;return r._cachedPosition=new i.Vector3,r._cachedForward=new i.Vector3(0,0,1),r._light=null,r.attachedMesh=new s.AbstractMesh("",r.gizmoLayer.utilityLayerScene),r._attachedMeshParent=new m.TransformNode("parent",r.gizmoLayer.originalScene),r.attachedMesh.parent=r._attachedMeshParent,r._material=new l.StandardMaterial("light",r.gizmoLayer.originalScene),r._material.diffuseColor=new o.Color3(.5,.5,.5),r._material.specularColor=new o.Color3(.1,.1,.1),r}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"light",{get:function(){return this._light},set:function(e){var r=this;if(this._light=e,e){this._lightMesh&&this._lightMesh.dispose(),e instanceof u.HemisphericLight?this._lightMesh=t._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene):e instanceof h.DirectionalLight?this._lightMesh=t._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene):e instanceof p.SpotLight?this._lightMesh=t._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene):this._lightMesh=t._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene),this._lightMesh.getChildMeshes(!1).forEach(function(e){e.material=r._material}),this._lightMesh.parent=this._rootMesh;var n=this.gizmoLayer._getSharedGizmoLight();n.includedOnlyMeshes=n.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)),this._lightMesh.rotationQuaternion=new i.Quaternion,this.attachedMesh.reservedDataStore||(this.attachedMesh.reservedDataStore={}),this.attachedMesh.reservedDataStore.lightGizmo=this,e.parent&&this._attachedMeshParent.freezeWorldMatrix(e.parent.getWorldMatrix()),e.position&&(this.attachedMesh.position.copyFrom(e.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position)),e.direction&&(this.attachedMesh.setDirection(e.direction),this.attachedMesh.computeWorldMatrix(!0),this._cachedForward.copyFrom(this.attachedMesh.forward)),this._update()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},enumerable:!0,configurable:!0}),t.prototype._update=function(){e.prototype._update.call(this),this._light&&(this._light.parent&&this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()),this._light.position&&(this.attachedMesh.position.equals(this._cachedPosition)?(this.attachedMesh.position.copyFrom(this._light.position),this.attachedMesh.computeWorldMatrix(!0),this._cachedPosition.copyFrom(this.attachedMesh.position)):(this._light.position.copyFrom(this.attachedMesh.position),this._cachedPosition.copyFrom(this.attachedMesh.position))),this._light.direction&&(i.Vector3.DistanceSquared(this.attachedMesh.forward,this._cachedForward)>1e-4?(this._light.direction.copyFrom(this.attachedMesh.forward),this._cachedForward.copyFrom(this.attachedMesh.forward)):i.Vector3.DistanceSquared(this.attachedMesh.forward,this._light.direction)>1e-4&&(this.attachedMesh.setDirection(this._light.direction),this.attachedMesh.computeWorldMatrix(!0),this._cachedForward.copyFrom(this.attachedMesh.forward))),this._light.isEnabled()?this._material.diffuseColor.set(this._light.diffuse.r/3,this._light.diffuse.g/3,this._light.diffuse.b/3):this._material.diffuseColor.set(0,0,0))},t.prototype.dispose=function(){this._material.dispose(),e.prototype.dispose.call(this),this._attachedMeshParent.dispose()},t._CreateHemisphericLightMesh=function(e){var r=new a.Mesh("hemisphereLight",e),n=f.HemisphereBuilder.CreateHemisphere(r.name,{segments:10,diameter:1},e);n.position.z=-.15,n.rotation.x=Math.PI/2,n.parent=r;var i=this._CreateLightLines(3,e);return i.parent=r,i.position.z,r.scaling.scaleInPlace(t._Scale),r.rotation.x=Math.PI/2,r},t._CreatePointLightMesh=function(e){var r=new a.Mesh("pointLight",e),n=d.SphereBuilder.CreateSphere(r.name,{segments:10,diameter:1},e);return n.rotation.x=Math.PI/2,n.parent=r,this._CreateLightLines(5,e).parent=r,r.scaling.scaleInPlace(t._Scale),r.rotation.x=Math.PI/2,r},t._CreateSpotLightMesh=function(e){var r=new a.Mesh("spotLight",e);d.SphereBuilder.CreateSphere(r.name,{segments:10,diameter:1},e).parent=r;var n=f.HemisphereBuilder.CreateHemisphere(r.name,{segments:10,diameter:2},e);return n.parent=r,n.rotation.x=-Math.PI/2,this._CreateLightLines(2,e).parent=r,r.scaling.scaleInPlace(t._Scale),r.rotation.x=Math.PI/2,r},t._CreateDirectionalLightMesh=function(e){var r=new a.Mesh("directionalLight",e),n=new a.Mesh(r.name,e);n.parent=r,d.SphereBuilder.CreateSphere(r.name,{diameter:1.2,segments:10},e).parent=n;var i=a.Mesh.CreateCylinder(r.name,6,.3,.3,6,1,e);i.parent=n,(o=i.clone(r.name)).scaling.y=.5,o.position.x+=1.25,(s=i.clone(r.name)).scaling.y=.5,s.position.x+=-1.25;var o,s,c=a.Mesh.CreateCylinder(r.name,1,0,.6,6,1,e);return c.position.y+=3,c.parent=n,(o=c.clone(r.name)).position.y=1.5,o.position.x+=1.25,(s=c.clone(r.name)).position.y=1.5,s.position.x+=-1.25,n.scaling.scaleInPlace(t._Scale),n.rotation.z=Math.PI/2,n.rotation.y=Math.PI/2,r},t._Scale=.007,t._CreateLightLines=function(e,t){var r=new a.Mesh("root",t);r.rotation.x=Math.PI/2;var n=new a.Mesh("linePivot",t);n.parent=r;var i=a.Mesh.CreateCylinder("line",2,.2,.3,6,1,t);if(i.position.y=i.scaling.y/2+1.2,i.parent=n,e<2)return n;for(var o=0;o<4;o++){(s=n.clone("lineParentClone")).rotation.z=Math.PI/4,s.rotation.y=Math.PI/2+Math.PI/2*o,s.getChildMeshes()[0].scaling.y=.5,s.getChildMeshes()[0].scaling.x=s.getChildMeshes()[0].scaling.z=.8,s.getChildMeshes()[0].position.y=s.getChildMeshes()[0].scaling.y/2+1.2}if(e<3)return r;for(o=0;o<4;o++){(s=n.clone("linePivotClone")).rotation.z=Math.PI/2,s.rotation.y=Math.PI/2*o}if(e<4)return r;for(o=0;o<4;o++){var s;(s=n.clone("linePivotClone")).rotation.z=Math.PI+Math.PI/4,s.rotation.y=Math.PI/2+Math.PI/2*o,s.getChildMeshes()[0].scaling.y=.5,s.getChildMeshes()[0].scaling.x=s.getChildMeshes()[0].scaling.z=.8,s.getChildMeshes()[0].position.y=s.getChildMeshes()[0].scaling.y/2+1.2}return e<5?r:((s=n.clone("linePivotClone")).rotation.z=Math.PI,r)},t}(c.Gizmo)},"./Gizmos/planeDragGizmo.ts": /*!**********************************!*\ !*** ./Gizmos/planeDragGizmo.ts ***! \**********************************/ /*! exports provided: PlaneDragGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"PlaneDragGizmo",function(){return f});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../Meshes/transformNode */"./Meshes/transformNode.ts"),c=r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.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,a,c){void 0===n&&(n=s.Color3.Gray()),void 0===a&&(a=h.UtilityLayerRenderer.DefaultUtilityLayer),void 0===c&&(c=null);var u=e.call(this,a)||this;u._pointerObserver=null,u.snapDistance=0,u.onSnapObservable=new i.Observable,u._isEnabled=!1,u._parent=null,u._parent=c,u._coloredMaterial=new d.StandardMaterial("",a.utilityLayerScene),u._coloredMaterial.diffuseColor=n,u._coloredMaterial.specularColor=n.subtract(new s.Color3(.1,.1,.1)),u._hoverMaterial=new d.StandardMaterial("",a.utilityLayerScene),u._hoverMaterial.diffuseColor=n.add(new s.Color3(.3,.3,.3)),u._plane=t._CreatePlane(a.utilityLayerScene,u._coloredMaterial),u._plane.lookAt(u._rootMesh.position.add(r)),u._plane.scaling.scaleInPlace(1/3),u._plane.parent=u._rootMesh;var f=0,p=new o.Vector3,m={snapDistance:0};u.dragBehavior=new l.PointerDragBehavior({dragPlaneNormal:r}),u.dragBehavior.moveAttached=!1,u._rootMesh.addBehavior(u.dragBehavior);var g=new o.Vector3,_=new o.Matrix;u.dragBehavior.onDragObservable.add(function(e){if(u.attachedMesh)if(u.attachedMesh.parent?(u.attachedMesh.parent.computeWorldMatrix().invertToRef(_),_.setTranslationFromFloats(0,0,0),o.Vector3.TransformCoordinatesToRef(e.delta,_,g)):g.copyFrom(e.delta),0==u.snapDistance)u.attachedMesh.position.addInPlace(g);else if(f+=e.dragDistance,Math.abs(f)>u.snapDistance){var t=Math.floor(Math.abs(f)/u.snapDistance);f%=u.snapDistance,g.normalizeToRef(p),p.scaleInPlace(u.snapDistance*t),u.attachedMesh.position.addInPlace(p),m.snapDistance=u.snapDistance*t,u.onSnapObservable.notifyObservers(m)}}),u._pointerObserver=a.utilityLayerScene.onPointerObservable.add(function(e){if(!u._customMeshSet){var t=e.pickInfo&&-1!=u._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?u._hoverMaterial:u._coloredMaterial;u._rootMesh.getChildMeshes().forEach(function(e){e.material=t})}});var v=a._getSharedGizmoLight();return v.includedOnlyMeshes=v.includedOnlyMeshes.concat(u._rootMesh.getChildMeshes(!1)),u}return Object(n.__extends)(t,e),t._CreatePlane=function(e,t){var r=new a.TransformNode("plane",e),n=c.PlaneBuilder.CreatePlane("dragPlane",{width:.1375,height:.1375,sideOrientation:2},e);return n.material=t,n.parent=r,n.material=t,r},t._CreateArrowInstance=function(e,t){for(var r=new a.TransformNode("arrow",e),n=0,i=t.getChildMeshes();n0&&(M.scaleInPlace(-1),x.scaleInPlace(-1))}o.Vector3.Dot(x,a)>0&&(l=-l);var h=!1;if(0!=m.snapDistance)if(E+=l,Math.abs(E)>m.snapDistance){var d=Math.floor(Math.abs(E)/m.snapDistance);E<0&&(d*=-1),E%=m.snapDistance,l=m.snapDistance*d,h=!0}else l=0;C.reset(),m.attachedMesh.parent&&(m.attachedMesh.parent.computeWorldMatrix().invertToRef(C),C.getRotationMatrixToRef(C),o.Vector3.TransformCoordinatesToRef(M,C,M));var f=Math.sin(l/2);R.set(M.x*f,M.y*f,M.z*f,Math.cos(l/2)),C.determinant()>0&&(R.toEulerAnglesToRef(S),o.Quaternion.RotationYawPitchRollToRef(S.y,-S.x,-S.z,R)),m.updateGizmoRotationToMatchAttachedMesh?m.attachedMesh.rotationQuaternion.multiplyToRef(R,m.attachedMesh.rotationQuaternion):R.multiplyToRef(m.attachedMesh.rotationQuaternion,m.attachedMesh.rotationQuaternion),p&&(m.attachedMesh.rotationQuaternion.toEulerAnglesToRef(S),m.attachedMesh.rotationQuaternion=null,m.attachedMesh.rotation.copyFrom(S)),b.copyFrom(e.dragPlanePoint),h&&(P.snapDistance=l,m.onSnapObservable.notifyObservers(P)),r&&m.attachedMesh.setParent(r)}}),m._pointerObserver=n.utilityLayerScene.onPointerObservable.add(function(e){if(!m._customMeshSet){var t=e.pickInfo&&-1!=m._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?_:g;m._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.diffuseColor)})}});var O=n._getSharedGizmoLight();return O.includedOnlyMeshes=O.includedOnlyMeshes.concat(m._rootMesh.getChildMeshes(!1)),m}return Object(n.__extends)(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},set:function(e){this._isEnabled=e,e?this._parent&&(this.attachedMesh=this._parent.attachedMesh):this.attachedMesh=null},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this)},t}(u.Gizmo))},"./Gizmos/positionGizmo.ts": /*!*********************************!*\ !*** ./Gizmos/positionGizmo.ts ***! \*********************************/ /*! exports provided: PositionGizmo */function(e,t,r){"use strict";r.r(t),r.d(t,"PositionGizmo",function(){return d});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),l=r(/*! ./axisDragGizmo */"./Gizmos/axisDragGizmo.ts"),u=r(/*! ./planeDragGizmo */"./Gizmos/planeDragGizmo.ts"),h=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),d=function(e){function t(t){void 0===t&&(t=h.UtilityLayerRenderer.DefaultUtilityLayer);var r=e.call(this,t)||this;return r._meshAttached=null,r.onDragStartObservable=new o.Observable,r.onDragEndObservable=new o.Observable,r._planarGizmoEnabled=!1,r.xGizmo=new l.AxisDragGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),t,r),r.yGizmo=new l.AxisDragGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),t,r),r.zGizmo=new l.AxisDragGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),t,r),r.xPlaneGizmo=new u.PlaneDragGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),r.gizmoLayer,r),r.yPlaneGizmo=new u.PlaneDragGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),r.gizmoLayer,r),r.zPlaneGizmo=new u.PlaneDragGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),r.gizmoLayer,r),[r.xGizmo,r.yGizmo,r.zGizmo,r.xPlaneGizmo,r.yPlaneGizmo,r.zPlaneGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){r.onDragEndObservable.notifyObservers({})})}),r.attachedMesh=null,r}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"planarGizmoEnabled",{get:function(){return this._planarGizmoEnabled},set:function(e){var t=this;this._planarGizmoEnabled=e,[this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(r){r&&(r.isEnabled=e,e&&(r.attachedMesh=t.attachedMesh))},this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this._updateGizmoRotationToMatchAttachedMesh},set:function(e){this._updateGizmoRotationToMatchAttachedMesh=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t&&(t.updateGizmoRotationToMatchAttachedMesh=e)})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this._snapDistance},set:function(e){this._snapDistance=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t&&(t.snapDistance=e)})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this._scaleRatio},set:function(e){this._scaleRatio=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(t){t&&(t.scaleRatio=e)})},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){[this.xGizmo,this.yGizmo,this.zGizmo,this.xPlaneGizmo,this.yPlaneGizmo,this.zPlaneGizmo].forEach(function(e){e&&e.dispose()}),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){i.Logger.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)")},t}(c.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 h});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),l=r(/*! ./planeRotationGizmo */"./Gizmos/planeRotationGizmo.ts"),u=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),h=function(e){function t(t,r,n){void 0===t&&(t=u.UtilityLayerRenderer.DefaultUtilityLayer),void 0===r&&(r=32),void 0===n&&(n=!1);var i=e.call(this,t)||this;return i.onDragStartObservable=new o.Observable,i.onDragEndObservable=new o.Observable,i.xGizmo=new l.PlaneRotationGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),t,r,i,n),i.yGizmo=new l.PlaneRotationGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),t,r,i,n),i.zGizmo=new l.PlaneRotationGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),t,r,i,n),[i.xGizmo,i.yGizmo,i.zGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){i.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){i.onDragEndObservable.notifyObservers({})})}),i.attachedMesh=null,i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo].forEach(function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null})},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}(c.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 d});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ../Meshes/Builders/polyhedronBuilder */"./Meshes/Builders/polyhedronBuilder.ts"),l=r(/*! ./gizmo */"./Gizmos/gizmo.ts"),u=r(/*! ./axisScaleGizmo */"./Gizmos/axisScaleGizmo.ts"),h=r(/*! ../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),d=function(e){function t(t){void 0===t&&(t=h.UtilityLayerRenderer.DefaultUtilityLayer);var r=e.call(this,t)||this;r._meshAttached=null,r._sensitivity=1,r.onDragStartObservable=new o.Observable,r.onDragEndObservable=new o.Observable,r.xGizmo=new u.AxisScaleGizmo(new s.Vector3(1,0,0),a.Color3.Red().scale(.5),t,r),r.yGizmo=new u.AxisScaleGizmo(new s.Vector3(0,1,0),a.Color3.Green().scale(.5),t,r),r.zGizmo=new u.AxisScaleGizmo(new s.Vector3(0,0,1),a.Color3.Blue().scale(.5),t,r),r.uniformScaleGizmo=new u.AxisScaleGizmo(new s.Vector3(0,1,0),a.Color3.Yellow().scale(.5),t,r),r.uniformScaleGizmo.updateGizmoRotationToMatchAttachedMesh=!1,r.uniformScaleGizmo.uniformScaling=!0,r._uniformScalingMesh=c.PolyhedronBuilder.CreatePolyhedron("",{type:1},r.uniformScaleGizmo.gizmoLayer.utilityLayerScene),r._uniformScalingMesh.scaling.scaleInPlace(.02),r._uniformScalingMesh.visibility=0,r._octahedron=c.PolyhedronBuilder.CreatePolyhedron("",{type:1},r.uniformScaleGizmo.gizmoLayer.utilityLayerScene),r._octahedron.scaling.scaleInPlace(.007),r._uniformScalingMesh.addChild(r._octahedron),r.uniformScaleGizmo.setCustomMesh(r._uniformScalingMesh,!0);var n=t._getSharedGizmoLight();return n.includedOnlyMeshes=n.includedOnlyMeshes.concat(r._octahedron),[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 Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"attachedMesh",{get:function(){return this._meshAttached},set:function(e){this._meshAttached=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t.isEnabled?t.attachedMesh=e:t.attachedMesh=null})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this._updateGizmoRotationToMatchAttachedMesh},set:function(e){e?(this._updateGizmoRotationToMatchAttachedMesh=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.updateGizmoRotationToMatchAttachedMesh=e)})):i.Logger.Warn("Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this._snapDistance},set:function(e){this._snapDistance=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.snapDistance=e)})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this._scaleRatio},set:function(e){this._scaleRatio=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.scaleRatio=e)})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sensitivity",{get:function(){return this._sensitivity},set:function(e){this._sensitivity=e,[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(t){t&&(t.sensitivity=e)})},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){[this.xGizmo,this.yGizmo,this.zGizmo,this.uniformScaleGizmo].forEach(function(e){e&&e.dispose()}),this.onDragStartObservable.clear(),this.onDragEndObservable.clear(),[this._uniformScalingMesh,this._octahedron].forEach(function(e){e&&e.dispose()})},t}(l.Gizmo)},"./Helpers/environmentHelper.ts": /*!**************************************!*\ !*** ./Helpers/environmentHelper.ts ***! \**************************************/ /*! exports provided: EnvironmentHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"EnvironmentHelper",function(){return g});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Cameras/arcRotateCamera */"./Cameras/arcRotateCamera.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),l=r(/*! ../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),u=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),h=r(/*! ../Materials/Textures/mirrorTexture */"./Materials/Textures/mirrorTexture.ts"),d=r(/*! ../Materials/Textures/cubeTexture */"./Materials/Textures/cubeTexture.ts"),f=r(/*! ../Materials/Background/backgroundMaterial */"./Materials/Background/backgroundMaterial.ts"),p=r(/*! ../Engines/constants */"./Engines/constants.ts"),m=(r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),r(/*! ../Meshes/Builders/boxBuilder */"./Meshes/Builders/boxBuilder.ts"),r(/*! ../Maths/math.plane */"./Maths/math.plane.ts")),g=function(){function e(t,r){var o=this;this._errorHandler=function(e,t){o.onErrorObservable.notifyObservers({message:e,exception:t})},this._options=Object(n.__assign)(Object(n.__assign)({},e._getDefaultOptions()),t),this._scene=r,this.onErrorObservable=new i.Observable,this._setupBackground(),this._setupImageProcessing()}return e._getDefaultOptions=function(){return{createGround:!0,groundSize:15,groundTexture:this._groundTextureCDNUrl,groundColor:new a.Color3(.2,.2,.3).toLinearSpace().scale(3),groundOpacity:.9,enableGroundShadow:!0,groundShadowLevel:.5,enableGroundMirror:!1,groundMirrorSizeRatio:.3,groundMirrorBlurKernel:64,groundMirrorAmount:1,groundMirrorFresnelWeight:1,groundMirrorFallOffDistance:0,groundMirrorTextureType:p.Constants.TEXTURETYPE_UNSIGNED_INT,groundYBias:1e-5,createSkybox:!0,skyboxSize:20,skyboxTexture:this._skyboxTextureCDNUrl,skyboxColor:new a.Color3(.2,.2,.3).toLinearSpace().scale(3),backgroundYRotation:0,sizeAuto:!0,rootPosition:s.Vector3.Zero(),setupImageProcessing:!0,environmentTexture:this._environmentTextureCDNUrl,cameraExposure:.8,cameraContrast:1.2,toneMappingEnabled:!0}},Object.defineProperty(e.prototype,"rootMesh",{get:function(){return this._rootMesh},enumerable:!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=Object(n.__assign)(Object(n.__assign)({},this._options),e);this._ground&&!t.createGround&&(this._ground.dispose(),this._ground=null),this._groundMaterial&&!t.createGround&&(this._groundMaterial.dispose(),this._groundMaterial=null),this._groundTexture&&this._options.groundTexture!=t.groundTexture&&(this._groundTexture.dispose(),this._groundTexture=null),this._skybox&&!t.createSkybox&&(this._skybox.dispose(),this._skybox=null),this._skyboxMaterial&&!t.createSkybox&&(this._skyboxMaterial.dispose(),this._skyboxMaterial=null),this._skyboxTexture&&this._options.skyboxTexture!=t.skyboxTexture&&(this._skyboxTexture.dispose(),this._skyboxTexture=null),this._groundMirror&&!t.enableGroundMirror&&(this._groundMirror.dispose(),this._groundMirror=null),this._scene.environmentTexture&&this._options.environmentTexture!=t.environmentTexture&&this._scene.environmentTexture.dispose(),this._options=t,this._setupBackground(),this._setupImageProcessing()},e.prototype.setMainColor=function(e){this.groundMaterial&&(this.groundMaterial.primaryColor=e),this.skyboxMaterial&&(this.skyboxMaterial.primaryColor=e),this.groundMirror&&(this.groundMirror.clearColor=new a.Color4(e.r,e.g,e.b,1))},e.prototype._setupImageProcessing=function(){this._options.setupImageProcessing&&(this._scene.imageProcessingConfiguration.contrast=this._options.cameraContrast,this._scene.imageProcessingConfiguration.exposure=this._options.cameraExposure,this._scene.imageProcessingConfiguration.toneMappingEnabled=this._options.toneMappingEnabled,this._setupEnvironmentTexture())},e.prototype._setupEnvironmentTexture=function(){if(!this._scene.environmentTexture)if(this._options.environmentTexture instanceof l.BaseTexture)this._scene.environmentTexture=this._options.environmentTexture;else{var e=d.CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture,this._scene);this._scene.environmentTexture=e}},e.prototype._setupBackground=function(){this._rootMesh||(this._rootMesh=new c.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=c.Mesh.CreatePlane("BackgroundPlane",e.groundSize,this._scene),this._ground.rotation.x=Math.PI/2,this._ground.parent=this._rootMesh,this._ground.onDisposeObservable.add(function(){t._ground=null})),this._ground.receiveShadows=this._options.enableGroundShadow},e.prototype._setupGroundMaterial=function(){this._groundMaterial||(this._groundMaterial=new f.BackgroundMaterial("BackgroundPlaneMaterial",this._scene)),this._groundMaterial.alpha=this._options.groundOpacity,this._groundMaterial.alphaMode=p.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,this._groundMaterial.shadowLevel=this._options.groundShadowLevel,this._groundMaterial.primaryColor=this._options.groundColor,this._groundMaterial.useRGBColor=!1,this._groundMaterial.enableNoise=!0,this._ground&&(this._ground.material=this._groundMaterial)},e.prototype._setupGroundDiffuseTexture=function(){if(this._groundMaterial&&!this._groundTexture)if(this._options.groundTexture instanceof l.BaseTexture)this._groundMaterial.diffuseTexture=this._options.groundTexture;else{var e=new u.Texture(this._options.groundTexture,this._scene,void 0,void 0,void 0,void 0,this._errorHandler);e.gammaSpace=!1,e.hasAlpha=!0,this._groundMaterial.diffuseTexture=e}},e.prototype._setupGroundMirrorTexture=function(e){var t=u.Texture.CLAMP_ADDRESSMODE;if(!this._groundMirror&&(this._groundMirror=new h.MirrorTexture("BackgroundPlaneMirrorTexture",{ratio:this._options.groundMirrorSizeRatio},this._scene,!1,this._options.groundMirrorTextureType,u.Texture.BILINEAR_SAMPLINGMODE,!0),this._groundMirror.mirrorPlane=new m.Plane(0,-1,0,e.rootPosition.y),this._groundMirror.anisotropicFilteringLevel=1,this._groundMirror.wrapU=t,this._groundMirror.wrapV=t,this._groundMirror.gammaSpace=!1,this._groundMirror.renderList))for(var r=0;re.LongPressDelay&&!i._isPointerSwiping()&&(i._startingPointerTime=0,c.processTrigger(s.Constants.ACTION_OnLongPressTrigger,a.ActionEvent.CreateNew(t.pickedMesh,r)))},e.LongPressDelay)}}else for(var l=0,u=o._pointerDownStage;le.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>e.DragMovementThreshold},e.prototype.simulatePointerUp=function(e,t,r){var i=new PointerEvent("pointerup",t),o=new u;r?o.doubleClick=!0:o.singleClick=!0,this._checkPrePointerObservable(e,i,n.PointerEventTypes.POINTERUP)||this._processPointerUp(e,i,o)},e.prototype._processPointerUp=function(e,t,r){var i=this._scene;if(e&&e&&e.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(i.onPointerPick&&i.onPointerPick(t,e),r.singleClick&&!r.ignore&&i.onPointerObservable.hasObservers())){var o=n.PointerEventTypes.POINTERPICK,c=new n.PointerInfo(o,t,e);this._setRayOnPointerInfo(c),i.onPointerObservable.notifyObservers(c,o)}var l=e.pickedMesh._getActionManagerForTrigger();if(l&&!r.ignore){l.processTrigger(s.Constants.ACTION_OnPickUpTrigger,a.ActionEvent.CreateNew(e.pickedMesh,t)),!r.hasSwiped&&r.singleClick&&l.processTrigger(s.Constants.ACTION_OnPickTrigger,a.ActionEvent.CreateNew(e.pickedMesh,t));var u=e.pickedMesh._getActionManagerForTrigger(s.Constants.ACTION_OnDoublePickTrigger);r.doubleClick&&u&&u.processTrigger(s.Constants.ACTION_OnDoublePickTrigger,a.ActionEvent.CreateNew(e.pickedMesh,t))}}else if(!r.ignore)for(var h=0,d=i._pointerUpStage;he.DoubleClickDelay&&!d._doubleClickOccured||t!==d._previousButtonPressed)&&(d._doubleClickOccured=!1,r.singleClick=!0,r.ignore=!1,n(r,d._currentPickResult))},this._initClickEvent=function(t,r,o,a){var c=new u;d._currentPickResult=null;var l=null,h=t.hasSpecificMask(n.PointerEventTypes.POINTERPICK)||r.hasSpecificMask(n.PointerEventTypes.POINTERPICK)||t.hasSpecificMask(n.PointerEventTypes.POINTERTAP)||r.hasSpecificMask(n.PointerEventTypes.POINTERTAP)||t.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)||r.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP);!h&&i.AbstractActionManager&&(l=d._initActionManager(l,c))&&(h=l.hasPickTriggers);var f=!1;if(h){var p=o.button;if(c.hasSwiped=d._isPointerSwiping(),!c.hasSwiped){var m=!e.ExclusiveDoubleClickMode;m||(m=!t.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)&&!r.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP))&&!i.AbstractActionManager.HasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)&&(l=d._initActionManager(l,c))&&(m=!l.hasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)),m?(Date.now()-d._previousStartingPointerTime>e.DoubleClickDelay||p!==d._previousButtonPressed)&&(c.singleClick=!0,a(c,d._currentPickResult),f=!0):(d._previousDelayedSimpleClickTimeout=d._delayedSimpleClickTimeout,d._delayedSimpleClickTimeout=window.setTimeout(d._delayedSimpleClick.bind(d,p,c,a),e.DoubleClickDelay));var g=t.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP)||r.hasSpecificMask(n.PointerEventTypes.POINTERDOUBLETAP);!g&&i.AbstractActionManager.HasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)&&(l=d._initActionManager(l,c))&&(g=l.hasSpecificTrigger(s.Constants.ACTION_OnDoublePickTrigger)),g&&(p===d._previousButtonPressed&&Date.now()-d._previousStartingPointerTime-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 o});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Misc/perfCounter */"./Misc/perfCounter.ts"),o=function(){function e(e){var t=this;this.scene=e,this._captureActiveMeshesEvaluationTime=!1,this._activeMeshesEvaluationTime=new i.PerfCounter,this._captureRenderTargetsRenderTime=!1,this._renderTargetsRenderTime=new i.PerfCounter,this._captureFrameTime=!1,this._frameTime=new i.PerfCounter,this._captureRenderTime=!1,this._renderTime=new i.PerfCounter,this._captureInterFrameTime=!1,this._interFrameTime=new i.PerfCounter,this._captureParticlesRenderTime=!1,this._particlesRenderTime=new i.PerfCounter,this._captureSpritesRenderTime=!1,this._spritesRenderTime=new i.PerfCounter,this._capturePhysicsTime=!1,this._physicsTime=new i.PerfCounter,this._captureAnimationsTime=!1,this._animationsTime=new i.PerfCounter,this._captureCameraRenderTime=!1,this._cameraRenderTime=new i.PerfCounter,this._onBeforeActiveMeshesEvaluationObserver=null,this._onAfterActiveMeshesEvaluationObserver=null,this._onBeforeRenderTargetsRenderObserver=null,this._onAfterRenderTargetsRenderObserver=null,this._onAfterRenderObserver=null,this._onBeforeDrawPhaseObserver=null,this._onAfterDrawPhaseObserver=null,this._onBeforeAnimationsObserver=null,this._onBeforeParticlesRenderingObserver=null,this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver=null,this._onAfterSpritesRenderingObserver=null,this._onBeforePhysicsObserver=null,this._onAfterPhysicsObserver=null,this._onAfterAnimationsObserver=null,this._onBeforeCameraRenderObserver=null,this._onAfterCameraRenderObserver=null,this._onBeforeAnimationsObserver=e.onBeforeAnimationsObservable.add(function(){t._captureActiveMeshesEvaluationTime&&t._activeMeshesEvaluationTime.fetchNewFrame(),t._captureRenderTargetsRenderTime&&t._renderTargetsRenderTime.fetchNewFrame(),t._captureFrameTime&&(n.Tools.StartPerformanceCounter("Scene rendering"),t._frameTime.beginMonitoring()),t._captureInterFrameTime&&t._interFrameTime.endMonitoring(),t._captureParticlesRenderTime&&t._particlesRenderTime.fetchNewFrame(),t._captureSpritesRenderTime&&t._spritesRenderTime.fetchNewFrame(),t._captureAnimationsTime&&t._animationsTime.beginMonitoring(),t.scene.getEngine()._drawCalls.fetchNewFrame()}),this._onAfterRenderObserver=e.onAfterRenderObservable.add(function(){t._captureFrameTime&&(n.Tools.EndPerformanceCounter("Scene rendering"),t._frameTime.endMonitoring()),t._captureRenderTime&&t._renderTime.endMonitoring(!1),t._captureInterFrameTime&&t._interFrameTime.beginMonitoring()})}return Object.defineProperty(e.prototype,"activeMeshesEvaluationTimeCounter",{get:function(){return this._activeMeshesEvaluationTime},enumerable:!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}),e.prototype.dispose=function(){this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=null,this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null,this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null,this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null,this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver&&(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null),this._onAfterSpritesRenderingObserver&&(this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null),this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null,this._onBeforePhysicsObserver&&(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null),this._onAfterPhysicsObserver&&(this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null),this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null,this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null,this.scene=null},e}()},"./Instrumentation/timeToken.ts": /*!**************************************!*\ !*** ./Instrumentation/timeToken.ts ***! \**************************************/ /*! exports provided: _TimeToken */function(e,t,r){"use strict";r.r(t),r.d(t,"_TimeToken",function(){return n});var n=function(){this._timeElapsedQueryEnded=!1}},"./Layers/effectLayer.ts": /*!*******************************!*\ !*** ./Layers/effectLayer.ts ***! \*******************************/ /*! exports provided: EffectLayer */function(e,t,r){"use strict";r.r(t),r.d(t,"EffectLayer",function(){return v});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=r(/*! ../Engines/engine */"./Engines/engine.ts"),l=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),h=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),d=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),f=r(/*! ../Materials/material */"./Materials/material.ts"),p=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),m=r(/*! ../Engines/constants */"./Engines/constants.ts"),g=(r(/*! ../Shaders/glowMapGeneration.fragment */"./Shaders/glowMapGeneration.fragment.ts"),r(/*! ../Shaders/glowMapGeneration.vertex */"./Shaders/glowMapGeneration.vertex.ts"),r(/*! ../Misc/devTools */"./Misc/devTools.ts")),_=r(/*! ../Materials/effectFallbacks */"./Materials/effectFallbacks.ts"),v=function(){function e(t,r){this._vertexBuffers={},this._maxSize=0,this._mainTextureDesiredSize={width:0,height:0},this._shouldRender=!0,this._postProcesses=[],this._textures=[],this._emissiveTextureAndColor={texture:null,color:new a.Color4},this.neutralColor=new a.Color4,this.isEnabled=!0,this.onDisposeObservable=new s.Observable,this.onBeforeRenderMainTextureObservable=new s.Observable,this.onBeforeComposeObservable=new s.Observable,this.onBeforeRenderMeshToEffect=new s.Observable,this.onAfterRenderMeshToEffect=new s.Observable,this.onAfterComposeObservable=new s.Observable,this.onSizeChangedObservable=new s.Observable,this.name=t,this._scene=r||l.EngineStore.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._engine=this._scene.getEngine(),this._maxSize=this._engine.getCaps().maxTextureSize,this._scene.effectLayers.push(this),this._generateIndexBuffer(),this._generateVertexBuffer()}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._effectLayerOptions.camera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderingGroupId",{get:function(){return this._effectLayerOptions.renderingGroupId},set:function(e){this._effectLayerOptions.renderingGroupId=e},enumerable:!0,configurable:!0}),e.prototype._init=function(e){this._effectLayerOptions=Object(n.__assign)({mainTextureRatio:.5,alphaBlendingMode:m.Constants.ALPHA_COMBINE,camera:null,renderingGroupId:-1},e),this._setMainTextureSize(),this._createMainTexture(),this._createTextureAndPostProcesses(),this._mergeEffect=this._createMergeEffect()},e.prototype._generateIndexBuffer=function(){var e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._engine.createIndexBuffer(e)},e.prototype._generateVertexBuffer=function(){var e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1);var t=new u.VertexBuffer(this._engine,e,u.VertexBuffer.PositionKind,!1,!1,2);this._vertexBuffers[u.VertexBuffer.PositionKind]=t},e.prototype._setMainTextureSize=function(){this._effectLayerOptions.mainTextureFixedSize?(this._mainTextureDesiredSize.width=this._effectLayerOptions.mainTextureFixedSize,this._mainTextureDesiredSize.height=this._effectLayerOptions.mainTextureFixedSize):(this._mainTextureDesiredSize.width=this._engine.getRenderWidth()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.height=this._engine.getRenderHeight()*this._effectLayerOptions.mainTextureRatio,this._mainTextureDesiredSize.width=this._engine.needPOTTextures?c.Engine.GetExponentOfTwo(this._mainTextureDesiredSize.width,this._maxSize):this._mainTextureDesiredSize.width,this._mainTextureDesiredSize.height=this._engine.needPOTTextures?c.Engine.GetExponentOfTwo(this._mainTextureDesiredSize.height,this._maxSize):this._mainTextureDesiredSize.height),this._mainTextureDesiredSize.width=Math.floor(this._mainTextureDesiredSize.width),this._mainTextureDesiredSize.height=Math.floor(this._mainTextureDesiredSize.height)},e.prototype._createMainTexture=function(){var e=this;this._mainTexture=new d.RenderTargetTexture("HighlightLayerMainRTT",{width:this._mainTextureDesiredSize.width,height:this._mainTextureDesiredSize.height},this._scene,!1,!0,m.Constants.TEXTURETYPE_UNSIGNED_INT),this._mainTexture.activeCamera=this._effectLayerOptions.camera,this._mainTexture.wrapU=h.Texture.CLAMP_ADDRESSMODE,this._mainTexture.wrapV=h.Texture.CLAMP_ADDRESSMODE,this._mainTexture.anisotropicFilteringLevel=1,this._mainTexture.updateSamplingMode(h.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;o4&&(o.push(u.VertexBuffer.MatricesIndicesExtraKind),o.push(u.VertexBuffer.MatricesWeightsExtraKind)),i.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers);var g=s.skeleton;g&&g.isUsingTextureForMatrices?i.push("#define BONETEXTURE"):i.push("#define BonesPerMesh "+(g?g.bones.length+1:0)),s.numBoneInfluencers>0&&m.addCPUSkinningFallback(0,s)}else i.push("#define NUM_BONE_INFLUENCERS 0");var v=s.morphTargetManager,A=0;v&&v.numInfluencers>0&&(i.push("#define MORPHTARGETS"),A=v.numInfluencers,i.push("#define NUM_MORPH_INFLUENCERS "+A),p.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(o,s,A)),t&&(i.push("#define INSTANCES"),p.MaterialHelper.PushAttributesForInstances(o)),this._addCustomEffectDefines(i);var y=i.join("\n");return this._cachedDefines!==y&&(this._cachedDefines=y,this._effectLayerMapGenerationEffect=this._scene.getEngine().createEffect("glowMapGeneration",o,["world","mBones","viewProjection","glowColor","morphTargetInfluences","boneTextureWidth","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity"],["diffuseSampler","emissiveSampler","opacitySampler","boneSampler"],y,m,void 0,void 0,{maxSimultaneousMorphTargets:A})),this._effectLayerMapGenerationEffect.isReady()},e.prototype.render=function(){var e=this._mergeEffect;if(e.isReady()){for(var t=0;t-1&&this._scene.effectLayers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onBeforeRenderMainTextureObservable.clear(),this.onBeforeComposeObservable.clear(),this.onBeforeRenderMeshToEffect.clear(),this.onAfterRenderMeshToEffect.clear(),this.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()},e.prototype.getClassName=function(){return"EffectLayer"},e.Parse=function(e,t,r){return o.Tools.Instantiate(e.customType).Parse(e,t,r)},e._SceneComponentInitialization=function(e){throw g._DevTools.WarnImport("EffectLayerSceneComponent")},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"name",void 0),Object(n.__decorate)([Object(i.serializeAsColor4)()],e.prototype,"neutralColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serializeAsCameraReference)()],e.prototype,"camera",null),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"renderingGroupId",null),e}()},"./Layers/effectLayerSceneComponent.ts": /*!*********************************************!*\ !*** ./Layers/effectLayerSceneComponent.ts ***! \*********************************************/ /*! exports provided: EffectLayerSceneComponent */function(e,t,r){"use strict";r.r(t),r.d(t,"EffectLayerSceneComponent",function(){return a});var n=r(/*! ../Cameras/camera */"./Cameras/camera.ts"),i=r(/*! ../sceneComponent */"./sceneComponent.ts"),o=r(/*! ./effectLayer */"./Layers/effectLayer.ts"),s=r(/*! ../abstractScene */"./abstractScene.ts");s.AbstractScene.AddParser(i.SceneComponentConstants.NAME_EFFECTLAYER,function(e,t,r,n){if(e.effectLayers){r.effectLayers||(r.effectLayers=new Array);for(var i=0;i0){this._previousStencilState=this._engine.getStencilBuffer();for(var i=0,o=r;i-1)){this._renderEffects=!0,this._needStencil=this._needStencil||s.needStencil();var a=s._mainTexture;a._shouldRender()&&(this.scene.incrementRenderId(),a.render(!1,!1),t=!0)}}this.scene.incrementRenderId()}return t},e.prototype._setStencil=function(){this._needStencil&&this._engine.setStencilBuffer(!0)},e.prototype._setStencilBack=function(){this._needStencil&&this._engine.setStencilBuffer(this._previousStencilState)},e.prototype._draw=function(e){if(this._renderEffects){this._engine.setDepthBuffer(!1);for(var t=this.scene.effectLayers,r=0;r-1},t.prototype.referenceMeshToUseItsOwnMaterial=function(e){this._meshesUsingTheirOwnMaterials.push(e.uniqueId)},t.prototype.unReferenceMeshFromUsingItsOwnMaterial=function(e){for(var t=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);t>0;)this._meshesUsingTheirOwnMaterials.slice(t,t+1),t=this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId)},t.prototype._disposeMesh=function(e){this.removeIncludedOnlyMesh(e),this.removeExcludedMesh(e)},t.prototype.getClassName=function(){return"GlowLayer"},t.prototype.serialize=function(){var e,t=i.SerializationHelper.Serialize(this);if(t.customType="BABYLON.GlowLayer",t.includedMeshes=[],this._includedOnlyMeshes.length)for(e=0;e0&&e.isBackground===t&&e.renderTargetTextures.indexOf(n)>-1&&0!=(e.layerMask&r)},e.prototype._drawRenderTargetBackground=function(e){var t=this;this._draw(function(r){return t._drawRenderTargetPredicate(r,!0,t.scene.activeCamera.layerMask,e)})},e.prototype._drawRenderTargetForeground=function(e){var t=this;this._draw(function(r){return t._drawRenderTargetPredicate(r,!1,t.scene.activeCamera.layerMask,e)})},e.prototype.addFromContainer=function(e){var t=this;e.layers&&e.layers.forEach(function(e){t.scene.layers.push(e)})},e.prototype.removeFromContainer=function(e,t){var r=this;void 0===t&&(t=!1),e.layers&&e.layers.forEach(function(e){var n=r.scene.layers.indexOf(e);-1!==n&&r.scene.layers.splice(n,1),t&&e.dispose()})},e}()},"./Legacy/legacy.ts": /*!**************************!*\ !*** ./Legacy/legacy.ts ***! \**************************/ /*! exports provided: Debug, AbstractScene, KeepAssets, InstantiatedEntries, AssetContainer, Node, Scene, SceneComponentConstants, Stage, AbstractActionManager, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction, Animatable, _IAnimationState, 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, FollowCameraInputsManager, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, _MeshCollisionData, BoundingBox, BoundingInfo, BoundingSphere, Ray, AxesViewer, BoneAxesViewer, DebugLayerTab, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer, Constants, ThinEngine, Engine, EngineStore, NullEngineOptions, NullEngine, WebGLPipelineContext, WebGL2ShaderProcessor, NativeEngine, KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, XRWindowsMotionController, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, DualShockButton, DualShockDpad, DualShockPad, AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, PlaneDragGizmo, EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome, EngineInstrumentation, SceneInstrumentation, _TimeToken, EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent, LensFlare, LensFlareSystem, LensFlareSystemSceneComponent, Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoaderAnimationGroupLoadingMode, SceneLoader, SceneLoaderFlags, ColorCurves, EffectFallbacks, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PBRMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, DynamicTexture, EquiRectangularCubeTexture, HDRCubeTexture, InternalTextureSource, InternalTexture, MirrorTexture, MultiRenderTarget, RawTexture, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, EffectRenderer, EffectWrapper, Scalar, Space, Axis, Color3, Color4, TmpColors, ToGammaSpace, ToLinearSpace, Epsilon, Frustum, Plane, Size, Vector2, Vector3, Vector4, Quaternion, Matrix, TmpVectors, Viewport, SphericalHarmonics, SphericalPolynomial, AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, TrailMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, MeshLODLevel, TransformNode, BoxBuilder, SphereBuilder, CylinderBuilder, TorusBuilder, LinesBuilder, PlaneBuilder, GroundBuilder, DataBuffer, WebGLDataBuffer, MorphTarget, MorphTargetManager, Database, BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, CloudPoint, PointsGroup, PointColor, PointsCloudSystem, 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, StereoscopicInterlacePostProcessI, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, VRMultiviewToSingleviewPostProcess, ScreenSpaceReflectionPostProcess, ReflectionProbe, BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer, Sprite, SpriteManager, SpriteMap, SpritePackedManager, SpriteSceneComponent, AlphaState, DepthCullingState, StencilState, AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, EquiRectangularCubeTextureAssetTask, AssetsManager, BasisTranscodeConfiguration, BasisTools, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsMatrix, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, MeshExploder, FilesInput, KhronosTextureContainer, EventState, Observer, MultiObserver, Observable, PerformanceMonitor, RollingAverage, PromisePolyfill, SceneOptimization, TextureOptimization, HardwareScalingOptimization, ShadowsOptimization, PostProcessesOptimization, LensFlaresOptimization, CustomOptimization, ParticlesOptimization, RenderTargetsOptimization, MergeMeshesOptimization, SceneOptimizerOptions, SceneOptimizer, SceneSerializer, SmartArray, SmartArrayNoDuplicate, StringDictionary, Tags, TextureTools, TGATools, Tools, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, WebRequest, InspectableType, BRDFTextureTools, RGBDTextureTools, ColorGradient, Color3Gradient, FactorGradient, GradientHelper, PerfCounter, RetryStrategy, CanvasGenerator, LoadFileError, RequestFileError, ReadFileError, FileTools, StringTools, DataReader, MinMaxReducer, DepthReducer, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRExperienceHelper, WebXRInput, WebXRInputSource, WebXRManagedOutputCanvasOptions, WebXRManagedOutputCanvas, WebXRState, WebXRSessionManager, WebXRDefaultExperienceOptions, WebXRDefaultExperience, WebXRFeatureName, WebXRFeaturesManager, 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, Octree, OctreeBlock, OctreeSceneComponent, _OcclusionDataStorage, _forceTransformFeedbackToBundle, EngineView, ShadowGenerator, CascadedShadowGenerator, ShadowGeneratorSceneComponent, _BabylonLoaderRegistered, BabylonFileLoaderConfiguration, BackgroundMaterial, PBRMaterialDefines, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, RawCubeTexture, RawTexture3D, RawTexture2DArray, RefractionTexture, VideoTexture, HtmlElementTexture, NodeMaterialConnectionPointCompatibilityStates, NodeMaterialConnectionPointDirection, NodeMaterialConnectionPoint, NodeMaterialBlock, NodeMaterialDefines, NodeMaterial, Orientation, BezierCurve, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, DracoCompression, TiledBoxBuilder, DiscBuilder, RibbonBuilder, HemisphereBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, TiledPlaneBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, RecastJSPlugin, RecastJSCrowd, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CustomParticleEmitter, MeshParticleEmitter, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, CubeMapToSphericalPolynomialTools, HDRTools, PanoramaToCubeMapTools, WebXRHitTestLegacy, WebXRAnchorSystem, WebXRPlaneDetector, WebXRBackgroundRemover, WebXRMotionControllerTeleportation, WebXRControllerPointerSelection, IWebXRControllerPhysicsOptions, WebXRControllerPhysics, WebXRAbstractMotionController, WebXRControllerComponent, WebXRGenericTriggerMotionController, WebXRMicrosoftMixedRealityController, WebXRMotionControllerManager, WebXROculusTouchMotionController, WebXRHTCViveMotionController, WebXRProfiledMotionController, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, _BasisTextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTexture, ProceduralTextureSceneComponent, TexturePacker, TexturePackerFrame, NodeMaterialBlockTargets, NodeMaterialBlockConnectionPointTypes, NodeMaterialBlockConnectionPointMode, NodeMaterialSystemValues, MultiplyBlock, AddBlock, ScaleBlock, ClampBlock, CrossBlock, DotBlock, TransformBlock, RemapBlock, NormalizeBlock, TrigonometryBlockOperations, TrigonometryBlock, ColorMergerBlock, VectorMergerBlock, ColorSplitterBlock, VectorSplitterBlock, LerpBlock, DivideBlock, SubtractBlock, StepBlock, OneMinusBlock, ViewDirectionBlock, FresnelBlock, MaxBlock, MinBlock, DistanceBlock, LengthBlock, NegateBlock, PowBlock, RandomNumberBlock, ArcTan2Block, SmoothStepBlock, ReciprocalBlock, ReplaceColorBlock, PosterizeBlock, WaveBlockKind, WaveBlock, GradientBlockColorStep, GradientBlock, NLerpBlock, WorleyNoise3DBlock, SimplexPerlin3DBlock, NormalBlendBlock, Rotate2dBlock, ReflectBlock, RefractBlock, DesaturateBlock, NodeMaterialOptimizer, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline, VertexOutputBlock, BonesBlock, InstancesBlock, MorphTargetsBlock, LightInformationBlock, FragmentOutputBlock, ImageProcessingBlock, PerturbNormalBlock, DiscardBlock, FrontFacingBlock, DerivativeBlock, FogBlock, LightBlock, TextureBlock, ReflectionTextureBlock, InputBlock, AnimatedInputBlockTypes */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,"InstantiatedEntries",function(){return n.InstantiatedEntries}),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,"AbstractActionManager",function(){return n.AbstractActionManager}),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,"_IAnimationState",function(){return n._IAnimationState}),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,"FollowCameraInputsManager",function(){return n.FollowCameraInputsManager}),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,"_MeshCollisionData",function(){return n._MeshCollisionData}),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,"DebugLayerTab",function(){return n.DebugLayerTab}),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,"ThinEngine",function(){return n.ThinEngine}),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,"WebGLPipelineContext",function(){return n.WebGLPipelineContext}),r.d(t,"WebGL2ShaderProcessor",function(){return n.WebGL2ShaderProcessor}),r.d(t,"NativeEngine",function(){return n.NativeEngine}),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,"DaydreamController",function(){return n.DaydreamController}),r.d(t,"GearVRController",function(){return n.GearVRController}),r.d(t,"GenericController",function(){return n.GenericController}),r.d(t,"OculusTouchController",function(){return n.OculusTouchController}),r.d(t,"PoseEnabledControllerType",function(){return n.PoseEnabledControllerType}),r.d(t,"PoseEnabledControllerHelper",function(){return n.PoseEnabledControllerHelper}),r.d(t,"PoseEnabledController",function(){return n.PoseEnabledController}),r.d(t,"ViveController",function(){return n.ViveController}),r.d(t,"WebVRController",function(){return n.WebVRController}),r.d(t,"WindowsMotionController",function(){return n.WindowsMotionController}),r.d(t,"XRWindowsMotionController",function(){return n.XRWindowsMotionController}),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,"DualShockButton",function(){return n.DualShockButton}),r.d(t,"DualShockDpad",function(){return n.DualShockDpad}),r.d(t,"DualShockPad",function(){return n.DualShockPad}),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,"PlaneDragGizmo",function(){return n.PlaneDragGizmo}),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,"SceneLoaderAnimationGroupLoadingMode",function(){return n.SceneLoaderAnimationGroupLoadingMode}),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,"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,"PBRMaterial",function(){return n.PBRMaterial}),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,"DynamicTexture",function(){return n.DynamicTexture}),r.d(t,"EquiRectangularCubeTexture",function(){return n.EquiRectangularCubeTexture}),r.d(t,"HDRCubeTexture",function(){return n.HDRCubeTexture}),r.d(t,"InternalTextureSource",function(){return n.InternalTextureSource}),r.d(t,"InternalTexture",function(){return n.InternalTexture}),r.d(t,"MirrorTexture",function(){return n.MirrorTexture}),r.d(t,"MultiRenderTarget",function(){return n.MultiRenderTarget}),r.d(t,"RawTexture",function(){return n.RawTexture}),r.d(t,"RenderTargetTexture",function(){return n.RenderTargetTexture}),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,"EffectRenderer",function(){return n.EffectRenderer}),r.d(t,"EffectWrapper",function(){return n.EffectWrapper}),r.d(t,"Scalar",function(){return n.Scalar}),r.d(t,"Space",function(){return n.Space}),r.d(t,"Axis",function(){return n.Axis}),r.d(t,"Color3",function(){return n.Color3}),r.d(t,"Color4",function(){return n.Color4}),r.d(t,"TmpColors",function(){return n.TmpColors}),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,"Frustum",function(){return n.Frustum}),r.d(t,"Plane",function(){return n.Plane}),r.d(t,"Size",function(){return n.Size}),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,"Quaternion",function(){return n.Quaternion}),r.d(t,"Matrix",function(){return n.Matrix}),r.d(t,"TmpVectors",function(){return n.TmpVectors}),r.d(t,"Viewport",function(){return n.Viewport}),r.d(t,"SphericalHarmonics",function(){return n.SphericalHarmonics}),r.d(t,"SphericalPolynomial",function(){return n.SphericalPolynomial}),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,"_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,"MeshLODLevel",function(){return n.MeshLODLevel}),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,"TorusBuilder",function(){return n.TorusBuilder}),r.d(t,"LinesBuilder",function(){return n.LinesBuilder}),r.d(t,"PlaneBuilder",function(){return n.PlaneBuilder}),r.d(t,"GroundBuilder",function(){return n.GroundBuilder}),r.d(t,"DataBuffer",function(){return n.DataBuffer}),r.d(t,"WebGLDataBuffer",function(){return n.WebGLDataBuffer}),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,"CloudPoint",function(){return n.CloudPoint}),r.d(t,"PointsGroup",function(){return n.PointsGroup}),r.d(t,"PointColor",function(){return n.PointColor}),r.d(t,"PointsCloudSystem",function(){return n.PointsCloudSystem}),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,"StereoscopicInterlacePostProcessI",function(){return n.StereoscopicInterlacePostProcessI}),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,"VRMultiviewToSingleviewPostProcess",function(){return n.VRMultiviewToSingleviewPostProcess}),r.d(t,"ScreenSpaceReflectionPostProcess",function(){return n.ScreenSpaceReflectionPostProcess}),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,"SpriteMap",function(){return n.SpriteMap}),r.d(t,"SpritePackedManager",function(){return n.SpritePackedManager}),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,"EquiRectangularCubeTextureAssetTask",function(){return n.EquiRectangularCubeTextureAssetTask}),r.d(t,"AssetsManager",function(){return n.AssetsManager}),r.d(t,"BasisTranscodeConfiguration",function(){return n.BasisTranscodeConfiguration}),r.d(t,"BasisTools",function(){return n.BasisTools}),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,"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,"Tools",function(){return n.Tools}),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,"BRDFTextureTools",function(){return n.BRDFTextureTools}),r.d(t,"RGBDTextureTools",function(){return n.RGBDTextureTools}),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,"GradientHelper",function(){return n.GradientHelper}),r.d(t,"PerfCounter",function(){return n.PerfCounter}),r.d(t,"RetryStrategy",function(){return n.RetryStrategy}),r.d(t,"CanvasGenerator",function(){return n.CanvasGenerator}),r.d(t,"LoadFileError",function(){return n.LoadFileError}),r.d(t,"RequestFileError",function(){return n.RequestFileError}),r.d(t,"ReadFileError",function(){return n.ReadFileError}),r.d(t,"FileTools",function(){return n.FileTools}),r.d(t,"StringTools",function(){return n.StringTools}),r.d(t,"DataReader",function(){return n.DataReader}),r.d(t,"MinMaxReducer",function(){return n.MinMaxReducer}),r.d(t,"DepthReducer",function(){return n.DepthReducer}),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,"WebXRExperienceHelper",function(){return n.WebXRExperienceHelper}),r.d(t,"WebXRInput",function(){return n.WebXRInput}),r.d(t,"WebXRInputSource",function(){return n.WebXRInputSource}),r.d(t,"WebXRManagedOutputCanvasOptions",function(){return n.WebXRManagedOutputCanvasOptions}),r.d(t,"WebXRManagedOutputCanvas",function(){return n.WebXRManagedOutputCanvas}),r.d(t,"WebXRState",function(){return n.WebXRState}),r.d(t,"WebXRSessionManager",function(){return n.WebXRSessionManager}),r.d(t,"WebXRDefaultExperienceOptions",function(){return n.WebXRDefaultExperienceOptions}),r.d(t,"WebXRDefaultExperience",function(){return n.WebXRDefaultExperience}),r.d(t,"WebXRFeatureName",function(){return n.WebXRFeatureName}),r.d(t,"WebXRFeaturesManager",function(){return n.WebXRFeaturesManager}),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,"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,"EngineView",function(){return n.EngineView}),r.d(t,"ShadowGenerator",function(){return n.ShadowGenerator}),r.d(t,"CascadedShadowGenerator",function(){return n.CascadedShadowGenerator}),r.d(t,"ShadowGeneratorSceneComponent",function(){return n.ShadowGeneratorSceneComponent}),r.d(t,"_BabylonLoaderRegistered",function(){return n._BabylonLoaderRegistered}),r.d(t,"BabylonFileLoaderConfiguration",function(){return n.BabylonFileLoaderConfiguration}),r.d(t,"BackgroundMaterial",function(){return n.BackgroundMaterial}),r.d(t,"PBRMaterialDefines",function(){return n.PBRMaterialDefines}),r.d(t,"PBRBaseMaterial",function(){return n.PBRBaseMaterial}),r.d(t,"PBRBaseSimpleMaterial",function(){return n.PBRBaseSimpleMaterial}),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,"RawCubeTexture",function(){return n.RawCubeTexture}),r.d(t,"RawTexture3D",function(){return n.RawTexture3D}),r.d(t,"RawTexture2DArray",function(){return n.RawTexture2DArray}),r.d(t,"RefractionTexture",function(){return n.RefractionTexture}),r.d(t,"VideoTexture",function(){return n.VideoTexture}),r.d(t,"HtmlElementTexture",function(){return n.HtmlElementTexture}),r.d(t,"NodeMaterialConnectionPointCompatibilityStates",function(){return n.NodeMaterialConnectionPointCompatibilityStates}),r.d(t,"NodeMaterialConnectionPointDirection",function(){return n.NodeMaterialConnectionPointDirection}),r.d(t,"NodeMaterialConnectionPoint",function(){return n.NodeMaterialConnectionPoint}),r.d(t,"NodeMaterialBlock",function(){return n.NodeMaterialBlock}),r.d(t,"NodeMaterialDefines",function(){return n.NodeMaterialDefines}),r.d(t,"NodeMaterial",function(){return n.NodeMaterial}),r.d(t,"Orientation",function(){return n.Orientation}),r.d(t,"BezierCurve",function(){return n.BezierCurve}),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,"DracoCompression",function(){return n.DracoCompression}),r.d(t,"TiledBoxBuilder",function(){return n.TiledBoxBuilder}),r.d(t,"DiscBuilder",function(){return n.DiscBuilder}),r.d(t,"RibbonBuilder",function(){return n.RibbonBuilder}),r.d(t,"HemisphereBuilder",function(){return n.HemisphereBuilder}),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,"TiledPlaneBuilder",function(){return n.TiledPlaneBuilder}),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,"RecastJSPlugin",function(){return n.RecastJSPlugin}),r.d(t,"RecastJSCrowd",function(){return n.RecastJSCrowd}),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,"CustomParticleEmitter",function(){return n.CustomParticleEmitter}),r.d(t,"MeshParticleEmitter",function(){return n.MeshParticleEmitter}),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,"CubeMapToSphericalPolynomialTools",function(){return n.CubeMapToSphericalPolynomialTools}),r.d(t,"HDRTools",function(){return n.HDRTools}),r.d(t,"PanoramaToCubeMapTools",function(){return n.PanoramaToCubeMapTools}),r.d(t,"WebXRHitTestLegacy",function(){return n.WebXRHitTestLegacy}),r.d(t,"WebXRAnchorSystem",function(){return n.WebXRAnchorSystem}),r.d(t,"WebXRPlaneDetector",function(){return n.WebXRPlaneDetector}),r.d(t,"WebXRBackgroundRemover",function(){return n.WebXRBackgroundRemover}),r.d(t,"WebXRMotionControllerTeleportation",function(){return n.WebXRMotionControllerTeleportation}),r.d(t,"WebXRControllerPointerSelection",function(){return n.WebXRControllerPointerSelection}),r.d(t,"IWebXRControllerPhysicsOptions",function(){return n.IWebXRControllerPhysicsOptions}),r.d(t,"WebXRControllerPhysics",function(){return n.WebXRControllerPhysics}),r.d(t,"WebXRAbstractMotionController",function(){return n.WebXRAbstractMotionController}),r.d(t,"WebXRControllerComponent",function(){return n.WebXRControllerComponent}),r.d(t,"WebXRGenericTriggerMotionController",function(){return n.WebXRGenericTriggerMotionController}),r.d(t,"WebXRMicrosoftMixedRealityController",function(){return n.WebXRMicrosoftMixedRealityController}),r.d(t,"WebXRMotionControllerManager",function(){return n.WebXRMotionControllerManager}),r.d(t,"WebXROculusTouchMotionController",function(){return n.WebXROculusTouchMotionController}),r.d(t,"WebXRHTCViveMotionController",function(){return n.WebXRHTCViveMotionController}),r.d(t,"WebXRProfiledMotionController",function(){return n.WebXRProfiledMotionController}),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,"_BasisTextureLoader",function(){return n._BasisTextureLoader}),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,"TexturePacker",function(){return n.TexturePacker}),r.d(t,"TexturePackerFrame",function(){return n.TexturePackerFrame}),r.d(t,"NodeMaterialBlockTargets",function(){return n.NodeMaterialBlockTargets}),r.d(t,"NodeMaterialBlockConnectionPointTypes",function(){return n.NodeMaterialBlockConnectionPointTypes}),r.d(t,"NodeMaterialBlockConnectionPointMode",function(){return n.NodeMaterialBlockConnectionPointMode}),r.d(t,"NodeMaterialSystemValues",function(){return n.NodeMaterialSystemValues}),r.d(t,"MultiplyBlock",function(){return n.MultiplyBlock}),r.d(t,"AddBlock",function(){return n.AddBlock}),r.d(t,"ScaleBlock",function(){return n.ScaleBlock}),r.d(t,"ClampBlock",function(){return n.ClampBlock}),r.d(t,"CrossBlock",function(){return n.CrossBlock}),r.d(t,"DotBlock",function(){return n.DotBlock}),r.d(t,"TransformBlock",function(){return n.TransformBlock}),r.d(t,"RemapBlock",function(){return n.RemapBlock}),r.d(t,"NormalizeBlock",function(){return n.NormalizeBlock}),r.d(t,"TrigonometryBlockOperations",function(){return n.TrigonometryBlockOperations}),r.d(t,"TrigonometryBlock",function(){return n.TrigonometryBlock}),r.d(t,"ColorMergerBlock",function(){return n.ColorMergerBlock}),r.d(t,"VectorMergerBlock",function(){return n.VectorMergerBlock}),r.d(t,"ColorSplitterBlock",function(){return n.ColorSplitterBlock}),r.d(t,"VectorSplitterBlock",function(){return n.VectorSplitterBlock}),r.d(t,"LerpBlock",function(){return n.LerpBlock}),r.d(t,"DivideBlock",function(){return n.DivideBlock}),r.d(t,"SubtractBlock",function(){return n.SubtractBlock}),r.d(t,"StepBlock",function(){return n.StepBlock}),r.d(t,"OneMinusBlock",function(){return n.OneMinusBlock}),r.d(t,"ViewDirectionBlock",function(){return n.ViewDirectionBlock}),r.d(t,"FresnelBlock",function(){return n.FresnelBlock}),r.d(t,"MaxBlock",function(){return n.MaxBlock}),r.d(t,"MinBlock",function(){return n.MinBlock}),r.d(t,"DistanceBlock",function(){return n.DistanceBlock}),r.d(t,"LengthBlock",function(){return n.LengthBlock}),r.d(t,"NegateBlock",function(){return n.NegateBlock}),r.d(t,"PowBlock",function(){return n.PowBlock}),r.d(t,"RandomNumberBlock",function(){return n.RandomNumberBlock}),r.d(t,"ArcTan2Block",function(){return n.ArcTan2Block}),r.d(t,"SmoothStepBlock",function(){return n.SmoothStepBlock}),r.d(t,"ReciprocalBlock",function(){return n.ReciprocalBlock}),r.d(t,"ReplaceColorBlock",function(){return n.ReplaceColorBlock}),r.d(t,"PosterizeBlock",function(){return n.PosterizeBlock}),r.d(t,"WaveBlockKind",function(){return n.WaveBlockKind}),r.d(t,"WaveBlock",function(){return n.WaveBlock}),r.d(t,"GradientBlockColorStep",function(){return n.GradientBlockColorStep}),r.d(t,"GradientBlock",function(){return n.GradientBlock}),r.d(t,"NLerpBlock",function(){return n.NLerpBlock}),r.d(t,"WorleyNoise3DBlock",function(){return n.WorleyNoise3DBlock}),r.d(t,"SimplexPerlin3DBlock",function(){return n.SimplexPerlin3DBlock}),r.d(t,"NormalBlendBlock",function(){return n.NormalBlendBlock}),r.d(t,"Rotate2dBlock",function(){return n.Rotate2dBlock}),r.d(t,"ReflectBlock",function(){return n.ReflectBlock}),r.d(t,"RefractBlock",function(){return n.RefractBlock}),r.d(t,"DesaturateBlock",function(){return n.DesaturateBlock}),r.d(t,"NodeMaterialOptimizer",function(){return n.NodeMaterialOptimizer}),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}),r.d(t,"VertexOutputBlock",function(){return n.VertexOutputBlock}),r.d(t,"BonesBlock",function(){return n.BonesBlock}),r.d(t,"InstancesBlock",function(){return n.InstancesBlock}),r.d(t,"MorphTargetsBlock",function(){return n.MorphTargetsBlock}),r.d(t,"LightInformationBlock",function(){return n.LightInformationBlock}),r.d(t,"FragmentOutputBlock",function(){return n.FragmentOutputBlock}),r.d(t,"ImageProcessingBlock",function(){return n.ImageProcessingBlock}),r.d(t,"PerturbNormalBlock",function(){return n.PerturbNormalBlock}),r.d(t,"DiscardBlock",function(){return n.DiscardBlock}),r.d(t,"FrontFacingBlock",function(){return n.FrontFacingBlock}),r.d(t,"DerivativeBlock",function(){return n.DerivativeBlock}),r.d(t,"FogBlock",function(){return n.FogBlock}),r.d(t,"LightBlock",function(){return n.LightBlock}),r.d(t,"TextureBlock",function(){return n.TextureBlock}),r.d(t,"ReflectionTextureBlock",function(){return n.ReflectionTextureBlock}),r.d(t,"InputBlock",function(){return n.InputBlock}),r.d(t,"AnimatedInputBlockTypes",function(){return n.AnimatedInputBlockTypes});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.color */"./Maths/math.color.ts"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=function(){function e(e,t,r,s,a){this.size=e,this.position=t,this.alphaMode=o.Constants.ALPHA_ONEONE,this.color=r||new n.Color3(1,1,1),this.texture=s?new i.Texture(s,a.getScene(),!0):null,this._system=a,a.lensFlares.push(this)}return e.AddFlare=function(t,r,n,i,o){return new e(t,r,n,i,o)},e.prototype.dispose=function(){this.texture&&this.texture.dispose();var e=this._system.lensFlares.indexOf(this);this._system.lensFlares.splice(e,1)},e}()},"./LensFlares/lensFlareSystem.ts": /*!***************************************!*\ !*** ./LensFlares/lensFlareSystem.ts ***! \***************************************/ /*! exports provided: LensFlareSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"LensFlareSystem",function(){return p});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),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=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),p=function(){function e(t,r,n){this.name=t,this.lensFlares=new Array,this.borderLimit=300,this.viewportBorder=0,this.layerMask=268435455,this._vertexBuffers={},this._isEnabled=!0,this._scene=n||s.EngineStore.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._emitter=r,this.id=t,n.lensFlareSystems.push(this),this.meshesSelectionPredicate=function(e){return n.activeCamera&&e.material&&e.isVisible&&e.isEnabled()&&e.isBlocker&&0!=(e.layerMask&n.activeCamera.layerMask)};var i=n.getEngine(),o=[];o.push(1,1),o.push(-1,1),o.push(-1,-1),o.push(1,-1),this._vertexBuffers[a.VertexBuffer.PositionKind]=new a.VertexBuffer(i,o,a.VertexBuffer.PositionKind,!1,!1,2);var 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._positionXe.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._positionXn.x+n.width-this.borderLimit?this._positionX-n.x-n.width+this.borderLimit:0)>(t=this._positionYn.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;p0);for(var r=0,i=t;r0)}},e}();s.LensFlareSystem._SceneComponentInitialization=function(e){var t=e._getComponent(i.SceneComponentConstants.NAME_LENSFLARESYSTEM);t||(t=new a(e),e._addComponent(t))}},"./Lights/Shadows/cascadedShadowGenerator.ts": /*!***************************************************!*\ !*** ./Lights/Shadows/cascadedShadowGenerator.ts ***! \***************************************************/ /*! exports provided: CascadedShadowGenerator */function(e,t,r){"use strict";r.r(t),r.d(t,"CascadedShadowGenerator",function(){return g});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../../Shaders/shadowMap.fragment */"./Shaders/shadowMap.fragment.ts"),r(/*! ../../Shaders/shadowMap.vertex */"./Shaders/shadowMap.vertex.ts"),r(/*! ../../Shaders/depthBoxBlur.fragment */"./Shaders/depthBoxBlur.fragment.ts"),r(/*! ../../Misc/devTools */"./Misc/devTools.ts")),c=r(/*! ./shadowGenerator */"./Lights/Shadows/shadowGenerator.ts"),l=r(/*! ../../Culling/boundingInfo */"./Culling/boundingInfo.ts"),u=r(/*! ../../Misc/depthReducer */"./Misc/depthReducer.ts"),h=i.Vector3.Up(),d=i.Vector3.Zero(),f=new i.Vector3,p=new i.Vector3,m=new i.Matrix,g=function(e){function t(t,r,n){var i=e.call(this,t,r,n)||this;if(1==i._scene.getEngine().webGLVersion)throw"CSM can only be used in WebGL2";return i.usePercentageCloserFiltering=!0,i}return Object(n.__extends)(t,e),t.prototype._validateFilter=function(e){return e===c.ShadowGenerator.FILTER_NONE||e===c.ShadowGenerator.FILTER_PCF||e===c.ShadowGenerator.FILTER_PCSS?e:(console.error('Unsupported filter "'+e+'"!'),c.ShadowGenerator.FILTER_NONE)},Object.defineProperty(t.prototype,"numCascades",{get:function(){return this._numCascades},set:function(e){(e=Math.min(Math.max(e,t.MIN_CASCADES_COUNT),t.MAX_CASCADES_COUNT))!==this._numCascades&&(this._numCascades=e,this.recreateShadowMap())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"freezeShadowCastersBoundingInfo",{get:function(){return this._freezeShadowCastersBoundingInfo},set:function(e){this._freezeShadowCastersBoundingInfoObservable&&e&&(this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable),this._freezeShadowCastersBoundingInfoObservable=null),this._freezeShadowCastersBoundingInfoObservable||e||(this._freezeShadowCastersBoundingInfoObservable=this._scene.onBeforeRenderObservable.add(this._computeShadowCastersBoundingInfo.bind(this))),this._freezeShadowCastersBoundingInfo=e,e&&this._computeShadowCastersBoundingInfo()},enumerable:!0,configurable:!0}),t.prototype._computeShadowCastersBoundingInfo=function(){if(this._scbiMin.copyFromFloats(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._scbiMax.copyFromFloats(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),this._shadowMap&&this._shadowMap.renderList){for(var e=this._shadowMap.renderList,t=0;tt&&(e=0,t=1),e<0&&(e=0),t>1&&(t=1),this._minDistance=e,this._maxDistance=t,this._breaksAreDirty=!0)},Object.defineProperty(t.prototype,"minDistance",{get:function(){return this._minDistance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxDistance",{get:function(){return this._maxDistance},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return t.CLASSNAME},t.prototype.getCascadeMinExtents=function(e){return e>=0&&e=0&&ethis._scene.activeCamera.maxZ||(this._shadowMaxZ=e,this._light._markMeshesAsLightDirty(),this._breaksAreDirty=!0):this._shadowMaxZ=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"debug",{get:function(){return this._debug},set:function(e){this._debug=e,this._light._markMeshesAsLightDirty()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"depthClamp",{get:function(){return this._depthClamp},set:function(e){this._depthClamp=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cascadeBlendPercentage",{get:function(){return this._cascadeBlendPercentage},set:function(e){this._cascadeBlendPercentage=e,this._light._markMeshesAsLightDirty()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lambda",{get:function(){return this._lambda},set:function(e){var t=Math.min(Math.max(e,0),1);this._lambda!=t&&(this._lambda=t,this._breaksAreDirty=!0)},enumerable:!0,configurable:!0}),t.prototype.getCascadeViewMatrix=function(e){return e>=0&&e=0&&e=0&&e=n&&(r=0,n=1),r==t._minDistance&&n==t._maxDistance||t.setMinMaxDistance(r,n)}),this._depthReducer.setDepthRenderer(this._depthRenderer)),this._depthReducer.activate()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoCalcDepthBoundsRefreshRate",{get:function(){var e,t,r;return null!=(r=null===(t=null===(e=this._depthReducer)||void 0===e?void 0:e.depthRenderer)||void 0===t?void 0:t.getDepthMap().refreshRate)?r:-1},set:function(e){var t;(null===(t=this._depthReducer)||void 0===t?void 0:t.depthRenderer)&&(this._depthReducer.depthRenderer.getDepthMap().refreshRate=e)},enumerable:!0,configurable:!0}),t.prototype.splitFrustum=function(){this._breaksAreDirty=!0},t.prototype._splitFrustum=function(){var e=this._scene.activeCamera;if(e){for(var t=e.minZ,r=e.maxZ,n=r-t,i=this._minDistance,o=t+i*n,s=t+(this._shadowMaxZ=t?Math.min((this._shadowMaxZ-t)/(r-t),this._maxDistance):this._maxDistance)*n,a=s-o,c=s/o,l=0;l=1?1:e<=0?0:e,this},Object.defineProperty(e.prototype,"transparencyShadow",{get:function(){return this._transparencyShadow},set:function(e){this.setTransparencyShadow(e)},enumerable:!0,configurable:!0}),e.prototype.setTransparencyShadow=function(e){return this._transparencyShadow=e,this},e.prototype.getShadowMap=function(){return this._shadowMap},e.prototype.getShadowMapForRendering=function(){return this._shadowMap2?this._shadowMap2:this._shadowMap},e.prototype.getClassName=function(){return e.CLASSNAME},e.prototype.addShadowCaster=function(e,t){var r;return void 0===t&&(t=!0),this._shadowMap?(this._shadowMap.renderList||(this._shadowMap.renderList=[]),this._shadowMap.renderList.push(e),t&&(r=this._shadowMap.renderList).push.apply(r,e.getChildMeshes()),this):this},e.prototype.removeShadowCaster=function(e,t){if(void 0===t&&(t=!0),!this._shadowMap||!this._shadowMap.renderList)return this;var r=this._shadowMap.renderList.indexOf(e);if(-1!==r&&this._shadowMap.renderList.splice(r,1),t)for(var n=0,i=e.getChildren();n1?(this._shadowMap=new u.RenderTargetTexture(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube(),void 0,!1,!1),this._shadowMap.createDepthStencilTexture(f.Constants.LESS,!0)):this._shadowMap=new u.RenderTargetTexture(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube())},e.prototype._initializeShadowMap=function(){var t=this;if(this._createTargetRenderTexture(),null!==this._shadowMap){this._shadowMap.wrapU=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._storedUniqueId&&(this._shadowMap.uniqueId=this._storedUniqueId),this._shadowMap.customRenderFunction=this._renderForShadowMap.bind(this);var r=this._scene.getEngine();this._shadowMap.onBeforeRenderObservable.add(function(n){t._currentFaceIndex=n,t._filter===e.FILTER_PCF&&r.setColorWrite(!1)}),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 o.Color4(0,0,0,0),i=new o.Color4(1,1,1,1);this._shadowMap.onClearObservable.add(function(r){t._filter===e.FILTER_PCF?r.clear(i,!1,!0,!1):t.useExponentialShadowMap||t.useBlurExponentialShadowMap?r.clear(n,!0,!0,!1):r.clear(i,!0,!0,!1)}),this._shadowMap.onResizeObservable.add(function(e){t._storedUniqueId=t._shadowMap.uniqueId,t._mapSize=e.getRenderSize(),t._light._markMeshesAsLightDirty(),t.recreateShadowMap()});for(var s=_.RenderingManager.MIN_RENDERINGGROUPS;s<_.RenderingManager.MAX_RENDERINGGROUPS;s++)this._shadowMap.setRenderingAutoClearDepthStencil(s,!1)}},e.prototype._initializeBlurRTTAndPostProcesses=function(){var e=this,t=this._scene.getEngine(),r=this._mapSize/this.blurScale;this.useKernelBlur&&1===this.blurScale||(this._shadowMap2=new u.RenderTargetTexture(this._light.name+"_shadowMap2",r,this._scene,!1,!0,this._textureType),this._shadowMap2.wrapU=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(),s=o.getColorWrite();if(n.length){for(o.setColorWrite(!1),i=0;i=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._isReadyCustomDefines=function(e,t,r){},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=[s.VertexBuffer.PositionKind],i=e.getMesh(),o=e.getMaterial();if(this.normalBias&&i.isVerticesDataPresent(s.VertexBuffer.NormalKind)&&(n.push(s.VertexBuffer.NormalKind),r.push("#define NORMAL"),i.nonUniformScaling&&r.push("#define NONUNIFORMSCALING"),this.getLight().getTypeID()===a.Light.LIGHTTYPEID_DIRECTIONALLIGHT&&r.push("#define DIRECTIONINLIGHTDATA")),o&&o.needAlphaTesting()){var l=o.getAlphaTestTexture();l&&(r.push("#define ALPHATEST"),i.isVerticesDataPresent(s.VertexBuffer.UVKind)&&(n.push(s.VertexBuffer.UVKind),r.push("#define UV1")),i.isVerticesDataPresent(s.VertexBuffer.UV2Kind)&&1===l.coordinatesIndex&&(n.push(s.VertexBuffer.UV2Kind),r.push("#define UV2")))}var u=new g.EffectFallbacks;if(i.useBones&&i.computeBonesUsingShaders&&i.skeleton){n.push(s.VertexBuffer.MatricesIndicesKind),n.push(s.VertexBuffer.MatricesWeightsKind),i.numBoneInfluencers>4&&(n.push(s.VertexBuffer.MatricesIndicesExtraKind),n.push(s.VertexBuffer.MatricesWeightsExtraKind));var h=i.skeleton;r.push("#define NUM_BONE_INFLUENCERS "+i.numBoneInfluencers),i.numBoneInfluencers>0&&u.addCPUSkinningFallback(0,i),h.isUsingTextureForMatrices?r.push("#define BONETEXTURE"):r.push("#define BonesPerMesh "+(h.bones.length+1))}else r.push("#define NUM_BONE_INFLUENCERS 0");var d=i.morphTargetManager,p=0;d&&d.numInfluencers>0&&(r.push("#define MORPHTARGETS"),p=d.numInfluencers,r.push("#define NUM_MORPH_INFLUENCERS "+p),c.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(n,i,p));var m=this._scene;if(m.clipPlane&&r.push("#define CLIPPLANE"),m.clipPlane2&&r.push("#define CLIPPLANE2"),m.clipPlane3&&r.push("#define CLIPPLANE3"),m.clipPlane4&&r.push("#define CLIPPLANE4"),m.clipPlane5&&r.push("#define CLIPPLANE5"),m.clipPlane6&&r.push("#define CLIPPLANE6"),t&&(r.push("#define INSTANCES"),c.MaterialHelper.PushAttributesForInstances(n)),this.customShaderOptions&&this.customShaderOptions.defines)for(var _=0,v=this.customShaderOptions.defines;_0?this._setDefaultFixedFrustumShadowProjectionMatrix(e):this._setDefaultAutoExtendShadowProjectionMatrix(e,t,r)},t.prototype._setDefaultFixedFrustumShadowProjectionMatrix=function(e){var t=this.getScene().activeCamera;t&&o.Matrix.OrthoLHToRef(this.shadowFrustumSize,this.shadowFrustumSize,void 0!==this.shadowMinZ?this.shadowMinZ:t.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:t.maxZ,e)},t.prototype._setDefaultAutoExtendShadowProjectionMatrix=function(e,t,r){var n=this.getScene().activeCamera;if(n){if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){var i=o.Vector3.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=Number.MIN_VALUE,this._orthoTop=Number.MIN_VALUE,this._orthoBottom=Number.MAX_VALUE;for(var s=Number.MAX_VALUE,a=Number.MIN_VALUE,c=0;cthis._orthoRight&&(this._orthoRight=i.x),i.y>this._orthoTop&&(this._orthoTop=i.y),this.autoCalcShadowZBounds&&(i.za&&(a=i.z))}this.autoCalcShadowZBounds&&(this._shadowMinZ=s,this._shadowMaxZ=a)}var d=this._orthoRight-this._orthoLeft,f=this._orthoTop-this._orthoBottom;o.Matrix.OrthoOffCenterLHToRef(this._orthoLeft-d*this.shadowOrthoScale,this._orthoRight+d*this.shadowOrthoScale,this._orthoBottom-f*this.shadowOrthoScale,this._orthoTop+f*this.shadowOrthoScale,void 0!==this.shadowMinZ?this.shadowMinZ:n.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:n.maxZ,e)}},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,t),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,t),this)},t.prototype.transferToNodeMaterialEffect=function(e,t){return this.computeTransformedInformation()?(e.setFloat3(t,this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z),this):(e.setFloat3(t,this.direction.x,this.direction.y,this.direction.z),this)},t.prototype.getDepthMinZ=function(e){return 1},t.prototype.getDepthMaxZ=function(e){return 1},t.prototype.prepareLightSpecificDefines=function(e,t){e["DIRLIGHT"+t]=!0},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowFrustumSize",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"shadowOrthoScale",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"autoUpdateExtends",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"autoCalcShadowZBounds",void 0),t}(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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../node */"./node.ts"),c=r(/*! ./light */"./Lights/light.ts");a.Node.AddNodeConstructor("Light_Type_3",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.groundColor=new s.Color3(0,0,0),i.direction=r||o.Vector3.Up(),i}return Object(n.__extends)(t,e),t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.getClassName=function(){return"HemisphericLight"},t.prototype.setDirectionToTarget=function(e){return this.direction=o.Vector3.Normalize(e.subtract(o.Vector3.Zero())),this.direction},t.prototype.getShadowGenerator=function(){return null},t.prototype.transferToEffect=function(e,t){var r=o.Vector3.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",r.x,r.y,r.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this},t.prototype.transferToNodeMaterialEffect=function(e,t){var r=o.Vector3.Normalize(this.direction);return e.setFloat3(t,r.x,r.y,r.z),this},t.prototype.computeWorldMatrix=function(){return this._worldMatrix||(this._worldMatrix=o.Matrix.Identity()),this._worldMatrix},t.prototype.getTypeID=function(){return c.Light.LIGHTTYPEID_HEMISPHERICLIGHT},t.prototype.prepareLightSpecificDefines=function(e,t){e["HEMILIGHT"+t]=!0},Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"groundColor",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"direction",void 0),t}(c.Light)},"./Lights/index.ts": /*!*************************!*\ !*** ./Lights/index.ts ***! \*************************/ /*! exports provided: Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, ShadowGenerator, CascadedShadowGenerator, 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,"CascadedShadowGenerator",function(){return o.CascadedShadowGenerator}),r.d(t,"ShadowGeneratorSceneComponent",function(){return o.ShadowGeneratorSceneComponent});var s=r(/*! ./directionalLight */"./Lights/directionalLight.ts");r.d(t,"DirectionalLight",function(){return s.DirectionalLight});var a=r(/*! ./hemisphericLight */"./Lights/hemisphericLight.ts");r.d(t,"HemisphericLight",function(){return a.HemisphericLight});var 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 u});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a=r(/*! ../node */"./node.ts"),c=r(/*! ../Materials/uniformBuffer */"./Materials/uniformBuffer.ts"),l=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),u=function(e){function t(r,n){var i=e.call(this,r,n)||this;return i.diffuse=new s.Color3(1,1,1),i.specular=new s.Color3(1,1,1),i.falloffType=t.FALLOFF_DEFAULT,i.intensity=1,i._range=Number.MAX_VALUE,i._inverseSquaredRange=0,i._photometricScale=1,i._intensityMode=t.INTENSITYMODE_AUTOMATIC,i._radius=1e-5,i.renderPriority=0,i._shadowEnabled=!0,i._excludeWithLayerMask=0,i._includeOnlyWithLayerMask=0,i._lightmapMode=0,i._excludedMeshesIds=new Array,i._includedOnlyMeshesIds=new Array,i._isLight=!0,i.getScene().addLight(i),i._uniformBuffer=new c.UniformBuffer(i.getScene().getEngine()),i._buildUniformLayout(),i.includedOnlyMeshes=new Array,i.excludedMeshes=new Array,i._resyncMeshes(),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"range",{get:function(){return this._range},set:function(e){this._range=e,this._inverseSquaredRange=1/(this.range*this.range)},enumerable:!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.transferTexturesToEffect=function(e,t){return this},t.prototype._bindLight=function(e,t,r,n,i){void 0===i&&(i=!1);var o=e.toString(),a=!1;if(!i||!this._uniformBuffer._alreadyBound){if(this._uniformBuffer.bindToEffect(r,"Light"+o),this._renderId!==t.getRenderId()||!this._uniformBuffer.useUbo){this._renderId=t.getRenderId();var c=this.getScaledIntensity();this.transferToEffect(r,o),this.diffuse.scaleToRef(c,s.TmpColors.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",s.TmpColors.Color3[0],this.range,o),n&&(this.specular.scaleToRef(c,s.TmpColors.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",s.TmpColors.Color3[1],this.radius,o)),a=!0}if(this.transferTexturesToEffect(r,o),t.shadowsEnabled&&this.shadowEnabled){var l=this.getShadowGenerator();l&&(l.bindShadowLight(o,r),a=!0)}a&&this._uniformBuffer.update()}},t.prototype.getClassName=function(){return"Light"},t.prototype.toString=function(e){var t="Name: "+this.name;if(t+=", type: "+["Point","Directional","Spot","Hemispheric"][this.getTypeID()],this.animations)for(var r=0;r0&&-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;n0&&(e.excludedMeshesIds=[],this.excludedMeshes.forEach(function(t){e.excludedMeshesIds.push(t.id)})),this.includedOnlyMeshes.length>0&&(e.includedOnlyMeshesIds=[],this.includedOnlyMeshes.forEach(function(t){e.includedOnlyMeshesIds.push(t.id)})),i.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e},t.GetConstructorFromName=function(e,t,r){var n=a.Node.Construct("Light_Type_"+e,t,r);return n||null},t.Parse=function(e,r){var n=t.GetConstructorFromName(e.type,e.name,r);if(!n)return null;var o=i.SerializationHelper.Parse(n,e,r);if(e.excludedMeshesIds&&(o._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(o._includedOnlyMeshesIds=e.includedOnlyMeshesIds),e.parentId&&(o._waitingParentId=e.parentId),void 0!==e.falloffType&&(o.falloffType=e.falloffType),void 0!==e.lightmapMode&&(o.lightmapMode=e.lightmapMode),e.animations){for(var s=0;s0){var n=t._waitingData.lods.ids,i=r.isEnabled(!1);if(t._waitingData.lods.distances){var o=t._waitingData.lods.distances;if(o.length>=n.length){var s=o.length>n.length?o[o.length-1]:0;r.setEnabled(!1);for(var a=0;a0&&r.addLODLevel(s,null),!0===i&&r.setEnabled(!0)}else S.Tools.Warn("Invalid level of detail distances for "+t.name)}}t._waitingData.lods=null}},N=function(e,t,r,o,s){void 0===s&&(s=!1);var g=new A.AssetContainer(e),M="importScene has failed JSON parse";try{var x=JSON.parse(t);M="";var P,S,O=_.SceneLoader.loggingLevel===_.SceneLoader.DETAILED_LOGGING;if(void 0!==x.environmentTexture&&null!==x.environmentTexture){var I=void 0===x.isPBR||x.isPBR;if(x.environmentTextureType&&"BABYLON.HDRCubeTexture"===x.environmentTextureType){var D=x.environmentTextureSize?x.environmentTextureSize:128,B=new f.HDRCubeTexture((x.environmentTexture.match(/https?:\/\//g)?"":r)+x.environmentTexture,e,D,!0,!I);x.environmentTextureRotationY&&(B.rotationY=x.environmentTextureRotationY),e.environmentTexture=B}else if(R.StringTools.EndsWith(x.environmentTexture,".env")){var N=new d.CubeTexture((x.environmentTexture.match(/https?:\/\//g)?"":r)+x.environmentTexture,e);x.environmentTextureRotationY&&(N.rotationY=x.environmentTextureRotationY),e.environmentTexture=N}else{var F=d.CubeTexture.CreateFromPrefilteredData((x.environmentTexture.match(/https?:\/\//g)?"":r)+x.environmentTexture,e);x.environmentTextureRotationY&&(F.rotationY=x.environmentTextureRotationY),e.environmentTexture=F}if(!0===x.createDefaultSkybox){var V=void 0!==e.activeCamera&&null!==e.activeCamera?(e.activeCamera.maxZ-e.activeCamera.minZ)/2:1e3,k=x.skyboxBlurLevel||0;e.createDefaultSkybox(e.environmentTexture,I,V,k)}g.environmentTexture=e.environmentTexture}if(void 0!==x.environmentIntensity&&null!==x.environmentIntensity&&(e.environmentIntensity=x.environmentIntensity),void 0!==x.lights&&null!==x.lights)for(P=0,S=x.lights.length;P0){for(var ve=0;ve<_e._excludedMeshesIds.length;ve++){var Ae=e.getMeshByID(_e._excludedMeshesIds[ve]);Ae&&_e.excludedMeshes.push(Ae)}_e._excludedMeshesIds=[]}if(_e._includedOnlyMeshesIds.length>0){for(var ye=0;ye<_e._includedOnlyMeshesIds.length;ye++){var be=e.getMeshByID(_e._includedOnlyMeshesIds[ye]);be&&_e.includedOnlyMeshes.push(be)}_e._includedOnlyMeshesIds=[]}}for(v.AbstractScene.Parse(x,e,g,r),P=0,S=e.meshes.length;P-1&&void 0!==f.skeletons&&null!==f.skeletons)if(!1===x.indexOf(E.skeletonId)>-1)for(var U=0,G=f.skeletons.length;U0,o.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!u.invertZ:u.invertZ,o.LODINREFLECTIONALPHA=u.lodLevelInAlpha,o.EQUIRECTANGULAR_RELFECTION_FOV=this.useEquirectangularFOV,o.REFLECTIONBGR=this.switchToBGR,u.coordinatesMode===f.Texture.INVCUBIC_MODE&&(o.INVERTCUBICMAP=!0),o.REFLECTIONMAP_3D=u.isCube,u.coordinatesMode){case f.Texture.EXPLICIT_MODE:o.REFLECTIONMAP_EXPLICIT=!0;break;case f.Texture.PLANAR_MODE:o.REFLECTIONMAP_PLANAR=!0;break;case f.Texture.PROJECTION_MODE:o.REFLECTIONMAP_PROJECTION=!0;break;case f.Texture.SKYBOX_MODE:o.REFLECTIONMAP_SKYBOX=!0;break;case f.Texture.SPHERICAL_MODE:o.REFLECTIONMAP_SPHERICAL=!0;break;case f.Texture.EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case f.Texture.FIXED_EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case f.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case f.Texture.CUBIC_MODE:case f.Texture.INVCUBIC_MODE:default:o.REFLECTIONMAP_CUBIC=!0}this.reflectionFresnel?(o.REFLECTIONFRESNEL=!0,o.REFLECTIONFALLOFF=this.reflectionFalloffDistance>0,this._reflectionControls.x=this.reflectionAmount,this._reflectionControls.y=this.reflectionReflectance0,this._reflectionControls.z=this.reflectionReflectance90,this._reflectionControls.w=1/this.reflectionFalloffDistance):(o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1)}else o.REFLECTION=!1,o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1,o.REFLECTIONBLUR=!1,o.REFLECTIONMAP_3D=!1,o.REFLECTIONMAP_SPHERICAL=!1,o.REFLECTIONMAP_PLANAR=!1,o.REFLECTIONMAP_CUBIC=!1,o.REFLECTIONMAP_PROJECTION=!1,o.REFLECTIONMAP_SKYBOX=!1,o.REFLECTIONMAP_EXPLICIT=!1,o.REFLECTIONMAP_EQUIRECTANGULAR=!1,o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,o.INVERTCUBICMAP=!1,o.REFLECTIONMAP_OPPOSITEZ=!1,o.LODINREFLECTIONALPHA=!1,o.GAMMAREFLECTION=!1,o.RGBDREFLECTION=!1}o.PREMULTIPLYALPHA=this.alphaMode===p.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===p.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,o.USERGBCOLOR=this._useRGBColor,o.NOISE=this._enableNoise}if(o._areLightsDirty&&(o.USEHIGHLIGHTANDSHADOWCOLORS=!this._useRGBColor&&(0!==this._primaryColorShadowLevel||0!==this._primaryColorHighlightLevel)),o._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(o)}if(l.MaterialHelper.PrepareDefinesForMisc(e,i,!1,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),l.MaterialHelper.PrepareDefinesForFrameBoundValues(i,a,o,r),l.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 h=new v.EffectFallbacks;o.FOG&&h.addFallback(0,"FOG"),o.POINTSIZE&&h.addFallback(1,"POINTSIZE"),o.MULTIVIEW&&h.addFallback(0,"MULTIVIEW"),l.MaterialHelper.HandleFallbacksForShadows(o,h,this._maxSimultaneousLights);var m=[c.VertexBuffer.PositionKind];o.NORMAL&&m.push(c.VertexBuffer.NormalKind),o.UV1&&m.push(c.VertexBuffer.UVKind),o.UV2&&m.push(c.VertexBuffer.UV2Kind),l.MaterialHelper.PrepareAttributesForBones(m,e,o,h),l.MaterialHelper.PrepareAttributesForInstances(m,o);var _=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","mBones","vPrimaryColor","vPrimaryColorShadow","vReflectionInfos","reflectionMatrix","vReflectionMicrosurfaceInfos","fFovMultiplier","shadowLevel","alpha","vBackgroundCenter","vReflectionControl","vDiffuseInfos","diffuseMatrix"],y=["diffuseSampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh"],b=["Material","Scene"];d.ImageProcessingConfiguration&&(d.ImageProcessingConfiguration.PrepareUniforms(_,o),d.ImageProcessingConfiguration.PrepareSamplers(y,o)),l.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:_,uniformBuffersNames:b,samplers:y,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var T=o.toString();t.setEffect(i.getEngine().createEffect("background",{attributes:m,uniformsNames:_,uniformBuffersNames:b,samplers:y,defines:T,fallbacks:h,onCompiled:function(e){n.onCompiled&&n.onCompiled(e),n.bindSceneUniformBuffer(e,i.getSceneUniformBuffer())},onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},a),o),this.buildUniformLayout()}return!(!t.effect||!t.effect.isReady())&&(o._renderId=i.getRenderId(),t.effect._wasPreviouslyReady=!0,!0)},t.prototype._computePrimaryColorFromPerceptualColor=function(){this.__perceptualColor&&(this._primaryColor.copyFrom(this.__perceptualColor),this._primaryColor.toLinearSpaceToRef(this._primaryColor),this._imageProcessingConfiguration&&this._primaryColor.scaleToRef(1/this._imageProcessingConfiguration.exposure,this._primaryColor),this._computePrimaryColors())},t.prototype._computePrimaryColors=function(){0===this._primaryColorShadowLevel&&0===this._primaryColorHighlightLevel||(this._primaryColor.scaleToRef(this._primaryColorShadowLevel,this._primaryShadowColor),this._primaryColor.subtractToRef(this._primaryShadowColor,this._primaryShadowColor),this._white.subtractToRef(this._primaryColor,this._primaryHighlightColor),this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel,this._primaryHighlightColor),this._primaryColor.addToRef(this._primaryHighlightColor,this._primaryHighlightColor))},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vPrimaryColor",4),this._uniformBuffer.addUniform("vPrimaryColorShadow",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("fFovMultiplier",1),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("shadowLevel",1),this._uniformBuffer.addUniform("alpha",1),this._uniformBuffer.addUniform("vBackgroundCenter",3),this._uniformBuffer.addUniform("vReflectionControl",4),this._uniformBuffer.create()},t.prototype.unbind=function(){this._diffuseTexture&&this._diffuseTexture.isRenderTarget&&this._uniformBuffer.setTexture("diffuseSampler",null),this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindOnlyWorldMatrix=function(e){this._activeEffect.setMatrix("world",e)},t.prototype.bindForSubMesh=function(e,t,r){var n=this.getScene(),i=r._materialDefines;if(i){var o=r.effect;if(o){this._activeEffect=o,this.bindOnlyWorldMatrix(e),l.MaterialHelper.BindBonesParameters(t,this._activeEffect);var s=this._mustRebind(n,o,t.visibility);if(s){this._uniformBuffer.bindToEffect(o,"Material"),this.bindViewProjection(o);var a=this._reflectionTexture;this._uniformBuffer.useUbo&&this.isFrozen&&this._uniformBuffer.isSync||(n.texturesEnabled&&(this._diffuseTexture&&g.MaterialFlags.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),l.MaterialHelper.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse")),a&&g.MaterialFlags.ReflectionTextureEnabled&&(this._uniformBuffer.updateMatrix("reflectionMatrix",a.getReflectionTextureMatrix()),this._uniformBuffer.updateFloat2("vReflectionInfos",a.level,this._reflectionBlur),this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos",a.getSize().width,a.lodGenerationScale,a.lodGenerationOffset))),this.shadowLevel>0&&this._uniformBuffer.updateFloat("shadowLevel",this.shadowLevel),this._uniformBuffer.updateFloat("alpha",this.alpha),this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),i.USEHIGHLIGHTANDSHADOWCOLORS?(this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryHighlightColor,1),this._uniformBuffer.updateColor4("vPrimaryColorShadow",this._primaryShadowColor,1)):this._uniformBuffer.updateColor4("vPrimaryColor",this._primaryColor,1)),this._uniformBuffer.updateFloat("fFovMultiplier",this._fovMultiplier),n.texturesEnabled&&(this._diffuseTexture&&g.MaterialFlags.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("diffuseSampler",this._diffuseTexture),a&&g.MaterialFlags.ReflectionTextureEnabled&&(i.REFLECTIONBLUR&&i.TEXTURELODSUPPORT?this._uniformBuffer.setTexture("reflectionSampler",a):i.REFLECTIONBLUR?(this._uniformBuffer.setTexture("reflectionSampler",a._lodTextureMid||a),this._uniformBuffer.setTexture("reflectionSamplerLow",a._lodTextureLow||a),this._uniformBuffer.setTexture("reflectionSamplerHigh",a._lodTextureHigh||a)):this._uniformBuffer.setTexture("reflectionSampler",a),i.REFLECTIONFRESNEL&&(this._uniformBuffer.updateFloat3("vBackgroundCenter",this.sceneCenter.x,this.sceneCenter.y,this.sceneCenter.z),this._uniformBuffer.updateFloat4("vReflectionControl",this._reflectionControls.x,this._reflectionControls.y,this._reflectionControls.z,this._reflectionControls.w)))),l.MaterialHelper.BindClipPlane(this._activeEffect,n),l.MaterialHelper.BindEyePosition(o,n)}!s&&this.isFrozen||(n.lightsEnabled&&l.MaterialHelper.BindLights(n,t,this._activeEffect,i,this._maxSimultaneousLights,!1),this.bindView(o),l.MaterialHelper.BindFogParameters(n,t,this._activeEffect,!0),this._imageProcessingConfiguration&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||(this._reflectionTexture===t||this._diffuseTexture===t)},t.prototype.dispose=function(t,r){void 0===t&&(t=!1),void 0===r&&(r=!1),r&&(this.diffuseTexture&&this.diffuseTexture.dispose(),this.reflectionTexture&&this.reflectionTexture.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t)},t.prototype.clone=function(e){var r=this;return i.SerializationHelper.Clone(function(){return new t(e,r.getScene())},this)},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.BackgroundMaterial",e},t.prototype.getClassName=function(){return"BackgroundMaterial"},t.Parse=function(e,r,n){return i.SerializationHelper.Parse(function(){return new t(e.name,r)},e,r,n)},t.StandardReflectance0=.05,t.StandardReflectance90=.5,Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"_primaryColor",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],t.prototype,"__perceptualColor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_primaryColorShadowLevel",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_primaryColorHighlightLevel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColorHighlightLevel",null),Object(n.__decorate)([Object(i.serializeAsTexture)()],t.prototype,"_reflectionTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionBlur",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionBlur",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)()],t.prototype,"_diffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLights",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_shadowLevel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLevel",void 0),Object(n.__decorate)([Object(i.serializeAsVector3)()],t.prototype,"_sceneCenter",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"sceneCenter",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_opacityFresnel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityFresnel",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionFresnel",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFresnel",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionFalloffDistance",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFalloffDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionAmount",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionAmount",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionReflectance0",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance0",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_reflectionReflectance90",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance90",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_useRGBColor",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRGBColor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_enableNoise",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableNoise",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serializeAsImageProcessingConfiguration)()],t.prototype,"_imageProcessingConfiguration",void 0),t}(h.PushMaterial);m._TypeStore.RegisteredTypes["BABYLON.BackgroundMaterial"]=y},"./Materials/Background/index.ts": /*!***************************************!*\ !*** ./Materials/Background/index.ts ***! \***************************************/ /*! exports provided: BackgroundMaterial */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./backgroundMaterial */"./Materials/Background/backgroundMaterial.ts");r.d(t,"BackgroundMaterial",function(){return n.BackgroundMaterial})},"./Materials/Node/Blocks/Dual/fogBlock.ts": /*!************************************************!*\ !*** ./Materials/Node/Blocks/Dual/fogBlock.ts ***! \************************************************/ /*! exports provided: FogBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"FogBlock",function(){return h});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),s=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),a=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),c=r(/*! ../../../materialHelper */"./Materials/materialHelper.ts"),l=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),h=(r(/*! ../../../../Shaders/ShadersInclude/fogFragmentDeclaration */"./Shaders/ShadersInclude/fogFragmentDeclaration.ts"),function(e){function t(t){var r=e.call(this,t,a.NodeMaterialBlockTargets.VertexAndFragment,!0)||this;return r.registerInput("worldPosition",o.NodeMaterialBlockConnectionPointTypes.Vector4,!1,a.NodeMaterialBlockTargets.Vertex),r.registerInput("view",o.NodeMaterialBlockConnectionPointTypes.Matrix,!1,a.NodeMaterialBlockTargets.Vertex),r.registerInput("input",o.NodeMaterialBlockConnectionPointTypes.Color3,!1,a.NodeMaterialBlockTargets.Fragment),r.registerInput("fogColor",o.NodeMaterialBlockConnectionPointTypes.Color3,!1,a.NodeMaterialBlockTargets.Fragment),r.registerOutput("output",o.NodeMaterialBlockConnectionPointTypes.Color3,a.NodeMaterialBlockTargets.Fragment),r.input.acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r.fogColor.acceptedConnectionPointTypes.push(o.NodeMaterialBlockConnectionPointTypes.Color4),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"FogBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._inputs[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"input",{get:function(){return this._inputs[2]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fogColor",{get:function(){return this._inputs[3]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){return this._outputs[0]},enumerable:!0,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.view.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.systemValue===s.NodeMaterialSystemValues.View});t||(t=new l.InputBlock("view")).setAsSystemValue(s.NodeMaterialSystemValues.View),t.output.connectTo(this.view)}if(!this.fogColor.isConnected){var r=e.getInputBlockByPredicate(function(e){return e.systemValue===s.NodeMaterialSystemValues.FogColor});r||(r=new l.InputBlock("fogColor",void 0,o.NodeMaterialBlockConnectionPointTypes.Color3)).setAsSystemValue(s.NodeMaterialSystemValues.FogColor),r.output.connectTo(this.fogColor)}},t.prototype.prepareDefines=function(e,t,r){var n=e.getScene();r.setValue("FOG",t.fogEnabled&&c.MaterialHelper.GetFogState(e,n))},t.prototype.bind=function(e,t,r){if(r){var n=r.getScene();e.setFloat4(this._fogParameters,n.fogMode,n.fogStart,n.fogEnd,n.fogDensity)}},t.prototype._buildBlock=function(t){if(e.prototype._buildBlock.call(this,t),t.target===a.NodeMaterialBlockTargets.Fragment){t.sharedData.blocksWithDefines.push(this),t.sharedData.bindableBlocks.push(this),t._emitFunctionFromInclude("fogFragmentDeclaration","//"+this.name,{removeUniforms:!0,removeVaryings:!0,removeIfDef:!1,replaceStrings:[{search:/float CalcFogFactor\(\)/,replace:"float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)"}]});var r=t._getFreeVariableName("fog"),n=this.input,i=this.fogColor;this._fogParameters=t._getFreeVariableName("fogParameters");var o=this._outputs[0];t._emitUniformFromString(this._fogParameters,"vec4"),t.compilationString+="#ifdef FOG\r\n",t.compilationString+="float "+r+" = CalcFogFactor("+this._fogDistanceName+", "+this._fogParameters+");\r\n",t.compilationString+=this._declareOutput(o,t)+" = "+r+" * "+n.associatedVariableName+".rgb + (1.0 - "+r+") * "+i.associatedVariableName+".rgb;\r\n",t.compilationString+="#else\r\n"+this._declareOutput(o,t)+" = "+n.associatedVariableName+".rgb;\r\n",t.compilationString+="#endif\r\n"}else{var s=this.worldPosition,c=this.view;this._fogDistanceName=t._getFreeVariableName("vFogDistance"),t._emitVaryingFromString(this._fogDistanceName,"vec3"),t.compilationString+=this._fogDistanceName+" = ("+c.associatedVariableName+" * "+s.associatedVariableName+").xyz;\r\n"}return this},t}(i.NodeMaterialBlock));u._TypeStore.RegisteredTypes["BABYLON.FogBlock"]=h},"./Materials/Node/Blocks/Dual/index.ts": /*!*********************************************!*\ !*** ./Materials/Node/Blocks/Dual/index.ts ***! \*********************************************/ /*! exports provided: FogBlock, LightBlock, TextureBlock, ReflectionTextureBlock */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./fogBlock */"./Materials/Node/Blocks/Dual/fogBlock.ts");r.d(t,"FogBlock",function(){return n.FogBlock});var i=r(/*! ./lightBlock */"./Materials/Node/Blocks/Dual/lightBlock.ts");r.d(t,"LightBlock",function(){return i.LightBlock});var o=r(/*! ./textureBlock */"./Materials/Node/Blocks/Dual/textureBlock.ts");r.d(t,"TextureBlock",function(){return o.TextureBlock});var s=r(/*! ./reflectionTextureBlock */"./Materials/Node/Blocks/Dual/reflectionTextureBlock.ts");r.d(t,"ReflectionTextureBlock",function(){return s.ReflectionTextureBlock})},"./Materials/Node/Blocks/Dual/lightBlock.ts": /*!**************************************************!*\ !*** ./Materials/Node/Blocks/Dual/lightBlock.ts ***! \**************************************************/ /*! exports provided: LightBlock */function(e,t,r){"use strict";r.r(t),r.d(t,"LightBlock",function(){return h});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../nodeMaterialBlock */"./Materials/Node/nodeMaterialBlock.ts"),o=r(/*! ../../Enums/nodeMaterialBlockTargets */"./Materials/Node/Enums/nodeMaterialBlockTargets.ts"),s=r(/*! ../../Enums/nodeMaterialBlockConnectionPointTypes */"./Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.ts"),a=r(/*! ../../../materialHelper */"./Materials/materialHelper.ts"),c=r(/*! ../../Enums/nodeMaterialSystemValues */"./Materials/Node/Enums/nodeMaterialSystemValues.ts"),l=r(/*! ../Input/inputBlock */"./Materials/Node/Blocks/Input/inputBlock.ts"),u=r(/*! ../../../../Misc/typeStore */"./Misc/typeStore.ts"),h=(r(/*! ../../../../Shaders/ShadersInclude/lightFragmentDeclaration */"./Shaders/ShadersInclude/lightFragmentDeclaration.ts"),r(/*! ../../../../Shaders/ShadersInclude/lightUboDeclaration */"./Shaders/ShadersInclude/lightUboDeclaration.ts"),r(/*! ../../../../Shaders/ShadersInclude/lightFragment */"./Shaders/ShadersInclude/lightFragment.ts"),r(/*! ../../../../Shaders/ShadersInclude/helperFunctions */"./Shaders/ShadersInclude/helperFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/lightsFragmentFunctions */"./Shaders/ShadersInclude/lightsFragmentFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/shadowsFragmentFunctions */"./Shaders/ShadersInclude/shadowsFragmentFunctions.ts"),r(/*! ../../../../Shaders/ShadersInclude/shadowsVertex */"./Shaders/ShadersInclude/shadowsVertex.ts"),function(e){function t(t){var r=e.call(this,t,o.NodeMaterialBlockTargets.VertexAndFragment)||this;return r._isUnique=!0,r.registerInput("worldPosition",s.NodeMaterialBlockConnectionPointTypes.Vector4,!1,o.NodeMaterialBlockTargets.Vertex),r.registerInput("worldNormal",s.NodeMaterialBlockConnectionPointTypes.Vector4,!1,o.NodeMaterialBlockTargets.Fragment),r.registerInput("cameraPosition",s.NodeMaterialBlockConnectionPointTypes.Vector3,!1,o.NodeMaterialBlockTargets.Fragment),r.registerInput("glossiness",s.NodeMaterialBlockConnectionPointTypes.Float,!0,o.NodeMaterialBlockTargets.Fragment),r.registerInput("glossPower",s.NodeMaterialBlockConnectionPointTypes.Float,!0,o.NodeMaterialBlockTargets.Fragment),r.registerInput("diffuseColor",s.NodeMaterialBlockConnectionPointTypes.Color3,!0,o.NodeMaterialBlockTargets.Fragment),r.registerInput("specularColor",s.NodeMaterialBlockConnectionPointTypes.Color3,!0,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("diffuseOutput",s.NodeMaterialBlockConnectionPointTypes.Color3,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("specularOutput",s.NodeMaterialBlockConnectionPointTypes.Color3,o.NodeMaterialBlockTargets.Fragment),r.registerOutput("shadow",s.NodeMaterialBlockConnectionPointTypes.Float,o.NodeMaterialBlockTargets.Fragment),r}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"LightBlock"},Object.defineProperty(t.prototype,"worldPosition",{get:function(){return this._inputs[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"worldNormal",{get:function(){return this._inputs[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cameraPosition",{get:function(){return this._inputs[2]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"glossiness",{get:function(){return this._inputs[3]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"glossPower",{get:function(){return this._inputs[4]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"diffuseColor",{get:function(){return this._inputs[5]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"specularColor",{get:function(){return this._inputs[6]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"diffuseOutput",{get:function(){return this._outputs[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"specularOutput",{get:function(){return this._outputs[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadow",{get:function(){return this._outputs[2]},enumerable:!0,configurable:!0}),t.prototype.autoConfigure=function(e){if(!this.cameraPosition.isConnected){var t=e.getInputBlockByPredicate(function(e){return e.systemValue===c.NodeMaterialSystemValues.CameraPosition});t||(t=new l.InputBlock("cameraPosition")).setAsSystemValue(c.NodeMaterialSystemValues.CameraPosition),t.output.connectTo(this.cameraPosition)}},t.prototype.prepareDefines=function(e,t,r){if(r._areLightsDirty){var n=e.getScene();if(this.light){var i={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};a.MaterialHelper.PrepareDefinesForLight(n,e,this.light,this._lightId,r,!0,i),i.needRebuild&&r.rebuild()}else a.MaterialHelper.PrepareDefinesForLights(n,e,r,!0,t.maxSimultaneousLights)}},t.prototype.updateUniformsAndSamples=function(e,t,r,n){for(var i=0;i0&&a.MaterialHelper.BindMorphTargetParameters(r,e)},t.prototype.replaceRepeatableContent=function(e,t,r,n){for(var i=this.position,o=this.normal,s=this.tangent,a=this.uv,l=this.positionOutput,u=this.normalOutput,h=this.tangentOutput,d=this.uvOutput,f=e,p=n.NUM_MORPH_INFLUENCERS,m=r.morphTargetManager,g=m&&m.supportsNormals&&n.NORMAL,_=m&&m.supportsTangents&&n.TANGENT,v=m&&m.supportsUVs&&n.UV1,A="",y=0;y0)for(y=0;y-1))return this._optimizers.push(e),this},t.prototype.unregisterOptimizer=function(e){var t=this._optimizers.indexOf(e);if(-1!==t)return this._optimizers.splice(t,1),this},t.prototype.addOutputNode=function(e){if(null===e.target)throw"This node is not meant to be an output node. You may want to explicitly set its target value.";return 0!=(e.target&u.NodeMaterialBlockTargets.Vertex)&&this._addVertexOutputNode(e),0!=(e.target&u.NodeMaterialBlockTargets.Fragment)&&this._addFragmentOutputNode(e),this},t.prototype.removeOutputNode=function(e){return null===e.target?this:(0!=(e.target&u.NodeMaterialBlockTargets.Vertex)&&this._removeVertexOutputNode(e),0!=(e.target&u.NodeMaterialBlockTargets.Fragment)&&this._removeFragmentOutputNode(e),this)},t.prototype._addVertexOutputNode=function(e){if(-1===this._vertexOutputNodes.indexOf(e))return e.target=u.NodeMaterialBlockTargets.Vertex,this._vertexOutputNodes.push(e),this},t.prototype._removeVertexOutputNode=function(e){var t=this._vertexOutputNodes.indexOf(e);if(-1!==t)return this._vertexOutputNodes.splice(t,1),this},t.prototype._addFragmentOutputNode=function(e){if(-1===this._fragmentOutputNodes.indexOf(e))return e.target=u.NodeMaterialBlockTargets.Fragment,this._fragmentOutputNodes.push(e),this},t.prototype._removeFragmentOutputNode=function(e){var t=this._fragmentOutputNodes.indexOf(e);if(-1!==t)return this._fragmentOutputNodes.splice(t,1),this},t.prototype.needAlphaBlending=function(){return!this.ignoreAlpha&&(this.alpha<1||this._sharedData&&this._sharedData.hints.needAlphaBlending)},t.prototype.needAlphaTesting=function(){return this._sharedData&&this._sharedData.hints.needAlphaTesting},t.prototype._initializeBlock=function(e,t,r){if(e.initialize(t),e.autoConfigure(this),e._preparationId=this._buildId,-1===this.attachedBlocks.indexOf(e)){if(e.isUnique)for(var n=e.getClassName(),i=0,o=this.attachedBlocks;i-1&&this.attachedBlocks.splice(t,1),e.isFinalMerger&&this.removeOutputNode(e)},t.prototype.build=function(e){void 0===e&&(e=!1),this._buildWasSuccessful=!1;var r=this.getScene().getEngine();if(0===this._vertexOutputNodes.length)throw"You must define at least one vertexOutputNode";if(0===this._fragmentOutputNodes.length)throw"You must define at least one fragmentOutputNode";this._vertexCompilationState=new c.NodeMaterialBuildState,this._vertexCompilationState.supportUniformBuffers=r.supportsUniformBuffers,this._vertexCompilationState.target=u.NodeMaterialBlockTargets.Vertex,this._fragmentCompilationState=new c.NodeMaterialBuildState,this._fragmentCompilationState.supportUniformBuffers=r.supportsUniformBuffers,this._fragmentCompilationState.target=u.NodeMaterialBlockTargets.Fragment,this._sharedData=new h.NodeMaterialBuildStateSharedData,this._vertexCompilationState.sharedData=this._sharedData,this._fragmentCompilationState.sharedData=this._sharedData,this._sharedData.buildId=this._buildId,this._sharedData.emitComments=this._options.emitComments,this._sharedData.verbose=e,this._sharedData.scene=this.getScene();for(var n=[],i=[],o=0,s=this._vertexOutputNodes;o=this._outputs.length?null:this._outputs[t+1]},e.prototype.connectTo=function(e,t){if(0!==this._outputs.length){for(var r=t&&t.output?this.getOutputByName(t.output):this.getFirstAvailableOutput(e),n=!0;n;){var i=t&&t.input?e.getInputByName(t.input):e.getFirstAvailableInput(r);if(r&&i&&r.canConnectTo(i))r.connectTo(i),n=!1;else{if(!r)throw"Unable to find a compatible match";r=this.getSiblingOutput(r)}}return this}},e.prototype._buildBlock=function(e){},e.prototype.updateUniformsAndSamples=function(e,t,r,n){},e.prototype.provideFallbacks=function(e,t){},e.prototype.initializeDefines=function(e,t,r,n){void 0===n&&(n=!1)},e.prototype.prepareDefines=function(e,t,r,n){void 0===n&&(n=!1)},e.prototype.autoConfigure=function(e){},e.prototype.replaceRepeatableContent=function(e,t,r,n){},e.prototype.isReady=function(e,t,r,n){return void 0===n&&(n=!1),!0},e.prototype._linkConnectionTypes=function(e,t){this._inputs[e]._linkedConnectionSource=this._inputs[t],this._inputs[t]._linkedConnectionSource=this._inputs[e]},e.prototype._processBuild=function(e,t,r,n){e.build(t,n);var i=null!=t._vertexState,s=e._buildTarget===o.NodeMaterialBlockTargets.Vertex&&e.target!==o.NodeMaterialBlockTargets.VertexAndFragment;if(i&&(0==(e.target&e._buildTarget)||0==(e.target&r.target)||this.target!==o.NodeMaterialBlockTargets.VertexAndFragment&&s)&&(!e.isInput&&t.target!==e._buildTarget||e.isInput&&e.isAttribute)){var a=r.connectedPoint;t._vertexState._emitVaryingFromString("v_"+a.associatedVariableName,t._getGLType(a.type))&&(t._vertexState.compilationString+="v_"+a.associatedVariableName+" = "+a.associatedVariableName+";\r\n"),r.associatedVariableName="v_"+a.associatedVariableName,r._enforceAssociatedVariableName=!0}},e.prototype.build=function(e,t){if(this._buildId===e.sharedData.buildId)return!0;if(!this.isInput)for(var r=0,n=this._outputs;r0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isConnectedInVertexShader",{get:function(){if(this.target===s.NodeMaterialBlockTargets.Vertex)return!0;if(!this.hasEndpoints)return!1;for(var e=0,t=this._endpoints;e[0.."+r.repeatKey+"]\r\n";var n=o.Effect.IncludesShadersStore[e]+"\r\n";if(this.sharedData.emitComments&&(n=t+"\r\n"+n),!r)return n;if(r.replaceStrings)for(var i=0;i[0.."+r.repeatKey+"]\r\n":this.functions[i]="#include<"+e+">\r\n",void(this.sharedData.emitComments&&(this.functions[i]=t+"\r\n"+this.functions[i]));if(this.functions[i]=o.Effect.IncludesShadersStore[e],this.sharedData.emitComments&&(this.functions[i]=t+"\r\n"+this.functions[i]),r.removeIfDef&&(this.functions[i]=this.functions[i].replace(/^\s*?#ifdef.+$/gm,""),this.functions[i]=this.functions[i].replace(/^\s*?#endif.*$/gm,""),this.functions[i]=this.functions[i].replace(/^\s*?#else.*$/gm,""),this.functions[i]=this.functions[i].replace(/^\s*?#elif.*$/gm,"")),r.removeAttributes&&(this.functions[i]=this.functions[i].replace(/^\s*?attribute.+$/gm,"")),r.removeUniforms&&(this.functions[i]=this.functions[i].replace(/^\s*?uniform.+$/gm,"")),r.removeVaryings&&(this.functions[i]=this.functions[i].replace(/^\s*?varying.+$/gm,"")),r.replaceStrings)for(var s=0;s0&&e.push(this._texture)},e.prototype.dispose=function(e){e&&this._texture&&this._texture.dispose()},e.prototype.getClassName=function(){return"PBRAnisotropicConfiguration"},e.AddFallbacks=function(e,t,r){return e.ANISOTROPIC&&t.addFallback(r++,"ANISOTROPIC"),r},e.AddUniforms=function(e){e.push("vAnisotropy","vAnisotropyInfos","anisotropyMatrix")},e.PrepareUniformBuffer=function(e){e.addUniform("vAnisotropy",3),e.addUniform("vAnisotropyInfos",2),e.addUniform("anisotropyMatrix",16)},e.AddSamplers=function(e){e.push("anisotropySampler")},e.prototype.copyTo=function(e){i.SerializationHelper.Clone(function(){return e},this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse(function(){return n},e,t,r)},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"intensity",void 0),Object(n.__decorate)([Object(i.serializeAsVector2)()],e.prototype,"direction",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),e}()},"./Materials/PBR/pbrBRDFConfiguration.ts": /*!***********************************************!*\ !*** ./Materials/PBR/pbrBRDFConfiguration.ts ***! \***********************************************/ /*! exports provided: PBRBRDFConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRBRDFConfiguration",function(){return o});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=function(){function e(t){this._useEnergyConservation=e.DEFAULT_USE_ENERGY_CONSERVATION,this.useEnergyConservation=e.DEFAULT_USE_ENERGY_CONSERVATION,this._useSmithVisibilityHeightCorrelated=e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this.useSmithVisibilityHeightCorrelated=e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this._useSphericalHarmonics=e.DEFAULT_USE_SPHERICAL_HARMONICS,this.useSphericalHarmonics=e.DEFAULT_USE_SPHERICAL_HARMONICS,this._useSpecularGlossinessInputEnergyConservation=e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this.useSpecularGlossinessInputEnergyConservation=e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this._internalMarkAllSubMeshesAsMiscDirty=t}return e.prototype._markAllSubMeshesAsMiscDirty=function(){this._internalMarkAllSubMeshesAsMiscDirty()},e.prototype.prepareDefines=function(e){e.BRDF_V_HEIGHT_CORRELATED=this._useSmithVisibilityHeightCorrelated,e.MS_BRDF_ENERGY_CONSERVATION=this._useEnergyConservation&&this._useSmithVisibilityHeightCorrelated,e.SPHERICAL_HARMONICS=this._useSphericalHarmonics,e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=this._useSpecularGlossinessInputEnergyConservation},e.prototype.getClassName=function(){return"PBRBRDFConfiguration"},e.prototype.copyTo=function(e){i.SerializationHelper.Clone(function(){return e},this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse(function(){return n},e,t,r)},e.DEFAULT_USE_ENERGY_CONSERVATION=!0,e.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED=!0,e.DEFAULT_USE_SPHERICAL_HARMONICS=!0,e.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION=!0,Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useEnergyConservation",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSmithVisibilityHeightCorrelated",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSphericalHarmonics",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],e.prototype,"useSpecularGlossinessInputEnergyConservation",void 0),e}()},"./Materials/PBR/pbrBaseMaterial.ts": /*!******************************************!*\ !*** ./Materials/PBR/pbrBaseMaterial.ts ***! \******************************************/ /*! exports provided: PBRMaterialDefines, PBRBaseMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRMaterialDefines",function(){return P}),r.d(t,"PBRBaseMaterial",function(){return E});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.vector */"./Maths/math.vector.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"),m=r(/*! ./pbrSubSurfaceConfiguration */"./Materials/PBR/pbrSubSurfaceConfiguration.ts"),g=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),_=r(/*! ../../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),v=r(/*! ../../Materials/materialDefines */"./Materials/materialDefines.ts"),A=r(/*! ../../Materials/pushMaterial */"./Materials/pushMaterial.ts"),y=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),b=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),T=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),M=r(/*! ../../Engines/constants */"./Engines/constants.ts"),x=(r(/*! ../../Materials/Textures/baseTexture.polynomial */"./Materials/Textures/baseTexture.polynomial.ts"),r(/*! ../../Shaders/pbr.fragment */"./Shaders/pbr.fragment.ts"),r(/*! ../../Shaders/pbr.vertex */"./Shaders/pbr.vertex.ts"),r(/*! ../effectFallbacks */"./Materials/effectFallbacks.ts")),P=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.GAMMAALBEDO=!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.METALLICF0FACTORFROMMETALLICMAP=!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.RGBDLIGHTMAP=!1,t.REFLECTION=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.USESPHERICALFROMREFLECTIONMAP=!1,t.USEIRRADIANCEMAP=!1,t.SPHERICAL_HARMONICS=!1,t.USESPHERICALINVERTEX=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDREFLECTION=!1,t.LINEARSPECULARREFLECTION=!1,t.RADIANCEOCCLUSION=!1,t.HORIZONOCCLUSION=!1,t.INSTANCES=!1,t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,t.BONETEXTURE=!1,t.NONUNIFORMSCALING=!1,t.MORPHTARGETS=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_UV=!1,t.NUM_MORPH_INFLUENCERS=0,t.IMAGEPROCESSING=!1,t.VIGNETTE=!1,t.VIGNETTEBLENDMODEMULTIPLY=!1,t.VIGNETTEBLENDMODEOPAQUE=!1,t.TONEMAPPING=!1,t.TONEMAPPING_ACES=!1,t.CONTRAST=!1,t.COLORCURVES=!1,t.COLORGRADING=!1,t.COLORGRADING3D=!1,t.SAMPLER3DGREENDEPTH=!1,t.SAMPLER3DBGRMAP=!1,t.IMAGEPROCESSINGPOSTPROCESS=!1,t.EXPOSURE=!1,t.MULTIVIEW=!1,t.USEPHYSICALLIGHTFALLOFF=!1,t.USEGLTFLIGHTFALLOFF=!1,t.TWOSIDEDLIGHTING=!1,t.SHADOWFLOAT=!1,t.CLIPPLANE=!1,t.CLIPPLANE2=!1,t.CLIPPLANE3=!1,t.CLIPPLANE4=!1,t.CLIPPLANE5=!1,t.CLIPPLANE6=!1,t.POINTSIZE=!1,t.FOG=!1,t.LOGARITHMICDEPTH=!1,t.FORCENORMALFORWARD=!1,t.SPECULARAA=!1,t.CLEARCOAT=!1,t.CLEARCOAT_DEFAULTIOR=!1,t.CLEARCOAT_TEXTURE=!1,t.CLEARCOAT_TEXTUREDIRECTUV=0,t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_BUMPDIRECTUV=0,t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1,t.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,t.ANISOTROPIC=!1,t.ANISOTROPIC_TEXTURE=!1,t.ANISOTROPIC_TEXTUREDIRECTUV=0,t.BRDF_V_HEIGHT_CORRELATED=!1,t.MS_BRDF_ENERGY_CONSERVATION=!1,t.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!1,t.SHEEN=!1,t.SHEEN_TEXTURE=!1,t.SHEEN_TEXTUREDIRECTUV=0,t.SHEEN_LINKWITHALBEDO=!1,t.SUBSURFACE=!1,t.SS_REFRACTION=!1,t.SS_TRANSLUCENCY=!1,t.SS_SCATERRING=!1,t.SS_THICKNESSANDMASK_TEXTURE=!1,t.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,t.SS_REFRACTIONMAP_3D=!1,t.SS_REFRACTIONMAP_OPPOSITEZ=!1,t.SS_LODINREFRACTIONALPHA=!1,t.SS_GAMMAREFRACTION=!1,t.SS_RGBDREFRACTION=!1,t.SS_LINEARSPECULARREFRACTION=!1,t.SS_LINKREFRACTIONTOTRANSPARENCY=!1,t.SS_MASK_FROM_THICKNESS_TEXTURE=!1,t.UNLIT=!1,t.DEBUGMODE=0,t.rebuild(),t}return Object(n.__extends)(t,e),t.prototype.reset=function(){e.prototype.reset.call(this),this.ALPHATESTVALUE="0.5",this.PBR=!0},t}(v.MaterialDefines),E=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._albedoTexture=null,i._ambientTexture=null,i._ambientTextureStrength=1,i._ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,i._opacityTexture=null,i._reflectionTexture=null,i._emissiveTexture=null,i._reflectivityTexture=null,i._metallicTexture=null,i._metallic=null,i._roughness=null,i._metallicF0Factor=.5,i._useMetallicF0FactorFromMetallicTexture=!1,i._microSurfaceTexture=null,i._bumpTexture=null,i._lightmapTexture=null,i._ambientColor=new g.Color3(0,0,0),i._albedoColor=new g.Color3(1,1,1),i._reflectivityColor=new g.Color3(1,1,1),i._reflectionColor=new g.Color3(1,1,1),i._emissiveColor=new g.Color3(0,0,0),i._microSurface=.9,i._useLightmapAsShadowmap=!1,i._useHorizonOcclusion=!0,i._useRadianceOcclusion=!0,i._useAlphaFromAlbedoTexture=!1,i._useSpecularOverAlpha=!0,i._useMicroSurfaceFromReflectivityMapAlpha=!1,i._useRoughnessFromMetallicTextureAlpha=!0,i._useRoughnessFromMetallicTextureGreen=!1,i._useMetallnessFromMetallicTextureBlue=!1,i._useAmbientOcclusionFromMetallicTextureRed=!1,i._useAmbientInGrayScale=!1,i._useAutoMicroSurfaceFromReflectivityMap=!1,i._lightFalloff=t.LIGHTFALLOFF_PHYSICAL,i._useRadianceOverAlpha=!0,i._useObjectSpaceNormalMap=!1,i._useParallax=!1,i._useParallaxOcclusion=!1,i._parallaxScaleBias=.05,i._disableLighting=!1,i._maxSimultaneousLights=4,i._invertNormalMapX=!1,i._invertNormalMapY=!1,i._twoSidedLighting=!1,i._alphaCutOff=.4,i._forceAlphaTest=!1,i._useAlphaFresnel=!1,i._useLinearAlphaFresnel=!1,i._transparencyMode=null,i._environmentBRDFTexture=null,i._forceIrradianceInFragment=!1,i._forceNormalForward=!1,i._enableSpecularAntiAliasing=!1,i._imageProcessingObserver=null,i._renderTargets=new s.SmartArray(16),i._globalAmbientColor=new g.Color3(0,0,0),i._useLogarithmicDepth=!1,i._unlit=!1,i._debugMode=0,i.debugMode=0,i.debugLimit=-1,i.debugFactor=1,i.clearCoat=new 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.subSurface=new m.PBRSubSurfaceConfiguration(i._markAllSubMeshesAsTexturesDirty.bind(i)),i._rebuildInParallel=!1,i._attachImageProcessingConfiguration(null),i.getRenderTargetTextures=function(){return i._renderTargets.reset(),T.MaterialFlags.ReflectionTextureEnabled&&i._reflectionTexture&&i._reflectionTexture.isRenderTarget&&i._renderTargets.push(i._reflectionTexture),i.subSurface.fillRenderTargetTextures(i._renderTargets),i._renderTargets},i._environmentBRDFTexture=a.BRDFTextureTools.GetEnvironmentBRDFTexture(n),i}return Object(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!!(T.MaterialFlags.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget)||this.subSurface.hasRenderTargetTextures()},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseMaterial"},Object.defineProperty(t.prototype,"useLogarithmicDepth",{get:function(){return this._useLogarithmicDepth},set:function(e){this._useLogarithmicDepth=e&&this.getScene().getEngine().getCaps().fragmentDepthSupported},enumerable:!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.subSurface.disableAlphaBlending||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.subSurface.disableAlphaBlending&&(null!=this._albedoTexture&&this._albedoTexture.hasAlpha&&(null==this._transparencyMode||this._transparencyMode===t.PBRMATERIAL_ALPHATEST))},t.prototype._shouldUseAlphaFromAlbedoTexture=function(){return null!=this._albedoTexture&&this._albedoTexture.hasAlpha&&this._useAlphaFromAlbedoTexture&&this._transparencyMode!==t.PBRMATERIAL_OPAQUE},t.prototype.getAlphaTestTexture=function(){return this._albedoTexture},t.prototype.isReadyForSubMesh=function(e,t,r){if(t.effect&&this.isFrozen&&t.effect._wasPreviouslyReady)return!0;t._materialDefines||(t._materialDefines=new P);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&&T.MaterialFlags.DiffuseTextureEnabled&&!this._albedoTexture.isReadyOrNotBlocking())return!1;if(this._ambientTexture&&T.MaterialFlags.AmbientTextureEnabled&&!this._ambientTexture.isReadyOrNotBlocking())return!1;if(this._opacityTexture&&T.MaterialFlags.OpacityTextureEnabled&&!this._opacityTexture.isReadyOrNotBlocking())return!1;var a=this._getReflectionTexture();if(a&&T.MaterialFlags.ReflectionTextureEnabled){if(!a.isReadyOrNotBlocking())return!1;if(a.irradianceTexture&&!a.irradianceTexture.isReadyOrNotBlocking())return!1}if(this._lightmapTexture&&T.MaterialFlags.LightmapTextureEnabled&&!this._lightmapTexture.isReadyOrNotBlocking())return!1;if(this._emissiveTexture&&T.MaterialFlags.EmissiveTextureEnabled&&!this._emissiveTexture.isReadyOrNotBlocking())return!1;if(T.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&&T.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&!this._bumpTexture.isReady())return!1;if(this._environmentBRDFTexture&&T.MaterialFlags.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady())return!1}if(!(this.subSurface.isReadyForSubMesh(n,i)&&this.clearCoat.isReadyForSubMesh(n,i,s,this._disableBumpMap)&&this.sheen.isReadyForSubMesh(n,i)&&this.anisotropy.isReadyForSubMesh(n,i)))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 c=t.effect,l=n._areLightsDisposed,h=this._prepareEffect(e,n,this.onCompiled,this.onError,r);if(h)if(this.allowShaderHotSwapping&&c&&!h.isReady()){if(h=c,this._rebuildInParallel=!0,n.markAsUnprocessed(),l)return n._areLightsDisposed=!0,!1}else this._rebuildInParallel=!1,i.resetCachedMaterial(),t.setEffect(h,n),this.buildUniformLayout();return!(!t.effect||!t.effect.isReady())&&(n._renderId=i.getRenderId(),t.effect._wasPreviouslyReady=!0,!0)},t.prototype.isMetallicWorkflow=function(){return!(null==this._metallic&&null==this._roughness&&!this._metallicTexture)},t.prototype._prepareEffect=function(e,t,r,n,i,o){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 x.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=d.PBRAnisotropicConfiguration.AddFallbacks(t,a,c),c=m.PBRSubSurfaceConfiguration.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=y.MaterialHelper.HandleFallbacksForShadows(t,a,this._maxSimultaneousLights,c++),t.SPECULARTERM&&a.addFallback(c++,"SPECULARTERM"),t.USESPHERICALFROMREFLECTIONMAP&&a.addFallback(c++,"USESPHERICALFROMREFLECTIONMAP"),t.USEIRRADIANCEMAP&&a.addFallback(c++,"USEIRRADIANCEMAP"),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.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),y.MaterialHelper.PrepareAttributesForBones(l,e,t,a),y.MaterialHelper.PrepareAttributesForInstances(l,t),y.MaterialHelper.PrepareAttributesForMorphTargets(l,e,t);var f="pbr",g=["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","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","vClipPlane5","vClipPlane6","albedoMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","vLightingIntensity","logarithmicDepthConstant","vSphericalX","vSphericalY","vSphericalZ","vSphericalXX_ZZ","vSphericalYY_ZZ","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vSphericalL00","vSphericalL1_1","vSphericalL10","vSphericalL11","vSphericalL2_2","vSphericalL2_1","vSphericalL20","vSphericalL21","vSphericalL22","vReflectionMicrosurfaceInfos","vTangentSpaceParams","boneTextureWidth","vDebugMode"],v=["albedoSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","irradianceSampler","microSurfaceSampler","environmentBrdfSampler","boneSampler"],A=["Material","Scene"];m.PBRSubSurfaceConfiguration.AddUniforms(g),m.PBRSubSurfaceConfiguration.AddSamplers(v),h.PBRClearCoatConfiguration.AddUniforms(g),h.PBRClearCoatConfiguration.AddSamplers(v),d.PBRAnisotropicConfiguration.AddUniforms(g),d.PBRAnisotropicConfiguration.AddSamplers(v),p.PBRSheenConfiguration.AddUniforms(g),p.PBRSheenConfiguration.AddSamplers(v),_.ImageProcessingConfiguration&&(_.ImageProcessingConfiguration.PrepareUniforms(g,t),_.ImageProcessingConfiguration.PrepareSamplers(v,t)),y.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:g,uniformBuffersNames:A,samplers:v,defines:t,maxSimultaneousLights:this._maxSimultaneousLights}),this.customShaderNameResolve&&(f=this.customShaderNameResolve(f,g,A,v,t));var b=t.toString();return s.createEffect(f,{attributes:l,uniformsNames:g,uniformBuffersNames:A,samplers:v,defines:b,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(y.MaterialHelper.PrepareDefinesForLights(o,e,r,!0,this._maxSimultaneousLights,this._disableLighting),r._needNormals=!0,y.MaterialHelper.PrepareDefinesForMultiview(o,r),r.METALLICWORKFLOW=this.isMetallicWorkflow(),r._areTexturesDirty){if(r._needUVs=!1,o.texturesEnabled){o.getEngine().getCaps().textureLOD&&(r.LODBASEDMICROSFURACE=!0),this._albedoTexture&&T.MaterialFlags.DiffuseTextureEnabled?(y.MaterialHelper.PrepareDefinesForMergedUV(this._albedoTexture,r,"ALBEDO"),r.GAMMAALBEDO=this._albedoTexture.gammaSpace):r.ALBEDO=!1,this._ambientTexture&&T.MaterialFlags.AmbientTextureEnabled?(y.MaterialHelper.PrepareDefinesForMergedUV(this._ambientTexture,r,"AMBIENT"),r.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):r.AMBIENT=!1,this._opacityTexture&&T.MaterialFlags.OpacityTextureEnabled?(y.MaterialHelper.PrepareDefinesForMergedUV(this._opacityTexture,r,"OPACITY"),r.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):r.OPACITY=!1;var a=this._getReflectionTexture();if(a&&T.MaterialFlags.ReflectionTextureEnabled){switch(r.REFLECTION=!0,r.GAMMAREFLECTION=a.gammaSpace,r.RGBDREFLECTION=a.isRGBD,r.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!a.invertZ:a.invertZ,r.LODINREFLECTIONALPHA=a.lodLevelInAlpha,r.LINEARSPECULARREFLECTION=a.linearSpecularLOD,a.coordinatesMode===b.Texture.INVCUBIC_MODE&&(r.INVERTCUBICMAP=!0),r.REFLECTIONMAP_3D=a.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,a.coordinatesMode){case b.Texture.EXPLICIT_MODE:r.REFLECTIONMAP_EXPLICIT=!0;break;case b.Texture.PLANAR_MODE:r.REFLECTIONMAP_PLANAR=!0;break;case b.Texture.PROJECTION_MODE:r.REFLECTIONMAP_PROJECTION=!0;break;case b.Texture.SKYBOX_MODE:r.REFLECTIONMAP_SKYBOX=!0;break;case b.Texture.SPHERICAL_MODE:r.REFLECTIONMAP_SPHERICAL=!0;break;case b.Texture.EQUIRECTANGULAR_MODE:r.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case b.Texture.FIXED_EQUIRECTANGULAR_MODE:r.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case b.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:r.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case b.Texture.CUBIC_MODE:case b.Texture.INVCUBIC_MODE:default:r.REFLECTIONMAP_CUBIC=!0,r.USE_LOCAL_REFLECTIONMAP_CUBIC=!!a.boundingBoxSize}a.coordinatesMode!==b.Texture.SKYBOX_MODE&&(a.irradianceTexture?(r.USEIRRADIANCEMAP=!0,r.USESPHERICALFROMREFLECTIONMAP=!1):a.isCube&&(r.USESPHERICALFROMREFLECTIONMAP=!0,r.USEIRRADIANCEMAP=!1,this._forceIrradianceInFragment||o.getEngine().getCaps().maxVaryingVectors<=8?r.USESPHERICALINVERTEX=!1:r.USESPHERICALINVERTEX=!0))}else r.REFLECTION=!1,r.REFLECTIONMAP_3D=!1,r.REFLECTIONMAP_SPHERICAL=!1,r.REFLECTIONMAP_PLANAR=!1,r.REFLECTIONMAP_CUBIC=!1,r.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,r.REFLECTIONMAP_PROJECTION=!1,r.REFLECTIONMAP_SKYBOX=!1,r.REFLECTIONMAP_EXPLICIT=!1,r.REFLECTIONMAP_EQUIRECTANGULAR=!1,r.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,r.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,r.INVERTCUBICMAP=!1,r.USESPHERICALFROMREFLECTIONMAP=!1,r.USEIRRADIANCEMAP=!1,r.USESPHERICALINVERTEX=!1,r.REFLECTIONMAP_OPPOSITEZ=!1,r.LODINREFLECTIONALPHA=!1,r.GAMMAREFLECTION=!1,r.RGBDREFLECTION=!1,r.LINEARSPECULARREFLECTION=!1;this._lightmapTexture&&T.MaterialFlags.LightmapTextureEnabled?(y.MaterialHelper.PrepareDefinesForMergedUV(this._lightmapTexture,r,"LIGHTMAP"),r.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,r.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace,r.RGBDLIGHTMAP=this._lightmapTexture.isRGBD):r.LIGHTMAP=!1,this._emissiveTexture&&T.MaterialFlags.EmissiveTextureEnabled?y.MaterialHelper.PrepareDefinesForMergedUV(this._emissiveTexture,r,"EMISSIVE"):r.EMISSIVE=!1,T.MaterialFlags.SpecularTextureEnabled?(this._metallicTexture?(y.MaterialHelper.PrepareDefinesForMergedUV(this._metallicTexture,r,"REFLECTIVITY"),r.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,r.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,r.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,r.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed,r.METALLICF0FACTORFROMMETALLICMAP=this._useMetallicF0FactorFromMetallicTexture):this._reflectivityTexture?(y.MaterialHelper.PrepareDefinesForMergedUV(this._reflectivityTexture,r,"REFLECTIVITY"),r.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,r.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap):r.REFLECTIVITY=!1,this._microSurfaceTexture?y.MaterialHelper.PrepareDefinesForMergedUV(this._microSurfaceTexture,r,"MICROSURFACEMAP"):r.MICROSURFACEMAP=!1):(r.REFLECTIVITY=!1,r.MICROSURFACEMAP=!1),o.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&T.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap?(y.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture,r,"BUMP"),this._useParallax&&this._albedoTexture&&T.MaterialFlags.DiffuseTextureEnabled?(r.PARALLAX=!0,r.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):r.PARALLAX=!1,r.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):r.BUMP=!1,this._environmentBRDFTexture&&T.MaterialFlags.ReflectionTextureEnabled?(r.ENVIRONMENTBRDF=!0,r.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(r.ENVIRONMENTBRDF=!1,r.ENVIRONMENTBRDF_RGBD=!1),this._shouldUseAlphaFromAlbedoTexture()?r.ALPHAFROMALBEDO=!0:r.ALPHAFROMALBEDO=!1}r.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===t.LIGHTFALLOFF_STANDARD?(r.USEPHYSICALLIGHTFALLOFF=!1,r.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===t.LIGHTFALLOFF_GLTF?(r.USEPHYSICALLIGHTFALLOFF=!1,r.USEGLTFLIGHTFALLOFF=!0):(r.USEPHYSICALLIGHTFALLOFF=!0,r.USEGLTFLIGHTFALLOFF=!1),r.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?r.TWOSIDEDLIGHTING=!0:r.TWOSIDEDLIGHTING=!1,r.SPECULARAA=o.getEngine().getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(r._areTexturesDirty||r._areMiscDirty)&&(r.ALPHATESTVALUE=this._alphaCutOff+(this._alphaCutOff%1==0?".":""),r.PREMULTIPLYALPHA=this.alphaMode===M.Constants.ALPHA_PREMULTIPLIED||this.alphaMode===M.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF,r.ALPHABLEND=this.needAlphaBlendingForMesh(e),r.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,r.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel),r._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(r),r.FORCENORMALFORWARD=this._forceNormalForward,r.RADIANCEOCCLUSION=this._useRadianceOcclusion,r.HORIZONOCCLUSION=this._useHorizonOcclusion,r._areMiscDirty&&(y.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.subSurface.prepareDefines(r,o),this.clearCoat.prepareDefines(r,o),this.anisotropy.prepareDefines(r,e,o),this.brdf.prepareDefines(r),this.sheen.prepareDefines(r,o),y.MaterialHelper.PrepareDefinesForFrameBoundValues(o,s,r,!!n,i),y.MaterialHelper.PrepareDefinesForAttributes(e,r,!0,!0,!0,this._transparencyMode!==t.PBRMATERIAL_OPAQUE)},t.prototype.forceCompilation=function(e,t,r){var i=this,o=Object(n.__assign)({clipPlane:!1,useInstances:!1},r),s=new P,a=this._prepareEffect(e,s,void 0,void 0,o.useInstances,o.clipPlane);a.isReady()?t&&t(this):a.onCompileObservable.add(function(){t&&t(i)})},t.prototype.buildUniformLayout=function(){var e=this._uniformBuffer;e.addUniform("vAlbedoInfos",2),e.addUniform("vAmbientInfos",4),e.addUniform("vOpacityInfos",2),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vReflectivityInfos",3),e.addUniform("vMicroSurfaceSamplerInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vBumpInfos",3),e.addUniform("albedoMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("reflectivityMatrix",16),e.addUniform("microSurfaceSamplerMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("reflectionMatrix",16),e.addUniform("vReflectionColor",3),e.addUniform("vAlbedoColor",4),e.addUniform("vLightingIntensity",4),e.addUniform("vReflectionMicrosurfaceInfos",3),e.addUniform("pointSize",1),e.addUniform("vReflectivityColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("visibility",1),h.PBRClearCoatConfiguration.PrepareUniformBuffer(e),d.PBRAnisotropicConfiguration.PrepareUniformBuffer(e),p.PBRSheenConfiguration.PrepareUniformBuffer(e),m.PBRSubSurfaceConfiguration.PrepareUniformBuffer(e),e.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this.subSurface.unbind(this._activeEffect)&&(t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,t,r){var n=this.getScene(),i=r._materialDefines;if(i){var o=r.effect;if(o){this._activeEffect=o,i.INSTANCES||this.bindOnlyWorldMatrix(e),i.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var s=this._mustRebind(n,o,t.visibility);y.MaterialHelper.BindBonesParameters(t,this._activeEffect);var a=null,l=this._uniformBuffer;if(s){var u=n.getEngine();if(l.bindToEffect(o,"Material"),this.bindViewProjection(o),a=this._getReflectionTexture(),!l.useUbo||!this.isFrozen||!l.isSync){if(n.texturesEnabled){if(this._albedoTexture&&T.MaterialFlags.DiffuseTextureEnabled&&(l.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),y.MaterialHelper.BindTextureMatrix(this._albedoTexture,l,"albedo")),this._ambientTexture&&T.MaterialFlags.AmbientTextureEnabled&&(l.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),y.MaterialHelper.BindTextureMatrix(this._ambientTexture,l,"ambient")),this._opacityTexture&&T.MaterialFlags.OpacityTextureEnabled&&(l.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),y.MaterialHelper.BindTextureMatrix(this._opacityTexture,l,"opacity")),a&&T.MaterialFlags.ReflectionTextureEnabled){if(l.updateMatrix("reflectionMatrix",a.getReflectionTextureMatrix()),l.updateFloat2("vReflectionInfos",a.level,0),a.boundingBoxSize){var h=a;l.updateVector3("vReflectionPosition",h.boundingBoxPosition),l.updateVector3("vReflectionSize",h.boundingBoxSize)}if(!i.USEIRRADIANCEMAP){var d=a.sphericalPolynomial;if(i.USESPHERICALFROMREFLECTIONMAP&&d)if(i.SPHERICAL_HARMONICS){var f=d.preScaledHarmonics;this._activeEffect.setVector3("vSphericalL00",f.l00),this._activeEffect.setVector3("vSphericalL1_1",f.l1_1),this._activeEffect.setVector3("vSphericalL10",f.l10),this._activeEffect.setVector3("vSphericalL11",f.l11),this._activeEffect.setVector3("vSphericalL2_2",f.l2_2),this._activeEffect.setVector3("vSphericalL2_1",f.l2_1),this._activeEffect.setVector3("vSphericalL20",f.l20),this._activeEffect.setVector3("vSphericalL21",f.l21),this._activeEffect.setVector3("vSphericalL22",f.l22)}else this._activeEffect.setFloat3("vSphericalX",d.x.x,d.x.y,d.x.z),this._activeEffect.setFloat3("vSphericalY",d.y.x,d.y.y,d.y.z),this._activeEffect.setFloat3("vSphericalZ",d.z.x,d.z.y,d.z.z),this._activeEffect.setFloat3("vSphericalXX_ZZ",d.xx.x-d.zz.x,d.xx.y-d.zz.y,d.xx.z-d.zz.z),this._activeEffect.setFloat3("vSphericalYY_ZZ",d.yy.x-d.zz.x,d.yy.y-d.zz.y,d.yy.z-d.zz.z),this._activeEffect.setFloat3("vSphericalZZ",d.zz.x,d.zz.y,d.zz.z),this._activeEffect.setFloat3("vSphericalXY",d.xy.x,d.xy.y,d.xy.z),this._activeEffect.setFloat3("vSphericalYZ",d.yz.x,d.yz.y,d.yz.z),this._activeEffect.setFloat3("vSphericalZX",d.zx.x,d.zx.y,d.zx.z)}l.updateFloat3("vReflectionMicrosurfaceInfos",a.getSize().width,a.lodGenerationScale,a.lodGenerationOffset)}this._emissiveTexture&&T.MaterialFlags.EmissiveTextureEnabled&&(l.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),y.MaterialHelper.BindTextureMatrix(this._emissiveTexture,l,"emissive")),this._lightmapTexture&&T.MaterialFlags.LightmapTextureEnabled&&(l.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),y.MaterialHelper.BindTextureMatrix(this._lightmapTexture,l,"lightmap")),T.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?(l.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),y.MaterialHelper.BindTextureMatrix(this._metallicTexture,l,"reflectivity")):this._reflectivityTexture&&(l.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),y.MaterialHelper.BindTextureMatrix(this._reflectivityTexture,l,"reflectivity")),this._microSurfaceTexture&&(l.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),y.MaterialHelper.BindTextureMatrix(this._microSurfaceTexture,l,"microSurfaceSampler"))),this._bumpTexture&&u.getCaps().standardDerivatives&&T.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&(l.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),y.MaterialHelper.BindTextureMatrix(this._bumpTexture,l,"bump"),n._mirroredCameraPosition?l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):l.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1))}if(this.pointsCloud&&l.updateFloat("pointSize",this.pointSize),i.METALLICWORKFLOW){g.TmpColors.Color3[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,g.TmpColors.Color3[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness;var p=.08*this._metallicF0Factor;l.updateColor4("vReflectivityColor",g.TmpColors.Color3[0],p)}else l.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface);l.updateColor3("vEmissiveColor",T.MaterialFlags.EmissiveTextureEnabled?this._emissiveColor:g.Color3.BlackReadOnly),l.updateColor3("vReflectionColor",this._reflectionColor),!i.SS_REFRACTION&&this.subSurface.linkRefractionWithTransparency?l.updateColor4("vAlbedoColor",this._albedoColor,1):l.updateColor4("vAlbedoColor",this._albedoColor,this.alpha),l.updateFloat("visibility",t.visibility),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity*n.environmentIntensity,this._lightingInfos.w=this._specularIntensity,l.updateVector4("vLightingIntensity",this._lightingInfos)}n.texturesEnabled&&(this._albedoTexture&&T.MaterialFlags.DiffuseTextureEnabled&&l.setTexture("albedoSampler",this._albedoTexture),this._ambientTexture&&T.MaterialFlags.AmbientTextureEnabled&&l.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&T.MaterialFlags.OpacityTextureEnabled&&l.setTexture("opacitySampler",this._opacityTexture),a&&T.MaterialFlags.ReflectionTextureEnabled&&(i.LODBASEDMICROSFURACE?l.setTexture("reflectionSampler",a):(l.setTexture("reflectionSampler",a._lodTextureMid||a),l.setTexture("reflectionSamplerLow",a._lodTextureLow||a),l.setTexture("reflectionSamplerHigh",a._lodTextureHigh||a)),i.USEIRRADIANCEMAP&&l.setTexture("irradianceSampler",a.irradianceTexture)),i.ENVIRONMENTBRDF&&l.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),this._emissiveTexture&&T.MaterialFlags.EmissiveTextureEnabled&&l.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&T.MaterialFlags.LightmapTextureEnabled&&l.setTexture("lightmapSampler",this._lightmapTexture),T.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?l.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&l.setTexture("reflectivitySampler",this._reflectivityTexture),this._microSurfaceTexture&&l.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&u.getCaps().standardDerivatives&&T.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&l.setTexture("bumpSampler",this._bumpTexture)),this.subSurface.bindForSubMesh(l,n,u,this.isFrozen,i.LODBASEDMICROSFURACE),this.clearCoat.bindForSubMesh(l,n,u,this._disableBumpMap,this.isFrozen,this._invertNormalMapX,this._invertNormalMapY),this.anisotropy.bindForSubMesh(l,n,this.isFrozen),this.sheen.bindForSubMesh(l,n,this.isFrozen),y.MaterialHelper.BindClipPlane(this._activeEffect,n),n.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor);var m=n._forcedViewPosition?n._forcedViewPosition:n._mirroredCameraPosition?n._mirroredCameraPosition:n.activeCamera.globalPosition,_=n.useRightHandedSystem===(null!=n._mirroredCameraPosition);o.setFloat4("vEyePosition",m.x,m.y,m.z,_?-1:1),o.setColor3("vAmbientColor",this._globalAmbientColor),o.setFloat2("vDebugMode",this.debugLimit,this.debugFactor)}!s&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&y.MaterialHelper.BindLights(n,t,this._activeEffect,i,this._maxSimultaneousLights,this._rebuildInParallel),(n.fogEnabled&&t.applyFog&&n.fogMode!==c.Scene.FOGMODE_NONE||a)&&this.bindView(o),y.MaterialHelper.BindFogParameters(n,t,this._activeEffect,!0),i.NUM_MORPH_INFLUENCERS&&y.MaterialHelper.BindMorphTargetParameters(t,this._activeEffect),this._imageProcessingConfiguration.bind(this._activeEffect),y.MaterialHelper.BindLogDepth(i,this._activeEffect,n)),l.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this.subSurface.getAnimatables(e),this.clearCoat.getAnimatables(e),this.sheen.getAnimatables(e),this.anisotropy.getAnimatables(e),e},t.prototype._getReflectionTexture=function(){return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._albedoTexture&&t.push(this._albedoTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._reflectivityTexture&&t.push(this._reflectivityTexture),this._metallicTexture&&t.push(this._metallicTexture),this._microSurfaceTexture&&t.push(this._microSurfaceTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this.subSurface.getActiveTextures(t),this.clearCoat.getActiveTextures(t),this.sheen.getActiveTextures(t),this.anisotropy.getActiveTextures(t),t},t.prototype.hasTexture=function(t){return!!e.prototype.hasTexture.call(this,t)||(this._albedoTexture===t||(this._ambientTexture===t||(this._opacityTexture===t||(this._reflectionTexture===t||(this._reflectivityTexture===t||(this._metallicTexture===t||(this._microSurfaceTexture===t||(this._bumpTexture===t||(this._lightmapTexture===t||(this.subSurface.hasTexture(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.subSurface.dispose(r),this.clearCoat.dispose(r),this.sheen.dispose(r),this.anisotropy.dispose(r),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t,r)},t.PBRMATERIAL_OPAQUE=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,Object(n.__decorate)([Object(i.serializeAsImageProcessingConfiguration)()],t.prototype,"_imageProcessingConfiguration",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"debugMode",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useLogarithmicDepth",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"transparencyMode",null),t}(A.PushMaterial)},"./Materials/PBR/pbrBaseSimpleMaterial.ts": /*!************************************************!*\ !*** ./Materials/PBR/pbrBaseSimpleMaterial.ts ***! \************************************************/ /*! exports provided: PBRBaseSimpleMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRBaseSimpleMaterial",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.maxSimultaneousLights=4,n.disableLighting=!1,n.invertNormalMapX=!1,n.invertNormalMapY=!1,n.emissiveColor=new o.Color3(0,0,0),n.occlusionStrength=1,n.useLightmapAsShadowmap=!1,n._useAlphaFromAlbedoTexture=!0,n._useAmbientInGrayScale=!0,n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"doubleSided",{get:function(){return this._twoSidedLighting},set:function(e){this._twoSidedLighting!==e&&(this._twoSidedLighting=e,this.backFaceCulling=!e,this._markAllSubMeshesAsTexturesDirty())},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"PBRBaseSimpleMaterial"},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectionTexture")],t.prototype,"environmentTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_bumpTexture")],t.prototype,"normalTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("emissive"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_ambientTextureStrength")],t.prototype,"occlusionStrength",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_ambientTexture")],t.prototype,"occlusionTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_alphaCutOff")],t.prototype,"alphaCutOff",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"doubleSided",null),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),t}(r(/*! ./pbrBaseMaterial */"./Materials/PBR/pbrBaseMaterial.ts").PBRBaseMaterial)},"./Materials/PBR/pbrClearCoatConfiguration.ts": /*!****************************************************!*\ !*** ./Materials/PBR/pbrClearCoatConfiguration.ts ***! \****************************************************/ /*! exports provided: PBRClearCoatConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRClearCoatConfiguration",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),c=function(){function e(t){this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.roughness=0,this._indexOfRefraction=e._DefaultIndexOfRefraction,this.indexOfRefraction=e._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._bumpTexture=null,this.bumpTexture=null,this._isTintEnabled=!1,this.isTintEnabled=!1,this.tintColor=o.Color3.White(),this.tintColorAtDistance=1,this.tintThickness=1,this._tintTexture=null,this.tintTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=t}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t,r,n){if(e._areTexturesDirty&&t.texturesEnabled){if(this._texture&&s.MaterialFlags.ClearCoatTextureEnabled&&!this._texture.isReadyOrNotBlocking())return!1;if(r.getCaps().standardDerivatives&&this._bumpTexture&&s.MaterialFlags.ClearCoatBumpTextureEnabled&&!n&&!this._bumpTexture.isReady())return!1;if(this._isTintEnabled&&this._tintTexture&&s.MaterialFlags.ClearCoatTintTextureEnabled&&!this._tintTexture.isReadyOrNotBlocking())return!1}return!0},e.prototype.prepareDefines=function(t,r){this._isEnabled?(t.CLEARCOAT=!0,t._areTexturesDirty&&r.texturesEnabled&&(this._texture&&s.MaterialFlags.ClearCoatTextureEnabled?a.MaterialHelper.PrepareDefinesForMergedUV(this._texture,t,"CLEARCOAT_TEXTURE"):t.CLEARCOAT_TEXTURE=!1,this._bumpTexture&&s.MaterialFlags.ClearCoatBumpTextureEnabled?a.MaterialHelper.PrepareDefinesForMergedUV(this._bumpTexture,t,"CLEARCOAT_BUMP"):t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_DEFAULTIOR=this._indexOfRefraction===e._DefaultIndexOfRefraction,this._isTintEnabled?(t.CLEARCOAT_TINT=!0,this._tintTexture&&s.MaterialFlags.ClearCoatTintTextureEnabled?a.MaterialHelper.PrepareDefinesForMergedUV(this._tintTexture,t,"CLEARCOAT_TINT_TEXTURE"):t.CLEARCOAT_TINT_TEXTURE=!1):(t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1))):(t.CLEARCOAT=!1,t.CLEARCOAT_TEXTURE=!1,t.CLEARCOAT_BUMP=!1,t.CLEARCOAT_TINT=!1,t.CLEARCOAT_TINT_TEXTURE=!1)},e.prototype.bindForSubMesh=function(e,t,r,n,i,o,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._indexOfRefraction,u=1+this._indexOfRefraction,h=Math.pow(-l/u,2),d=1/this._indexOfRefraction;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,t,r){var n=this;i.SerializationHelper.Parse(function(){return n},e,t,r)},e._DefaultIndexOfRefraction=1.5,Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"intensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"indexOfRefraction",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"bumpTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isTintEnabled",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"tintColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"tintColorAtDistance",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"tintThickness",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"tintTexture",void 0),e}()},"./Materials/PBR/pbrMaterial.ts": /*!**************************************!*\ !*** ./Materials/PBR/pbrMaterial.ts ***! \**************************************/ /*! exports provided: PBRMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRMaterial",function(){return 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.color */"./Maths/math.color.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.metallicF0Factor=.5,i.useMetallicF0FactorFromMetallicTexture=!1,i.ambientColor=new s.Color3(0,0,0),i.albedoColor=new s.Color3(1,1,1),i.reflectivityColor=new s.Color3(1,1,1),i.reflectionColor=new s.Color3(1,1,1),i.emissiveColor=new s.Color3(0,0,0),i.microSurface=1,i.useLightmapAsShadowmap=!1,i.useAlphaFromAlbedoTexture=!1,i.forceAlphaTest=!1,i.alphaCutOff=.4,i.useSpecularOverAlpha=!0,i.useMicroSurfaceFromReflectivityMapAlpha=!1,i.useRoughnessFromMetallicTextureAlpha=!0,i.useRoughnessFromMetallicTextureGreen=!1,i.useMetallnessFromMetallicTextureBlue=!1,i.useAmbientOcclusionFromMetallicTextureRed=!1,i.useAmbientInGrayScale=!1,i.useAutoMicroSurfaceFromReflectivityMap=!1,i.useRadianceOverAlpha=!0,i.useObjectSpaceNormalMap=!1,i.useParallax=!1,i.useParallaxOcclusion=!1,i.parallaxScaleBias=.05,i.disableLighting=!1,i.forceIrradianceInFragment=!1,i.maxSimultaneousLights=4,i.invertNormalMapX=!1,i.invertNormalMapY=!1,i.twoSidedLighting=!1,i.useAlphaFresnel=!1,i.useLinearAlphaFresnel=!1,i.environmentBRDFTexture=null,i.forceNormalForward=!1,i.enableSpecularAntiAliasing=!1,i.useHorizonOcclusion=!0,i.useRadianceOcclusion=!0,i.unlit=!1,i._environmentBRDFTexture=o.BRDFTextureTools.GetEnvironmentBRDFTexture(n),i}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"refractionTexture",{get:function(){return this.subSurface.refractionTexture},set:function(e){this.subSurface.refractionTexture=e,e?this.subSurface.isRefractionEnabled=!0:this.subSurface.linkRefractionWithTransparency||(this.subSurface.isRefractionEnabled=!1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"indexOfRefraction",{get:function(){return 1/this.subSurface.indexOfRefraction},set:function(e){this.subSurface.indexOfRefraction=1/e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invertRefractionY",{get:function(){return this.subSurface.invertRefractionY},set:function(e){this.subSurface.invertRefractionY=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"linkRefractionWithTransparency",{get:function(){return this.subSurface.linkRefractionWithTransparency},set:function(e){this.subSurface.linkRefractionWithTransparency=e,e&&(this.subSurface.isRefractionEnabled=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"usePhysicalLightFalloff",{get:function(){return this._lightFalloff===a.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL},set:function(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?a.PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL:a.PBRBaseMaterial.LIGHTFALLOFF_STANDARD)},enumerable:!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),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.PBRMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse(function(){return new t(e.name,r)},e,r,n);return e.clearCoat&&o.clearCoat.parse(e.clearCoat,r,n),e.anisotropy&&o.anisotropy.parse(e.anisotropy,r,n),e.brdf&&o.brdf.parse(e.brdf,r,n),e.sheen&&o.sheen.parse(e.sheen,r,n),e.subSurface&&o.subSurface.parse(e.subSurface,r,n),o},t.PBRMATERIAL_OPAQUE=a.PBRBaseMaterial.PBRMATERIAL_OPAQUE,t.PBRMATERIAL_ALPHATEST=a.PBRBaseMaterial.PBRMATERIAL_ALPHATEST,t.PBRMATERIAL_ALPHABLEND=a.PBRBaseMaterial.PBRMATERIAL_ALPHABLEND,t.PBRMATERIAL_ALPHATESTANDBLEND=a.PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=a.PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"directIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularIntensity",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"disableBumpMap",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureStrength",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicF0Factor",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMetallicF0FactorFromMetallicTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurfaceTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("ambient"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("albedo"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("reflectivity"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("reflection"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("emissive"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurface",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromAlbedoTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"forceAlphaTest",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"alphaCutOff",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureGreen",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMetallnessFromMetallicTextureBlue",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientInGrayScale",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"usePhysicalLightFalloff",null),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useGLTFLightFalloff",null),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"parallaxScaleBias",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceIrradianceInFragment",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFresnel",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLinearAlphaFresnel",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentBRDFTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceNormalForward",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableSpecularAntiAliasing",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useHorizonOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],t.prototype,"unlit",void 0),t}(a.PBRBaseMaterial);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 Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"PBRMetallicRoughnessMaterial"},t.prototype.clone=function(e){var r=this,n=i.SerializationHelper.Clone(function(){return new t(e,r.getScene())},this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.PBRMetallicRoughnessMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse(function(){return new t(e.name,r)},e,r,n);return e.clearCoat&&o.clearCoat.parse(e.clearCoat,r,n),e.anisotropy&&o.anisotropy.parse(e.anisotropy,r,n),e.brdf&&o.brdf.parse(e.brdf,r,n),e.sheen&&o.sheen.parse(e.sheen,r,n),e.subSurface&&o.subSurface.parse(e.subSurface,r,n),o},Object(n.__decorate)([Object(i.serializeAsColor3)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"baseColor",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"baseTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_metallicTexture")],t.prototype,"metallicRoughnessTexture",void 0),t}(o.PBRBaseSimpleMaterial);s._TypeStore.RegisteredTypes["BABYLON.PBRMetallicRoughnessMaterial"]=a},"./Materials/PBR/pbrSheenConfiguration.ts": /*!************************************************!*\ !*** ./Materials/PBR/pbrSheenConfiguration.ts ***! \************************************************/ /*! exports provided: PBRSheenConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRSheenConfiguration",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../../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,t,r){var n=this;i.SerializationHelper.Parse(function(){return n},e,t,r)},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"linkSheenWithAlbedo",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"intensity",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"color",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"texture",void 0),e}()},"./Materials/PBR/pbrSpecularGlossinessMaterial.ts": /*!********************************************************!*\ !*** ./Materials/PBR/pbrSpecularGlossinessMaterial.ts ***! \********************************************************/ /*! exports provided: PBRSpecularGlossinessMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRSpecularGlossinessMaterial",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ./pbrBaseSimpleMaterial */"./Materials/PBR/pbrBaseSimpleMaterial.ts"),s=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._useMicroSurfaceFromReflectivityMapAlpha=!0,n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"PBRSpecularGlossinessMaterial"},t.prototype.clone=function(e){var r=this,n=i.SerializationHelper.Clone(function(){return new t(e,r.getScene())},this);return n.id=e,n.name=e,this.clearCoat.copyTo(n.clearCoat),this.anisotropy.copyTo(n.anisotropy),this.brdf.copyTo(n.brdf),this.sheen.copyTo(n.sheen),this.subSurface.copyTo(n.subSurface),n},t.prototype.serialize=function(){var e=i.SerializationHelper.Serialize(this);return e.customType="BABYLON.PBRSpecularGlossinessMaterial",e.clearCoat=this.clearCoat.serialize(),e.anisotropy=this.anisotropy.serialize(),e.brdf=this.brdf.serialize(),e.sheen=this.sheen.serialize(),e.subSurface=this.subSurface.serialize(),e},t.Parse=function(e,r,n){var o=i.SerializationHelper.Parse(function(){return new t(e.name,r)},e,r,n);return e.clearCoat&&o.clearCoat.parse(e.clearCoat,r,n),e.anisotropy&&o.anisotropy.parse(e.anisotropy,r,n),e.brdf&&o.brdf.parse(e.brdf,r,n),e.sheen&&o.sheen.parse(e.sheen,r,n),e.subSurface&&o.subSurface.parse(e.subSurface,r,n),o},Object(n.__decorate)([Object(i.serializeAsColor3)("diffuse"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoColor")],t.prototype,"diffuseColor",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_albedoTexture")],t.prototype,"diffuseTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("specular"),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectivityColor")],t.prototype,"specularColor",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_microSurface")],t.prototype,"glossiness",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty","_reflectivityTexture")],t.prototype,"specularGlossinessTexture",void 0),t}(o.PBRBaseSimpleMaterial);s._TypeStore.RegisteredTypes["BABYLON.PBRSpecularGlossinessMaterial"]=a},"./Materials/PBR/pbrSubSurfaceConfiguration.ts": /*!*****************************************************!*\ !*** ./Materials/PBR/pbrSubSurfaceConfiguration.ts ***! \*****************************************************/ /*! exports provided: PBRSubSurfaceConfiguration */function(e,t,r){"use strict";r.r(t),r.d(t,"PBRSubSurfaceConfiguration",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),s=r(/*! ../materialFlags */"./Materials/materialFlags.ts"),a=r(/*! ../../Materials/materialHelper */"./Materials/materialHelper.ts"),c=function(){function e(e){this._isRefractionEnabled=!1,this.isRefractionEnabled=!1,this._isTranslucencyEnabled=!1,this.isTranslucencyEnabled=!1,this._isScatteringEnabled=!1,this.refractionIntensity=1,this.translucencyIntensity=1,this.scatteringIntensity=1,this._thicknessTexture=null,this.thicknessTexture=null,this._refractionTexture=null,this.refractionTexture=null,this._indexOfRefraction=1,this.indexOfRefraction=1,this._invertRefractionY=!1,this.invertRefractionY=!1,this._linkRefractionWithTransparency=!1,this.linkRefractionWithTransparency=!1,this.minimumThickness=0,this.maximumThickness=1,this.tintColor=o.Color3.White(),this.tintColorAtDistance=1,this.diffusionDistance=o.Color3.White(),this._useMaskFromThicknessTexture=!1,this.useMaskFromThicknessTexture=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e}return e.prototype._markAllSubMeshesAsTexturesDirty=function(){this._internalMarkAllSubMeshesAsTexturesDirty()},e.prototype.isReadyForSubMesh=function(e,t){if(e._areTexturesDirty&&t.texturesEnabled){if(this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking())return!1;var r=this._getRefractionTexture(t);if(r&&s.MaterialFlags.RefractionTextureEnabled&&!r.isReadyOrNotBlocking())return!1}return!0},e.prototype.prepareDefines=function(e,t){if(e._areTexturesDirty&&(e.SUBSURFACE=!1,e.SS_TRANSLUCENCY=this._isTranslucencyEnabled,e.SS_SCATERRING=this._isScatteringEnabled,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_MASK_FROM_THICKNESS_TEXTURE=!1,e.SS_REFRACTION=!1,e.SS_REFRACTIONMAP_3D=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled)&&(e.SUBSURFACE=!0,e._areTexturesDirty&&t.texturesEnabled&&this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&a.MaterialHelper.PrepareDefinesForMergedUV(this._thicknessTexture,e,"SS_THICKNESSANDMASK_TEXTURE"),e.SS_MASK_FROM_THICKNESS_TEXTURE=this._useMaskFromThicknessTexture),this._isRefractionEnabled&&t.texturesEnabled)){var r=this._getRefractionTexture(t);r&&s.MaterialFlags.RefractionTextureEnabled&&(e.SS_REFRACTION=!0,e.SS_REFRACTIONMAP_3D=r.isCube,e.SS_GAMMAREFRACTION=r.gammaSpace,e.SS_RGBDREFRACTION=r.isRGBD,e.SS_LINEARSPECULARREFRACTION=r.linearSpecularLOD,e.SS_REFRACTIONMAP_OPPOSITEZ=r.invertZ,e.SS_LODINREFRACTIONALPHA=r.lodLevelInAlpha,e.SS_LINKREFRACTIONTOTRANSPARENCY=this._linkRefractionWithTransparency)}},e.prototype.bindForSubMesh=function(e,t,r,n,i){var o=this._getRefractionTexture(t);if(!e.useUbo||!n||!e.isSync){if(this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&(e.updateFloat2("vThicknessInfos",this._thicknessTexture.coordinatesIndex,this._thicknessTexture.level),a.MaterialHelper.BindTextureMatrix(this._thicknessTexture,e,"thickness")),e.updateFloat2("vThicknessParam",this.minimumThickness,this.maximumThickness-this.minimumThickness),o&&s.MaterialFlags.RefractionTextureEnabled){e.updateMatrix("refractionMatrix",o.getReflectionTextureMatrix());var c=1;o.isCube||o.depth&&(c=o.depth),e.updateFloat4("vRefractionInfos",o.level,1/this._indexOfRefraction,c,this._invertRefractionY?-1:1),e.updateFloat3("vRefractionMicrosurfaceInfos",o.getSize().width,o.lodGenerationScale,o.lodGenerationOffset)}e.updateColor3("vDiffusionDistance",this.diffusionDistance),e.updateFloat4("vTintColor",this.tintColor.r,this.tintColor.g,this.tintColor.b,this.tintColorAtDistance),e.updateFloat3("vSubSurfaceIntensity",this.refractionIntensity,this.translucencyIntensity,this.scatteringIntensity)}t.texturesEnabled&&(this._thicknessTexture&&s.MaterialFlags.ThicknessTextureEnabled&&e.setTexture("thicknessSampler",this._thicknessTexture),o&&s.MaterialFlags.RefractionTextureEnabled&&(i?e.setTexture("refractionSampler",o):(e.setTexture("refractionSampler",o._lodTextureMid||o),e.setTexture("refractionSamplerLow",o._lodTextureLow||o),e.setTexture("refractionSamplerHigh",o._lodTextureHigh||o))))},e.prototype.unbind=function(e){return!(!this._refractionTexture||!this._refractionTexture.isRenderTarget)&&(e.setTexture("refractionSampler",null),!0)},e.prototype._getRefractionTexture=function(e){return this._refractionTexture?this._refractionTexture:this._isRefractionEnabled?e.environmentTexture:null},Object.defineProperty(e.prototype,"disableAlphaBlending",{get:function(){return this.isRefractionEnabled&&this._linkRefractionWithTransparency},enumerable:!0,configurable:!0}),e.prototype.fillRenderTargetTextures=function(e){s.MaterialFlags.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&e.push(this._refractionTexture)},e.prototype.hasTexture=function(e){return this._thicknessTexture===e||this._refractionTexture===e},e.prototype.hasRenderTargetTextures=function(){return!!(s.MaterialFlags.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget)},e.prototype.getActiveTextures=function(e){this._thicknessTexture&&e.push(this._thicknessTexture),this._refractionTexture&&e.push(this._refractionTexture)},e.prototype.getAnimatables=function(e){this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture)},e.prototype.dispose=function(e){e&&(this._thicknessTexture&&this._thicknessTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose())},e.prototype.getClassName=function(){return"PBRSubSurfaceConfiguration"},e.AddFallbacks=function(e,t,r){return e.SS_SCATERRING&&t.addFallback(r++,"SS_SCATERRING"),e.SS_TRANSLUCENCY&&t.addFallback(r++,"SS_TRANSLUCENCY"),r},e.AddUniforms=function(e){e.push("vDiffusionDistance","vTintColor","vSubSurfaceIntensity","vRefractionMicrosurfaceInfos","vRefractionInfos","vThicknessInfos","vThicknessParam","refractionMatrix","thicknessMatrix")},e.AddSamplers=function(e){e.push("thicknessSampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh")},e.PrepareUniformBuffer=function(e){e.addUniform("vRefractionMicrosurfaceInfos",3),e.addUniform("vRefractionInfos",4),e.addUniform("refractionMatrix",16),e.addUniform("vThicknessInfos",2),e.addUniform("thicknessMatrix",16),e.addUniform("vThicknessParam",2),e.addUniform("vDiffusionDistance",3),e.addUniform("vTintColor",4),e.addUniform("vSubSurfaceIntensity",3)},e.prototype.copyTo=function(e){i.SerializationHelper.Clone(function(){return e},this)},e.prototype.serialize=function(){return i.SerializationHelper.Serialize(this)},e.prototype.parse=function(e,t,r){var n=this;i.SerializationHelper.Parse(function(){return n},e,t,r)},Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isRefractionEnabled",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"isTranslucencyEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"refractionIntensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"translucencyIntensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"scatteringIntensity",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"thicknessTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"refractionTexture",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"indexOfRefraction",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"invertRefractionY",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"linkRefractionWithTransparency",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"minimumThickness",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"maximumThickness",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"tintColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"tintColorAtDistance",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)()],e.prototype,"diffusionDistance",void 0),Object(n.__decorate)([Object(i.serialize)(),Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],e.prototype,"useMaskFromThicknessTexture",void 0),e}()},"./Materials/Textures/Loaders/basisTextureLoader.ts": /*!**********************************************************!*\ !*** ./Materials/Textures/Loaders/basisTextureLoader.ts ***! \**********************************************************/ /*! exports provided: _BasisTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_BasisTextureLoader",function(){return a});var n=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),i=r(/*! ../../../Misc/basis */"./Misc/basis.ts"),o=r(/*! ../../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),a=function(){function e(){this.supportCascades=!0}return e.prototype.canLoad=function(e){return s.StringTools.EndsWith(e,".basis")},e.prototype.loadCubeData=function(e,t,r,n,s){if(!Array.isArray(e)){var a=t.getEngine().getCaps(),c={supportedCompressionFormats:{etc1:!!a.etc1,s3tc:!!a.s3tc,pvrtc:!!a.pvrtc,etc2:!!a.etc2}};i.BasisTools.TranscodeAsync(e,c).then(function(e){var r=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;i.BasisTools.LoadTextureFromTranscodeResult(t,e),t.getEngine()._setCubeMapTextureParams(r),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()}).catch(function(e){o.Tools.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),t.isReady=!0})}},e.prototype.loadData=function(e,t,r){var n=t.getEngine().getCaps(),s={supportedCompressionFormats:{etc1:!!n.etc1,s3tc:!!n.s3tc,pvrtc:!!n.pvrtc,etc2:!!n.etc2}};i.BasisTools.TranscodeAsync(e,s).then(function(e){var n=e.fileInfo.images[0].levels[0],o=e.fileInfo.images[0].levels.length>1&&t.generateMipMaps;r(n.width,n.height,o,-1!==e.format,function(){i.BasisTools.LoadTextureFromTranscodeResult(t,e)})}).catch(function(e){o.Tools.Warn("Failed to transcode Basis file, transcoding may not be supported on this device"),r(0,0,!1,!1,function(){})})},e}();n.Engine._TextureLoaders.push(new a)},"./Materials/Textures/Loaders/ddsTextureLoader.ts": /*!********************************************************!*\ !*** ./Materials/Textures/Loaders/ddsTextureLoader.ts ***! \********************************************************/ /*! exports provided: _DDSTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_DDSTextureLoader",function(){return a});var n=r(/*! ../../../Maths/sphericalPolynomial */"./Maths/sphericalPolynomial.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../../Misc/dds */"./Misc/dds.ts"),s=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),a=function(){function e(){this.supportCascades=!0}return e.prototype.canLoad=function(e){return s.StringTools.EndsWith(e,".dds")},e.prototype.loadCubeData=function(e,t,r,i,s){var a,c=t.getEngine(),l=!1;if(Array.isArray(e))for(var u=0;u1)&&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,!1)}c._setCubeMapTextureParams(l),t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),i&&i({isDDS:!0,width:t.width,info:a,data:e,texture:t})},e.prototype.loadData=function(e,t,r){var n=o.DDSTools.GetDDSInfo(e),i=(n.isRGB||n.isLuminance||n.mipmapCount>1)&&t.generateMipMaps&&n.width>>n.mipmapCount-1==1;r(n.width,n.height,i,n.isFourCC,function(){o.DDSTools.UploadDDSLevels(t.getEngine(),t,e,n,i,1)})},e}();i.Engine._TextureLoaders.push(new a)},"./Materials/Textures/Loaders/envTextureLoader.ts": /*!********************************************************!*\ !*** ./Materials/Textures/Loaders/envTextureLoader.ts ***! \********************************************************/ /*! exports provided: _ENVTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_ENVTextureLoader",function(){return s});var n=r(/*! ../../../Misc/environmentTextureTools */"./Misc/environmentTextureTools.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),s=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return o.StringTools.EndsWith(e,".env")},e.prototype.loadCubeData=function(e,t,r,i,o){if(!Array.isArray(e)){var s=n.EnvironmentTextureTools.GetEnvInfo(e);s?(t.width=s.width,t.height=s.width,n.EnvironmentTextureTools.UploadEnvSpherical(t,s),n.EnvironmentTextureTools.UploadEnvLevelsAsync(t,e,s).then(function(){t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),i&&i()})):o&&o("Can not parse the environment file",null)}},e.prototype.loadData=function(e,t,r){throw".env not supported in 2d."},e}();i.Engine._TextureLoaders.push(new s)},"./Materials/Textures/Loaders/index.ts": /*!*********************************************!*\ !*** ./Materials/Textures/Loaders/index.ts ***! \*********************************************/ /*! exports provided: _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, _BasisTextureLoader */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./ddsTextureLoader */"./Materials/Textures/Loaders/ddsTextureLoader.ts");r.d(t,"_DDSTextureLoader",function(){return n._DDSTextureLoader});var i=r(/*! ./envTextureLoader */"./Materials/Textures/Loaders/envTextureLoader.ts");r.d(t,"_ENVTextureLoader",function(){return i._ENVTextureLoader});var o=r(/*! ./ktxTextureLoader */"./Materials/Textures/Loaders/ktxTextureLoader.ts");r.d(t,"_KTXTextureLoader",function(){return o._KTXTextureLoader});var s=r(/*! ./tgaTextureLoader */"./Materials/Textures/Loaders/tgaTextureLoader.ts");r.d(t,"_TGATextureLoader",function(){return s._TGATextureLoader});var a=r(/*! ./basisTextureLoader */"./Materials/Textures/Loaders/basisTextureLoader.ts");r.d(t,"_BasisTextureLoader",function(){return a._BasisTextureLoader})},"./Materials/Textures/Loaders/ktxTextureLoader.ts": /*!********************************************************!*\ !*** ./Materials/Textures/Loaders/ktxTextureLoader.ts ***! \********************************************************/ /*! exports provided: _KTXTextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_KTXTextureLoader",function(){return c});var n=r(/*! ../../../Misc/khronosTextureContainer */"./Misc/khronosTextureContainer.ts"),i=r(/*! ../../../Misc/khronosTextureContainer2 */"./Misc/khronosTextureContainer2.ts"),o=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),a=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),c=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return s.StringTools.EndsWith(e,".ktx")||s.StringTools.EndsWith(e,".ktx2")},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,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),i&&i()}},e.prototype.loadData=function(e,t,r){if(n.KhronosTextureContainer.IsValid(e)){t._invertVScale=!t.invertY;var o=new n.KhronosTextureContainer(e,1);r(o.pixelWidth,o.pixelHeight,t.generateMipMaps,!0,function(){o.uploadLevels(t,t.generateMipMaps)},o.isInvalid)}else if(i.KhronosTextureContainer2.IsValid(e)){new i.KhronosTextureContainer2(t.getEngine()).uploadAsync(e,t).then(function(){r(t.width,t.height,!1,!0,function(){},!1)},function(e){a.Logger.Warn("Failed to load KTX2 texture data: "+e.message),r(0,0,!1,!1,function(){},!0)})}else r(0,0,!1,!1,function(){},!0)},e}();o.Engine._TextureLoaders.unshift(new c)},"./Materials/Textures/Loaders/tgaTextureLoader.ts": /*!********************************************************!*\ !*** ./Materials/Textures/Loaders/tgaTextureLoader.ts ***! \********************************************************/ /*! exports provided: _TGATextureLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"_TGATextureLoader",function(){return s});var n=r(/*! ../../../Misc/tga */"./Misc/tga.ts"),i=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),o=r(/*! ../../../Misc/stringTools */"./Misc/stringTools.ts"),s=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e){return o.StringTools.EndsWith(e,".tga")},e.prototype.loadCubeData=function(e,t,r,n,i){throw".env not supported in Cube."},e.prototype.loadData=function(e,t,r){var i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=n.TGATools.GetTGAHeader(i);r(o.width,o.height,t.generateMipMaps,!1,function(){n.TGATools.UploadContent(t,i)})},e}();i.Engine._TextureLoaders.push(new s)},"./Materials/Textures/MultiviewRenderTarget.ts": /*!*****************************************************!*\ !*** ./Materials/Textures/MultiviewRenderTarget.ts ***! \*****************************************************/ /*! exports provided: MultiviewRenderTarget */function(e,t,r){"use strict";r.r(t),r.d(t,"MultiviewRenderTarget",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),o=r(/*! ../Textures/internalTexture */"./Materials/Textures/internalTexture.ts"),s=r(/*! ../../Engines/constants */"./Engines/constants.ts"),a=function(e){function t(t,r){void 0===r&&(r=512);var n=e.call(this,"multiview rtt",r,t,!1,!0,o.InternalTextureSource.Unknown,!1,void 0,!1,!1,!0,void 0,!0)||this,i=t.getEngine().createMultiviewRenderTargetTexture(n.getRenderWidth(),n.getRenderHeight());return i.isMultiview=!0,i.format=s.Constants.TEXTUREFORMAT_RGBA,n._texture=i,n.samples=n._engine.getCaps().maxSamples||n.samples,n}return Object(n.__extends)(t,e),t.prototype._bindFrameBuffer=function(e){void 0===e&&(e=0),this._texture&&this.getScene().getEngine().bindMultiviewFramebuffer(this._texture)},t.prototype.getViewCount=function(){return 2},t}(i.RenderTargetTexture)},"./Materials/Textures/Packer/frame.ts": /*!********************************************!*\ !*** ./Materials/Textures/Packer/frame.ts ***! \********************************************/ /*! exports provided: TexturePackerFrame */function(e,t,r){"use strict";r.r(t),r.d(t,"TexturePackerFrame",function(){return n});var n=function(e,t,r){this.id=e,this.scale=t,this.offset=r}},"./Materials/Textures/Packer/index.ts": /*!********************************************!*\ !*** ./Materials/Textures/Packer/index.ts ***! \********************************************/ /*! exports provided: TexturePacker, TexturePackerFrame */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./packer */"./Materials/Textures/Packer/packer.ts");r.d(t,"TexturePacker",function(){return n.TexturePacker});var i=r(/*! ./frame */"./Materials/Textures/Packer/frame.ts");r.d(t,"TexturePackerFrame",function(){return i.TexturePackerFrame})},"./Materials/Textures/Packer/packer.ts": /*!*********************************************!*\ !*** ./Materials/Textures/Packer/packer.ts ***! \*********************************************/ /*! exports provided: TexturePacker */function(e,t,r){"use strict";r.r(t),r.d(t,"TexturePacker",function(){return h});var n=r(/*! ../../../Engines/engine */"./Engines/engine.ts"),i=r(/*! ../../../Meshes/buffer */"./Meshes/buffer.ts"),o=r(/*! ../texture */"./Materials/Textures/texture.ts"),s=r(/*! ../dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),a=r(/*! ../../../Maths/math.vector */"./Maths/math.vector.ts"),c=r(/*! ../../../Maths/math.color */"./Maths/math.color.ts"),l=r(/*! ./frame */"./Materials/Textures/Packer/frame.ts"),u=r(/*! ../../../Misc/logger */"./Misc/logger.ts"),h=function(){function e(t,r,n,o){return this.name=t,this.meshes=r,this.scene=o,this.options=n,this.options.map=this.options.map||["ambientTexture","bumpTexture","diffuseTexture","emissiveTexture","lightmapTexture","opacityTexture","reflectionTexture","refractionTexture","specularTexture"],this.options.uvsIn=this.options.uvsIn||i.VertexBuffer.UVKind,this.options.uvsOut=this.options.uvsOut||i.VertexBuffer.UVKind,this.options.layout=this.options.layout||e.LAYOUT_STRIP,this.options.layout===e.LAYOUT_COLNUM&&(this.options.colnum=this.options.colnum||8),this.options.updateInputMeshes=this.options.updateInputMeshes||!0,this.options.disposeSources=this.options.disposeSources||!0,this._expecting=0,this.options.fillBlanks=this.options.fillBlanks||!0,!0===this.options.fillBlanks&&(this.options.customFillColor=this.options.customFillColor||"black"),this.options.frameSize=this.options.frameSize||256,this.options.paddingRatio=this.options.paddingRatio||.0115,this._paddingValue=Math.ceil(this.options.frameSize*this.options.paddingRatio),this._paddingValue%2!=0&&this._paddingValue++,this.options.paddingMode=this.options.paddingMode||e.SUBUV_WRAP,this.options.paddingMode===e.SUBUV_COLOR&&(this.options.paddingColor=this.options.paddingColor||new c.Color4(0,0,0,1)),this.sets={},this.frames=[],this}return e.prototype._createFrames=function(e){for(var t=this,r=this._calculateSize(),i=new a.Vector2(1,1).divide(r),l=0,u=this._expecting,h=this.meshes.length,d=Object.keys(this.sets),f=0;f0)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=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)}},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"isEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"autoClear",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_generateMipMaps",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_size",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"refreshRate",null),t}(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}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;e0)}},e}()},"./Materials/Textures/baseTexture.polynomial.ts": /*!******************************************************!*\ !*** ./Materials/Textures/baseTexture.polynomial.ts ***! \******************************************************/ /*! no exports provided */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../../Misc/HighDynamicRange/cubemapToSphericalPolynomial */"./Misc/HighDynamicRange/cubemapToSphericalPolynomial.ts"),i=r(/*! ./baseTexture */"./Materials/Textures/baseTexture.ts");Object.defineProperty(i.BaseTexture.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial)return this._texture._sphericalPolynomial;this._texture.isReady&&(this._texture._sphericalPolynomial=n.CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this))}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0})},"./Materials/Textures/baseTexture.ts": /*!*******************************************!*\ !*** ./Materials/Textures/baseTexture.ts ***! \*******************************************/ /*! exports provided: BaseTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseTexture",function(){return 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(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Engines/engineStore */"./Engines/engineStore.ts"),c=r(/*! ../../Engines/constants */"./Engines/constants.ts"),l=r(/*! ../../Misc/guid */"./Misc/guid.ts"),u=r(/*! ../../Maths/math.size */"./Maths/math.size.ts"),h=(r(/*! ../../Misc/fileTools */"./Misc/fileTools.ts"),function(){function e(t){this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this.getAlphaFromRGB=!1,this.level=1,this.coordinatesIndex=0,this._coordinatesMode=c.Constants.TEXTURE_EXPLICIT_MODE,this.wrapU=c.Constants.TEXTURE_WRAP_ADDRESSMODE,this.wrapV=c.Constants.TEXTURE_WRAP_ADDRESSMODE,this.wrapR=c.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._onDisposeObserver=null,this.delayLoadState=c.Constants.DELAYLOADSTATE_NONE,this._scene=null,this._texture=null,this._uid=null,this._cachedSize=u.Size.Zero(),this._scene=t||a.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(c.Constants.MATERIAL_TextureDirtyFlag|c.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(c.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,"is2DArray",{get:function(){return!!this._texture&&this._texture.is2DArray},set:function(e){this._texture&&(this._texture.is2DArray=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRGBD",{get:function(){return null!=this._texture&&this._texture._isRGBD},set:function(e){this._texture&&(this._texture._isRGBD=e)},enumerable:!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,"linearSpecularLOD",{get:function(){return!!this._texture&&this._texture._linearSpecularLOD},set:function(e){this._texture&&(this._texture._linearSpecularLOD=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"irradianceTexture",{get:function(){return this._texture?this._texture._irradianceTexture:null},set:function(e){this._texture&&(this._texture._irradianceTexture=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uid",{get:function(){return this._uid||(this._uid=l.GUID.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 s.Matrix.IdentityReadOnly},e.prototype.getReflectionTextureMatrix=function(){return s.Matrix.IdentityReadOnly},e.prototype.getInternalTexture=function(){return this._texture},e.prototype.isReadyOrNotBlocking=function(){return!this.isBlocking||this.isReady()},e.prototype.isReady=function(){return this.delayLoadState===c.Constants.DELAYLOADSTATE_NOTLOADED?(this.delayLoad(),!1):!!this._texture&&this._texture.isReady},e.prototype.getSize=function(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize},e.prototype.getBaseSize=function(){return this.isReady()&&this._texture?this._texture._size?new u.Size(this._texture._size,this._texture._size):new u.Size(this._texture.baseWidth,this._texture.baseHeight):u.Size.Zero()},e.prototype.updateSamplingMode=function(e){if(this._texture){var t=this.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=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 if(i=n.onLoadObservable){var o=function(){i.removeCallback(o),0==--r&&t()};i.add(o)}},s=0;s1,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 Object(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,null,s.Constants.TEXTURETYPE_UNSIGNED_INT):r.createRawTexture3D(null,1,1,1,s.Constants.TEXTUREFORMAT_RGBA,!1,!1,s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,null,s.Constants.TEXTURETYPE_UNSIGNED_INT),this._texture=e;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;p0&&(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 f});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),c=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),l=r(/*! ../../Engines/constants */"./Engines/constants.ts"),u=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),h=(r(/*! ../../Engines/Extensions/engine.cubeTexture */"./Engines/Extensions/engine.cubeTexture.ts"),r(/*! ../../Misc/stringTools */"./Misc/stringTools.ts")),d=r(/*! ../../Misc/observable */"./Misc/observable.ts"),f=function(e){function t(t,r,n,i,a,u,h,f,p,m,g,_,v){var A;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===f&&(f=l.Constants.TEXTUREFORMAT_RGBA),void 0===p&&(p=!1),void 0===m&&(m=null),void 0===g&&(g=!1),void 0===_&&(_=.8),void 0===v&&(v=0);var y=e.call(this,r)||this;if(y.onLoadObservable=new d.Observable,y.boundingBoxPosition=s.Vector3.Zero(),y._rotationY=0,y._files=null,y._forcedExtension=null,y._extensions=null,y._prefiltered=!1,y.name=t,y.url=t,y._noMipmap=i,y.hasAlpha=!1,y._format=f,y.isCube=!0,y._textureMatrix=s.Matrix.Identity(),y._createPolynomials=g,y.coordinatesMode=c.Texture.CUBIC_MODE,y._extensions=n,y._files=a,y._forcedExtension=m,!t&&!a)return y;var b=t.lastIndexOf("."),T=m||(b>-1?t.substring(b).toLowerCase():""),M=".dds"===T,x=".env"===T;if(x?(y.gammaSpace=!1,y._prefiltered=!1,y.anisotropicFilteringLevel=1):(y._prefiltered=p,p&&(y.gammaSpace=!1,y.anisotropicFilteringLevel=1)),y._texture=y._getFromCache(t,i),!a&&(x||M||n||(n=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),a=[],n))for(var P=0;P255){var A=255/v;m*=A,g*=A,_*=A}a[3*p+0]=m,a[3*p+1]=g,a[3*p+2]=_}a?s.push(a):s.push(f)}return s},null,this._onLoad,this._onError))},t.prototype.clone=function(){var e=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===a.Constants.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=a.Constants.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap),this._texture||this.loadTexture())},t.prototype.getReflectionTextureMatrix=function(){return this._textureMatrix},t.prototype.setReflectionTextureMatrix=function(e){var t=this;this._textureMatrix=e,e.updateFlag!==this._textureMatrix.updateFlag&&e.isIdentity()!==this._textureMatrix.isIdentity()&&this.getScene().markAllMaterialsAsDirty(a.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}(o.BaseTexture));u._TypeStore.RegisteredTypes["BABYLON.HDRCubeTexture"]=f},"./Materials/Textures/htmlElementTexture.ts": /*!**************************************************!*\ !*** ./Materials/Textures/htmlElementTexture.ts ***! \**************************************************/ /*! exports provided: HtmlElementTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"HtmlElementTexture",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=(r(/*! ../../Engines/Extensions/engine.dynamicTexture */"./Engines/Extensions/engine.dynamicTexture.ts"),r(/*! ../../Engines/Extensions/engine.videoTexture */"./Engines/Extensions/engine.videoTexture.ts"),function(e){function t(r,i,o){var a=e.call(this,o.scene)||this;return i&&(o.engine||o.scene)?(o=Object(n.__assign)(Object(n.__assign)({},t.DefaultOptions),o),a._engine=o.engine||o.scene.getEngine(),a._generateMipMaps=o.generateMipMaps,a._samplingMode=o.samplingMode,a._textureMatrix=s.Matrix.Identity(),a.name=r,a.element=i,a._isVideo=i instanceof HTMLVideoElement,a.anisotropicFilteringLevel=1,a._createInternalTexture(),a):a}return Object(n.__extends)(t,e),t.prototype._createInternalTexture=function(){var e=0,t=0;this._isVideo?(e=this.element.videoWidth,t=this.element.videoHeight):(e=this.element.width,t=this.element.height),this._texture=this._engine.createDynamicTexture(e,t,this._generateMipMaps,this._samplingMode),this.update()},t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.update=function(e){if(void 0===e&&(e=null),null!=this._texture)if(this._isVideo){var t=this.element;if(t.readyState1||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=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(/*! ./internalTexture */"./Materials/Textures/internalTexture.ts"),a=r(/*! ./cubeTexture */"./Materials/Textures/cubeTexture.ts"),c=r(/*! ../../Engines/constants */"./Engines/constants.ts"),l=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),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 Object(n.__extends)(t,e),t.prototype.update=function(e,t,r,n,i){void 0===i&&(i=null),this._texture.getEngine().updateRawCubeTexture(this._texture,e,t,r,n,i)},t.prototype.updateRGBDAsync=function(e,r,n,i){return void 0===r&&(r=null),void 0===n&&(n=.8),void 0===i&&(i=0),t._UpdateRGBDAsync(this._texture,e,r,n,i)},t.prototype.clone=function(){var e=this;return i.SerializationHelper.Clone(function(){var r=e.getScene(),n=e._texture,i=new t(r,n._bufferViewArray,n.width,n.format,n.type,n.generateMipMaps,n.invertY,n.samplingMode,n._compression);return n.source===s.InternalTextureSource.CubeRawRGBD&&i.updateRGBDAsync(n._bufferViewArrayArray,n._sphericalPolynomial,n._lodGenerationScale,n._lodGenerationOffset),i},this)},t._UpdateRGBDAsync=function(e,t,r,n,i){return e._source=s.InternalTextureSource.CubeRawRGBD,e._bufferViewArrayArray=t,e._lodGenerationScale=n,e._lodGenerationOffset=i,e._sphericalPolynomial=r,o.EnvironmentTextureTools.UploadLevelsAsync(e,t).then(function(){e.isReady=!0})},t}(a.CubeTexture))},"./Materials/Textures/rawTexture.ts": /*!******************************************!*\ !*** ./Materials/Textures/rawTexture.ts ***! \******************************************/ /*! exports provided: RawTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"RawTexture",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n,s,a,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 Object(n.__extends)(t,e),t.prototype.update=function(e){this._engine.updateRawTexture(this._texture,e,this._texture.format,this._texture.invertY,null,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/rawTexture2DArray.ts": /*!*************************************************!*\ !*** ./Materials/Textures/rawTexture2DArray.ts ***! \*************************************************/ /*! exports provided: RawTexture2DArray */function(e,t,r){"use strict";r.r(t),r.d(t,"RawTexture2DArray",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n,s,a,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().createRawTexture2DArray(t,r,n,s,a,l,u,h,null,d),f.is2DArray=!0,f}return Object(n.__extends)(t,e),t.prototype.update=function(e){this._texture&&this._engine.updateRawTexture2DArray(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t}(i.Texture))},"./Materials/Textures/rawTexture3D.ts": /*!********************************************!*\ !*** ./Materials/Textures/rawTexture3D.ts ***! \********************************************/ /*! exports provided: RawTexture3D */function(e,t,r){"use strict";r.r(t),r.d(t,"RawTexture3D",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./texture */"./Materials/Textures/texture.ts"),o=r(/*! ../../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../../Engines/Extensions/engine.rawTexture */"./Engines/Extensions/engine.rawTexture.ts"),function(e){function t(t,r,n,s,a,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,null,d),f.is3D=!0,f}return Object(n.__extends)(t,e),t.prototype.update=function(e){this._texture&&this._engine.updateRawTexture3D(this._texture,e,this._texture.format,this._texture.invertY,null,this._texture.type)},t}(i.Texture))},"./Materials/Textures/refractionTexture.ts": /*!*************************************************!*\ !*** ./Materials/Textures/refractionTexture.ts ***! \*************************************************/ /*! exports provided: RefractionTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"RefractionTexture",function(){return o});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.plane */"./Maths/math.plane.ts"),o=function(e){function t(t,r,n,o){var s=e.call(this,t,r,n,o,!0)||this;return s.refractionPlane=new i.Plane(0,1,0,1),s.depth=2,s.onBeforeRenderObservable.add(function(){n.clipPlane=s.refractionPlane}),s.onAfterRenderObservable.add(function(){n.clipPlane=null}),s}return Object(n.__extends)(t,e),t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var r=this.getSize(),n=new t(this.name,r.width,e,this._generateMipMaps);return n.hasAlpha=this.hasAlpha,n.level=this.level,n.refractionPlane=this.refractionPlane.clone(),this.renderList&&(n.renderList=this.renderList.slice(0)),n.depth=this.depth,n},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);return t.mirrorPlane=this.refractionPlane.asArray(),t.depth=this.depth,t},t}(r(/*! ../../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts").RenderTargetTexture)},"./Materials/Textures/renderTargetCreationOptions.ts": /*!***********************************************************!*\ !*** ./Materials/Textures/renderTargetCreationOptions.ts ***! \***********************************************************/ /*! exports provided: RenderTargetCreationOptions */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderTargetCreationOptions",function(){return n});var n=function(){}},"./Materials/Textures/renderTargetTexture.ts": /*!***************************************************!*\ !*** ./Materials/Textures/renderTargetTexture.ts ***! \***************************************************/ /*! exports provided: RenderTargetTexture */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderTargetTexture",function(){return d});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Materials/Textures/texture */"./Materials/Textures/texture.ts"),c=r(/*! ../../PostProcesses/postProcessManager */"./PostProcesses/postProcessManager.ts"),l=r(/*! ../../Rendering/renderingManager */"./Rendering/renderingManager.ts"),u=r(/*! ../../Engines/constants */"./Engines/constants.ts"),h=(r(/*! ../../Engines/Extensions/engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),r(/*! ../../Engines/Extensions/engine.renderTargetCube */"./Engines/Extensions/engine.renderTargetCube.ts"),r(/*! ../../Engines/engine */"./Engines/engine.ts")),d=function(e){function t(t,r,n,o,c,h,d,f,p,m,g,_,v){void 0===c&&(c=!0),void 0===h&&(h=u.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===d&&(d=!1),void 0===f&&(f=a.Texture.TRILINEAR_SAMPLINGMODE),void 0===p&&(p=!0),void 0===m&&(m=!1),void 0===g&&(g=!1),void 0===_&&(_=u.Constants.TEXTUREFORMAT_RGBA),void 0===v&&(v=!1);var A=e.call(this,null,n,!o)||this;return A.isCube=d,A.renderParticles=!0,A.renderSprites=!1,A.coordinatesMode=a.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.onResizeObservable=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=c,A._renderingManager=new l.RenderingManager(n),A._renderingManager._useSceneAutoClearSetup=!0,g?A:(A._renderTargetOptions={generateMipMaps:o,type:h,format:_,samplingMode:f,generateDepthBuffer:p,generateStencilBuffer:m},f===a.Texture.NEAREST_SAMPLINGMODE&&(A.wrapU=a.Texture.CLAMP_ADDRESSMODE,A.wrapV=a.Texture.CLAMP_ADDRESSMODE),v||(d?(A._texture=n.getEngine().createRenderTargetCubeTexture(A.getRenderSize(),A._renderTargetOptions),A.coordinatesMode=a.Texture.INVCUBIC_MODE,A._textureMatrix=s.Matrix.Identity()):A._texture=n.getEngine().createRenderTargetTexture(A._size,A._renderTargetOptions)),A)):A}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"renderList",{get:function(){return this._renderList},set:function(e){this._renderList=e,this._renderList&&this._hookArray(this._renderList)},enumerable:!0,configurable:!0}),t.prototype._hookArray=function(e){var t=this,r=e.push;e.push=function(){for(var n=[],i=0;i0&&(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},t.prototype.getRenderLayers=function(){var e=this._size.layers;return e||0},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.scale=function(e){var t=Math.max(1,this.getRenderSize()*e);this.resize(t)},t.prototype.getReflectionTextureMatrix=function(){return this.isCube?this._textureMatrix:e.prototype.getReflectionTextureMatrix.call(this)},t.prototype.resize=function(e){var t=this.isCube;this.releaseInternalTexture();var r=this.getScene();r&&(this._processSizeParameter(e),this._texture=t?r.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):r.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))},t.prototype.render=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=!1),a=this.getScene()){var r,n=a.getEngine();if(void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses),this._waitingRenderList){this.renderList=[];for(var i=0;i1||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=h.Engine.NearestPOT(r+16384/(128+r));return Math.min(h.Engine.FloorPOT(e),n)},t.prototype._prepareRenderingManager=function(e,t,r,n){var i=this.getScene();if(i){this._renderingManager.reset();for(var o=i.getRenderId(),s=0;s=0&&this._renderingManager.dispatchParticles(d))}}},t.prototype._bindFrameBuffer=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0);var r=this.getScene();if(r){var n=r.getEngine();this._texture&&n.bindFramebuffer(this._texture,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,0,t)}},t.prototype.unbindFrameBuffer=function(e,t){var r=this;this._texture&&e.unBindFramebuffer(this._texture,this.isCube,function(){r.onAfterRenderObservable.notifyObservers(t)})},t.prototype.renderToTarget=function(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=null);var s=this.getScene();if(s){var a=s.getEngine();if(this._texture){this._postProcessManager?this._postProcessManager._prepareFrame(this._texture,this._postProcesses):t&&s.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(e,n),this.is2DArray?this.onBeforeRenderObservable.notifyObservers(n):this.onBeforeRenderObservable.notifyObservers(e);var c=null,l=this.renderList?this.renderList:s.getActiveMeshes().data,u=this.renderList?this.renderList.length:s.getActiveMeshes().length;this.getCustomRenderList&&(c=this.getCustomRenderList(this.is2DArray?n:e,l,u)),c?this._prepareRenderingManager(c,c.length,i,!1):(this._defaultRenderListPrepared||(this._prepareRenderingManager(l,u,i,!this.renderList),this._defaultRenderListPrepared=!0),c=l),this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(a):a.clear(this.clearColor||s.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||s.updateTransformMatrix(!0);for(var h=0,d=s._beforeRenderTargetDrawStage;h=0&&t.customRenderTargets.splice(r,1);for(var n=0,i=t.cameras;n=0&&o.customRenderTargets.splice(r,1)}this.depthStencilTexture&&this.getScene().getEngine()._releaseTexture(this.depthStencilTexture),e.prototype.dispose.call(this)}},t.prototype._rebuild=function(){this.refreshRate===t.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=t.REFRESHRATE_RENDER_ONCE),this._postProcessManager&&this._postProcessManager._rebuild()},t.prototype.freeRenderingGroups=function(){this._renderingManager&&this._renderingManager.freeRenderingGroups()},t.prototype.getViewCount=function(){return 1},t.REFRESHRATE_RENDER_ONCE=0,t.REFRESHRATE_RENDER_ONEVERYFRAME=1,t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2,t}(a.Texture);a.Texture._CreateRenderTargetTexture=function(e,t,r,n){return new d(e,t,r,n)}},"./Materials/Textures/texture.ts": /*!***************************************!*\ !*** ./Materials/Textures/texture.ts ***! \***************************************/ /*! exports provided: Texture */function(e,t,r){"use strict";r.r(t),r.d(t,"Texture",function(){return m});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Materials/Textures/baseTexture */"./Materials/Textures/baseTexture.ts"),c=r(/*! ../../Engines/constants */"./Engines/constants.ts"),l=r(/*! ../../Misc/typeStore */"./Misc/typeStore.ts"),u=r(/*! ../../Misc/devTools */"./Misc/devTools.ts"),h=r(/*! ../../Misc/timingTools */"./Misc/timingTools.ts"),d=r(/*! ../../Misc/instantiationTools */"./Misc/instantiationTools.ts"),f=r(/*! ../../Maths/math.plane */"./Maths/math.plane.ts"),p=r(/*! ../../Misc/stringTools */"./Misc/stringTools.ts"),m=function(e){function t(r,n,i,s,a,l,u,d,f,p,m){void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===a&&(a=t.TRILINEAR_SAMPLINGMODE),void 0===l&&(l=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===f&&(f=!1);var g=e.call(this,n&&"Scene"===n.getClassName()?n:null)||this;g.url=null,g.uOffset=0,g.vOffset=0,g.uScale=1,g.vScale=1,g.uAng=0,g.vAng=0,g.wAng=0,g.uRotationCenter=.5,g.vRotationCenter=.5,g.wRotationCenter=.5,g.inspectableCustomProperties=null,g._noMipmap=!1,g._invertY=!1,g._rowGenerationMatrix=null,g._cachedTextureMatrix=null,g._projectionModeMatrix=null,g._t0=null,g._t1=null,g._t2=null,g._cachedUOffset=-1,g._cachedVOffset=-1,g._cachedUScale=0,g._cachedVScale=0,g._cachedUAng=-1,g._cachedVAng=-1,g._cachedWAng=-1,g._cachedProjectionMatrixId=-1,g._cachedCoordinatesMode=-1,g._initialSamplingMode=t.BILINEAR_SAMPLINGMODE,g._buffer=null,g._deleteBuffer=!1,g._format=null,g._delayedOnLoad=null,g._delayedOnError=null,g.onLoadObservable=new o.Observable,g._isBlocking=!0,g.name=r||"",g.url=r,g._noMipmap=i,g._invertY=s,g._initialSamplingMode=a,g._buffer=d,g._deleteBuffer=f,g._mimeType=m,p&&(g._format=p);var _=g.getScene(),v=n&&n.getCaps?n:_?_.getEngine():null;if(!v)return g;v.onBeforeTextureInitObservable.notifyObservers(g);var A=function(){g._texture&&(g._texture._invertVScale&&(g.vScale*=-1,g.vOffset+=1),null!==g._texture._cachedWrapU&&(g.wrapU=g._texture._cachedWrapU,g._texture._cachedWrapU=null),null!==g._texture._cachedWrapV&&(g.wrapV=g._texture._cachedWrapV,g._texture._cachedWrapV=null),null!==g._texture._cachedWrapR&&(g.wrapR=g._texture._cachedWrapR,g._texture._cachedWrapR=null)),g.onLoadObservable.hasObservers()&&g.onLoadObservable.notifyObservers(g),l&&l(),!g.isBlocking&&_&&_.resetCachedMaterial()};return g.url?(g._texture=g._getFromCache(g.url,i,a,s),g._texture?g._texture.isReady?h.TimingTools.SetImmediate(function(){return A()}):g._texture.onLoadedObservable.add(A):_&&_.useDelayedTextureLoading?(g.delayLoadState=c.Constants.DELAYLOADSTATE_NOTLOADED,g._delayedOnLoad=A,g._delayedOnError=u):(g._texture=v.createTexture(g.url,i,s,_,a,A,u,g._buffer,void 0,g._format,null,m),f&&delete g._buffer),g):(g._delayedOnLoad=A,g._delayedOnError=u,g)}return Object(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(c.Constants.MATERIAL_TextureDirtyFlag)),this.name&&!p.StringTools.StartsWith(this.name,"data:")||(this.name=e),this.url=e,this._buffer=t,this.delayLoadState=c.Constants.DELAYLOADSTATE_NOTLOADED,r&&(this._delayedOnLoad=r),this.delayLoad()},t.prototype.delayLoad=function(){if(this.delayLoadState===c.Constants.DELAYLOADSTATE_NOTLOADED){var e=this.getScene();e&&(this.delayLoadState=c.Constants.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,this._noMipmap,this.samplingMode,this._invertY),this._texture?this._delayedOnLoad&&(this._texture.isReady?h.TimingTools.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(this.url,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,null,this._mimeType),this._deleteBuffer&&delete this._buffer),this._delayedOnLoad=null,this._delayedOnError=null)}},t.prototype._prepareRowForTextureGeneration=function(e,t,r,n){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,r-=this.wRotationCenter,s.Vector3.TransformCoordinatesFromFloatsToRef(e,t,r,this._rowGenerationMatrix,n),n.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,n.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,n.z+=this.wRotationCenter},t.prototype.getTextureMatrix=function(e){var t=this;if(void 0===e&&(e=1),this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedTextureMatrix||(this._cachedTextureMatrix=s.Matrix.Zero(),this._rowGenerationMatrix=new s.Matrix,this._t0=s.Vector3.Zero(),this._t1=s.Vector3.Zero(),this._t2=s.Vector3.Zero()),s.Matrix.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),s.Matrix.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix);var r=this.getScene();return r?(r.markAllMaterialsAsDirty(c.Constants.MATERIAL_TextureDirtyFlag,function(e){return e.hasTexture(t)}),this._cachedTextureMatrix):this._cachedTextureMatrix},t.prototype.getReflectionTextureMatrix=function(){var e=this,r=this.getScene();if(!r)return this._cachedTextureMatrix;if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale===this._cachedUScale&&this.vScale===this._cachedVScale&&this.coordinatesMode===this._cachedCoordinatesMode){if(this.coordinatesMode!==t.PROJECTION_MODE)return this._cachedTextureMatrix;if(this._cachedProjectionMatrixId===r.getProjectionMatrix().updateFlag)return this._cachedTextureMatrix}switch(this._cachedTextureMatrix||(this._cachedTextureMatrix=s.Matrix.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=s.Matrix.Zero()),this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale,this._cachedVScale=this.vScale,this._cachedCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case t.PLANAR_MODE:s.Matrix.IdentityToRef(this._cachedTextureMatrix),this._cachedTextureMatrix[0]=this.uScale,this._cachedTextureMatrix[5]=this.vScale,this._cachedTextureMatrix[12]=this.uOffset,this._cachedTextureMatrix[13]=this.vOffset;break;case t.PROJECTION_MODE:s.Matrix.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);var n=r.getProjectionMatrix();this._cachedProjectionMatrixId=n.updateFlag,n.multiplyToRef(this._projectionModeMatrix,this._cachedTextureMatrix);break;default:s.Matrix.IdentityToRef(this._cachedTextureMatrix)}return r.markAllMaterialsAsDirty(c.Constants.MATERIAL_TextureDirtyFlag,function(t){return-1!==t.getActiveTextures().indexOf(e)}),this._cachedTextureMatrix},t.prototype.clone=function(){var e=this;return i.SerializationHelper.Clone(function(){return new t(e._texture?e._texture.url:null,e.getScene(),e._noMipmap,e._invertY,e.samplingMode,void 0,void 0,e._texture?e._texture._buffer:void 0)},this)},t.prototype.serialize=function(){var r=this.name;t.SerializeBuffers||p.StringTools.StartsWith(this.name,"data:")&&(this.name="");var n=e.prototype.serialize.call(this);return n?(t.SerializeBuffers&&("string"==typeof this._buffer&&"data:"===this._buffer.substr(0,5)?(n.base64String=this._buffer,n.name=n.name.replace("data:","")):this.url&&p.StringTools.StartsWith(this.url,"data:")&&this._buffer instanceof Uint8Array&&(n.base64String="data:image/png;base64,"+p.StringTools.EncodeArrayBufferToBase64(this._buffer))),n.invertY=this._invertY,n.samplingMode=this.samplingMode,this.name=r,n):null},t.prototype.getClassName=function(){return"Texture"},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null},t.Parse=function(e,r,n){if(e.customType){var o=d.InstantiationTools.Instantiate(e.customType).Parse(e,r,n);return e.samplingMode&&o.updateSamplingMode&&o._samplingMode&&o._samplingMode!==e.samplingMode&&o.updateSamplingMode(e.samplingMode),o}if(e.isCube&&!e.isRenderTarget)return t._CubeTextureParser(e,r,n);if(!e.name&&!e.isRenderTarget)return null;var s=i.SerializationHelper.Parse(function(){var i,o=!0;if(e.noMipmap&&(o=!1),e.mirrorPlane){var s=t._CreateMirror(e.name,e.renderTargetSize,r,o);return s._waitingRenderList=e.renderList,s.mirrorPlane=f.Plane.FromArray(e.mirrorPlane),s}if(e.isRenderTarget){var a=null;if(e.isCube){if(r.reflectionProbes)for(var c=0;c=u.video.HAVE_CURRENT_DATA;return!l.poster||l.autoPlay&&h?h&&u._createInternalTexture():(u._texture=u._engine.createTexture(l.poster,!1,!u.invertY,n),u._displayingPosterTexture=!0),u}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"onUserActionRequestedObservable",{get:function(){return this._onUserActionRequestedObservable||(this._onUserActionRequestedObservable=new i.Observable),this._onUserActionRequestedObservable},enumerable:!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,this._currentSrc=e},t.prototype.clone=function(){return new t(this.name,this._currentSrc,this.getScene(),this._generateMipMaps,this.invertY,this.samplingMode,this._settings)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._currentSrc=null,this._onUserActionRequestedObservable&&(this._onUserActionRequestedObservable.clear(),this._onUserActionRequestedObservable=null),this.video.removeEventListener(this._createInternalTextureOnEvent,this._createInternalTexture),this.video.removeEventListener("paused",this._updateInternalTexture),this.video.removeEventListener("seeked",this._updateInternalTexture),this.video.removeEventListener("emptied",this.reset),this.video.pause()},t.CreateFromStreamAsync=function(e,r){var n=document.createElement("video");return n.setAttribute("autoplay",""),n.setAttribute("muted","true"),n.setAttribute("playsinline",""),n.muted=!0,void 0!==n.mozSrcObject?n.mozSrcObject=r:"object"==typeof n.srcObject?n.srcObject=r:(window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,n.src=window.URL&&window.URL.createObjectURL(r)),new Promise(function(r){var i=function(){r(new t("video",n,e,!0,!0)),n.removeEventListener("playing",i)};n.addEventListener("playing",i),n.play()})},t.CreateFromWebCamAsync=function(e,t,r){var n,i=this;return void 0===r&&(r=!1),t&&t.deviceId&&(n={exact:t.deviceId}),navigator.mediaDevices?navigator.mediaDevices.getUserMedia({video:t,audio:r}).then(function(t){return i.CreateFromStreamAsync(e,t)}):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getUserMedia&&navigator.getUserMedia({video:{deviceId:n,width:{min:t&&t.minWidth||256,max:t&&t.maxWidth||640},height:{min:t&&t.minHeight||256,max:t&&t.maxHeight||480}},audio:r},function(t){return i.CreateFromStreamAsync(e,t)},function(e){s.Logger.Error(e.name)}),Promise.reject("No support for userMedia on this device"))},t.CreateFromWebCam=function(e,t,r,n){void 0===n&&(n=!1),this.CreateFromWebCamAsync(e,r,n).then(function(e){t&&t(e)}).catch(function(e){s.Logger.Error(e.name)})},t}(a.Texture))},"./Materials/colorCurves.ts": /*!**********************************!*\ !*** ./Materials/colorCurves.ts ***! \**********************************/ /*! exports provided: ColorCurves */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorCurves",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),s=function(){function e(){this._dirty=!0,this._tempColor=new o.Color4(0,0,0,0),this._globalCurve=new o.Color4(0,0,0,0),this._highlightsCurve=new o.Color4(0,0,0,0),this._midtonesCurve=new o.Color4(0,0,0,0),this._shadowsCurve=new o.Color4(0,0,0,0),this._positiveCurve=new o.Color4(0,0,0,0),this._negativeCurve=new o.Color4(0,0,0,0),this._globalHue=30,this._globalDensity=0,this._globalSaturation=0,this._globalExposure=0,this._highlightsHue=30,this._highlightsDensity=0,this._highlightsSaturation=0,this._highlightsExposure=0,this._midtonesHue=30,this._midtonesDensity=0,this._midtonesSaturation=0,this._midtonesExposure=0,this._shadowsHue=30,this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}return Object.defineProperty(e.prototype,"globalHue",{get:function(){return this._globalHue},set:function(e){this._globalHue=e,this._dirty=!0},enumerable:!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)},Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalHue",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalDensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalSaturation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_globalExposure",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsHue",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsDensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsSaturation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_highlightsExposure",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesHue",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesDensity",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesSaturation",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_midtonesExposure",void 0),e}();i.SerializationHelper._ColorCurvesParser=s.Parse},"./Materials/effect.ts": /*!*****************************!*\ !*** ./Materials/effect.ts ***! \*****************************/ /*! exports provided: Effect */function(e,t,r){"use strict";r.r(t),r.d(t,"Effect",function(){return c});var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ../Engines/constants */"./Engines/constants.ts"),o=r(/*! ../Misc/domManagement */"./Misc/domManagement.ts"),s=r(/*! ../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../Engines/Processors/shaderProcessor */"./Engines/Processors/shaderProcessor.ts"),c=function(){function e(t,r,i,s,c,l,u,h,d,f){var p,m,g=this;if(void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=null),void 0===h&&(h=null),void 0===d&&(d=null),this.name=null,this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new n.Observable,this.onErrorObservable=new n.Observable,this._onBindObservable=null,this._wasPreviouslyReady=!1,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._pipelineContext=null,this._valueCache={},this.name=t,r.attributes){var _=r;if(this._engine=i,this._attributesNames=_.attributes,this._uniformsNames=_.uniformsNames.concat(_.samplers),this._samplerList=_.samplers.slice(),this.defines=_.defines,this.onError=_.onError,this.onCompiled=_.onCompiled,this._fallbacks=_.fallbacks,this._indexParameters=_.indexParameters,this._transformFeedbackVaryings=_.transformFeedbackVaryings||null,_.uniformBuffersNames)for(var v=0;v<_.uniformBuffersNames.length;v++)this._uniformBuffersNames[_.uniformBuffersNames[v]]=v}else this._engine=c,this.defines=null==l?"":l,this._uniformsNames=i.concat(s),this._samplerList=s?s.slice():[],this._attributesNames=r,this.onError=d,this.onCompiled=h,this._indexParameters=f,this._fallbacks=u;this._attributeLocationByName={},this.uniqueId=e._uniqueIdSeed++;var A=o.DomManagement.IsWindowObjectExist()?this._engine.getHostDocument():null;t.vertexSource?p="source:"+t.vertexSource:t.vertexElement?(p=A?A.getElementById(t.vertexElement):null)||(p=t.vertexElement):p=t.vertex||t,t.fragmentSource?m="source:"+t.fragmentSource:t.fragmentElement?(m=A?A.getElementById(t.fragmentElement):null)||(m=t.fragmentElement):m=t.fragment||t;var y={defines:this.defines.split("\n"),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:this._engine._shaderProcessor,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:e.ShadersRepository,includesShadersStore:e.IncludesShadersStore,version:(100*this._engine.webGLVersion).toString(),platformName:this._engine.webGLVersion>=2?"WEBGL2":"WEBGL1"};this._loadShader(p,"Vertex","",function(e){g._loadShader(m,"Fragment","Pixel",function(r){a.ShaderProcessor.Process(e,y,function(e){y.isFragment=!0,a.ShaderProcessor.Process(r,y,function(r){g._useFinalCode(e,r,t)})})})})}return Object.defineProperty(e.prototype,"onBindObservable",{get:function(){return this._onBindObservable||(this._onBindObservable=new n.Observable),this._onBindObservable},enumerable:!0,configurable:!0}),e.prototype._useFinalCode=function(e,t,r){if(r){var n=r.vertexElement||r.vertex||r.spectorName||r,i=r.fragmentElement||r.fragment||r.spectorName||r;this._vertexSourceCode="#define SHADER_NAME vertex:"+n+"\n"+e,this._fragmentSourceCode="#define SHADER_NAME fragment:"+i+"\n"+t}else this._vertexSourceCode=e,this._fragmentSourceCode=t;this._prepareEffect()},Object.defineProperty(e.prototype,"key",{get:function(){return this._key},enumerable:!0,configurable:!0}),e.prototype.isReady=function(){try{return this._isReadyInternal()}catch(e){return!1}},e.prototype._isReadyInternal=function(){return!!this._isReady||!!this._pipelineContext&&this._pipelineContext.isReady},e.prototype.getEngine=function(){return this._engine},e.prototype.getPipelineContext=function(){return this._pipelineContext},e.prototype.getAttributesNames=function(){return this._attributesNames},e.prototype.getAttributeLocation=function(e){return this._attributes[e]},e.prototype.getAttributeLocationByName=function(e){return this._attributeLocationByName[e]},e.prototype.getAttributesCount=function(){return this._attributes.length},e.prototype.getUniformIndex=function(e){return this._uniformsNames.indexOf(e)},e.prototype.getUniform=function(e){return this._uniforms[e]},e.prototype.getSamplers=function(){return this._samplerList},e.prototype.getCompilationError=function(){return this._compilationError},e.prototype.allFallbacksProcessed=function(){return this._allFallbacksProcessed},e.prototype.executeWhenCompiled=function(e){var t=this;this.isReady()?e(this):(this.onCompileObservable.add(function(t){e(t)}),this._pipelineContext&&!this._pipelineContext.isAsync||setTimeout(function(){t._checkIsReady(null)},16))},e.prototype._checkIsReady=function(e){var t=this;try{if(this._isReadyInternal())return}catch(t){return void this._processCompilationErrors(t,e)}setTimeout(function(){t._checkIsReady(e)},16)},e.prototype._loadShader=function(t,r,n,i){var s;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return void i(o.DomManagement.GetDOMTextContent(t));"source:"!==t.substr(0,7)?"base64:"!==t.substr(0,7)?e.ShadersStore[t+r+"Shader"]?i(e.ShadersStore[t+r+"Shader"]):n&&e.ShadersStore[t+n+"Shader"]?i(e.ShadersStore[t+n+"Shader"]):(s="."===t[0]||"/"===t[0]||t.indexOf("http")>-1?t:e.ShadersRepository+t,this._engine._loadFile(s+"."+r.toLowerCase()+".fx",i)):i(window.atob(t.substr(7))):i(t.substr(7))},e.prototype._rebuildProgram=function(e,t,r,n){var o=this;this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=function(e,t){n&&n(t)},this.onCompiled=function(){var e=o.getEngine().scenes;if(e)for(var t=0;tthis._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)},e.prototype.addCPUSkinningFallback=function(e,t){this._mesh=t,ethis._maxRank&&(this._maxRank=e)},Object.defineProperty(e.prototype,"hasMoreFallbacks",{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.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;n0&&(i.computeBonesUsingShaders=!1)}}else{var a=this._defines[this._currentRank];if(a)for(n=0;n1&&i!=e.length-1?r._getNextFrameBuffer():t,r.setViewport(),r.applyEffectWrapper(n),o&&r.engine.bindFramebuffer(o.getInternalTexture()),r.draw(),o&&r.engine.unBindFramebuffer(o.getInternalTexture())})},e.prototype.dispose=function(){this._ringScreenBuffer&&(this._ringScreenBuffer.forEach(function(e){e.dispose()}),this._ringScreenBuffer=null);var e=this._vertexBuffers[o.VertexBuffer.PositionKind];e&&(e.dispose(),delete this._vertexBuffers[o.VertexBuffer.PositionKind]),this._indexBuffer&&this.engine._releaseBuffer(this._indexBuffer)},e._DefaultOptions={positions:[1,1,-1,1,-1,-1,1,-1],indices:[0,1,2,0,2,3]},e}()),h=function(){function e(e){var t,r=this;this.onApplyObservable=new c.Observable;var n=e.uniformNames||[];e.vertexShader?t={fragmentSource:e.fragmentShader,vertexSource:e.vertexShader,spectorName:e.name||"effectWrapper"}:(n.push("scale"),t={fragmentSource:e.fragmentShader,vertex:"postprocess",spectorName:e.name||"effectWrapper"},this.onApplyObservable.add(function(){r.effect.setFloat2("scale",1,1)})),this.effect=new l.Effect(t,e.attributeNames||["position"],n,e.samplerNames,e.engine)}return e.prototype.dispose=function(){this.effect.dispose()},e}()},"./Materials/fresnelParameters.ts": /*!****************************************!*\ !*** ./Materials/fresnelParameters.ts ***! \****************************************/ /*! exports provided: FresnelParameters */function(e,t,r){"use strict";r.r(t),r.d(t,"FresnelParameters",function(){return c});var n=r(/*! ../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Engines/engine */"./Engines/engine.ts"),s=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),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.color */"./Maths/math.color.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 Object(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(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=null!=t?t:n/r,o=Math.tan(.5*this.vignetteCameraFov),a=o*i,c=Math.sqrt(a*o);a=s.Tools.Mix(a,c,this.vignetteStretch),o=s.Tools.Mix(o,c,this.vignetteStretch),e.setFloat4("vignetteSettings1",a,o,-a*this.vignetteCentreX,-o*this.vignetteCentreY);var u=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,u)}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);var h=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(h-1)/h,.5/h,h,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,Object(n.__decorate)([Object(i.serializeAsColorCurves)()],e.prototype,"colorCurves",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorCurvesEnabled",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("colorGradingTexture")],e.prototype,"_colorGradingTexture",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorGradingEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorGradingWithGreenDepth",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_colorGradingBGR",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_exposure",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_toneMappingEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_toneMappingType",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_contrast",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteStretch",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteCentreX",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteCentreY",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteWeight",void 0),Object(n.__decorate)([Object(i.serializeAsColor4)()],e.prototype,"vignetteColor",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"vignetteCameraFov",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_vignetteBlendMode",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_vignetteEnabled",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_applyByPostProcess",void 0),Object(n.__decorate)([Object(i.serialize)()],e.prototype,"_isEnabled",void 0),e}();i.SerializationHelper._ImageProcessingConfigurationParser=h.Parse},"./Materials/index.ts": /*!****************************!*\ !*** ./Materials/index.ts ***! \****************************/ /*! exports provided: ColorCurves, EffectFallbacks, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PBRMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, DynamicTexture, EquiRectangularCubeTexture, HDRCubeTexture, InternalTextureSource, InternalTexture, MirrorTexture, MultiRenderTarget, RawTexture, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, EffectRenderer, EffectWrapper, BackgroundMaterial, PBRMaterialDefines, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, RawCubeTexture, RawTexture3D, RawTexture2DArray, RefractionTexture, VideoTexture, HtmlElementTexture, NodeMaterialConnectionPointCompatibilityStates, NodeMaterialConnectionPointDirection, NodeMaterialConnectionPoint, NodeMaterialBlock, NodeMaterialDefines, NodeMaterial, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, _BasisTextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTexture, ProceduralTextureSceneComponent, TexturePacker, TexturePackerFrame, NodeMaterialBlockTargets, NodeMaterialBlockConnectionPointTypes, NodeMaterialBlockConnectionPointMode, NodeMaterialSystemValues, MultiplyBlock, AddBlock, ScaleBlock, ClampBlock, CrossBlock, DotBlock, TransformBlock, RemapBlock, NormalizeBlock, TrigonometryBlockOperations, TrigonometryBlock, ColorMergerBlock, VectorMergerBlock, ColorSplitterBlock, VectorSplitterBlock, LerpBlock, DivideBlock, SubtractBlock, StepBlock, OneMinusBlock, ViewDirectionBlock, FresnelBlock, MaxBlock, MinBlock, DistanceBlock, LengthBlock, NegateBlock, PowBlock, RandomNumberBlock, ArcTan2Block, SmoothStepBlock, ReciprocalBlock, ReplaceColorBlock, PosterizeBlock, WaveBlockKind, WaveBlock, GradientBlockColorStep, GradientBlock, NLerpBlock, WorleyNoise3DBlock, SimplexPerlin3DBlock, NormalBlendBlock, Rotate2dBlock, ReflectBlock, RefractBlock, DesaturateBlock, NodeMaterialOptimizer, VertexOutputBlock, BonesBlock, InstancesBlock, MorphTargetsBlock, LightInformationBlock, FragmentOutputBlock, ImageProcessingBlock, PerturbNormalBlock, DiscardBlock, FrontFacingBlock, DerivativeBlock, FogBlock, LightBlock, TextureBlock, ReflectionTextureBlock, InputBlock, AnimatedInputBlockTypes */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(/*! ./effectFallbacks */"./Materials/effectFallbacks.ts");r.d(t,"EffectFallbacks",function(){return o.EffectFallbacks});var s=r(/*! ./effect */"./Materials/effect.ts");r.d(t,"Effect",function(){return s.Effect});var a=r(/*! ./fresnelParameters */"./Materials/fresnelParameters.ts");r.d(t,"FresnelParameters",function(){return a.FresnelParameters});var c=r(/*! ./imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts");r.d(t,"ImageProcessingConfigurationDefines",function(){return c.ImageProcessingConfigurationDefines}),r.d(t,"ImageProcessingConfiguration",function(){return c.ImageProcessingConfiguration});var l=r(/*! ./material */"./Materials/material.ts");r.d(t,"Material",function(){return l.Material});var u=r(/*! ./materialDefines */"./Materials/materialDefines.ts");r.d(t,"MaterialDefines",function(){return u.MaterialDefines});var h=r(/*! ./materialHelper */"./Materials/materialHelper.ts");r.d(t,"MaterialHelper",function(){return h.MaterialHelper});var d=r(/*! ./multiMaterial */"./Materials/multiMaterial.ts");r.d(t,"MultiMaterial",function(){return d.MultiMaterial});var f=r(/*! ./PBR/index */"./Materials/PBR/index.ts");r.d(t,"PBRMaterial",function(){return f.PBRMaterial}),r.d(t,"PBRMaterialDefines",function(){return f.PBRMaterialDefines}),r.d(t,"PBRBaseMaterial",function(){return f.PBRBaseMaterial}),r.d(t,"PBRBaseSimpleMaterial",function(){return f.PBRBaseSimpleMaterial}),r.d(t,"PBRMetallicRoughnessMaterial",function(){return f.PBRMetallicRoughnessMaterial}),r.d(t,"PBRSpecularGlossinessMaterial",function(){return f.PBRSpecularGlossinessMaterial});var p=r(/*! ./pushMaterial */"./Materials/pushMaterial.ts");r.d(t,"PushMaterial",function(){return p.PushMaterial});var m=r(/*! ./shaderMaterial */"./Materials/shaderMaterial.ts");r.d(t,"ShaderMaterial",function(){return m.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 _=r(/*! ./Textures/index */"./Materials/Textures/index.ts");r.d(t,"BaseTexture",function(){return _.BaseTexture}),r.d(t,"CubeTexture",function(){return _.CubeTexture}),r.d(t,"DynamicTexture",function(){return _.DynamicTexture}),r.d(t,"EquiRectangularCubeTexture",function(){return _.EquiRectangularCubeTexture}),r.d(t,"HDRCubeTexture",function(){return _.HDRCubeTexture}),r.d(t,"InternalTextureSource",function(){return _.InternalTextureSource}),r.d(t,"InternalTexture",function(){return _.InternalTexture}),r.d(t,"MirrorTexture",function(){return _.MirrorTexture}),r.d(t,"MultiRenderTarget",function(){return _.MultiRenderTarget}),r.d(t,"RawTexture",function(){return _.RawTexture}),r.d(t,"RenderTargetTexture",function(){return _.RenderTargetTexture}),r.d(t,"Texture",function(){return _.Texture}),r.d(t,"ColorGradingTexture",function(){return _.ColorGradingTexture}),r.d(t,"RawCubeTexture",function(){return _.RawCubeTexture}),r.d(t,"RawTexture3D",function(){return _.RawTexture3D}),r.d(t,"RawTexture2DArray",function(){return _.RawTexture2DArray}),r.d(t,"RefractionTexture",function(){return _.RefractionTexture}),r.d(t,"VideoTexture",function(){return _.VideoTexture}),r.d(t,"HtmlElementTexture",function(){return _.HtmlElementTexture}),r.d(t,"_DDSTextureLoader",function(){return _._DDSTextureLoader}),r.d(t,"_ENVTextureLoader",function(){return _._ENVTextureLoader}),r.d(t,"_KTXTextureLoader",function(){return _._KTXTextureLoader}),r.d(t,"_TGATextureLoader",function(){return _._TGATextureLoader}),r.d(t,"_BasisTextureLoader",function(){return _._BasisTextureLoader}),r.d(t,"CustomProceduralTexture",function(){return _.CustomProceduralTexture}),r.d(t,"NoiseProceduralTexture",function(){return _.NoiseProceduralTexture}),r.d(t,"ProceduralTexture",function(){return _.ProceduralTexture}),r.d(t,"ProceduralTextureSceneComponent",function(){return _.ProceduralTextureSceneComponent}),r.d(t,"TexturePacker",function(){return _.TexturePacker}),r.d(t,"TexturePackerFrame",function(){return _.TexturePackerFrame});var v=r(/*! ./uniformBuffer */"./Materials/uniformBuffer.ts");r.d(t,"UniformBuffer",function(){return v.UniformBuffer});var A=r(/*! ./materialFlags */"./Materials/materialFlags.ts");r.d(t,"MaterialFlags",function(){return A.MaterialFlags});var y=r(/*! ./Node/index */"./Materials/Node/index.ts");r.d(t,"NodeMaterialConnectionPointCompatibilityStates",function(){return y.NodeMaterialConnectionPointCompatibilityStates}),r.d(t,"NodeMaterialConnectionPointDirection",function(){return y.NodeMaterialConnectionPointDirection}),r.d(t,"NodeMaterialConnectionPoint",function(){return y.NodeMaterialConnectionPoint}),r.d(t,"NodeMaterialBlock",function(){return y.NodeMaterialBlock}),r.d(t,"NodeMaterialDefines",function(){return y.NodeMaterialDefines}),r.d(t,"NodeMaterial",function(){return y.NodeMaterial}),r.d(t,"NodeMaterialBlockTargets",function(){return y.NodeMaterialBlockTargets}),r.d(t,"NodeMaterialBlockConnectionPointTypes",function(){return y.NodeMaterialBlockConnectionPointTypes}),r.d(t,"NodeMaterialBlockConnectionPointMode",function(){return y.NodeMaterialBlockConnectionPointMode}),r.d(t,"NodeMaterialSystemValues",function(){return y.NodeMaterialSystemValues}),r.d(t,"MultiplyBlock",function(){return y.MultiplyBlock}),r.d(t,"AddBlock",function(){return y.AddBlock}),r.d(t,"ScaleBlock",function(){return y.ScaleBlock}),r.d(t,"ClampBlock",function(){return y.ClampBlock}),r.d(t,"CrossBlock",function(){return y.CrossBlock}),r.d(t,"DotBlock",function(){return y.DotBlock}),r.d(t,"TransformBlock",function(){return y.TransformBlock}),r.d(t,"RemapBlock",function(){return y.RemapBlock}),r.d(t,"NormalizeBlock",function(){return y.NormalizeBlock}),r.d(t,"TrigonometryBlockOperations",function(){return y.TrigonometryBlockOperations}),r.d(t,"TrigonometryBlock",function(){return y.TrigonometryBlock}),r.d(t,"ColorMergerBlock",function(){return y.ColorMergerBlock}),r.d(t,"VectorMergerBlock",function(){return y.VectorMergerBlock}),r.d(t,"ColorSplitterBlock",function(){return y.ColorSplitterBlock}),r.d(t,"VectorSplitterBlock",function(){return y.VectorSplitterBlock}),r.d(t,"LerpBlock",function(){return y.LerpBlock}),r.d(t,"DivideBlock",function(){return y.DivideBlock}),r.d(t,"SubtractBlock",function(){return y.SubtractBlock}),r.d(t,"StepBlock",function(){return y.StepBlock}),r.d(t,"OneMinusBlock",function(){return y.OneMinusBlock}),r.d(t,"ViewDirectionBlock",function(){return y.ViewDirectionBlock}),r.d(t,"FresnelBlock",function(){return y.FresnelBlock}),r.d(t,"MaxBlock",function(){return y.MaxBlock}),r.d(t,"MinBlock",function(){return y.MinBlock}),r.d(t,"DistanceBlock",function(){return y.DistanceBlock}),r.d(t,"LengthBlock",function(){return y.LengthBlock}),r.d(t,"NegateBlock",function(){return y.NegateBlock}),r.d(t,"PowBlock",function(){return y.PowBlock}),r.d(t,"RandomNumberBlock",function(){return y.RandomNumberBlock}),r.d(t,"ArcTan2Block",function(){return y.ArcTan2Block}),r.d(t,"SmoothStepBlock",function(){return y.SmoothStepBlock}),r.d(t,"ReciprocalBlock",function(){return y.ReciprocalBlock}),r.d(t,"ReplaceColorBlock",function(){return y.ReplaceColorBlock}),r.d(t,"PosterizeBlock",function(){return y.PosterizeBlock}),r.d(t,"WaveBlockKind",function(){return y.WaveBlockKind}),r.d(t,"WaveBlock",function(){return y.WaveBlock}),r.d(t,"GradientBlockColorStep",function(){return y.GradientBlockColorStep}),r.d(t,"GradientBlock",function(){return y.GradientBlock}),r.d(t,"NLerpBlock",function(){return y.NLerpBlock}),r.d(t,"WorleyNoise3DBlock",function(){return y.WorleyNoise3DBlock}),r.d(t,"SimplexPerlin3DBlock",function(){return y.SimplexPerlin3DBlock}),r.d(t,"NormalBlendBlock",function(){return y.NormalBlendBlock}),r.d(t,"Rotate2dBlock",function(){return y.Rotate2dBlock}),r.d(t,"ReflectBlock",function(){return y.ReflectBlock}),r.d(t,"RefractBlock",function(){return y.RefractBlock}),r.d(t,"DesaturateBlock",function(){return y.DesaturateBlock}),r.d(t,"NodeMaterialOptimizer",function(){return y.NodeMaterialOptimizer}),r.d(t,"VertexOutputBlock",function(){return y.VertexOutputBlock}),r.d(t,"BonesBlock",function(){return y.BonesBlock}),r.d(t,"InstancesBlock",function(){return y.InstancesBlock}),r.d(t,"MorphTargetsBlock",function(){return y.MorphTargetsBlock}),r.d(t,"LightInformationBlock",function(){return y.LightInformationBlock}),r.d(t,"FragmentOutputBlock",function(){return y.FragmentOutputBlock}),r.d(t,"ImageProcessingBlock",function(){return y.ImageProcessingBlock}),r.d(t,"PerturbNormalBlock",function(){return y.PerturbNormalBlock}),r.d(t,"DiscardBlock",function(){return y.DiscardBlock}),r.d(t,"FrontFacingBlock",function(){return y.FrontFacingBlock}),r.d(t,"DerivativeBlock",function(){return y.DerivativeBlock}),r.d(t,"FogBlock",function(){return y.FogBlock}),r.d(t,"LightBlock",function(){return y.LightBlock}),r.d(t,"TextureBlock",function(){return y.TextureBlock}),r.d(t,"ReflectionTextureBlock",function(){return y.ReflectionTextureBlock}),r.d(t,"InputBlock",function(){return y.InputBlock}),r.d(t,"AnimatedInputBlockTypes",function(){return y.AnimatedInputBlockTypes});var b=r(/*! ./effectRenderer */"./Materials/effectRenderer.ts");r.d(t,"EffectRenderer",function(){return b.EffectRenderer}),r.d(t,"EffectWrapper",function(){return b.EffectWrapper})},"./Materials/material.ts": /*!*******************************!*\ !*** ./Materials/material.ts ***! \*******************************/ /*! exports provided: Material */function(e,t,r){"use strict";r.r(t),r.d(t,"Material",function(){return f});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/tools */"./Misc/tools.ts"),s=r(/*! ../Misc/observable */"./Misc/observable.ts"),a=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),c=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),l=r(/*! ./uniformBuffer */"./Materials/uniformBuffer.ts"),u=r(/*! ../Engines/constants */"./Engines/constants.ts"),h=r(/*! ../Misc/logger */"./Misc/logger.ts"),d=r(/*! ../Maths/math.plane */"./Maths/math.plane.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.onCompiled=null,this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new s.Observable,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=u.Constants.ALPHA_COMBINE,this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.forceDepthWrite=!1,this.depthFunction=0,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this._effect=null,this._useUBO=!1,this._fillMode=e.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this.name=t,this.id=t||o.Tools.RandomId(),this._scene=r||a.EngineStore.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.useRightHandedSystem?this.sideOrientation=e.ClockWiseSideOrientation:this.sideOrientation=e.CounterClockWiseSideOrientation,this._uniformBuffer=new l.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.markDirty(),this.checkReadyOnlyOnce=!0},e.prototype.unfreeze=function(){this.markDirty(),this.checkReadyOnlyOnce=!1},e.prototype.isReady=function(e,t){return!0},e.prototype.isReadyForSubMesh=function(e,t,r){return!1},e.prototype.getEffect=function(){return this._effect},e.prototype.getScene=function(){return this._scene},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(){for(var e=0,t=this.getScene().meshes;e0,t.NUM_MORPH_INFLUENCERS=r.numInfluencers):(t.MORPHTARGETS_UV=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)},e.PrepareDefinesForAttributes=function(e,t,r,n,i,o){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!t._areAttributesDirty&&t._needNormals===t._normals&&t._needUVs===t._uvs)return!1;if(t._normals=t._needNormals,t._uvs=t._needUVs,t.NORMAL=t._needNormals&&e.isVerticesDataPresent(s.VertexBuffer.NormalKind),t._needNormals&&e.isVerticesDataPresent(s.VertexBuffer.TangentKind)&&(t.TANGENT=!0),t._needUVs?(t.UV1=e.isVerticesDataPresent(s.VertexBuffer.UVKind),t.UV2=e.isVerticesDataPresent(s.VertexBuffer.UV2Kind)):(t.UV1=!1,t.UV2=!1),r){var a=e.useVertexColors&&e.isVerticesDataPresent(s.VertexBuffer.ColorKind);t.VERTEXCOLOR=a,t.VERTEXALPHA=e.hasVertexAlpha&&a&&o}return n&&this.PrepareDefinesForBones(e,t),i&&this.PrepareDefinesForMorphTargets(e,t),!0},e.PrepareDefinesForMultiview=function(e,t){if(e.activeCamera){var r=t.MULTIVIEW;t.MULTIVIEW=null!==e.activeCamera.outputRenderTarget&&e.activeCamera.outputRenderTarget.getViewCount()>1,t.MULTIVIEW!=r&&t.markAsUnprocessed()}},e.PrepareDefinesForLight=function(e,t,r,n,i,o,s){switch(s.needNormals=!0,void 0===i["LIGHT"+n]&&(s.needRebuild=!0),i["LIGHT"+n]=!0,i["SPOTLIGHT"+n]=!1,i["HEMILIGHT"+n]=!1,i["POINTLIGHT"+n]=!1,i["DIRLIGHT"+n]=!1,r.prepareLightSpecificDefines(i,n),i["LIGHT_FALLOFF_PHYSICAL"+n]=!1,i["LIGHT_FALLOFF_GLTF"+n]=!1,i["LIGHT_FALLOFF_STANDARD"+n]=!1,r.falloffType){case a.Light.FALLOFF_GLTF:i["LIGHT_FALLOFF_GLTF"+n]=!0;break;case a.Light.FALLOFF_PHYSICAL:i["LIGHT_FALLOFF_PHYSICAL"+n]=!0;break;case a.Light.FALLOFF_STANDARD:i["LIGHT_FALLOFF_STANDARD"+n]=!0}if(o&&!r.specular.equalsFloats(0,0,0)&&(s.specularEnabled=!0),i["SHADOW"+n]=!1,i["SHADOWCSM"+n]=!1,i["SHADOWCSMDEBUG"+n]=!1,i["SHADOWCSMNUM_CASCADES"+n]=!1,i["SHADOWCSMUSESHADOWMAXZ"+n]=!1,i["SHADOWCSMNOBLEND"+n]=!1,i["SHADOWCSM_RIGHTHANDED"+n]=!1,i["SHADOWPCF"+n]=!1,i["SHADOWPCSS"+n]=!1,i["SHADOWPOISSON"+n]=!1,i["SHADOWESM"+n]=!1,i["SHADOWCUBE"+n]=!1,i["SHADOWLOWQUALITY"+n]=!1,i["SHADOWMEDIUMQUALITY"+n]=!1,t&&t.receiveShadows&&e.shadowsEnabled&&r.shadowEnabled){var c=r.getShadowGenerator();if(c){var l=c.getShadowMap();l&&l.renderList&&l.renderList.length>0&&(s.shadowEnabled=!0,c.prepareDefines(i,n))}}r.lightmapMode!=a.Light.LIGHTMAP_DEFAULT?(s.lightmapMode=!0,i["LIGHTMAPEXCLUDED"+n]=!0,i["LIGHTMAPNOSPECULAR"+n]=r.lightmapMode==a.Light.LIGHTMAP_SHADOWSONLY):(i["LIGHTMAPEXCLUDED"+n]=!1,i["LIGHTMAPNOSPECULAR"+n]=!1)},e.PrepareDefinesForLights=function(e,t,r,n,i,o){if(void 0===i&&(i=4),void 0===o&&(o=!1),!r._areLightsDirty)return r._needNormals;var s=0,a={needNormals:!1,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(e.lightsEnabled&&!o)for(var c=0,l=t.lightSources;c0&&(i=n+o,t.addFallback(i,"LIGHT"+o)),e.SHADOWS||(e["SHADOW"+o]&&t.addFallback(n,"SHADOW"+o),e["SHADOWPCF"+o]&&t.addFallback(n,"SHADOWPCF"+o),e["SHADOWPCSS"+o]&&t.addFallback(n,"SHADOWPCSS"+o),e["SHADOWPOISSON"+o]&&t.addFallback(n,"SHADOWPOISSON"+o),e["SHADOWESM"+o]&&t.addFallback(n,"SHADOWESM"+o));return i++},e.PrepareAttributesForMorphTargetsInfluencers=function(e,t,r){this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS=r,this.PrepareAttributesForMorphTargets(e,t,this._TmpMorphInfluencers)},e.PrepareAttributesForMorphTargets=function(e,t,r){var i=r.NUM_MORPH_INFLUENCERS;if(i>0&&o.EngineStore.LastCreatedEngine)for(var a=o.EngineStore.LastCreatedEngine.getCaps().maxVertexAttribs,c=t.morphTargetManager,l=c&&c.supportsNormals&&r.NORMAL,u=c&&c.supportsTangents&&r.TANGENT,h=c&&c.supportsUVs&&r.UV1,d=0;da&&n.Logger.Error("Cannot add more vertex attributes for mesh "+t.name)},e.PrepareAttributesForBones=function(e,t,r,n){r.NUM_BONE_INFLUENCERS>0&&(n.addCPUSkinningFallback(0,t),e.push(s.VertexBuffer.MatricesIndicesKind),e.push(s.VertexBuffer.MatricesWeightsKind),r.NUM_BONE_INFLUENCERS>4&&(e.push(s.VertexBuffer.MatricesIndicesExtraKind),e.push(s.VertexBuffer.MatricesWeightsExtraKind)))},e.PrepareAttributesForInstances=function(e,t){t.INSTANCES&&this.PushAttributesForInstances(e)},e.PushAttributesForInstances=function(e){e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3")},e.BindLightProperties=function(e,t,r){e.transferToEffect(t,r+"")},e.BindLight=function(e,t,r,n,i,o){void 0===o&&(o=!1),e._bindLight(t,r,n,i,o)},e.BindLights=function(e,t,r,n,i,o){void 0===i&&(i=4),void 0===o&&(o=!1);for(var s=Math.min(t.lightSources.length,i),a=0;a-1){var n=r.getTransformMatrixTexture(e);t.setTexture("boneSampler",n),t.setFloat("boneTextureWidth",4*(r.bones.length+1))}else{var i=r.getTransformMatrices(e);i&&t.setMatrices("mBones",i)}}},e.BindMorphTargetParameters=function(e,t){var r=e.morphTargetManager;e&&r&&t.setFloatArray("morphTargetInfluences",r.influences)},e.BindLogDepth=function(e,t,r){e.LOGARITHMICDEPTH&&t.setFloat("logarithmicDepthConstant",2/(Math.log(r.activeCamera.maxZ+1)/Math.LN2))},e.BindClipPlane=function(e,t){if(t.clipPlane){var r=t.clipPlane;e.setFloat4("vClipPlane",r.normal.x,r.normal.y,r.normal.z,r.d)}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)}if(t.clipPlane5){r=t.clipPlane5;e.setFloat4("vClipPlane5",r.normal.x,r.normal.y,r.normal.z,r.d)}if(t.clipPlane6){r=t.clipPlane6;e.setFloat4("vClipPlane6",r.normal.x,r.normal.y,r.normal.z,r.d)}},e._TmpMorphInfluencers={NUM_MORPH_INFLUENCERS:0},e._tempFogColor=c.Color3.Black(),e}()},"./Materials/multiMaterial.ts": /*!************************************!*\ !*** ./Materials/multiMaterial.ts ***! \************************************/ /*! exports provided: MultiMaterial */function(e,t,r){"use strict";r.r(t),r.d(t,"MultiMaterial",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/material */"./Materials/material.ts"),o=r(/*! ../Misc/tags */"./Misc/tags.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=function(e){function t(t,r){var n=e.call(this,t,r,!0)||this;return r.multiMaterials.push(n),n.subMaterials=new Array,n._storeEffectOnSubMeshes=!0,n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"subMaterials",{get:function(){return this._subMaterials},set:function(e){this._subMaterials=e,this._hookArray(e)},enumerable:!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=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=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;i1&&(this._multiview=!0,i.push("#define MULTIVIEW"),-1!==this._options.uniforms.indexOf("viewProjection")&&-1===this._options.uniforms.push("viewProjectionR")&&this._options.uniforms.push("viewProjectionR"));for(var l=0;l4&&(o.push(s.VertexBuffer.MatricesIndicesExtraKind),o.push(s.VertexBuffer.MatricesWeightsExtraKind));var u=e.skeleton;i.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),a.addCPUSkinningFallback(0,e),u.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 "+(u.bones.length+1)),-1===this._options.uniforms.indexOf("mBones")&&this._options.uniforms.push("mBones"))}else i.push("#define NUM_BONE_INFLUENCERS 0");for(var h in this._textures)if(!this._textures[h].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(),this._effect._wasPreviouslyReady=!0,!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")&&(e.multiplyToRef(t.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),this._effect.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)))},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()),this._multiview&&this._effect.setMatrix("viewProjectionR",this.getScene()._transformMatrixR)),this.getScene().activeCamera&&-1!==this._options.uniforms.indexOf("cameraPosition")&&this._effect.setVector3("cameraPosition",this.getScene().activeCamera.globalPosition),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._colors4Arrays)this._effect.setArray4(r,this._colors4Arrays[r]);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._matrixArrays)this._effect.setMatrices(r,this._matrixArrays[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]);for(r in this._vectors4Arrays)this._effect.setArray4(r,this._vectors4Arrays[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;i0,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");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){var a=o._areLightsDisposed;o.markAsProcessed();var c=new v.EffectFallbacks;o.REFLECTION&&c.addFallback(0,"REFLECTION"),o.SPECULAR&&c.addFallback(0,"SPECULAR"),o.BUMP&&c.addFallback(0,"BUMP"),o.PARALLAX&&c.addFallback(1,"PARALLAX"),o.PARALLAXOCCLUSION&&c.addFallback(0,"PARALLAXOCCLUSION"),o.SPECULAROVERALPHA&&c.addFallback(0,"SPECULAROVERALPHA"),o.FOG&&c.addFallback(1,"FOG"),o.POINTSIZE&&c.addFallback(0,"POINTSIZE"),o.LOGARITHMICDEPTH&&c.addFallback(0,"LOGARITHMICDEPTH"),f.MaterialHelper.HandleFallbacksForShadows(o,c,this._maxSimultaneousLights),o.SPECULARTERM&&c.addFallback(0,"SPECULARTERM"),o.DIFFUSEFRESNEL&&c.addFallback(1,"DIFFUSEFRESNEL"),o.OPACITYFRESNEL&&c.addFallback(2,"OPACITYFRESNEL"),o.REFLECTIONFRESNEL&&c.addFallback(3,"REFLECTIONFRESNEL"),o.EMISSIVEFRESNEL&&c.addFallback(4,"EMISSIVEFRESNEL"),o.FRESNEL&&c.addFallback(4,"FRESNEL"),o.MULTIVIEW&&c.addFallback(0,"MULTIVIEW");var h=[l.VertexBuffer.PositionKind];o.NORMAL&&h.push(l.VertexBuffer.NormalKind),o.UV1&&h.push(l.VertexBuffer.UVKind),o.UV2&&h.push(l.VertexBuffer.UV2Kind),o.VERTEXCOLOR&&h.push(l.VertexBuffer.ColorKind),f.MaterialHelper.PrepareAttributesForBones(h,e,o,c),f.MaterialHelper.PrepareAttributesForInstances(h,o),f.MaterialHelper.PrepareAttributesForMorphTargets(h,e,o);var d="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","vClipPlane5","vClipPlane6","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth"],g=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler"],y=["Material","Scene"];u.ImageProcessingConfiguration&&(u.ImageProcessingConfiguration.PrepareUniforms(m,o),u.ImageProcessingConfiguration.PrepareSamplers(g,o)),f.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:m,uniformBuffersNames:y,samplers:g,defines:o,maxSimultaneousLights:this._maxSimultaneousLights}),this.customShaderNameResolve&&(d=this.customShaderNameResolve(d,m,y,g,o));var b=o.toString(),T=r.effect,M=i.getEngine().createEffect(d,{attributes:h,uniformsNames:m,uniformBuffersNames:y,samplers:g,defines:b,fallbacks:c,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:o.NUM_MORPH_INFLUENCERS}},s);if(M)if(this.allowShaderHotSwapping&&T&&!M.isReady()){if(M=T,this._rebuildInParallel=!0,o.markAsUnprocessed(),a)return o._areLightsDisposed=!0,!1}else this._rebuildInParallel=!1,i.resetCachedMaterial(),r.setEffect(M,o),this.buildUniformLayout()}return!(!r.effect||!r.effect.isReady())&&(o._renderId=i.getRenderId(),r.effect._wasPreviouslyReady=!0,!0)},t.prototype.buildUniformLayout=function(){var e=this._uniformBuffer;e.addUniform("diffuseLeftColor",4),e.addUniform("diffuseRightColor",4),e.addUniform("opacityParts",4),e.addUniform("reflectionLeftColor",4),e.addUniform("reflectionRightColor",4),e.addUniform("refractionLeftColor",4),e.addUniform("refractionRightColor",4),e.addUniform("emissiveLeftColor",4),e.addUniform("emissiveRightColor",4),e.addUniform("vDiffuseInfos",2),e.addUniform("vAmbientInfos",2),e.addUniform("vOpacityInfos",2),e.addUniform("vReflectionInfos",2),e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vSpecularInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("diffuseMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("reflectionMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("specularMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("pointSize",1),e.addUniform("refractionMatrix",16),e.addUniform("vRefractionInfos",4),e.addUniform("vSpecularColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("visibility",1),e.addUniform("vDiffuseColor",4),e.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this._refractionTexture&&this._refractionTexture.isRenderTarget&&(this._activeEffect.setTexture("refraction2DSampler",null),t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,r,n){var i=this.getScene(),o=n._materialDefines;if(o){var a=n.effect;if(a){this._activeEffect=a,o.INSTANCES||this.bindOnlyWorldMatrix(e),o.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var l=this._mustRebind(i,a,r.visibility);f.MaterialHelper.BindBonesParameters(r,a);var u=this._uniformBuffer;if(l){if(u.bindToEffect(a,"Material"),this.bindViewProjection(a),!u.useUbo||!this.isFrozen||!u.isSync){if(t.FresnelEnabled&&o.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(u.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),u.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&u.updateColor4("opacityParts",new c.Color3(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(u.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),u.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(u.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),u.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(u.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),u.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),i.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled&&(u.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),f.MaterialHelper.BindTextureMatrix(this._diffuseTexture,u,"diffuse"),this._diffuseTexture.hasAlpha&&a.setFloat("alphaCutOff",this.alphaCutOff)),this._ambientTexture&&t.AmbientTextureEnabled&&(u.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),f.MaterialHelper.BindTextureMatrix(this._ambientTexture,u,"ambient")),this._opacityTexture&&t.OpacityTextureEnabled&&(u.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),f.MaterialHelper.BindTextureMatrix(this._opacityTexture,u,"opacity")),this._reflectionTexture&&t.ReflectionTextureEnabled&&(u.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),u.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){var h=this._reflectionTexture;u.updateVector3("vReflectionPosition",h.boundingBoxPosition),u.updateVector3("vReflectionSize",h.boundingBoxSize)}if(this._emissiveTexture&&t.EmissiveTextureEnabled&&(u.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),f.MaterialHelper.BindTextureMatrix(this._emissiveTexture,u,"emissive")),this._lightmapTexture&&t.LightmapTextureEnabled&&(u.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),f.MaterialHelper.BindTextureMatrix(this._lightmapTexture,u,"lightmap")),this._specularTexture&&t.SpecularTextureEnabled&&(u.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),f.MaterialHelper.BindTextureMatrix(this._specularTexture,u,"specular")),this._bumpTexture&&i.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&(u.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),f.MaterialHelper.BindTextureMatrix(this._bumpTexture,u,"bump"),i._mirroredCameraPosition?u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):u.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&t.RefractionTextureEnabled){var d=1;this._refractionTexture.isCube||(u.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(d=this._refractionTexture.depth)),u.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,d,this.invertRefractionY?-1:1)}}this.pointsCloud&&u.updateFloat("pointSize",this.pointSize),o.SPECULARTERM&&u.updateColor4("vSpecularColor",this.specularColor,this.specularPower),u.updateColor3("vEmissiveColor",t.EmissiveTextureEnabled?this.emissiveColor:c.Color3.BlackReadOnly),u.updateFloat("visibility",r.visibility),u.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha)}if(i.texturesEnabled&&(this._diffuseTexture&&t.DiffuseTextureEnabled&&a.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&t.AmbientTextureEnabled&&a.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&t.OpacityTextureEnabled&&a.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?a.setTexture("reflectionCubeSampler",this._reflectionTexture):a.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&t.EmissiveTextureEnabled&&a.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&t.LightmapTextureEnabled&&a.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&t.SpecularTextureEnabled&&a.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&i.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&a.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&t.RefractionTextureEnabled)){d=1;this._refractionTexture.isCube?a.setTexture("refractionCubeSampler",this._refractionTexture):a.setTexture("refraction2DSampler",this._refractionTexture)}f.MaterialHelper.BindClipPlane(a,i),i.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),f.MaterialHelper.BindEyePosition(a,i),a.setColor3("vAmbientColor",this._globalAmbientColor)}!l&&this.isFrozen||(i.lightsEnabled&&!this._disableLighting&&f.MaterialHelper.BindLights(i,r,a,o,this._maxSimultaneousLights,this._rebuildInParallel),(i.fogEnabled&&r.applyFog&&i.fogMode!==s.Scene.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture)&&this.bindView(a),f.MaterialHelper.BindFogParameters(i,r,a),o.NUM_MORPH_INFLUENCERS&&f.MaterialHelper.BindMorphTargetParameters(r,a),this.useLogarithmicDepth&&f.MaterialHelper.BindLogDepth(o,a,i),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),u.update(),this._afterBind(r,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&e.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),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 g.MaterialFlags.DiffuseTextureEnabled},set:function(e){g.MaterialFlags.DiffuseTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AmbientTextureEnabled",{get:function(){return g.MaterialFlags.AmbientTextureEnabled},set:function(e){g.MaterialFlags.AmbientTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OpacityTextureEnabled",{get:function(){return g.MaterialFlags.OpacityTextureEnabled},set:function(e){g.MaterialFlags.OpacityTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ReflectionTextureEnabled",{get:function(){return g.MaterialFlags.ReflectionTextureEnabled},set:function(e){g.MaterialFlags.ReflectionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"EmissiveTextureEnabled",{get:function(){return g.MaterialFlags.EmissiveTextureEnabled},set:function(e){g.MaterialFlags.EmissiveTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpecularTextureEnabled",{get:function(){return g.MaterialFlags.SpecularTextureEnabled},set:function(e){g.MaterialFlags.SpecularTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BumpTextureEnabled",{get:function(){return g.MaterialFlags.BumpTextureEnabled},set:function(e){g.MaterialFlags.BumpTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightmapTextureEnabled",{get:function(){return g.MaterialFlags.LightmapTextureEnabled},set:function(e){g.MaterialFlags.LightmapTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RefractionTextureEnabled",{get:function(){return g.MaterialFlags.RefractionTextureEnabled},set:function(e){g.MaterialFlags.RefractionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ColorGradingTextureEnabled",{get:function(){return g.MaterialFlags.ColorGradingTextureEnabled},set:function(e){g.MaterialFlags.ColorGradingTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FresnelEnabled",{get:function(){return g.MaterialFlags.FresnelEnabled},set:function(e){g.MaterialFlags.FresnelEnabled=e},enumerable:!0,configurable:!0}),Object(n.__decorate)([Object(i.serializeAsTexture)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"diffuseTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("ambientTexture")],t.prototype,"_ambientTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("opacityTexture")],t.prototype,"_opacityTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("reflectionTexture")],t.prototype,"_reflectionTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("emissiveTexture")],t.prototype,"_emissiveTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("specularTexture")],t.prototype,"_specularTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("bumpTexture")],t.prototype,"_bumpTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("lightmapTexture")],t.prototype,"_lightmapTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"lightmapTexture",void 0),Object(n.__decorate)([Object(i.serializeAsTexture)("refractionTexture")],t.prototype,"_refractionTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("ambient")],t.prototype,"ambientColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("diffuse")],t.prototype,"diffuseColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("specular")],t.prototype,"specularColor",void 0),Object(n.__decorate)([Object(i.serializeAsColor3)("emissive")],t.prototype,"emissiveColor",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"specularPower",void 0),Object(n.__decorate)([Object(i.serialize)("useAlphaFromDiffuseTexture")],t.prototype,"_useAlphaFromDiffuseTexture",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFromDiffuseTexture",void 0),Object(n.__decorate)([Object(i.serialize)("useEmissiveAsIllumination")],t.prototype,"_useEmissiveAsIllumination",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useEmissiveAsIllumination",void 0),Object(n.__decorate)([Object(i.serialize)("linkEmissiveWithDiffuse")],t.prototype,"_linkEmissiveWithDiffuse",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkEmissiveWithDiffuse",void 0),Object(n.__decorate)([Object(i.serialize)("useSpecularOverAlpha")],t.prototype,"_useSpecularOverAlpha",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)("useReflectionOverAlpha")],t.prototype,"_useReflectionOverAlpha",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useReflectionOverAlpha",void 0),Object(n.__decorate)([Object(i.serialize)("disableLighting")],t.prototype,"_disableLighting",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),Object(n.__decorate)([Object(i.serialize)("useObjectSpaceNormalMap")],t.prototype,"_useObjectSpaceNormalMap",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),Object(n.__decorate)([Object(i.serialize)("useParallax")],t.prototype,"_useParallax",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),Object(n.__decorate)([Object(i.serialize)("useParallaxOcclusion")],t.prototype,"_useParallaxOcclusion",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"parallaxScaleBias",void 0),Object(n.__decorate)([Object(i.serialize)("roughness")],t.prototype,"_roughness",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"indexOfRefraction",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"invertRefractionY",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"alphaCutOff",void 0),Object(n.__decorate)([Object(i.serialize)("useLightmapAsShadowmap")],t.prototype,"_useLightmapAsShadowmap",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("diffuseFresnelParameters")],t.prototype,"_diffuseFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"diffuseFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("opacityFresnelParameters")],t.prototype,"_opacityFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelAndMiscDirty")],t.prototype,"opacityFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("reflectionFresnelParameters")],t.prototype,"_reflectionFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"reflectionFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("refractionFresnelParameters")],t.prototype,"_refractionFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"refractionFresnelParameters",void 0),Object(n.__decorate)([Object(i.serializeAsFresnelParameters)("emissiveFresnelParameters")],t.prototype,"_emissiveFresnelParameters",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"emissiveFresnelParameters",void 0),Object(n.__decorate)([Object(i.serialize)("useReflectionFresnelFromSpecular")],t.prototype,"_useReflectionFresnelFromSpecular",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"useReflectionFresnelFromSpecular",void 0),Object(n.__decorate)([Object(i.serialize)("useGlossinessFromSpecularMapAlpha")],t.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useGlossinessFromSpecularMapAlpha",void 0),Object(n.__decorate)([Object(i.serialize)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),Object(n.__decorate)([Object(i.serialize)("invertNormalMapX")],t.prototype,"_invertNormalMapX",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),Object(n.__decorate)([Object(i.serialize)("invertNormalMapY")],t.prototype,"_invertNormalMapY",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),Object(n.__decorate)([Object(i.serialize)("twoSidedLighting")],t.prototype,"_twoSidedLighting",void 0),Object(n.__decorate)([Object(i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),Object(n.__decorate)([Object(i.serialize)()],t.prototype,"useLogarithmicDepth",null),t}(d.PushMaterial);m._TypeStore.RegisteredTypes["BABYLON.StandardMaterial"]=y,s.Scene.DefaultMaterialFactory=function(e){return new y("default material",e)}},"./Materials/uniformBuffer.ts": /*!************************************!*\ !*** ./Materials/uniformBuffer.ts ***! \************************************/ /*! exports provided: UniformBuffer */function(e,t,r){"use strict";r.r(t),r.d(t,"UniformBuffer",function(){return i});var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=(r(/*! ../Engines/Extensions/engine.uniformBuffer */"./Engines/Extensions/engine.uniformBuffer.ts"),function(){function e(e,t,r){this._alreadyBound=!1,this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers,this._dynamic=r,this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformLocationPointer=0,this._needSync=!1,this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform)}return Object.defineProperty(e.prototype,"useUbo",{get:function(){return!this._noUBO},enumerable:!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=0&&o<=1?(a=i,c=s):o>=1&&o<=2?(a=s,c=i):o>=2&&o<=3?(c=i,l=s):o>=3&&o<=4?(c=s,l=i):o>=4&&o<=5?(a=s,l=i):o>=5&&o<=6&&(a=i,l=s);var u=r-i;n.set(a+u,c+u,l+u)},e.FromHexString=function(t){if("#"!==t.substring(0,1)||7!==t.length)return new e(0,0,0);var r=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16),i=parseInt(t.substring(5,7),16);return e.FromInts(r,n,i)},e.FromArray=function(t,r){return void 0===r&&(r=0),new e(t[r],t[r+1],t[r+2])},e.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}(),c=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=n.Scalar.Clamp(this.r,e,t),r.g=n.Scalar.Clamp(this.g,e,t),r.b=n.Scalar.Clamp(this.b,e,t),r.a=n.Scalar.Clamp(this.a,e,t),this},e.prototype.multiply=function(t){return new e(this.r*t.r,this.g*t.g,this.b*t.b,this.a*t.a)},e.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t},e.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},e.prototype.getClassName=function(){return"Color4"},e.prototype.getHashCode=function(){var e=255*this.r|0;return e=397*(e=397*(e=397*e^(255*this.g|0))^(255*this.b|0))^(255*this.a|0)},e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.a)},e.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this},e.prototype.copyFromFloats=function(e,t,r,n){return this.r=e,this.g=t,this.b=r,this.a=n,this},e.prototype.set=function(e,t,r,n){return this.copyFromFloats(e,t,r,n)},e.prototype.toHexString=function(){var e=255*this.r|0,t=255*this.g|0,r=255*this.b|0,i=255*this.a|0;return"#"+n.Scalar.ToHex(e)+n.Scalar.ToHex(t)+n.Scalar.ToHex(r)+n.Scalar.ToHex(i)},e.prototype.toLinearSpace=function(){var t=new e;return this.toLinearSpaceToRef(t),t},e.prototype.toLinearSpaceToRef=function(e){return e.r=Math.pow(this.r,i.ToLinearSpace),e.g=Math.pow(this.g,i.ToLinearSpace),e.b=Math.pow(this.b,i.ToLinearSpace),e.a=this.a,this},e.prototype.toGammaSpace=function(){var t=new e;return this.toGammaSpaceToRef(t),t},e.prototype.toGammaSpaceToRef=function(e){return e.r=Math.pow(this.r,i.ToGammaSpace),e.g=Math.pow(this.g,i.ToGammaSpace),e.b=Math.pow(this.b,i.ToGammaSpace),e.a=this.a,this},e.FromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length)return new e(0,0,0,0);var r=parseInt(t.substring(1,3),16),n=parseInt(t.substring(3,5),16),i=parseInt(t.substring(5,7),16),o=parseInt(t.substring(7,9),16);return e.FromInts(r,n,i,o)},e.Lerp=function(t,r,n){var i=new e(0,0,0,0);return e.LerpToRef(t,r,n,i),i},e.LerpToRef=function(e,t,r,n){n.r=e.r+(t.r-e.r)*r,n.g=e.g+(t.g-e.g)*r,n.b=e.b+(t.b-e.b)*r,n.a=e.a+(t.a-e.a)*r},e.FromColor3=function(t,r){return void 0===r&&(r=1),new e(t.r,t.g,t.b,r)},e.FromArray=function(t,r){return void 0===r&&(r=0),new e(t[r],t[r+1],t[r+2],t[r+3])},e.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;n180&&(h-=360),h-u<-180&&(h+=360),d-h>180&&(d-=360),d-h<-180&&(d+=360),this.orientation=h-u<0?n.CW:n.CCW,this.angle=c.FromDegrees(this.orientation===n.CW?u-d:d-u)},u=function(){function e(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new o.Vector2(e,t))}return e.prototype.addLineTo=function(e,t){if(this.closed)return this;var r=new o.Vector2(e,t),n=this._points[this._points.length-1];return this._points.push(r),this._length+=r.subtract(n).length(),this},e.prototype.addArcTo=function(e,t,r,i,s){if(void 0===s&&(s=36),this.closed)return this;var a=this._points[this._points.length-1],c=new o.Vector2(e,t),u=new o.Vector2(r,i),h=new l(a,c,u),d=h.angle.radians()/s;h.orientation===n.CW&&(d*=-1);for(var f=h.startAngle.radians()+d,p=0;p1)return o.Vector2.Zero();for(var t=e*this.length(),r=0,n=0;n=r&&t<=c){var l=a.normalize(),u=t-r;return new o.Vector2(s.x+l.x*u,s.y+l.y*u)}r=c}return o.Vector2.Zero()},e.StartingAt=function(t,r){return new e(t,r)},e}(),h=function(){function e(e,t,r,n){void 0===t&&(t=null),void 0===n&&(n=!1),this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:o.Vector3.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:o.Matrix.Identity()};for(var i=0;ir){var n=t;t=r,r=n}var i=this.getCurve(),o=this.getPointAt(t),s=this.getPreviousPointIndexAt(t),a=this.getPointAt(r),c=this.getPreviousPointIndexAt(r)+1,l=[];return 0!==t&&(s++,l.push(o)),l.push.apply(l,i.slice(s,c)),1===r&&1!==t||l.push(a),new e(l,this.getNormalAt(t),this._raw,this._alignTangentsWithPath)},e.prototype.update=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=!1);for(var n=0;nt+1;)t++,r=this._curve[e].subtract(this._curve[e-t]);return r},e.prototype._normalVector=function(e,t){var r,n,a=e.length();(0===a&&(a=1),null==t)?(n=i.Scalar.WithinEpsilon(Math.abs(e.y)/a,1,s.Epsilon)?i.Scalar.WithinEpsilon(Math.abs(e.x)/a,1,s.Epsilon)?i.Scalar.WithinEpsilon(Math.abs(e.z)/a,1,s.Epsilon)?o.Vector3.Zero():new o.Vector3(0,0,1):new o.Vector3(1,0,0):new o.Vector3(0,-1,0),r=o.Vector3.Cross(e,n)):(r=o.Vector3.Cross(e,t),o.Vector3.CrossToRef(r,e,r));return r.normalize(),r},e.prototype._updatePointAtData=function(e,t){if(void 0===t&&(t=!1),this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;var r=this.getPoints();if(e<=0)return this._setPointAtData(0,0,r[0],0,t);if(e>=1)return this._setPointAtData(1,1,r[r.length-1],r.length-1,t);for(var n,i=r[0],s=0,a=e*this.length(),c=1;ca){var u=(s-a)/l,h=i.subtract(n),d=n.add(h.scaleInPlace(u));return this._setPointAtData(e,1-u,d,c-1,t)}i=n}return this._pointAtData},e.prototype._setPointAtData=function(e,t,r,n,i){return this._pointAtData.point=r,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=n,this._pointAtData.interpolateReady=i,i&&this._updateInterpolationMatrix(),this._pointAtData},e.prototype._updateInterpolationMatrix=function(){this._pointAtData.interpolationMatrix=o.Matrix.Identity();var e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){var t=e+1,r=this._tangents[e].clone(),n=this._normals[e].clone(),i=this._binormals[e].clone(),s=this._tangents[t].clone(),a=this._normals[t].clone(),c=this._binormals[t].clone(),l=o.Quaternion.RotationQuaternionFromAxis(n,i,r),u=o.Quaternion.RotationQuaternionFromAxis(a,c,s);o.Quaternion.Slerp(l,u,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}},e}(),d=function(){function e(e){this._length=0,this._points=e,this._length=this._computeLength(e)}return e.CreateQuadraticBezier=function(t,r,n,i){i=i>2?i:3;for(var s=new Array,a=function(e,t,r,n){return(1-e)*(1-e)*t+2*e*(1-e)*r+e*e*n},c=0;c<=i;c++)s.push(new o.Vector3(a(c/i,t.x,r.x,n.x),a(c/i,t.y,r.y,n.y),a(c/i,t.z,r.z,n.z)));return new e(s)},e.CreateCubicBezier=function(t,r,n,i,s){s=s>3?s:4;for(var a=new Array,c=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},l=0;l<=s;l++)a.push(new o.Vector3(c(l/s,t.x,r.x,n.x,i.x),c(l/s,t.y,r.y,n.y,i.y),c(l/s,t.z,r.z,n.z,i.z)));return new e(a)},e.CreateHermiteSpline=function(t,r,n,i,s){for(var a=new Array,c=1/s,l=0;l<=s;l++)a.push(o.Vector3.Hermite(t,r,n,i,l*c));return new e(a)},e.CreateCatmullRomSpline=function(t,r,n){var i=new Array,s=1/r,a=0;if(n){for(var c=t.length,l=0;l0?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-n180&&(i-=360),t+i*e.Clamp(n)},e.InverseLerp=function(t,r,n){return t!=r?e.Clamp((n-t)/(r-t)):0},e.Hermite=function(e,t,r,n,i){var o=i*i,s=i*o;return e*(2*s-3*o+1)+r*(-2*s+3*o)+t*(s-2*o+i)+n*(s-o)},e.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},e.RangeToPercent=function(e,t,r){return(e-t)/(r-t)},e.PercentToRange=function(e,t,r){return(r-t)*e+t},e.NormalizeRadians=function(t){return t-=e.TwoPi*Math.floor((t+Math.PI)/e.TwoPi)},e.TwoPi=2*Math.PI,e}()},"./Maths/math.size.ts": /*!****************************!*\ !*** ./Maths/math.size.ts ***! \****************************/ /*! exports provided: Size */function(e,t,r){"use strict";r.r(t),r.d(t,"Size",function(){return n});var n=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.toString=function(){return"{W: "+this.width+", H: "+this.height+"}"},e.prototype.getClassName=function(){return"Size"},e.prototype.getHashCode=function(){var e=0|this.width;return e=397*e^(0|this.height)},e.prototype.copyFrom=function(e){this.width=e.width,this.height=e.height},e.prototype.copyFromFloats=function(e,t){return this.width=e,this.height=t,this},e.prototype.set=function(e,t){return this.copyFromFloats(e,t)},e.prototype.multiplyByFloats=function(t,r){return new e(this.width*t,this.height*r)},e.prototype.clone=function(){return new e(this.width,this.height)},e.prototype.equals=function(e){return!!e&&(this.width===e.width&&this.height===e.height)},Object.defineProperty(e.prototype,"surface",{get:function(){return this.width*this.height},enumerable:!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}()},"./Maths/math.ts": /*!***********************!*\ !*** ./Maths/math.ts ***! \***********************/ /*! exports provided: Space, Axis, Color3, Color4, TmpColors, ToGammaSpace, ToLinearSpace, Epsilon, Frustum, Plane, Size, Vector2, Vector3, Vector4, Quaternion, Matrix, TmpVectors, Viewport, Orientation, BezierCurve, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./math.axis */"./Maths/math.axis.ts");r.d(t,"Space",function(){return n.Space}),r.d(t,"Axis",function(){return n.Axis});var i=r(/*! ./math.color */"./Maths/math.color.ts");r.d(t,"Color3",function(){return i.Color3}),r.d(t,"Color4",function(){return i.Color4}),r.d(t,"TmpColors",function(){return i.TmpColors});var o=r(/*! ./math.constants */"./Maths/math.constants.ts");r.d(t,"ToGammaSpace",function(){return o.ToGammaSpace}),r.d(t,"ToLinearSpace",function(){return o.ToLinearSpace}),r.d(t,"Epsilon",function(){return o.Epsilon});var s=r(/*! ./math.frustum */"./Maths/math.frustum.ts");r.d(t,"Frustum",function(){return s.Frustum});var a=r(/*! ./math.path */"./Maths/math.path.ts");r.d(t,"Orientation",function(){return a.Orientation}),r.d(t,"BezierCurve",function(){return a.BezierCurve}),r.d(t,"Angle",function(){return a.Angle}),r.d(t,"Arc2",function(){return a.Arc2}),r.d(t,"Path2",function(){return a.Path2}),r.d(t,"Path3D",function(){return a.Path3D}),r.d(t,"Curve3",function(){return a.Curve3});var c=r(/*! ./math.plane */"./Maths/math.plane.ts");r.d(t,"Plane",function(){return c.Plane});var l=r(/*! ./math.size */"./Maths/math.size.ts");r.d(t,"Size",function(){return l.Size});var u=r(/*! ./math.vector */"./Maths/math.vector.ts");r.d(t,"Vector2",function(){return u.Vector2}),r.d(t,"Vector3",function(){return u.Vector3}),r.d(t,"Vector4",function(){return u.Vector4}),r.d(t,"Quaternion",function(){return u.Quaternion}),r.d(t,"Matrix",function(){return u.Matrix}),r.d(t,"TmpVectors",function(){return u.TmpVectors});var h=r(/*! ./math.vertexFormat */"./Maths/math.vertexFormat.ts");r.d(t,"PositionNormalVertex",function(){return h.PositionNormalVertex}),r.d(t,"PositionNormalTextureVertex",function(){return h.PositionNormalTextureVertex});var d=r(/*! ./math.viewport */"./Maths/math.viewport.ts");r.d(t,"Viewport",function(){return d.Viewport})},"./Maths/math.vector.ts": /*!******************************!*\ !*** ./Maths/math.vector.ts ***! \******************************/ /*! exports provided: Vector2, Vector3, Vector4, Quaternion, Matrix, TmpVectors */function(e,t,r){"use strict";r.r(t),r.d(t,"Vector2",function(){return a}),r.d(t,"Vector3",function(){return c}),r.d(t,"Vector4",function(){return l}),r.d(t,"Quaternion",function(){return u}),r.d(t,"Matrix",function(){return h}),r.d(t,"TmpVectors",function(){return f});var n=r(/*! ./math.scalar */"./Maths/math.scalar.ts"),i=r(/*! ./math.constants */"./Maths/math.constants.ts"),o=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),s=r(/*! ../Misc/typeStore */"./Misc/typeStore.ts"),a=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=e,this.y=t}return e.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+"}"},e.prototype.getClassName=function(){return"Vector2"},e.prototype.getHashCode=function(){var e=0|this.x;return e=397*e^(0|this.y)},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,this},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.copyFromFloats=function(e,t){return this.x=e,this.y=t,this},e.prototype.set=function(e,t){return this.copyFromFloats(e,t)},e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,this},e.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.addVector3=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,this},e.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this},e.prototype.multiply=function(t){return new e(this.x*t.x,this.y*t.y)},e.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,this},e.prototype.multiplyByFloats=function(t,r){return new e(this.x*t,this.y*r)},e.prototype.divide=function(t){return new e(this.x/t.x,this.y/t.y)},e.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,this},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.negate=function(){return new e(-this.x,-this.y)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this.x,-1*this.y)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this},e.prototype.scale=function(t){var r=new e(0,0);return this.scaleToRef(t,r),r},e.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,this},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=i.Epsilon),e&&n.Scalar.WithinEpsilon(this.x,e.x,t)&&n.Scalar.WithinEpsilon(this.y,e.y,t)},e.prototype.floor=function(){return new e(Math.floor(this.x),Math.floor(this.y))},e.prototype.fract=function(){return new e(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.length();return 0===e?this:(this.x/=e,this.y/=e,this)},e.prototype.clone=function(){return new e(this.x,this.y)},e.Zero=function(){return new e(0,0)},e.One=function(){return new e(1,1)},e.FromArray=function(t,r){return void 0===r&&(r=0),new e(t[r],t[r+1])},e.FromArrayToRef=function(e,t,r){r.x=e[t],r.y=e[t+1]},e.CatmullRom=function(t,r,n,i,o){var s=o*o,a=o*s;return new e(.5*(2*r.x+(-t.x+n.x)*o+(2*t.x-5*r.x+4*n.x-i.x)*s+(-t.x+3*r.x-3*n.x+i.x)*a),.5*(2*r.y+(-t.y+n.y)*o+(2*t.y-5*r.y+4*n.y-i.y)*s+(-t.y+3*r.y-3*n.y+i.y)*a))},e.Clamp=function(t,r,n){var i=t.x;i=(i=i>n.x?n.x:i)n.y?n.y:o)r.x?t.x:r.x,t.y>r.y?t.y:r.y)},e.Transform=function(t,r){var n=e.Zero();return e.TransformToRef(t,r,n),n},e.TransformToRef=function(e,t,r){var n=t.m,i=e.x*n[0]+e.y*n[4]+n[12],o=e.x*n[1]+e.y*n[5]+n[13];r.x=i,r.y=o},e.PointInTriangle=function(e,t,r,n){var i=.5*(-r.y*n.x+t.y*(-r.x+n.x)+t.x*(r.y-n.y)+r.x*n.y),o=i<0?-1:1,s=(t.y*n.x-t.x*n.y+(n.y-t.y)*e.x+(t.x-n.x)*e.y)*o,a=(t.x*r.y-t.y*r.x+(t.y-r.y)*e.x+(r.x-t.x)*e.y)*o;return s>0&&a>0&&s+a<2*i*o},e.Distance=function(t,r){return Math.sqrt(e.DistanceSquared(t,r))},e.DistanceSquared=function(e,t){var r=e.x-t.x,n=e.y-t.y;return r*r+n*n},e.Center=function(e,t){var r=e.add(t);return r.scaleInPlace(.5),r},e.DistanceOfPointFromSegment=function(t,r,n){var i=e.DistanceSquared(r,n);if(0===i)return e.Distance(t,r);var o=n.subtract(r),s=Math.max(0,Math.min(1,e.Dot(t.subtract(r),o)/i)),a=r.add(o.multiplyByFloats(s,s));return e.Distance(t,a)},e}(),c=function(){function e(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),this.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=0|this.x;return e=397*(e=397*e^(0|this.y))^(0|this.z)},e.prototype.asArray=function(){var e=[];return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,this},e.prototype.toQuaternion=function(){return u.RotationYawPitchRoll(this.y,this.x,this.z)},e.prototype.addInPlace=function(e){return this.addInPlaceFromFloats(e.x,e.y,e.z)},e.prototype.addInPlaceFromFloats=function(e,t,r){return this.x+=e,this.y+=t,this.z+=r,this},e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y,this.z+t.z)},e.prototype.addToRef=function(e,t){return t.copyFromFloats(this.x+e.x,this.y+e.y,this.z+e.z)},e.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y,this.z-t.z)},e.prototype.subtractToRef=function(e,t){return this.subtractFromFloatsToRef(e.x,e.y,e.z,t)},e.prototype.subtractFromFloats=function(t,r,n){return new e(this.x-t,this.y-r,this.z-n)},e.prototype.subtractFromFloatsToRef=function(e,t,r,n){return n.copyFromFloats(this.x-e,this.y-t,this.z-r)},e.prototype.negate=function(){return new e(-this.x,-this.y,-this.z)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this.x,-1*this.y,-1*this.z)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this},e.prototype.scale=function(t){return new e(this.x*t,this.y*t,this.z*t)},e.prototype.scaleToRef=function(e,t){return t.copyFromFloats(this.x*e,this.y*e,this.z*e)},e.prototype.scaleAndAddToRef=function(e,t){return t.addInPlaceFromFloats(this.x*e,this.y*e,this.z*e)},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=i.Epsilon),e&&n.Scalar.WithinEpsilon(this.x,e.x,t)&&n.Scalar.WithinEpsilon(this.y,e.y,t)&&n.Scalar.WithinEpsilon(this.z,e.z,t)},e.prototype.equalsToFloats=function(e,t,r){return this.x===e&&this.y===t&&this.z===r},e.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this},e.prototype.multiply=function(e){return this.multiplyByFloats(e.x,e.y,e.z)},e.prototype.multiplyToRef=function(e,t){return t.copyFromFloats(this.x*e.x,this.y*e.y,this.z*e.z)},e.prototype.multiplyByFloats=function(t,r,n){return new e(this.x*t,this.y*r,this.z*n)},e.prototype.divide=function(t){return new e(this.x/t.x,this.y/t.y,this.z/t.z)},e.prototype.divideToRef=function(e,t){return t.copyFromFloats(this.x/e.x,this.y/e.y,this.z/e.z)},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.minimizeInPlace=function(e){return this.minimizeInPlaceFromFloats(e.x,e.y,e.z)},e.prototype.maximizeInPlace=function(e){return this.maximizeInPlaceFromFloats(e.x,e.y,e.z)},e.prototype.minimizeInPlaceFromFloats=function(e,t,r){return ethis.x&&(this.x=e),t>this.y&&(this.y=t),r>this.z&&(this.z=r),this},e.prototype.isNonUniformWithinEpsilon=function(e){var t=Math.abs(this.x),r=Math.abs(this.y);if(!n.Scalar.WithinEpsilon(t,r,e))return!0;var i=Math.abs(this.z);return!n.Scalar.WithinEpsilon(t,i,e)||!n.Scalar.WithinEpsilon(r,i,e)},Object.defineProperty(e.prototype,"isNonUniform",{get:function(){var e=Math.abs(this.x),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:(d.Vector3[0].copyFrom(this),["x","y","z"].forEach(function(r,n){t[r]=d.Vector3[0][e[n]]}),this)},e.prototype.rotateByQuaternionToRef=function(t,r){return t.toRotationMatrix(d.Matrix[0]),e.TransformCoordinatesToRef(this,d.Matrix[0],r),r},e.prototype.rotateByQuaternionAroundPointToRef=function(e,t,r){return this.subtractToRef(t,d.Vector3[0]),d.Vector3[0].rotateByQuaternionToRef(e,d.Vector3[0]),t.addToRef(d.Vector3[0],r),r},e.prototype.cross=function(t){return e.Cross(this,t)},e.prototype.normalizeFromLength=function(e){return 0===e||1===e?this:this.scaleInPlace(1/e)},e.prototype.normalizeToNew=function(){var t=new e(0,0,0);return this.normalizeToRef(t),t},e.prototype.normalizeToRef=function(e){var t=this.length();return 0===t||1===t?e.copyFromFloats(this.x,this.y,this.z):this.scaleToRef(1/t,e)},e.prototype.clone=function(){return new e(this.x,this.y,this.z)},e.prototype.copyFrom=function(e){return this.copyFromFloats(e.x,e.y,e.z)},e.prototype.copyFromFloats=function(e,t,r){return this.x=e,this.y=t,this.z=r,this},e.prototype.set=function(e,t,r){return this.copyFromFloats(e,t,r)},e.prototype.setAll=function(e){return this.x=this.y=this.z=e,this},e.GetClipFactor=function(t,r,n,i){var o=e.Dot(t,n)-i;return o/(o-(e.Dot(r,n)-i))},e.GetAngleBetweenVectors=function(t,r,n){var i=t.normalizeToRef(d.Vector3[1]),o=r.normalizeToRef(d.Vector3[2]),s=e.Dot(i,o),a=d.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}),Object.defineProperty(e,"ZeroReadOnly",{get:function(){return e._ZeroReadOnly},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)r.y?r.y:o)r.z?r.z:s)this.x&&(this.x=e.x),e.y>this.y&&(this.y=e.y),e.z>this.z&&(this.z=e.z),e.w>this.w&&(this.w=e.w),this},e.prototype.floor=function(){return new e(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},e.prototype.fract=function(){return new e(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.prototype.normalize=function(){var e=this.length();return 0===e?this:this.scaleInPlace(1/e)},e.prototype.toVector3=function(){return new c(this.x,this.y,this.z)},e.prototype.clone=function(){return new e(this.x,this.y,this.z,this.w)},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},e.prototype.copyFromFloats=function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},e.prototype.set=function(e,t,r,n){return this.copyFromFloats(e,t,r,n)},e.prototype.setAll=function(e){return this.x=this.y=this.z=this.w=e,this},e.FromArray=function(t,r){return r||(r=0),new e(t[r],t[r+1],t[r+2],t[r+3])},e.FromArrayToRef=function(e,t,r){r.x=e[t],r.y=e[t+1],r.z=e[t+2],r.w=e[t+3]},e.FromFloatArrayToRef=function(t,r,n){e.FromArrayToRef(t,r,n)},e.FromFloatsToRef=function(e,t,r,n,i){i.x=e,i.y=t,i.z=r,i.w=n},e.Zero=function(){return new e(0,0,0,0)},e.One=function(){return new e(1,1,1,1)},e.Normalize=function(t){var r=e.Zero();return e.NormalizeToRef(t,r),r},e.NormalizeToRef=function(e,t){t.copyFrom(e),t.normalize()},e.Minimize=function(e,t){var r=e.clone();return r.minimizeInPlace(t),r},e.Maximize=function(e,t){var r=e.clone();return r.maximizeInPlace(t),r},e.Distance=function(t,r){return Math.sqrt(e.DistanceSquared(t,r))},e.DistanceSquared=function(e,t){var r=e.x-t.x,n=e.y-t.y,i=e.z-t.z,o=e.w-t.w;return r*r+n*n+i*i+o*o},e.Center=function(e,t){var r=e.add(t);return r.scaleInPlace(.5),r},e.TransformNormal=function(t,r){var n=e.Zero();return e.TransformNormalToRef(t,r,n),n},e.TransformNormalToRef=function(e,t,r){var n=t.m,i=e.x*n[0]+e.y*n[4]+e.z*n[8],o=e.x*n[1]+e.y*n[5]+e.z*n[9],s=e.x*n[2]+e.y*n[6]+e.z*n[10];r.x=i,r.y=o,r.z=s,r.w=e.w},e.TransformNormalFromFloatsToRef=function(e,t,r,n,i,o){var s=i.m;o.x=e*s[0]+t*s[4]+r*s[8],o.y=e*s[1]+t*s[5]+r*s[9],o.z=e*s[2]+t*s[6]+r*s[10],o.w=n},e.FromVector3=function(t,r){return void 0===r&&(r=0),new e(t.x,t.y,t.z,r)},e}(),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.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=0|this.x;return e=397*(e=397*(e=397*e^(0|this.y))^(0|this.z))^(0|this.w)},e.prototype.asArray=function(){return[this.x,this.y,this.z,this.w]},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=i.Epsilon),e&&n.Scalar.WithinEpsilon(this.x,e.x,t)&&n.Scalar.WithinEpsilon(this.y,e.y,t)&&n.Scalar.WithinEpsilon(this.z,e.z,t)&&n.Scalar.WithinEpsilon(this.w,e.w,t)},e.prototype.clone=function(){return new e(this.x,this.y,this.z,this.w)},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},e.prototype.copyFromFloats=function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},e.prototype.set=function(e,t,r,n){return this.copyFromFloats(e,t,r,n)},e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y,this.z+t.z,this.w+t.w)},e.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)},e.prototype.scale=function(t){return new e(this.x*t,this.y*t,this.z*t,this.w*t)},e.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t.w=this.w*e,this},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,t.z+=this.z*e,t.w+=this.w*e,this},e.prototype.multiply=function(t){var r=new e(0,0,0,1);return this.multiplyToRef(t,r),r},e.prototype.multiplyToRef=function(e,t){var r=this.x*e.w+this.y*e.z-this.z*e.y+this.w*e.x,n=-this.x*e.z+this.y*e.w+this.z*e.x+this.w*e.y,i=this.x*e.y-this.y*e.x+this.z*e.w+this.w*e.z,o=-this.x*e.x-this.y*e.y-this.z*e.z+this.w*e.w;return t.copyFromFloats(r,n,i,o),this},e.prototype.multiplyInPlace=function(e){return this.multiplyToRef(e,this),this},e.prototype.conjugateToRef=function(e){return e.copyFromFloats(-this.x,-this.y,-this.z,this.w),this},e.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},e.prototype.conjugate=function(){return new e(-this.x,-this.y,-this.z,this.w)},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.prototype.normalize=function(){var e=this.length();if(0===e)return this;var t=1/e;return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},e.prototype.toEulerAngles=function(e){void 0===e&&(e="YZX");var t=c.Zero();return this.toEulerAnglesToRef(t),t},e.prototype.toEulerAnglesToRef=function(e){var t=this.z,r=this.x,n=this.y,i=this.w,o=i*i,s=t*t,a=r*r,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 h.FromQuaternionToRef(this,e),this},e.prototype.fromRotationMatrix=function(t){return e.FromRotationMatrixToRef(t,this),this},e.FromRotationMatrix=function(t){var r=new e;return e.FromRotationMatrixToRef(t,r),r},e.FromRotationMatrixToRef=function(e,t){var r,n=e.m,i=n[0],o=n[4],s=n[8],a=n[1],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=d.Matrix[0];h.FromXYZAxesToRef(t.normalize(),r.normalize(),n.normalize(),o),e.FromRotationMatrixToRef(o,i)},e.Slerp=function(t,r,n){var i=e.Identity();return e.SlerpToRef(t,r,n,i),i},e.SlerpToRef=function(e,t,r,n){var i,o,s=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w,a=!1;if(s<0&&(a=!0,s=-s),s>.999999)o=1-r,i=a?-r:r;else{var 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}(),h=function(){function e(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,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],m=e[14],g=e[15],_=h*g-m*d,v=u*g-p*d,A=u*m-p*h,y=l*g-f*d,b=l*m-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],m=r[12],g=r[13],_=r[14],v=r[15],A=f*v-_*p,y=d*v-g*p,b=d*_-g*f,T=h*v-m*p,M=h*_-f*m,x=h*g-m*d,P=+(c*A-l*y+u*b),E=-(a*A-l*T+u*M),C=+(a*y-c*T+u*x),S=-(a*b-c*M+l*x),R=n*P+i*E+o*C+s*S;if(0===R)return t.copyFrom(this),this;var O=1/R,I=l*v-_*u,D=c*v-g*u,B=c*_-g*l,w=a*v-m*u,L=a*_-m*l,N=a*g-m*c,F=l*p-f*u,V=c*p-d*u,k=c*f-d*l,z=a*p-h*u,U=a*f-h*l,G=a*d-h*c,j=-(i*A-o*y+s*b),H=+(n*A-o*T+s*M),X=-(n*y-i*T+s*x),W=+(n*b-i*M+o*x),Y=+(i*I-o*D+s*B),Q=-(n*I-o*w+s*L),K=+(n*D-i*w+s*N),q=-(n*B-i*L+o*N),Z=-(i*F-o*V+s*k),J=+(n*F-o*z+s*U),$=-(n*V-i*z+s*G),ee=+(n*k-i*U+o*G);return e.FromValuesToRef(P*O,j*O,Y*O,Z*O,E*O,H*O,Q*O,J*O,C*O,X*O,K*O,$*O,S*O,W*O,q*O,ee*O,t),this},e.prototype.addAtIndex=function(e,t){return this._m[e]+=t,this._markAsUpdated(),this},e.prototype.multiplyAtIndex=function(e,t){return this._m[e]*=t,this._markAsUpdated(),this},e.prototype.setTranslationFromFloats=function(e,t,r){return this._m[12]=e,this._m[13]=t,this._m[14]=r,this._markAsUpdated(),this},e.prototype.addTranslationFromFloats=function(e,t,r){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=r,this._markAsUpdated(),this},e.prototype.setTranslation=function(e){return this.setTranslationFromFloats(e.x,e.y,e.z)},e.prototype.getTranslation=function(){return new c(this._m[12],this._m[13],this._m[14])},e.prototype.getTranslationToRef=function(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],this},e.prototype.removeRotationAndScaling=function(){var t=this.m;return e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]),this},e.prototype.multiply=function(t){var r=new e;return this.multiplyToRef(t,r),r},e.prototype.copyFrom=function(e){e.copyToArray(this._m);var t=e;return this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this},e.prototype.copyToArray=function(e,t){void 0===t&&(t=0);var r=this._m;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],this},e.prototype.multiplyToRef=function(e,t){return this._isIdentity?(t.copyFrom(e),this):e._isIdentity?(t.copyFrom(this),this):(this.multiplyToArray(e,t._m,0),t._markAsUpdated(),this)},e.prototype.multiplyToArray=function(e,t,r){var n=this._m,i=e.m,o=n[0],s=n[1],a=n[2],c=n[3],l=n[4],u=n[5],h=n[6],d=n[7],f=n[8],p=n[9],m=n[10],g=n[11],_=n[12],v=n[13],A=n[14],y=n[15],b=i[0],T=i[1],M=i[2],x=i[3],P=i[4],E=i[5],C=i[6],S=i[7],R=i[8],O=i[9],I=i[10],D=i[11],B=i[12],w=i[13],L=i[14],N=i[15];return t[r]=o*b+s*P+a*R+c*B,t[r+1]=o*T+s*E+a*O+c*w,t[r+2]=o*M+s*C+a*I+c*L,t[r+3]=o*x+s*S+a*D+c*N,t[r+4]=l*b+u*P+h*R+d*B,t[r+5]=l*T+u*E+h*O+d*w,t[r+6]=l*M+u*C+h*I+d*L,t[r+7]=l*x+u*S+h*D+d*N,t[r+8]=f*b+p*P+m*R+g*B,t[r+9]=f*T+p*E+m*O+g*w,t[r+10]=f*M+p*C+m*I+g*L,t[r+11]=f*x+p*S+m*D+g*N,t[r+12]=_*b+v*P+A*R+y*B,t[r+13]=_*T+v*E+A*O+y*w,t[r+14]=_*M+v*C+A*I+y*L,t[r+15]=_*x+v*S+A*D+y*N,this},e.prototype.equals=function(e){var t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;var r=this.m,n=t.m;return r[0]===n[0]&&r[1]===n[1]&&r[2]===n[2]&&r[3]===n[3]&&r[4]===n[4]&&r[5]===n[5]&&r[6]===n[6]&&r[7]===n[7]&&r[8]===n[8]&&r[9]===n[9]&&r[10]===n[10]&&r[11]===n[11]&&r[12]===n[12]&&r[13]===n[13]&&r[14]===n[14]&&r[15]===n[15]},e.prototype.clone=function(){var t=new e;return t.copyFrom(this),t},e.prototype.getClassName=function(){return"Matrix"},e.prototype.getHashCode=function(){for(var e=0|this._m[0],t=1;t<16;t++)e=397*e^(0|this._m[t]);return e},e.prototype.decompose=function(t,r,n){if(this._isIdentity)return n&&n.setAll(0),t&&t.setAll(1),r&&r.copyFromFloats(0,0,0,1),!0;var i=this._m;if(n&&n.copyFromFloats(i[12],i[13],i[14]),(t=t||d.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,d.Matrix[0]),u.FromRotationMatrixToRef(d.Matrix[0],r)}return!0},e.prototype.getRow=function(e){if(e<0||e>3)return null;var t=4*e;return new l(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=d.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=d.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,m,g){var _=g._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]=m,g._markAsUpdated()},e.FromValues=function(t,r,n,i,o,s,a,c,l,u,h,d,f,p,m,g){var _=new e,v=_._m;return v[0]=t,v[1]=r,v[2]=n,v[3]=i,v[4]=o,v[5]=s,v[6]=a,v[7]=c,v[8]=l,v[9]=u,v[10]=h,v[11]=d,v[12]=f,v[13]=p,v[14]=m,v[15]=g,_._markAsUpdated(),_},e.Compose=function(t,r,n){var i=new e;return e.ComposeToRef(t,r,n,i),i},e.ComposeToRef=function(e,t,r,n){var i=n._m,o=t.x,s=t.y,a=t.z,c=t.w,l=o+o,u=s+s,h=a+a,d=o*l,f=o*u,p=o*h,m=s*u,g=s*h,_=a*h,v=c*l,A=c*u,y=c*h,b=e.x,T=e.y,M=e.z;i[0]=(1-(m+_))*b,i[1]=(f+y)*b,i[2]=(p-A)*b,i[3]=0,i[4]=(f-y)*T,i[5]=(1-(d+_))*T,i[6]=(g+v)*T,i[7]=0,i[8]=(p+A)*M,i[9]=(g-v)*M,i[10]=(1-(d+m))*M,i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,n._markAsUpdated()},e.Identity=function(){var t=e.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t},e.IdentityToRef=function(t){e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0)},e.Zero=function(){var t=e.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t},e.RotationX=function(t){var r=new e;return e.RotationXToRef(t,r),r},e.Invert=function(t){var r=new e;return t.invertToRef(r),r},e.RotationXToRef=function(t,r){var n=Math.sin(t),i=Math.cos(t);e.FromValuesToRef(1,0,0,0,0,i,n,0,0,-n,i,0,0,0,0,1,r),r._updateIdentityStatus(1===i&&0===n)},e.RotationY=function(t){var r=new e;return e.RotationYToRef(t,r),r},e.RotationYToRef=function(t,r){var n=Math.sin(t),i=Math.cos(t);e.FromValuesToRef(i,0,-n,0,0,1,0,0,n,0,i,0,0,0,0,1,r),r._updateIdentityStatus(1===i&&0===n)},e.RotationZ=function(t){var r=new e;return e.RotationZToRef(t,r),r},e.RotationZToRef=function(t,r){var n=Math.sin(t),i=Math.cos(t);e.FromValuesToRef(i,n,0,0,-n,i,0,0,0,0,1,0,0,0,0,1,r),r._updateIdentityStatus(1===i&&0===n)},e.RotationAxis=function(t,r){var n=new e;return e.RotationAxisToRef(t,r,n),n},e.RotationAxisToRef=function(e,t,r){var n=Math.sin(-t),i=Math.cos(-t),o=1-i;e.normalize();var s=r._m;s[0]=e.x*e.x*o+i,s[1]=e.x*e.y*o-e.z*n,s[2]=e.x*e.z*o+e.y*n,s[3]=0,s[4]=e.y*e.x*o+e.z*n,s[5]=e.y*e.y*o+i,s[6]=e.y*e.z*o-e.x*n,s[7]=0,s[8]=e.z*e.x*o-e.y*n,s[9]=e.z*e.y*o+e.x*n,s[10]=e.z*e.z*o+i,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,r._markAsUpdated()},e.RotationAlignToRef=function(e,t,r){var n=c.Cross(t,e),i=c.Dot(t,e),o=1/(1+i),s=r._m;s[0]=n.x*n.x*o+i,s[1]=n.y*n.x*o-n.z,s[2]=n.z*n.x*o+n.y,s[3]=0,s[4]=n.x*n.y*o+n.z,s[5]=n.y*n.y*o+i,s[6]=n.z*n.y*o-n.x,s[7]=0,s[8]=n.x*n.z*o-n.y,s[9]=n.y*n.z*o+n.x,s[10]=n.z*n.z*o+i,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,r._markAsUpdated()},e.RotationYawPitchRoll=function(t,r,n){var i=new e;return e.RotationYawPitchRollToRef(t,r,n,i),i},e.RotationYawPitchRollToRef=function(e,t,r,n){u.RotationYawPitchRollToRef(e,t,r,d.Quaternion[0]),d.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=d.Vector3[0],s=d.Quaternion[0],a=d.Vector3[1];t.decompose(o,s,a);var l=d.Vector3[2],h=d.Quaternion[1],f=d.Vector3[3];r.decompose(l,h,f);var p=d.Vector3[4];c.LerpToRef(o,l,n,p);var m=d.Quaternion[2];u.SlerpToRef(s,h,n,m);var g=d.Vector3[5];c.LerpToRef(a,f,n,g),e.ComposeToRef(p,m,g,i)},e.LookAtLH=function(t,r,n){var i=new e;return e.LookAtLHToRef(t,r,n,i),i},e.LookAtLHToRef=function(t,r,n,i){var o=d.Vector3[0],s=d.Vector3[1],a=d.Vector3[2];r.subtractToRef(t,a),a.normalize(),c.CrossToRef(n,a,o);var l=o.lengthSquared();0===l?o.x=1:o.normalizeFromLength(Math.sqrt(l)),c.CrossToRef(a,o,s),s.normalize();var u=-c.Dot(o,t),h=-c.Dot(s,t),f=-c.Dot(a,t);e.FromValuesToRef(o.x,s.x,a.x,0,o.y,s.y,a.y,0,o.z,s.z,a.z,0,u,h,f,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=d.Vector3[0],s=d.Vector3[1],a=d.Vector3[2];t.subtractToRef(r,a),a.normalize(),c.CrossToRef(n,a,o);var l=o.lengthSquared();0===l?o.x=1:o.normalizeFromLength(Math.sqrt(l)),c.CrossToRef(a,o,s),s.normalize();var u=-c.Dot(o,t),h=-c.Dot(s,t),f=-c.Dot(a,t);e.FromValuesToRef(o.x,s.x,a.x,0,o.y,s.y,a.y,0,o.z,s.z,a.z,0,u,h,f,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.PerspectiveFovReverseLHToRef=function(t,r,n,i,o,s){void 0===s&&(s=!0);var a=1/Math.tan(.5*t),c=s?a/r:a,l=s?a:a*r;e.FromValuesToRef(c,0,0,0,0,l,0,0,0,0,-n,1,0,0,1,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovRH=function(t,r,n,i){var o=new e;return e.PerspectiveFovRHToRef(t,r,n,i,o),o},e.PerspectiveFovRHToRef=function(t,r,n,i,o,s){void 0===s&&(s=!0);var a=n,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.PerspectiveFovReverseRHToRef=function(t,r,n,i,o,s){void 0===s&&(s=!0);var a=1/Math.tan(.5*t),c=s?a/r:a,l=s?a:a*r;e.FromValuesToRef(c,0,0,0,0,l,0,0,0,0,-n,-1,0,0,-1,0,o),o._updateIdentityStatus(!1)},e.PerspectiveFovWebVRToRef=function(e,t,r,n,i){void 0===i&&(i=!1);var o=i?-1:1,s=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),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),f=d.Matrix[0];return r.multiplyToRef(n,f),f.multiplyToRef(i,f),f.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}(),d=function(){function e(){}return e.Vector3=o.ArrayTools.BuildArray(6,c.Zero),e.Matrix=o.ArrayTools.BuildArray(2,h.Identity),e.Quaternion=o.ArrayTools.BuildArray(3,u.Zero),e}(),f=function(){function e(){}return e.Vector2=o.ArrayTools.BuildArray(3,a.Zero),e.Vector3=o.ArrayTools.BuildArray(13,c.Zero),e.Vector4=o.ArrayTools.BuildArray(3,l.Zero),e.Quaternion=o.ArrayTools.BuildArray(2,u.Zero),e.Matrix=o.ArrayTools.BuildArray(8,h.Identity),e}();s._TypeStore.RegisteredTypes["BABYLON.Vector2"]=a,s._TypeStore.RegisteredTypes["BABYLON.Vector3"]=c,s._TypeStore.RegisteredTypes["BABYLON.Vector4"]=l,s._TypeStore.RegisteredTypes["BABYLON.Matrix"]=h},"./Maths/math.vertexFormat.ts": /*!************************************!*\ !*** ./Maths/math.vertexFormat.ts ***! \************************************/ /*! exports provided: PositionNormalVertex, PositionNormalTextureVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"PositionNormalVertex",function(){return i}),r.d(t,"PositionNormalTextureVertex",function(){return o});var n=r(/*! ./math.vector */"./Maths/math.vector.ts"),i=function(){function e(e,t){void 0===e&&(e=n.Vector3.Zero()),void 0===t&&(t=n.Vector3.Up()),this.position=e,this.normal=t}return e.prototype.clone=function(){return new e(this.position.clone(),this.normal.clone())},e}(),o=function(){function e(e,t,r){void 0===e&&(e=n.Vector3.Zero()),void 0===t&&(t=n.Vector3.Up()),void 0===r&&(r=n.Vector2.Zero()),this.position=e,this.normal=t,this.uv=r}return e.prototype.clone=function(){return new e(this.position.clone(),this.normal.clone(),this.uv.clone())},e}()},"./Maths/math.viewport.ts": /*!********************************!*\ !*** ./Maths/math.viewport.ts ***! \********************************/ /*! exports provided: Viewport */function(e,t,r){"use strict";r.r(t),r.d(t,"Viewport",function(){return n});var n=function(){function e(e,t,r,n){this.x=e,this.y=t,this.width=r,this.height=n}return e.prototype.toGlobal=function(t,r){return new e(this.x*t,this.y*r,this.width*t,this.height*r)},e.prototype.toGlobalToRef=function(e,t,r){return r.x=this.x*e,r.y=this.y*t,r.width=this.width*e,r.height=this.height*t,this},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e}()},"./Maths/sphericalPolynomial.ts": /*!**************************************!*\ !*** ./Maths/sphericalPolynomial.ts ***! \**************************************/ /*! exports provided: SphericalHarmonics, SphericalPolynomial */function(e,t,r){"use strict";r.r(t),r.d(t,"SphericalHarmonics",function(){return c}),r.d(t,"SphericalPolynomial",function(){return l});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],o=[function(e){return 1},function(e){return e.y},function(e){return e.z},function(e){return e.x},function(e){return e.x*e.y},function(e){return e.y*e.z},function(e){return 3*e.z*e.z-1},function(e){return e.x*e.z},function(e){return e.x*e.x-e.y*e.y}],s=function(e,t){return i[e]*o[e](t)},a=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4],c=function(){function e(){this.preScaled=!1,this.l00=n.Vector3.Zero(),this.l1_1=n.Vector3.Zero(),this.l10=n.Vector3.Zero(),this.l11=n.Vector3.Zero(),this.l2_2=n.Vector3.Zero(),this.l2_1=n.Vector3.Zero(),this.l20=n.Vector3.Zero(),this.l21=n.Vector3.Zero(),this.l22=n.Vector3.Zero()}return e.prototype.addLight=function(e,t,r){var i=new n.Vector3(t.r,t.g,t.b).scale(r);this.l00=this.l00.add(i.scale(s(0,e))),this.l1_1=this.l1_1.add(i.scale(s(1,e))),this.l10=this.l10.add(i.scale(s(2,e))),this.l11=this.l11.add(i.scale(s(3,e))),this.l2_2=this.l2_2.add(i.scale(s(4,e))),this.l2_1=this.l2_1.add(i.scale(s(5,e))),this.l20=this.l20.add(i.scale(s(6,e))),this.l21=this.l21.add(i.scale(s(7,e))),this.l22=this.l22.add(i.scale(s(8,e)))},e.prototype.scaleInPlace=function(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)},e.prototype.convertIncidentRadianceToIrradiance=function(){this.l00.scaleInPlace(a[0]),this.l1_1.scaleInPlace(a[1]),this.l10.scaleInPlace(a[2]),this.l11.scaleInPlace(a[3]),this.l2_2.scaleInPlace(a[4]),this.l2_1.scaleInPlace(a[5]),this.l20.scaleInPlace(a[6]),this.l21.scaleInPlace(a[7]),this.l22.scaleInPlace(a[8])},e.prototype.convertIrradianceToLambertianRadiance=function(){this.scaleInPlace(1/Math.PI)},e.prototype.preScaleForRendering=function(){this.preScaled=!0,this.l00.scaleInPlace(i[0]),this.l1_1.scaleInPlace(i[1]),this.l10.scaleInPlace(i[2]),this.l11.scaleInPlace(i[3]),this.l2_2.scaleInPlace(i[4]),this.l2_1.scaleInPlace(i[5]),this.l20.scaleInPlace(i[6]),this.l21.scaleInPlace(i[7]),this.l22.scaleInPlace(i[8])},e.FromArray=function(t){var r=new e;return n.Vector3.FromArrayToRef(t[0],0,r.l00),n.Vector3.FromArrayToRef(t[1],0,r.l1_1),n.Vector3.FromArrayToRef(t[2],0,r.l10),n.Vector3.FromArrayToRef(t[3],0,r.l11),n.Vector3.FromArrayToRef(t[4],0,r.l2_2),n.Vector3.FromArrayToRef(t[5],0,r.l2_1),n.Vector3.FromArrayToRef(t[6],0,r.l20),n.Vector3.FromArrayToRef(t[7],0,r.l21),n.Vector3.FromArrayToRef(t[8],0,r.l22),r},e.FromPolynomial=function(t){var r=new e;return r.l00=t.xx.scale(.376127).add(t.yy.scale(.376127)).add(t.zz.scale(.376126)),r.l1_1=t.y.scale(.977204),r.l10=t.z.scale(.977204),r.l11=t.x.scale(.977204),r.l2_2=t.xy.scale(1.16538),r.l2_1=t.yz.scale(1.16538),r.l20=t.zz.scale(1.34567).subtract(t.xx.scale(.672834)).subtract(t.yy.scale(.672834)),r.l21=t.zx.scale(1.16538),r.l22=t.xx.scale(1.16538).subtract(t.yy.scale(1.16538)),r.l1_1.scaleInPlace(-1),r.l11.scaleInPlace(-1),r.l2_1.scaleInPlace(-1),r.l21.scaleInPlace(-1),r.scaleInPlace(Math.PI),r},e}(),l=function(){function e(){this.x=n.Vector3.Zero(),this.y=n.Vector3.Zero(),this.z=n.Vector3.Zero(),this.xx=n.Vector3.Zero(),this.yy=n.Vector3.Zero(),this.zz=n.Vector3.Zero(),this.xy=n.Vector3.Zero(),this.yz=n.Vector3.Zero(),this.zx=n.Vector3.Zero()}return Object.defineProperty(e.prototype,"preScaledHarmonics",{get:function(){return this._harmonics||(this._harmonics=c.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics},enumerable:!0,configurable:!0}),e.prototype.addAmbient=function(e){var t=new n.Vector3(e.r,e.g,e.b);this.xx=this.xx.add(t),this.yy=this.yy.add(t),this.zz=this.zz.add(t)},e.prototype.scaleInPlace=function(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)},e.FromHarmonics=function(t){var r=new e;return r._harmonics=t,r.x=t.l11.scale(1.02333).scale(-1),r.y=t.l1_1.scale(1.02333).scale(-1),r.z=t.l10.scale(1.02333),r.xx=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).add(t.l22.scale(.429043)),r.yy=t.l00.scale(.886277).subtract(t.l20.scale(.247708)).subtract(t.l22.scale(.429043)),r.zz=t.l00.scale(.886277).add(t.l20.scale(.495417)),r.yz=t.l2_1.scale(.858086).scale(-1),r.zx=t.l21.scale(.858086).scale(-1),r.xy=t.l2_2.scale(.858086),r.scaleInPlace(1/Math.PI),r},e.FromArray=function(t){var r=new e;return n.Vector3.FromArrayToRef(t[0],0,r.x),n.Vector3.FromArrayToRef(t[1],0,r.y),n.Vector3.FromArrayToRef(t[2],0,r.z),n.Vector3.FromArrayToRef(t[3],0,r.xx),n.Vector3.FromArrayToRef(t[4],0,r.yy),n.Vector3.FromArrayToRef(t[5],0,r.zz),n.Vector3.FromArrayToRef(t[6],0,r.yz),n.Vector3.FromArrayToRef(t[7],0,r.zx),n.Vector3.FromArrayToRef(t[8],0,r.xy),r},e}()},"./Meshes/Builders/boxBuilder.ts": /*!***************************************!*\ !*** ./Meshes/Builders/boxBuilder.ts ***! \***************************************/ /*! exports provided: BoxBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"BoxBuilder",function(){return a});var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");s.VertexData.CreateBox=function(e){var t,r=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],o=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],a=[],c=e.width||e.size||1,l=e.height||e.size||1,u=e.depth||e.size||1,h=e.wrap||!1,d=void 0===e.topBaseAt?1:e.topBaseAt,f=void 0===e.bottomBaseAt?0:e.bottomBaseAt,p=[2,0,3,1][d=(d+4)%4],m=[2,0,1,3][f=(f+4)%4],g=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(h){r=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],g=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];for(var _=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],v=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]],A=[17,18,19,16],y=[22,23,20,21];p>0;)_.unshift(_.pop()),A.unshift(A.pop()),p--;for(;m>0;)v.unshift(v.pop()),y.unshift(y.pop()),m--;_=_.flat(),v=v.flat(),g=g.concat(_).concat(v),r.push(A[0],A[2],A[3],A[0],A[1],A[2]),r.push(y[0],y[2],y[3],y[0],y[1],y[2])}var b=[c/2,l/2,u/2];t=g.reduce(function(e,t,r){return e.concat(t*b[r%3])},[]);for(var T=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,M=e.faceUV||new Array(6),x=e.faceColors,P=[],E=0;E<6;E++)void 0===M[E]&&(M[E]=new n.Vector4(0,0,1,1)),x&&void 0===x[E]&&(x[E]=new i.Color4(1,1,1,1));for(var C=0;C<6;C++)if(a.push(M[C].z,M[C].w),a.push(M[C].x,M[C].w),a.push(M[C].x,M[C].y),a.push(M[C].z,M[C].y),x)for(var S=0;S<4;S++)P.push(x[C].r,x[C].g,x[C].b,x[C].a);s.VertexData._ComputeSides(T,t,r,o,a,e.frontUVs,e.backUVs);var R=new s.VertexData;if(R.indices=r,R.positions=t,R.normals=o,R.uvs=a,x){var O=T===s.VertexData.DOUBLESIDE?P.concat(P):P;R.colors=O}return R},o.Mesh.CreateBox=function(e,t,r,n,i){void 0===r&&(r=null);var o={size:t,sideOrientation:i,updatable:n};return a.CreateBox(e,o,r)};var a=function(){function e(){}return e.CreateBox=function(e,t,r){void 0===r&&(r=null);var n=new o.Mesh(e,r);return t.sideOrientation=o.Mesh._GetDefaultSideOrientation(t.sideOrientation),n._originalBuilderSideOrientation=t.sideOrientation,s.VertexData.CreateBox(t).applyToMesh(n,t.updatable),n},e}()},"./Meshes/Builders/cylinderBuilder.ts": /*!********************************************!*\ !*** ./Meshes/Builders/cylinderBuilder.ts ***! \********************************************/ /*! exports provided: CylinderBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"CylinderBuilder",function(){return l});var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../mesh */"./Meshes/mesh.ts"),s=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../../scene */"./scene.ts"),c=r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts");s.VertexData.CreateCylinder=function(e){var t=e.height||2,r=0===e.diameterTop?0:e.diameterTop||e.diameter||1,a=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1;r=r||1e-5,a=a||1e-5;var l,u=e.tessellation||24,h=e.subdivisions||1,d=!!e.hasRings,f=!!e.enclose,p=0===e.cap?0:e.cap||o.Mesh.CAP_ALL,m=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,g=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,_=e.faceUV||new Array(3),v=e.faceColors,A=2+(1+(1!==m&&f?2:0))*(d?h:1);for(l=0;l0)?1:0)+((l=n.Vector3.Dot(e[s+1].position,t)-r>0)?1:0)+((u=n.Vector3.Dot(e[s+2].position,t)-r>0)?1:0)){case 0:o.push(e[s]),o.push(e[s+1]),o.push(e[s+2]);break;case 1:if(c&&(h=e[s+1],d=e[s+2],p=i(e[s],h),m=i(e[s],d)),l){h=e[s],d=e[s+2],p=i(e[s+1],h),m=i(e[s+1],d),o.push(p),o.push(d.clone()),o.push(h.clone()),o.push(d.clone()),o.push(p.clone()),o.push(m);break}u&&(h=e[s],d=e[s+1],p=i(e[s+2],h),m=i(e[s+2],d)),h&&d&&p&&m&&(o.push(h.clone()),o.push(d.clone()),o.push(p),o.push(m),o.push(p.clone()),o.push(d.clone()));break;case 2:c||(d=i(h=e[s].clone(),e[s+1]),p=i(h,e[s+2]),o.push(h),o.push(d),o.push(p)),l||(d=i(h=e[s+1].clone(),e[s+2]),p=i(h,e[s]),o.push(h),o.push(d),o.push(p)),u||(d=i(h=e[s+2].clone(),e[s]),p=i(h,e[s+1]),o.push(h),o.push(d),o.push(p))}}return o},S=0;S1)?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;de.maxHeight){f=!0;var p=e.maxHeight;e.maxHeight=e.minHeight,e.minHeight=p}for(t=0;t<=e.subdivisions;t++)for(r=0;r<=e.subdivisions;r++){var m=new n.Vector3(r*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-t)*e.height/e.subdivisions-e.height/2),g=4*(((m.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(m.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth),_=e.buffer[g]/255,v=e.buffer[g+1]/255,A=e.buffer[g+2]/255,y=e.buffer[g+3]/255;f&&(_=1-_,v=1-v,A=1-A);var b=_*h.r+v*h.g+A*h.b;m.y=y>=d?e.minHeight+(e.maxHeight-e.minHeight)*b:e.minHeight-u.Epsilon,a.push(m.x,m.y,m.z),c.push(0,0,0),l.push(r/e.subdivisions,1-t/e.subdivisions)}for(t=0;t=e.minHeight,C=a[3*M+1]>=e.minHeight,S=a[3*x+1]>=e.minHeight;E&&C&&S&&(o.push(T),o.push(M),o.push(x)),a[3*P+1]>=e.minHeight&&E&&S&&(o.push(P),o.push(T),o.push(x))}s.VertexData.ComputeNormals(a,o,c);var R=new s.VertexData;return R.indices=o,R.positions=a,R.normals=c,R.uvs=l,R},o.Mesh.CreateGround=function(e,t,r,n,i,o){var s={width:t,height:r,subdivisions:n,updatable:o};return d.CreateGround(e,s,i)},o.Mesh.CreateTiledGround=function(e,t,r,n,i,o,s,a,c){var l={xmin:t,zmin:r,xmax:n,zmax:i,subdivisions:o,precision:s,updatable:c};return d.CreateTiledGround(e,l,a)},o.Mesh.CreateGroundFromHeightMap=function(e,t,r,n,i,o,s,a,c,l,u){var h={width:r,height:n,subdivisions:i,minHeight:o,maxHeight:s,updatable:c,onReady:l,alphaFilter:u};return d.CreateGroundFromHeightMap(e,t,h,a)};var d=function(){function e(){}return e.CreateGround=function(e,t,r){var n=new a.GroundMesh(e,r);return n._setReady(!1),n._subdivisionsX=t.subdivisionsX||t.subdivisions||1,n._subdivisionsY=t.subdivisionsY||t.subdivisions||1,n._width=t.width||1,n._height=t.height||1,n._maxX=n._width/2,n._maxZ=n._height/2,n._minX=-n._maxX,n._minZ=-n._maxZ,s.VertexData.CreateGround(t).applyToMesh(n,t.updatable),n._setReady(!0),n},e.CreateTiledGround=function(e,t,r){void 0===r&&(r=null);var n=new o.Mesh(e,r);return s.VertexData.CreateTiledGround(t).applyToMesh(n,t.updatable),n},e.CreateGroundFromHeightMap=function(e,t,r,n){void 0===n&&(n=null);var o=r.width||10,u=r.height||10,d=r.subdivisions||1,f=r.minHeight||0,p=r.maxHeight||1,m=r.colorFilter||new i.Color3(.3,.59,.11),g=r.alphaFilter||0,_=r.updatable,v=r.onReady;n=n||l.EngineStore.LastCreatedScene;var A=new a.GroundMesh(e,n);A._subdivisionsX=d,A._subdivisionsY=d,A._width=o,A._height=u,A._maxX=A._width/2,A._maxZ=A._height/2,A._minX=-A._maxX,A._minZ=-A._maxZ,A._setReady(!1);return c.Tools.LoadImage(t,function(e){var t=e.width,r=e.height,i=h.CanvasGenerator.CreateCanvas(t,r).getContext("2d");if(!i)throw new Error("Unable to get 2d context for CreateGroundFromHeightMap");if(!n.isDisposed){i.drawImage(e,0,0);var a=i.getImageData(0,0,t,r).data;s.VertexData.CreateGroundFromHeightMap({width:o,height:u,subdivisions:d,minHeight:f,maxHeight:p,colorFilter:m,buffer:a,bufferWidth:t,bufferHeight:r,alphaFilter:g}).applyToMesh(A,_),v&&v(A),A._setReady(!0)}},function(){},n.offlineProvider),A},e}()},"./Meshes/Builders/hemisphereBuilder.ts": /*!**********************************************!*\ !*** ./Meshes/Builders/hemisphereBuilder.ts ***! \**********************************************/ /*! exports provided: HemisphereBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"HemisphereBuilder",function(){return o});var n=r(/*! ../mesh */"./Meshes/mesh.ts"),i=r(/*! ../Builders/sphereBuilder */"./Meshes/Builders/sphereBuilder.ts");n.Mesh.CreateHemisphere=function(e,t,r,n){var i={segments:t,diameter:r};return o.CreateHemisphere(e,i,n)};var o=function(){function e(){}return e.CreateHemisphere=function(e,t,r){t.diameter||(t.diameter=1),t.segments||(t.segments=16);var o=i.SphereBuilder.CreateSphere("",{slice:.5,diameter:t.diameter,segments:t.segments},r),s=n.Mesh.CreateDisc("",t.diameter/2,3*t.segments+(4-t.segments),r);s.rotation.x=-Math.PI/2,s.parent=o;var a=n.Mesh.MergeMeshes([s,o],!0);return a.name=e,a},e}()},"./Meshes/Builders/icoSphereBuilder.ts": /*!*********************************************!*\ !*** ./Meshes/Builders/icoSphereBuilder.ts ***! \*********************************************/ /*! exports provided: IcoSphereBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"IcoSphereBuilder",function(){return s});var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.VertexData.CreateIcoSphere=function(e){var t,r=e.sideOrientation||o.VertexData.DEFAULTSIDE,i=e.radius||1,s=void 0===e.flat||e.flat,a=e.subdivisions||4,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],m=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],g=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],_=new Array,v=new Array,A=new Array,y=new Array,b=0,T=new Array(3),M=new Array(3);for(t=0;t<3;t++)T[t]=n.Vector3.Zero(),M[t]=n.Vector2.Zero();for(var x=0;x<20;x++){for(t=0;t<3;t++){var P=f[3*x+t];T[t].copyFromFloats(d[3*p[P]],d[3*p[P]+1],d[3*p[P]+2]),T[t].normalize().scaleInPlace(i),M[t].copyFromFloats(m[2*P]*(138/1024)+60/1024+g[x]*(-40/1024),m[2*P+1]*(239/1024)+26/1024+g[x]*(20/1024))}for(var E=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),m=n.Vector3.Lerp(T[1],T[2],i/a);o=n.Vector3.Lerp(p,m,r/(a-i))}else o=new n.Vector3(f.x,f.y,f.z);o.x/=c,o.y/=l,o.z/=u,o.normalize();var g=n.Vector2.Lerp(M[0],M[2],t/a),x=n.Vector2.Lerp(M[1],M[2],t/a),P=a===t?M[2]:n.Vector2.Lerp(g,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(P.x,P.y),_.push(b),b++},C=0;C1?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),m=t.cap||i.Mesh.NO_CAP,g=2*Math.PI,_=new Array,v=t.invertUV||!1,A=0,y=0,b=g/h*a,T=new Array;for(A=0;A<=h-d;A++){T=[];for(m!=i.Mesh.CAP_START&&m!=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;y0&&(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,m=0,g=0;for(g=0;g=t.length)?0:e.type||0,d=e.size,f=e.sizeX||d||1,p=e.sizeY||d||1,m=e.sizeZ||d||1,g=e.custom||t[h],_=g.face.length,v=e.faceUV||new Array(_),A=e.faceColors,y=void 0===e.flat||e.flat,b=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,T=new Array,M=new Array,x=new Array,P=new Array,E=new Array,C=0,S=0,R=new Array,O=0,I=0;if(y)for(I=0;I<_;I++)A&&void 0===A[I]&&(A[I]=new i.Color4(1,1,1,1)),v&&void 0===v[I]&&(v[I]=new n.Vector4(0,0,1,1));if(y)for(I=0;I<_;I++){var D=g.face[I].length;for(a=2*Math.PI/D,c=.5*Math.tan(a/2),l=.5,O=0;Oa?a:Math.floor(c);var l,u,h,d,f=0===e.sideOrientation?0:e.sideOrientation||s.VertexData.DEFAULTSIDE,p=e.uvs,m=e.colors,g=[],_=[],v=[],A=[],y=[],b=[],T=[],M=[],x=[],P=[];if(t.length<2){var E=[],C=[];for(h=0;h0&&(O=S[d].subtract(S[d-1]).length()+T[u],y[u].push(O),T[u]=O),d++;n&&(d--,g.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+w,P[u]=B,B+=R+w}var L,N,F=null,V=null;for(h=0;h3?0:f,p);var E=o.RibbonBuilder.CreateRibbon(e,{pathArray:M,closeArray:h,closePath:d,updatable:g,sideOrientation:_,invertUV:A,frontUVs:y||void 0,backUVs:b||void 0},m);return E._creationDataStorage.pathArray=M,E._creationDataStorage.path3D=T,E._creationDataStorage.cap=f,E},e}()},"./Meshes/Builders/sphereBuilder.ts": /*!******************************************!*\ !*** ./Meshes/Builders/sphereBuilder.ts ***! \******************************************/ /*! exports provided: SphereBuilder */function(e,t,r){"use strict";r.r(t),r.d(t,"SphereBuilder",function(){return s});var n=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../mesh */"./Meshes/mesh.ts"),o=r(/*! ../mesh.vertexData */"./Meshes/mesh.vertexData.ts");o.VertexData.CreateSphere=function(e){for(var t=e.segments||32,r=e.diameterX||e.diameter||1,i=e.diameterY||e.diameter||1,s=e.diameterZ||e.diameter||1,a=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,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=[],m=[],g=[],_=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,M=n.Matrix.RotationZ(-A),x=n.Matrix.RotationY(T),P=n.Vector3.TransformCoordinates(n.Vector3.Up(),M),E=n.Vector3.TransformCoordinates(P,x),C=E.multiply(u),S=E.divide(u).normalize();p.push(C.x,C.y,C.z),m.push(S.x,S.y,S.z),g.push(b,v)}if(_>0)for(var R=p.length/3,O=R-2*(d+1);O+d+20||f>0){v=-p,A=-m;y=p,b=m;switch(s){case n.Mesh.CENTER:v-=u/=2,y+=u;break;case n.Mesh.LEFT:y+=u,g=-u/2;break;case n.Mesh.RIGHT:v-=u,g=u/2}switch(a){case n.Mesh.CENTER:A-=f/=2,b+=f;break;case n.Mesh.BOTTOM:b+=f,_=-f/2;break;case n.Mesh.TOP:A-=f,_=f/2}}var T=[],M=[],x=[];x[0]=[0,0,1,0,1,1,0,1],x[1]=[0,0,1,0,1,1,0,1],t!==n.Mesh.ROTATE_TILE&&t!==n.Mesh.ROTATE_ROW||(x[1]=[1,1,0,1,0,0,1,0]),t!==n.Mesh.FLIP_TILE&&t!==n.Mesh.FLIP_ROW||(x[1]=[1,0,0,0,0,1,1,1]),t!==n.Mesh.FLIP_N_ROTATE_TILE&&t!==n.Mesh.FLIP_N_ROTATE_ROW||(x[1]=[0,1,1,1,1,0,0,0]);for(var P=[],E=[],C=[],S=0,R=0;R0||f>0){var I,D,B,w,L=f>0&&(a===n.Mesh.CENTER||a===n.Mesh.TOP),N=f>0&&(a===n.Mesh.CENTER||a===n.Mesh.BOTTOM),F=u>0&&(s===n.Mesh.CENTER||s===n.Mesh.RIGHT),V=u>0&&(s===n.Mesh.CENTER||s===n.Mesh.LEFT),k=[];if(L&&F&&(T.push(v+g,A+_,0),T.push(-p+g,A+_,0),T.push(-p+g,A+f+_,0),T.push(v+g,A+f+_,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,k=[I=1-u/r,D=1-f/o,B=1,D,B,w=1,I,w],t===n.Mesh.ROTATE_ROW&&(k=[1-I,1-D,1-B,1-D,1-B,1-w,1-I,1-w]),t===n.Mesh.FLIP_ROW&&(k=[1-I,D,1-B,D,1-B,w,1-I,w]),t===n.Mesh.FLIP_N_ROTATE_ROW&&(k=[I,1-D,B,1-D,B,1-w,I,1-w]),P=P.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L&&V&&(T.push(p+g,A+_,0),T.push(y+g,A+_,0),T.push(y+g,A+f+_,0),T.push(p+g,A+f+_,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,k=[I=0,D=1-f/o,B=u/r,D,B,w=1,I,w],(t===n.Mesh.ROTATE_ROW||t===n.Mesh.ROTATE_TILE&&l%2==0)&&(k=[1-I,1-D,1-B,1-D,1-B,1-w,1-I,1-w]),(t===n.Mesh.FLIP_ROW||t===n.Mesh.FLIP_TILE&&l%2==0)&&(k=[1-I,D,1-B,D,1-B,w,1-I,w]),(t===n.Mesh.FLIP_N_ROTATE_ROW||t===n.Mesh.FLIP_N_ROTATE_TILE&&l%2==0)&&(k=[I,1-D,B,1-D,B,1-w,I,1-w]),P=P.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),N&&F&&(T.push(v+g,m+_,0),T.push(-p+g,m+_,0),T.push(-p+g,b+_,0),T.push(v+g,b+_,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,k=[I=1-u/r,D=0,B=1,D,B,w=f/o,I,w],(t===n.Mesh.ROTATE_ROW&&d%2==1||t===n.Mesh.ROTATE_TILE&&d%1==0)&&(k=[1-I,1-D,1-B,1-D,1-B,1-w,1-I,1-w]),(t===n.Mesh.FLIP_ROW&&d%2==1||t===n.Mesh.FLIP_TILE&&d%2==0)&&(k=[1-I,D,1-B,D,1-B,w,1-I,w]),(t===n.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===n.Mesh.FLIP_N_ROTATE_TILE&&d%2==0)&&(k=[I,1-D,B,1-D,B,1-w,I,1-w]),P=P.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),N&&V&&(T.push(p+g,m+_,0),T.push(y+g,m+_,0),T.push(y+g,b+_,0),T.push(p+g,b+_,0),C.push(S,S+1,S+3,S+1,S+2,S+3),S+=4,k=[I=0,D=0,B=u/r,D,B,w=f/o,I,w],(t===n.Mesh.ROTATE_ROW&&d%2==1||t===n.Mesh.ROTATE_TILE&&(d+l)%2==1)&&(k=[1-I,1-D,1-B,1-D,1-B,1-w,1-I,1-w]),(t===n.Mesh.FLIP_ROW&&d%2==1||t===n.Mesh.FLIP_TILE&&(d+l)%2==1)&&(k=[1-I,D,1-B,D,1-B,w,1-I,w]),(t===n.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===n.Mesh.FLIP_N_ROTATE_TILE&&(d+l)%2==1)&&(k=[I,1-D,B,1-D,B,1-w,I,1-w]),P=P.concat(k),E.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),L){var z=[];I=0,D=1-f/o,B=1,w=1,z[0]=[I,D,B,D,B,w,I,w],z[1]=[I,D,B,D,B,w,I,w],t!==n.Mesh.ROTATE_TILE&&t!==n.Mesh.ROTATE_ROW||(z[1]=[1-I,1-D,1-B,1-D,1-B,1-w,1-I,1-w]),t!==n.Mesh.FLIP_TILE&&t!==n.Mesh.FLIP_ROW||(z[1]=[1-I,D,1-B,D,1-B,w,1-I,w]),t!==n.Mesh.FLIP_N_ROTATE_TILE&&t!==n.Mesh.FLIP_N_ROTATE_ROW||(z[1]=[I,1-D,B,1-D,B,1-w,I,1-w]);for(O=0;O1)?1:t.arc||1;var g,_,v=function(e,t,r,o,s,a,c,l){for(var u,h,d,f,p=t.getTangents(),m=t.getNormals(),g=t.getDistances(),_=2*Math.PI/s*l,v=a||function(){return o},A=n.TmpVectors.Matrix[0],y=c===i.Mesh.NO_CAP||c===i.Mesh.CAP_END?0:2,b=0;b3?0:d,t.arc);var b=o.RibbonBuilder.CreateRibbon(e,{pathArray:_,closePath:!0,closeArray:!1,updatable:p,sideOrientation:m,invertUV:f,frontUVs:t.frontUVs,backUVs:t.backUVs},r);return b._creationDataStorage.pathArray=_,b._creationDataStorage.path3D=g,b._creationDataStorage.tessellation=u,b._creationDataStorage.cap=d,b._creationDataStorage.arc=t.arc,b._creationDataStorage.radius=l,b},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 l});var n=r(/*! ../../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../../Misc/workerPool */"./Misc/workerPool.ts"),o=r(/*! ../../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts");function s(e){return new Promise(function(t){DracoDecoderModule({wasmBinary:e}).then(function(e){t({module:e})})})}function a(e,t,r,n,i){var o=new e.DecoderBuffer;o.Init(t,t.byteLength);var s,a,c=new e.Decoder;try{var l=c.GetEncodedGeometryType(o);switch(l){case e.TRIANGULAR_MESH:s=new e.Mesh,a=c.DecodeBufferToMesh(o,s);break;case e.POINT_CLOUD:s=new e.PointCloud,a=c.DecodeBufferToPointCloud(o,s);break;default:throw new Error("Invalid geometry type "+l)}if(!a.ok()||!s.ptr)throw new Error(a.error_msg());var u=s.num_points();if(l===e.TRIANGULAR_MESH){var h=s.num_faces(),d=new e.DracoInt32Array;try{for(var f=new Uint32Array(3*h),p=0;pa.Engine.CollisionsEpsilon&&i.position.addInPlace(i._meshCollisionData._diffPositionForCollisions),r&&i.onCollideObservable.notifyObservers(r),i.onCollisionPositionChangeObservable.notifyObservers(i.position)},i.getScene().addMesh(i),i._resyncLightSources(),i}return Object(n.__extends)(t,e),Object.defineProperty(t,"BILLBOARDMODE_NONE",{get:function(){return u.TransformNode.BILLBOARDMODE_NONE},enumerable:!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,"BILLBOARDMODE_USE_POSITION",{get:function(){return u.TransformNode.BILLBOARDMODE_USE_POSITION},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetNb",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetNb},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningSubdivisions",{get:function(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions},set:function(e){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningBBoxRatio",{get:function(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio},set:function(e){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mustDepthSortFacets",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort},set:function(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetDepthSortFrom",{get:function(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom},set:function(e){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFacetDataEnabled",{get:function(){return this._internalAbstractMeshDataInfo._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._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._meshCollisionData._onCollideObserver),this._meshCollisionData._onCollideObserver=this.onCollideObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onCollisionPositionChange",{set:function(e){this._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._meshCollisionData._onCollisionPositionChangeObserver),this._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._internalAbstractMeshDataInfo._visibility},set:function(e){this._internalAbstractMeshDataInfo._visibility!==e&&(this._internalAbstractMeshDataInfo._visibility=e,this._markSubMeshesAsMiscDirty())},enumerable:!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._internalAbstractMeshDataInfo._receiveShadows},set:function(e){this._internalAbstractMeshDataInfo._receiveShadows!==e&&(this._internalAbstractMeshDataInfo._receiveShadows=e,this._markSubMeshesAsLightDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasVertexAlpha",{get:function(){return this._internalAbstractMeshDataInfo._hasVertexAlpha},set:function(e){this._internalAbstractMeshDataInfo._hasVertexAlpha!==e&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useVertexColors",{get:function(){return this._internalAbstractMeshDataInfo._useVertexColors},set:function(e){this._internalAbstractMeshDataInfo._useVertexColors!==e&&(this._internalAbstractMeshDataInfo._useVertexColors=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders},set:function(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numBoneInfluencers",{get:function(){return this._internalAbstractMeshDataInfo._numBoneInfluencers},set:function(e){this._internalAbstractMeshDataInfo._numBoneInfluencers!==e&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"applyFog",{get:function(){return this._internalAbstractMeshDataInfo._applyFog},set:function(e){this._internalAbstractMeshDataInfo._applyFog!==e&&(this._internalAbstractMeshDataInfo._applyFog=e,this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layerMask",{get:function(){return this._internalAbstractMeshDataInfo._layerMask},set:function(e){e!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=e,this._resyncLightSources())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._meshCollisionData._collisionMask},set:function(e){this._meshCollisionData._collisionMask=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionGroup",{get:function(){return this._meshCollisionData._collisionGroup},set:function(e){this._meshCollisionData._collisionGroup=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lightSources",{get:function(){return this._lightSources},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._internalAbstractMeshDataInfo._skeleton},set:function(e){var t=this._internalAbstractMeshDataInfo._skeleton;t&&t.needInitialSkinMatrix&&t._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=e,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()},enumerable:!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");t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);var r=this._internalAbstractMeshDataInfo._skeleton;return r&&(t+=", skeleton: "+r.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),t},t.prototype._getEffectiveParent=function(){return this._masterMesh&&this.billboardMode!==u.TransformNode.BILLBOARDMODE_NONE?this._masterMesh:e.prototype._getEffectiveParent.call(this)},t.prototype._getActionManagerForTrigger=function(e,t){if(void 0===t&&(t=!0),this.actionManager&&(t||this.actionManager.isRecursive)){if(!e)return this.actionManager;if(this.actionManager.hasSpecificTrigger(e))return this.actionManager}return this.parent?this.parent._getActionManagerForTrigger(e,!1):null},t.prototype._rebuild=function(){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery&&(this._occlusionQuery=null),this.subMeshes)for(var e=0,t=this.subMeshes;e4,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.TmpVectors.Vector3[0],d=s.TmpVectors.Matrix[0],f=s.TmpVectors.Matrix[1],p=0,m=0;m0&&(s.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*r[p+g]),_,f),d.addToSelf(f));if(o)for(g=0;g<4;g++)(_=l[p+g])>0&&(s.Matrix.FromFloat32ArrayToRefScaled(u,Math.floor(16*a[p+g]),_,f),d.addToSelf(f));s.Vector3.TransformCoordinatesFromFloatsToRef(t[m],t[m+1],t[m+2],d,h),h.toArray(t,m),this._positions&&this._positions[m/3].copyFrom(h)}}}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;r1||!n.IsGlobal)&&n.updateBoundingInfo(e)}return this},t.prototype._afterComputeWorldMatrix=function(){this.doNotSyncBoundingInfo||this._updateBoundingInfo()},Object.defineProperty(t.prototype,"_effectiveMesh",{get:function(){return this.skeleton&&this.skeleton.overrideMesh||this},enumerable:!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();n1&&!o._checkCollision(e)||this._collideForSubMesh(o,t,e)}return this},t.prototype._checkCollision=function(e){if(!this._boundingInfo||!this._boundingInfo._checkCollision(e))return this;var t=s.TmpVectors.Matrix[0],r=s.TmpVectors.Matrix[1];return s.Matrix.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,r),this._processCollisionsForSubMeshes(e,r),this},t.prototype._generatePointsArray=function(){return!1},t.prototype.intersects=function(e,t,r){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;u1)||d.canIntersects(e)){var f=d.intersects(e,this._positions,this.getIndices(),t,r);if(f&&(t||!a||f.distance65535){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;hv.Epsilon?i.maximum.x-i.minimum.x:v.Epsilon,e.bbSize.y=i.maximum.y-i.minimum.y>v.Epsilon?i.maximum.y-i.minimum.y:v.Epsilon,e.bbSize.z=i.maximum.z-i.minimum.z>v.Epsilon?i.maximum.z-i.minimum.z:v.Epsilon;var f=e.bbSize.x>e.bbSize.y?e.bbSize.x:e.bbSize.y;if(f=f>e.bbSize.z?f:e.bbSize.z,e.subDiv.max=e.partitioningSubdivisions,e.subDiv.X=Math.floor(e.subDiv.max*e.bbSize.x/f),e.subDiv.Y=Math.floor(e.subDiv.max*e.bbSize.y/f),e.subDiv.Z=Math.floor(e.subDiv.max*e.bbSize.z/f),e.subDiv.X=e.subDiv.X<1?1:e.subDiv.X,e.subDiv.Y=e.subDiv.Y<1?1:e.subDiv.Y,e.subDiv.Z=e.subDiv.Z<1?1:e.subDiv.Z,e.facetParameters.facetNormals=this.getFacetLocalNormals(),e.facetParameters.facetPositions=this.getFacetLocalPositions(),e.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),e.facetParameters.bInfo=i,e.facetParameters.bbSize=e.bbSize,e.facetParameters.subDiv=e.subDiv,e.facetParameters.ratio=this.partitioningBBoxRatio,e.facetParameters.depthSort=e.facetDepthSort,e.facetDepthSort&&e.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(e.invertedMatrix),s.Vector3.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,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;hi.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.TmpVectors.Matrix[5];a.invertToRef(c);var l=s.TmpVectors.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,m=this.getFacetLocalPositions(),g=this.getFacetLocalNormals(),_=this.getFacetsAtLocalCoordinates(e,t,r);if(!_)return null;for(var v,A,y,b=Number.MAX_VALUE,T=b,M=0;M<_.length;M++)A=g[v=_[M]],u=(e-(y=m[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)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=[],m=[];for(a=0;a=3&&(f=new u(p,t.shared)).plane&&o.push(f),m.length>=3&&(f=new u(m,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;e0&&(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;t0){for(var t=0;t0){for(t=0;t0){for(t=0;t0){var u=new Float32Array(t,l.positionsAttrDesc.offset,l.positionsAttrDesc.count);r.setVerticesData(s.VertexBuffer.PositionKind,u,!1)}if(l.normalsAttrDesc&&l.normalsAttrDesc.count>0){var h=new Float32Array(t,l.normalsAttrDesc.offset,l.normalsAttrDesc.count);r.setVerticesData(s.VertexBuffer.NormalKind,h,!1)}if(l.tangetsAttrDesc&&l.tangetsAttrDesc.count>0){var d=new Float32Array(t,l.tangetsAttrDesc.offset,l.tangetsAttrDesc.count);r.setVerticesData(s.VertexBuffer.TangentKind,d,!1)}if(l.uvsAttrDesc&&l.uvsAttrDesc.count>0){var f=new Float32Array(t,l.uvsAttrDesc.offset,l.uvsAttrDesc.count);r.setVerticesData(s.VertexBuffer.UVKind,f,!1)}if(l.uvs2AttrDesc&&l.uvs2AttrDesc.count>0){var p=new Float32Array(t,l.uvs2AttrDesc.offset,l.uvs2AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV2Kind,p,!1)}if(l.uvs3AttrDesc&&l.uvs3AttrDesc.count>0){var m=new Float32Array(t,l.uvs3AttrDesc.offset,l.uvs3AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV3Kind,m,!1)}if(l.uvs4AttrDesc&&l.uvs4AttrDesc.count>0){var g=new Float32Array(t,l.uvs4AttrDesc.offset,l.uvs4AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV4Kind,g,!1)}if(l.uvs5AttrDesc&&l.uvs5AttrDesc.count>0){var _=new Float32Array(t,l.uvs5AttrDesc.offset,l.uvs5AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV5Kind,_,!1)}if(l.uvs6AttrDesc&&l.uvs6AttrDesc.count>0){var v=new Float32Array(t,l.uvs6AttrDesc.offset,l.uvs6AttrDesc.count);r.setVerticesData(s.VertexBuffer.UV6Kind,v,!1)}if(l.colorsAttrDesc&&l.colorsAttrDesc.count>0){var A=new Float32Array(t,l.colorsAttrDesc.offset,l.colorsAttrDesc.count);r.setVerticesData(s.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>8),b.push((16711680&M)>>16),b.push(M>>24)}r.setVerticesData(s.VertexBuffer.MatricesIndicesKind,b,!1)}if(l.matricesWeightsAttrDesc&&l.matricesWeightsAttrDesc.count>0){var x=new Float32Array(t,l.matricesWeightsAttrDesc.offset,l.matricesWeightsAttrDesc.count);r.setVerticesData(s.VertexBuffer.MatricesWeightsKind,x,!1)}if(l.indicesAttrDesc&&l.indicesAttrDesc.count>0){var P=new Int32Array(t,l.indicesAttrDesc.offset,l.indicesAttrDesc.count);r.setIndices(P,null)}if(l.subMeshesAttrDesc&&l.subMeshesAttrDesc.count>0){var E=new Int32Array(t,l.subMeshesAttrDesc.offset,5*l.subMeshesAttrDesc.count);r.subMeshes=[];for(T=0;T>8),b.push((16711680&D)>>16),b.push(D>>24)}r.setVerticesData(s.VertexBuffer.MatricesIndicesKind,b,t.matricesIndices._updatable)}if(t.matricesIndicesExtra)if(t.matricesIndicesExtra._isExpanded)delete t.matricesIndices._isExpanded,r.setVerticesData(s.VertexBuffer.MatricesIndicesExtraKind,t.matricesIndicesExtra,t.matricesIndicesExtra._updatable);else{for(b=[],T=0;T>8),b.push((16711680&D)>>16),b.push(D>>24)}r.setVerticesData(s.VertexBuffer.MatricesIndicesExtraKind,b,t.matricesIndicesExtra._updatable)}t.matricesWeights&&(e._CleanMatricesWeights(t,r),r.setVerticesData(s.VertexBuffer.MatricesWeightsKind,t.matricesWeights,t.matricesWeights._updatable)),t.matricesWeightsExtra&&r.setVerticesData(s.VertexBuffer.MatricesWeightsExtraKind,t.matricesWeightsExtra,t.matricesWeights._updatable),r.setIndices(t.indices,null)}if(t.subMeshes){r.subMeshes=[];for(var B=0;B-1){var n=t.getScene().getLastSkeletonByID(e.skeletonId);if(n){r=n.bones.length;for(var i=t.getVerticesData(s.VertexBuffer.MatricesIndicesKind),o=t.getVerticesData(s.VertexBuffer.MatricesIndicesExtraKind),a=e.matricesWeights,l=e.matricesWeightsExtra,u=e.numBoneInfluencer,h=a.length,d=0;du-1)&&(p=u-1),f>.001){var _=1/f;for(m=0;m<4;m++)a[d+m]*=_;if(l)for(m=0;m<4;m++)l[d+m]*=_}else p>=4?(l[d+p-4]=1-f,o[d+p-4]=r):(a[d+p]=1-f,i[d+p]=r)}t.setVerticesData(s.VertexBuffer.MatricesIndicesKind,i),e.matricesWeightsExtra&&t.setVerticesData(s.VertexBuffer.MatricesIndicesExtraKind,o)}}}},e.Parse=function(t,r,i){if(r.getGeometryByID(t.id))return null;var a=new e(t.id,r,void 0,t.updatable);return d.Tags&&d.Tags.AddTagsTo(a,t.tags),t.delayLoadingFile?(a.delayLoadState=u.Constants.DELAYLOADSTATE_NOTLOADED,a.delayLoadingFile=i+t.delayLoadingFile,a._boundingInfo=new l.BoundingInfo(n.Vector3.FromArray(t.boundingBoxMinimum),n.Vector3.FromArray(t.boundingBoxMaximum)),a._delayInfo=[],t.hasUVs&&a._delayInfo.push(s.VertexBuffer.UVKind),t.hasUVs2&&a._delayInfo.push(s.VertexBuffer.UV2Kind),t.hasUVs3&&a._delayInfo.push(s.VertexBuffer.UV3Kind),t.hasUVs4&&a._delayInfo.push(s.VertexBuffer.UV4Kind),t.hasUVs5&&a._delayInfo.push(s.VertexBuffer.UV5Kind),t.hasUVs6&&a._delayInfo.push(s.VertexBuffer.UV6Kind),t.hasColors&&a._delayInfo.push(s.VertexBuffer.ColorKind),t.hasMatricesIndices&&a._delayInfo.push(s.VertexBuffer.MatricesIndicesKind),t.hasMatricesWeights&&a._delayInfo.push(s.VertexBuffer.MatricesWeightsKind),a._delayLoadingFunction=o.VertexData.ImportVertexData):o.VertexData.ImportVertexData(t,a),r.pushGeometry(a,!0),a},e}()},"./Meshes/groundMesh.ts": /*!******************************!*\ !*** ./Meshes/groundMesh.ts ***! \******************************/ /*! exports provided: GroundMesh */function(e,t,r){"use strict";r.r(t),r.d(t,"GroundMesh",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts");s.Mesh._GroundMeshParser=function(e,t){return a.Parse(e,t)};var a=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.generateOctree=!1,n}return Object(n.__extends)(t,e),t.prototype.getClassName=function(){return"GroundMesh"},Object.defineProperty(t.prototype,"subdivisions",{get:function(){return Math.min(this._subdivisionsX,this._subdivisionsY)},enumerable:!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.TmpVectors.Matrix[5];r.invertToRef(n);var o=i.TmpVectors.Vector3[8];if(i.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,n,o),e=o.x,t=o.z,ethis._maxX||tthis._maxZ)return this.position.y;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());var s=this._getFacetAt(e,t),a=-(s.x*e+s.z*t+s.w)/s.y;return i.Vector3.TransformCoordinatesFromFloatsToRef(0,a,0,r,o),o.y},t.prototype.getNormalAtCoordinates=function(e,t){var r=new i.Vector3(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,r),r},t.prototype.getNormalAtCoordinatesToRef=function(e,t,r){var n=this.getWorldMatrix(),o=i.TmpVectors.Matrix[5];n.invertToRef(o);var s=i.TmpVectors.Vector3[8];if(i.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,o,s),e=s.x,t=s.z,ethis._maxX||tthis._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 t0!=this._getWorldMatrixDeterminant()>0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1},t.prototype._postActivate=function(){this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)},t.prototype.getWorldMatrix=function(){if(this._currentLOD&&this._currentLOD.billboardMode!==l.TransformNode.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){var t=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,i.TmpVectors.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),i.TmpVectors.Matrix[0].copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(i.TmpVectors.Vector3[7]),this._currentLOD._masterMesh=t,i.TmpVectors.Matrix[0]}return e.prototype.getWorldMatrix.call(this)},Object.defineProperty(t.prototype,"isAnInstance",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.getLOD=function(e){if(!e)return this;var t=this.getBoundingInfo();return this._currentLOD=this.sourceMesh.getLOD(e,t.boundingSphere),this._currentLOD===this.sourceMesh?this.sourceMesh:this._currentLOD},t.prototype._preActivateForIntermediateRendering=function(e){return this.sourceMesh._preActivateForIntermediateRendering(e)},t.prototype._syncSubMeshes=function(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(var e=0;e0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"morphTargetManager",{get:function(){return this._internalMeshDataInfo._morphTargetManager},set:function(e){this._internalMeshDataInfo._morphTargetManager!==e&&(this._internalMeshDataInfo._morphTargetManager=e,this._syncGeometryWithMorphTargetManager())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._internalMeshDataInfo._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}),Object.defineProperty(t.prototype,"worldMatrixInstancedBuffer",{get:function(){return this._instanceDataStorage.instancesData},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"manualUpdateOfWorldMatrixInstancedBuffer",{get:function(){return this._instanceDataStorage.manualUpdate},set:function(e){this._instanceDataStorage.manualUpdate=e},enumerable:!0,configurable:!0}),t.prototype.instantiateHierarchy=function(e,t,r){void 0===e&&(e=null);var n=!(this.getTotalVertices()>0)||t&&t.doNotInstantiate?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));n&&(n.parent=e||this.parent,n.position=this.position.clone(),n.scaling=this.scaling.clone(),this.rotationQuaternion?n.rotationQuaternion=this.rotationQuaternion.clone():n.rotation=this.rotation.clone(),r&&r(this,n));for(var i=0,o=this.getChildTransformNodes(!0);i0},enumerable:!0,configurable:!0}),t.prototype.getLODLevels=function(){return this._internalMeshDataInfo._LODLevels},t.prototype._sortLODLevels=function(){this._internalMeshDataInfo._LODLevels.sort(function(e,t){return e.distancet.distance?-1:0})},t.prototype.addLODLevel=function(e,t){if(t&&t._masterMesh)return T.Logger.Warn("You cannot use a mesh as LOD level twice"),this;var r=new E.MeshLODLevel(e,t);return this._internalMeshDataInfo._LODLevels.push(r),t&&(t._masterMesh=this),this._sortLODLevels(),this},t.prototype.getLODLevelAtDistance=function(e){for(var t=this._internalMeshDataInfo,r=0;ri)return this.onLODLevelSelection&&this.onLODLevelSelection(i,this,this),this;for(var o=0;o0;this.computeWorldMatrix();var s=this.material||i.defaultMaterial;if(s)if(s._storeEffectOnSubMeshes)for(var a=0,c=this.subMeshes;a0){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=n){i=!0;break}if(a.verticesStart+a.verticesCount>=t){i=!0;break}}if(!i)return this.subMeshes[0]}return this.releaseSubMeshes(),new m.SubMesh(0,0,t,0,this.getTotalIndices(),this)},t.prototype.subdivide=function(e){if(!(e<1)){for(var t=this.getTotalIndices(),r=t/e|0,n=0;r%3!=0;)r++;this.releaseSubMeshes();for(var i=0;i=t);i++)m.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 d.VertexData;i.set(t,e);var o=this.getScene();new f.Geometry(f.Geometry.RandomId(),o,i,r,this)}return this},t.prototype.removeVerticesData=function(e){this._geometry&&this._geometry.removeVerticesData(e)},t.prototype.markVerticesDataAsUpdatable=function(e,t){void 0===t&&(t=!0);var r=this.getVertexBuffer(e);r&&r.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)},t.prototype.setVerticesBuffer=function(e){return this._geometry||(this._geometry=f.Geometry.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e),this},t.prototype.updateVerticesData=function(e,t,r,n){return this._geometry?(n?(this.makeGeometryUnique(),this.updateVerticesData(e,t,r,!1)):this._geometry.updateVerticesData(e,t,r),this):this},t.prototype.updateMeshPositions=function(e,t){void 0===t&&(t=!0);var r=this.getVerticesData(h.VertexBuffer.PositionKind);if(!r)return this;if(e(r),this.updateVerticesData(h.VertexBuffer.PositionKind,r,!1,!1),t){var n=this.getIndices(),i=this.getVerticesData(h.VertexBuffer.NormalKind);if(!i)return this;d.VertexData.ComputeNormals(r,n,i),this.updateVerticesData(h.VertexBuffer.NormalKind,i,!1,!1)}return this},t.prototype.makeGeometryUnique=function(){if(!this._geometry)return this;var e=this._geometry,t=this._geometry.copy(f.Geometry.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this},t.prototype.setIndices=function(e,t,r){if(void 0===t&&(t=null),void 0===r&&(r=!1),this._geometry)this._geometry.setIndices(e,t,r);else{var n=new d.VertexData;n.indices=e;var i=this.getScene();new f.Geometry(f.Geometry.RandomId(),i,n,r,this)}return this},t.prototype.updateIndices=function(e,t,r){return void 0===r&&(r=!1),this._geometry?(this._geometry.updateIndices(e,t,r),this):this},t.prototype.toLeftHanded=function(){return this._geometry?(this._geometry.toLeftHanded(),this):this},t.prototype._bind=function(e,t,r){if(!this._geometry)return this;var n,i=this.getScene().getEngine();if(this._unIndexed)n=null;else switch(r){case _.Material.PointFillMode:n=null;break;case _.Material.WireFrameFillMode:n=e._getLinesIndexBuffer(this.getIndices(),i);break;default:case _.Material.TriangleFillMode:n=this._geometry.getIndexBuffer()}return this._geometry._bind(t,n),this},t.prototype._draw=function(e,t,r){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);var n=this.getScene().getEngine();return this._unIndexed||t==_.Material.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,r):t==_.Material.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,r):n.drawElementsType(t,e.indexStart,e.indexCount,r),this},t.prototype.registerBeforeRender=function(e){return this.onBeforeRenderObservable.add(e),this},t.prototype.unregisterBeforeRender=function(e){return this.onBeforeRenderObservable.removeCallback(e),this},t.prototype.registerAfterRender=function(e){return this.onAfterRenderObservable.add(e),this},t.prototype.unregisterAfterRender=function(e){return this.onAfterRenderObservable.removeCallback(e),this},t.prototype._getInstancesRenderList=function(e,t){if(void 0===t&&(t=!1),this._instanceDataStorage.isFrozen&&this._instanceDataStorage.previousBatch)return this._instanceDataStorage.previousBatch;var r=this.getScene(),n=r._isInIntermediateRendering(),i=n?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,o=this._instanceDataStorage.batchCache;if(o.mustReturn=!1,o.renderSelf[e]=t||!i&&this.isEnabled()&&this.isVisible,o.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances&&!t){var s=this._instanceDataStorage.visibleInstances,a=r.getRenderId(),c=n?s.intermediateDefaultRenderId:s.defaultRenderId;o.visibleInstances[e]=s[a],!o.visibleInstances[e]&&c&&(o.visibleInstances[e]=s[c])}return o.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&null!==o.visibleInstances[e]&&void 0!==o.visibleInstances[e],this._instanceDataStorage.previousBatch=o,o},t.prototype._renderWithInstances=function(e,t,r,n,i){var o=r.visibleInstances[e._id];if(!o)return this;for(var s=this._instanceDataStorage,a=s.instancesBufferSize,c=s.instancesBuffer,l=16*(o.length+1)*4;s.instancesBufferSizeu&&n++,0!==m&&f++,d+=m,u=m}if(c[f]++,f>o&&(o=f),0===d)i++;else{var g=1/d,_=0;for(p=0;p.001&&s++}}var v=this.skeleton.bones.length,A=this.getVerticesData(h.VertexBuffer.MatricesIndicesKind),y=this.getVerticesData(h.VertexBuffer.MatricesIndicesExtraKind),b=0;for(l=0;l=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===y.Constants.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=y.Constants.DELAYLOADSTATE_LOADING,this._queueLoad(e)),this},t.prototype._queueLoad=function(e){var t=this;e._addPendingData(this);var r=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return o.Tools.LoadFile(this.delayLoadingFile,function(r){r instanceof ArrayBuffer?t._delayLoadingFunction(r,t):t._delayLoadingFunction(JSON.parse(r),t),t.instances.forEach(function(e){e.refreshBoundingInfo(),e._syncSubMeshes()}),t.delayLoadState=y.Constants.DELAYLOADSTATE_LOADED,e._removePendingData(t)},function(){},e.offlineProvider,r),this},t.prototype.isInFrustum=function(t){return this.delayLoadState!==y.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(h.VertexBuffer.PositionKind))return this;var t=this.subMeshes.splice(0);this._resetPointsArrayCache();var r,n=this.getVerticesData(h.VertexBuffer.PositionKind),i=new Array;for(r=0;r-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;o4,u=l?this.getVerticesData(h.VertexBuffer.MatricesIndicesExtraKind):null,d=l?this.getVerticesData(h.VertexBuffer.MatricesWeightsExtraKind):null,f=e.getTransformMatrices(this),p=c.Vector3.Zero(),m=new c.Matrix,g=new c.Matrix,_=0,v=0;v0&&(c.Matrix.FromFloat32ArrayToRefScaled(f,Math.floor(16*o[_+a]),A,g),m.addToSelf(g));if(l)for(a=0;a<4;a++)(A=d[_+a])>0&&(c.Matrix.FromFloat32ArrayToRefScaled(f,Math.floor(16*u[_+a]),A,g),m.addToSelf(g));c.Vector3.TransformCoordinatesFromFloatsToRef(t._sourcePositions[v],t._sourcePositions[v+1],t._sourcePositions[v+2],m,p),p.toArray(n,v),c.Vector3.TransformNormalFromFloatsToRef(t._sourceNormals[v],t._sourceNormals[v+1],t._sourceNormals[v+2],m,p),p.toArray(i,v),m.reset()}return this.updateVerticesData(h.VertexBuffer.PositionKind,n),this.updateVerticesData(h.VertexBuffer.NormalKind,i),this},t.MinMax=function(e){var t=null,r=null;return e.forEach(function(e){var n=e.getBoundingInfo().boundingBox;t&&r?(t.minimizeInPlace(n.minimumWorld),r.maximizeInPlace(n.maximumWorld)):(t=n.minimumWorld,r=n.maximumWorld)}),t&&r?{min:t,max:r}:{min: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=65536)return T.Logger.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}if(s){var l,u,h=null;o=!1}var f,p=new Array,g=new Array,_=null,A=new Array,y=null;for(a=0;ai.bbSize.y?i.bbSize.x:i.bbSize.y;$=$>i.bbSize.z?$:i.bbSize.z,B=i.subDiv.X*O/i.bbSize.x,w=i.subDiv.Y*O/i.bbSize.y,L=i.subDiv.Z*O/i.bbSize.z,N=i.subDiv.max*i.subDiv.max,i.facetPartitioning.length=0}for(o=0;ol||r.deleted||r.isDirty))for(var o=0;o<3;++o)if(r.error[o]>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;t0&&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,g,3*i.length,this._reconstructedMesh))},e.prototype.initDecimatedMesh=function(){this._reconstructedMesh=new a.Mesh(this._mesh.name+"Decimated",this._mesh.getScene()),this._reconstructedMesh.material=this._mesh.material,this._reconstructedMesh.parent=this._mesh.parent,this._reconstructedMesh.isVisible=!1,this._reconstructedMesh.renderingGroupId=this._mesh.renderingGroupId},e.prototype.isFlipped=function(e,t,r,n,o){for(var s=0;s.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;ot.x&&(t.x=r.x),r.yt.y&&(t.y=r.y)}),{min:e,max:t,width:t.x-e.x,height:t.y-e.y}},e}(),f=function(){function e(){}return e.Rectangle=function(e,t,r,n){return[new o.Vector2(e,t),new o.Vector2(r,t),new o.Vector2(r,n),new o.Vector2(e,n)]},e.Circle=function(e,t,r,n){void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=32);for(var i=new Array,s=0,a=2*Math.PI/n,c=0;c0){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;us.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),m=new o.Vector3(d.x,0,d.y).subtract(p),g=new o.Vector3(0,1,0),_=o.Vector3.Cross(m,g);_=_.normalize(),r.push(u/i.width,0),r.push(u/i.width,1),u+=m.length(),r.push(u/i.width,0),r.push(u/i.width,1),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(/*! ./buffer */"./Meshes/buffer.ts"),o=r(/*! ../Collisions/intersectionInfo */"./Collisions/intersectionInfo.ts"),s=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),a=r(/*! ../Engines/constants */"./Engines/constants.ts"),c=r(/*! ../Maths/math.functions */"./Maths/math.functions.ts"),l=function(){function e(){this._materialDefines=null,this._materialEffect=null}return Object.defineProperty(e.prototype,"materialDefines",{get:function(){return this._materialDefines},set:function(e){this._materialDefines=e},enumerable:!0,configurable:!0}),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._linesIndexCount=0,l._linesIndexBuffer=null,l._lastColliderWorldVertices=null,l._lastColliderTransformMatrix=null,l._renderId=0,l._alphaIndex=0,l._distanceToCamera=0,l._currentMaterial=null,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 Object(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(e){if(void 0===e&&(e=null),this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(i.VertexBuffer.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;var t,r=this._renderingMesh.getIndices();if(0===this.indexStart&&this.indexCount===r.length){var n=this._renderingMesh.getBoundingInfo();t={minimum:n.minimum.clone(),maximum:n.maximum.clone()}}else t=Object(c.extractMinAndMaxIndexed)(e,r,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(t.minimum,t.maximum):this._boundingInfo=new s.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&&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._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this},t.prototype._getLinesIndexBuffer=function(e,t){if(!this._linesIndexBuffer){for(var r=[],n=this.indexStart;na&&(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 l});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),o=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),l=function(e){function t(t,r,n,i,o,a){void 0===i&&(i=1),void 0===o&&(o=60),void 0===a&&(a=!0);var c=e.call(this,t,n)||this;c._sectionPolygonPointsCount=4,c._running=!1,c._autoStart=a,c._generator=r,c._diameter=i,c._length=o,c._sectionVectors=[],c._sectionNormalVectors=[];for(var l=0;l1023?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;i32767)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),m=new ArrayBuffer(t.width*t.height*4*3),g=new Float32Array(m);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;u128){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;_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-1&&this._tasks.splice(t,1)},e.prototype._decreaseWaitingTasksCount=function(e){this._waitingTasksCount--;try{this.onProgress&&this.onProgress(this._waitingTasksCount,this._totalTasksCount,e),this.onProgressObservable.notifyObservers(new p(this._waitingTasksCount,this._totalTasksCount,e))}catch(e){d.Logger.Error("Error running progress callbacks."),console.log(e)}if(0===this._waitingTasksCount){try{var t=this._tasks.slice();this.onFinish&&this.onFinish(t);for(var r=0,i=t;r-1&&this._tasks.splice(o,1)}}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(e){d.Logger.Error("Error running tasks-done callbacks."),console.log(e)}this._isLoading=!1,this.autoHideLoadingUI&&this._scene.getEngine().hideLoadingUI()}},e.prototype._runTask=function(e){var t=this,r=function(r,n){e._setErrorObject(r,n),t.onTaskError&&t.onTaskError(e),t.onTaskErrorObservable.notifyObservers(e),t._decreaseWaitingTasksCount(e)};e.run(this._scene,function(){try{t.onTaskSuccess&&t.onTaskSuccess(e),t.onTaskSuccessObservable.notifyObservers(e),t._decreaseWaitingTasksCount(e)}catch(e){r("Error executing task success callbacks",e)}},r)},e.prototype.reset=function(){return this._isLoading=!1,this._tasks=new Array,this},e.prototype.load=function(){if(this._isLoading)return this;if(this._isLoading=!0,this._waitingTasksCount=this._tasks.length,this._totalTasksCount=this._tasks.length,0===this._waitingTasksCount)return this._isLoading=!1,this.onFinish&&this.onFinish(this._tasks),this.onTasksDoneObservable.notifyObservers(this._tasks),this;this.useDefaultLoadingScreen&&this._scene.getEngine().displayLoadingUI();for(var e=0;e>2&3],o[f++]=i[d>>4&3],o[f++]=i[d>>6&3]}}return o}(s,0,e.getImageWidth(t,r)+3&-4,e.getImageHeight(t,r)+3&-4));return s}onmessage=function(n){if("init"===n.data.action)t||(Module={wasmBinary:n.data.wasmBinary},importScripts(n.data.url),t=new Promise(function(e){Module.onRuntimeInitialized=function(){Module.initializeBasis(),e()}})),t.then(function(){postMessage({action:"init"})});else if("transcode"===n.data.action){var i=n.data.config,o=n.data.imageData,s=new Module.BasisFile(o),a=function(e){for(var t=e.getHasAlpha(),r=e.getNumImages(),n=[],i=0;i>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>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>8&255,O>>16&255,O>>24&255)))}var B=e._ExtractLongWordOrder(P[23]),w=e._ExtractLongWordOrder(P[24]),L=e._ExtractLongWordOrder(P[25]),N=e._ExtractLongWordOrder(P[26]);I&&(C=t._getRGBABufferInternalSizedFormat(i.textureType)),T=1,131072&P[2]&&!1!==s&&(T=Math.max(1,P[7]));for(var F=h||0;F0?i.sphericalPolynomial=c.CubeMapToSphericalPolynomialTools.ConvertCubeMapToSphericalPolynomial({size:P[4],right:g[0],left:g[1],up:g[2],down:g[3],front:g[4],back:g[5],format:o.Constants.TEXTUREFORMAT_RGBA,type:o.Constants.TEXTURETYPE_FLOAT,gammaSpace:!1}):i.sphericalPolynomial=void 0}else a.Logger.Error("Compressed textures are not supported on this platform.");else a.Logger.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");else a.Logger.Error("Invalid magic number in DDS header")},e.StoreLODInAlphaChannel=!1,e}();u.ThinEngine.prototype.createPrefilteredCubeTexture=function(e,t,r,o,c,u,h,d,f){var p=this;void 0===c&&(c=null),void 0===u&&(u=null),void 0===d&&(d=null),void 0===f&&(f=!0);return this.createCubeTexture(e,t,null,!1,function(e){if(e){var u=e.texture;if(f?e.info.sphericalPolynomial&&(u._sphericalPolynomial=e.info.sphericalPolynomial):u._sphericalPolynomial=new i.SphericalPolynomial,u._source=s.InternalTextureSource.CubePrefiltered,p.getCaps().textureLOD)c&&c(u);else{var h=p._gl,d=e.width;if(d){for(var m=[],_=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)),M=new s.InternalTexture(p,s.InternalTextureSource.Temp);if(M.type=u.type,M.format=u.format,M.width=Math.pow(2,Math.max(n.Scalar.Log2(d)-T,0)),M.height=M.width,M.isCube=!0,p._bindTextureDirectly(h.TEXTURE_CUBE_MAP,M,!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,P=e.data;p._unpackFlipY(x.isCompressed),g.UploadDDSLevels(p,M,P,x,!0,6,T)}else a.Logger.Warn("DDS is the only prefiltered cube map supported so far.");p._bindTextureDirectly(h.TEXTURE_CUBE_MAP,null);var E=new l.BaseTexture(t);E.isCube=!0,E._texture=M,M.isReady=!0,m.push(E)}u._lodTextureHigh=m[2],u._lodTextureMid=m[1],u._lodTextureLow=m[0],c&&c(u)}}}else c&&c(null)},u,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 d}),r.d(t,"serialize",function(){return f}),r.d(t,"serializeAsTexture",function(){return p}),r.d(t,"serializeAsColor3",function(){return m}),r.d(t,"serializeAsFresnelParameters",function(){return g}),r.d(t,"serializeAsVector2",function(){return _}),r.d(t,"serializeAsVector3",function(){return v}),r.d(t,"serializeAsMeshReference",function(){return A}),r.d(t,"serializeAsColorCurves",function(){return y}),r.d(t,"serializeAsColor4",function(){return b}),r.d(t,"serializeAsImageProcessingConfiguration",function(){return T}),r.d(t,"serializeAsQuaternion",function(){return M}),r.d(t,"serializeAsMatrix",function(){return x}),r.d(t,"serializeAsCameraReference",function(){return P}),r.d(t,"SerializationHelper",function(){return E});var n=r(/*! ../Misc/tags */"./Misc/tags.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ./devTools */"./Misc/devTools.ts"),s=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),a={},c={},l=function(e,t,r){var i=e();n.Tags&&n.Tags.AddTagsTo(i,t.tags);var o=u(i);for(var s in o){var a=o[s],c=t[s],l=a.type;if(null!=c&&"uniqueId"!==s)switch(l){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 u(e){var t=e.getClassName();if(c[t])return c[t];c[t]={};for(var r=c[t],n=e,i=t;i;){var o=a[i];for(var s in o)r[s]=o[s];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 h(e,t){return function(r,n){var i=function(e){var t=e.getClassName();return a[t]||(a[t]={}),a[t]}(r);i[n]||(i[n]={type:e,sourceName:t})}}function d(e,t){return void 0===t&&(t=null),function(e,t){return void 0===t&&(t=null),function(r,n){var i=t||"_"+n;Object.defineProperty(r,n,{get:function(){return this[i]},set:function(t){this[i]!==t&&(this[i]=t,r[e].apply(this))},enumerable:!0,configurable:!0})}}(e,t)}function f(e){return h(0,e)}function p(e){return h(1,e)}function m(e){return h(2,e)}function g(e){return h(3,e)}function _(e){return h(4,e)}function v(e){return h(5,e)}function A(e){return h(6,e)}function y(e){return h(7,e)}function b(e){return h(8,e)}function T(e){return h(9,e)}function M(e){return h(10,e)}function x(e){return h(12,e)}function P(e){return h(11,e)}var E=function(){function e(){}return e.AppendSerializedAnimations=function(e,t){if(e.animations){t.animations=[];for(var r=0;r0)if("object"==typeof a[0])for(var l=0;l=200&&t.status<300||0===t.status&&(!o.DomManagement.IsWindowObjectExist()||e.IsFileURL()))return void r(c?t.response:t.responseText,t);var n=e.DefaultRetryStrategy;if(n){var u=n(h,t,m);if(-1!==u)return t.removeEventListener("loadend",g),t=new i.WebRequest,void(s=setTimeout(function(){return a(m+1)},u))}var f=new p("Error status: "+t.status+" "+t.statusText+" - Unable to load "+h,t);l&&l(f)}};t.addEventListener("readystatechange",_),t.send()};a(0)};if(a&&a.enableSceneOffline){var g=function(e){e&&e.status>400?l&&l(e):m()};a.open(function(){a&&a.loadFile(e.BaseUrl+t,function(e){d||r(e),f.onCompleteObservable.notifyObservers(f)},n?function(e){d||n(e)}:void 0,g,c)},g)}else m();return f},e.IsFileURL=function(){return"file:"===location.protocol},e.DefaultRetryStrategy=c.RetryStrategy.ExponentialBackoff(),e.BaseUrl="",e.CorsBehavior="anonymous",e.PreprocessUrl=function(e){return e},e}();h.ThinEngine._FileToolsLoadImage=g.LoadImage.bind(g),h.ThinEngine._FileToolsLoadFile=g.LoadFile.bind(g),d.ShaderProcessor._FileToolsLoadFile=g.LoadFile.bind(g)},"./Misc/filesInput.ts": /*!****************************!*\ !*** ./Misc/filesInput.ts ***! \****************************/ /*! exports provided: FilesInput */function(e,t,r){"use strict";r.r(t),r.d(t,"FilesInput",function(){return s});var n=r(/*! ../Loading/sceneLoader */"./Loading/sceneLoader.ts"),i=r(/*! ../Misc/logger */"./Misc/logger.ts"),o=r(/*! ./filesInputStore */"./Misc/filesInputStore.ts"),s=function(){function e(e,t,r,n,i,o,s,a,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;o0)){for(var r=new Array,n=[],i=e.dataTransfer?e.dataTransfer.items:null,o=0;o0&&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/gradients.ts": /*!***************************!*\ !*** ./Misc/gradients.ts ***! \***************************/ /*! exports provided: ColorGradient, Color3Gradient, FactorGradient, GradientHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"ColorGradient",function(){return i}),r.d(t,"Color3Gradient",function(){return o}),r.d(t,"FactorGradient",function(){return s}),r.d(t,"GradientHelper",function(){return a});var n=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),i=function(){function e(){}return e.prototype.getColorToRef=function(e){this.color2?n.Color4.LerpToRef(this.color1,this.color2,Math.random(),e):e.copyFrom(this.color1)},e}(),o=function(){},s=function(){function e(){}return e.prototype.getFactor=function(){return void 0===this.factor2?this.factor1:this.factor1+(this.factor2-this.factor1)*Math.random()},e}(),a=function(){function e(){}return e.GetCurrentGradient=function(e,t,r){for(var n=0;n=i.gradient&&e<=o.gradient)return void r(i,o,(e-i.gradient)/(o.gradient-i.gradient))}var s=t.length-1;r(t[s],t[s],1)},e}()},"./Misc/guid.ts": /*!**********************!*\ !*** ./Misc/guid.ts ***! \**********************/ /*! exports provided: GUID */function(e,t,r){"use strict";r.r(t),r.d(t,"GUID",function(){return n});var n=function(){function e(){}return e.RandomId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}()},"./Misc/iInspectable.ts": /*!******************************!*\ !*** ./Misc/iInspectable.ts ***! \******************************/ /*! exports provided: InspectableType */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"InspectableType",function(){return n}),function(e){e[e.Checkbox=0]="Checkbox",e[e.Slider=1]="Slider",e[e.Vector3=2]="Vector3",e[e.Quaternion=3]="Quaternion",e[e.Color3=4]="Color3",e[e.String=5]="String"}(n||(n={}))},"./Misc/index.ts": /*!***********************!*\ !*** ./Misc/index.ts ***! \***********************/ /*! exports provided: AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, EquiRectangularCubeTextureAssetTask, AssetsManager, BasisTranscodeConfiguration, BasisTools, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsMatrix, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, MeshExploder, FilesInput, KhronosTextureContainer, EventState, Observer, MultiObserver, Observable, PerformanceMonitor, RollingAverage, PromisePolyfill, SceneOptimization, TextureOptimization, HardwareScalingOptimization, ShadowsOptimization, PostProcessesOptimization, LensFlaresOptimization, CustomOptimization, ParticlesOptimization, RenderTargetsOptimization, MergeMeshesOptimization, SceneOptimizerOptions, SceneOptimizer, SceneSerializer, SmartArray, SmartArrayNoDuplicate, StringDictionary, Tags, TextureTools, TGATools, Tools, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, WebRequest, InspectableType, BRDFTextureTools, RGBDTextureTools, ColorGradient, Color3Gradient, FactorGradient, GradientHelper, PerfCounter, RetryStrategy, CanvasGenerator, LoadFileError, RequestFileError, ReadFileError, FileTools, StringTools, DataReader, MinMaxReducer, DepthReducer, CubeMapToSphericalPolynomialTools, 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,"EquiRectangularCubeTextureAssetTask",function(){return i.EquiRectangularCubeTextureAssetTask}),r.d(t,"AssetsManager",function(){return i.AssetsManager});var o=r(/*! ./basis */"./Misc/basis.ts");r.d(t,"BasisTranscodeConfiguration",function(){return o.BasisTranscodeConfiguration}),r.d(t,"BasisTools",function(){return o.BasisTools});var s=r(/*! ./dds */"./Misc/dds.ts");r.d(t,"DDSTools",function(){return s.DDSTools});var a=r(/*! ./decorators */"./Misc/decorators.ts");r.d(t,"expandToProperty",function(){return a.expandToProperty}),r.d(t,"serialize",function(){return a.serialize}),r.d(t,"serializeAsTexture",function(){return a.serializeAsTexture}),r.d(t,"serializeAsColor3",function(){return a.serializeAsColor3}),r.d(t,"serializeAsFresnelParameters",function(){return a.serializeAsFresnelParameters}),r.d(t,"serializeAsVector2",function(){return a.serializeAsVector2}),r.d(t,"serializeAsVector3",function(){return a.serializeAsVector3}),r.d(t,"serializeAsMeshReference",function(){return a.serializeAsMeshReference}),r.d(t,"serializeAsColorCurves",function(){return a.serializeAsColorCurves}),r.d(t,"serializeAsColor4",function(){return a.serializeAsColor4}),r.d(t,"serializeAsImageProcessingConfiguration",function(){return a.serializeAsImageProcessingConfiguration}),r.d(t,"serializeAsQuaternion",function(){return a.serializeAsQuaternion}),r.d(t,"serializeAsMatrix",function(){return a.serializeAsMatrix}),r.d(t,"serializeAsCameraReference",function(){return a.serializeAsCameraReference}),r.d(t,"SerializationHelper",function(){return a.SerializationHelper});var c=r(/*! ./deferred */"./Misc/deferred.ts");r.d(t,"Deferred",function(){return c.Deferred});var l=r(/*! ./environmentTextureTools */"./Misc/environmentTextureTools.ts");r.d(t,"EnvironmentTextureTools",function(){return l.EnvironmentTextureTools});var u=r(/*! ./meshExploder */"./Misc/meshExploder.ts");r.d(t,"MeshExploder",function(){return u.MeshExploder});var h=r(/*! ./filesInput */"./Misc/filesInput.ts");r.d(t,"FilesInput",function(){return h.FilesInput});var d=r(/*! ./HighDynamicRange/index */"./Misc/HighDynamicRange/index.ts");r.d(t,"CubeMapToSphericalPolynomialTools",function(){return d.CubeMapToSphericalPolynomialTools}),r.d(t,"HDRTools",function(){return d.HDRTools}),r.d(t,"PanoramaToCubeMapTools",function(){return d.PanoramaToCubeMapTools});var f=r(/*! ./khronosTextureContainer */"./Misc/khronosTextureContainer.ts");r.d(t,"KhronosTextureContainer",function(){return f.KhronosTextureContainer});var p=r(/*! ./observable */"./Misc/observable.ts");r.d(t,"EventState",function(){return p.EventState}),r.d(t,"Observer",function(){return p.Observer}),r.d(t,"MultiObserver",function(){return p.MultiObserver}),r.d(t,"Observable",function(){return p.Observable});var m=r(/*! ./performanceMonitor */"./Misc/performanceMonitor.ts");r.d(t,"PerformanceMonitor",function(){return m.PerformanceMonitor}),r.d(t,"RollingAverage",function(){return m.RollingAverage});var g=r(/*! ./promise */"./Misc/promise.ts");r.d(t,"PromisePolyfill",function(){return g.PromisePolyfill});var _=r(/*! ./sceneOptimizer */"./Misc/sceneOptimizer.ts");r.d(t,"SceneOptimization",function(){return _.SceneOptimization}),r.d(t,"TextureOptimization",function(){return _.TextureOptimization}),r.d(t,"HardwareScalingOptimization",function(){return _.HardwareScalingOptimization}),r.d(t,"ShadowsOptimization",function(){return _.ShadowsOptimization}),r.d(t,"PostProcessesOptimization",function(){return _.PostProcessesOptimization}),r.d(t,"LensFlaresOptimization",function(){return _.LensFlaresOptimization}),r.d(t,"CustomOptimization",function(){return _.CustomOptimization}),r.d(t,"ParticlesOptimization",function(){return _.ParticlesOptimization}),r.d(t,"RenderTargetsOptimization",function(){return _.RenderTargetsOptimization}),r.d(t,"MergeMeshesOptimization",function(){return _.MergeMeshesOptimization}),r.d(t,"SceneOptimizerOptions",function(){return _.SceneOptimizerOptions}),r.d(t,"SceneOptimizer",function(){return _.SceneOptimizer});var v=r(/*! ./sceneSerializer */"./Misc/sceneSerializer.ts");r.d(t,"SceneSerializer",function(){return v.SceneSerializer});var A=r(/*! ./smartArray */"./Misc/smartArray.ts");r.d(t,"SmartArray",function(){return A.SmartArray}),r.d(t,"SmartArrayNoDuplicate",function(){return A.SmartArrayNoDuplicate});var y=r(/*! ./stringDictionary */"./Misc/stringDictionary.ts");r.d(t,"StringDictionary",function(){return y.StringDictionary});var b=r(/*! ./tags */"./Misc/tags.ts");r.d(t,"Tags",function(){return b.Tags});var T=r(/*! ./textureTools */"./Misc/textureTools.ts");r.d(t,"TextureTools",function(){return T.TextureTools});var M=r(/*! ./tga */"./Misc/tga.ts");r.d(t,"TGATools",function(){return M.TGATools});var x=r(/*! ./tools */"./Misc/tools.ts");r.d(t,"Tools",function(){return x.Tools}),r.d(t,"className",function(){return x.className}),r.d(t,"AsyncLoop",function(){return x.AsyncLoop});var P=r(/*! ./videoRecorder */"./Misc/videoRecorder.ts");r.d(t,"VideoRecorder",function(){return P.VideoRecorder});var E=r(/*! ./virtualJoystick */"./Misc/virtualJoystick.ts");r.d(t,"JoystickAxis",function(){return E.JoystickAxis}),r.d(t,"VirtualJoystick",function(){return E.VirtualJoystick});var C=r(/*! ./workerPool */"./Misc/workerPool.ts");r.d(t,"WorkerPool",function(){return C.WorkerPool});var S=r(/*! ./logger */"./Misc/logger.ts");r.d(t,"Logger",function(){return S.Logger});var R=r(/*! ./typeStore */"./Misc/typeStore.ts");r.d(t,"_TypeStore",function(){return R._TypeStore});var O=r(/*! ./filesInputStore */"./Misc/filesInputStore.ts");r.d(t,"FilesInputStore",function(){return O.FilesInputStore});var I=r(/*! ./deepCopier */"./Misc/deepCopier.ts");r.d(t,"DeepCopier",function(){return I.DeepCopier});var D=r(/*! ./pivotTools */"./Misc/pivotTools.ts");r.d(t,"PivotTools",function(){return D.PivotTools});var B=r(/*! ./precisionDate */"./Misc/precisionDate.ts");r.d(t,"PrecisionDate",function(){return B.PrecisionDate});var 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 N=r(/*! ./iInspectable */"./Misc/iInspectable.ts");r.d(t,"InspectableType",function(){return N.InspectableType});var F=r(/*! ./brdfTextureTools */"./Misc/brdfTextureTools.ts");r.d(t,"BRDFTextureTools",function(){return F.BRDFTextureTools});var V=r(/*! ./rgbdTextureTools */"./Misc/rgbdTextureTools.ts");r.d(t,"RGBDTextureTools",function(){return V.RGBDTextureTools});var k=r(/*! ./gradients */"./Misc/gradients.ts");r.d(t,"ColorGradient",function(){return k.ColorGradient}),r.d(t,"Color3Gradient",function(){return k.Color3Gradient}),r.d(t,"FactorGradient",function(){return k.FactorGradient}),r.d(t,"GradientHelper",function(){return k.GradientHelper});var z=r(/*! ./perfCounter */"./Misc/perfCounter.ts");r.d(t,"PerfCounter",function(){return z.PerfCounter});var U=r(/*! ./retryStrategy */"./Misc/retryStrategy.ts");r.d(t,"RetryStrategy",function(){return U.RetryStrategy});var G=r(/*! ./canvasGenerator */"./Misc/canvasGenerator.ts");r.d(t,"CanvasGenerator",function(){return G.CanvasGenerator});var j=r(/*! ./fileTools */"./Misc/fileTools.ts");r.d(t,"LoadFileError",function(){return j.LoadFileError}),r.d(t,"RequestFileError",function(){return j.RequestFileError}),r.d(t,"ReadFileError",function(){return j.ReadFileError}),r.d(t,"FileTools",function(){return j.FileTools});var H=r(/*! ./stringTools */"./Misc/stringTools.ts");r.d(t,"StringTools",function(){return H.StringTools});var X=r(/*! ./dataReader */"./Misc/dataReader.ts");r.d(t,"DataReader",function(){return X.DataReader});var W=r(/*! ./minMaxReducer */"./Misc/minMaxReducer.ts");r.d(t,"MinMaxReducer",function(){return W.MinMaxReducer});var Y=r(/*! ./depthReducer */"./Misc/depthReducer.ts");r.d(t,"DepthReducer",function(){return Y.DepthReducer})},"./Misc/instantiationTools.ts": /*!************************************!*\ !*** ./Misc/instantiationTools.ts ***! \************************************/ /*! exports provided: InstantiationTools */function(e,t,r){"use strict";r.r(t),r.d(t,"InstantiationTools",function(){return o});var n=r(/*! ./logger */"./Misc/logger.ts"),i=r(/*! ./typeStore */"./Misc/typeStore.ts"),o=function(){function e(){}return e.Instantiate=function(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];var t=i._TypeStore.GetClass(e);if(t)return t;n.Logger.Warn(e+" not found, you may have missed an import.");for(var r=e.split("."),o=window||this,s=0,a=r.length;s=12){var t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&49===t[5]&&49===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1},e.HEADER_LEN=64,e.COMPRESSED_2D=0,e.COMPRESSED_3D=1,e.TEX_2D=2,e.TEX_3D=3,e}()},"./Misc/khronosTextureContainer2.ts": /*!******************************************!*\ !*** ./Misc/khronosTextureContainer2.ts ***! \******************************************/ /*! exports provided: KhronosTextureContainer2 */function(e,t,r){"use strict";r.r(t),r.d(t,"KhronosTextureContainer2",function(){return n});var n=function(){function e(t){var r=this;e._ModulePromise||(e._ModulePromise=new Promise(function(n){LIBKTX().then(function(i){i.GL.makeContextCurrent(i.GL.registerContext(t._gl,{majorVersion:t._webGLVersion})),e._TranscodeFormat=r._determineTranscodeFormat(i.TranscodeTarget,t.getCaps()),n({module:i})})}))}return e.prototype.uploadAsync=function(t,r){return e._ModulePromise.then(function(n){var i=new n.module.ktxTexture(t);try{i.isBasisSupercompressed&&i.transcodeBasis(e._TranscodeFormat,0),r.width=r.baseWidth=i.baseWidth,r.height=r.baseHeight=i.baseHeight,r.generateMipMaps=!1;var o=i.glUpload();if(0!==o.error)throw new Error("Failed to upload: "+o.error);r._webGLTexture=o.texture,r.isReady=!0}finally{i.delete()}})},e.prototype._determineTranscodeFormat=function(e,t){if(t.s3tc)return e.BC1_OR_3;if(t.etc2)return e.ETC;throw new Error("No compatible format available")},e.IsValid=function(e){if(e.byteLength>=12){var t=new Uint8Array(e.buffer,e.byteOffset,12);if(171===t[0]&&75===t[1]&&84===t[2]&&88===t[3]&&32===t[4]&&50===t[5]&&48===t[6]&&187===t[7]&&13===t[8]&&10===t[9]&&26===t[10]&&10===t[11])return!0}return!1},e}()},"./Misc/logger.ts": /*!************************!*\ !*** ./Misc/logger.ts ***! \************************/ /*! exports provided: Logger */function(e,t,r){"use strict";r.r(t),r.d(t,"Logger",function(){return n});var n=function(){function e(){}return e._AddLogEntry=function(t){e._LogCache=t+e._LogCache,e.OnNewCacheEntry&&e.OnNewCacheEntry(t)},e._FormatMessage=function(e){var t=function(e){return e<10?"0"+e:""+e},r=new Date;return"["+t(r.getHours())+":"+t(r.getMinutes())+":"+t(r.getSeconds())+"]: "+e},e._LogDisabled=function(e){},e._LogEnabled=function(t){var r=e._FormatMessage(t);console.log("BJS - "+r);var n="
"+r+"

";e._AddLogEntry(n)},e._WarnDisabled=function(e){},e._WarnEnabled=function(t){var r=e._FormatMessage(t);console.warn("BJS - "+r);var n="
"+r+"

";e._AddLogEntry(n)},e._ErrorDisabled=function(e){},e._ErrorEnabled=function(t){e.errorsCount++;var r=e._FormatMessage(t);console.error("BJS - "+r);var n="
"+r+"

";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.vector */"./Maths/math.vector.ts"),i=function(){function e(e,t){this._meshesOrigins=[],this._toCenterVectors=[],this._scaledDirection=n.Vector3.Zero(),this._newPosition=n.Vector3.Zero(),this._centerPosition=n.Vector3.Zero(),this._meshes=e.slice(),t?this._centerMesh=t:this._setCenterMesh();var r=this._meshes.indexOf(this._centerMesh);r>=0&&this._meshes.splice(r,1),this._centerPosition=this._centerMesh.getAbsolutePosition().clone();for(var i=0;i1||u>1;){l=Math.max(Math.round(l/2),1),u=Math.max(Math.round(u/2),1);var d=new i.PostProcess("Reduction phase "+h,"minmaxRedux",["texSize"],null,{width:l,height:u},null,n.Constants.TEXTURE_NEAREST_NEAREST,a.getEngine(),!1,"#define "+(1==l&&1==u?"LAST":1==l||1==u?"ONEBEFORELAST":"MAIN"),r,void 0,void 0,void 0,n.Constants.TEXTUREFORMAT_RG);if(d.autoClear=!1,d.forceFullscreenViewport=o,d.onApply=function(e,t){return function(r){1==e||1==t?r.setIntArray2("texSize",new Int32Array([e,t])):r.setFloatArray2("texSize",new Float32Array([e,t]))}}(l,u),this._reductionSteps.push(d),h++,1==l&&1==u){d.onAfterRenderObservable.add(function(e,t,r){var n=new Float32Array(4*e*t),i={min:0,max:0};return function(){a.getEngine()._readTexturePixels(r.inputTexture,e,t,-1,0,n),i.min=n[0],i.max=n[1],s.onAfterReductionPerformed.notifyObservers(i)}}(l,u,d))}}}},Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._sourceTexture?this._sourceTexture.refreshRate:-1},set:function(e){this._sourceTexture&&(this._sourceTexture.refreshRate=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activated",{get:function(){return this._activated},enumerable:!0,configurable:!0}),e.prototype.activate=function(){var e=this;!this._onAfterUnbindObserver&&this._sourceTexture&&(this._onAfterUnbindObserver=this._sourceTexture.onAfterUnbindObservable.add(function(){e._reductionSteps[0].activate(e._camera),e._postProcessManager.directRender(e._reductionSteps,e._reductionSteps[0].inputTexture,e._forceFullscreenViewport),e._camera.getScene().getEngine().unBindFramebuffer(e._reductionSteps[0].inputTexture,!1)}),this._activated=!0)},e.prototype.deactivate=function(){this._onAfterUnbindObserver&&this._sourceTexture&&(this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=null,this._activated=!1)},e.prototype.dispose=function(e){if(void 0===e&&(e=!0),e&&this.onAfterReductionPerformed.clear(),this.deactivate(),this._reductionSteps){for(var t=0;t0},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;t1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)},e.Enabled=!0,e}()},"./Misc/performanceMonitor.ts": /*!************************************!*\ !*** ./Misc/performanceMonitor.ts ***! \************************************/ /*! exports provided: PerformanceMonitor, RollingAverage */function(e,t,r){"use strict";r.r(t),r.d(t,"PerformanceMonitor",function(){return i}),r.d(t,"RollingAverage",function(){return o});var n=r(/*! ./precisionDate */"./Misc/precisionDate.ts"),i=function(){function e(e){void 0===e&&(e=30),this._enabled=!0,this._rollingFrameTime=new o(e)}return e.prototype.sampleFrame=function(e){if(void 0===e&&(e=n.PrecisionDate.Now),this._enabled){if(null!=this._lastFrameTimeMs){var t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}},Object.defineProperty(e.prototype,"averageFrameTime",{get:function(){return this._rollingFrameTime.average},enumerable:!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.vector */"./Maths/math.vector.ts"),i=function(){function e(){}return e._RemoveAndStorePivotPoint=function(t){t&&0===e._PivotCached&&(t.getPivotPointToRef(e._OldPivotPoint),e._OldPivotPoint.equalsToFloats(0,0,0)||(t.setPivotMatrix(n.Matrix.IdentityReadOnly),e._OldPivotPoint.subtractToRef(t.getPivotPoint(),e._PivotTranslation),e._PivotTmpVector.copyFromFloats(1,1,1),e._PivotTmpVector.subtractInPlace(t.scaling),e._PivotTmpVector.multiplyInPlace(e._PivotTranslation),t.position.addInPlace(e._PivotTmpVector))),e._PivotCached++},e._RestorePivotPoint=function(t){t&&!e._OldPivotPoint.equalsToFloats(0,0,0)&&1===e._PivotCached&&(t.setPivotPoint(e._OldPivotPoint),e._PivotTmpVector.copyFromFloats(1,1,1),e._PivotTmpVector.subtractInPlace(t.scaling),e._PivotTmpVector.multiplyInPlace(e._PivotTranslation),t.position.subtractInPlace(e._PivotTmpVector)),this._PivotCached--},e._PivotCached=0,e._OldPivotPoint=new n.Vector3,e._PivotTranslation=new n.Vector3,e._PivotTmpVector=new n.Vector3,e}()},"./Misc/precisionDate.ts": /*!*******************************!*\ !*** ./Misc/precisionDate.ts ***! \*******************************/ /*! exports provided: PrecisionDate */function(e,t,r){"use strict";r.r(t),r.d(t,"PrecisionDate",function(){return i});var n=r(/*! ./domManagement */"./Misc/domManagement.ts"),i=function(){function e(){}return Object.defineProperty(e,"Now",{get:function(){return n.DomManagement.IsWindowObjectExist()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!0,configurable:!0}),e}()},"./Misc/promise.ts": /*!*************************!*\ !*** ./Misc/promise.ts ***! \*************************/ /*! exports provided: PromisePolyfill */function(e,t,r){"use strict";var n;r.r(t),r.d(t,"PromisePolyfill",function(){return s}),function(e){e[e.Pending=0]="Pending",e[e.Fulfilled=1]="Fulfilled",e[e.Rejected=2]="Rejected"}(n||(n={}));var i=function(){this.count=0,this.target=0,this.results=[]},o=function(){function e(e){var t=this;if(this._state=n.Pending,this._children=new Array,this._rejectWasConsumed=!1,e)try{e(function(e){t._resolve(e)},function(e){t._reject(e)})}catch(e){this._reject(e)}}return Object.defineProperty(e.prototype,"_result",{get:function(){return this._resultValue},set:function(e){this._resultValue=e,this._parent&&void 0===this._parent._result&&(this._parent._result=e)},enumerable:!0,configurable:!0}),e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.then=function(t,r){var i=this,o=new e;return o._onFulfilled=t,o._onRejected=r,this._children.push(o),o._parent=this,this._state!==n.Pending&&setTimeout(function(){if(i._state===n.Fulfilled||i._rejectWasConsumed){var e=o._resolve(i._result);if(null!=e)if(void 0!==e._state){var t=e;o._children.push(t),t._parent=o,o=t}else o._result=e}else o._reject(i._reason)}),o},e.prototype._moveChildren=function(e){var t,r=this;if((t=this._children).push.apply(t,e.splice(0,e.length)),this._children.forEach(function(e){e._parent=r}),this._state===n.Fulfilled)for(var i=0,o=this._children;i=e||-1!==r.indexOf("file:")?-1:Math.pow(2,i)*t}},e}()},"./Misc/rgbdTextureTools.ts": /*!**********************************!*\ !*** ./Misc/rgbdTextureTools.ts ***! \**********************************/ /*! exports provided: RGBDTextureTools */function(e,t,r){"use strict";r.r(t),r.d(t,"RGBDTextureTools",function(){return o});var n=r(/*! ../Engines/constants */"./Engines/constants.ts"),i=r(/*! ../PostProcesses/postProcess */"./PostProcesses/postProcess.ts"),o=(r(/*! ../Shaders/rgbdDecode.fragment */"./Shaders/rgbdDecode.fragment.ts"),r(/*! ../Engines/Extensions/engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),function(){function e(){}return e.ExpandRGBDTexture=function(e){var t=e._texture;if(t&&e.isRGBD){var r=t.getEngine(),o=r.getCaps(),s=!1;o.textureHalfFloatRender&&o.textureHalfFloatLinearFiltering?(s=!0,t.type=n.Constants.TEXTURETYPE_HALF_FLOAT):o.textureFloatRender&&o.textureFloatLinearFiltering&&(s=!0,t.type=n.Constants.TEXTURETYPE_FLOAT),s&&(t.isReady=!1,t._isRGBD=!1,t.invertY=!1),e.onLoadObservable.addOnce(function(){if(s){var o=new i.PostProcess("rgbdDecode","rgbdDecode",null,null,1,null,n.Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,r,!1,void 0,t.type,void 0,null,!1),a=r.createRenderTargetTexture(t.width,{generateDepthBuffer:!1,generateMipMaps:!1,generateStencilBuffer:!1,samplingMode:t.samplingMode,type:t.type,format:n.Constants.TEXTUREFORMAT_RGBA});o.getEffect().executeWhenCompiled(function(){o.onApply=function(e){e._bindTexture("textureSampler",t),e.setFloat2("scale",1,1)},e.getScene().postProcessManager.directRender([o],a,!0),r.restoreDefaultFramebuffer(),r._releaseTexture(t),r._releaseFramebufferObjects(a),o&&o.dispose(),a._swapAndDie(t),t.isReady=!0})}})}},e}())},"./Misc/sceneOptimizer.ts": /*!********************************!*\ !*** ./Misc/sceneOptimizer.ts ***! \********************************/ /*! exports provided: SceneOptimization, TextureOptimization, HardwareScalingOptimization, ShadowsOptimization, PostProcessesOptimization, LensFlaresOptimization, CustomOptimization, ParticlesOptimization, RenderTargetsOptimization, MergeMeshesOptimization, SceneOptimizerOptions, SceneOptimizer */function(e,t,r){"use strict";r.r(t),r.d(t,"SceneOptimization",function(){return a}),r.d(t,"TextureOptimization",function(){return 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 m}),r.d(t,"MergeMeshesOptimization",function(){return g}),r.d(t,"SceneOptimizerOptions",function(){return _}),r.d(t,"SceneOptimizer",function(){return v});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),o=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),s=r(/*! ./observable */"./Misc/observable.ts"),a=function(){function e(e){void 0===e&&(e=0),this.priority=e}return e.prototype.getDescription=function(){return""},e.prototype.apply=function(e,t){return!0},e}(),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 Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Reducing render target texture size to "+this.maximumSize},t.prototype.apply=function(e,t){for(var r=!0,n=0;nthis.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 Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Setting hardware scaling level to "+this._currentScale},t.prototype.apply=function(e,t){return-1===this._currentScale&&(this._currentScale=e.getEngine().getHardwareScalingLevel(),this._currentScale>this.maximumScale&&(this._directionOffset=-1)),this._currentScale+=this._directionOffset*this.step,e.getEngine().setHardwareScalingLevel(this._currentScale),1===this._directionOffset?this._currentScale>=this.maximumScale:this._currentScale<=this.maximumScale},t}(a),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning shadows on/off"},t.prototype.apply=function(e,t){return e.shadowsEnabled=t.isInImprovementMode,!0},t}(a),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning 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 Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning lens flares on/off"},t.prototype.apply=function(e,t){return e.lensFlaresEnabled=t.isInImprovementMode,!0},t}(a),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return this.onGetDescription?this.onGetDescription():"Running user defined callback"},t.prototype.apply=function(e,t){return!this.onApply||this.onApply(e,t)},t}(a),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning particles on/off"},t.prototype.apply=function(e,t){return e.particlesEnabled=t.isInImprovementMode,!0},t}(a),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.getDescription=function(){return"Turning render targets off"},t.prototype.apply=function(e,t){return e.renderTargetsEnabled=t.isInImprovementMode,!0},t}(a),g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._canBeMerged=function(e){if(!(e instanceof o.Mesh))return!1;var t=e;return!t.isDisposed()&&(!(!t.isVisible||!t.isEnabled())&&(!(t.instances.length>0)&&(!t.skeleton&&!t.hasLODLevels)))},t}return Object(n.__extends)(t,e),Object.defineProperty(t,"UpdateSelectionTree",{get:function(){return t._UpdateSelectionTree},set:function(e){t._UpdateSelectionTree=e},enumerable:!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=this._targetFrameRate)return this._isRunning=!1,void this.onSuccessObservable.notifyObservers(this);for(var n=!0,i=!0,o=0;o0){h.animationGroups=[];for(var _=0;_0)for(h.reflectionProbes=[],r=0;rl&&(f=(p=l)*d);var m=Math.max(0,u-f)/2,g=Math.max(0,l-p)/2,_=t.getRenderingCanvas();h&&_&&h.drawImage(_,m,g,f,p),c.Tools.EncodeScreenshotCanvasData(i,o)}else a.Logger.Error("Invalid 'size' parameter !")},e.CreateScreenshotAsync=function(t,r,n,i){return void 0===i&&(i="image/png"),new Promise(function(o,s){e.CreateScreenshot(t,r,n,function(e){void 0!==e?o(e):s(new Error("Data is undefined"))},i)})},e.CreateScreenshotUsingRenderTarget=function(t,r,l,u,h,d,f,p,m){void 0===h&&(h="image/png"),void 0===d&&(d=1),void 0===f&&(f=!1),void 0===m&&(m=!1);var g=e._getScreenshotSize(t,r,l),_=g.height,v=g.width,A={width:v,height:_};if(_&&v){var y=r.getScene(),b=null;y.activeCamera!==r&&(b=y.activeCamera,y.activeCamera=r);var T=t.getRenderingCanvas();if(T){var M={width:T.width,height:T.height};t.setSize(v,_),y.render();var x=new i.RenderTargetTexture("screenShot",A,y,!1,!1,s.Constants.TEXTURETYPE_UNSIGNED_INT,!1,n.Texture.NEAREST_SAMPLINGMODE);x.renderList=null,x.samples=d,x.renderSprites=m,x.onAfterRenderObservable.add(function(){c.Tools.DumpFramebuffer(v,_,t,u,h,p)});var P=function(){y.incrementRenderId(),y.resetCachedMaterial(),x.render(!0),x.dispose(),b&&(y.activeCamera=b),t.setSize(M.width,M.height),r.getProjectionMatrix(!0)};if(f){var E=new o.FxaaPostProcess("antialiasing",1,y.activeCamera);x.addPostProcess(E),E.getEffect().isReady()?P():E.getEffect().onCompiled=function(){P()}}else P()}else a.Logger.Error("No rendering canvas found !")}else a.Logger.Error("Invalid 'size' parameter !")},e.CreateScreenshotUsingRenderTargetAsync=function(t,r,n,i,o,s,a,c){return void 0===i&&(i="image/png"),void 0===o&&(o=1),void 0===s&&(s=!1),void 0===c&&(c=!1),new Promise(function(l,u){e.CreateScreenshotUsingRenderTarget(t,r,n,function(e){void 0!==e?l(e):u(new Error("Data is undefined"))},i,o,s,a,c)})},e._getScreenshotSize=function(e,t,r){var n=0,i=0;if("object"==typeof r){var o=r.precision?Math.abs(r.precision):1;r.width&&r.height?(n=r.height*o,i=r.width*o):r.width&&!r.height?(i=r.width*o,n=Math.round(i/e.getAspectRatio(t))):r.height&&!r.width?(n=r.height*o,i=Math.round(n*e.getAspectRatio(t))):(i=Math.round(e.getRenderWidth()*o),n=Math.round(i/e.getAspectRatio(t)))}else isNaN(r)||(n=r,i=r);return i&&(i=Math.floor(i)),n&&(n=Math.floor(n)),{height:0|n,width:0|i}},e}();c.Tools.CreateScreenshot=l.CreateScreenshot,c.Tools.CreateScreenshotAsync=l.CreateScreenshotAsync,c.Tools.CreateScreenshotUsingRenderTarget=l.CreateScreenshotUsingRenderTarget,c.Tools.CreateScreenshotUsingRenderTargetAsync=l.CreateScreenshotUsingRenderTargetAsync},"./Misc/smartArray.ts": /*!****************************!*\ !*** ./Misc/smartArray.ts ***! \****************************/ /*! exports provided: SmartArray, SmartArrayNoDuplicate */function(e,t,r){"use strict";r.r(t),r.d(t,"SmartArray",function(){return i}),r.d(t,"SmartArrayNoDuplicate",function(){return o});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=function(){function e(t){this.length=0,this.data=new Array(t),this._id=e._GlobalId++}return e.prototype.push=function(e){this.data[this.length++]=e,this.length>this.data.length&&(this.data.length*=2)},e.prototype.forEach=function(e){for(var t=0;tthis.data.length&&(this.data.length=2*(this.length+e.length));for(var t=0;t=this.length?-1:t},e.prototype.contains=function(e){return-1!==this.indexOf(e)},e._GlobalId=0,e}(),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._duplicateId=0,t}return Object(n.__extends)(t,e),t.prototype.push=function(t){e.prototype.push.call(this,t),t.__smartArrayFlags||(t.__smartArrayFlags={}),t.__smartArrayFlags[this._id]=this._duplicateId},t.prototype.pushNoDuplicate=function(e){return(!e.__smartArrayFlags||e.__smartArrayFlags[this._id]!==this._duplicateId)&&(this.push(e),!0)},t.prototype.reset=function(){e.prototype.reset.call(this),this._duplicateId++},t.prototype.concatWithNoDuplicate=function(e){if(0!==e.length){this.length+e.length>this.data.length&&(this.data.length=2*(this.length+e.length));for(var t=0;t>2,o=(3&t)<<4|(r=u>4,s=(15&r)<<2|(n=u>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 l},e}()},"./Misc/tags.ts": /*!**********************!*\ !*** ./Misc/tags.ts ***! \**********************/ /*! exports provided: Tags */function(e,t,r){"use strict";r.r(t),r.d(t,"Tags",function(){return i});var n=r(/*! ./andOrNotEvaluator */"./Misc/andOrNotEvaluator.ts"),i=function(){function e(){}return e.EnableFor=function(t){t._tags=t._tags||{},t.hasTags=function(){return e.HasTags(t)},t.addTags=function(r){return e.AddTagsTo(t,r)},t.removeTags=function(r){return e.RemoveTagsFrom(t,r)},t.matchesTagsQuery=function(r){return e.MatchesQuery(t,r)}},e.DisableFor=function(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery},e.HasTags=function(e){if(!e._tags)return!1;var t=e._tags;for(var r in t)if(t.hasOwnProperty(r))return!0;return!1},e.GetTags=function(e,t){if(void 0===t&&(t=!0),!e._tags)return null;if(t){var r=[];for(var n in e._tags)e._tags.hasOwnProperty(n)&&!0===e._tags[n]&&r.push(n);return r.join(" ")}return e._tags},e.AddTagsTo=function(t,r){r&&("string"==typeof r&&r.split(" ").forEach(function(r,n,i){e._AddTagTo(t,r)}))},e._AddTagTo=function(t,r){""!==(r=r.trim())&&"true"!==r&&"false"!==r&&(r.match(/[\s]/)||r.match(/^([!]|([|]|[&]){2})/)||(e.EnableFor(t),t._tags[r]=!0))},e.RemoveTagsFrom=function(t,r){if(e.HasTags(t)){var n=r.split(" ");for(var i in n)e._RemoveTagFrom(t,n[i])}},e._RemoveTagFrom=function(e,t){delete e._tags[t]},e.MatchesQuery=function(t,r){return void 0===r||(""===r?e.HasTags(t):n.AndOrNotEvaluator.Eval(r,function(r){return e.HasTags(t)&&t._tags[r]}))},e}()},"./Misc/textureTools.ts": /*!******************************!*\ !*** ./Misc/textureTools.ts ***! \******************************/ /*! exports provided: TextureTools */function(e,t,r){"use strict";r.r(t),r.d(t,"TextureTools",function(){return a});var n=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),i=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),o=r(/*! ../PostProcesses/passPostProcess */"./PostProcesses/passPostProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=function(){function e(){}return e.CreateResizedCopy=function(e,t,r,a){void 0===a&&(a=!0);var 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,m,g,_=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,M=new Uint8Array(_);i>e._ORIGIN_SHIFT){default:case e._ORIGIN_UL:h=0,f=1,g=o.width,d=0,p=1,m=o.height;break;case e._ORIGIN_BL:h=0,f=1,g=o.width,d=o.height-1,p=-1,m=-1;break;case e._ORIGIN_UR:h=o.width-1,f=-1,g=-1,d=0,p=1,m=o.height;break;case e._ORIGIN_BR:h=o.width-1,f=-1,g=-1,d=o.height-1,p=-1,m=-1}var x=e["_getImageData"+(l?"Grey":"")+o.pixel_size+"bits"](o,u,s,d,p,m,h,f,g);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,m=e.height,g=0,_=new Uint8Array(p*m*4);for(h=n;h!==o;h+=i)for(u=s;u!==c;u+=a,g++)l=d[g],_[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,m=0,g=new Uint8Array(f*p*4);for(h=n;h!==o;h+=i)for(u=s;u!==c;u+=a,m+=2){var _=255*((31744&(l=d[m+0]+(d[m+1]<<8)))>>10)/31|0,v=255*((992&l)>>5)/31|0,A=255*(31&l)/31|0;g[4*(u+f*h)+0]=_,g[4*(u+f*h)+1]=v,g[4*(u+f*h)+2]=A,g[4*(u+f*h)+3]=32768&l?0:255}return g},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,m=new Uint8Array(d*f*4);for(u=n;u!==o;u+=i)for(l=s;l!==c;l+=a,p+=3)m[4*(l+d*u)+3]=255,m[4*(l+d*u)+2]=h[p+0],m[4*(l+d*u)+1]=h[p+1],m[4*(l+d*u)+0]=h[p+2];return m},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,m=new Uint8Array(d*f*4);for(u=n;u!==o;u+=i)for(l=s;l!==c;l+=a,p+=4)m[4*(l+d*u)+2]=h[p+0],m[4*(l+d*u)+1]=h[p+1],m[4*(l+d*u)+0]=h[p+2],m[4*(l+d*u)+3]=h[p+3];return m},e._getImageDataGrey8bits=function(e,t,r,n,i,o,s,a,c){var l,u,h,d=r,f=e.width,p=e.height,m=0,g=new Uint8Array(f*p*4);for(h=n;h!==o;h+=i)for(u=s;u!==c;u+=a,m++)l=d[m],g[4*(u+f*h)+0]=l,g[4*(u+f*h)+1]=l,g[4*(u+f*h)+2]=l,g[4*(u+f*h)+3]=255;return g},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,m=new Uint8Array(d*f*4);for(u=n;u!==o;u+=i)for(l=s;l!==c;l+=a,p+=2)m[4*(l+d*u)+0]=h[p+0],m[4*(l+d*u)+1]=h[p+0],m[4*(l+d*u)+2]=h[p+0],m[4*(l+d*u)+3]=h[p+1];return m},e._TYPE_INDEXED=1,e._TYPE_RGB=2,e._TYPE_GREY=3,e._TYPE_RLE_INDEXED=9,e._TYPE_RLE_RGB=10,e._TYPE_RLE_GREY=11,e._ORIGIN_MASK=48,e._ORIGIN_SHIFT=4,e._ORIGIN_BL=0,e._ORIGIN_BR=1,e._ORIGIN_UL=2,e._ORIGIN_UR=3,e}()},"./Misc/timingTools.ts": /*!*****************************!*\ !*** ./Misc/timingTools.ts ***! \*****************************/ /*! exports provided: TimingTools */function(e,t,r){"use strict";r.r(t),r.d(t,"TimingTools",function(){return i});var n=r(/*! ./domManagement */"./Misc/domManagement.ts"),i=function(){function e(){}return e.SetImmediate=function(e){n.DomManagement.IsWindowObjectExist()&&window.setImmediate?window.setImmediate(e):setTimeout(e,1)},e}()},"./Misc/tools.ts": /*!***********************!*\ !*** ./Misc/tools.ts ***! \***********************/ /*! exports provided: Tools, className, AsyncLoop */function(e,t,r){"use strict";r.r(t),r.d(t,"Tools",function(){return g}),r.d(t,"className",function(){return _}),r.d(t,"AsyncLoop",function(){return v});var n=r(/*! ./observable */"./Misc/observable.ts"),i=r(/*! ./domManagement */"./Misc/domManagement.ts"),o=r(/*! ./logger */"./Misc/logger.ts"),s=r(/*! ./deepCopier */"./Misc/deepCopier.ts"),a=r(/*! ./precisionDate */"./Misc/precisionDate.ts"),c=r(/*! ./devTools */"./Misc/devTools.ts"),l=r(/*! ./webRequest */"./Misc/webRequest.ts"),u=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),h=r(/*! ./fileTools */"./Misc/fileTools.ts"),d=r(/*! ./promise */"./Misc/promise.ts"),f=r(/*! ./timingTools */"./Misc/timingTools.ts"),p=r(/*! ./instantiationTools */"./Misc/instantiationTools.ts"),m=r(/*! ./guid */"./Misc/guid.ts"),g=function(){function e(){}return Object.defineProperty(e,"BaseUrl",{get:function(){return h.FileTools.BaseUrl},set:function(e){h.FileTools.BaseUrl=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"DefaultRetryStrategy",{get:function(){return h.FileTools.DefaultRetryStrategy},set:function(e){h.FileTools.DefaultRetryStrategy=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"UseFallbackTexture",{get:function(){return u.EngineStore.UseFallbackTexture},set:function(e){u.EngineStore.UseFallbackTexture=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"RegisteredExternalClasses",{get:function(){return p.InstantiationTools.RegisteredExternalClasses},set:function(e){p.InstantiationTools.RegisteredExternalClasses=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"fallbackTexture",{get:function(){return u.EngineStore.FallbackTexture},set:function(e){u.EngineStore.FallbackTexture=e},enumerable:!0,configurable:!0}),e.FetchToRef=function(e,t,r,n,i,o){var s=4*((Math.abs(e)*r%r|0)+(Math.abs(t)*n%n|0)*r);o.r=i[s]/255,o.g=i[s+1]/255,o.b=i[s+2]/255,o.a=i[s+3]/255},e.Mix=function(e,t,r){return e*(1-r)+t*r},e.Instantiate=function(e){return p.InstantiationTools.Instantiate(e)},e.Slice=function(e,t,r){return e.slice?e.slice(t,r):Array.prototype.slice.call(e,t,r)},e.SetImmediate=function(e){f.TimingTools.SetImmediate(e)},e.IsExponentOfTwo=function(e){var t=1;do{t*=2}while(t=t)break;if(n(s),o&&o()){e.breakLoop();break}}e.executeNext()},s)},i)},e}();u.EngineStore.FallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z",d.PromisePolyfill.Apply()},"./Misc/typeStore.ts": /*!***************************!*\ !*** ./Misc/typeStore.ts ***! \***************************/ /*! exports provided: _TypeStore */function(e,t,r){"use strict";r.r(t),r.d(t,"_TypeStore",function(){return n});var n=function(){function e(){}return e.GetClass=function(e){return this.RegisteredTypes&&this.RegisteredTypes[e]?this.RegisteredTypes[e]:null},e.RegisteredTypes={},e}()},"./Misc/uniqueIdGenerator.ts": /*!***********************************!*\ !*** ./Misc/uniqueIdGenerator.ts ***! \***********************************/ /*! exports provided: UniqueIdGenerator */function(e,t,r){"use strict";r.r(t),r.d(t,"UniqueIdGenerator",function(){return n});var n=function(){function e(){}return Object.defineProperty(e,"UniqueId",{get:function(){var e=this._UniqueIdCounter;return this._UniqueIdCounter++,e},enumerable:!0,configurable:!0}),e._UniqueIdCounter=0,e}()},"./Misc/videoRecorder.ts": /*!*******************************!*\ !*** ./Misc/videoRecorder.ts ***! \*******************************/ /*! exports provided: VideoRecorder */function(e,t,r){"use strict";r.r(t),r.d(t,"VideoRecorder",function(){return o});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./tools */"./Misc/tools.ts"),o=function(){function e(t,r){if(void 0===r&&(r=null),!e.IsSupported(t))throw"Your browser does not support recording so far.";var i=t.getRenderingCanvas();if(!i)throw"The babylon engine must have a canvas to be recorded";this._canvas=i,this._canvas.isRecording=!1,this._options=Object(n.__assign)(Object(n.__assign)({},e._defaultOptions),r);var o=this._canvas.captureStream(this._options.fps);if(this._options.audioTracks)for(var s=0,a=this._options.audioTracks;s0&&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.vector */"./Maths/math.vector.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.clientXe.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(t){e.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(t)},e.prototype.open=function(t,r){for(var n=0,i=e.CustomRequestModifiers;n=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._syncActiveTargets(!0))},e.prototype.clone=function(){for(var t=new e(this._scene),r=0,n=this._targets;r-1&&(this.agents.splice(t,1),this.transforms.splice(t,1))},e.prototype.getAgents=function(){return this.agents},e.prototype.update=function(e){this.recastCrowd.update(e);for(var t=0;t=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.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(){this.direction1=new i.Vector3(0,1,0),this.direction2=new i.Vector3(0,1,0),this.minEmitBox=new i.Vector3(-.5,-.5,-.5),this.maxEmitBox=new i.Vector3(.5,.5,.5)}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),a=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),c=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);if(n)return t.x=s,t.y=a,void(t.z=c);i.Vector3.TransformNormalFromFloatsToRef(s,a,c,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(this.minEmitBox.x,this.maxEmitBox.x),a=o.Scalar.RandomRange(this.minEmitBox.y,this.maxEmitBox.y),c=o.Scalar.RandomRange(this.minEmitBox.z,this.maxEmitBox.z);if(n)return t.x=s,t.y=a,void(t.z=c);i.Vector3.TransformCoordinatesFromFloatsToRef(s,a,c,e,t)},e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2),e.setVector3("minEmitBox",this.minEmitBox),e.setVector3("maxEmitBox",this.maxEmitBox)},e.prototype.getEffectDefines=function(){return"#define BOXEMITTER"},e.prototype.getClassName=function(){return"BoxParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e.minEmitBox=this.minEmitBox.asArray(),e.maxEmitBox=this.maxEmitBox.asArray(),e},e.prototype.parse=function(e){i.Vector3.FromArrayToRef(e.direction1,0,this.direction1),i.Vector3.FromArrayToRef(e.direction2,0,this.direction2),i.Vector3.FromArrayToRef(e.minEmitBox,0,this.minEmitBox),i.Vector3.FromArrayToRef(e.maxEmitBox,0,this.maxEmitBox)},e}()},"./Particles/EmitterTypes/coneParticleEmitter.ts": /*!*******************************************************!*\ !*** ./Particles/EmitterTypes/coneParticleEmitter.ts ***! \*******************************************************/ /*! exports provided: ConeParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"ConeParticleEmitter",function(){return s});var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(e,t,r){void 0===e&&(e=1),void 0===t&&(t=Math.PI),void 0===r&&(r=0),this.directionRandomizer=r,this.radiusRange=1,this.heightRange=1,this.emitFromSpawnPointOnly=!1,this.angle=t,this.radius=e}return Object.defineProperty(e.prototype,"radius",{get:function(){return this._radius},set:function(e){this._radius=e,this._buildHeight()},enumerable:!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,n){if(1===Math.abs(Math.cos(this._angle))){if(n)return t.x=0,t.y=1,void(t.z=0);i.Vector3.TransformNormalFromFloatsToRef(0,1,0,e,t)}else{var s=r.position.subtract(e.getTranslation()).normalize(),a=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer),l=o.Scalar.RandomRange(0,this.directionRandomizer);if(s.x+=a,s.y+=c,s.z+=l,s.normalize(),n)return void t.copyFrom(s);i.Vector3.TransformNormalFromFloatsToRef(s.x,s.y,s.z,e,t)}},e.prototype.startPositionFunction=function(e,t,r,n){var s,a=o.Scalar.RandomRange(0,2*Math.PI);s=this.emitFromSpawnPointOnly?1e-4:1-(s=o.Scalar.RandomRange(0,this.heightRange))*s;var c=this._radius-o.Scalar.RandomRange(0,this._radius*this.radiusRange),l=(c*=s)*Math.sin(a),u=c*Math.cos(a),h=s*this._height;if(n)return t.x=l,t.y=h,void(t.z=u);i.Vector3.TransformCoordinatesFromFloatsToRef(l,h,u,e,t)},e.prototype.clone=function(){var t=new e(this._radius,this._angle,this.directionRandomizer);return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat2("radius",this._radius,this.radiusRange),e.setFloat("coneAngle",this._angle),e.setFloat2("height",this._height,this.heightRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){var e="#define CONEEMITTER";return this.emitFromSpawnPointOnly&&(e+="\n#define CONEEMITTERSPAWNPOINT"),e},e.prototype.getClassName=function(){return"ConeParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this._radius,e.angle=this._angle,e.directionRandomizer=this.directionRandomizer,e.radiusRange=this.radiusRange,e.heightRange=this.heightRange,e.emitFromSpawnPointOnly=this.emitFromSpawnPointOnly,e},e.prototype.parse=function(e){this.radius=e.radius,this.angle=e.angle,this.directionRandomizer=e.directionRandomizer,this.radiusRange=e.radiusRange,this.heightRange=e.heightRange,this.emitFromSpawnPointOnly=e.emitFromSpawnPointOnly},e}()},"./Particles/EmitterTypes/customParticleEmitter.ts": /*!*********************************************************!*\ !*** ./Particles/EmitterTypes/customParticleEmitter.ts ***! \*********************************************************/ /*! exports provided: CustomParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"CustomParticleEmitter",function(){return o});var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=function(){function e(){this.particlePositionGenerator=function(){},this.particleDestinationGenerator=function(){}}return e.prototype.startDirectionFunction=function(e,t,r,n){var o=i.TmpVectors.Vector3[0];if(this.particleDestinationGenerator){this.particleDestinationGenerator(-1,r,o);var s=i.TmpVectors.Vector3[1];o.subtractToRef(r.position,s),s.scaleToRef(1/r.lifeTime,o)}else o.set(0,0,0);n?t.copyFrom(o):i.Vector3.TransformNormalToRef(o,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var o=i.TmpVectors.Vector3[0];this.particlePositionGenerator?this.particlePositionGenerator(-1,r,o):o.set(0,0,0),n?t.copyFrom(o):i.Vector3.TransformCoordinatesToRef(o,e,t)},e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){},e.prototype.getEffectDefines=function(){return"#define CUSTOMEMITTER"},e.prototype.getClassName=function(){return"CustomParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e},e.prototype.parse=function(e){},e}()},"./Particles/EmitterTypes/cylinderParticleEmitter.ts": /*!***********************************************************!*\ !*** ./Particles/EmitterTypes/cylinderParticleEmitter.ts ***! \***********************************************************/ /*! exports provided: CylinderParticleEmitter, CylinderDirectedParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"CylinderParticleEmitter",function(){return a}),r.d(t,"CylinderDirectedParticleEmitter",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),a=function(){function e(e,t,r,n){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=1),void 0===n&&(n=0),this.radius=e,this.height=t,this.radiusRange=r,this.directionRandomizer=n}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=r.position.subtract(e.getTranslation()).normalize(),a=o.Scalar.RandomRange(-this.directionRandomizer/2,this.directionRandomizer/2),c=Math.atan2(s.x,s.z);c+=o.Scalar.RandomRange(-Math.PI/2,Math.PI/2)*this.directionRandomizer,s.y=a,s.x=Math.sin(c),s.z=Math.cos(c),s.normalize(),n?t.copyFrom(s):i.Vector3.TransformNormalFromFloatsToRef(s.x,s.y,s.z,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(-this.height/2,this.height/2),a=o.Scalar.RandomRange(0,2*Math.PI),c=o.Scalar.RandomRange((1-this.radiusRange)*(1-this.radiusRange),1),l=Math.sqrt(c)*this.radius,u=l*Math.cos(a),h=l*Math.sin(a);n?t.copyFromFloats(u,s,h):i.Vector3.TransformCoordinatesFromFloatsToRef(u,s,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("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 Object(n.__extends)(t,e),t.prototype.startDirectionFunction=function(e,t,r){var n=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),s=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),a=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);i.Vector3.TransformNormalFromFloatsToRef(n,s,a,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.height,this.radiusRange,this.direction1,this.direction2);return s.DeepCopier.DeepCopy(this,e),e},t.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("height",this.height),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},t.prototype.getEffectDefines=function(){return"#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER"},t.prototype.getClassName=function(){return"CylinderDirectedParticleEmitter"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this.direction1.copyFrom(t.direction1),this.direction2.copyFrom(t.direction2)},t}(a)},"./Particles/EmitterTypes/hemisphericParticleEmitter.ts": /*!**************************************************************!*\ !*** ./Particles/EmitterTypes/hemisphericParticleEmitter.ts ***! \**************************************************************/ /*! exports provided: HemisphericParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"HemisphericParticleEmitter",function(){return s});var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(e,t,r){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=r}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=r.position.subtract(e.getTranslation()).normalize(),a=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer),l=o.Scalar.RandomRange(0,this.directionRandomizer);s.x+=a,s.y+=c,s.z+=l,s.normalize(),n?t.copyFrom(s):i.Vector3.TransformNormalFromFloatsToRef(s.x,s.y,s.z,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=this.radius-o.Scalar.RandomRange(0,this.radius*this.radiusRange),a=o.Scalar.RandomRange(0,1),c=o.Scalar.RandomRange(0,2*Math.PI),l=Math.acos(2*a-1),u=s*Math.cos(c)*Math.sin(l),h=s*Math.cos(l),d=s*Math.sin(c)*Math.sin(l);n?t.copyFromFloats(u,Math.abs(h),d):i.Vector3.TransformCoordinatesFromFloatsToRef(u,Math.abs(h),d,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, CustomParticleEmitter, MeshParticleEmitter */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});var l=r(/*! ./customParticleEmitter */"./Particles/EmitterTypes/customParticleEmitter.ts");r.d(t,"CustomParticleEmitter",function(){return l.CustomParticleEmitter});var u=r(/*! ./meshParticleEmitter */"./Particles/EmitterTypes/meshParticleEmitter.ts");r.d(t,"MeshParticleEmitter",function(){return u.MeshParticleEmitter})},"./Particles/EmitterTypes/meshParticleEmitter.ts": /*!*******************************************************!*\ !*** ./Particles/EmitterTypes/meshParticleEmitter.ts ***! \*******************************************************/ /*! exports provided: MeshParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"MeshParticleEmitter",function(){return a});var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),a=function(){function e(e){this.mesh=e,this._indices=null,this._positions=null,this._normals=null,this._storedNormal=i.Vector3.Zero(),this.direction1=new i.Vector3(0,1,0),this.direction2=new i.Vector3(0,1,0),this.useMeshNormalsForDirection=!0,e&&(this._indices=e.getIndices(),this._positions=e.getVerticesData(s.VertexBuffer.PositionKind),this._normals=e.getVerticesData(s.VertexBuffer.NormalKind))}return e.prototype.startDirectionFunction=function(e,t,r,n){if(this.useMeshNormalsForDirection&&this._normals)i.Vector3.TransformNormalToRef(this._storedNormal,e,t);else{var s=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),a=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),c=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);n?t.copyFromFloats(s,a,c):i.Vector3.TransformNormalFromFloatsToRef(s,a,c,e,t)}},e.prototype.startPositionFunction=function(e,t,r,n){if(this._indices&&this._positions){var o=3*Math.random()*(this._indices.length/3)|0,s=Math.random(),a=Math.random()*(1-s),c=1-s-a,l=this._indices[o],u=this._indices[o+1],h=this._indices[o+2],d=i.TmpVectors.Vector3[0],f=i.TmpVectors.Vector3[1],p=i.TmpVectors.Vector3[2],m=i.TmpVectors.Vector3[3];i.Vector3.FromArrayToRef(this._positions,3*l,d),i.Vector3.FromArrayToRef(this._positions,3*u,f),i.Vector3.FromArrayToRef(this._positions,3*h,p),m.x=s*d.x+a*f.x+c*p.x,m.y=s*d.y+a*f.y+c*p.y,m.z=s*d.z+a*f.z+c*p.z,n?t.copyFromFloats(m.x,m.y,m.z):i.Vector3.TransformCoordinatesFromFloatsToRef(m.x,m.y,m.z,e,t),this.useMeshNormalsForDirection&&this._normals&&(i.Vector3.FromArrayToRef(this._normals,3*l,d),i.Vector3.FromArrayToRef(this._normals,3*u,f),i.Vector3.FromArrayToRef(this._normals,3*h,p),this._storedNormal.x=s*d.x+a*f.x+c*p.x,this._storedNormal.y=s*d.y+a*f.y+c*p.y,this._storedNormal.z=s*d.z+a*f.z+c*p.z)}},e.prototype.clone=function(){var t=new e(this.mesh);return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},e.prototype.getEffectDefines=function(){return""},e.prototype.getClassName=function(){return"MeshParticleEmitter"},e.prototype.serialize=function(){var e,t={};return t.type=this.getClassName(),t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t.meshId=null===(e=this.mesh)||void 0===e?void 0:e.id,t.useMeshNormalsForDirection=this.useMeshNormalsForDirection,t},e.prototype.parse=function(e,t){i.Vector3.FromArrayToRef(e.direction1,0,this.direction1),i.Vector3.FromArrayToRef(e.direction2,0,this.direction2),e.meshId&&(this.mesh=t.getLastMeshByID(e.meshId)||void 0),this.useMeshNormalsForDirection=e.useMeshNormalsForDirection},e}()},"./Particles/EmitterTypes/pointParticleEmitter.ts": /*!********************************************************!*\ !*** ./Particles/EmitterTypes/pointParticleEmitter.ts ***! \********************************************************/ /*! exports provided: PointParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"PointParticleEmitter",function(){return s});var n=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(){this.direction1=new i.Vector3(0,1,0),this.direction2=new i.Vector3(0,1,0)}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),a=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),c=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);n?t.copyFromFloats(s,a,c):i.Vector3.TransformNormalFromFloatsToRef(s,a,c,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){n?t.copyFromFloats(0,0,0):i.Vector3.TransformCoordinatesFromFloatsToRef(0,0,0,e,t)},e.prototype.clone=function(){var t=new e;return n.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},e.prototype.getEffectDefines=function(){return"#define POINTEMITTER"},e.prototype.getClassName=function(){return"PointParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.direction1=this.direction1.asArray(),e.direction2=this.direction2.asArray(),e},e.prototype.parse=function(e){i.Vector3.FromArrayToRef(e.direction1,0,this.direction1),i.Vector3.FromArrayToRef(e.direction2,0,this.direction2)},e}()},"./Particles/EmitterTypes/sphereParticleEmitter.ts": /*!*********************************************************!*\ !*** ./Particles/EmitterTypes/sphereParticleEmitter.ts ***! \*********************************************************/ /*! exports provided: SphereParticleEmitter, SphereDirectedParticleEmitter */function(e,t,r){"use strict";r.r(t),r.d(t,"SphereParticleEmitter",function(){return a}),r.d(t,"SphereDirectedParticleEmitter",function(){return c});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Maths/math.scalar */"./Maths/math.scalar.ts"),s=r(/*! ../../Misc/deepCopier */"./Misc/deepCopier.ts"),a=function(){function e(e,t,r){void 0===e&&(e=1),void 0===t&&(t=1),void 0===r&&(r=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=r}return e.prototype.startDirectionFunction=function(e,t,r,n){var s=r.position.subtract(e.getTranslation()).normalize(),a=o.Scalar.RandomRange(0,this.directionRandomizer),c=o.Scalar.RandomRange(0,this.directionRandomizer),l=o.Scalar.RandomRange(0,this.directionRandomizer);s.x+=a,s.y+=c,s.z+=l,s.normalize(),n?t.copyFrom(s):i.Vector3.TransformNormalFromFloatsToRef(s.x,s.y,s.z,e,t)},e.prototype.startPositionFunction=function(e,t,r,n){var s=this.radius-o.Scalar.RandomRange(0,this.radius*this.radiusRange),a=o.Scalar.RandomRange(0,1),c=o.Scalar.RandomRange(0,2*Math.PI),l=Math.acos(2*a-1),u=s*Math.cos(c)*Math.sin(l),h=s*Math.cos(l),d=s*Math.sin(c)*Math.sin(l);n?t.copyFromFloats(u,h,d):i.Vector3.TransformCoordinatesFromFloatsToRef(u,h,d,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return s.DeepCopier.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("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 Object(n.__extends)(t,e),t.prototype.startDirectionFunction=function(e,t,r){var n=o.Scalar.RandomRange(this.direction1.x,this.direction2.x),s=o.Scalar.RandomRange(this.direction1.y,this.direction2.y),a=o.Scalar.RandomRange(this.direction1.z,this.direction2.z);i.Vector3.TransformNormalFromFloatsToRef(n,s,a,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.direction1,this.direction2);return s.DeepCopier.DeepCopy(this,e),e},t.prototype.applyToShader=function(e){e.setFloat("radius",this.radius),e.setFloat("radiusRange",this.radiusRange),e.setVector3("direction1",this.direction1),e.setVector3("direction2",this.direction2)},t.prototype.getEffectDefines=function(){return"#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER"},t.prototype.getClassName=function(){return"SphereDirectedParticleEmitter"},t.prototype.serialize=function(){var t=e.prototype.serialize.call(this);return t.direction1=this.direction1.asArray(),t.direction2=this.direction2.asArray(),t},t.prototype.parse=function(t){e.prototype.parse.call(this,t),this.direction1.copyFrom(t.direction1),this.direction2.copyFrom(t.direction2)},t}(a)},"./Particles/baseParticleSystem.ts": /*!*****************************************!*\ !*** ./Particles/baseParticleSystem.ts ***! \*****************************************/ /*! exports provided: BaseParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"BaseParticleSystem",function(){return c});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Materials/imageProcessingConfiguration */"./Materials/imageProcessingConfiguration.ts"),o=r(/*! ../Particles/EmitterTypes/index */"./Particles/EmitterTypes/index.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),c=function(){function e(t){this.animations=[],this.renderingGroupId=0,this.emitter=n.Vector3.Zero(),this.emitRate=10,this.manualEmitCount=-1,this.updateSpeed=.01,this.targetStopDuration=0,this.disposeOnStop=!1,this.minEmitPower=1,this.maxEmitPower=1,this.minLifeTime=1,this.maxLifeTime=1,this.minSize=1,this.maxSize=1,this.minScaleX=1,this.maxScaleX=1,this.minScaleY=1,this.maxScaleY=1,this.minInitialRotation=0,this.maxInitialRotation=0,this.minAngularSpeed=0,this.maxAngularSpeed=0,this.layerMask=268435455,this.customShader=null,this.preventAutoStart=!1,this.noiseStrength=new n.Vector3(10,10,10),this.onAnimationEnd=null,this.blendMode=e.BLENDMODE_ONEONE,this.forceDepthWrite=!1,this.preWarmCycles=0,this.preWarmStepOffset=1,this.spriteCellChangeSpeed=1,this.startSpriteCellID=0,this.endSpriteCellID=0,this.spriteCellWidth=0,this.spriteCellHeight=0,this.spriteRandomStartCell=!1,this.translationPivot=new n.Vector2(0,0),this.beginAnimationOnStart=!1,this.beginAnimationFrom=0,this.beginAnimationTo=60,this.beginAnimationLoop=!1,this.worldOffset=new n.Vector3(0,0,0),this.gravity=n.Vector3.Zero(),this._colorGradients=null,this._sizeGradients=null,this._lifeTimeGradients=null,this._angularSpeedGradients=null,this._velocityGradients=null,this._limitVelocityGradients=null,this._dragGradients=null,this._emitRateGradients=null,this._startSizeGradients=null,this._rampGradients=null,this._colorRemapGradients=null,this._alphaRemapGradients=null,this.startDelay=0,this.limitVelocityDamping=.4,this.color1=new a.Color4(1,1,1,1),this.color2=new a.Color4(1,1,1,1),this.colorDead=new a.Color4(0,0,0,1),this.textureMask=new a.Color4(1,1,1,1),this._isSubEmitter=!1,this.billboardMode=s.Constants.PARTICLES_BILLBOARDMODE_ALL,this._isBillboardBased=!0,this._imageProcessingConfigurationDefines=new i.ImageProcessingConfigurationDefines,this.id=t,this.name=t}return Object.defineProperty(e.prototype,"noiseTexture",{get:function(){return this._noiseTexture},set:function(e){this._noiseTexture!==e&&(this._noiseTexture=e,this._reset())},enumerable:!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;i1},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}),Object.defineProperty(t.prototype,"isLocal",{get:function(){return!1},set:function(e){},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.gradientt.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.gradientt.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);var r=3;this.particleEmitterType instanceof T.CustomParticleEmitter&&(t.initialPosition=e.createVertexBuffer("initialPosition",r,3),r+=3),t.age=e.createVertexBuffer("age",r,1),r+=1,t.life=e.createVertexBuffer("life",r,1),r+=1,t.seed=e.createVertexBuffer("seed",r,4),r+=4,t.size=e.createVertexBuffer("size",r,3),r+=3,this._colorGradientsTexture||(t.color=e.createVertexBuffer("color",r,4),r+=4),t.direction=e.createVertexBuffer("direction",r,3),r+=3,this._isBillboardBased||(t.initialDirection=e.createVertexBuffer("initialDirection",r,3),r+=3),this._angularSpeedGradientsTexture?(t.angle=e.createVertexBuffer("angle",r,1),r+=1):(t.angle=e.createVertexBuffer("angle",r,2),r+=2),this._isAnimationSheetEnabled&&(t.cellIndex=e.createVertexBuffer("cellIndex",r,1),r+=1,this.spriteRandomStartCell&&(t.cellStartOffset=e.createVertexBuffer("cellStartOffset",r,1),r+=1)),this.noiseTexture&&(t.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",r,3),r+=3,t.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",r,3),r+=3);var n=this._engine.recordVertexArrayObject(t,null,this._updateEffect);return this._engine.bindArrayBuffer(null),n},t.prototype._createRenderVAO=function(e,t){var r={};r.position=e.createVertexBuffer("position",0,3,this._attributesStrideSize,!0);var n=3;this.particleEmitterType instanceof T.CustomParticleEmitter&&(n+=3),r.age=e.createVertexBuffer("age",n,1,this._attributesStrideSize,!0),n+=1,r.life=e.createVertexBuffer("life",n,1,this._attributesStrideSize,!0),n+=5,r.size=e.createVertexBuffer("size",n,3,this._attributesStrideSize,!0),n+=3,this._colorGradientsTexture||(r.color=e.createVertexBuffer("color",n,4,this._attributesStrideSize,!0),n+=4),this.billboardMode===h.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.particleEmitterType instanceof T.CustomParticleEmitter&&(this._attributesStrideSize+=3),this.isBillboardBased||(this._attributesStrideSize+=3),this._colorGradientsTexture&&(this._attributesStrideSize-=4),this._angularSpeedGradientsTexture&&(this._attributesStrideSize-=1),this._isAnimationSheetEnabled&&(this._attributesStrideSize+=1,this.spriteRandomStartCell&&(this._attributesStrideSize+=1)),this.noiseTexture&&(this._attributesStrideSize+=6);for(var n=this.particleEmitterType instanceof T.CustomParticleEmitter,i=s.TmpVectors.Vector3[0],o=0;o=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;o1){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(p.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||this._scene.clipPlane5||this._scene.clipPlane6){var l=o.clone();l.invert(),this._renderEffect.setMatrix("invView",l),m.MaterialHelper.BindClipPlane(this._renderEffect,this._scene)}switch(this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._renderEffect),this.blendMode){case h.ParticleSystem.BLENDMODE_ADD:this._engine.setAlphaMode(A.Constants.ALPHA_ADD);break;case h.ParticleSystem.BLENDMODE_ONEONE:this._engine.setAlphaMode(A.Constants.ALPHA_ONEONE);break;case h.ParticleSystem.BLENDMODE_STANDARD:this._engine.setAlphaMode(A.Constants.ALPHA_COMBINE);break;case h.ParticleSystem.BLENDMODE_MULTIPLY:this._engine.setAlphaMode(A.Constants.ALPHA_MULTIPLY)}this.forceDepthWrite&&this._engine.setDepthWrite(!0),this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex],null),this._engine.drawArraysType(p.Material.TriangleFanDrawMode,0,4,this._currentActiveCount),this._engine.setAlphaMode(A.Constants.ALPHA_DISABLE)}this._targetIndex++,2===this._targetIndex&&(this._targetIndex=0);var u=this._sourceBuffer;return this._sourceBuffer=this._targetBuffer,this._targetBuffer=u,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-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 b.DeepCopier.DeepCopy(this,n,["particles","customShader","noiseTexture","particleTexture","onDisposeObservable"]),void 0===r&&(r=this.emitter),n.emitter=r,this.particleTexture&&(n.particleTexture=new _.Texture(this.particleTexture.url,this._scene)),n.noiseTexture=this.noiseTexture,this._colorGradients&&this._colorGradients.forEach(function(e){n.addColorGradient(e.gradient,e.color1,e.color2)}),this._dragGradients&&this._dragGradients.forEach(function(e){n.addDragGradient(e.gradient,e.factor1)}),this._angularSpeedGradients&&this._angularSpeedGradients.forEach(function(e){n.addAngularSpeedGradient(e.gradient,e.factor1)}),this._emitRateGradients&&this._emitRateGradients.forEach(function(e){n.addEmitRateGradient(e.gradient,e.factor1,e.factor2)}),this._lifeTimeGradients&&this._lifeTimeGradients.forEach(function(e){n.addLifeTimeGradient(e.gradient,e.factor1,e.factor2)}),this._limitVelocityGradients&&this._limitVelocityGradients.forEach(function(e){n.addLimitVelocityGradient(e.gradient,e.factor1)}),this._sizeGradients&&this._sizeGradients.forEach(function(e){n.addSizeGradient(e.gradient,e.factor1)}),this._startSizeGradients&&this._startSizeGradients.forEach(function(e){n.addStartSizeGradient(e.gradient,e.factor1,e.factor2)}),this._velocityGradients&&this._velocityGradients.forEach(function(e){n.addVelocityGradient(e.gradient,e.factor1)}),this._rampGradients&&this._rampGradients.forEach(function(e){n.addRampGradient(e.gradient,e.color)}),this._colorRemapGradients&&this._colorRemapGradients.forEach(function(e){n.addColorRemapGradient(e.gradient,e.factor1,e.factor2)}),this._alphaRemapGradients&&this._alphaRemapGradients.forEach(function(e){n.addAlphaRemapGradient(e.gradient,e.factor1,e.factor2)}),n},t.prototype.serialize=function(){var e={};return h.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),h.ParticleSystem._Parse(e,o,r,n),e.preventAutoStart&&(o.preventAutoStart=e.preventAutoStart),i||o.preventAutoStart||o.start(),o},t}(u.BaseParticleSystem))},"./Particles/index.ts": /*!****************************!*\ !*** ./Particles/index.ts ***! \****************************/ /*! exports provided: BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, CloudPoint, PointsGroup, PointColor, PointsCloudSystem, SubEmitterType, SubEmitter, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CustomParticleEmitter, MeshParticleEmitter */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}),r.d(t,"CustomParticleEmitter",function(){return i.CustomParticleEmitter}),r.d(t,"MeshParticleEmitter",function(){return i.MeshParticleEmitter});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(/*! ./cloudPoint */"./Particles/cloudPoint.ts");r.d(t,"CloudPoint",function(){return f.CloudPoint}),r.d(t,"PointsGroup",function(){return f.PointsGroup});var p=r(/*! ./pointsCloudSystem */"./Particles/pointsCloudSystem.ts");r.d(t,"PointColor",function(){return p.PointColor}),r.d(t,"PointsCloudSystem",function(){return p.PointsCloudSystem});var m=r(/*! ./subEmitter */"./Particles/subEmitter.ts");r.d(t,"SubEmitterType",function(){return m.SubEmitterType}),r.d(t,"SubEmitter",function(){return m.SubEmitter})},"./Particles/particle.ts": /*!*******************************!*\ !*** ./Particles/particle.ts ***! \*******************************/ /*! exports provided: Particle */function(e,t,r){"use strict";r.r(t),r.d(t,"Particle",function(){return s});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Maths/math.scalar */"./Maths/math.scalar.ts"),s=function(){function e(t){this.particleSystem=t,this.position=n.Vector3.Zero(),this.direction=n.Vector3.Zero(),this.color=new i.Color4(0,0,0,0),this.colorStep=new i.Color4(0,0,0,0),this.lifeTime=1,this.age=0,this.size=0,this.scale=new n.Vector2(1,1),this.angle=0,this.angularSpeed=0,this.cellIndex=0,this._attachedSubEmitters=null,this._currentColor1=new i.Color4(0,0,0,0),this._currentColor2=new i.Color4(0,0,0,0),this._currentSize1=0,this._currentSize2=0,this._currentAngularSpeed1=0,this._currentAngularSpeed2=0,this._currentVelocity1=0,this._currentVelocity2=0,this._currentLimitVelocity1=0,this._currentLimitVelocity2=0,this._currentDrag1=0,this._currentDrag2=0,this.id=e._Count++,this.particleSystem.isAnimationSheetEnabled&&this.updateCellInfoFromSystem()}return e.prototype.updateCellInfoFromSystem=function(){this.cellIndex=this.particleSystem.startSpriteCellID},e.prototype.updateCellIndex=function(){var e=this.age,t=this.particleSystem.spriteCellChangeSpeed;this.particleSystem.spriteRandomStartCell&&(void 0===this._randomCellOffset&&(this._randomCellOffset=Math.random()*this.lifeTime),0===t?(t=1,e=this._randomCellOffset):e+=this._randomCellOffset);var r=this._initialEndSpriteCellID-this._initialStartSpriteCellID,n=o.Scalar.Clamp(e*t%this.lifeTime/this.lifeTime);this.cellIndex=this._initialStartSpriteCellID+n*r|0},e.prototype._inheritParticleInfoToSubEmitter=function(e){if(e.particleSystem.emitter.position){var t=e.particleSystem.emitter;t.position.copyFrom(this.position),e.inheritDirection&&t.setDirection(this.direction.normalize(),0,Math.PI/2)}else{e.particleSystem.emitter.copyFrom(this.position)}this.direction.scaleToRef(e.inheritedVelocityAmount/2,n.TmpVectors.Vector3[0]),e.particleSystem._inheritedVelocityOffset.copyFrom(n.TmpVectors.Vector3[0])},e.prototype._inheritParticleInfoToSubEmitters=function(){var e=this;this._attachedSubEmitters&&this._attachedSubEmitters.length>0&&this._attachedSubEmitters.forEach(function(t){e._inheritParticleInfoToSubEmitter(t)})},e.prototype._reset=function(){this.age=0,this.id=e._Count++,this._currentColorGradient=null,this._currentSizeGradient=null,this._currentAngularSpeedGradient=null,this._currentVelocityGradient=null,this._currentLimitVelocityGradient=null,this._currentDragGradient=null,this.cellIndex=this.particleSystem.startSpriteCellID,this._randomCellOffset=void 0},e.prototype.copyTo=function(e){e.position.copyFrom(this.position),this._initialDirection?e._initialDirection?e._initialDirection.copyFrom(this._initialDirection):e._initialDirection=this._initialDirection.clone():e._initialDirection=null,e.direction.copyFrom(this.direction),this._localPosition&&(e._localPosition?e._localPosition.copyFrom(this._localPosition):e._localPosition=this._localPosition.clone()),e.color.copyFrom(this.color),e.colorStep.copyFrom(this.colorStep),e.lifeTime=this.lifeTime,e.age=this.age,e._randomCellOffset=this._randomCellOffset,e.size=this.size,e.scale.copyFrom(this.scale),e.angle=this.angle,e.angularSpeed=this.angularSpeed,e.particleSystem=this.particleSystem,e.cellIndex=this.cellIndex,e.id=this.id,e._attachedSubEmitters=this._attachedSubEmitters,this._currentColorGradient&&(e._currentColorGradient=this._currentColorGradient,e._currentColor1.copyFrom(this._currentColor1),e._currentColor2.copyFrom(this._currentColor2)),this._currentSizeGradient&&(e._currentSizeGradient=this._currentSizeGradient,e._currentSize1=this._currentSize1,e._currentSize2=this._currentSize2),this._currentAngularSpeedGradient&&(e._currentAngularSpeedGradient=this._currentAngularSpeedGradient,e._currentAngularSpeed1=this._currentAngularSpeed1,e._currentAngularSpeed2=this._currentAngularSpeed2),this._currentVelocityGradient&&(e._currentVelocityGradient=this._currentVelocityGradient,e._currentVelocity1=this._currentVelocity1,e._currentVelocity2=this._currentVelocity2),this._currentLimitVelocityGradient&&(e._currentLimitVelocityGradient=this._currentLimitVelocityGradient,e._currentLimitVelocity1=this._currentLimitVelocity1,e._currentLimitVelocity2=this._currentLimitVelocity2),this._currentDragGradient&&(e._currentDragGradient=this._currentDragGradient,e._currentDrag1=this._currentDrag1,e._currentDrag2=this._currentDrag2),this.particleSystem.isAnimationSheetEnabled&&(e._initialStartSpriteCellID=this._initialStartSpriteCellID,e._initialEndSpriteCellID=this._initialEndSpriteCellID),this.particleSystem.useRampGradients&&e.remapData.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 u});var n=r(/*! ../Misc/tools */"./Misc/tools.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),s=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),a=r(/*! ./gpuParticleSystem */"./Particles/gpuParticleSystem.ts"),c=r(/*! ./particleSystemSet */"./Particles/particleSystemSet.ts"),l=r(/*! ./particleSystem */"./Particles/particleSystem.ts"),u=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;r0){var t=h._subEmitters[Math.floor(Math.random()*h._subEmitters.length)];e._attachedSubEmitters=[],t.forEach(function(t){if(t.type===b.SubEmitterType.ATTACHED){var r=t.clone();e._attachedSubEmitters.push(r),r.particleSystem.start()}})}return e},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===b.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||_.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 v.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.GradientHelper.GetCurrentGradient(d,h._colorGradients,function(e,t,r){e!==n._currentColorGradient&&(n._currentColor1.copyFrom(n._currentColor2),t.getColorToRef(n._currentColor2),n._currentColorGradient=e),E.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.GradientHelper.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.GradientHelper.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.GradientHelper.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.GradientHelper.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)}),h.isLocal?(n._localPosition.addInPlace(h._scaledDirection),s.Vector3.TransformCoordinatesToRef(n._localPosition,h._emitterWorldMatrix,n.position)):n.position.addInPlace(h._scaledDirection),r&&t&&n._randomNoiseCoordinates1){var p=h._fetchR(n._randomNoiseCoordinates1.x,n._randomNoiseCoordinates1.y,t.width,t.height,r),m=h._fetchR(n._randomNoiseCoordinates1.z,n._randomNoiseCoordinates2.x,t.width,t.height,r),g=h._fetchR(n._randomNoiseCoordinates2.y,n._randomNoiseCoordinates2.z,t.width,t.height,r),_=s.TmpVectors.Vector3[0],v=s.TmpVectors.Vector3[1];_.copyFromFloats((2*p-1)*h.noiseStrength.x,(2*m-1)*h.noiseStrength.y,(2*g-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.GradientHelper.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.GradientHelper.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.GradientHelper.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;ct.gradient?1:0})},t.prototype._removeFactorGradient=function(e,t){if(e)for(var r=0,n=0,i=e;nt.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.gradientt.gradient?1:0}),this},t.prototype.removeColorGradient=function(e){if(!this._colorGradients)return this;for(var t=0,r=0,n=this._colorGradients;r0&&(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;e0&&this.getScene().beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop)}},t.prototype.stop=function(e){void 0===e&&(e=!0),this._stopped=!0,e&&this._stopSubEmitters()},t.prototype.reset=function(){this._stockParticles=[],this._particles=[]},t.prototype._appendParticleVertex=function(e,r,n,i){var o=e*this._vertexBufferSize;if(this._vertexData[o++]=r.position.x+this.worldOffset.x,this._vertexData[o++]=r.position.y+this.worldOffset.y,this._vertexData[o++]=r.position.z+this.worldOffset.z,this._vertexData[o++]=r.color.r,this._vertexData[o++]=r.color.g,this._vertexData[o++]=r.color.b,this._vertexData[o++]=r.color.a,this._vertexData[o++]=r.angle,this._vertexData[o++]=r.scale.x*r.size,this._vertexData[o++]=r.scale.y*r.size,this._isAnimationSheetEnabled&&(this._vertexData[o++]=r.cellIndex),this._isBillboardBased)this.billboardMode===t.BILLBOARDMODE_STRETCHED&&(this._vertexData[o++]=r.direction.x,this._vertexData[o++]=r.direction.y,this._vertexData[o++]=r.direction.z);else if(r._initialDirection){var a=r._initialDirection;this.isLocal&&(s.Vector3.TransformNormalToRef(a,this._emitterWorldMatrix,s.TmpVectors.Vector3[0]),a=s.TmpVectors.Vector3[0]),0===a.x&&0===a.z&&(a.x=.001),this._vertexData[o++]=a.x,this._vertexData[o++]=a.y,this._vertexData[o++]=a.z}else{var c=r.direction;this.isLocal&&(s.Vector3.TransformNormalToRef(c,this._emitterWorldMatrix,s.TmpVectors.Vector3[0]),c=s.TmpVectors.Vector3[0]),0===c.x&&0===c.z&&(c.x=.001),this._vertexData[o++]=c.x,this._vertexData[o++]=c.y,this._vertexData[o++]=c.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";if(t=u._createParticle(),u._particles.push(t),u.targetStopDuration&&u._lifeTimeGradients&&u._lifeTimeGradients.length>0){var e=a.Scalar.Clamp(u._actualFrame/u.targetStopDuration);i.GradientHelper.GetCurrentGradient(e,u._lifeTimeGradients,function(r,n){var i=r,o=n,s=i.getFactor(),c=o.getFactor(),l=(e-i.gradient)/(o.gradient-i.gradient);t.lifeTime=a.Scalar.Lerp(s,c,l)})}else t.lifeTime=a.Scalar.RandomRange(u.minLifeTime,u.maxLifeTime);var n=a.Scalar.RandomRange(u.minEmitPower,u.maxEmitPower);if(u.startPositionFunction?u.startPositionFunction(u._emitterWorldMatrix,t.position,t,u.isLocal):u.particleEmitterType.startPositionFunction(u._emitterWorldMatrix,t.position,t,u.isLocal),u.isLocal&&(t._localPosition?t._localPosition.copyFrom(t.position):t._localPosition=t.position.clone(),s.Vector3.TransformCoordinatesToRef(t._localPosition,u._emitterWorldMatrix,t.position)),u.startDirectionFunction?u.startDirectionFunction(u._emitterWorldMatrix,t.direction,t,u.isLocal):u.particleEmitterType.startDirectionFunction(u._emitterWorldMatrix,t.direction,t,u.isLocal),0===n?t._initialDirection?t._initialDirection.copyFrom(t.direction):t._initialDirection=t.direction.clone():t._initialDirection=null,t.direction.scaleInPlace(n),u._sizeGradients&&0!==u._sizeGradients.length?(t._currentSizeGradient=u._sizeGradients[0],t._currentSize1=t._currentSizeGradient.getFactor(),t.size=t._currentSize1,u._sizeGradients.length>1?t._currentSize2=u._sizeGradients[1].getFactor():t._currentSize2=t._currentSize1):t.size=a.Scalar.RandomRange(u.minSize,u.maxSize),t.scale.copyFromFloats(a.Scalar.RandomRange(u.minScaleX,u.maxScaleX),a.Scalar.RandomRange(u.minScaleY,u.maxScaleY)),u._startSizeGradients&&u._startSizeGradients[0]&&u.targetStopDuration){var o=u._actualFrame/u.targetStopDuration;i.GradientHelper.GetCurrentGradient(o,u._startSizeGradients,function(e,n,i){e!==r._currentStartSizeGradient&&(r._currentStartSize1=r._currentStartSize2,r._currentStartSize2=n.getFactor(),r._currentStartSizeGradient=e);var o=a.Scalar.Lerp(r._currentStartSize1,r._currentStartSize2,i);t.scale.scaleInPlace(o)})}u._angularSpeedGradients&&0!==u._angularSpeedGradients.length?(t._currentAngularSpeedGradient=u._angularSpeedGradients[0],t.angularSpeed=t._currentAngularSpeedGradient.getFactor(),t._currentAngularSpeed1=t.angularSpeed,u._angularSpeedGradients.length>1?t._currentAngularSpeed2=u._angularSpeedGradients[1].getFactor():t._currentAngularSpeed2=t._currentAngularSpeed1):t.angularSpeed=a.Scalar.RandomRange(u.minAngularSpeed,u.maxAngularSpeed),t.angle=a.Scalar.RandomRange(u.minInitialRotation,u.maxInitialRotation),u._velocityGradients&&u._velocityGradients.length>0&&(t._currentVelocityGradient=u._velocityGradients[0],t._currentVelocity1=t._currentVelocityGradient.getFactor(),u._velocityGradients.length>1?t._currentVelocity2=u._velocityGradients[1].getFactor():t._currentVelocity2=t._currentVelocity1),u._limitVelocityGradients&&u._limitVelocityGradients.length>0&&(t._currentLimitVelocityGradient=u._limitVelocityGradients[0],t._currentLimitVelocity1=t._currentLimitVelocityGradient.getFactor(),u._limitVelocityGradients.length>1?t._currentLimitVelocity2=u._limitVelocityGradients[1].getFactor():t._currentLimitVelocity2=t._currentLimitVelocity1),u._dragGradients&&u._dragGradients.length>0&&(t._currentDragGradient=u._dragGradients[0],t._currentDrag1=t._currentDragGradient.getFactor(),u._dragGradients.length>1?t._currentDrag2=u._dragGradients[1].getFactor():t._currentDrag2=t._currentDrag1),u._colorGradients&&0!==u._colorGradients.length?(t._currentColorGradient=u._colorGradients[0],t._currentColorGradient.getColorToRef(t.color),t._currentColor1.copyFrom(t.color),u._colorGradients.length>1?u._colorGradients[1].getColorToRef(t._currentColor2):t._currentColor2.copyFrom(t.color)):(c=a.Scalar.RandomRange(0,1),E.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-1)r=this.manualEmitCount,this._newPartsExcess=0,this.manualEmitCount=0;else{var n=this.emitRate;if(this._emitRateGradients&&this._emitRateGradients.length>0&&this.targetStopDuration){var o=this._actualFrame/this.targetStopDuration;i.GradientHelper.GetCurrentGradient(o,this._emitRateGradients,function(e,r,i){e!==t._currentEmitRateGradient&&(t._currentEmitRate1=t._currentEmitRate2,t._currentEmitRate2=r.getFactor(),t._currentEmitRateGradient=e),n=a.Scalar.Lerp(t._currentEmitRate1,t._currentEmitRate2,i)})}r=n*this._scaledUpdateSpeed>>0,this._newPartsExcess+=n*this._scaledUpdateSpeed-r}if(this._newPartsExcess>1&&(r+=this._newPartsExcess>>0,this._newPartsExcess-=this._newPartsExcess>>0),this._alive=!1,this._stopped?r=0:(this._actualFrame+=this._scaledUpdateSpeed,this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()),this._update(r),this._stopped&&(this._alive||(this._started=!1,this.onAnimationEnd&&this.onAnimationEnd(),this.disposeOnStop&&this._scene._toBeDisposed.push(this))),!e){for(var s=0,c=0;c-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);(s.customShader=i,x.DeepCopier.DeepCopy(this,s,["particles","customShader","noiseTexture","particleTexture","onDisposeObservable"]),void 0===r&&(r=this.emitter),s.noiseTexture=this.noiseTexture,s.emitter=r,this.particleTexture)&&(this.particleTexture instanceof p.DynamicTexture?(s.particleTexture=this.particleTexture.clone(),s.particleTexture.getContext().drawImage(this.particleTexture.getContext().canvas,0,0),s.particleTexture.update()):s.particleTexture=new f.Texture(this.particleTexture.url,this._scene));return 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;r0?a.shaderOptions.defines.join("\n"):"";s=r.getEngine().createEffectForParticles(a.shaderPath.fragmentElement,a.shaderOptions.uniforms,a.shaderOptions.samplers,c)}var l=new t(o,e.capacity,r,s,e.isAnimationSheetEnabled);if(l.customShader=a,e.id&&(l.id=e.id),e.subEmitters){l.subEmitters=[];for(var u=0,h=e.subEmitters;u0&&e.set(this._uvs32,a.VertexBuffer.UVKind);var t=0;this._colors32.length>0&&(t=1,e.set(this._colors32,a.VertexBuffer.ColorKind));var r=new l.Mesh(this.name,this._scene);e.applyToMesh(r,this._updatable),this.mesh=r,this._positions=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0);var n=new p.StandardMaterial("point cloud material",this._scene);return n.emissiveColor=new i.Color3(t,t,t),n.disableLighting=!0,n.pointsCloud=!0,n.pointSize=this._size,r.material=n,new Promise(function(e){return e(r)})},e.prototype._addParticle=function(e,t,r,n){var i=new h.CloudPoint(e,t,r,n,this);return this.particles.push(i),i},e.prototype._randomUnitVector=function(e){e.position=new o.Vector3(Math.random(),Math.random(),Math.random()),e.color=new i.Color4(1,1,1,1)},e.prototype._getColorIndicesForCoord=function(e,t,r,n){var o=e._groupImageData,s=r*(4*n)+4*t,a=[s,s+1,s+2,s+3],c=a[1],l=a[2],u=a[3],h=o[a[0]],d=o[c],f=o[l],p=o[u];return new i.Color4(h/255,d/255,f/255,p)},e.prototype._setPointsColorOrUV=function(e,t,r,n,s,c,l){r&&e.updateFacetData();var u=2*e.getBoundingInfo().boundingSphere.radius,h=e.getVerticesData(a.VertexBuffer.PositionKind),d=e.getIndices(),p=e.getVerticesData(a.VertexBuffer.UVKind),m=e.getVerticesData(a.VertexBuffer.ColorKind),_=o.Vector3.Zero();e.computeWorldMatrix();var v=e.getWorldMatrix();if(!v.isIdentity())for(var A=0;A1&&(Be=1),(we=Le.b+Ie)<0&&(we=0),we>1&&(we=1),i.Color3.HSVtoRGBToRef(De,Be,we,ke),ve.set(ke.r,ke.g,ke.b,1)):ve=ue.set(Math.random(),Math.random(),Math.random(),1),Fe.color=new i.Color4(ve.x,ve.y,ve.z,ve.w),this._colors.push(ve.x,ve.y,ve.z,ve.w))}},e.prototype._colorFromTexture=function(e,t,r){var n=this;if(null===e.material)return s.Logger.Warn(e.name+"has no material."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,r,!0,!1);var i=e.material.getActiveTextures();if(0===i.length)return s.Logger.Warn(e.name+"has no useable texture."),t._groupImageData=null,void this._setPointsColorOrUV(e,t,r,!0,!1);var o=e.clone();o.setEnabled(!1),this._promises.push(new Promise(function(e){m.BaseTexture.WhenAllReady(i,function(){var s=t._textureNb;return s<0&&(s=0),s>i.length-1&&(s=i.length-1),t._groupImageData=i[s].readPixels(),t._groupImgWidth=i[s].getSize().width,t._groupImgHeight=i[s].getSize().height,n._setPointsColorOrUV(o,t,r,!0,!0),o.dispose(),e()})}))},e.prototype._calculateDensity=function(e,t,r){for(var n,i,s,a,c,l,u,h,d,f,p,m,g,_,v,A,y,b=new Array,T=o.Vector3.Zero(),M=o.Vector3.Zero(),x=o.Vector3.Zero(),P=o.Vector3.Zero(),E=o.Vector3.Zero(),C=o.Vector3.Zero(),S=new Array,R=0,O=r.length/3,I=0;I0&&(b=b.map(function(e){return e+w}));for(I=0;I3)&&(c=n.Random);var l=e.getVerticesData(a.VertexBuffer.PositionKind),u=e.getIndices();this._groups.push(this._groupCounter);var d=new h.PointsGroup(this._groupCounter,null);switch(d._groupDensity=this._calculateDensity(t,l,u),c===n.Color?d._textureNb=o||0:o=o||new i.Color4(1,1,1,1),c){case n.Color:this._colorFromTexture(e,d,!1);break;case n.UV:this._setPointsColorOrUV(e,d,!1,!1,!1);break;case n.Random:this._setPointsColorOrUV(e,d,!1);break;case n.Stated:this._setPointsColorOrUV(e,d,!1,void 0,void 0,o,s)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1},e.prototype.addVolumePoints=function(e,t,r,o,s){var c=r||n.Random;(isNaN(c)||c<0||c>3)&&(c=n.Random);var l=e.getVerticesData(a.VertexBuffer.PositionKind),u=e.getIndices();this._groups.push(this._groupCounter);var d=new h.PointsGroup(this._groupCounter,null);switch(d._groupDensity=this._calculateDensity(t,l,u),c===n.Color?d._textureNb=o||0:o=o||new i.Color4(1,1,1,1),c){case n.Color:this._colorFromTexture(e,d,!0);break;case n.UV:this._setPointsColorOrUV(e,d,!0,!1,!1);break;case n.Random:this._setPointsColorOrUV(e,d,!0);break;case n.Stated:this._setPointsColorOrUV(e,d,!0,void 0,void 0,o,s)}return this.nbParticles+=t,this._groupCounter++,this._groupCounter-1},e.prototype.setParticles=function(e,t,r){if(void 0===e&&(e=0),void 0===t&&(t=this.nbParticles-1),void 0===r&&(r=!0),!this._updatable||!this._isReady)return this;this.beforeUpdateParticles(e,t,r);var n=o.TmpVectors.Matrix[0],i=this.mesh,s=this._colors32,c=this._positions32,l=this._uvs32,u=o.TmpVectors.Vector3,h=u[5].copyFromFloats(1,0,0),f=u[6].copyFromFloats(0,1,0),p=u[7].copyFromFloats(0,0,1),m=u[8].setAll(Number.MAX_VALUE),g=u[9].setAll(-Number.MAX_VALUE);o.Matrix.IdentityToRef(n);var _=0;if(this.mesh.isFacetDataEnabled&&(this._computeBoundingBox=!0),t=t>=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var v=this.mesh._boundingInfo;v&&(m.copyFrom(v.minimum),g.copyFrom(v.maximum))}_=0;for(var A=0,y=0,b=0,T=e;T<=t;T++){var M=this.particles[T];A=3*(_=M.idx),y=4*_,b=2*_,this.updateParticle(M);var x=M._rotationMatrix,P=M.position,E=M._globalPosition;if(this._computeParticleRotation&&M.getRotationMatrix(n),null!==M.parentId){var C=this.particles[M.parentId],S=C._rotationMatrix,R=C._globalPosition,O=P.x*S[1]+P.y*S[4]+P.z*S[7],I=P.x*S[0]+P.y*S[3]+P.z*S[6],D=P.x*S[2]+P.y*S[5]+P.z*S[8];if(E.x=R.x+I,E.y=R.y+O,E.z=R.z+D,this._computeParticleRotation){var B=n.m;x[0]=B[0]*S[0]+B[1]*S[3]+B[2]*S[6],x[1]=B[0]*S[1]+B[1]*S[4]+B[2]*S[7],x[2]=B[0]*S[2]+B[1]*S[5]+B[2]*S[8],x[3]=B[4]*S[0]+B[5]*S[3]+B[6]*S[6],x[4]=B[4]*S[1]+B[5]*S[4]+B[6]*S[7],x[5]=B[4]*S[2]+B[5]*S[5]+B[6]*S[8],x[6]=B[8]*S[0]+B[9]*S[3]+B[10]*S[6],x[7]=B[8]*S[1]+B[9]*S[4]+B[10]*S[7],x[8]=B[8]*S[2]+B[9]*S[5]+B[10]*S[8]}}else if(E.x=0,E.y=0,E.z=0,this._computeParticleRotation){B=n.m;x[0]=B[0],x[1]=B[1],x[2]=B[2],x[3]=B[4],x[4]=B[5],x[5]=B[6],x[6]=B[8],x[7]=B[9],x[8]=B[10]}var w=u[11];M.translateFromPivot?w.setAll(0):w.copyFrom(M.pivot);var L=u[0];L.copyFrom(M.position);var N=L.x-M.pivot.x,F=L.y-M.pivot.y,V=L.z-M.pivot.z,k=N*x[0]+F*x[3]+V*x[6],z=N*x[1]+F*x[4]+V*x[7],U=N*x[2]+F*x[5]+V*x[8];k+=w.x,z+=w.y,U+=w.z;var G=c[A]=E.x+h.x*k+f.x*z+p.x*U,j=c[A+1]=E.y+h.y*k+f.y*z+p.y*U,H=c[A+2]=E.z+h.z*k+f.z*z+p.z*U;if(this._computeBoundingBox&&(m.minimizeInPlaceFromFloats(G,j,H),g.maximizeInPlaceFromFloats(G,j,H)),this._computeParticleColor&&M.color){var X=M.color,W=this._colors32;W[y]=X.r,W[y+1]=X.g,W[y+2]=X.b,W[y+3]=X.a}if(this._computeParticleTexture&&M.uv){var Y=M.uv,Q=this._uvs32;Q[b]=Y.x,Q[b+1]=Y.y}}return r&&(this._computeParticleColor&&i.updateVerticesData(a.VertexBuffer.ColorKind,s,!1,!1),this._computeParticleTexture&&i.updateVerticesData(a.VertexBuffer.UVKind,l,!1,!1),i.updateVerticesData(a.VertexBuffer.PositionKind,c,!1,!1)),this._computeBoundingBox&&(i._boundingInfo?i._boundingInfo.reConstruct(m,g,i._worldMatrix):i._boundingInfo=new d.BoundingInfo(m,g,i._worldMatrix)),this.afterUpdateParticles(e,t,r),this},e.prototype.dispose=function(){this.mesh.dispose(),this.vars=null,this._positions=null,this._indices=null,this._normals=null,this._uvs=null,this._colors=null,this._indices32=null,this._positions32=null,this._uvs32=null,this._colors32=null},e.prototype.refreshVisibleSize=function(){return this._isVisibilityBoxLocked||this.mesh.refreshBoundingInfo(),this},e.prototype.setVisibilityBox=function(e){var t=e/2;this.mesh._boundingInfo=new d.BoundingInfo(new o.Vector3(-t,-t,-t),new o.Vector3(t,t,t))},Object.defineProperty(e.prototype,"isAlwaysVisible",{get:function(){return this._alwaysVisible},set:function(e){this._alwaysVisible=e,this.mesh.alwaysSelectAsActiveMesh=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"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,"computeBoundingBox",{get:function(){return this._computeBoundingBox},set:function(e){this._computeBoundingBox=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.beforeUpdateParticles=function(e,t,r){},e.prototype.afterUpdateParticles=function(e,t,r){},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 c}),r.d(t,"ModelShape",function(){return l}),r.d(t,"DepthSortedParticle",function(){return u});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),s=r(/*! ../Culling/boundingSphere */"./Culling/boundingSphere.ts"),a=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),c=function(){function e(e,t,r,s,c,l,u,h,d,f){void 0===d&&(d=null),void 0===f&&(f=null),this.idx=0,this.id=0,this.color=new i.Color4(1,1,1,1),this.position=n.Vector3.Zero(),this.rotation=n.Vector3.Zero(),this.scaling=n.Vector3.One(),this.uvs=new n.Vector4(0,0,1,1),this.velocity=n.Vector3.Zero(),this.pivot=n.Vector3.Zero(),this.translateFromPivot=!1,this.alive=!0,this.isVisible=!0,this._pos=0,this._ind=0,this.shapeId=0,this.idxInShape=0,this._stillInvisible=!1,this._rotationMatrix=[1,0,0,0,1,0,0,0,1],this.parentId=null,this.materialIndex=null,this.cullingStrategy=a.AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this._globalPosition=n.Vector3.Zero(),this.idx=e,this.id=t,this._pos=r,this._ind=s,this._model=c,this.shapeId=l,this.idxInShape=u,this._sps=h,d&&(this._modelBoundingInfo=d,this._boundingInfo=new o.BoundingInfo(d.minimum,d.maximum)),null!==f&&(this.materialIndex=f)}return e.prototype.copyToRef=function(e){return e.position.copyFrom(this.position),e.rotation.copyFrom(this.rotation),this.rotationQuaternion&&(e.rotationQuaternion?e.rotationQuaternion.copyFrom(this.rotationQuaternion):e.rotationQuaternion=this.rotationQuaternion.clone()),e.scaling.copyFrom(this.scaling),this.color&&(e.color?e.color.copyFrom(this.color):e.color=this.color.clone()),e.uvs.copyFrom(this.uvs),e.velocity.copyFrom(this.velocity),e.pivot.copyFrom(this.pivot),e.translateFromPivot=this.translateFromPivot,e.alive=this.alive,e.isVisible=this.isVisible,e.parentId=this.parentId,e.cullingStrategy=this.cullingStrategy,null!==this.materialIndex&&(e.materialIndex=this.materialIndex),this},Object.defineProperty(e.prototype,"scale",{get:function(){return this.scaling},set:function(e){this.scaling=e},enumerable:!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?s.BoundingSphere.Intersects(this._boundingInfo.boundingSphere,e._boundingInfo.boundingSphere):this._boundingInfo.intersects(e._boundingInfo,!1))},e.prototype.isInFrustum=function(e){return null!==this._boundingInfo&&this._boundingInfo.isInFrustum(e,this.cullingStrategy)},e.prototype.getRotationMatrix=function(e){var t;if(this.rotationQuaternion)t=this.rotationQuaternion;else{t=n.TmpVectors.Quaternion[0];var r=this.rotation;n.Quaternion.RotationYawPitchRollToRef(r.y,r.x,r.z,t)}t.toRotationMatrix(e)},e}(),l=function(e,t,r,n,i,o,s,a,c){this._indicesLength=0,this.shapeID=e,this._shape=t,this._indices=r,this._indicesLength=r.length,this._shapeUV=o,this._shapeColors=i,this._normals=n,this._positionFunction=s,this._vertexFunction=a,this._material=c},u=function(e,t,r){this.ind=0,this.indicesLength=0,this.sqDistance=0,this.materialIndex=0,this.ind=e,this.indicesLength=t,this.materialIndex=r}},"./Particles/solidParticleSystem.ts": /*!******************************************!*\ !*** ./Particles/solidParticleSystem.ts ***! \******************************************/ /*! exports provided: SolidParticleSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"SolidParticleSystem",function(){return g});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=r(/*! ../Maths/math.color */"./Maths/math.color.ts"),o=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../Meshes/mesh.vertexData */"./Meshes/mesh.vertexData.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ../Meshes/Builders/discBuilder */"./Meshes/Builders/discBuilder.ts"),l=r(/*! ../Engines/engineStore */"./Engines/engineStore.ts"),u=r(/*! ./solidParticle */"./Particles/solidParticle.ts"),h=r(/*! ../Culling/boundingInfo */"./Culling/boundingInfo.ts"),d=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts"),f=r(/*! ../Meshes/subMesh */"./Meshes/subMesh.ts"),p=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),m=r(/*! ../Materials/multiMaterial */"./Materials/multiMaterial.ts"),g=function(){function e(e,t,r){this.particles=new Array,this.nbParticles=0,this.billboard=!1,this.recomputeNormals=!1,this.counter=0,this.vars={},this._bSphereOnly=!1,this._bSphereRadiusFactor=1,this._positions=new Array,this._indices=new Array,this._normals=new Array,this._colors=new Array,this._uvs=new Array,this._index=0,this._updatable=!0,this._pickable=!1,this._isVisibilityBoxLocked=!1,this._alwaysVisible=!1,this._depthSort=!1,this._expandable=!1,this._shapeCounter=0,this._copy=new u.SolidParticle(0,0,0,0,null,0,0,this),this._color=new i.Color4(0,0,0,0),this._computeParticleColor=!0,this._computeParticleTexture=!0,this._computeParticleRotation=!0,this._computeParticleVertex=!1,this._computeBoundingBox=!1,this._depthSortParticles=!0,this._mustUnrotateFixedNormals=!1,this._particlesIntersect=!1,this._needs32Bits=!1,this._isNotBuilt=!0,this._lastParticleId=0,this._idxOfId=[],this._multimaterialEnabled=!1,this._useModelMaterial=!1,this._depthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},this._materialSortFunction=function(e,t){return e.materialIndex-t.materialIndex},this._autoUpdateSubMeshes=!1,this.name=e,this._scene=t||l.EngineStore.LastCreatedScene,this._camera=t.activeCamera,this._pickable=!!r&&r.isPickable,this._depthSort=!!r&&r.enableDepthSort,this._multimaterialEnabled=!!r&&r.enableMultiMaterial,this._useModelMaterial=!!r&&r.useModelMaterial,this._multimaterialEnabled=!!this._useModelMaterial||this._multimaterialEnabled,this._expandable=!!r&&r.expandable,this._particlesIntersect=!!r&&r.particleIntersection,this._bSphereOnly=!!r&&r.boundingSphereOnly,this._bSphereRadiusFactor=r&&r.bSphereRadiusFactor?r.bSphereRadiusFactor:1,r&&void 0!==r.updatable?this._updatable=r.updatable:this._updatable=!0,this._pickable&&(this.pickedParticles=[]),(this._depthSort||this._multimaterialEnabled)&&(this.depthSortedParticles=[]),this._multimaterialEnabled&&(this._multimaterial=new m.MultiMaterial(this.name+"MultiMaterial",this._scene),this._materials=[],this._materialIndexesById={})}return e.prototype.buildMesh=function(){if(!this._isNotBuilt&&this.mesh)return this.mesh;if(0===this.nbParticles&&!this.mesh){var e=c.DiscBuilder.CreateDisc("",{radius:1,tessellation:3},this._scene);this.addShape(e,1),e.dispose()}if(this._indices32=this._needs32Bits?new Uint32Array(this._indices):new Uint16Array(this._indices),this._positions32=new Float32Array(this._positions),this._uvs32=new Float32Array(this._uvs),this._colors32=new Float32Array(this._colors),!this.mesh){var t=new a.Mesh(this.name,this._scene);this.mesh=t}!this._updatable&&this._multimaterialEnabled&&this._sortParticlesByMaterial(),this.recomputeNormals&&s.VertexData.ComputeNormals(this._positions32,this._indices32,this._normals),this._normals32=new Float32Array(this._normals),this._fixedNormal32=new Float32Array(this._normals),this._mustUnrotateFixedNormals&&this._unrotateFixedNormals();var r=new s.VertexData;return r.indices=this._depthSort?this._indices:this._indices32,r.set(this._positions32,o.VertexBuffer.PositionKind),r.set(this._normals32,o.VertexBuffer.NormalKind),this._uvs32.length>0&&r.set(this._uvs32,o.VertexBuffer.UVKind),this._colors32.length>0&&r.set(this._colors32,o.VertexBuffer.ColorKind),r.applyToMesh(this.mesh,this._updatable),this.mesh.isPickable=this._pickable,this._multimaterialEnabled&&this.setMultiMaterial(this._materials),this._expandable||(this._depthSort||this._multimaterialEnabled||(this._indices=null),this._positions=null,this._normals=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0)),this._isNotBuilt=!1,this.recomputeNormals=!1,this.mesh},e.prototype.digest=function(e,t){var r=t&&t.facetNb||1,i=t&&t.number||0,s=t&&t.delta||0,a=e.getVerticesData(o.VertexBuffer.PositionKind),c=e.getIndices(),l=e.getVerticesData(o.VertexBuffer.UVKind),d=e.getVerticesData(o.VertexBuffer.ColorKind),f=e.getVerticesData(o.VertexBuffer.NormalKind),p=t&&t.storage?t.storage:null,m=0,g=c.length/3;i?(i=i>g?g:i,r=Math.round(g/i),s=0):r=r>g?g:r;for(var _=[],v=[],A=[],y=[],b=[],T=n.Vector3.Zero(),M=r;mg-(r=M+Math.floor((1+s)*Math.random()))&&(r=g-m),_.length=0,v.length=0,A.length=0,y.length=0,b.length=0;for(var x=0,P=3*m;P<3*(m+r);P++){A.push(x);var E=c[P],C=3*E;if(_.push(a[C],a[C+1],a[C+2]),v.push(f[C],f[C+1],f[C+2]),l){var S=2*E;y.push(l[S],l[S+1])}if(d){var R=4*E;b.push(d[R],d[R+1],d[R+2],d[R+3])}x++}var O,I=this.nbParticles,D=this._posToShape(_),B=this._uvsToShapeUV(y),w=Array.from(A),L=Array.from(b),N=Array.from(v);for(T.copyFromFloats(0,0,0),O=0;O65535&&(this._needs32Bits=!0)}if(this._pickable){var N=o.length/3;for(v=0;v=this.nbParticles||!this._updatable)return[];var n=this.particles,i=this.nbParticles;if(t=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var w=this.mesh._boundingInfo;w&&(T.copyFrom(w.minimum),M.copyFrom(w.maximum))}var L=(S=this.particles[e]._pos)/3|0;O=4*L,D=2*L;for(var N=e;N<=t;N++){var F=this.particles[N];this.updateParticle(F);var V=F._model._shape,k=F._model._shapeUV,z=F._rotationMatrix,U=F.position,G=F.rotation,j=F.scaling,H=F._globalPosition;if(this._depthSort&&this._depthSortParticles){var X=this.depthSortedParticles[N];X.ind=F._ind,X.indicesLength=F._model._indicesLength,X.sqDistance=n.Vector3.DistanceSquared(F.position,x)}if(!F.alive||F._stillInvisible&&!F.isVisible)S+=3*(B=V.length),O+=4*B,D+=2*B;else{if(F.isVisible){F._stillInvisible=!1;var W=v[12];if(F.pivot.multiplyToRef(j,W),this.billboard&&(G.x=0,G.y=0),(this._computeParticleRotation||this.billboard)&&F.getRotationMatrix(i),null!==F.parentId){var Y=this.getParticleById(F.parentId);if(Y){var Q=Y._rotationMatrix,K=Y._globalPosition,q=U.x*Q[1]+U.y*Q[4]+U.z*Q[7],Z=U.x*Q[0]+U.y*Q[3]+U.z*Q[6],J=U.x*Q[2]+U.y*Q[5]+U.z*Q[8];if(H.x=K.x+Z,H.y=K.y+q,H.z=K.z+J,this._computeParticleRotation||this.billboard){var $=i.m;z[0]=$[0]*Q[0]+$[1]*Q[3]+$[2]*Q[6],z[1]=$[0]*Q[1]+$[1]*Q[4]+$[2]*Q[7],z[2]=$[0]*Q[2]+$[1]*Q[5]+$[2]*Q[8],z[3]=$[4]*Q[0]+$[5]*Q[3]+$[6]*Q[6],z[4]=$[4]*Q[1]+$[5]*Q[4]+$[6]*Q[7],z[5]=$[4]*Q[2]+$[5]*Q[5]+$[6]*Q[8],z[6]=$[8]*Q[0]+$[9]*Q[3]+$[10]*Q[6],z[7]=$[8]*Q[1]+$[9]*Q[4]+$[10]*Q[7],z[8]=$[8]*Q[2]+$[9]*Q[5]+$[10]*Q[8]}}else F.parentId=null}else if(H.x=U.x,H.y=U.y,H.z=U.z,this._computeParticleRotation||this.billboard){$=i.m;z[0]=$[0],z[1]=$[1],z[2]=$[2],z[3]=$[4],z[4]=$[5],z[5]=$[6],z[6]=$[8],z[7]=$[9],z[8]=$[10]}var ee=v[11];for(F.translateFromPivot?ee.setAll(0):ee.copyFrom(W),B=0;B0)for(var t=0;t0&&e>0;)e-r0&&this._isImpostorInContact(a))for(var c=0,l=a._onPhysicsCollideCallbacks;c3?3:c;var l=(new this.bjsAMMO.btSoftBodyHelpers).CreateRope(this.world.getWorldInfo(),this._tmpAmmoVectorA,this._tmpAmmoVectorB,r-1,c);return l.get_m_cfg().set_collisions(17),l},e.prototype._createCustom=function(e){var t=null;return this.onCreateCustomShape&&(t=this.onCreateCustomShape(e)),null==t&&(t=new this.bjsAMMO.btCompoundShape),t},e.prototype._addHullVerts=function(e,t,r){var i=this,o=0;if(r&&r.getIndices&&r.getWorldMatrix&&r.getChildMeshes){var s=r.getIndices();s||(s=[]);var c=r.getVerticesData(a.VertexBuffer.PositionKind);c||(c=[]),r.computeWorldMatrix(!1);for(var l=s.length/3,u=0;u0){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}this.bjsAMMO.destroy(s),s=null}switch(e.type){case o.PhysicsImpostor.SphereImpostor:if(d.Scalar.WithinEpsilon(c.x,c.y,1e-4)&&d.Scalar.WithinEpsilon(c.x,c.z,1e-4))s=new this.bjsAMMO.btSphereShape(c.x/2);else{var f=[new this.bjsAMMO.btVector3(0,0,0)];(s=new this.bjsAMMO.btMultiSphereShape(f,[1],1)).setLocalScaling(new this.bjsAMMO.btVector3(c.x/2,c.y/2,c.z/2))}break;case o.PhysicsImpostor.CapsuleImpostor:s=new this.bjsAMMO.btCapsuleShape(c.x/2,c.y/2);break;case o.PhysicsImpostor.CylinderImpostor:this._tmpAmmoVectorA.setValue(c.x/2,c.y/2,c.z/2),s=new this.bjsAMMO.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 this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);break;case o.PhysicsImpostor.MeshImpostor:if(0==e.getParam("mass")){var p=new this.bjsAMMO.btTriangleMesh;e._pluginData.toDispose.push(p);var m=this._addMeshVerts(p,a,a);s=0==m?new this.bjsAMMO.btCompoundShape:new this.bjsAMMO.btBvhTriangleMeshShape(p);break}case o.PhysicsImpostor.ConvexHullImpostor:var g=new this.bjsAMMO.btConvexHullShape;0==(m=this._addHullVerts(g,a,a))?(e._pluginData.toDispose.push(g),s=new this.bjsAMMO.btCompoundShape):s=g;break;case o.PhysicsImpostor.NoImpostor:s=new this.bjsAMMO.btSphereShape(c.x/2);break;case o.PhysicsImpostor.CustomImpostor:s=this._createCustom(e);break;case o.PhysicsImpostor.SoftbodyImpostor:s=this._createSoftbody(e);break;case o.PhysicsImpostor.ClothImpostor:s=this._createCloth(e);break;case o.PhysicsImpostor.RopeImpostor:s=this._createRope(e);break;default:i.Logger.Warn("The impostor type is not currently supported by the ammo plugin.")}return s},e.prototype.setTransformationFromPhysicsBody=function(e){e.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.object.position.set(this._tmpAmmoTransform.getOrigin().x(),this._tmpAmmoTransform.getOrigin().y(),this._tmpAmmoTransform.getOrigin().z()),e.object.rotationQuaternion?e.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()):e.object.rotation&&(this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(),this._tmpAmmoTransform.getRotation().y(),this._tmpAmmoTransform.getRotation().z(),this._tmpAmmoTransform.getRotation().w()),this._tmpQuaternion.toEulerAnglesToRef(e.object.rotation))},e.prototype.setPhysicsBodyTransformation=function(e,t,r){var n=e.physicsBody.getWorldTransform();if(n.getOrigin().x()!=t.x||n.getOrigin().y()!=t.y||n.getOrigin().z()!=t.z||n.getRotation().x()!=r.x||n.getRotation().y()!=r.y||n.getRotation().z()!=r.z||n.getRotation().w()!=r.w)if(this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),n.setOrigin(this._tmpAmmoVectorA),this._tmpAmmoQuaternion.setValue(r.x,r.y,r.z,r.w),n.setRotation(this._tmpAmmoQuaternion),e.physicsBody.setWorldTransform(n),0==e.mass){var i=e.physicsBody.getMotionState();i&&i.setWorldTransform(n)}else e.physicsBody.activate()},e.prototype.isSupported=function(){return void 0!==this.bjsAMMO},e.prototype.setLinearVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.linearVelocity(this._tmpAmmoVectorA):e.physicsBody.setLinearVelocity(this._tmpAmmoVectorA)},e.prototype.setAngularVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.soft?e.physicsBody.angularVelocity(this._tmpAmmoVectorA):e.physicsBody.setAngularVelocity(this._tmpAmmoVectorA)},e.prototype.getLinearVelocity=function(e){if(e.soft)var t=e.physicsBody.linearVelocity();else t=e.physicsBody.getLinearVelocity();if(!t)return null;var r=new n.Vector3(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),r},e.prototype.getAngularVelocity=function(e){if(e.soft)var t=e.physicsBody.angularVelocity();else t=e.physicsBody.getAngularVelocity();if(!t)return null;var r=new n.Vector3(t.x(),t.y(),t.z());return this.bjsAMMO.destroy(t),r},e.prototype.setBodyMass=function(e,t){e.soft?e.physicsBody.setTotalMass(t,!1):e.physicsBody.setMassProps(t),e._pluginData.mass=t},e.prototype.getBodyMass=function(e){return e._pluginData.mass||0},e.prototype.getBodyFriction=function(e){return e._pluginData.friction||0},e.prototype.setBodyFriction=function(e,t){e.soft?e.physicsBody.get_m_cfg().set_kDF(t):e.physicsBody.setFriction(t),e._pluginData.friction=t},e.prototype.getBodyRestitution=function(e){return e._pluginData.restitution||0},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.setRestitution(t),e._pluginData.restitution=t},e.prototype.getBodyPressure=function(e){return e.soft?e._pluginData.pressure||0:(i.Logger.Warn("Pressure is not a property of a rigid body"),0)},e.prototype.setBodyPressure=function(e,t){e.soft?e.type===o.PhysicsImpostor.SoftbodyImpostor?(e.physicsBody.get_m_cfg().set_kPR(t),e._pluginData.pressure=t):(e.physicsBody.get_m_cfg().set_kPR(0),e._pluginData.pressure=0):i.Logger.Warn("Pressure can only be applied to a softbody")},e.prototype.getBodyStiffness=function(e){return e.soft?e._pluginData.stiffness||0:(i.Logger.Warn("Stiffness is not a property of a rigid body"),0)},e.prototype.setBodyStiffness=function(e,t){e.soft?(t=(t=t<0?0:t)>1?1:t,e.physicsBody.get_m_materials().at(0).set_m_kLST(t),e._pluginData.stiffness=t):i.Logger.Warn("Stiffness cannot be applied to a rigid body")},e.prototype.getBodyVelocityIterations=function(e){return e.soft?e._pluginData.velocityIterations||0:(i.Logger.Warn("Velocity iterations is not a property of a rigid body"),0)},e.prototype.setBodyVelocityIterations=function(e,t){e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_viterations(t),e._pluginData.velocityIterations=t):i.Logger.Warn("Velocity iterations cannot be applied to a rigid body")},e.prototype.getBodyPositionIterations=function(e){return e.soft?e._pluginData.positionIterations||0:(i.Logger.Warn("Position iterations is not a property of a rigid body"),0)},e.prototype.setBodyPositionIterations=function(e,t){e.soft?(t=t<0?0:t,e.physicsBody.get_m_cfg().set_piterations(t),e._pluginData.positionIterations=t):i.Logger.Warn("Position iterations cannot be applied to a rigid body")},e.prototype.appendAnchor=function(e,t,r,n,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var s=e.segments,a=Math.round((s-1)*r)+s*(s-1-Math.round((s-1)*n));e.physicsBody.appendAnchor(a,t.physicsBody,o,i)},e.prototype.appendHook=function(e,t,r,n,i){void 0===n&&(n=1),void 0===i&&(i=!1);var o=Math.round(e.segments*r);e.physicsBody.appendAnchor(o,t.physicsBody,i,n)},e.prototype.sleepBody=function(e){i.Logger.Warn("sleepBody is not currently supported by the Ammo physics plugin")},e.prototype.wakeUpBody=function(e){e.physicsBody.activate()},e.prototype.updateDistanceJoint=function(e,t,r){i.Logger.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin")},e.prototype.setMotor=function(e,t,r,n){e.physicsJoint.enableAngularMotor(!0,t,r)},e.prototype.setLimit=function(e,t,r){i.Logger.Warn("setLimit is not currently supported by the Ammo physics plugin")},e.prototype.syncMeshWithImpostor=function(e,t){t.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform),e.position.x=this._tmpAmmoTransform.getOrigin().x(),e.position.y=this._tmpAmmoTransform.getOrigin().y(),e.position.z=this._tmpAmmoTransform.getOrigin().z(),e.rotationQuaternion&&(e.rotationQuaternion.x=this._tmpAmmoTransform.getRotation().x(),e.rotationQuaternion.y=this._tmpAmmoTransform.getRotation().y(),e.rotationQuaternion.z=this._tmpAmmoTransform.getRotation().z(),e.rotationQuaternion.w=this._tmpAmmoTransform.getRotation().w())},e.prototype.getRadius=function(e){return e.getObjectExtendSize().x/2},e.prototype.getBoxSizeToRef=function(e,t){var r=e.getObjectExtendSize();t.x=r.x,t.y=r.y,t.z=r.z},e.prototype.dispose=function(){this.bjsAMMO.destroy(this.world),this.bjsAMMO.destroy(this._solver),this.bjsAMMO.destroy(this._overlappingPairCache),this.bjsAMMO.destroy(this._dispatcher),this.bjsAMMO.destroy(this._collisionConfiguration),this.bjsAMMO.destroy(this._tmpAmmoVectorA),this.bjsAMMO.destroy(this._tmpAmmoVectorB),this.bjsAMMO.destroy(this._tmpAmmoVectorC),this.bjsAMMO.destroy(this._tmpAmmoTransform),this.bjsAMMO.destroy(this._tmpAmmoQuaternion),this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback),this.world=null},e.prototype.raycast=function(e,t){this._tmpAmmoVectorRCA=new this.bjsAMMO.btVector3(e.x,e.y,e.z),this._tmpAmmoVectorRCB=new this.bjsAMMO.btVector3(t.x,t.y,t.z);var r=new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB);return this.world.rayTest(this._tmpAmmoVectorRCA,this._tmpAmmoVectorRCB,r),this._raycastResult.reset(e,t),r.hasHit()&&(this._raycastResult.setHitData({x:r.get_m_hitNormalWorld().x(),y:r.get_m_hitNormalWorld().y(),z:r.get_m_hitNormalWorld().z()},{x:r.get_m_hitPointWorld().x(),y:r.get_m_hitPointWorld().y(),z:r.get_m_hitPointWorld().z()}),this._raycastResult.calculateHitDistance()),this.bjsAMMO.destroy(r),this.bjsAMMO.destroy(this._tmpAmmoVectorRCA),this.bjsAMMO.destroy(this._tmpAmmoVectorRCB),this._raycastResult},e.DISABLE_COLLISION_FLAG=4,e.KINEMATIC_FLAG=2,e.DISABLE_DEACTIVATION_FLAG=4,e}()},"./Physics/Plugins/cannonJSPlugin.ts": /*!*******************************************!*\ !*** ./Physics/Plugins/cannonJSPlugin.ts ***! \*******************************************/ /*! exports provided: CannonJSPlugin */function(e,t,r){"use strict";r.r(t),r.d(t,"CannonJSPlugin",function(){return u});var n=r(/*! ../../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../../Meshes/buffer */"./Meshes/buffer.ts"),s=r(/*! ../../Physics/physicsImpostor */"./Physics/physicsImpostor.ts"),a=r(/*! ../../Physics/physicsJoint */"./Physics/physicsJoint.ts"),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._physicsBodysToRemoveAfterStep=new Array,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),this._removeMarkedPhysicsBodiesFromWorld()},e.prototype._removeMarkedPhysicsBodiesFromWorld=function(){var e=this;this._physicsBodysToRemoveAfterStep.length>0&&(this._physicsBodysToRemoveAfterStep.forEach(function(t){e.world.remove(t)}),this._physicsBodysToRemoveAfterStep=[])},e.prototype.applyImpulse=function(e,t,r){var n=new this.BJSCANNON.Vec3(r.x,r.y,r.z),i=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyImpulse(i,n)},e.prototype.applyForce=function(e,t,r){var n=new this.BJSCANNON.Vec3(r.x,r.y,r.z),i=new this.BJSCANNON.Vec3(t.x,t.y,t.z);e.physicsBody.applyForce(i,n)},e.prototype.generatePhysicsBody=function(e){if(this._removeMarkedPhysicsBodiesFromWorld(),e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){var t=this._createShape(e),r=e.physicsBody;r&&this.removePhysicsBody(e);var n=this._addMaterial("mat-"+e.uniqueId,e.getParam("friction"),e.getParam("restitution")),i={mass:e.getParam("mass"),material:n},o=e.getParam("nativeOptions");for(var s in o)o.hasOwnProperty(s)&&(i[s]=o[s]);e.physicsBody=new this.BJSCANNON.Body(i),e.physicsBody.addEventListener("collide",e.onCollide),this.world.addEventListener("preStep",e.beforeStep),this.world.addEventListener("postStep",e.afterStep),e.physicsBody.addShape(t),this.world.add(e.physicsBody),r&&["force","torque","velocity","angularVelocity"].forEach(function(t){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.position.clone(),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),-1===this._physicsBodysToRemoveAfterStep.indexOf(e.physicsBody)&&this._physicsBodysToRemoveAfterStep.push(e.physicsBody)},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,r=e.connectedImpostor.physicsBody;if(t&&r){var n,i=e.joint.jointData,o={pivotA:i.mainPivot?(new this.BJSCANNON.Vec3).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;n1e3*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.vector */"./Maths/math.vector.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")||.001,e.getParam("friction"),e.getParam("restitution")],size:[],type:[],pos:[],posShape:[],rot:[],rotShape:[],move:0!==e.getParam("mass"),density:e.getParam("mass"),friction:e.getParam("friction"),restitution:e.getParam("restitution"),world:this.world},i=[e];(u=e.object).getChildMeshes&&u.getChildMeshes().forEach(function(e){e.physicsImpostor&&i.push(e.physicsImpostor)});var 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(),i.object.rotationQuaternion.set(0,0,0,1),i.object.computeWorldMatrix(!0);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.position.clone();r.posShape.push(d.x),r.posShape.push(d.y),r.posShape.push(d.z),r.rotShape.push(57.29577951308232*s.x),r.rotShape.push(57.29577951308232*s.y),r.rotShape.push(57.29577951308232*s.z)}switch(i.object.rotationQuaternion.copyFrom(l),i.type){case n.PhysicsImpostor.ParticleImpostor:a.Logger.Warn("No Particle support in OIMO.js. using SphereImpostor instead");case n.PhysicsImpostor.SphereImpostor:var f=u.x,p=u.y,m=u.z,g=Math.max(c(f),c(p),c(m))/2;r.type.push("sphere"),r.size.push(g),r.size.push(g),r.size.push(g);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){if(!e.physicsBody.sleeping){if(e.physicsBody.shapes.next){for(var t=e.physicsBody.shapes;t.next;)t=t.next;e.object.position.copyFrom(t.position)}else 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;e.physicsBody.shapes.next||(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.vector */"./Maths/math.vector.ts"),i=r(/*! ../Misc/devTools */"./Misc/devTools.ts"),o=function(){function e(t,r){if(void 0===r&&(r=e.DefaultPluginFactory()),this._physicsPlugin=r,this._impostors=[],this._joints=[],this._subTimeStep=0,!this._physicsPlugin.isSupported())throw new Error("Physics Engine "+this._physicsPlugin.name+" cannot be found. Please make sure it is included.");t=t||new n.Vector3(0,-9.807,0),this.setGravity(t),this.setTimeStep()}return e.DefaultPluginFactory=function(){throw i._DevTools.WarnImport("CannonJSPlugin")},e.prototype.setGravity=function(e){this.gravity=e,this._physicsPlugin.setGravity(this.gravity)},e.prototype.setTimeStep=function(e){void 0===e&&(e=1/60),this._physicsPlugin.setTimeStep(e)},e.prototype.getTimeStep=function(){return this._physicsPlugin.getTimeStep()},e.prototype.setSubTimeStep=function(e){void 0===e&&(e=0),this._subTimeStep=e},e.prototype.getSubTimeStep=function(){return this._subTimeStep},e.prototype.dispose=function(){this._impostors.forEach(function(e){e.dispose()}),this._physicsPlugin.dispose()},e.prototype.getPhysicsPluginName=function(){return this._physicsPlugin.name},e.prototype.addImpostor=function(e){e.uniqueId=this._impostors.push(e),e.parent||this._physicsPlugin.generatePhysicsBody(e)},e.prototype.removeImpostor=function(e){var t=this._impostors.indexOf(e);t>-1&&(this._impostors.splice(t,1).length&&this.getPhysicsPlugin().removePhysicsBody(e))},e.prototype.addJoint=function(e,t,r){var n={mainImpostor:e,connectedImpostor:t,joint:r};r.physicsPlugin=this._physicsPlugin,this._joints.push(n),this._physicsPlugin.generateJoint(n)},e.prototype.removeJoint=function(e,t,r){var n=this._joints.filter(function(n){return n.connectedImpostor===t&&n.joint===r&&n.mainImpostor===e});n.length&&this._physicsPlugin.removeJoint(n[0])},e.prototype._step=function(e){var t=this;this._impostors.forEach(function(e){e.isBodyInitRequired()&&t._physicsPlugin.generatePhysicsBody(e)}),e>.1?e=.1:e<=0&&(e=1/60),this._physicsPlugin.executeStep(e,this._impostors)},e.prototype.getPhysicsPlugin=function(){return this._physicsPlugin},e.prototype.getImpostors=function(){return this._impostors},e.prototype.getImpostorForPhysicsObject=function(e){for(var t=0;t0)for(this._physicsTimeAccumulator+=e;this._physicsTimeAccumulator>t;)this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(t/1e3),this.onAfterPhysicsObservable.notifyObservers(this),this._physicsTimeAccumulator-=t;else this.onBeforePhysicsObservable.notifyObservers(this),this._physicsEngine._step(e/1e3),this.onAfterPhysicsObservable.notifyObservers(this)}},Object.defineProperty(o.AbstractMesh.prototype,"physicsImpostor",{get:function(){return this._physicsImpostor},set:function(e){var t=this;this._physicsImpostor!==e&&(this._disposePhysicsObserver&&this.onDisposeObservable.remove(this._disposePhysicsObserver),this._physicsImpostor=e,e&&(this._disposePhysicsObserver=this.onDisposeObservable.add(function(){t.physicsImpostor&&(t.physicsImpostor.dispose(),t.physicsImpostor=null)})))},enumerable:!0,configurable:!0}),o.AbstractMesh.prototype.getPhysicsImpostor=function(){return this.physicsImpostor},o.AbstractMesh.prototype.applyImpulse=function(e,t){return this.physicsImpostor?(this.physicsImpostor.applyImpulse(e,t),this):this},o.AbstractMesh.prototype.setPhysicsLinkWith=function(e,t,r,n){return this.physicsImpostor&&e.physicsImpostor?(this.physicsImpostor.createJoint(e.physicsImpostor,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 g}),r.d(t,"PhysicsUpdraftEventOptions",function(){return _}),r.d(t,"PhysicsVortexEventOptions",function(){return v}),r.d(t,"PhysicsRadialImpulseFalloff",function(){return n}),r.d(t,"PhysicsUpdraftMode",function(){return i});var n,i,o=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),s=r(/*! ../Misc/logger */"./Misc/logger.ts"),a=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),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 g).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var o=new d(this._scene,t),a=Array();return i.forEach(function(t){var r=o.getImpostorHitData(t,e);r&&(t.applyImpulse(r.force,r.contactPoint),a.push({impostor:t,hitData:r}))}),o.triggerAffectedImpostorsCallback(a),o.dispose(!1),o},e.prototype.applyRadialExplosionForce=function(e,t,r,n){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;var i=this._physicsEngine.getImpostors();if(0===i.length)return null;"number"==typeof t&&((t=new g).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var o=new d(this._scene,t),a=Array();return i.forEach(function(t){var r=o.getImpostorHitData(t,e);r&&(t.applyForce(r.force,r.contactPoint),a.push({impostor:t,hitData:r}))}),o.triggerAffectedImpostorsCallback(a),o.dispose(!1),o},e.prototype.gravitationalField=function(e,t,r,n){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new g).radius=t,t.strength=r||t.strength,t.falloff=n||t.falloff);var i=new f(this,this._scene,e,t);return i.dispose(!1),i},e.prototype.updraft=function(e,t,r,n,i){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new _).radius=t,t.strength=r||t.strength,t.height=n||t.height,t.updraftMode=i||t.updraftMode);var o=new p(this._scene,e,t);return o.dispose(!1),o},e.prototype.vortex=function(e,t,r,n){if(!this._physicsEngine)return s.Logger.Warn("Physics engine not enabled. Please enable the physics before you call the PhysicsHelper."),null;if(0===this._physicsEngine.getImpostors().length)return null;"number"==typeof t&&((t=new v).radius=t,t.strength=r||t.strength,t.height=n||t.height);var i=new m(this._scene,e,t);return i.dispose(!1),i},e}(),d=function(){function e(e,t){this._scene=e,this._options=t,this._dataFetched=!1,this._options=Object(o.__assign)(Object(o.__assign)({},new g),this._options)}return e.prototype.getData=function(){return this._dataFetched=!0,{sphere:this._sphere}},e.prototype.getImpostorHitData=function(e,t){if(0===e.mass)return null;if(!this._intersectsWithSphere(e,t,this._options.radius))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var r=e.getObjectCenter().subtract(t),i=new u.Ray(t,r,this._options.radius).intersectsMesh(e.object).pickedPoint;if(!i)return null;var o=a.Vector3.Distance(t,i);if(o>this._options.radius)return null;var s=this._options.falloff===n.Constant?this._options.strength:this._options.strength*(1-o/this._options.radius);return{force:r.multiplyByFloats(s,s,s),contactPoint:i,distanceFromOrigin:o}},e.prototype.triggerAffectedImpostorsCallback=function(e){this._options.affectedImpostorsCallback&&this._options.affectedImpostorsCallback(e)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._sphere.dispose():setTimeout(function(){t._dataFetched||t._sphere.dispose()},0)},e.prototype._prepareSphere=function(){this._sphere||(this._sphere=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=Object(o.__assign)(Object(o.__assign)({},new g),this._options),this._tickCallback=this._tick.bind(this),this._options.strength=-1*this._options.strength}return e.prototype.getData=function(){return this._dataFetched=!0,{sphere:this._sphere}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._sphere.dispose():setTimeout(function(){t._dataFetched||t._sphere.dispose()},0)},e.prototype._tick=function(){if(this._sphere)this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);else{var e=this._physicsHelper.applyRadialExplosionForce(this._origin,this._options);e&&(this._sphere=e.getData().sphere.clone("radialExplosionEventSphereClone"))}},e}(),p=function(){function e(e,t,r){this._scene=e,this._origin=t,this._options=r,this._originTop=a.Vector3.Zero(),this._originDirection=a.Vector3.Zero(),this._cylinderPosition=a.Vector3.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options=Object(o.__assign)(Object(o.__assign)({},new _),this._options),this._origin.addToRef(new a.Vector3(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new a.Vector3(0,this._options.height,0),this._originTop),this._options.updraftMode===i.Perpendicular&&(this._originDirection=this._origin.subtract(this._originTop).normalize()),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),this._cylinder&&(e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0))},e.prototype.getImpostorHitData=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;var t=e.getObjectCenter();if(this._options.updraftMode===i.Perpendicular)var r=this._originDirection;else r=t.subtract(this._originTop);var n=a.Vector3.Distance(this._origin,t),o=-1*this._options.strength;return{force:r.multiplyByFloats(o,o,o),contactPoint:t,distanceFromOrigin:n}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var r=e.getImpostorHitData(t);r&&t.applyForce(r.force,r.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=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}(),m=function(){function e(e,t,r){this._scene=e,this._origin=t,this._options=r,this._originTop=a.Vector3.Zero(),this._cylinderPosition=a.Vector3.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._options=Object(o.__assign)(Object(o.__assign)({},new v),this._options),this._origin.addToRef(new a.Vector3(0,this._options.height/2,0),this._cylinderPosition),this._origin.addToRef(new a.Vector3(0,this._options.height,0),this._originTop),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0)},e.prototype.getImpostorHitData=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var t=e.getObjectCenter(),r=new a.Vector3(this._origin.x,t.y,this._origin.z),n=t.subtract(r),i=new u.Ray(r,n,this._options.radius).intersectsMesh(e.object),o=i.pickedPoint;if(!o)return null;var s=i.distance/this._options.radius,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,distanceFromOrigin:s}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var r=e.getImpostorHitData(t);r&&t.applyForce(r.force,r.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=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}(),g=function(){this.radius=5,this.strength=10,this.falloff=n.Constant,this.sphere={segments:32,diameter:1}},_=function(){this.radius=5,this.strength=10,this.height=10,this.updraftMode=i.Center},v=function(){this.radius=5,this.strength=10,this.height=10,this.centripetalForceThreshold=.7,this.centripetalForceMultiplier=5,this.centrifugalForceMultiplier=.5,this.updraftForceMultiplier=.02};!function(e){e[e.Constant=0]="Constant",e[e.Linear=1]="Linear"}(n||(n={})),function(e){e[e.Center=0]="Center",e[e.Perpendicular=1]="Perpendicular"}(i||(i={}))},"./Physics/physicsImpostor.ts": /*!************************************!*\ !*** ./Physics/physicsImpostor.ts ***! \************************************/ /*! exports provided: PhysicsImpostor */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsImpostor",function(){return u});var n=r(/*! ../Misc/logger */"./Misc/logger.ts"),i=r(/*! ../Misc/arrayTools */"./Misc/arrayTools.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),a=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),c=r(/*! ./physicsJoint */"./Physics/physicsJoint.ts"),l=r(/*! ../Maths/math.axis */"./Maths/math.axis.ts");a.Mesh._PhysicsImpostorParser=function(e,t,r){return new u(t,r.physicsImpostor,{mass:r.physicsMass,friction:r.physicsFriction,restitution:r.physicsRestitution},e)};var u=function(){function e(e,t,r,i){var s=this;void 0===r&&(r={mass:0}),this.object=e,this.type=t,this._options=r,this._scene=i,this._pluginData={},this._bodyUpdateRequired=!1,this._onBeforePhysicsStepCallbacks=new Array,this._onAfterPhysicsStepCallbacks=new Array,this._onPhysicsCollideCallbacks=[],this._deltaPosition=o.Vector3.Zero(),this._isDisposed=!1,this.soft=!1,this.segments=0,this._tmpQuat=new o.Quaternion,this._tmpQuat2=new o.Quaternion,this.beforeStep=function(){s._physicsEngine&&(s.object.translate(s._deltaPosition,-1),s._deltaRotationConjugated&&s.object.rotationQuaternion&&s.object.rotationQuaternion.multiplyToRef(s._deltaRotationConjugated,s.object.rotationQuaternion),s.object.computeWorldMatrix(!1),s.object.parent&&s.object.rotationQuaternion?(s.getParentsRotation(),s._tmpQuat.multiplyToRef(s.object.rotationQuaternion,s._tmpQuat)):s._tmpQuat.copyFrom(s.object.rotationQuaternion||new o.Quaternion),s._options.disableBidirectionalTransformation||s.object.rotationQuaternion&&s._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(s,s.object.getAbsolutePosition(),s._tmpQuat),s._onBeforePhysicsStepCallbacks.forEach(function(e){e(s)}))},this.afterStep=function(){s._physicsEngine&&(s._onAfterPhysicsStepCallbacks.forEach(function(e){e(s)}),s._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(s),s.object.parent&&s.object.rotationQuaternion&&(s.getParentsRotation(),s._tmpQuat.conjugateInPlace(),s._tmpQuat.multiplyToRef(s.object.rotationQuaternion,s.object.rotationQuaternion)),s.object.setAbsolutePosition(s.object.position),s._deltaRotation&&s.object.rotationQuaternion&&s.object.rotationQuaternion.multiplyToRef(s._deltaRotation,s.object.rotationQuaternion),s.object.translate(s._deltaPosition,1))},this.onCollideEvent=null,this.onCollide=function(e){if((s._onPhysicsCollideCallbacks.length||s.onCollideEvent)&&s._physicsEngine){var t=s._physicsEngine.getImpostorWithPhysicsBody(e.body);t&&(s.onCollideEvent&&s.onCollideEvent(s,t),s._onPhysicsCollideCallbacks.filter(function(e){return-1!==e.otherImpostors.indexOf(t)}).forEach(function(e){e.callback(s,t)}))}},this.object?(this.object.parent&&0!==r.mass&&n.Logger.Warn("A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur."),!this._scene&&e.getScene&&(this._scene=e.getScene()),this._scene&&(this.type>100&&(this.soft=!0),this._physicsEngine=this._scene.getPhysicsEngine(),this._physicsEngine?(this.object.rotationQuaternion||(this.object.rotation?this.object.rotationQuaternion=o.Quaternion.RotationYawPitchRoll(this.object.rotation.y,this.object.rotation.x,this.object.rotation.z):this.object.rotationQuaternion=new o.Quaternion),this._options.mass=void 0===r.mass?0:r.mass,this._options.friction=void 0===r.friction?.2:r.friction,this._options.restitution=void 0===r.restitution?.2:r.restitution,this.soft&&(this._options.mass=this._options.mass>0?this._options.mass:1,this._options.pressure=void 0===r.pressure?200:r.pressure,this._options.stiffness=void 0===r.stiffness?1:r.stiffness,this._options.velocityIterations=void 0===r.velocityIterations?20:r.velocityIterations,this._options.positionIterations=void 0===r.positionIterations?20:r.positionIterations,this._options.fixedPoints=void 0===r.fixedPoints?0:r.fixedPoints,this._options.margin=void 0===r.margin?0:r.margin,this._options.damping=void 0===r.damping?0:r.damping,this._options.path=void 0===r.path?null:r.path,this._options.shape=void 0===r.shape?null:r.shape),this._joints=[],!this.object.parent||this._options.ignoreParent?this._init():this.object.parent.physicsImpostor&&n.Logger.Warn("You must affect impostors to children before affecting impostor to parent.")):n.Logger.Error("Physics not enabled. Please use scene.enablePhysics(...) before creating impostors."))):n.Logger.Error("No object was provided. A physics object is obligatory")}return Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!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,o){var s=e._tmpVecs[0],a=this.object;if(a.rotationQuaternion)if(o){var c=e._tmpQuat;a.rotationQuaternion.multiplyToRef(o,c),t.setRotationQuaternion(c,l.Space.WORLD,r)}else t.setRotationQuaternion(a.rotationQuaternion,l.Space.WORLD,r);s.x=0,s.y=0,s.z=0,n&&(s.x=n.x,s.y=n.y,s.z=n.z,t.getDirectionToRef(s,r,s),null==i&&(i=n.length()),s.x*=i,s.y*=i,s.z*=i),t.getParent()?(s.addInPlace(a.getAbsolutePosition()),t.setAbsolutePosition(s,r)):(r.setAbsolutePosition(a.getAbsolutePosition()),r.position.x-=s.x,r.position.y-=s.y,r.position.z-=s.z)},e.prototype.syncImpostorWithBone=function(t,r,n,i,o,s){var a=this.object;if(a.rotationQuaternion)if(o){var c=e._tmpQuat;t.getRotationQuaternionToRef(l.Space.WORLD,r,c),c.multiplyToRef(o,a.rotationQuaternion)}else t.getRotationQuaternionToRef(l.Space.WORLD,r,a.rotationQuaternion);var u=e._tmpVecs[0],h=e._tmpVecs[1];s||((s=e._tmpVecs[2]).x=0,s.y=1,s.z=0),t.getDirectionToRef(s,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),a.setAbsolutePosition(u)},e.DEFAULT_OBJECT_SIZE=new o.Vector3(1,1,1),e.IDENTITY_QUATERNION=o.Quaternion.Identity(),e._tmpVecs=i.ArrayTools.BuildArray(3,o.Vector3.Zero),e._tmpQuat=o.Quaternion.Identity(),e.NoImpostor=0,e.SphereImpostor=1,e.BoxImpostor=2,e.PlaneImpostor=3,e.MeshImpostor=4,e.CapsuleImpostor=6,e.CylinderImpostor=7,e.ParticleImpostor=8,e.HeightmapImpostor=9,e.ConvexHullImpostor=10,e.CustomImpostor=100,e.RopeImpostor=101,e.ClothImpostor=102,e.SoftbodyImpostor=103,e}()},"./Physics/physicsJoint.ts": /*!*********************************!*\ !*** ./Physics/physicsJoint.ts ***! \*********************************/ /*! exports provided: PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsJoint",function(){return i}),r.d(t,"DistanceJoint",function(){return o}),r.d(t,"MotorEnabledJoint",function(){return s}),r.d(t,"HingeJoint",function(){return a}),r.d(t,"Hinge2Joint",function(){return 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 Object(n.__extends)(t,e),t.prototype.updateDistance=function(e,t){this._physicsPlugin.updateDistanceJoint(this,e,t)},t}(i),s=function(e){function t(t,r){return e.call(this,t,r)||this}return Object(n.__extends)(t,e),t.prototype.setMotor=function(e,t){this._physicsPlugin.setMotor(this,e||0,t)},t.prototype.setLimit=function(e,t){this._physicsPlugin.setLimit(this,e,t)},t}(i),a=function(e){function t(t){return e.call(this,i.HingeJoint,t)||this}return Object(n.__extends)(t,e),t.prototype.setMotor=function(e,t){this._physicsPlugin.setMotor(this,e||0,t)},t.prototype.setLimit=function(e,t){this._physicsPlugin.setLimit(this,e,t)},t}(s),c=function(e){function t(t){return e.call(this,i.Hinge2Joint,t)||this}return Object(n.__extends)(t,e),t.prototype.setMotor=function(e,t,r){void 0===r&&(r=0),this._physicsPlugin.setMotor(this,e||0,t,r)},t.prototype.setLimit=function(e,t,r){void 0===r&&(r=0),this._physicsPlugin.setLimit(this,e,t,r)},t}(s)},"./Physics/physicsRaycastResult.ts": /*!*****************************************!*\ !*** ./Physics/physicsRaycastResult.ts ***! \*****************************************/ /*! exports provided: PhysicsRaycastResult */function(e,t,r){"use strict";r.r(t),r.d(t,"PhysicsRaycastResult",function(){return i});var n=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),i=function(){function e(){this._hasHit=!1,this._hitDistance=0,this._hitNormalWorld=n.Vector3.Zero(),this._hitPointWorld=n.Vector3.Zero(),this._rayFromWorld=n.Vector3.Zero(),this._rayToWorld=n.Vector3.Zero()}return Object.defineProperty(e.prototype,"hasHit",{get:function(){return this._hasHit},enumerable:!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"),m=r(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),g=r(/*! ../../../PostProcesses/depthOfFieldEffect */"./PostProcesses/depthOfFieldEffect.ts"),_=r(/*! ../../../PostProcesses/bloomEffect */"./PostProcesses/bloomEffect.ts"),v=r(/*! ../../../Misc/typeStore */"./Misc/typeStore.ts"),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=g.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 m.PostProcessRenderEffect(f,c.SharpenPostProcessId,function(){return c.sharpen},!0),c.depthOfField=new g.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 m.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 m.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 Object(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;t1){for(var r=0,n=this._cameras;r-1&&(e.depthOfField.depthTexture=t.enableDepthRenderer(t.activeCamera).getDepthMap())})}else{this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);var a=this._scene.enableDepthRenderer(this._cameras[0]);this.depthOfField.depthTexture=a.getDepthMap()}this.depthOfField._isReady()||this.depthOfField._updateEffects(),this.addEffect(this.depthOfField),this._setAutoClearAndTextureSharing(this.depthOfField._effects[0],!0)}else this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);this.bloomEnabled&&(this.bloom._isReady()||this.bloom._updateEffects(),this.addEffect(this.bloom),this._setAutoClearAndTextureSharing(this.bloom._effects[0],!0)),this._imageProcessingEnabled&&(this.imageProcessing=new u.ImageProcessingPostProcess("imageProcessing",1,null,s.Texture.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this._hdr?(this.addEffect(new m.PostProcessRenderEffect(t,this.ImageProcessingPostProcessId,function(){return e.imageProcessing},!0)),this._setAutoClearAndTextureSharing(this.imageProcessing)):this._scene.imageProcessingConfiguration.applyByPostProcess=!1),this.sharpenEnabled&&(this.sharpen.isReady()||this.sharpen.updateEffect(),this.addEffect(this._sharpenEffect),this._setAutoClearAndTextureSharing(this.sharpen)),this.grainEnabled&&(this.grain.isReady()||this.grain.updateEffect(),this.addEffect(this._grainEffect),this._setAutoClearAndTextureSharing(this.grain)),this.chromaticAberrationEnabled&&(this.chromaticAberration.isReady()||this.chromaticAberration.updateEffect(),this.addEffect(this._chromaticAberrationEffect),this._setAutoClearAndTextureSharing(this.chromaticAberration)),this.fxaaEnabled&&(this.fxaa=new f.FxaaPostProcess("fxaa",1,null,s.Texture.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this.addEffect(new m.PostProcessRenderEffect(t,this.FxaaPostProcessId,function(){return e.fxaa},!0)),this._setAutoClearAndTextureSharing(this.fxaa,!0)),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),this._scene.activeCameras&&this._scene.activeCameras.length>1&&(this._scene.autoClear=!0),!this._enableMSAAOnFirstPostProcess(this.samples)&&this.samples>1&&o.Logger.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")}},t.prototype._disposePostProcesses=function(e){void 0===e&&(e=!1);for(var t=0;t0?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),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),e.setArray("samplerOffsets",r._samplerOffsets))},this._blurHPostProcess.samples=this.textureSamples,this._blurVPostProcess.samples=this.textureSamples},t.prototype._rebuild=function(){e.prototype._rebuild.call(this)},t.prototype._radicalInverse_VdC=function(e){return this._bits[0]=e,this._bits[0]=(this._bits[0]<<16|this._bits[0]>>16)>>>0,this._bits[0]=(1431655765&this._bits[0])<<1|(2863311530&this._bits[0])>>>1>>>0,this._bits[0]=(858993459&this._bits[0])<<2|(3435973836&this._bits[0])>>>2>>>0,this._bits[0]=(252645135&this._bits[0])<<4|(4042322160&this._bits[0])>>>4>>>0,this._bits[0]=(16711935&this._bits[0])<<8|(4278255360&this._bits[0])>>>8>>>0,2.3283064365386963e-10*this._bits[0]},t.prototype._hammersley=function(e,t){return[e/t,this._radicalInverse_VdC(e)]},t.prototype._hemisphereSample_uniform=function(e,t){var r=2*t*Math.PI,n=1-(.85*e+.15),i=Math.sqrt(1-n*n);return new s.Vector3(Math.cos(r)*i,Math.sin(r)*i,n)},t.prototype._generateHemisphere=function(){for(var e,t=this.samples,r=[],n=0;n1&&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",this._floatTextureType),this.downSampleX4PostProcess.onApply=function(e){for(var t=0,i=r.downSampleX4PostProcess.width,o=r.downSampleX4PostProcess.height,s=-2;s<2;s++)for(var a=-2;a<2;a++)n[t]=(s+.5)*(1/i),n[t+1]=(a+.5)*(1/o),t+=2;e.setArray2("dsOffsets",n)},this.addEffect(new 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",this._floatTextureType),this.brightPassPostProcess.onApply=function(e){var t=1/r.brightPassPostProcess.width,i=1/r.brightPassPostProcess.height;n[0]=-.5*t,n[1]=.5*i,n[2]=.5*t,n[3]=.5*i,n[4]=-.5*t,n[5]=-.5*i,n[6]=.5*t,n[7]=-.5*i,e.setArray2("dsOffsets",n),e.setFloat("brightThreshold",r.brightThreshold)},this.addEffect(new 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,this._floatTextureType),l=new d.BlurPostProcess("HDRBlurV_"+r,new s.Vector2(0,1),this[n],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,this._floatTextureType);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",this._floatTextureType),this.textureAdderPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",r._vlsEnabled?r._currentDepthOfFieldSource:r.originalPostProcess),e.setTexture("lensSampler",r.lensTexture),e.setFloat("exposure",r._currentExposure),r._currentDepthOfFieldSource=r.textureAdderFinalPostProcess},this.addEffect(new 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,n=["#define HDR"];this._hdrAutoExposure&&n.push("#define AUTO_EXPOSURE"),this.hdrPostProcess=new l.PostProcess("HDR","standard",["averageLuminance"],["textureAdderSampler"],t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,n.join("\n"),p.Constants.TEXTURETYPE_UNSIGNED_INT);var i=1,o=0,s=0;this.hdrPostProcess.onApply=function(t){if(t.setTextureFromPostProcess("textureAdderSampler",r._currentDepthOfFieldSource),o+=e.getEngine().getDeltaTime(),i<0)i=r._hdrCurrentLuminance;else{var n=(s-o)/1e3;r._hdrCurrentLuminancei-r.hdrIncreaseRate*n?i-=r.hdrIncreaseRate*n:i=r._hdrCurrentLuminance}r.hdrAutoExposure?r._currentExposure=r._fixedExposure/i:(i=a.Scalar.Clamp(i,r.hdrMinimumLuminance,1e20),t.setFloat("averageLuminance",i)),s=o,r._currentDepthOfFieldSource=r.hdrFinalPostProcess},this.addEffect(new 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,"lensFlareBlurWidth"),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.lensFlarePostProcess),e.setTexture("lensDirtSampler",r.lensFlareDirtTexture),e.setTexture("lensStarSampler",r.lensStarTexture);var t=r._scene.activeCamera.getViewMatrix().getRow(0),n=r._scene.activeCamera.getViewMatrix().getRow(2),a=s.Vector3.Dot(t.toVector3(),new s.Vector3(1,0,0))+s.Vector3.Dot(n.toVector3(),new s.Vector3(0,0,1));a*=4;var 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;if(this._isObjectBasedMotionBlur){var n=new g.MotionBlurPostProcess("HDRMotionBlur",e,t,null,c.Texture.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,p.Constants.TEXTURETYPE_UNSIGNED_INT);n.motionStrength=this.motionStrength,n.motionBlurSamples=this.motionBlurSamples,this.motionBlurPostProcess=n}else{this.motionBlurPostProcess=new 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 i=0,o=s.Matrix.Identity(),a=s.Matrix.Identity(),u=s.Matrix.Identity(),d=s.Vector2.Zero();this.motionBlurPostProcess.onApply=function(t){(u=e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(a),t.setMatrix("inverseViewProjection",a),t.setMatrix("prevViewProjection",o),o=u,d.x=r.motionBlurPostProcess.width,d.y=r.motionBlurPostProcess.height,t.setVector2("screenSize",d),i=e.getEngine().getFps()/60,t.setFloat("motionScale",i),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;e0){var r=this._renderEffects[t[0]].getPostProcesses();r&&(r[0].samples=e)}return!0},e.prototype.dispose=function(){},Object(n.__decorate)([Object(o.serialize)()],e.prototype,"_name",void 0),e}()},"./PostProcesses/RenderPipeline/postProcessRenderPipelineManager.ts": /*!**************************************************************************!*\ !*** ./PostProcesses/RenderPipeline/postProcessRenderPipelineManager.ts ***! \**************************************************************************/ /*! exports provided: PostProcessRenderPipelineManager */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcessRenderPipelineManager",function(){return n});var n=function(){function e(){this._renderPipelines={}}return Object.defineProperty(e.prototype,"supportedPipelines",{get:function(){var e=[];for(var t in this._renderPipelines)if(this._renderPipelines.hasOwnProperty(t)){var r=this._renderPipelines[t];r.isSupported&&e.push(r)}return e},enumerable:!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 Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/blackAndWhitePostProcess.ts": /*!***************************************************!*\ !*** ./PostProcesses/blackAndWhitePostProcess.ts ***! \***************************************************/ /*! exports provided: BlackAndWhitePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"BlackAndWhitePostProcess",function(){return o});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=(r(/*! ../Shaders/blackAndWhite.fragment */"./Shaders/blackAndWhite.fragment.ts"),function(e){function t(t,r,n,i,o,s){var a=e.call(this,t,"blackAndWhite",["degree"],null,r,n,i,o,s)||this;return a.degree=1,a.onApplyObservable.add(function(e){e.setFloat("degree",a.degree)}),a}return Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/bloomEffect.ts": /*!**************************************!*\ !*** ./PostProcesses/bloomEffect.ts ***! \**************************************/ /*! exports provided: BloomEffect */function(e,t,r){"use strict";r.r(t),r.d(t,"BloomEffect",function(){return u});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),o=r(/*! ./extractHighlightsPostProcess */"./PostProcesses/extractHighlightsPostProcess.ts"),s=r(/*! ./blurPostProcess */"./PostProcesses/blurPostProcess.ts"),a=r(/*! ./bloomMergePostProcess */"./PostProcesses/bloomMergePostProcess.ts"),c=r(/*! ../Maths/math.vector */"./Maths/math.vector.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 Object(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;t0)return Math.max(i,3)}return Math.max(t,3)},t.prototype._gaussianWeight=function(e){var t=-e*e/(1/3*2*(1/3));return 1/(Math.sqrt(2*Math.PI)*(1/3))*Math.exp(t)},t.prototype._glslFloat=function(e,t){return void 0===t&&(t=8),e.toFixed(t).replace(/0+$/,"")},t}(i.PostProcess))},"./PostProcesses/chromaticAberrationPostProcess.ts": /*!*********************************************************!*\ !*** ./PostProcesses/chromaticAberrationPostProcess.ts ***! \*********************************************************/ /*! exports provided: ChromaticAberrationPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ChromaticAberrationPostProcess",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/chromaticAberration.fragment */"./Shaders/chromaticAberration.fragment.ts"),function(e){function t(t,r,n,o,a,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 Object(n.__extends)(t,e),t}(o.PostProcess))},"./PostProcesses/circleOfConfusionPostProcess.ts": /*!*******************************************************!*\ !*** ./PostProcesses/circleOfConfusionPostProcess.ts ***! \*******************************************************/ /*! exports provided: CircleOfConfusionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"CircleOfConfusionPostProcess",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/circleOfConfusion.fragment */"./Shaders/circleOfConfusion.fragment.ts"),function(e){function t(t,r,n,i,a,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 Object(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 Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/convolutionPostProcess.ts": /*!*************************************************!*\ !*** ./PostProcesses/convolutionPostProcess.ts ***! \*************************************************/ /*! exports provided: ConvolutionPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ConvolutionPostProcess",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/convolution.fragment */"./Shaders/convolution.fragment.ts"),function(e){function t(t,r,n,i,s,a,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 Object(n.__extends)(t,e),t.EdgeDetect0Kernel=[1,0,-1,0,0,0,-1,0,1],t.EdgeDetect1Kernel=[0,1,0,1,-4,1,0,1,0],t.EdgeDetect2Kernel=[-1,-1,-1,-1,8,-1,-1,-1,-1],t.SharpenKernel=[0,-1,0,-1,5,-1,0,-1,0],t.EmbossKernel=[-2,-1,0,-1,1,1,0,1,2],t.GaussianKernel=[0,1,0,1,1,1,0,1,0],t}(i.PostProcess))},"./PostProcesses/depthOfFieldBlurPostProcess.ts": /*!******************************************************!*\ !*** ./PostProcesses/depthOfFieldBlurPostProcess.ts ***! \******************************************************/ /*! exports provided: DepthOfFieldBlurPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthOfFieldBlurPostProcess",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),o=r(/*! ./blurPostProcess */"./PostProcesses/blurPostProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=function(e){function t(t,r,n,o,a,c,l,u,h,d,f,p,m){void 0===u&&(u=null),void 0===h&&(h=i.Texture.BILINEAR_SAMPLINGMODE),void 0===p&&(p=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===m&&(m=!1);var g=e.call(this,t,n,o,a,c,h=s.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,d,f,p=s.Constants.TEXTURETYPE_UNSIGNED_INT,"#define DOF 1\r\n",m)||this;return g.direction=n,g.onApplyObservable.add(function(e){null!=u&&e.setTextureFromPostProcess("textureSampler",u),e.setTextureFromPostProcessOutput("circleOfConfusionSampler",l),r.activeCamera&&e.setFloat2("cameraMinMaxZ",r.activeCamera.minZ,r.activeCamera.maxZ)}),g}return Object(n.__extends)(t,e),t}(o.BlurPostProcess)},"./PostProcesses/depthOfFieldEffect.ts": /*!*********************************************!*\ !*** ./PostProcesses/depthOfFieldEffect.ts ***! \*********************************************/ /*! exports provided: DepthOfFieldEffectBlurLevel, DepthOfFieldEffect */function(e,t,r){"use strict";r.r(t),r.d(t,"DepthOfFieldEffectBlurLevel",function(){return n}),r.d(t,"DepthOfFieldEffect",function(){return h});var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),a=r(/*! ../PostProcesses/RenderPipeline/postProcessRenderEffect */"./PostProcesses/RenderPipeline/postProcessRenderEffect.ts"),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 m=p/Math.pow(2,f-1),g=1,_=0;_-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 Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/highlightsPostProcess.ts": /*!************************************************!*\ !*** ./PostProcesses/highlightsPostProcess.ts ***! \************************************************/ /*! exports provided: HighlightsPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"HighlightsPostProcess",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/highlights.fragment */"./Shaders/highlights.fragment.ts"),function(e){function t(t,r,n,i,s,a,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 Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/imageProcessingPostProcess.ts": /*!*****************************************************!*\ !*** ./PostProcesses/imageProcessingPostProcess.ts ***! \*****************************************************/ /*! exports provided: ImageProcessingPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"ImageProcessingPostProcess",function(){return 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 Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){e.applyByPostProcess=!0,this._attachImageProcessingConfiguration(e)},enumerable:!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)},Object(n.__decorate)([Object(i.serialize)()],t.prototype,"_fromLinearSpace",void 0),t}(s.PostProcess))},"./PostProcesses/index.ts": /*!********************************!*\ !*** ./PostProcesses/index.ts ***! \********************************/ /*! exports provided: AnaglyphPostProcess, BlackAndWhitePostProcess, BloomEffect, BloomMergePostProcess, BlurPostProcess, ChromaticAberrationPostProcess, CircleOfConfusionPostProcess, ColorCorrectionPostProcess, ConvolutionPostProcess, DepthOfFieldBlurPostProcess, DepthOfFieldEffectBlurLevel, DepthOfFieldEffect, DepthOfFieldMergePostProcessOptions, DepthOfFieldMergePostProcess, DisplayPassPostProcess, ExtractHighlightsPostProcess, FilterPostProcess, FxaaPostProcess, GrainPostProcess, HighlightsPostProcess, ImageProcessingPostProcess, MotionBlurPostProcess, PassPostProcess, PassCubePostProcess, PostProcess, PostProcessManager, RefractionPostProcess, SharpenPostProcess, StereoscopicInterlacePostProcessI, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, VRMultiviewToSingleviewPostProcess, ScreenSpaceReflectionPostProcess, 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 m=r(/*! ./displayPassPostProcess */"./PostProcesses/displayPassPostProcess.ts");r.d(t,"DisplayPassPostProcess",function(){return m.DisplayPassPostProcess});var g=r(/*! ./extractHighlightsPostProcess */"./PostProcesses/extractHighlightsPostProcess.ts");r.d(t,"ExtractHighlightsPostProcess",function(){return g.ExtractHighlightsPostProcess});var _=r(/*! ./filterPostProcess */"./PostProcesses/filterPostProcess.ts");r.d(t,"FilterPostProcess",function(){return _.FilterPostProcess});var v=r(/*! ./fxaaPostProcess */"./PostProcesses/fxaaPostProcess.ts");r.d(t,"FxaaPostProcess",function(){return v.FxaaPostProcess});var 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 M=r(/*! ./passPostProcess */"./PostProcesses/passPostProcess.ts");r.d(t,"PassPostProcess",function(){return M.PassPostProcess}),r.d(t,"PassCubePostProcess",function(){return M.PassCubePostProcess});var x=r(/*! ./postProcess */"./PostProcesses/postProcess.ts");r.d(t,"PostProcess",function(){return x.PostProcess});var P=r(/*! ./postProcessManager */"./PostProcesses/postProcessManager.ts");r.d(t,"PostProcessManager",function(){return P.PostProcessManager});var E=r(/*! ./refractionPostProcess */"./PostProcesses/refractionPostProcess.ts");r.d(t,"RefractionPostProcess",function(){return E.RefractionPostProcess});var C=r(/*! ./RenderPipeline/index */"./PostProcesses/RenderPipeline/index.ts");r.d(t,"PostProcessRenderEffect",function(){return C.PostProcessRenderEffect}),r.d(t,"PostProcessRenderPipeline",function(){return C.PostProcessRenderPipeline}),r.d(t,"PostProcessRenderPipelineManager",function(){return C.PostProcessRenderPipelineManager}),r.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return C.PostProcessRenderPipelineManagerSceneComponent}),r.d(t,"DefaultRenderingPipeline",function(){return C.DefaultRenderingPipeline}),r.d(t,"LensRenderingPipeline",function(){return C.LensRenderingPipeline}),r.d(t,"SSAO2RenderingPipeline",function(){return C.SSAO2RenderingPipeline}),r.d(t,"SSAORenderingPipeline",function(){return C.SSAORenderingPipeline}),r.d(t,"StandardRenderingPipeline",function(){return C.StandardRenderingPipeline});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,"StereoscopicInterlacePostProcessI",function(){return R.StereoscopicInterlacePostProcessI}),r.d(t,"StereoscopicInterlacePostProcess",function(){return R.StereoscopicInterlacePostProcess});var O=r(/*! ./tonemapPostProcess */"./PostProcesses/tonemapPostProcess.ts");r.d(t,"TonemappingOperator",function(){return O.TonemappingOperator}),r.d(t,"TonemapPostProcess",function(){return O.TonemapPostProcess});var I=r(/*! ./volumetricLightScatteringPostProcess */"./PostProcesses/volumetricLightScatteringPostProcess.ts");r.d(t,"VolumetricLightScatteringPostProcess",function(){return I.VolumetricLightScatteringPostProcess});var D=r(/*! ./vrDistortionCorrectionPostProcess */"./PostProcesses/vrDistortionCorrectionPostProcess.ts");r.d(t,"VRDistortionCorrectionPostProcess",function(){return D.VRDistortionCorrectionPostProcess});var B=r(/*! ./vrMultiviewToSingleviewPostProcess */"./PostProcesses/vrMultiviewToSingleviewPostProcess.ts");r.d(t,"VRMultiviewToSingleviewPostProcess",function(){return B.VRMultiviewToSingleviewPostProcess});var w=r(/*! ./screenSpaceReflectionPostProcess */"./PostProcesses/screenSpaceReflectionPostProcess.ts");r.d(t,"ScreenSpaceReflectionPostProcess",function(){return w.ScreenSpaceReflectionPostProcess})},"./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.vector */"./Maths/math.vector.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 Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"motionBlurSamples",{get:function(){return this._motionBlurSamples},set:function(e){this._motionBlurSamples=e,this._geometryBufferRenderer&&this.updateEffect("#define GEOMETRY_SUPPORTED\n#define SAMPLES "+e.toFixed(1))},enumerable:!0,configurable:!0}),t.prototype.excludeSkinnedMesh=function(e){this._geometryBufferRenderer&&e.skeleton&&this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity.push(e)},t.prototype.removeExcludedSkinnedMesh=function(e){if(this._geometryBufferRenderer&&e.skeleton){var t=this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity.indexOf(e);-1!==t&&this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity.splice(t,1)}},t.prototype.dispose=function(t){this._geometryBufferRenderer&&(this._geometryBufferRenderer._previousTransformationMatrices={},this._geometryBufferRenderer._previousBonesTransformationMatrices={},this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity=[]),e.prototype.dispose.call(this,t)},t}(s.PostProcess))},"./PostProcesses/passPostProcess.ts": /*!******************************************!*\ !*** ./PostProcesses/passPostProcess.ts ***! \******************************************/ /*! exports provided: PassPostProcess, PassCubePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"PassPostProcess",function(){return a}),r.d(t,"PassCubePostProcess",function(){return 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 Object(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 Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"face",{get:function(){return this._face},set:function(e){if(!(e<0||e>5))switch(this._face=e,this._face){case 0:this.updateEffect("#define POSITIVEX");break;case 1:this.updateEffect("#define NEGATIVEX");break;case 2:this.updateEffect("#define POSITIVEY");break;case 3:this.updateEffect("#define NEGATIVEY");break;case 4:this.updateEffect("#define POSITIVEZ");break;case 5:this.updateEffect("#define NEGATIVEZ")}},enumerable:!0,configurable:!0}),t}(o.PostProcess);s.Engine._RescalePostProcessFactory=function(e){return new a("rescale",1,null,i.Constants.TEXTURE_BILINEAR_SAMPLINGMODE,e,!1,i.Constants.TEXTURETYPE_UNSIGNED_INT)}},"./PostProcesses/postProcess.ts": /*!**************************************!*\ !*** ./PostProcesses/postProcess.ts ***! \**************************************/ /*! exports provided: PostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"PostProcess",function(){return c});var n=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),i=r(/*! ../Misc/observable */"./Misc/observable.ts"),o=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts"),a=(r(/*! ../Shaders/postprocess.vertex */"./Shaders/postprocess.vertex.ts"),r(/*! ../Engines/engine */"./Engines/engine.ts")),c=(r(/*! ../Engines/Extensions/engine.renderTarget */"./Engines/Extensions/engine.renderTarget.ts"),function(){function e(e,t,r,a,c,l,u,h,d,f,p,m,g,_,v){void 0===u&&(u=s.Constants.TEXTURE_NEAREST_SAMPLINGMODE),void 0===f&&(f=null),void 0===p&&(p=s.Constants.TEXTURETYPE_UNSIGNED_INT),void 0===m&&(m="postprocess"),void 0===_&&(_=!1),void 0===v&&(v=s.Constants.TEXTUREFORMAT_RGBA),this.name=e,this.width=-1,this.height=-1,this._outputTexture=null,this.autoClear=!0,this.alphaMode=s.Constants.ALPHA_DISABLE,this.animations=new Array,this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=s.Constants.SCALEMODE_FLOOR,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._reusable=!1,this._textures=new n.SmartArray(2),this._currentRenderTextureInd=0,this._scaleRatio=new o.Vector2(1,1),this._texelSize=o.Vector2.Zero(),this.onActivateObservable=new i.Observable,this.onSizeChangedObservable=new i.Observable,this.onApplyObservable=new i.Observable,this.onBeforeRenderObservable=new i.Observable,this.onAfterRenderObservable=new i.Observable,null!=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||s.Constants.TEXTURE_NEAREST_SAMPLINGMODE,this._reusable=d||!1,this._textureType=p,this._textureFormat=v,this._samplers=a||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=m,this._parameters=r||[],this._parameters.push("scale"),this._indexParameters=g,_||this.updateEffect(f)}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._samples},set:function(e){var t=this;this._samples=Math.min(e,this._engine.getCaps().maxMSAASamples),this._textures.forEach(function(e){e.samples!==t._samples&&t._engine.updateRenderTargetTextureSampleCount(e,t._samples)})},enumerable:!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 n.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 n=this;void 0===t&&(t=null);var i=(e=e||this._camera).getScene(),o=i.getEngine(),c=o.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,m=this.renderTargetSamplingMode!==s.Constants.TEXTURE_NEAREST_LINEAR&&this.renderTargetSamplingMode!==s.Constants.TEXTURE_NEAREST_NEAREST&&this.renderTargetSamplingMode!==s.Constants.TEXTURE_LINEAR_LINEAR;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){var g=o.currentViewport;g&&(f*=g.width,p*=g.height)}if((m||this.alwaysForcePOT)&&(this._options.width||(f=o.needPOTTextures?a.Engine.GetExponentOfTwo(f,c,this.scaleMode):f),this._options.height||(p=o.needPOTTextures?a.Engine.GetExponentOfTwo(p,c,this.scaleMode):p)),this.width!==f||this.height!==p){if(this._textures.length>0){for(var _=0;_0)for(var e=0;e0){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>0)),e.push("#define SMOOTH_STEPS "+(this._smoothSteps>>0)),this.updateEffect(e.join("\n"))},Object(n.__decorate)([Object(a.serialize)()],t.prototype,"threshold",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"strength",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"reflectionSpecularFalloffExponent",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"step",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"roughnessFactor",void 0),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"enableSmoothReflections",null),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"reflectionSamples",null),Object(n.__decorate)([Object(a.serialize)()],t.prototype,"smoothSteps",null),t}(i.PostProcess))},"./PostProcesses/sharpenPostProcess.ts": /*!*********************************************!*\ !*** ./PostProcesses/sharpenPostProcess.ts ***! \*********************************************/ /*! exports provided: SharpenPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"SharpenPostProcess",function(){return s});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=(r(/*! ../Shaders/sharpen.fragment */"./Shaders/sharpen.fragment.ts"),function(e){function t(t,r,n,i,s,a,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 Object(n.__extends)(t,e),t}(i.PostProcess))},"./PostProcesses/stereoscopicInterlacePostProcess.ts": /*!***********************************************************!*\ !*** ./PostProcesses/stereoscopicInterlacePostProcess.ts ***! \***********************************************************/ /*! exports provided: StereoscopicInterlacePostProcessI, StereoscopicInterlacePostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"StereoscopicInterlacePostProcessI",function(){return s}),r.d(t,"StereoscopicInterlacePostProcess",function(){return a});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=(r(/*! ../Shaders/stereoscopicInterlace.fragment */"./Shaders/stereoscopicInterlace.fragment.ts"),function(e){function t(t,r,n,o,s,a,c){var l=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,r[1],s,a,c,o?"#define IS_STEREOSCOPIC_INTERLACED 1":n?"#define IS_STEREOSCOPIC_HORIZ 1":void 0)||this;return l._passedProcess=r[0]._rigPostProcess,l._stepSize=new i.Vector2(1/l.width,1/l.height),l.onSizeChangedObservable.add(function(){l._stepSize=new i.Vector2(1/l.width,1/l.height)}),l.onApplyObservable.add(function(e){e.setTextureFromPostProcess("camASampler",l._passedProcess),e.setFloat2("stepSize",l._stepSize.x,l._stepSize.y)}),l}return Object(n.__extends)(t,e),t}(o.PostProcess)),a=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 Object(n.__extends)(t,e),t}(o.PostProcess)},"./PostProcesses/tonemapPostProcess.ts": /*!*********************************************!*\ !*** ./PostProcesses/tonemapPostProcess.ts ***! \*********************************************/ /*! exports provided: TonemappingOperator, TonemapPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"TonemappingOperator",function(){return n}),r.d(t,"TonemapPostProcess",function(){return a});var n,i=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),o=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),s=r(/*! ../Engines/constants */"./Engines/constants.ts");r(/*! ../Shaders/tonemap.fragment */"./Shaders/tonemap.fragment.ts");!function(e){e[e.Hable=0]="Hable",e[e.Reinhard=1]="Reinhard",e[e.HejiDawson=2]="HejiDawson",e[e.Photographic=3]="Photographic"}(n||(n={}));var a=function(e){function t(t,r,i,o,a,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 Object(i.__extends)(t,e),t}(o.PostProcess)},"./PostProcesses/volumetricLightScatteringPostProcess.ts": /*!***************************************************************!*\ !*** ./PostProcesses/volumetricLightScatteringPostProcess.ts ***! \***************************************************************/ /*! exports provided: VolumetricLightScatteringPostProcess */function(e,t,r){"use strict";r.r(t),r.d(t,"VolumetricLightScatteringPostProcess",function(){return A});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../Misc/decorators */"./Misc/decorators.ts"),o=r(/*! ../Misc/logger */"./Misc/logger.ts"),s=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../Meshes/buffer */"./Meshes/buffer.ts"),c=r(/*! ../Meshes/abstractMesh */"./Meshes/abstractMesh.ts"),l=r(/*! ../Meshes/mesh */"./Meshes/mesh.ts"),u=r(/*! ../Materials/material */"./Materials/material.ts"),h=r(/*! ../Materials/materialHelper */"./Materials/materialHelper.ts"),d=r(/*! ../Materials/standardMaterial */"./Materials/standardMaterial.ts"),f=r(/*! ../Materials/Textures/texture */"./Materials/Textures/texture.ts"),p=r(/*! ../Materials/Textures/renderTargetTexture */"./Materials/Textures/renderTargetTexture.ts"),m=r(/*! ./postProcess */"./PostProcesses/postProcess.ts"),g=r(/*! ../Engines/constants */"./Engines/constants.ts"),_=(r(/*! ../Meshes/Builders/planeBuilder */"./Meshes/Builders/planeBuilder.ts"),r(/*! ../Shaders/depth.vertex */"./Shaders/depth.vertex.ts"),r(/*! ../Shaders/volumetricLightScattering.fragment */"./Shaders/volumetricLightScattering.fragment.ts"),r(/*! ../Shaders/volumetricLightScatteringPass.vertex */"./Shaders/volumetricLightScatteringPass.vertex.ts"),r(/*! ../Shaders/volumetricLightScatteringPass.fragment */"./Shaders/volumetricLightScatteringPass.fragment.ts"),r(/*! ../Maths/math.color */"./Maths/math.color.ts")),v=r(/*! ../Maths/math.viewport */"./Maths/math.viewport.ts"),A=function(e){function t(r,n,i,o,a,c,l,u,h){void 0===a&&(a=100),void 0===c&&(c=f.Texture.BILINEAR_SAMPLINGMODE);var d=e.call(this,r,"volumetricLightScattering",["decay","exposure","weight","meshPositionOnScreen","density"],["lightScatteringSampler"],n.postProcessRatio||n,i,c,l,u,"#define NUM_SAMPLES "+a)||this;return d._screenCoordinates=s.Vector2.Zero(),d.customMeshPosition=s.Vector3.Zero(),d.useCustomMeshPosition=!1,d.invert=!0,d.excludedMeshes=new Array,d.exposure=.3,d.decay=.96815,d.weight=.58767,d.density=.926,l=(h=null===i?h:i.getScene()).getEngine(),d._viewPort=new v.Viewport(0,0,1,1).toGlobal(l.getRenderWidth(),l.getRenderHeight()),d.mesh=null!==o?o:t.CreateDefaultMesh("VolumetricLightScatteringMesh",h),d._createPass(h,n.passRatio||n),d.onActivate=function(e){d.isSupported||d.dispose(e),d.onActivate=null},d.onApplyObservable.add(function(e){d._updateMeshScreenCoordinates(h),e.setTexture("lightScatteringSampler",d._volumetricLightScatteringRTT),e.setFloat("exposure",d.exposure),e.setFloat("decay",d.decay),e.setFloat("weight",d.weight),e.setFloat("density",d.density),e.setVector2("meshPositionOnScreen",d._screenCoordinates)}),d}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"useDiffuseColor",{get:function(){return o.Logger.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead"),!1},set:function(e){o.Logger.Warn("VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead")},enumerable:!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"),h.MaterialHelper.PushAttributesForInstances(i));var s=n.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._volumetricLightScatteringPass=r.getScene().getEngine().createEffect("volumetricLightScatteringPass",i,["world","mBones","viewProjection","diffuseMatrix"],["diffuseSampler"],s,void 0,void 0,void 0,{maxSimultaneousMorphTargets:r.numBoneInfluencers})),this._volumetricLightScatteringPass.isReady()},t.prototype.setCustomMeshPosition=function(e){this.customMeshPosition=e},t.prototype.getCustomMeshPosition=function(){return this.customMeshPosition},t.prototype.dispose=function(t){var r=t.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);-1!==r&&t.getScene().customRenderTargets.splice(r,1),this._volumetricLightScatteringRTT.dispose(),e.prototype.dispose.call(this,t)},t.prototype.getPass=function(){return this._volumetricLightScatteringRTT},t.prototype._meshExcluded=function(e){return this.excludedMeshes.length>0&&-1!==this.excludedMeshes.indexOf(e)},t.prototype._createPass=function(e,t){var r=this,n=e.getEngine();this._volumetricLightScatteringRTT=new p.RenderTargetTexture("volumetricLightScatteringMap",{width:n.getRenderWidth()*t,height:n.getRenderHeight()*t},e,!1,!0,g.Constants.TEXTURETYPE_UNSIGNED_INT),this._volumetricLightScatteringRTT.wrapU=f.Texture.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.wrapV=f.Texture.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.renderList=null,this._volumetricLightScatteringRTT.renderParticles=!1,this._volumetricLightScatteringRTT.ignoreCameraViewport=!0;var i=this.getCamera();i?i.customRenderTargets.push(this._volumetricLightScatteringRTT):e.customRenderTargets.push(this._volumetricLightScatteringRTT);var o,s=function(e){var t=e.getRenderingMesh();if(!r._meshExcluded(t)){t._internalAbstractMeshDataInfo._isActiveIntermediate=!1;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,n.fillMode),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)})}}}}},a=new _.Color4(0,0,0,1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function(){o=e.clearColor,e.clearColor=a}),this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function(){e.clearColor=o}),this._volumetricLightScatteringRTT.customRenderFunction=function(t,r,n,i){var o,a=e.getEngine();if(i.length){for(a.setColorWrite(!1),o=0;ot._alphaIndex?1:e._alphaIndext._distanceToCamera?-1:0}),a.setAlphaMode(g.Constants.ALPHA_COMBINE),o=0;o4&&(o.push(i.VertexBuffer.MatricesIndicesExtraKind),o.push(i.VertexBuffer.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),n.push("#define BonesPerMesh "+(s.skeleton?s.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0");var c=s.morphTargetManager,l=0;c&&c.numInfluencers>0&&(l=c.numInfluencers,n.push("#define MORPHTARGETS"),n.push("#define NUM_MORPH_INFLUENCERS "+l),a.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(o,s,l)),t&&(n.push("#define INSTANCES"),a.MaterialHelper.PushAttributesForInstances(o)),this._storeNonLinearDepth&&n.push("#define NONLINEARDEPTH"),this.isPacked&&n.push("#define PACKED");var u=n.join("\n");return this._cachedDefines!==u&&(this._cachedDefines=u,this._effect=this._scene.getEngine().createEffect("depth",o,["world","mBones","viewProjection","diffuseMatrix","depthValues","morphTargetInfluences"],["diffuseSampler"],u,void 0,void 0,void 0,{maxSimultaneousMorphTargets:l})),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,t){if(void 0===t&&(t=!1),!(e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){var r=0;r=this.getEngine().getCaps().textureHalfFloatRender?o.Constants.TEXTURETYPE_HALF_FLOAT:this.getEngine().getCaps().textureFloatRender?o.Constants.TEXTURETYPE_FLOAT:o.Constants.TEXTURETYPE_UNSIGNED_BYTE,this._depthRenderer[e.id]=new i.DepthRenderer(this,r,e,t)}return this._depthRenderer[e.id]},n.Scene.prototype.disableDepthRenderer=function(e){(e=e||this.activeCamera)&&this._depthRenderer&&this._depthRenderer[e.id]&&(this._depthRenderer[e.id].dispose(),delete this._depthRenderer[e.id])};var a=function(){function e(e){this.name=s.SceneComponentConstants.NAME_DEPTHRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(s.SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER,this,this._gatherRenderTargets),this.scene._gatherActiveCameraRenderTargetsStage.registerStep(s.SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER,this,this._gatherActiveCameraRenderTargets)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){for(var e in this.scene._depthRenderer)this.scene._depthRenderer[e].dispose()},e.prototype._gatherRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var r=this.scene._depthRenderer[t];r.enabled&&!r.useOnlyInActiveCamera&&e.push(r.getDepthMap())}},e.prototype._gatherActiveCameraRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var r=this.scene._depthRenderer[t];r.enabled&&r.useOnlyInActiveCamera&&this.scene.activeCamera.id===t&&e.push(r.getDepthMap())}},e}();i.DepthRenderer._SceneComponentInitialization=function(e){var t=e._getComponent(s.SceneComponentConstants.NAME_DEPTHRENDERER);t||(t=new a(e),e._addComponent(t))}},"./Rendering/edgesRenderer.ts": /*!************************************!*\ !*** ./Rendering/edgesRenderer.ts ***! \************************************/ /*! exports provided: EdgesRenderer, LineEdgesRenderer */function(e,t,r){"use strict";r.r(t),r.d(t,"EdgesRenderer",function(){return 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.vector */"./Maths/math.vector.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(){this.edges=new Array,this.edgesConnectedCount=0},f=function(){function e(e,t,r,n){var i=this;void 0===t&&(t=.95),void 0===r&&(r=!1),void 0===n&&(n=!0),this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._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._ib&&this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose()},e.prototype._processEdgeForAdjacencies=function(e,t,r,n,i){return e===r&&t===n||e===n&&t===r?0:e===n&&t===i||e===i&&t===n?1:e===i&&t===r||e===r&&t===i?2:-1},e.prototype._processEdgeForAdjacenciesWithVertices=function(e,t,r,n,i){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])4&&(o.push(i.VertexBuffer.MatricesIndicesExtraKind),o.push(i.VertexBuffer.MatricesWeightsExtraKind)),n.push("#define NUM_BONE_INFLUENCERS "+s.numBoneInfluencers),n.push("#define BonesPerMesh "+(s.skeleton?s.skeleton.bones.length+1:0))):n.push("#define NUM_BONE_INFLUENCERS 0");var l=s.morphTargetManager,d=0;l&&l.numInfluencers>0&&(d=l.numInfluencers,n.push("#define MORPHTARGETS"),n.push("#define NUM_MORPH_INFLUENCERS "+d),c.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(o,s,d)),t&&(n.push("#define INSTANCES"),c.MaterialHelper.PushAttributesForInstances(o)),n.push("#define RENDER_TARGET_COUNT "+this._multiRenderTarget.textures.length);var f=n.join("\n");return this._cachedDefines!==f&&(this._cachedDefines=f,this._effect=this._scene.getEngine().createEffect("geometry",o,["world","mBones","viewProjection","diffuseMatrix","view","previousWorld","previousViewProjection","mPreviousBones","morphTargetInfluences","bumpMatrix","reflectivityMatrix","vTangentSpaceParams","vBumpInfos"],["diffuseSampler","bumpSampler","reflectivitySampler"],f,void 0,void 0,void 0,{buffersCount:this._multiRenderTarget.textures.length-1,maxSimultaneousMorphTargets:d})),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._enableReflectivity&&(this._reflectivityIndex=r,r++),this._multiRenderTarget=new a.MultiRenderTarget("gBuffer",{width:t.getRenderWidth()*this._ratio,height:t.getRenderHeight()*this._ratio},r,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,defaultType:o.Constants.TEXTURETYPE_FLOAT}),this.isSupported){this._multiRenderTarget.wrapU=s.Texture.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=s.Texture.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null,this._multiRenderTarget.onClearObservable.add(function(e){e.clear(new l.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){if(r._internalAbstractMeshDataInfo._isActiveIntermediate=!1,e._enableVelocity&&!e._previousTransformationMatrices[r.uniqueId]&&(e._previousTransformationMatrices[r.uniqueId]={world:n.Matrix.Identity(),viewProjection:i.getTransformMatrix()},r.skeleton)){var a=r.skeleton.getTransformMatrices(r);e._previousBonesTransformationMatrices[r.uniqueId]=e._copyBonesTransformationMatrices(a,new Float32Array(a.length))}o.setState(s.backFaceCulling,0,!1,i.useRightHandedSystem);var l=r._getInstancesRenderList(t._id);if(!l.mustReturn){var d=o.getCaps().instancedArrays&&null!==l.visibleInstances[t._id];if(e.isReady(t,d)){if(o.enableEffect(e._effect),r._bind(t,e._effect,s.fillMode),e._effect.setMatrix("viewProjection",i.getTransformMatrix()),e._effect.setMatrix("view",i.getViewMatrix()),s){if(s.needAlphaTesting()){var f=s.getAlphaTestTexture();f&&(e._effect.setTexture("diffuseSampler",f),e._effect.setMatrix("diffuseMatrix",f.getTextureMatrix()))}s.bumpTexture&&i.getEngine().getCaps().standardDerivatives&&u.StandardMaterial.BumpTextureEnabled&&(e._effect.setFloat3("vBumpInfos",s.bumpTexture.coordinatesIndex,1/s.bumpTexture.level,s.parallaxScaleBias),e._effect.setMatrix("bumpMatrix",s.bumpTexture.getTextureMatrix()),e._effect.setTexture("bumpSampler",s.bumpTexture),e._effect.setFloat2("vTangentSpaceParams",s.invertNormalMapX?-1:1,s.invertNormalMapY?-1:1)),e._enableReflectivity&&(s instanceof u.StandardMaterial&&s.specularTexture?(e._effect.setMatrix("reflectivityMatrix",s.specularTexture.getTextureMatrix()),e._effect.setTexture("reflectivitySampler",s.specularTexture)):s instanceof h.PBRMaterial&&s.reflectivityTexture&&(e._effect.setMatrix("reflectivityMatrix",s.reflectivityTexture.getTextureMatrix()),e._effect.setTexture("reflectivitySampler",s.reflectivityTexture)))}r.useBones&&r.computeBonesUsingShaders&&r.skeleton&&(e._effect.setMatrices("mBones",r.skeleton.getTransformMatrices(r)),e._enableVelocity&&e._effect.setMatrices("mPreviousBones",e._previousBonesTransformationMatrices[r.uniqueId])),c.MaterialHelper.BindMorphTargetParameters(r,e._effect),e._enableVelocity&&(e._effect.setMatrix("previousWorld",e._previousTransformationMatrices[r.uniqueId].world),e._effect.setMatrix("previousViewProjection",e._previousTransformationMatrices[r.uniqueId].viewProjection)),r._processRendering(t,e._effect,s.fillMode,l,d,function(t,r){return e._effect.setMatrix("world",r)})}e._enableVelocity&&(e._previousTransformationMatrices[r.uniqueId].world=r.getWorldMatrix().clone(),e._previousTransformationMatrices[r.uniqueId].viewProjection=e._scene.getTransformMatrix().clone(),r.skeleton&&e._copyBonesTransformationMatrices(r.skeleton.getTransformMatrices(r),e._previousBonesTransformationMatrices[r.uniqueId]))}}};this._multiRenderTarget.customRenderFunction=function(r,n,o,s){var a;if(s.length){for(t.setColorWrite(!1),a=0;a4&&(i.push(n.VertexBuffer.MatricesIndicesExtraKind),i.push(n.VertexBuffer.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),r.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):r.push("#define NUM_BONE_INFLUENCERS 0");var a=o.morphTargetManager,l=0;a&&a.numInfluencers>0&&(l=a.numInfluencers,r.push("#define MORPHTARGETS"),r.push("#define NUM_MORPH_INFLUENCERS "+l),c.MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(i,o,l)),t&&(r.push("#define INSTANCES"),c.MaterialHelper.PushAttributesForInstances(i));var u=r.join("\n");return this._cachedDefines!==u&&(this._cachedDefines=u,this._effect=this.scene.getEngine().createEffect("outline",i,["world","mBones","viewProjection","diffuseMatrix","offset","color","logarithmicDepthConstant","morphTargetInfluences"],["diffuseSampler"],u,void 0,void 0,void 0,{maxSimultaneousMorphTargets:l})),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.renderOverlay){var n=this._engine.getAlphaMode(),i=this._engine.alphaState.alphaBlend;this._engine.setAlphaMode(s.Constants.ALPHA_COMBINE),this.render(t,r,!0),this._engine.setAlphaMode(n),this._engine.setDepthWrite(this._savedDepthWrite),this._engine.alphaState.alphaBlend=i}e.renderOutline&&this._savedDepthWrite&&(this._engine.setDepthWrite(!0),this._engine.setColorWrite(!1),this.render(t,r),this._engine.setColorWrite(!0))},e._StencilReference=4,e}()},"./Rendering/renderingGroup.ts": /*!*************************************!*\ !*** ./Rendering/renderingGroup.ts ***! \*************************************/ /*! exports provided: RenderingGroup */function(e,t,r){"use strict";r.r(t),r.d(t,"RenderingGroup",function(){return s});var n=r(/*! ../Misc/smartArray */"./Misc/smartArray.ts"),i=r(/*! ../Maths/math.vector */"./Maths/math.vector.ts"),o=r(/*! ../Engines/constants */"./Engines/constants.ts"),s=function(){function e(e,t,r,i,o){void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=null),this.index=e,this._opaqueSubMeshes=new n.SmartArray(256),this._transparentSubMeshes=new n.SmartArray(256),this._alphaTestSubMeshes=new n.SmartArray(256),this._depthOnlySubMeshes=new n.SmartArray(256),this._particleSystems=new n.SmartArray(256),this._spriteManagers=new n.SmartArray(256),this._edgesRenderers=new n.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;ar._alphaIndex?1:t._alphaIndext._distanceToCamera?-1:0},e.frontToBackSortCompare=function(e,t){return e._distanceToCamerat._distanceToCamera?1:0},e.prototype.prepare=function(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this._spriteManagers.reset(),this._edgesRenderers.reset()},e.prototype.dispose=function(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()},e.prototype.dispatch=function(e,t,r){void 0===t&&(t=e.getMesh()),void 0===r&&(r=e.getMaterial()),null!=r&&(r.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):r.needAlphaTesting()?(r.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(r.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t._edgesRenderer.isEnabled&&this._edgesRenderers.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;r0)):!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.onAfterCameraRenderObservable.add(function(e){r.shouldRender&&e==r.getRenderCamera()&&r.render()}),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add(function(){r.dispose()}),this._updateCamera()}return e.prototype.getRenderCamera=function(e){if(this._renderCamera)return this._renderCamera;var t=void 0;return t=this.originalScene.activeCameras.length>1?this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:this.originalScene.activeCamera,e&&t&&t.isRigCamera?t.rigParent:t},e.prototype.setRenderCamera=function(e){this._renderCamera=e},e.prototype._getSharedGizmoLight=function(){return this._sharedGizmoLight||(this._sharedGizmoLight=new a.HemisphericLight("shared gizmo light",new c.Vector3(0,1,0),this.utilityLayerScene),this._sharedGizmoLight.intensity=2,this._sharedGizmoLight.groundColor=l.Color3.Gray()),this._sharedGizmoLight},Object.defineProperty(e,"DefaultUtilityLayer",{get:function(){return null==e._DefaultUtilityLayer&&(e._DefaultUtilityLayer=new e(s.EngineStore.LastCreatedScene),e._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(function(){e._DefaultUtilityLayer=null})),e._DefaultUtilityLayer},enumerable:!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.onAfterCameraRenderObservable.remove(this._afterRenderObserver),this._sceneDisposeObserver&&this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver),this._originalPointerObserver&&this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver),this.utilityLayerScene.dispose()},e.prototype._updateCamera=function(){this.utilityLayerScene.cameraToUseForPointers=this.getRenderCamera(),this.utilityLayerScene.activeCamera=this.getRenderCamera()},e._DefaultUtilityLayer=null,e._DefaultKeepDepthUtilityLayer=null,e}()},"./Shaders/ShadersInclude/backgroundFragmentDeclaration.ts": /*!*****************************************************************!*\ !*** ./Shaders/ShadersInclude/backgroundFragmentDeclaration.ts ***! \*****************************************************************/ /*! exports provided: backgroundFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundFragmentDeclaration",function(){return o});var n="backgroundFragmentDeclaration",i=" uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;\nuniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/backgroundUboDeclaration.ts": /*!************************************************************!*\ !*** ./Shaders/ShadersInclude/backgroundUboDeclaration.ts ***! \************************************************************/ /*! exports provided: backgroundUboDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundUboDeclaration",function(){return o});var n="backgroundUboDeclaration",i="layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec4 vPrimaryColor;\nuniform vec4 vPrimaryColorShadow;\nuniform vec2 vDiffuseInfos;\nuniform vec2 vReflectionInfos;\nuniform mat4 diffuseMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\nuniform float pointSize;\nuniform float shadowLevel;\nuniform float alpha;\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/backgroundVertexDeclaration.ts": /*!***************************************************************!*\ !*** ./Shaders/ShadersInclude/backgroundVertexDeclaration.ts ***! \***************************************************************/ /*! exports provided: backgroundVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"backgroundVertexDeclaration",function(){return o});var n="backgroundVertexDeclaration",i="uniform mat4 view;\nuniform mat4 viewProjection;\nuniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/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,vec3 textureSample,float scale)\n{\ntextureSample=textureSample*2.0-1.0;\n#ifdef NORMALXYSCALE\ntextureSample=normalize(textureSample*vec3(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*textureSample);\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#if defined(BUMP)\n#if BUMPDIRECTUV == 1\n#define vBumpUV vMainUV1\n#elif BUMPDIRECTUV == 2\n#define vBumpUV vMainUV2\n#else\nvarying vec2 vBumpUV;\n#endif\nuniform sampler2D bumpSampler;\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv)\n{\nreturn perturbNormal(cotangentFrame,texture2D(bumpSampler,uv).xyz,vBumpInfos.y);\n}\n#endif\n#if defined(BUMP) || defined(CLEARCOAT_BUMP)\nvec3 perturbNormal(mat3 cotangentFrame,vec3 color)\n{\nreturn perturbNormal(cotangentFrame,color,vBumpInfos.y);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\nreturn cotangent_frame(normal,p,uv,vTangentSpaceParams);\n}\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; icurrRayHeight)\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\n#ifdef CLIPPLANE5\nif (fClipDistance5>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE6\nif (fClipDistance6>0.0)\n{\ndiscard;\n}\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts": /*!****************************************************************!*\ !*** ./Shaders/ShadersInclude/clipPlaneFragmentDeclaration.ts ***! \****************************************************************/ /*! exports provided: clipPlaneFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneFragmentDeclaration",function(){return o});var n="clipPlaneFragmentDeclaration",i="#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nvarying float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.ts": /*!*****************************************************************!*\ !*** ./Shaders/ShadersInclude/clipPlaneFragmentDeclaration2.ts ***! \*****************************************************************/ /*! exports provided: clipPlaneFragmentDeclaration2 */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneFragmentDeclaration2",function(){return o});var n="clipPlaneFragmentDeclaration2",i="#ifdef CLIPPLANE\nin float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nin float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nin float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nin float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nin float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nin float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneVertex.ts": /*!***************************************************!*\ !*** ./Shaders/ShadersInclude/clipPlaneVertex.ts ***! \***************************************************/ /*! exports provided: clipPlaneVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneVertex",function(){return o});var n="clipPlaneVertex",i="#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nfClipDistance5=dot(worldPos,vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nfClipDistance6=dot(worldPos,vClipPlane6);\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts": /*!**************************************************************!*\ !*** ./Shaders/ShadersInclude/clipPlaneVertexDeclaration.ts ***! \**************************************************************/ /*! exports provided: clipPlaneVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneVertexDeclaration",function(){return o});var n="clipPlaneVertexDeclaration",i="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nvarying float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/clipPlaneVertexDeclaration2.ts": /*!***************************************************************!*\ !*** ./Shaders/ShadersInclude/clipPlaneVertexDeclaration2.ts ***! \***************************************************************/ /*! exports provided: clipPlaneVertexDeclaration2 */function(e,t,r){"use strict";r.r(t),r.d(t,"clipPlaneVertexDeclaration2",function(){return o});var n="clipPlaneVertexDeclaration2",i="#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nout float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nout float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nout float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nout float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nout float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nout float fClipDistance6;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/defaultFragmentDeclaration.ts": /*!**************************************************************!*\ !*** ./Shaders/ShadersInclude/defaultFragmentDeclaration.ts ***! \**************************************************************/ /*! exports provided: defaultFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"defaultFragmentDeclaration",function(){return o});var n="defaultFragmentDeclaration",i="uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/defaultUboDeclaration.ts": /*!*********************************************************!*\ !*** ./Shaders/ShadersInclude/defaultUboDeclaration.ts ***! \*********************************************************/ /*! exports provided: defaultUboDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"defaultUboDeclaration",function(){return o});var n="defaultUboDeclaration",i="layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor;\nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec3 vReflectionPosition;\nvec3 vReflectionSize;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix;\nvec2 vTangentSpaceParams;\nfloat pointSize;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nfloat visibility;\nvec4 vDiffuseColor;\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\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;\nuniform vec3 vSphericalL1_1;\nuniform vec3 vSphericalL10;\nuniform vec3 vSphericalL11;\nuniform vec3 vSphericalL2_2;\nuniform vec3 vSphericalL2_1;\nuniform vec3 vSphericalL20;\nuniform vec3 vSphericalL21;\nuniform vec3 vSphericalL22;\n\n\n\n\n\n\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\nreturn vSphericalL00\n+vSphericalL1_1*(normal.y)\n+vSphericalL10*(normal.z)\n+vSphericalL11*(normal.x)\n+vSphericalL2_2*(normal.y*normal.x)\n+vSphericalL2_1*(normal.y*normal.z)\n+vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+vSphericalL21*(normal.z*normal.x)\n+vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));\n}\n#else\nuniform vec3 vSphericalX;\nuniform vec3 vSphericalY;\nuniform vec3 vSphericalZ;\nuniform vec3 vSphericalXX_ZZ;\nuniform vec3 vSphericalYY_ZZ;\nuniform vec3 vSphericalZZ;\nuniform vec3 vSphericalXY;\nuniform vec3 vSphericalYZ;\nuniform vec3 vSphericalZX;\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\n\n\n\n\n\n\n\n\n\nfloat Nx=normal.x;\nfloat Ny=normal.y;\nfloat Nz=normal.z;\nvec3 C1=vSphericalZZ.rgb;\nvec3 Cx=vSphericalX.rgb;\nvec3 Cy=vSphericalY.rgb;\nvec3 Cz=vSphericalZ.rgb;\nvec3 Cxx_zz=vSphericalXX_ZZ.rgb;\nvec3 Cyy_zz=vSphericalYY_ZZ.rgb;\nvec3 Cxy=vSphericalXY.rgb;\nvec3 Cyz=vSphericalYZ.rgb;\nvec3 Czx=vSphericalZX.rgb;\nvec3 a1=Cyy_zz*Ny+Cy;\nvec3 a2=Cyz*Nz+a1;\nvec3 b1=Czx*Nz+Cx;\nvec3 b2=Cxy*Ny+b1;\nvec3 b3=Cxx_zz*Nx+b2;\nvec3 t1=Cz*Nz+C1;\nvec3 t2=a2*Ny+t1;\nvec3 t3=b3*Nx+t2;\nreturn t3;\n}\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/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 toGammaSpace(float color)\n{\nreturn pow(color,GammaEncodePowerApprox);\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat pow5(float value) {\nfloat sq=value*value;\nreturn sq*sq*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\n\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nfloat dither(vec2 seed,float varianceAmount) {\nfloat rand=getRand(seed);\nfloat dither=mix(-varianceAmount/255.0,varianceAmount/255.0,rand);\nreturn dither;\n}\n\nconst float rgbdMaxRange=255.0;\nvec4 toRGBD(vec3 color) {\nfloat maxRGB=maxEps(max(color.r,max(color.g,color.b)));\nfloat D=max(rgbdMaxRange/maxRGB,1.);\nD=clamp(floor(D)/255.0,0.,1.);\n\nvec3 rgb=color.rgb*D;\n\nrgb=toGammaSpace(rgb);\nreturn vec4(rgb,D);\n}\nvec3 fromRGBD(vec4 rgbd) {\n\nrgbd.rgb=toLinearSpace(rgbd.rgb);\n\nreturn rgbd.rgb/rgbd.a;\n}\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/imageProcessingDeclaration.ts": /*!**************************************************************!*\ !*** ./Shaders/ShadersInclude/imageProcessingDeclaration.ts ***! \**************************************************************/ /*! exports provided: imageProcessingDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"imageProcessingDeclaration",function(){return o});var n="imageProcessingDeclaration",i="#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#ifdef VIGNETTE\nuniform vec2 vInverseScreenSize;\nuniform vec4 vignetteSettings1;\nuniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;\nuniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/imageProcessingFunctions.ts": /*!************************************************************!*\ !*** ./Shaders/ShadersInclude/imageProcessingFunctions.ts ***! \************************************************************/ /*! exports provided: imageProcessingFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"imageProcessingFunctions",function(){return o});var n="imageProcessingFunctions",i="#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n\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}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);\n#elif defined(SS_TRANSLUCENCY)\ninfo.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,transmittance);\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef SPECULARTERM\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,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}.vLightSpecular.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;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nfor (int i=0; i=0.) {\nindex{X}=i;\nbreak;\n}\n}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nfloat frustumLength=frustumLengths{X}[index{X}];\nfloat diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};\nif (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{\nindex{X}+=1;\nfloat nextShadow=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;\nshadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else\ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/lightFragmentDeclaration.ts": /*!************************************************************!*\ !*** ./Shaders/ShadersInclude/lightFragmentDeclaration.ts ***! \************************************************************/ /*! exports provided: lightFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"lightFragmentDeclaration",function(){return o});var n="lightFragmentDeclaration",i="#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\nuniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/lightUboDeclaration.ts": /*!*******************************************************!*\ !*** ./Shaders/ShadersInclude/lightUboDeclaration.ts ***! \*******************************************************/ /*! exports provided: lightUboDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"lightUboDeclaration",function(){return o});var n="lightUboDeclaration",i="#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\nvec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/lightsFragmentFunctions.ts": /*!***********************************************************!*\ !*** ./Shaders/ShadersInclude/lightsFragmentFunctions.ts ***! \***********************************************************/ /*! exports provided: lightsFragmentFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"lightsFragmentFunctions",function(){return o});var n="lightsFragmentFunctions",i="\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn textureColor;\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/logDepthDeclaration.ts": /*!*******************************************************!*\ !*** ./Shaders/ShadersInclude/logDepthDeclaration.ts ***! \*******************************************************/ /*! exports provided: logDepthDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"logDepthDeclaration",function(){return o});var n="logDepthDeclaration",i="#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/logDepthFragment.ts": /*!****************************************************!*\ !*** ./Shaders/ShadersInclude/logDepthFragment.ts ***! \****************************************************/ /*! exports provided: logDepthFragment */function(e,t,r){"use strict";r.r(t),r.d(t,"logDepthFragment",function(){return o});var n="logDepthFragment",i="#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/logDepthVertex.ts": /*!**************************************************!*\ !*** ./Shaders/ShadersInclude/logDepthVertex.ts ***! \**************************************************/ /*! exports provided: logDepthVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"logDepthVertex",function(){return o});var n="logDepthVertex",i="#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/morphTargetsVertex.ts": /*!******************************************************!*\ !*** ./Shaders/ShadersInclude/morphTargetsVertex.ts ***! \******************************************************/ /*! exports provided: morphTargetsVertex */function(e,t,r){"use strict";r.r(t),r.d(t,"morphTargetsVertex",function(){return o});var n="morphTargetsVertex",i="#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts": /*!*****************************************************************!*\ !*** ./Shaders/ShadersInclude/morphTargetsVertexDeclaration.ts ***! \*****************************************************************/ /*! exports provided: morphTargetsVertexDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"morphTargetsVertexDeclaration",function(){return o});var n="morphTargetsVertexDeclaration",i="#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#ifdef MORPHTARGETS_UV\nattribute vec2 uv_{X};\n#endif\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts": /*!***********************************************************************!*\ !*** ./Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.ts ***! \***********************************************************************/ /*! exports provided: morphTargetsVertexGlobalDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"morphTargetsVertexGlobalDeclaration",function(){return o});var n="morphTargetsVertexGlobalDeclaration",i="#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/mrtFragmentDeclaration.ts": /*!**********************************************************!*\ !*** ./Shaders/ShadersInclude/mrtFragmentDeclaration.ts ***! \**********************************************************/ /*! exports provided: mrtFragmentDeclaration */function(e,t,r){"use strict";r.r(t),r.d(t,"mrtFragmentDeclaration",function(){return o});var n="mrtFragmentDeclaration",i="#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/packingFunctions.ts": /*!****************************************************!*\ !*** ./Shaders/ShadersInclude/packingFunctions.ts ***! \****************************************************/ /*! exports provided: packingFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"packingFunctions",function(){return o});var n="packingFunctions",i="vec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/pbrBRDFFunctions.ts": /*!****************************************************!*\ !*** ./Shaders/ShadersInclude/pbrBRDFFunctions.ts ***! \****************************************************/ /*! exports provided: pbrBRDFFunctions */function(e,t,r){"use strict";r.r(t),r.d(t,"pbrBRDFFunctions",function(){return o});var n="pbrBRDFFunctions",i="\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n\n\n\n\n#ifdef MS_BRDF_ENERGY_CONSERVATION\n\n\nvec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\nreturn 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);\n}\n#endif\n#ifdef ENVIRONMENTBRDF\nvec3 getBRDFLookup(float NdotV,float perceptualRoughness) {\n\nvec2 UV=vec2(NdotV,perceptualRoughness);\n\nvec4 brdfLookup=texture2D(environmentBrdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 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#ifdef SS_TRANSLUCENCY\n\n\nvec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {\nvec3 S=1./maxEps(diffusionDistance);\nvec3 temp=exp((-0.333333333*thickness)*S);\nreturn tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);\n}\n\n\nfloat computeWrappedDiffuseNdotL(float NdotL,float w) {\nfloat t=1.0+w;\nfloat invt2=1.0/square(t);\nreturn saturate((NdotL+w)*invt2);\n}\n#endif\n";r(/*! ../../Materials/effect */"./Materials/effect.ts").Effect.IncludesShadersStore[n]=i;var o={name:n,shader:i}},"./Shaders/ShadersInclude/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.wthis._delay&&(this._time=this._time%this._delay,this.cellIndex+=this._direction,(this._direction>0&&this.cellIndex>this._toIndex||this._direction<0&&this.cellIndex0?this._fromIndex:this._toIndex:(this.cellIndex=this._toIndex,this._animationStarted=!1,this._onAnimationEnd&&this._onAnimationEnd(),this.disposeWhenFinishedAnimating&&this.dispose()))))},e.prototype.dispose=function(){for(var e=0;e0);var u=e.substring(0,l-1)+".json",h=new XMLHttpRequest;h.open("GET",u,!0),h.onerror=function(){f.Logger.Error("JSON ERROR: Unable to load JSON file."),r._fromPacked=!1,r._packedAndReady=!1},h.onload=function(){try{var e=JSON.parse(h.response),t=Reflect.ownKeys(e.frames);r._spriteMap=t,r._packedAndReady=!0,r._cellData=e.frames}catch(e){throw r._fromPacked=!1,r._packedAndReady=!1,new Error("Invalid JSON format. Please check documentation for format specifications.")}},h.send()}},e.prototype._appendSpriteVertex=function(e,t,r,n,i){var o=18*e;if(0===r?r=this._epsilon:1===r&&(r=1-this._epsilon),0===n?n=this._epsilon:1===n&&(n=1-this._epsilon),this._vertexData[o]=t.position.x,this._vertexData[o+1]=t.position.y,this._vertexData[o+2]=t.position.z,this._vertexData[o+3]=t.angle,this._vertexData[o+4]=t.width,this._vertexData[o+5]=t.height,this._vertexData[o+6]=r,this._vertexData[o+7]=n,this._vertexData[o+8]=t.invertU?1:0,this._vertexData[o+9]=t.invertV?1:0,this._packedAndReady){t.cellRef||(t.cellIndex=0);var s=t.cellIndex;"number"==typeof s&&isFinite(s)&&Math.floor(s)===s&&(t.cellRef=this._spriteMap[t.cellIndex]),this._vertexData[o+10]=this._cellData[t.cellRef].frame.x/i.width,this._vertexData[o+11]=this._cellData[t.cellRef].frame.y/i.height,this._vertexData[o+12]=this._cellData[t.cellRef].frame.w/i.width,this._vertexData[o+13]=this._cellData[t.cellRef].frame.h/i.height}else{t.cellIndex||(t.cellIndex=0);var a=i.width/this.cellWidth,c=t.cellIndex/a>>0;this._vertexData[o+10]=(t.cellIndex-c*a)*this.cellWidth/i.width,this._vertexData[o+11]=c*this.cellHeight/i.height,this._vertexData[o+12]=this.cellWidth/i.width,this._vertexData[o+13]=this.cellHeight/i.height}this._vertexData[o+14]=t.color.r,this._vertexData[o+15]=t.color.g,this._vertexData[o+16]=t.color.b,this._vertexData[o+17]=t.color.a},e.prototype.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.TmpVectors.Vector3[0],d=s.TmpVectors.Vector3[1],f=t.getViewMatrix(),p=0;pg&&(l=g,u=m,n))break}}}if(u){var _=new c.PickingInfo;f.invertToRef(s.TmpVectors.Matrix[0]),_.hit=!0,_.pickedSprite=u,_.distance=l;var v=s.TmpVectors.Vector3[2];return v.copyFrom(e.direction),v.normalize(),v.scaleInPlace(l),e.origin.addToRef(v,h),_.pickedPoint=s.Vector3.TransformCoordinates(h,s.TmpVectors.Matrix[0]),_}return null},e.prototype.multiIntersects=function(e,t,r){for(var n,i=Math.min(this._capacity,this.sprites.length),o=s.Vector3.Zero(),a=s.Vector3.Zero(),l=[],u=s.TmpVectors.Vector3[0].copyFromFloats(0,0,0),h=s.TmpVectors.Vector3[1].copyFromFloats(0,0,0),d=t.getViewMatrix(),f=0;f0&&(e+="\n\r"),e+=this._tileMaps[t]._texture._bufferView.toString();var r=document.createElement("a");r.href="data:octet/stream;charset=utf-8,"+encodeURI(e),r.target="_blank",r.download=this.name+".tilemaps",r.click(),r.remove()},e.prototype.loadTileMaps=function(e){var t=this,r=new XMLHttpRequest;r.open("GET",e);var n=this.options.layerCount||0;r.onload=function(){for(var e=r.response.split("\n\r"),i=0;i0)for(var o=0;o=i.distance))&&(i=c,r))break}}return i||new s.PickingInfo},i.Scene.prototype._internalMultiPickSprites=function(e,t,r){if(!s.PickingInfo)return null;var n=new Array;if(!r){if(!this.activeCamera)return null;r=this.activeCamera}if(this.spriteManagers.length>0)for(var i=0;i0&&(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._inputManager._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}()},"./XR/features/WebXRAbstractFeature.ts": /*!*********************************************!*\ !*** ./XR/features/WebXRAbstractFeature.ts ***! \*********************************************/ /*! exports provided: WebXRAbstractFeature */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRAbstractFeature",function(){return n});var n=function(){function e(e){this._xrSessionManager=e,this._attached=!1,this._removeOnDetach=[],this.disableAutoAttach=!1}return Object.defineProperty(e.prototype,"attached",{get:function(){return this._attached},enumerable:!0,configurable:!0}),e.prototype.attach=function(e){var t=this;if(e)this.attached&&this.detach();else if(this.attached)return!1;return this._attached=!0,this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable,function(e){return t._onXRFrame(e)}),!0},e.prototype.detach=function(){return this._attached?(this._attached=!1,this._removeOnDetach.forEach(function(e){e.observable.remove(e.observer)}),!0):(this.disableAutoAttach=!0,!1)},e.prototype.dispose=function(){this.detach()},e.prototype._addNewAttachObserver=function(e,t){this._removeOnDetach.push({observable:e,observer:e.add(t)})},e}()},"./XR/features/WebXRAnchorSystem.ts": /*!******************************************!*\ !*** ./XR/features/WebXRAnchorSystem.ts ***! \******************************************/ /*! exports provided: WebXRAnchorSystem */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRAnchorSystem",function(){return u});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../../Misc/observable */"./Misc/observable.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ./WebXRHitTestLegacy */"./XR/features/WebXRHitTestLegacy.ts"),c=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),l=0,u=function(e){function t(t,r){void 0===r&&(r={});var n=e.call(this,t)||this;return n._options=r,n._enabled=!1,n._lastFrameDetected=new Set,n._onSelect=function(e){if(n._options.addAnchorOnSelect){var t=function(e){if(e.length){var t=e[0],r=new XRRigidTransform(t.hitMatrix);n.addAnchorAtRigidTransformation(r)}};n._hitTestModule&&!n._hitTestModule.options.testOnPointerDownOnly&&t(n._hitTestModule.lastNativeXRHitResults),a.WebXRHitTestLegacy.XRHitTestWithSelectEvent(e,n._xrSessionManager.referenceSpace).then(t),n._planeDetector}},n._trackedAnchors=[],n.onAnchorAddedObservable=new o.Observable,n.onAnchorRemovedObservable=new o.Observable,n.onAnchorUpdatedObservable=new o.Observable,n}return Object(n.__extends)(t,e),t.prototype.addAnchorAtRigidTransformation=function(e,t){return(t||this._xrSessionManager.session).createAnchor(e,this._xrSessionManager.referenceSpace)},t.prototype.attach=function(){return!!e.prototype.attach.call(this)&&(this._options.addAnchorOnSelect&&this._xrSessionManager.session.addEventListener("select",this._onSelect,!1),!0)},t.prototype.detach=function(){return!!e.prototype.detach.call(this)&&(this._xrSessionManager.session.removeEventListener("select",this._onSelect),!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.onAnchorAddedObservable.clear(),this.onAnchorRemovedObservable.clear(),this.onAnchorUpdatedObservable.clear()},t.prototype.setHitTestModule=function(e){this._hitTestModule=e},t.prototype.setPlaneDetector=function(e,t){void 0===t&&(t=!0),this._planeDetector=e,this._options.usePlaneDetection=t},t.prototype._onXRFrame=function(e){var t=this;if(this.attached&&this._enabled&&e){var r=e.trackedAnchors;r&&r.size&&(this._trackedAnchors.filter(function(e){return!r.has(e.xrAnchor)}).map(function(e){var r=t._trackedAnchors.indexOf(e);t._trackedAnchors.splice(r,1),t.onAnchorRemovedObservable.notifyObservers(e)}),r.forEach(function(r){if(t._lastFrameDetected.has(r)){if(r.lastChangedTime===t._xrSessionManager.currentTimestamp){var n=t._findIndexInAnchorArray(r),i=t._trackedAnchors[n];t._updateAnchorWithXRFrame(r,i,e),t.onAnchorUpdatedObservable.notifyObservers(i)}}else{var o={id:l++,xrAnchor:r},s=t._updateAnchorWithXRFrame(r,o,e);t._trackedAnchors.push(s),t.onAnchorAddedObservable.notifyObservers(s)}}),this._lastFrameDetected=r)}},t.prototype._findIndexInAnchorArray=function(e){for(var t=0;tn/10&&(s.isVisible=!0),(a+=t._scene.getEngine().getDeltaTime())>=n)t._scene.simulatePointerDown(r.pick,{pointerId:r.id}),c=!0,t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id}),s.isVisible=!1;else{var e=1-a/n;s.scaling.set(e,e,e)}else c=!1,a=0;t._scene.simulatePointerMove(r.pick,{pointerId:r.id}),o=r.pick}}),void 0!==this._options.renderingGroupId&&(s.renderingGroupId=this._options.renderingGroupId),e.onDisposeObservable.addOnce(function(){r.pick&&!t._options.disablePointerUpOnTouchOut&&c&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id}),s.dispose()})},t.prototype._attachScreenRayMode=function(e){var t=this,r=this._controllers[e.uniqueId],n=!1;r.onFrameObserver=this._xrSessionManager.onXRFrameObservable.add(function(){!r.pick||t._options.disablePointerUpOnTouchOut&&n||(n?t._scene.simulatePointerMove(r.pick,{pointerId:r.id}):(t._scene.simulatePointerDown(r.pick,{pointerId:r.id}),n=!0,t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id})))}),e.onDisposeObservable.addOnce(function(){r.pick&&n&&!t._options.disablePointerUpOnTouchOut&&t._scene.simulatePointerUp(r.pick,{pointerId:r.id})})},t.prototype._attachTrackedPointerRayMode=function(e){var t=this;e.onMotionControllerInitObservable.add(function(r){if(t._options.forceGazeMode)return t._attachGazeMode(e);var n=t._controllers[e.uniqueId];t._options.overrideButtonId&&(n.selectionComponent=r.getComponent(t._options.overrideButtonId)),n.selectionComponent||(n.selectionComponent=r.getMainComponent()),n.onFrameObserver=t._xrSessionManager.onXRFrameObservable.add(function(){n.selectionComponent&&n.selectionComponent.pressed?(n.selectionMesh.material.emissiveColor=t.selectionMeshPickedColor,n.laserPointer.material.emissiveColor=t.laserPointerPickedColor):(n.selectionMesh.material.emissiveColor=t.selectionMeshDefaultColor,n.laserPointer.material.emissiveColor=t.lasterPointerDefaultColor),n.laserPointer.isVisible=t.displayLaserPointer,n.laserPointer.material.disableLighting=t.disablePointerLighting,n.selectionMesh.material.disableLighting=t.disableSelectionMeshLighting,n.pick&&t._scene.simulatePointerMove(n.pick,{pointerId:n.id})}),n.onButtonChangedObserver=n.selectionComponent.onButtonStateChangedObservable.add(function(e){if(e.changes.pressed){var r=e.changes.pressed.current;n.pick&&(r?t._scene.simulatePointerDown(n.pick,{pointerId:n.id}):t._scene.simulatePointerUp(n.pick,{pointerId:n.id}))}})})},t.prototype._convertNormalToDirectionOfRay=function(e,t){e&&(Math.acos(o.Vector3.Dot(e,t.direction))n},t.prototype._updatePointerDistance=function(e,t){void 0===t&&(t=100),e.scaling.y=t,e.position.z=t/2+.05},t._idCounter=0,t.Name=i.WebXRFeatureName.POINTER_SELECTION,t.Version=1,t}(f.WebXRAbstractFeature);i.WebXRFeaturesManager.AddWebXRFeature(m.Name,function(e,t){return function(){return new m(e,t)}},m.Version,!0)},"./XR/features/WebXRControllerTeleportation.ts": /*!*****************************************************!*\ !*** ./XR/features/WebXRControllerTeleportation.ts ***! \*****************************************************/ /*! exports provided: WebXRMotionControllerTeleportation */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRMotionControllerTeleportation",function(){return b});var n=r(/*! tslib */"../node_modules/tslib/tslib.es6.js"),i=r(/*! ../webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),o=r(/*! ../motionController/webXRControllerComponent */"./XR/motionController/webXRControllerComponent.ts"),s=r(/*! ../../Maths/math.vector */"./Maths/math.vector.ts"),a=r(/*! ../../Culling/ray */"./Culling/ray.ts"),c=r(/*! ../../Materials/Textures/dynamicTexture */"./Materials/Textures/dynamicTexture.ts"),l=r(/*! ../../Meshes/Builders/cylinderBuilder */"./Meshes/Builders/cylinderBuilder.ts"),u=r(/*! ../../Animations/easing */"./Animations/easing.ts"),h=r(/*! ../../Animations/animation */"./Animations/animation.ts"),d=r(/*! ../../Maths/math.axis */"./Maths/math.axis.ts"),f=r(/*! ../../Materials/standardMaterial */"./Materials/standardMaterial.ts"),p=r(/*! ../../Meshes/Builders/groundBuilder */"./Meshes/Builders/groundBuilder.ts"),m=r(/*! ../../Meshes/Builders/torusBuilder */"./Meshes/Builders/torusBuilder.ts"),g=r(/*! ../../Maths/math.path */"./Maths/math.path.ts"),_=r(/*! ../../Meshes/Builders/linesBuilder */"./Meshes/Builders/linesBuilder.ts"),v=r(/*! ./WebXRAbstractFeature */"./XR/features/WebXRAbstractFeature.ts"),A=r(/*! ../../Maths/math.color */"./Maths/math.color.ts"),y=r(/*! ../../Rendering/utilityLayerRenderer */"./Rendering/utilityLayerRenderer.ts"),b=function(e){function t(t,r){var n=e.call(this,t)||this;return n._options=r,n._controllers={},n._snappedToPoint=!1,n._tmpRay=new a.Ray(new s.Vector3,new s.Vector3),n._tmpVector=new s.Vector3,n.backwardsMovementEnabled=!0,n.backwardsTeleportationDistance=.7,n.parabolicCheckRadius=5,n.parabolicRayEnabled=!0,n.rotationAngle=Math.PI/8,n.rotationEnabled=!0,n._attachController=function(e){if(!n._controllers[e.uniqueId]){n._controllers[e.uniqueId]={xrController:e,teleportationState:{forward:!1,backwards:!1,rotating:!1,currentRotation:0,baseRotation:0}};var t=n._controllers[e.uniqueId];e.onMotionControllerInitObservable.addOnce(function(){if(e.motionController){var r=e.motionController.getComponentOfType(o.WebXRControllerComponent.THUMBSTICK_TYPE)||e.motionController.getComponentOfType(o.WebXRControllerComponent.TOUCHPAD_TYPE);if(!r||n._options.useMainComponentOnly){var i=e.motionController.getMainComponent();if(!i)return;t.onButtonChangedObserver=i.onButtonStateChangedObservable.add(function(){if(i.changes.pressed)if(i.changes.pressed.current){t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y,t.teleportationState.currentRotation=0;var r=n._options.timeToTeleport||3e3,o=0,s=n._xrSessionManager.onXRFrameObservable.add(function(){i.pressed?((o+=n._xrSessionManager.scene.getEngine().getDeltaTime())>=r&&n._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&n._teleportForward(e.uniqueId),o>=r&&n._xrSessionManager.onXRFrameObservable.remove(s)):n._xrSessionManager.onXRFrameObservable.remove(s)})}else t.teleportationState.forward=!1,n._currentTeleportationControllerId=""})}else t.onButtonChangedObserver=r.onButtonStateChangedObservable.add(function(){n._currentTeleportationControllerId===t.xrController.uniqueId&&t.teleportationState.forward&&!r.touched&&n._teleportForward(e.uniqueId)}),t.onAxisChangedObserver=r.onAxisValueChangedObservable.add(function(e){if(e.y<=.7&&t.teleportationState.backwards&&(t.teleportationState.backwards=!1),e.y>.7&&!t.teleportationState.forward&&n.backwardsMovementEnabled&&!n.snapPointsOnly&&!t.teleportationState.backwards){t.teleportationState.backwards=!0,n._tmpVector.set(0,0,n.backwardsTeleportationDistance),n._tmpVector.rotateByQuaternionToRef(n._options.xrInput.xrCamera.rotationQuaternion,n._tmpVector),n._tmpVector.addInPlace(n._options.xrInput.xrCamera.position),n._options.xrInput.xrCamera.position.subtractToRef(n._tmpVector,n._tmpVector),n._tmpRay.origin.copyFrom(n._tmpVector),n._tmpRay.direction.set(0,-1,0);var r=n._xrSessionManager.scene.pickWithRay(n._tmpRay,function(e){return-1!==n._floorMeshes.indexOf(e)});r&&r.pickedPoint&&n._options.xrInput.xrCamera.position.addInPlace(r.pickedPoint)}if(e.y<-.7&&!n._currentTeleportationControllerId&&!t.teleportationState.rotating&&(t.teleportationState.forward=!0,n._currentTeleportationControllerId=t.xrController.uniqueId,t.teleportationState.baseRotation=n._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y),e.x){if(t.teleportationState.forward)n._currentTeleportationControllerId===t.xrController.uniqueId&&(n.rotationEnabled?setTimeout(function(){t.teleportationState.currentRotation=Math.atan2(e.x,-e.y)}):t.teleportationState.currentRotation=0);else if(!t.teleportationState.rotating&&Math.abs(e.x)>.7){t.teleportationState.rotating=!0;var i=n.rotationAngle*(e.x>0?1:-1);n._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(s.Quaternion.FromEulerAngles(0,i,0))}}else t.teleportationState.rotating=!1})}})}},n._options.teleportationTargetMesh||n._createDefaultTargetMesh(),n._floorMeshes=n._options.floorMeshes||[],n._snapToPositions=n._options.snapPositions||[],n._setTargetMeshVisibility(!1),n}return Object(n.__extends)(t,e),Object.defineProperty(t.prototype,"snapPointsOnly",{get:function(){return!!this._options.snapPointsOnly},set:function(e){this._options.snapPointsOnly=e},enumerable:!0,configurable:!0}),t.prototype.addFloorMesh=function(e){this._floorMeshes.push(e)},t.prototype.addSnapPoint=function(e){this._snapToPositions.push(e)},t.prototype.attach=function(){var t=this;return!!e.prototype.attach.call(this)&&(this._options.xrInput.controllers.forEach(this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable,this._attachController),this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable,function(e){t._detachController(e.uniqueId)}),!0)},t.prototype.detach=function(){var t=this;return!!e.prototype.detach.call(this)&&(Object.keys(this._controllers).forEach(function(e){t._detachController(e)}),this._setTargetMeshVisibility(!1),!0)},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._options.teleportationTargetMesh&&this._options.teleportationTargetMesh.dispose(!1,!0)},t.prototype.removeFloorMesh=function(e){var t=this._floorMeshes.indexOf(e);-1!==t&&this._floorMeshes.splice(t,1)},t.prototype.removeFloorMeshByName=function(e){var t=this._xrSessionManager.scene.getMeshByName(e);t&&this.removeFloorMesh(t)},t.prototype.removeSnapPoint=function(e){var t=this._snapToPositions.indexOf(e);if(-1===t)for(var r=0;re;){var r=this.rigCameras.pop();r&&r.dispose()}},t.prototype._updateReferenceSpace=function(){this.position.equals(this._referencedPosition)&&this.rotationQuaternion.equals(this._referenceQuaternion)||(this.position.subtractToRef(this._referencedPosition,this._referencedPosition),this._referenceQuaternion.conjugateInPlace(),this._referenceQuaternion.multiplyToRef(this.rotationQuaternion,this._referenceQuaternion),this._updateReferenceSpaceOffset(this._referencedPosition,this._referenceQuaternion.normalize()))},t.prototype._updateReferenceSpaceOffset=function(e,t,r){if(void 0===r&&(r=!1),this._xrSessionManager.referenceSpace&&this._xrSessionManager.currentFrame){this._xrInvPositionCache.copyFrom(e),t?this._xrInvQuaternionCache.copyFrom(t):this._xrInvQuaternionCache.copyFromFloats(0,0,0,1),this._scene.useRightHandedSystem||(this._xrInvPositionCache.z*=-1,this._xrInvQuaternionCache.z*=-1,this._xrInvQuaternionCache.w*=-1),this._xrInvPositionCache.negateInPlace(),this._xrInvQuaternionCache.conjugateInPlace(),this._xrInvPositionCache.rotateByQuaternionToRef(this._xrInvQuaternionCache,this._xrInvPositionCache),r&&(this._xrInvPositionCache.y=0);var o=new XRRigidTransform(Object(n.__assign)({},this._xrInvPositionCache),Object(n.__assign)({},this._xrInvQuaternionCache)),s=this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(o),a=this._xrSessionManager.currentFrame&&this._xrSessionManager.currentFrame.getViewerPose(s);if(a){var c=new i.Vector3;c.copyFrom(a.transform.position),this._scene.useRightHandedSystem||(c.z*=-1),this.position.subtractToRef(c,c),this._scene.useRightHandedSystem||(c.z*=-1),c.negateInPlace();var l=new XRRigidTransform(Object(n.__assign)({},c));this._xrSessionManager.referenceSpace=s.getOffsetReferenceSpace(l)}}},t}(s.FreeCamera)},"./XR/webXRDefaultExperience.ts": /*!**************************************!*\ !*** ./XR/webXRDefaultExperience.ts ***! \**************************************/ /*! exports provided: WebXRDefaultExperienceOptions, WebXRDefaultExperience */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRDefaultExperienceOptions",function(){return l}),r.d(t,"WebXRDefaultExperience",function(){return u});var n=r(/*! ./webXRExperienceHelper */"./XR/webXRExperienceHelper.ts"),i=r(/*! ./webXRInput */"./XR/webXRInput.ts"),o=r(/*! ./features/WebXRControllerPointerSelection */"./XR/features/WebXRControllerPointerSelection.ts"),s=r(/*! ./webXREnterExitUI */"./XR/webXREnterExitUI.ts"),a=r(/*! ./features/WebXRControllerTeleportation */"./XR/features/WebXRControllerTeleportation.ts"),c=r(/*! ../Misc/logger */"./Misc/logger.ts"),l=function(){},u=function(){function e(){}return e.CreateAsync=function(t,r){void 0===r&&(r={});var l=new e;return n.WebXRExperienceHelper.CreateAsync(t).then(function(e){return l.baseExperience=e,r.ignoreNativeCameraTransformation&&(l.baseExperience.camera.compensateOnFirstFrame=!1),l.input=new i.WebXRInput(e.sessionManager,e.camera,r.inputOptions),l.pointerSelection=l.baseExperience.featuresManager.enableFeature(o.WebXRControllerPointerSelection.Name,r.useStablePlugins?"stable":"latest",{xrInput:l.input}),r.disableTeleportation||(l.teleportation=l.baseExperience.featuresManager.enableFeature(a.WebXRMotionControllerTeleportation.Name,r.useStablePlugins?"stable":"latest",{floorMeshes:r.floorMeshes,xrInput:l.input}),l.teleportation.setSelectionFeature(l.pointerSelection)),l.renderTarget=l.baseExperience.sessionManager.getWebXRRenderTarget(r.outputCanvasOptions),r.disableDefaultUI?void 0:(r.uiOptions&&(r.uiOptions.renderTarget=r.uiOptions.renderTarget||l.renderTarget),s.WebXREnterExitUI.CreateAsync(t,l.baseExperience,r.uiOptions||{renderTarget:l.renderTarget}).then(function(e){l.enterExitUI=e}))}).then(function(){return l}).catch(function(e){return c.Logger.Error("Error initializing XR"),c.Logger.Error(e),l})},e.prototype.dispose=function(){this.baseExperience&&this.baseExperience.dispose(),this.input&&this.input.dispose(),this.enterExitUI&&this.enterExitUI.dispose(),this.renderTarget&&this.renderTarget.dispose()},e}()},"./XR/webXREnterExitUI.ts": /*!********************************!*\ !*** ./XR/webXREnterExitUI.ts ***! \********************************/ /*! exports provided: WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXREnterExitUIButton",function(){return 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(/*! ./webXRTypes */"./XR/webXRTypes.ts"),s=function(){function e(e,t,r){this.element=e,this.sessionMode=t,this.referenceSpaceType=r}return e.prototype.update=function(e){},e}(),a=function(){},c=function(){function e(e,t){var r=this;if(this.scene=e,this.options=t,this._activeButton=null,this._buttons=[],this.activeButtonChangedObservable=new i.Observable,this._overlay=document.createElement("div"),this._overlay.style.cssText="z-index:11;position: absolute; right: 20px;bottom: 50px;",t.customButtons)this._buttons=t.customButtons;else{var n=t.sessionMode||"immersive-vr",o=t.referenceSpaceType||"local-floor",a=".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url("+(window.SVGSVGElement?"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A":"https://cdn.babylonjs.com/Assets/vrButton.png")+"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }";a+='.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: "EXIT"} .xr-error::after { content: "ERROR"}';var c=document.createElement("style");c.appendChild(document.createTextNode(a)),document.getElementsByTagName("head")[0].appendChild(c);var l=document.createElement("button");l.className="babylonVRicon",l.title=n+" - "+o,this._buttons.push(new s(l,n,o)),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",l.className="babylonVRicon"+(e===this?" vrdisplaypresenting":"")},this._updateButtons(null)}var u=e.getEngine().getInputElement();u&&u.parentNode&&(u.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.sessionManager.isSessionSupportedAsync(e.sessionMode)});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 Object(n.__awaiter)(s,void 0,void 0,function(){var e,s;return Object(n.__generator)(this,function(n){switch(n.label){case 0:return r.state!=o.WebXRState.IN_XR?[3,2]:[4,r.exitXRAsync()];case 1:return n.sent(),a._updateButtons(null),[3,6];case 2:if(r.state!=o.WebXRState.NOT_IN_XR)return[3,6];if(!i.renderTarget)return[3,6];n.label=3;case 3:return n.trys.push([3,5,,6]),[4,r.enterXRAsync(a._buttons[t].sessionMode,a._buttons[t].referenceSpaceType,i.renderTarget)];case 4:return n.sent(),a._updateButtons(a._buttons[t]),[3,6];case 5:return n.sent(),a._updateButtons(null),e=a._buttons[t].element,s=e.title,e.title="Error entering XR session : "+s,e.classList.add("xr-error"),[3,6];case 6:return[2]}})})})}),a})},e.prototype.dispose=function(){var e=this.scene.getEngine().getInputElement();e&&e.parentNode&&e.parentNode.contains(this._overlay)&&e.parentNode.removeChild(this._overlay),this.activeButtonChangedObservable.clear()},e.prototype._updateButtons=function(e){var t=this;this._activeButton=e,this._buttons.forEach(function(e){e.update(t._activeButton)}),this.activeButtonChangedObservable.notifyObservers(this._activeButton)},e}()},"./XR/webXRExperienceHelper.ts": /*!*************************************!*\ !*** ./XR/webXRExperienceHelper.ts ***! \*************************************/ /*! exports provided: WebXRExperienceHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRExperienceHelper",function(){return l});var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ./webXRSessionManager */"./XR/webXRSessionManager.ts"),o=r(/*! ./webXRCamera */"./XR/webXRCamera.ts"),s=r(/*! ./webXRTypes */"./XR/webXRTypes.ts"),a=r(/*! ./webXRFeaturesManager */"./XR/webXRFeaturesManager.ts"),c=r(/*! ../Misc/logger */"./Misc/logger.ts"),l=function(){function e(e){var t=this;this.scene=e,this._nonVRCamera=null,this._originalSceneAutoClear=!0,this._supported=!1,this.onInitialXRPoseSetObservable=new n.Observable,this.onStateChangedObservable=new n.Observable,this.state=s.WebXRState.NOT_IN_XR,this.sessionManager=new i.WebXRSessionManager(e),this.camera=new o.WebXRCamera("",e,this.sessionManager),this.featuresManager=new a.WebXRFeaturesManager(this.sessionManager),e.onDisposeObservable.add(function(){t.exitXRAsync()})}return e.CreateAsync=function(t){var r=new e(t);return r.sessionManager.initializeAsync().then(function(){return r._supported=!0,r}).catch(function(e){throw r._setState(s.WebXRState.NOT_IN_XR),r.dispose(),e})},e.prototype.dispose=function(){this.camera.dispose(),this.onStateChangedObservable.clear(),this.onInitialXRPoseSetObservable.clear(),this.sessionManager.dispose(),this._nonVRCamera&&(this.scene.activeCamera=this._nonVRCamera)},e.prototype.enterXRAsync=function(e,t,r){var n=this;if(void 0===r&&(r=this.sessionManager.getWebXRRenderTarget()),!this._supported)throw"WebXR not supported in this browser or environment";this._setState(s.WebXRState.ENTERING_XR);var i={optionalFeatures:"viewer"!==t&&"local"!==t?[t]:[]};return"immersive-ar"===e&&"local"!==t&&c.Logger.Warn("We recommend using 'local' reference space type when using 'immersive-ar' session mode"),this.sessionManager.isSessionSupportedAsync(e).then(function(t){if(!t)throw new Error('Session mode "'+e+'" not supported in browser');return n.sessionManager.initializeSessionAsync(e,i)}).then(function(){return n.sessionManager.setReferenceSpaceTypeAsync(t)}).then(function(){return r.initializeXRLayerAsync(n.sessionManager.session)}).then(function(){return n.sessionManager.updateRenderStateAsync({depthFar:n.camera.maxZ,depthNear:n.camera.minZ,baseLayer:r.xrLayer})}).then(function(){return n.sessionManager.runXRRenderLoop(),n._originalSceneAutoClear=n.scene.autoClear,n._nonVRCamera=n.scene.activeCamera,n.scene.autoClear=!1,n.scene.activeCamera=n.camera,"immersive-ar"!==e?n._nonXRToXRCamera():n.camera.compensateOnFirstFrame=!1,n.sessionManager.onXRSessionEnded.addOnce(function(){n.camera.rigCameras.forEach(function(e){e.outputRenderTarget=null}),n.scene.autoClear=n._originalSceneAutoClear,n.scene.activeCamera=n._nonVRCamera,"immersive-ar"!==e&&n.camera.compensateOnFirstFrame&&(n._nonVRCamera.setPosition?n._nonVRCamera.setPosition(n.camera.position):n._nonVRCamera.position.copyFrom(n.camera.position)),n._setState(s.WebXRState.NOT_IN_XR)}),n.sessionManager.onXRFrameObservable.addOnce(function(){n._setState(s.WebXRState.IN_XR)}),n.sessionManager}).catch(function(e){throw console.log(e),console.log(e.message),n._setState(s.WebXRState.NOT_IN_XR),e})},e.prototype.exitXRAsync=function(){return this._setState(s.WebXRState.EXITING_XR),this.sessionManager.exitXRAsync()},e.prototype._nonXRToXRCamera=function(){this.camera.setTransformationFromNonVRCamera(this._nonVRCamera),this.onInitialXRPoseSetObservable.notifyObservers(this.camera)},e.prototype._setState=function(e){this.state!==e&&(this.state=e,this.onStateChangedObservable.notifyObservers(this.state))},e}()},"./XR/webXRFeaturesManager.ts": /*!************************************!*\ !*** ./XR/webXRFeaturesManager.ts ***! \************************************/ /*! exports provided: WebXRFeatureName, WebXRFeaturesManager */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRFeatureName",function(){return n}),r.d(t,"WebXRFeaturesManager",function(){return i});var n=function(){function e(){}return e.ANCHOR_SYSTEM="xr-anchor-system",e.BACKGROUND_REMOVER="xr-background-remover",e.HIT_TEST="xr-hit-test",e.PHYSICS_CONTROLLERS="xr-physics-controller",e.PLANE_DETECTION="xr-plane-detection",e.POINTER_SELECTION="xr-controller-pointer-selection",e.TELEPORTATION="xr-controller-teleportation",e}(),i=function(){function e(e){var t=this;this._xrSessionManager=e,this._features={},this._xrSessionManager.onXRSessionInit.add(function(){t.getEnabledFeatures().forEach(function(e){var r=t._features[e];!r.enabled||r.featureImplementation.attached||r.featureImplementation.disableAutoAttach||t.attachFeature(e)})}),this._xrSessionManager.onXRSessionEnded.add(function(){t.getEnabledFeatures().forEach(function(e){var r=t._features[e];r.enabled&&r.featureImplementation.attached&&t.detachFeature(e)})})}return e.AddWebXRFeature=function(e,t,r,n){void 0===r&&(r=1),void 0===n&&(n=!1),this._AvailableFeatures[e]=this._AvailableFeatures[e]||{latest:r},r>this._AvailableFeatures[e].latest&&(this._AvailableFeatures[e].latest=r),n&&(this._AvailableFeatures[e].stable=r),this._AvailableFeatures[e][r]=t},e.ConstructFeature=function(e,t,r,n){void 0===t&&(t=1);var i=this._AvailableFeatures[e][t];if(!i)throw new Error("feature not found");return i(r,n)},e.GetAvailableFeatures=function(){return Object.keys(this._AvailableFeatures)},e.GetAvailableVersions=function(e){return Object.keys(this._AvailableFeatures[e])},e.GetLatestVersionOfFeature=function(e){return this._AvailableFeatures[e]&&this._AvailableFeatures[e].latest||-1},e.GetStableVersionOfFeature=function(e){return this._AvailableFeatures[e]&&this._AvailableFeatures[e].stable||-1},e.prototype.attachFeature=function(e){var t=this._features[e];t&&t.enabled&&!t.featureImplementation.attached&&t.featureImplementation.attach()},e.prototype.detachFeature=function(e){var t=this._features[e];t&&t.featureImplementation.attached&&t.featureImplementation.detach()},e.prototype.disableFeature=function(e){var t="string"==typeof e?e:e.Name,r=this._features[t];return!(!r||!r.enabled)&&(r.enabled=!1,this.detachFeature(t),r.featureImplementation.dispose(),!0)},e.prototype.dispose=function(){var e=this;this.getEnabledFeatures().forEach(function(t){e.disableFeature(t),e._features[t].featureImplementation.dispose()})},e.prototype.enableFeature=function(t,r,n,i){void 0===r&&(r="latest"),void 0===n&&(n={}),void 0===i&&(i=!0);var o="string"==typeof t?t:t.Name,s=0;if("string"==typeof r){if(!r)throw new Error("Error in provided version - "+o+" ("+r+")");if(-1===(s="stable"===r?e.GetStableVersionOfFeature(o):"latest"===r?e.GetLatestVersionOfFeature(o):+r)||isNaN(s))throw new Error("feature not found - "+o+" ("+r+")")}else s=r;var a=this._features[o],c=e.ConstructFeature(o,s,this._xrSessionManager,n);if(!c)throw new Error("feature not found - "+o);return a&&this.disableFeature(o),this._features[o]={featureImplementation:c(),enabled:!0,version:s},i?this._xrSessionManager.session&&!a.featureImplementation.attached&&this.attachFeature(o):this._features[o].featureImplementation.disableAutoAttach=!0,this._features[o].featureImplementation},e.prototype.getEnabledFeature=function(e){return this._features[e]&&this._features[e].featureImplementation},e.prototype.getEnabledFeatures=function(){return Object.keys(this._features)},e._AvailableFeatures={},e}()},"./XR/webXRInput.ts": /*!**************************!*\ !*** ./XR/webXRInput.ts ***! \**************************/ /*! exports provided: WebXRInput */function(e,t,r){"use strict";r.r(t),r.d(t,"WebXRInput",function(){return s});var n=r(/*! ../Misc/observable */"./Misc/observable.ts"),i=r(/*! ./webXRInputSource */"./XR/webXRInputSource.ts"),o=r(/*! ./motionController/webXRMotionControllerManager */"./XR/motionController/webXRMotionControllerManager.ts"),s=function(){function e(e,t,r){var i=this;void 0===r&&(r={}),this.xrSessionManager=e,this.xrCamera=t,this.options=r,this.controllers=[],this.onControllerAddedObservable=new n.Observable,this.onControllerRemovedObservable=new n.Observable,this._onInputSourcesChange=function(e){i._addAndRemoveControllers(e.added,e.removed)},this._sessionEndedObserver=this.xrSessionManager.onXRSessionEnded.add(function(){i._addAndRemoveControllers([],i.controllers.map(function(e){return e.inputSource}))}),this._sessionInitObserver=this.xrSessionManager.onXRSessionInit.add(function(e){e.addEventListener("inputsourceschange",i._onInputSourcesChange)}),this._frameObserver=this.xrSessionManager.onXRFrameObservable.add(function(e){i.controllers.forEach(function(t){t.updateFromXRFrame(e,i.xrSessionManager.referenceSpace)})}),this.options.customControllersRepositoryURL&&(o.WebXRMotionControllerManager.BaseRepositoryUrl=this.options.customControllersRepositoryURL),this.options.disableOnlineControllerRepository?o.WebXRMotionControllerManager.UseOnlineRepository=!1:(o.WebXRMotionControllerManager.UseOnlineRepository=!0,o.WebXRMotionControllerManager.UpdateProfilesList())}return e.prototype._addAndRemoveControllers=function(e,t){for(var r=this,n=this.controllers.map(function(e){return e.inputSource}),o=0,s=e;o-1&&t.animations.splice(o,1)}},i=0,o=e.animations;i0){for(var e=0,t=this._transientComponents;e0)return!1;for(e=0;e0,i=0,o=this._isReadyForMeshStage;i0)for(var s=0,a=this.activeCameras;s0},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;return this._registerTransientComponents(),this.isReady()?(this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1)):this._isDisposed?(this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1)):void(this._executeWhenReadyTimeoutId=setTimeout(function(){e._checkIsReady()},150))},Object.defineProperty(t.prototype,"animatables",{get:function(){return this._activeAnimatables},enumerable:!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),this._frustumPlanes?I.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=I.Frustum.GetPlanes(this._transformMatrix),this._multiviewSceneUbo&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(r,n):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.update()))},t.prototype.getSceneUniformBuffer=function(){return this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo},t.prototype.getUniqueId=function(){return D.UniqueIdGenerator.UniqueId},t.prototype.addMesh=function(e,t){var r=this;void 0===t&&(t=!1),this._blockEntityCollection||(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),this.onNewMeshAddedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){r.addMesh(e)}))},t.prototype.removeMesh=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.meshes.indexOf(e);return-1!==n&&(this.meshes[n]=this.meshes[this.meshes.length-1],this.meshes.pop(),e.parent||e._removeFromSceneRootNodes()),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){r.removeMesh(e)}),n},t.prototype.addTransformNode=function(e){this._blockEntityCollection||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))},t.prototype.removeTransformNode=function(e){var t=e._indexInSceneTransformNodesArray;if(-1!==t){if(t!==this.transformNodes.length-1){var r=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=r,r._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t},t.prototype.removeSkeleton=function(e){var t=this.skeletons.indexOf(e);return-1!==t&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e)),t},t.prototype.removeMorphTargetManager=function(e){var t=this.morphTargetManagers.indexOf(e);return-1!==t&&this.morphTargetManagers.splice(t,1),t},t.prototype.removeLight=function(e){var t=this.lights.indexOf(e);if(-1!==t){for(var r=0,n=this.meshes;r0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t},t.prototype.removeParticleSystem=function(e){var t=this.particleSystems.indexOf(e);return-1!==t&&this.particleSystems.splice(t,1),t},t.prototype.removeAnimation=function(e){var t=this.animations.indexOf(e);return-1!==t&&this.animations.splice(t,1),t},t.prototype.stopAnimation=function(e,t,r){},t.prototype.removeAnimationGroup=function(e){var t=this.animationGroups.indexOf(e);return-1!==t&&this.animationGroups.splice(t,1),t},t.prototype.removeMultiMaterial=function(e){var t=this.multiMaterials.indexOf(e);return-1!==t&&this.multiMaterials.splice(t,1),t},t.prototype.removeMaterial=function(e){var t=e._indexInSceneMaterialArray;if(-1!==t&&t=0;t--)if(this.materials[t].id===e)return this.materials[t];return null},t.prototype.getMaterialByName=function(e){for(var t=0;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=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null},t.prototype.getSkeletonByUniqueId=function(e){for(var t=0;t0&&0!=(s.layerMask&this.activeCamera.layerMask)&&(this._skipFrustumClipping||s.alwaysSelectAsActiveMesh||s.isInFrustum(this._frustumPlanes))&&(this._activeMeshes.push(s),this.activeCamera._activeMeshes.push(s),a!==s&&a._activate(this._renderId,!1),s._activate(this._renderId,!1)&&(s.isAnInstance?s._internalAbstractMeshDataInfo._actAsRegularMesh&&(a=s):a._internalAbstractMeshDataInfo._onlyForInstances=!1,a._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(s,a)),s._postActivate()))}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(var c=0;c0)for(var i=this.getActiveSubMeshCandidates(t),o=i.length,s=0;s1)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;n0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets);for(var s=0,a=this._gatherActiveCameraRenderTargetsStage;s0){i.Tools.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(var l=0;l0),this._renderId++}for(var d=0,f=this._cameraDrawRenderTargetStage;d1&&this.getEngine().getCaps().multiview)return this._renderForCamera(e),void this.onAfterRenderCameraObservable.notifyObservers(e);if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else for(var t=0;t-1&&(n.trigger===M.Constants.ACTION_OnIntersectionExitTrigger&&n._executeCurrent(A.ActionEvent.CreateNew(t,void 0,o)),t.actionManager.hasSpecificTrigger(M.Constants.ACTION_OnIntersectionExitTrigger,function(e){var t=e instanceof d.AbstractMesh?e:e.mesh;return o===t})&&n.trigger!==M.Constants.ACTION_OnIntersectionExitTrigger||t._intersectionsInProgress.splice(a,1))}}}},t.prototype._advancePhysicsEngineStep=function(e){},t.prototype._animate=function(){},t.prototype.animate=function(){if(this._engine.isDeterministicLockStep()){var e=Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime))+this._timeAccumulator,r=this._engine.getTimeStep(),n=1e3/r/1e3,i=0,o=this._engine.getLockstepMaxSteps(),s=Math.floor(e/r);for(s=Math.min(s,o);e>0&&i0)for(var o=0;o0),this._intermediateRendering=!0;for(var u=0;u0),this._intermediateRendering=!1,this._renderId++}this.activeCamera=l,this._bindFrameBuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(var d=0,p=this._beforeClearStage;d0)for(o=0;o0&&this._engine.clear(null,!1,!0,!0),this._processSubCameras(this.activeCameras[o]);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera)}this._checkIntersections();for(var _=0,v=this._afterRenderStage;_-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=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]=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 m(){for(var e=[],t=0;t1||a(e,t)})})}function a(e,t){try{(r=i[e](t)).value instanceof _?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 A(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:_(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function y(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 b(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function T(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 M(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(/*! ./mtlFileLoader */"./OBJ/mtlFileLoader.ts");r.d(t,"MTLFileLoader",function(){return n.MTLFileLoader});var i=r(/*! ./objFileLoader */"./OBJ/objFileLoader.ts");r.d(t,"OBJFileLoader",function(){return i.OBJFileLoader})},"./OBJ/mtlFileLoader.ts": /*!******************************!*\ !*** ./OBJ/mtlFileLoader.ts ***! \******************************/ /*! exports provided: MTLFileLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"MTLFileLoader",function(){return i});var n=r(/*! babylonjs/Maths/math.color */"babylonjs/Misc/tools"),i=function(){function e(){this.materials=[]}return e.prototype.parseMTL=function(t,r,i,o){if(!(r instanceof ArrayBuffer)){for(var s,a=r.split("\n"),c=/\s+/,l=null,u=0;u=0?h.substring(0,d):h;f=f.toLowerCase();var p=d>=0?h.substring(d+1).trim():"";"newmtl"===f?(l&&this.materials.push(l),t._blockEntityCollection=o,l=new n.StandardMaterial(p,t),t._blockEntityCollection=!1):"kd"===f&&l?(s=p.split(c,3).map(parseFloat),l.diffuseColor=n.Color3.FromArray(s)):"ka"===f&&l?(s=p.split(c,3).map(parseFloat),l.ambientColor=n.Color3.FromArray(s)):"ks"===f&&l?(s=p.split(c,3).map(parseFloat),l.specularColor=n.Color3.FromArray(s)):"ke"===f&&l?(s=p.split(c,3).map(parseFloat),l.emissiveColor=n.Color3.FromArray(s)):"ns"===f&&l?l.specularPower=parseFloat(p):"d"===f&&l?l.alpha=parseFloat(p):"map_ka"===f&&l?l.ambientTexture=e._getTexture(i,p,t):"map_kd"===f&&l?l.diffuseTexture=e._getTexture(i,p,t):"map_ks"===f&&l?l.specularTexture=e._getTexture(i,p,t):"map_ns"===f||("map_bump"===f&&l?l.bumpTexture=e._getTexture(i,p,t):"map_d"===f&&l&&(l.opacityTexture=e._getTexture(i,p,t)))}}l&&this.materials.push(l)}},e._getTexture=function(t,r,i){if(!r)return null;var o=t;if("file:"===t){var s=r.lastIndexOf("\\");-1===s&&(s=r.lastIndexOf("/")),o+=s>-1?r.substr(s+1):r}else o+=r;return new n.Texture(o,i,!1,e.INVERT_TEXTURE_Y)},e.INVERT_TEXTURE_Y=!0,e}()},"./OBJ/objFileLoader.ts": /*!******************************!*\ !*** ./OBJ/objFileLoader.ts ***! \******************************/ /*! exports provided: OBJFileLoader */function(e,t,r){"use strict";r.r(t),r.d(t,"OBJFileLoader",function(){return o});var n=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/tools"),i=r(/*! ./mtlFileLoader */"./OBJ/mtlFileLoader.ts"),o=function(){function e(t){this.name="obj",this.extensions=".obj",this.obj=/^o/,this.group=/^g/,this.mtllib=/^mtllib /,this.usemtl=/^usemtl /,this.smooth=/^s /,this.vertexPattern=/v( +[\d|\.|\+|\-|e|E]+){3,7}/,this.normalPattern=/vn( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,this.uvPattern=/vt( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,this.facePattern1=/f\s+(([\d]{1,}[\s]?){3,})+/,this.facePattern2=/f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,this.facePattern3=/f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,this.facePattern4=/f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/,this.facePattern5=/f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/,this._forAssetContainer=!1,this._meshLoadOptions=t||e.currentMeshLoadOptions}return Object.defineProperty(e,"INVERT_TEXTURE_Y",{get:function(){return i.MTLFileLoader.INVERT_TEXTURE_Y},set:function(e){i.MTLFileLoader.INVERT_TEXTURE_Y=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"currentMeshLoadOptions",{get:function(){return{ComputeNormals:e.COMPUTE_NORMALS,ImportVertexColors:e.IMPORT_VERTEX_COLORS,InvertY:e.INVERT_Y,InvertTextureY:e.INVERT_TEXTURE_Y,UVScaling:e.UV_SCALING,MaterialLoadingFailsSilently:e.MATERIAL_LOADING_FAILS_SILENTLY,OptimizeWithUV:e.OPTIMIZE_WITH_UV,SkipMaterials:e.SKIP_MATERIALS}},enumerable:!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){var s=this;return this._forAssetContainer=!0,this.importMeshAsync(null,e,t,r).then(function(t){var r=new n.AssetContainer(e);return t.meshes.forEach(function(e){return r.meshes.push(e)}),t.meshes.forEach(function(e){var t=e.material;t&&(-1==r.materials.indexOf(t)&&(r.materials.push(t),t.getActiveTextures().forEach(function(e){-1==r.textures.indexOf(e)&&r.textures.push(e)})))}),s._forAssetContainer=!1,r}).catch(function(e){throw s._forAssetContainer=!1,e})},e.prototype._parseSolid=function(t,r,o,s){for(var a,c=this,l=[],u=[],h=[],d=[],f=[],p=[],m=[],g=[],_=[],v=[],A=[],y=0,b=!1,T=[],M=[],x=[],P=[],E=[],C="",S="",R=new i.MTLFileLoader,O=1,I=!0,D=new n.Color4(.5,.5,.5,1),B=function(e,t,r,n,i,o,s){var a;-1===(a=c._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}(A,[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]}(A,[e,r]))?(p.push(m.length),m.push(n),g.push(i),v.push(o),void 0!==s&&_.push(s),A[e].normals.push(r),A[e].idx.push(y++),c._meshLoadOptions.OptimizeWithUV&&A[e].uv.push(t)):p.push(a)},w=function(){for(var e=0;e0&&(a=f[f.length-1],w(),p.reverse(),a.indices=p.slice(),a.positions=T.slice(),a.normals=x.slice(),a.uvs=P.slice(),!0===c._meshLoadOptions.ImportVertexColors&&(a.colors=M.slice()),p=[],T=[],M=[],x=[],P=[])},G=o.split("\n"),j=0;j=7?d.push(new n.Color4(parseFloat(H[4]),parseFloat(H[5]),parseFloat(H[6]),7===H.length||void 0===H[7]?1:parseFloat(H[7]))):d.push(D));else if(null!==(H=this.normalPattern.exec(X)))u.push(new n.Vector3(parseFloat(H[1]),parseFloat(H[2]),parseFloat(H[3])));else if(null!==(H=this.uvPattern.exec(X)))h.push(new n.Vector2(parseFloat(H[1])*e.UV_SCALING.x,parseFloat(H[2])*e.UV_SCALING.y));else if(null!==(H=this.facePattern3.exec(X)))V(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern4.exec(X)))k(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern5.exec(X)))z(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern2.exec(X)))F(H[1].trim().split(" "),1);else if(null!==(H=this.facePattern1.exec(X)))N(H[1].trim().split(" "),1);else if(this.group.test(X)||this.obj.test(X)){var W={name:X.substring(2).trim(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:""};U(),f.push(W),b=!0,I=!0,O=1}else if(this.usemtl.test(X)){if(C=X.substring(7).trim(),!I||!b){U();W={name:"mesh_mm"+O.toString(),indices:void 0,positions:void 0,normals:void 0,uvs:void 0,colors:void 0,materialName:C};O++,f.push(W),b=!0}b&&I&&(f[f.length-1].materialName=C,I=!1)}else this.mtllib.test(X)?S=X.substring(7).trim():this.smooth.test(X)||console.log("Unhandled expression at line : "+X)}b&&(a=f[f.length-1],p.reverse(),w(),a.indices=p,a.positions=T,a.normals=x,a.uvs=P,!0===this._meshLoadOptions.ImportVertexColors&&(a.colors=M)),b||(p.reverse(),w(),f.push({name:n.Geometry.RandomId(),indices:p,positions:T,colors:M,normals:x,uvs:P,materialName:C}));for(var Y=[],Q=new Array,K=0;K-1;)u.push(a),l=a+1;if(-1===a&&0===u.length)R.materials[o].dispose();else for(var h=0;h127)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=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;t0&&(d=v(s,i))&&-1===a.indexOf(d)&&a.push(d),new o.Bone(l.jointName||"",n,d,M).id=i}}else o.Tools.Warn("Joint named "+t.jointNames[c]+" does not exist")}}var x=n.bones;n.bones=[];for(c=0;c1?(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),e.scene._blockEntityCollection=!1,i.subMeshes=[];var I=0;for(g=0;g0&&-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(e.scene._blockEntityCollection=e.forAssetContainer,"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().getInputElement()),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().getInputElement()),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}e.scene._blockEntityCollection=!1}}}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 m=d[d.type],g=new o.DirectionalLight(t.light,o.Vector3.Zero(),e.scene);g.name=t.name||"",m.color&&(g.diffuse=o.Color3.FromArray(m.color)),i=g}else if("point"===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){e.scene._blockEntityCollection=e.forAssetContainer;var x=new o.Mesh(t.name||"",e.scene);e.scene._blockEntityCollection=!1,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),M(e,n,i,s)}else t.translation&&t.rotation&&t.scale&&M(e,o.Vector3.FromArray(t.translation),o.Quaternion.FromArray(t.rotation),o.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(i,t);else{var P=t.translation||[0,0,0],E=t.rotation||[0,0,0,1],C=t.scale||[1,1,1];M(i,o.Vector3.FromArray(P),o.Quaternion.FromArray(E),o.Vector3.FromArray(C))}i.updateCache(!0),t.babylonNode=i}return i},P=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;ss.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;n0){var r=e.metadata=e.metadata||{};(r.gltf=r.gltf||{}).extras=t.extras}},e.prototype.dispose=function(){delete this._loader},e.prototype.loadNodeAsync=function(e,t,r){var n=this;return this._loader.loadNodeAsync(e,t,function(e){n._assignExtras(e,t),r(e)})},e.prototype.loadCameraAsync=function(e,t,r){var n=this;return this._loader.loadCameraAsync(e,t,function(e){n._assignExtras(e,t),r(e)})},e.prototype.createMaterial=function(e,t,r){var n=this._loader.createMaterial(e,t,r);return this._assignExtras(n,t),n},e}();n.GLTFLoader.RegisterExtension(i,function(e){return new o(e)})},"./glTF/2.0/Extensions/KHR_draco_mesh_compression.ts": /*!***********************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_draco_mesh_compression.ts ***! \***********************************************************/ /*! exports provided: KHR_draco_mesh_compression */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_draco_mesh_compression",function(){return s});var n=r(/*! babylonjs/Meshes/Compression/dracoCompression */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_draco_mesh_compression",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=n.DracoCompression.DecoderAvailable&&this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this.dracoCompression,delete this._loader},e.prototype._loadVertexDataAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(s,a){if(null!=t.mode){if(5!==t.mode&&4!==t.mode)throw new Error(e+": Unsupported mode "+t.mode);if(5===t.mode)throw new Error(e+": Mode "+t.mode+" is not currently supported")}var 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||n.DracoCompression.Default).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.vector */"babylonjs/Misc/tools"),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._loader=e,this.enabled=this._loader.isExtensionUsed(s)}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(s._loader.babylonScene._blockEntityCollection=s._loader._forAssetContainer,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 s._loader.babylonScene._blockEntityCollection=!1,new Error(a+": Invalid light type ("+l.type+")")}s._loader.babylonScene._blockEntityCollection=!1,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,s._loader._babylonLights.push(t),o.GLTFLoader.AddPointerMetadata(t,a),r(e)})})},e}();o.GLTFLoader.RegisterExtension(s,function(e){return new a(e)})},"./glTF/2.0/Extensions/KHR_materials_clearcoat.ts": /*!********************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_materials_clearcoat.ts ***! \********************************************************/ /*! exports provided: KHR_materials_clearcoat */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_clearcoat",function(){return s});var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_clearcoat",s=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(i,o){var s=new Array;return s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadClearCoatPropertiesAsync(i,o,r)),Promise.all(s).then(function(){})})},e.prototype._loadClearCoatPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;return r.clearCoat.isEnabled=!0,null!=t.clearcoatFactor?r.clearCoat.intensity=t.clearcoatFactor:r.clearCoat.intensity=0,t.clearcoatTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/clearcoatTexture",t.clearcoatTexture,function(e){e.name=r.name+" (ClearCoat Intensity)",r.clearCoat.texture=e})),null!=t.clearcoatRoughnessFactor?r.clearCoat.roughness=t.clearcoatRoughnessFactor:r.clearCoat.roughness=0,t.clearcoatRoughnessTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/clearcoatRoughnessTexture",t.clearcoatRoughnessTexture,function(e){e.name=r.name+" (ClearCoat Roughness)",r.clearCoat.texture=e})),t.clearcoatNormalTexture&&(i.push(this._loader.loadTextureInfoAsync(e+"/clearcoatNormalTexture",t.clearcoatNormalTexture,function(e){e.name=r.name+" (ClearCoat Normal)",r.clearCoat.bumpTexture=e})),r.invertNormalMapX=!r.getScene().useRightHandedSystem,r.invertNormalMapY=r.getScene().useRightHandedSystem,null!=t.clearcoatNormalTexture.scale&&(r.clearCoat.bumpTexture.level=t.clearcoatNormalTexture.scale)),Promise.all(i).then(function(){})},e}();i.GLTFLoader.RegisterExtension(o,function(e){return new s(e)})},"./glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts": /*!********************************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts ***! \********************************************************************/ /*! exports provided: KHR_materials_pbrSpecularGlossiness */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_pbrSpecularGlossiness",function(){return s});var n=r(/*! babylonjs/Maths/math.color */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_pbrSpecularGlossiness",s=function(){function e(e){this.name=o,this.order=200,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(i,o){var s=new Array;return s.push(n._loader.loadMaterialBasePropertiesAsync(e,t,r)),s.push(n._loadSpecularGlossinessPropertiesAsync(i,t,o,r)),n._loader.loadMaterialAlphaProperties(e,t,r),Promise.all(s).then(function(){})})},e.prototype._loadSpecularGlossinessPropertiesAsync=function(e,t,r,i){if(!(i instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var o=new Array;return i.metallic=null,i.roughness=null,r.diffuseFactor?(i.albedoColor=n.Color3.FromArray(r.diffuseFactor),i.alpha=r.diffuseFactor[3]):i.albedoColor=n.Color3.White(),i.reflectivityColor=r.specularFactor?n.Color3.FromArray(r.specularFactor):n.Color3.White(),i.microSurface=null==r.glossinessFactor?1:r.glossinessFactor,r.diffuseTexture&&o.push(this._loader.loadTextureInfoAsync(e+"/diffuseTexture",r.diffuseTexture,function(e){e.name=i.name+" (Diffuse)",i.albedoTexture=e})),r.specularGlossinessTexture&&(o.push(this._loader.loadTextureInfoAsync(e+"/specularGlossinessTexture",r.specularGlossinessTexture,function(e){e.name=i.name+" (Specular Glossiness)",i.reflectivityTexture=e})),i.reflectivityTexture.hasAlpha=!0,i.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(o).then(function(){})},e}();i.GLTFLoader.RegisterExtension(o,function(e){return new s(e)})},"./glTF/2.0/Extensions/KHR_materials_sheen.ts": /*!****************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_materials_sheen.ts ***! \****************************************************/ /*! exports provided: KHR_materials_sheen */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_sheen",function(){return s});var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_sheen",s=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(i,o){var s=new Array;return s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadSheenPropertiesAsync(i,o,r)),Promise.all(s).then(function(){})})},e.prototype._loadSheenPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;return r.sheen.isEnabled=!0,null!=t.intensityFactor?r.sheen.intensity=t.intensityFactor:r.sheen.intensity=0,null!=t.colorFactor&&(r.sheen.color=n.Color3.FromArray(t.colorFactor)),t.colorIntensityTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/sheenTexture",t.colorIntensityTexture,function(e){e.name=r.name+" (Sheen Intensity)",r.sheen.texture=e})),Promise.all(i).then(function(){})},e}();i.GLTFLoader.RegisterExtension(o,function(e){return new s(e)})},"./glTF/2.0/Extensions/KHR_materials_specular.ts": /*!*******************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_materials_specular.ts ***! \*******************************************************/ /*! exports provided: KHR_materials_specular */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_specular",function(){return s});var n=r(/*! babylonjs/Materials/PBR/pbrMaterial */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_specular",s=function(){function e(e){this.name=o,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(i,o){var s=new Array;return s.push(n._loader.loadMaterialPropertiesAsync(e,t,r)),s.push(n._loadSpecularPropertiesAsync(i,o,r)),Promise.all(s).then(function(){})})},e.prototype._loadSpecularPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");return void 0!==t.specularFactor&&(r.metallicF0Factor=t.specularFactor),t.specularTexture&&(r.useMetallicF0FactorFromMetallicTexture=!0),Promise.resolve()},e}();i.GLTFLoader.RegisterExtension(o,function(e){return new s(e)})},"./glTF/2.0/Extensions/KHR_materials_unlit.ts": /*!****************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_materials_unlit.ts ***! \****************************************************/ /*! exports provided: KHR_materials_unlit */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_materials_unlit",function(){return s});var n=r(/*! babylonjs/Maths/math.color */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_materials_unlit",s=function(){function e(e){this.name=o,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadMaterialPropertiesAsync=function(e,t,r){var n=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(){return n._loadUnlitPropertiesAsync(e,t,r)})},e.prototype._loadUnlitPropertiesAsync=function(e,t,r){if(!(r instanceof n.PBRMaterial))throw new Error(e+": Material type not supported");var i=new Array;r.unlit=!0;var o=t.pbrMetallicRoughness;return o&&(o.baseColorFactor?(r.albedoColor=n.Color3.FromArray(o.baseColorFactor),r.alpha=o.baseColorFactor[3]):r.albedoColor=n.Color3.White(),o.baseColorTexture&&i.push(this._loader.loadTextureInfoAsync(e+"/baseColorTexture",o.baseColorTexture,function(e){e.name=r.name+" (Base Color)",r.albedoTexture=e}))),t.doubleSided&&(r.backFaceCulling=!1,r.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,t,r),Promise.all(i).then(function(){})},e}();i.GLTFLoader.RegisterExtension(o,function(e){return new s(e)})},"./glTF/2.0/Extensions/KHR_mesh_quantization.ts": /*!******************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_mesh_quantization.ts ***! \******************************************************/ /*! exports provided: KHR_mesh_quantization */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_mesh_quantization",function(){return o});var n=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),i="KHR_mesh_quantization",o=function(){function e(e){this.name=i,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){},e}();n.GLTFLoader.RegisterExtension(i,function(e){return new o(e)})},"./glTF/2.0/Extensions/KHR_texture_basisu.ts": /*!***************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_texture_basisu.ts ***! \***************************************************/ /*! exports provided: KHR_texture_basisu */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_texture_basisu",function(){return o});var n=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),i="KHR_texture_basisu",o=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){delete this._loader},e.prototype._loadTextureAsync=function(e,t,r){var i=this;return n.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(o,s){var a=null==t.sampler?n.GLTFLoader.DefaultSampler:n.ArrayItem.Get(e+"/sampler",i._loader.gltf.samplers,t.sampler),c=n.ArrayItem.Get(o+"/source",i._loader.gltf.images,s.source);return i._loader._createTextureAsync(e,a,c,function(e){e.gammaSpace=!1,r(e)})})},e}();n.GLTFLoader.RegisterExtension(i,function(e){return new o(e)})},"./glTF/2.0/Extensions/KHR_texture_transform.ts": /*!******************************************************!*\ !*** ./glTF/2.0/Extensions/KHR_texture_transform.ts ***! \******************************************************/ /*! exports provided: KHR_texture_transform */function(e,t,r){"use strict";r.r(t),r.d(t,"KHR_texture_transform",function(){return s});var n=r(/*! babylonjs/Materials/Textures/texture */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="KHR_texture_transform",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader},e.prototype.loadTextureInfoAsync=function(e,t,r){var o=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(i,s){return o._loader.loadTextureInfoAsync(e,t,function(e){if(!(e instanceof n.Texture))throw new Error(i+": Texture type not supported");s.offset&&(e.uOffset=s.offset[0],e.vOffset=s.offset[1]),e.uRotationCenter=0,e.vRotationCenter=0,s.rotation&&(e.wAng=-s.rotation),s.scale&&(e.uScale=s.scale[0],e.vScale=s.scale[1]),null!=s.texCoord&&(e.coordinatesIndex=s.texCoord),r(e)})})},e}();i.GLTFLoader.RegisterExtension(o,function(e){return new s(e)})},"./glTF/2.0/Extensions/MSFT_audio_emitter.ts": /*!***************************************************!*\ !*** ./glTF/2.0/Extensions/MSFT_audio_emitter.ts ***! \***************************************************/ /*! exports provided: MSFT_audio_emitter */function(e,t,r){"use strict";r.r(t),r.d(t,"MSFT_audio_emitter",function(){return s});var n=r(/*! babylonjs/Maths/math.vector */"babylonjs/Misc/tools"),i=r(/*! ../glTFLoader */"./glTF/2.0/glTFLoader.ts"),o="MSFT_audio_emitter",s=function(){function e(e){this.name=o,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){delete this._loader,delete this._clips,delete this._emitters},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._clips=t.clips,this._emitters=t.emitters,i.ArrayItem.Assign(this._clips),i.ArrayItem.Assign(this._emitters)}},e.prototype.loadSceneAsync=function(e,t){var r=this;return i.GLTFLoader.LoadExtensionAsync(e,t,this.name,function(n,o){var s=new Array;s.push(r._loader.loadSceneAsync(e,t));for(var a=0,c=o.emitters;a=0;s--)if(o.push(i.ArrayItem.Get(e+"/ids/"+n[s],r,n[s])),o.length===this.maxLODsToLoad)return o;return o.push(t),o},e.prototype._disposeTransformNode=function(e){var t=this,r=new Array,n=e.material;n&&r.push(n);for(var i=0,o=e.getChildMeshes();i "+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,l=r._babylonScene.blockMaterialDirtyMechanism;if(r._babylonScene.blockMaterialDirtyMechanism=!0,e)c.push(r.loadSceneAsync("/nodes",{nodes:e,index:-1}));else if(null!=r._gltf.scene||r._gltf.scenes&&r._gltf.scenes[0]){var u=o.Get("/scene",r._gltf.scenes,r._gltf.scene||0);c.push(r.loadSceneAsync("/scenes/"+u.index,u))}r._babylonScene.blockMaterialDirtyMechanism=l,r._parent.compileMaterials&&c.push(r._compileMaterialsAsync()),r._parent.compileShadowGenerators&&c.push(r._compileShadowGeneratorsAsync());var h=Promise.all(c).then(function(){return r._rootBabylonMesh&&r._rootBabylonMesh.setEnabled(!0),r._setState(i.GLTFLoaderState.READY),r._extensionsOnReady(),r._startAnimations(),t()});return h.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()})})}),h},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.byteLengthe.bin.byteLength)&&n.Logger.Warn("Binary buffer length ("+r.byteLength+") from JSON does not match chunk length ("+e.bin.byteLength+")"),this._bin=e.bin}else n.Logger.Warn("Unexpected BIN chunk")}},e.prototype._setupData=function(){if(o.Assign(this._gltf.accessors),o.Assign(this._gltf.animations),o.Assign(this._gltf.buffers),o.Assign(this._gltf.bufferViews),o.Assign(this._gltf.cameras),o.Assign(this._gltf.images),o.Assign(this._gltf.materials),o.Assign(this._gltf.meshes),o.Assign(this._gltf.nodes),o.Assign(this._gltf.samplers),o.Assign(this._gltf.scenes),o.Assign(this._gltf.skins),o.Assign(this._gltf.textures),this._gltf.nodes){for(var e={},t=0,r=this._gltf.nodes;t=2)throw new Error(t+"/texCoord: Invalid value ("+r.texCoord+")");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,n){void 0===n&&(n=function(){});var i=this._extensionsLoadTextureAsync(t,r,n);if(i)return i;this.logOpen(t+" "+(r.name||""));var s=null==r.sampler?e.DefaultSampler:o.Get(t+"/sampler",this._gltf.samplers,r.sampler),a=o.Get(t+"/source",this._gltf.images,r.source),c=this._createTextureAsync(t,s,a,n);return this.logClose(),c},e.prototype._createTextureAsync=function(e,t,r,i){var o=this;void 0===i&&(i=function(){});var s=this._loadSampler("/samplers/"+t.index,t),a=new Array,c=new n.Deferred;this._babylonScene._blockEntityCollection=this._forAssetContainer;var l=new n.Texture(null,this._babylonScene,s.noMipMaps,!1,s.samplingMode,function(){o._disposed||c.resolve()},function(t,r){o._disposed||c.reject(new Error(e+": "+(r&&r.message?r.message:t||"Failed to load texture")))},void 0,void 0,void 0,r.mimeType);return this._babylonScene._blockEntityCollection=!1,a.push(c.promise),a.push(this.loadImageAsync("/images/"+r.index,r).then(function(e){var t=r.uri||o._fileName+"#image"+r.index,n="data:"+o._uniqueRootUrl+t;l.updateURL(n,e)})),l.wrapU=s.wrapU,l.wrapV=s.wrapV,i(l),Promise.all(a).then(function(){return l})},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;i0)throw new Error("Incompatible minimum version: "+r.minVersion)}var o={1:e._CreateGLTF1Loader,2:e._CreateGLTF2Loader}[n.major];if(!o)throw new Error("Unsupported version: "+r.version);return o(this)},e.prototype._parseJson=function(e){this._startPerformanceCounter("Parse JSON"),this._log("JSON length: "+e.length);var t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t},e.prototype._unpackBinaryAsync=function(e){var t=this;return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then(function(){var r=e.readUint32();if(1179937895!==r)throw new Error("Unexpected magic: "+r);var n=e.readUint32();t.loggingEnabled&&t._log("Binary version: "+n);var i,o=e.readUint32();if(0!=e.buffer.byteLength&&o!==e.buffer.byteLength)throw new Error("Length in header does not match actual data length: "+o+" != "+e.buffer.byteLength);switch(n){case 1:i=t._unpackBinaryV1Async(e,o);break;case 2:i=t._unpackBinaryV2Async(e,o);break;default:throw new Error("Unsupported version: "+n)}return t._endPerformanceCounter("Unpack Binary"),i})},e.prototype._unpackBinaryV1Async=function(e,t){var r=e.readUint32(),n=e.readUint32();if(0!==n)throw new Error("Unexpected content format: "+n);var i=t-e.byteOffset,o={json:this._parseJson(e.readString(r)),bin:null};if(0!==i){var s=e.byteOffset;o.bin={readAsync:function(t,r){return e.buffer.readAsync(s+t,r)},byteLength:i}}return Promise.resolve(o)},e.prototype._unpackBinaryV2Async=function(e,t){var r=this,n=1313821514,i=5130562,o=e.readUint32();if(e.readUint32()!==n)throw new Error("First chunk format is not JSON");return e.byteOffset+o===t?e.loadAsync(o).then(function(){return{json:r._parseJson(e.readString(o)),bin:null}}):e.loadAsync(o+8).then(function(){var s={json:r._parseJson(e.readString(o)),bin:null},a=function(){var r=e.readUint32();switch(e.readUint32()){case n:throw new Error("Unexpected JSON chunk");case i:var o=e.byteOffset;s.bin={readAsync:function(t,r){return e.buffer.readAsync(o+t,r)},byteLength:r},e.skipBytes(r);break;default:e.skipBytes(r)}return e.byteOffset!==t?e.loadAsync(8).then(a):Promise.resolve(s)};return a()})},e._parseVersion=function(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};var t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null},e._compareVersion=function(e,t){return e.major>t.major?1:e.majort.minor?1:e.minor-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, GLTFValidation, MTLFileLoader, OBJFileLoader, STLFileLoader */function(e,t,r){"use strict";r.r(t);r(/*! ../index */"./index.ts");var n=r(/*! ./legacy-glTF */"./legacy/legacy-glTF.ts");r.d(t,"GLTFLoaderCoordinateSystemMode",function(){return n.GLTFLoaderCoordinateSystemMode}),r.d(t,"GLTFLoaderAnimationStartMode",function(){return n.GLTFLoaderAnimationStartMode}),r.d(t,"GLTFLoaderState",function(){return n.GLTFLoaderState}),r.d(t,"GLTFFileLoader",function(){return n.GLTFFileLoader}),r.d(t,"GLTFValidation",function(){return n.GLTFValidation});var i=r(/*! ./legacy-glTF1 */"./legacy/legacy-glTF1.ts");r.d(t,"GLTF1",function(){return i.GLTF1});var o=r(/*! ./legacy-glTF2 */"./legacy/legacy-glTF2.ts");r.d(t,"GLTF2",function(){return o.GLTF2});var s=r(/*! ./legacy-objFileLoader */"./legacy/legacy-objFileLoader.ts");r.d(t,"MTLFileLoader",function(){return s.MTLFileLoader}),r.d(t,"OBJFileLoader",function(){return s.OBJFileLoader});var a=r(/*! ./legacy-stlFileLoader */"./legacy/legacy-stlFileLoader.ts");r.d(t,"STLFileLoader",function(){return a.STLFileLoader})},"babylonjs/Misc/tools": /*!****************************************************************************************************!*\ !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***! \****************************************************************************************************/ /*! no static exports found */function(t,r){t.exports=e}})},e.exports=n(r(0))}).call(this,r(10))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});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(6),p=r(1);!function(e){e[e.INIT=0]="INIT",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e[e.ENTRY=3]="ENTRY",e[e.ENTRYDONE=4]="ENTRYDONE",e[e.COMPLETE=5]="COMPLETE",e[e.CANCELED=6]="CANCELED",e[e.ERROR=7]="ERROR"}(n=t.ModelState||(t.ModelState={}));var m=function(){function e(e,t,r){var s=this;this._observablesManager=e,this._configurationContainer=r,this._meshes=[],this.particleSystems=[],this.skeletons=[],this._loaderDone=!1,this._animatables=[],this._frameRate=60,this._shadowsRenderedAfterLoad=!1,this.onLoadedObservable=new o.Observable,this.onLoadErrorObservable=new o.Observable,this.onLoadProgressObservable=new o.Observable,this.onCompleteObservable=new o.Observable,this.onAfterConfigure=new o.Observable,this.state=n.INIT;var 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&&e.animations[0]&&(n.addTargetedAnimation(e.animations[0],e),i=!0)}),i&&e.addAnimationGroup(n)});var t=function(){};if(this._modelConfiguration.animation&&(this._modelConfiguration.animation.playOnce&&this._animations.forEach(function(e){e.playMode=f.AnimationPlayMode.ONCE}),this._modelConfiguration.animation.autoStart&&this._animations.length)){var r=!0===this._modelConfiguration.animation.autoStart?this._animations[0].name:this._modelConfiguration.animation.autoStart;t=function(){e.playAnimation(r)}}this._enterScene(t)},e.prototype._enterScene=function(e){var t=this,r=this.rootMesh.getScene(),i=r.animationPropertiesOverride.enableBlending,o=function(){t.state=n.ENTRYDONE,r.animationPropertiesOverride.enableBlending=i,t._checkCompleteState(),e&&e()};this._entryAnimation?(this.rootMesh.setEnabled(!0),r.animationPropertiesOverride.enableBlending=!1,this._applyAnimation(this._entryAnimation,!0,o)):o()},e.prototype._exitScene=function(e){this._exitAnimation?this._applyAnimation(this._exitAnimation,!1,e):e()},e.prototype._modelComplete=function(){var e=this;this._pivotMesh.getChildMeshes(!1).filter(function(e){return e.material}).forEach(function(t){e._applyModelMaterialConfiguration(t.material)}),this.state=n.COMPLETE,this.onCompleteObservable.notifyObservers(this)},e.prototype.addAnimationGroup=function(e){this._animations.push(new f.GroupModelAnimation(e))},e.prototype.getAnimations=function(){return this._animations},e.prototype.getAnimationNames=function(){return this._animations.map(function(e){return e.name})},e.prototype._getAnimationByName=function(e){var t=this._animations.filter(function(t){return t.name===e.trim()});return 1===t.length?t[0]:null},e.prototype.playAnimation=function(e){var t=this.setCurrentAnimationByName(e);return t&&t.start(),t},e.prototype.setCurrentAnimationByName=function(e){var t=this._getAnimationByName(e.trim());if(t)return this.currentAnimation&&this.currentAnimation.state!==f.AnimationState.STOPPED&&this.currentAnimation.stop(),this.currentAnimation=t,t;throw new Error("animation not found - "+e)},e.prototype._configureModel=function(){var e=this,t=[this.rootMesh],r=function(e,r,n){t.forEach(function(t){n?t[e][n]=r:t[e]=r})},n=function(e,t){void 0!==t.x&&r(e,t.x,"x"),void 0!==t.y&&r(e,t.y,"y"),void 0!==t.z&&r(e,t.z,"z"),void 0!==t.w&&r(e,t.w,"w")};if(this._modelConfiguration.normalize){var i=!1,o=!1,s=void 0;!0===this._modelConfiguration.normalize?(i=!0,o=!0):(i=!!this._modelConfiguration.normalize.center,o=!!this._modelConfiguration.normalize.unitSize,s=this._modelConfiguration.normalize.parentIndex);var a=[];void 0!==s?a.push(this._meshes[s]):a=1===this._pivotMesh.getChildMeshes(!0).length?[this._pivotMesh]:t,o&&a.forEach(function(e){e.normalizeToUnitCube(!0),e.computeWorldMatrix(!0)}),i&&a.forEach(function(e){var t=e.getHierarchyBoundingVectors(!0),r=t.max.subtract(t.min).scale(.5),n=t.min.add(r);e.position=n.scale(-1),e.position.y+=r.y,e.computeWorldMatrix(!0)})}if(this._modelConfiguration.position&&n("position",this._modelConfiguration.position),this._modelConfiguration.rotation&&(this._modelConfiguration.rotation.w?(t.forEach(function(e){e.rotationQuaternion||(e.rotationQuaternion=new 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\n \n\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.5&&(t.value=""+r),n._currentAnimation.state===f.AnimationState.PLAYING?n.sceneManager.camera.autoRotationBehavior&&!n._oldIdleRotationValue&&(n._oldIdleRotationValue=n.sceneManager.camera.autoRotationBehavior.idleRotationSpeed,n.sceneManager.camera.autoRotationBehavior.idleRotationSpeed=0):n.sceneManager.camera.autoRotationBehavior&&n._oldIdleRotationValue&&(n.sceneManager.camera.autoRotationBehavior.idleRotationSpeed=n._oldIdleRotationValue,n._oldIdleRotationValue=0)}}},n._updateAnimationSpeed=function(e,t){var r=n.templateManager.getTemplate("navBar");r&&e&&n._currentAnimation&&(n._currentAnimation.speedRatio=parseFloat(e),n._isAnimationPaused||n._currentAnimation.restart(),t?t.selectedSpeed=e+"x":r.updateParams({selectedSpeed:e+"x"}))},n._updateAnimationType=function(e,t){var r=n.templateManager.getTemplate("navBar");r&&(e&&(n._currentAnimation=n.sceneManager.models[0].setCurrentAnimationByName(e.value)),t?(t.selectedAnimation=n._animationList.indexOf(e.value)+1,t.selectedAnimationName=e.label):r.updateParams({selectedAnimation:n._animationList.indexOf(e.value)+1,selectedAnimationName:e.label}),n._updateAnimationSpeed("1.0",t))},n.toggleFullscreen=function(){var e=n.templateManager.getTemplate("viewer"),t=e&&e.parent,r=n.fullscreenElement||t;r&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement?((document.exitFullscreen||document.webkitExitFullscreen||document.msExitFullscreen||document.mozCancelFullScreen).call(document),t&&t.classList.remove("in-fullscreen")):((r.requestFullscreen||r.webkitRequestFullscreen||r.msRequestFullscreen||r.mozRequestFullScreen).call(r),t&&t.classList.add("in-fullscreen")))},n._onModelLoaded=function(e){n._configureTemplate(e);var t=20;n.configuration.lab&&void 0!==n.configuration.lab.hideLoadingDelay&&(t=n.configuration.lab.hideLoadingDelay),setTimeout(function(){n.sceneManager.scene.executeWhenReady(function(){n.hideLoadingScreen()})},t)},n.onModelLoadedObservable.add(n._onModelLoaded),n.onModelRemovedObservable.add(function(){n._configureTemplate()}),n.onEngineInitObservable.add(function(){n.sceneManager.onLightsConfiguredObservable.add(function(e){n._configureLights()})}),n.onInitDoneObservable.add(function(){n.sceneManager.setDefaultMaterial=function(e){var t=e.defaultMaterial;t&&(("standard"===t.materialType&&"StandardMaterial"!==this.scene.defaultMaterial.getClassName()||"pbr"===t.materialType&&"PBRMaterial"!==this.scene.defaultMaterial.getClassName())&&(this.scene.defaultMaterial.dispose(),"standard"===t.materialType?this.scene.defaultMaterial=new u.StandardMaterial("defaultMaterial",this.scene):this.scene.defaultMaterial=new 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 p.HDButtonPlugin(this)),this.registerTemplatePlugin(new m.PrintButtonPlugin(this)))},t.prototype._initVR=function(){var t=this;this.engine.onVRDisplayChangedObservable.add(function(){var e=t.templateManager.getTemplate("viewer"),r=e&&e.parent;r&&(t.sceneManager.vrHelper.isInVRMode?r.classList.add("in-vr"):r.classList.remove("in-vr"))}),this.sceneManager.vrHelper&&this.sceneManager.vrHelper.onExitingVR.add(function(){var e=t.templateManager.getTemplate("viewer"),r=e&&e.parent;r&&r.classList.remove("in-vr")}),e.prototype._initVR.call(this)},t.prototype._prepareContainerElement=function(){var e=this.containerElement;e.style&&(e.style.position="relative",e.style.height="100%",e.style.display="flex")},t.prototype._configureTemplate=function(e){var t=this.templateManager.getTemplate("navBar");if(t){var r=t.configuration.params||{};if(e){var n=e.getAnimationNames();if(r.animations=n.map(function(e){return{label:e,value:e}}),n.length){this._isAnimationPaused=e.configuration.animation&&!e.configuration.animation.autoStart||!e.configuration.animation,this._animationList=n,r.paused=this._isAnimationPaused;var i=0;e.configuration.animation&&"string"==typeof e.configuration.animation.autoStart&&-1===(i=n.indexOf(e.configuration.animation.autoStart))&&(i=0),this._updateAnimationType(r.animations[i],r)}else r.animations=null;e.configuration.thumbnail&&(r.logoImage=e.configuration.thumbnail)}else r.animations=null;t.updateParams(r,!1)}},t.prototype.loadModel=function(t){var r=this;return t||(t=this.configuration.model),this.showLoadingScreen(),e.prototype.loadModel.call(this,t,!0).catch(function(e){return console.log(e),r.hideLoadingScreen(),r.showOverlayScreen("error"),Promise.reject(e)})},t.prototype.showOverlayScreen=function(e){var t=this,r=this.templateManager.getTemplate("overlay");return r?r.show(function(r){var n=t.containerElement.getBoundingClientRect();r.parent.style.display="flex",r.parent.style.width=n.width+"px",r.parent.style.height=n.height+"px",r.parent.style.opacity="1";var i=t.templateManager.getTemplate(e);return i?i.show(function(e){return e.parent.style.display="flex",Promise.resolve(e)}):Promise.reject(e+" template not found")}):Promise.resolve("Overlay template not found")},t.prototype.hideOverlayScreen=function(){var e=this.templateManager.getTemplate("overlay");return e?e.hide(function(e){e.parent.style.opacity="0";var t=function(){e.parent.removeEventListener("transitionend",t),e.parent.style.display="none"};e.parent.addEventListener("transitionend",t);var r=e.parent.querySelectorAll(".overlay");if(r)for(var n=0;n= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.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=/[&<>"'`=]/g,i=/[&<>"'`=]/;function o(e){return r[e]}function s(e){for(var t=1;t0?(r.ids&&(r.ids=[r.name]),e.helpers.each(t,r)):i(this);if(r.data&&r.ids){var s=n.createFrame(r.data);s.contextPath=n.appendContextPath(r.data.contextPath,r.name),r={data:s}}return o(t,r)})},e.exports=t.default},function(e,t,r){(function(n){"use strict";var i=r(1).default;t.__esModule=!0;var o=r(5),s=i(r(6));t.default=function(e){e.registerHelper("each",function(e,t){if(!t)throw new s.default("Must pass iterator to #each");var r=t.fn,i=t.inverse,a=0,c="",l=void 0,u=void 0;function h(t,n,i){l&&(l.key=t,l.index=n,l.first=0===n,l.last=!!i,u&&(l.contextPath=u+t)),c+=r(e[t],{data:l,blockParams:o.blockParams([e[t],t],[u+t,null])})}if(t.data&&t.ids&&(u=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(l=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var d=e.length;a=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=c.LAST_COMPATIBLE_COMPILER_REVISION&&t<=c.COMPILER_REVISION)return;if(t2&&y.push("'"+this.terminals_[_]+"'");M=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(M,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:u,expected:y})}}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+d);switch(m[0]){case 1:r.push(d),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),r.push(m[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_[m[1]][1],T.$=n[n.length-v],T._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},h&&(T._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(g=this.performAction.call(T,s,c,a,this.yy,m[1],n,i)))return g;v&&(r=r.slice(0,-1*v*2),n=n.slice(0,-1*v),i=i.slice(0,-1*v)),r.push(this.productions_[m[1]][0]),n.push(T.$),i.push(T._$),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;st[0].length)||(t=r,n=s,this.options.flex));s++);return t?((i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,o[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,r,n){function i(e,r){return t.yytext=t.yytext.substring(e,t.yyleng-r+e)}switch(r){case 0:if("\\\\"===t.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(t.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return t.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return t.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return t.yytext=t.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return e}();function r(){this.yy={}}return e.lexer=t,r.prototype=e,e.Parser=r,new r}();t.default=r,e.exports=t.default},function(e,t,r){"use strict";var n=r(1).default;t.__esModule=!0;var i=n(r(39));function o(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=e}function s(e,t,r){void 0===t&&(t=e.length);var n=e[t-1],i=e[t-2];return n?"ContentStatement"===n.type?(i||!r?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original):void 0:r}function a(e,t,r){void 0===t&&(t=-1);var n=e[t+1],i=e[t+2];return n?"ContentStatement"===n.type?(i||!r?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original):void 0:r}function 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;i0)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;r1)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=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){var r=[this.aliasable("container.propertyIsEnumerable"),".call(",e,',"constructor")'];return"constructor"===t?["(",r,"?",n()," : undefined)"]:n();function n(){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;c0&&(t+=", "+r.join(", "));var n=0;for(var i in this.aliases){var o=this.aliases[i];this.aliases.hasOwnProperty(i)&&o.children&&o.referenceCount>1&&(t+=", alias"+ ++n+"="+i,o.children[0]="alias"+n)}var s=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&s.push("blockParams"),this.useDepths&&s.push("depths");var a=this.mergeSource(t);return e?(s.push(a),Function.apply(this,s)):this.source.wrap(["function(",s.join(","),") {\n ",a,"}"])},mergeSource:function(e){var t=this.environment.isSimple,r=!this.forceBuffer,n=void 0,i=void 0,o=void 0,s=void 0;return this.source.each(function(e){e.appendToBuffer?(o?e.prepend(" + "):o=e,s=e):(o&&(i?o.prepend("buffer += "):n=!0,s.add(";"),o=s=void 0),i=!0,t||(r=!1))}),r?o?(o.prepend("return "),s.add(";")):i||this.source.push('return "";'):(e+=", buffer = "+(n?"":this.initializeBuffer()),o?(o.prepend("return buffer + "),s.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(n?"":";\n")),this.source.merge()},blockValue:function(e){var t=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs(e,0,r);var n=this.popStack();r.splice(1,0,n),this.push(this.source.functionCall(t,"call",r))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),t=[this.contextName(0)];this.setupHelperArgs("",0,t,!0),this.flushInline();var r=this.topStack();t.splice(1,0,r),this.pushSource(["if (!",this.lastHelper,") { ",r," = ",this.source.functionCall(e,"call",t),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(e){return[" != null ? ",e,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,r,n){var i=0;n||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(e[i++])),this.resolvePath("context",e,i,t,r)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",t,1)},lookupData:function(e,t,r){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",t,0,!0,r)},resolvePath:function(e,t,r,n,i){var o=this;if(this.options.strict||this.options.assumeObjects)this.push(function(e,t,r,n){var i=t.popStack(),o=0,s=r.length;e&&s--;for(;othis.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;t1){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(25)},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(11);t.viewerManager=o.viewerManager;var s=r(12);t.DefaultViewer=s.DefaultViewer;var a=r(14);t.AbstractViewer=a.AbstractViewer;var c=r(7);t.telemetryManager=c.telemetryManager;var l=r(20);t.ModelLoader=l.ModelLoader;var u=r(5);t.ViewerModel=u.ViewerModel,t.ModelState=u.ModelState;var h=r(6);t.AnimationPlayMode=h.AnimationPlayMode,t.AnimationState=h.AnimationState;var d=r(9);t.AbstractViewerNavbarButton=d.AbstractViewerNavbarButton;var f=r(23);t.registerCustomOptimizer=f.registerCustomOptimizer;var p=r(0);t.BABYLON=p,r(4),r(68);var m=r(69);t.InitTags=m.InitTags,p.PromisePolyfill.Apply(),m.initListeners();var g=i.viewerGlobals.disableInit;t.disableInit=g,t.disposeAll=function(){o.viewerManager.dispose(),n.mapperManager.dispose(),c.telemetryManager.dispose()};var _=i.viewerGlobals.version;t.Version=_,console.log("Babylon.js viewer (v"+_+")");var v=r(4);t.GLTF2=v.GLTF2,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(21))},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(13),a=r(28),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;n0?(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;t0,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=b.CubeTexture.CreateFromPrefilteredData(e.environmentTexture,this.scene);this.scene.environmentTexture=n}!0===e.debug?this.scene.debugLayer.show():!1===e.debug&&this.scene.debugLayer.isVisible()&&this.scene.debugLayer.hide(),e.disableHdr?this._handleHardwareLimitations(!1):this._handleHardwareLimitations(!0),void 0!==e.renderInBackground&&(this._engine.renderEvenInBackground=!!e.renderInBackground);var i=this._engine.getInputElement();i&&(this.camera&&e.disableCameraControl?this.camera.detachControl(i):this.camera&&!1===e.disableCameraControl&&this.camera.attachControl(i)),this.setDefaultMaterial(e),e.flags&&o.extendClassWithConfig(this.scene,e.flags),this.onSceneConfiguredObservable.notifyObservers({sceneManager:this,object:this.scene,newConfiguration:e})}},e.prototype._configureOptimizer=function(e){var t=this;if("boolean"==typeof e)this.sceneOptimizer&&(this.sceneOptimizer.stop(),this.sceneOptimizer.dispose(),delete this.sceneOptimizer),e&&(this.sceneOptimizer=new u.SceneOptimizer(this.scene),this.sceneOptimizer.start());else{var r=new u.SceneOptimizerOptions(e.targetFrameRate,e.trackerDuration);if(e.degradation)switch(e.degradation){case"low":r=u.SceneOptimizerOptions.LowDegradationAllowed(e.targetFrameRate);break;case"moderate":r=u.SceneOptimizerOptions.ModerateDegradationAllowed(e.targetFrameRate);break;case"hight":r=u.SceneOptimizerOptions.HighDegradationAllowed(e.targetFrameRate)}if(this.sceneOptimizer&&(this.sceneOptimizer.stop(),this.sceneOptimizer.dispose()),e.custom){var n=a.getCustomOptimizerByName(e.custom,e.improvementMode);n&&r.addCustomOptimization(function(){return n(t)},function(){return"Babylon Viewer "+e.custom+" custom optimization"})}this.sceneOptimizer=new u.SceneOptimizer(this.scene,r,e.autoGeneratePriorities,e.improvementMode),this.sceneOptimizer.start()}this.onSceneOptimizerConfiguredObservable.notifyObservers({sceneManager:this,object:this.sceneOptimizer,newConfiguration:e})},e.prototype._configureVR=function(e){var t=this;if(e.disabled)this._vrHelper&&(this._vrHelper.isInVRMode&&this._vrHelper.exitVR(),this._vrHelper.dispose(),this._vrHelper=void 0);else{var r,n=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 b.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}var u=this.scene.getEngine().getInputElement();u&&this.scene.activeCamera.attachControl(u),this.camera=this.scene.activeCamera,this.camera.setTarget(p.Vector3.Zero())}if(this.camera||(this.camera=this.scene.activeCamera),e.position){var 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 m in e.behaviors)void 0!==e.behaviors[m]&&this._setCameraBehavior(m,e.behaviors[m]);var g=this.scene.getWorldExtends(function(e){return!t.environmentHelper||e!==t.environmentHelper.ground&&e!==t.environmentHelper.rootMesh&&e!==t.environmentHelper.skybox}),_=g.max.subtract(g.min).length();isFinite(_)&&(this.camera.upperRadiusLimit=4*_),this.scene.imageProcessingConfiguration&&(this.scene.imageProcessingConfiguration.colorCurvesEnabled=!0,this.scene.imageProcessingConfiguration.vignetteEnabled=!0,this.scene.imageProcessingConfiguration.toneMappingEnabled=!!n.getConfigurationKey("camera.toneMappingEnabled",this._globalConfiguration)),o.extendClassWithConfig(this.camera,e),this.onCameraConfiguredObservable.notifyObservers({sceneManager:this,object:this.camera,newConfiguration:e})},e.prototype._configureEnvironment=function(e,t){var r=this;if(e||t){var n={createGround:!!t&&this._groundEnabled,createSkybox:!!e,setupImageProcessing:!1};if(t){var i="boolean"==typeof t?{}:t,s=i.size||"object"==typeof e&&e.scale;s&&(n.groundSize=s),n.enableGroundShadow=!0===i||i.receiveShadows,void 0!==i.shadowLevel&&(n.groundShadowLevel=i.shadowLevel),n.enableGroundMirror=!!i.mirror&&this.groundMirrorEnabled,i.texture&&(n.groundTexture=this._getAssetUrl(i.texture)),i.color&&(n.groundColor=new p.Color3(i.color.r,i.color.g,i.color.b)),void 0!==i.opacity&&(n.groundOpacity=i.opacity),i.mirror&&(n.enableGroundMirror=!0,"object"==typeof i.mirror&&(void 0!==i.mirror.amount&&(n.groundMirrorAmount=i.mirror.amount),void 0!==i.mirror.sizeRatio&&(n.groundMirrorSizeRatio=i.mirror.sizeRatio),void 0!==i.mirror.blurKernel&&(n.groundMirrorBlurKernel=i.mirror.blurKernel),void 0!==i.mirror.fresnelWeight&&(n.groundMirrorFresnelWeight=i.mirror.fresnelWeight),void 0!==i.mirror.fallOffDistance&&(n.groundMirrorFallOffDistance=i.mirror.fallOffDistance),void 0!==this._defaultPipelineTextureType&&(n.groundMirrorTextureType=this._defaultPipelineTextureType)))}var a=!1;if(e){var 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=M.Scalar.Clamp(h.r),this.environmentHelper.groundMirror.clearColor.g=M.Scalar.Clamp(h.g),this.environmentHelper.groundMirror.clearColor.b=M.Scalar.Clamp(h.b),this.environmentHelper.groundMirror.clearColor.a=1,this.groundMirrorEnabled||(this.environmentHelper.groundMaterial.reflectionTexture=null)}var m=this.environmentHelper.skyboxMaterial;m&&(m._perceptualColor=this.mainColor,a&&"object"==typeof e&&e.material&&o.extendClassWithConfig(m,e.material))}else this.environmentHelper&&(this.environmentHelper.dispose(),this.environmentHelper=void 0);this._observablesManager&&this._observablesManager.onModelLoadedObservable.add(function(e){r._updateGroundMirrorRenderList(e)}),this.onEnvironmentConfiguredObservable.notifyObservers({sceneManager:this,object:this.environmentHelper,newConfiguration:{skybox:e,ground:t}})},e.prototype._configureLights=function(e){var t=this;void 0===e&&(e={});var r=Object.keys(e).filter(function(e){return"globalRotation"!==e});if(r.length){var n=this.scene.lights.map(function(e){return e.name}),i=Object.keys(this._globalConfiguration.lights||[]);Object.keys(i).length!==n.length&&n.forEach(function(e){-1===i.indexOf(e)&&t.scene.getLightByName(e).dispose()}),r.forEach(function(r,i){var s,a={type:0};if("object"==typeof e[r]&&(a=e[r]),"number"==typeof e[r]&&(a.type=e[r]),a.name=r,-1===n.indexOf(r)){if(!(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 y.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 m=s;void 0!==a.spotAngle&&(m.angle=a.spotAngle*Math.PI/180),m.angle&&a.shadowFieldOfView&&(m.shadowAngleScale=a.shadowFieldOfView/m.angle),f=!0}else s.getTypeID()===d.Light.LIGHTTYPEID_POINTLIGHT&&(a.shadowFieldOfView&&(s.shadowAngle=a.shadowFieldOfView*Math.PI/180),f=!0);var g=s.getShadowGenerator();if(f&&a.shadowEnabled&&t._maxShadows){var _=a.shadowBufferSize||256;g||(g=new C.ShadowGenerator(_,s));var v=t.getBlurKernel(s,_);g.bias=t._shadowGeneratorBias,g.blurKernel=v,o.extendClassWithConfig(g,a.shadowConfig||{}),t._observablesManager&&t._observablesManager.onModelLoadedObservable.add(function(e){t._updateShadowRenderList(g,e)}),t._updateShadowRenderList(g)}else g&&g.dispose()}}else s.dispose()});var s=this._globalConfiguration.lights||{};Object.keys(s).sort().forEach(function(e,r){s[e];var n=t.scene.getLightByName(e);n&&(n.renderPriority=-r)})}else this.scene.lights.length||new T.HemisphericLight("default light",p.Vector3.Up(),this.scene);this.onLightsConfiguredObservable.notifyObservers({sceneManager:this,object:this.scene.lights,newConfiguration:e})},e.prototype._updateShadowRenderList=function(e,t,r){var n=t?t.meshes:this.scene.meshes,i=e.getShadowMap();if(i){r&&i.renderList?i.renderList.length=0:i.renderList=i.renderList||[];for(var o=0;o1){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(17),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(63);t.defaultConfiguration=i.defaultConfiguration;var o=r(18),s=r(64),a=r(65),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(8);t.minimalConfiguration={version:"0.1",templates:{main:{html:n.defaultTemplate},fillContainer:{html:n.fillContainer,params:{disable:!1}},loadingScreen:{html:n.loadingScreen,params:{backgroundColor:"#000000",loadingImage:n.loading}},viewer:{html:n.defaultViewer},overlay:{html:n.overlay,params:{closeImage:n.close,closeText:"Close"}},error:{html:n.error}},engine:{antialiasing:!0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.babylonFont=r(45)},function(e,t){e.exports="data:font/woff;charset=utf-8;base64,d09GRgABAAAAABTkAA8AAAAAJEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABWAAAAEgAAABgSlp+MVZETVgAAAGgAAACBQAABeCBXolxY21hcAAAA6gAAACIAAAA3oTfhSJjdnQgAAAEMAAAACAAAAAqCdkJr2ZwZ20AAARQAAAA8AAAAVn8nuaOZ2FzcAAABUAAAAAMAAAADAAIABtnbHlmAAAFTAAACPgAAAzOOMLcQmhlYWQAAA5EAAAAMgAAADb+Z7dYaGhlYQAADngAAAAVAAAAJBABCAZobXR4AAAOkAAAACsAAAA2EzQDvGxvY2EAAA68AAAALgAAAC4W1hOObWF4cAAADuwAAAAcAAAAIACPANFuYW1lAAAPCAAABTwAAAvzL/OWdXBvc3QAABREAAAAEwAAACD/UQB3cHJlcAAAFFgAAACJAAAA03i98g542mNgZp/IOIGBlYGDdRarMQMDozSEZr7IkMYkxMHKysXIxAgGDEAgwIAAvsEKCgwODLzf0zjAfAjJAFbHAuEpMDAAAL2BB0542hXJUxQYBgAEwclf2qa2bdu2bdu2bdu2bdu2bTtlur15734WAwz4fwYZPHCIgWGoMHQYJqqD+mHDcGH4MEIYMYwURg6jhFHDaGH0MEYYM4wVxg7jhHHDeGH8MEGYMEwUJg6ThEnDZGHyMEWYMkwVpg7ThGnDdGH6MEOYMcwUZg6zhFnDbGH2MEeYM8wV5g7zhHnDfGH+sEBYMCwUFg6LhEXDYmHxsERYMiwVlg7LhGXDcmH5sEJYMawUVg6rhFXDamH1sEZYM6wV1g7rhHXDemH9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4dGwKEUJ9MjRTEHLM7TDPDpkywHNCINcE6k+xDVrC/4Jnf3WMO9oKlsBr4UH4d/hD+Gv4Gz8/hL+F37DHjbItdZJtsG9AeUywBPc0sPGOw5ewGsZW0CpAoQAWL4WYH+HPY90E2YRncWTpJ2CVoP4I1Bc3rYAcRUqQFebnJdsErMljSRUu0m7AKtDDS+8RgvTeMMWaX2aUnuDqmPs894tGwcrDGiAQ8jqJPQTol/ocgwwzxJiPdRblP6FxB9p12AvsUzlhTRZnG/6FqWCMH0qtsCP+a/jHwPWkfez9DwA2xTIinBIYGpGNiw2yHC71birmEKinqAZ9ZYN8eUE6cKtHAXlHt2kq0Feu0UaYpawMamIdkAzinpFdSrxqStDPGQWbgrrVNPIv0Z0HcJXUWc3Z0h1YjiqPrRE4ZoVUXV2thqQvmKcl4lsPgX3W1pHMKNgmcB1Svdl5bv4OZnyczUDSLNdUpgXVxzWqfKWonkE1Fc5curD3a5ITOgf552HFCR74ui9jbGP5vbefsKTFNQGZojh11LpnN6qIMOu9Px3WtNwOYSZuLI3/dW4D8ba4pSGrKXNNb+azZE4emSlJftF/brFpc0ZtVkSVG23Wz40HNnN7kf57R9qtW+M7M2bs3RPkq4/xgvCOqdNvb+RdZ0AR35z/h1P9ay0PfZPoqH7oH79Gr0Wb0fvRu9DasVw4xFWB/B/QeUd2KNsrg++CbkFE3d0DTQLyYjfgbYLuFq3jaY2BmAIP/fgzlDFgAACkqAcgAeNrbwKDNsImRk0mbcRMXiNzO1ZobaqvKwKG9nTs12EFPBsTiifCw0JAEsXidzbXlhUEsPh0VGREeEItfTkKYjwPEEuDj4WRnAbEEwQDEEtowoSDAAMhi2M4IN5oJbjQz3GgWuNGscKPZ5CShRrPDjeaAG80JN3qTMCO79gYGBdfaTAkXAMQBKBoAAAA="},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.babylonLogo=r(47),t.close=r(48),t.fullscreen=r(49),t.helpCircle=r(50),t.loading=r(51),t.staticLoading=r(52)},function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5ybMHDx7YdGLixKMRsaR0FAAAAEQYswEAAOgxmXnoc5+74/iNN9zovdiXSV9f39IVK+7acP78+bdGRva1zk5NfTEisnQXAAAA85sxGwAAgJ6QmSdvvOGG7bfffsfazPxc6Z756Iorrrj53nvvv/nkyYntowdGr+x2u6tKNwEAADB/GbMBAAAorbt0yZL+1avvXr1w4aINpWOIuPba677wyMNrumNjY1veHDu2sqqqT5ZuAgAAYP4xZgMAAFDMokULt921YtXSq666al3pFn5F3/Lly9fddNNNp0YPjm46dfLU4xHVFaWjAAAAmD+M2QAAAFx2mTH2meW3Hlq+fLkRu8ctWLDgmlV3rdowNTV1eN/+ve9MT097lzkAAACXhTEbAACAy+nM9ddd37zjjjsf6+vrW146hg9uyZIltz/whQdvn5h4t3Xg4IFPdLvVitJNAAAAzG3GbAAAAC6H6sorr6itWnn3bVdccYX3Ys9i1113w0MPP3T9zLE3j7321ltjn4+I60s3AQAAMDcZswEAALikFizo27Pizrs611xz7drSLVwcmbno1ltufeLmT988MTI6snly8r11EbGgdBcAAABzizEbAACASyIjxz998837b73l1nUR0Ve6h4tv4cKF1929+u71Z8+ePbhvZO/EzPTMw6WbAAAAmDuM2QAAAFxsU9dce21jxR0rHl6wYMETpWO49JYuXXrHg194KI4ff2fg0OFDn66q6tbSTQAAAMx+xmwAAAAumsWLFw+sXnX3p6+88krvxZ6Hbrzxk2tuuOHG6TeOvrH57bfHH4oqrirdBAAAwOxlzAYAAOBj6+vr27fizrvOXXvttWtKt1BWZi6+/bO3r7/55pvHD4yMDp0+c9o18wAAAHwkxmwAAAA+uoyJT33qpp233XrbusxcUDqH3nHFoituuueez980OTm5Z//I/k6n076vdBMAAACzizEbAACAj2Lm6qs/0b/yrpVfWLBgwfrSMfSuq6+++p6HH3q4Gh8f7z9y9PBtVRXLSzcBAAAwOxizAQAA+FAWLlzUWr1q9SeWLl1qxOaDyptuumntJz/5yTMHDx7YdGLixGMRcWXpKAAAAHqbMRsAAIAPJPvy8Oduu+OdG2+80Xux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ac2Xv27t7e3ssiIkv3ALyf7u7uuStXrLzi0KGDu57ZsWPv0aNH1pRuAgAAGAvGbAAAYDI5OG/uvKHzzlvc32g0ekvHAHwUPT0zzlt1yarzXn/9J0O7X3hhQV23zyndBAAAcCIZswEAgMmgnj59WnP5spULp02bdmXpGIBPYv78U9eecsr8oy++/OLDP37ttVURMbt0EwAAwIlgzAYAACa0rq6up5csXjJy8slz1pduATheMnPKonMWXXHmGWe+tnPns0+8deCtDRHRKN0FAABwPBmzAQCAieq1M87offbss8428AAT1pQpUxacf/4FC/bv3//0szufHRkdHbmodBMAAMDxYswGAAAmmiOzZ5/UXLZ02aqurq7LS8cAjIXZs2evvHT1pfVrr702+NJLL55TR31m6SYAAIBPypgNAABMGFOnTh1asXzl6dOnT7+idAtAAblgwYL1p5566sFdu55/aO++vX0R0VM6CgAA4OMyZgMAAONeZmPXeeeeu/eUU+avLd0CUFqj0ZixZMnSK99+++0f7ty54/GDhw5dFhFZugsAAOCjMmYDAADjV8a+005b8NTCsxdelpnnlc4B6CTTpk0748ILLz7jjTf2Pfnc88/1tNvtZaWbAAAAPgpjNgAAMB6NzJo5a3DZsuUXdHd3u1Ic4H3MmTP3U2suXdves2fPY6/ueWVZXdenlm4CAAD4MIzZAADAuNI9pXvbimUrZ8+YMePy0i0A40ijt7d3w4IFC3723K7nHvrZGz9bF1FPKx0FAADwfozZAADAuJCNfOGcsxb+cMGCBetLtwCMV11dXScvX7r8ykOHDr2w49lnfnLkyJG1pZsAAADeizEbAADoaBl5YO7cucOLFy9el9lYVLoHYCLo6elZdMmnVi3at++njz+/6/mT2u16SekmAACAf86YDQAAdKr2jJ6eweXLVy6bMmXKlaVjACaiuXNPWX3p6nlHX3z5xYd//Nprl0TESaWbAAAA/pExGwAA6DiNRtf2pUuW1ieffPKG0i0AE11mTll0zqIrzuo9a+/O53Y+vH//mxsioqt0FwAAgDEbAADoGJn5wzN7z9rV29t7WURk6R6AyaS7u3veyhUrr3jrrbd2PLtzx+GRkZFP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Pd2xHyZKtdNpcLMg11Pr7y4/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+3QyW5Jx8JsD9okfV74p4ELIceNudMAjRodtfh8T4yETg7fvEf3pAqMlCw7QQah29kl2zOIiedL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82UWhS1hAlKUOsvj6+1nz9/ZPhSY1hv+0stKhrULyleN6+i4gzt3sQs4YISNN3tAM3cHJehdOkPpDR2pylhgwKEth0g5bE7TQkdlKDLLx8rHWluet12vi4vuB1A5HIYbllal5Kbff+87du7Y9xizLGgXKPl4JEK67naX3AKxbh+ycKvFezY8btY98SIlFBZKYotAIZhGIZhGIZhGIZhGIZhGIZhGIZhGIZhGIZhGIZhGIaa/wDuuvLKPcgIqgAAADV0RVh0Q29tbWVudABDb252ZXJ0ZWQgd2l0aCBlemdpZi5jb20gU1ZHIHRvIFBORyBjb252ZXJ0ZXIsKeMjAAAAAElFTkSuQmCC"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTemplate=r(54),t.defaultViewer=r(55),t.error=r(56),t.fillContainer=r(57),t.help=r(58),t.loadingScreen=r(59),t.navbar=r(60),t.overlay=r(61),t.share=r(62)},function(e,t){e.exports=" {{#if fillScreen}} {{/if}} "},function(e,t){e.exports=" "},function(e,t){e.exports=" "},function(e,t){e.exports=" {{#unless disable}} {{/unless}} "},function(e,t){e.exports="HELP"},function(e,t){e.exports=" "},function(e,t){e.exports=' {{#if (or (not animations) hideAnimations)}} {{#if hideLogo}} {{else}} {{/if}} {{/if}} {{#if disableOnFullscreen}} {{/if}} '},function(e,t){e.exports="
{{closeText}}
"},function(e,t){e.exports="SHARE"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),i=r(8),o=r(19),s=r(1);t.defaultConfiguration=s.deepmerge(o.renderOnlyDefaultConfiguration,{version:"3.2.0-alpha4",templates:{main:{html:n.defaultTemplate,params:{babylonFont:n.babylonFont,noEscape:!0}},fillContainer:{html:n.fillContainer,params:{disable:!1}},loadingScreen:{html:n.loadingScreen,params:{backgroundColor:"#000000",loadingImage:i.loading,staticLoadingImage:i.staticLoading}},viewer:{html:n.defaultViewer,params:{enableDragAndDrop:!1}},navBar:{html:n.navbar,params:{speedList:{"0.5x":"0.5","1.0x":"1.0","1.5x":"1.5","2.0x":"2.0"},logoImage:i.babylonLogo,logoText:"BabylonJS",logoLink:"https://babylonjs.com",hideHelp:!0,hideHd:!0,hideVr:!0,hidePrint:!0,disableOnFullscreen:!1,text:{hdButton:"Toggle HD",fullscreenButton:"Toggle Fullscreen",helpButton:"Help",vrButton:"Toggle VR",printButton:"3D Print Object"}},events:{click:{".navbar-control":!0},pointerdown:{".help-button":!0},input:{".progress-wrapper":!0},pointerup:{".progress-wrapper":!0}}},overlay:{html:n.overlay,params:{closeImage:i.close,closeText:"Close"}},help:{html:n.help},share:{html:n.share},error:{html:n.error}},camera:{behaviors:{autoRotate:{type:0},framing:{type:2,zoomOnBoundingInfo:!0,zoomStopsAnimation:!1},bouncing:{type:1}}},skybox:{},ground:{receiveShadows:!0},engine:{antialiasing:!0},scene:{}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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\n\n {{/unless}}\n',t}(r(9).AbstractViewerNavbarButton);t.HDButtonPlugin=o},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),s=r(0),a=function(e){function t(r){var n=e.call(this,"print","print-button",t.HtmlTemplate)||this;return n._viewer=r,n._viewer.onModelLoadedObservable.add(function(e){if(n._currentModelUrl="",e.configuration.url){var t=s.Tools.GetFilename(e.configuration.url)||e.configuration.url,r=e.configuration.root||s.Tools.GetFolderPath(e.configuration.url),i=e.configuration.loader||t.split(".").pop()||"",o=!1;["gltf","glb","obj","stl"].forEach(function(e){-1!==i.indexOf(e)&&(o=!0)}),o&&(n._currentModelUrl=r+t)}}),n}return i(t,e),t.prototype.onEvent=function(e){if(this._currentModelUrl){var t=this._currentModelUrl.replace(/https?:\/\//,"com.microsoft.builder3d://");window.open(t,"_self")}},t.HtmlTemplate='\n{{#unless hidePrint}}\n\n\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=a}return this.firstXY=null,t}},findTouch:function(e,t){for(var r,n=0,i=e.length;n=t.length){var r=[];B.forEach(function(e,n){if(1!==n&&!this.findTouch(t,n-2)){var i=e.out;r.push(i)}},this),r.forEach(this.cancelOut,this)}},touchstart:function(e){this.vacuumTouches(e),this.setPrimaryTouch(e.changedTouches[0]),this.dedupSynthMouse(e),this.scrolling||(this.clickCount++,this.processTouches(e,this.overDown))},overDown:function(e){B.set(e.pointerId,{target:e.target,out:e,outTarget:e.target}),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=B.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){B.delete(e.pointerId),this.removePrimaryPointer(e)},dedupSynthMouse:function(e){var t=R.lastTouches,r=e.changedTouches[0];if(this.isPrimaryTouch(r)){var n={x:r.clientX,y:r.clientY};t.push(n);var i=function(e,t){var r=e.indexOf(t);r>-1&&e.splice(r,1)}.bind(null,t,n);setTimeout(i,2500)}}};S=new _(w.elementAdded,w.elementRemoved,w.elementChanged,w);var L,N,F,V=l.pointermap,k=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,z={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 k&&((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 U(e){if(!l.pointermap.has(e)){var t=new Error("InvalidPointerId");throw t.name="InvalidPointerId",t}}function G(e){for(var t=e.parentNode;t&&t!==e.ownerDocument;)t=t.parentNode;if(!t){var r=new Error("InvalidStateError");throw r.name="InvalidStateError",r}}function j(e){var t=l.pointermap.get(e);return 0!==t.buttons}return window.navigator.msPointerEnabled?(L=function(e){U(e),G(this),j(e)&&(l.setCapture(e,this,!0),this.msSetPointerCapture(e))},N=function(e){U(e),l.releaseCapture(e,!0),this.msReleasePointerCapture(e)}):(L=function(e){U(e),G(this),j(e)&&l.setCapture(e,this)},N=function(e){U(e),l.releaseCapture(e)}),F=function(e){return!!l.captureInfo[e]},function(){if(M){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",z)}else Object.defineProperty(window.navigator,"maxTouchPoints",{value:0,enumerable:!0}),l.registerSource("mouse",R),void 0!==window.ontouchstart&&l.registerSource("touch",w);l.register(document)}}(),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:L},releasePointerCapture:{value:N},hasPointerCapture:{value:F}}),{dispatcher:l,Installer:_,PointerEvent:r,PointerMap:n,targetFinding:u}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(12),i=r(2),o=r(3);function s(e){void 0===e&&(e="babylon");for(var t=document.querySelectorAll(e),r=0;r