From 800885feadfd88d459c3223a98776e995e12b7ec Mon Sep 17 00:00:00 2001 From: David Catuhe Date: Mon, 28 Jan 2019 13:45:30 -0800 Subject: [PATCH] Fix #5821 --- Playground/babylon.d.txt | 3 + dist/preview release/babylon.js | 2 +- dist/preview release/babylon.max.js | 82 +++++++++---------- dist/preview release/gui/babylon.gui.d.ts | 3 + dist/preview release/gui/babylon.gui.js | 29 +++++-- dist/preview release/gui/babylon.gui.js.map | 2 +- dist/preview release/gui/babylon.gui.min.js | 2 +- .../gui/babylon.gui.module.d.ts | 6 ++ dist/preview release/viewer/babylon.viewer.js | 18 ++-- .../viewer/babylon.viewer.max.js | 2 +- gui/src/2D/controls/control.ts | 6 +- gui/src/2D/controls/sliders/baseSlider.ts | 23 +++++- 12 files changed, 114 insertions(+), 64 deletions(-) diff --git a/Playground/babylon.d.txt b/Playground/babylon.d.txt index ae6404efaf1..53ded8b714c 100644 --- a/Playground/babylon.d.txt +++ b/Playground/babylon.d.txt @@ -55434,6 +55434,7 @@ declare module BABYLON.GUI { protected _barOffset: ValueAndUnit; private _isThumbClamped; protected _displayThumb: boolean; + private _step; protected _effectiveBarOffset: number; protected _renderLeft: number; protected _renderTop: number; @@ -55446,6 +55447,8 @@ declare module BABYLON.GUI { onValueChangedObservable: BABYLON.Observable; /** Gets or sets a boolean indicating if the thumb must be rendered */ displayThumb: boolean; + /** Gets or sets a step to apply to values (0 by default) */ + step: number; /** Gets or sets main bar offset (ie. the margin applied to the value bar) */ barOffset: string | number; /** Gets main bar offset in pixels*/ diff --git a/dist/preview release/babylon.js b/dist/preview release/babylon.js index 3ccb8f03b92..ab217f7d33a 100644 --- a/dist/preview release/babylon.js +++ b/dist/preview release/babylon.js @@ -13,4 +13,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function n(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var o=function(){return(o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s}function a(e,t,i,r){return new(i||(i=Promise))(function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):new i(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function c(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]this._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,"isMoreFallbacks",{get:function(){return this._currentRank<=this._maxRank},enumerable:!0,configurable:!0}),e.prototype.reduce=function(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0&&this._mesh.material){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;for(var i=this._mesh.getScene(),r=0;r-1?t:e.ShadersRepository+t,this._engine._loadFile(r+".vertex.fx",i)):i(window.atob(t.substr(7)))},e.prototype._loadFragmentShader=function(t,i){var r;if(o.a.IsWindowObjectExist()&&t instanceof HTMLElement)return void i(o.a.GetDOMTextContent(t));"base64:"!==t.substr(0,7)?e.ShadersStore[t+"PixelShader"]?i(e.ShadersStore[t+"PixelShader"]):e.ShadersStore[t+"FragmentShader"]?i(e.ShadersStore[t+"FragmentShader"]):(r="."===t[0]||"/"===t[0]||t.indexOf("http")>-1?t:e.ShadersRepository+t,this._engine._loadFile(r+".fragment.fx",i)):i(window.atob(t.substr(7)))},e.prototype._dumpShadersSource=function(e,t,i){var r=(this._engine.webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"")+(i?i+"\n":"");t=r+t;var n=2,o=/\n/gm,a="\n1\t"+(e=r+e).replace(o,function(){return"\n"+n+++"\t"});n=2;var c="\n1\t"+t.replace(o,function(){return"\n"+n+++"\t"});this.name.vertexElement?(s.a.Error("Vertex shader: "+this.name.vertexElement+a),s.a.Error("Fragment shader: "+this.name.fragmentElement+c)):this.name.vertex?(s.a.Error("Vertex shader: "+this.name.vertex+a),s.a.Error("Fragment shader: "+this.name.fragment+c)):(s.a.Error("Vertex shader: "+this.name+a),s.a.Error("Fragment shader: "+this.name+c))},e.prototype._processShaderConversion=function(e,t,i){var r=this._processPrecision(e);if(1!=this._engine.webGLVersion)if(-1===r.indexOf("#version 3")){var n=-1!==r.search(/#extension.+GL_EXT_draw_buffers.+require/),o=r.replace(/#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"");o=(o=(o=(o=o.replace(/varying(?![\n\r])\s/g,t?"in ":"out ")).replace(/attribute[ \t]/g,"in ")).replace(/[ \t]attribute/g," in")).replace(/texture2D\s*\(/g,"texture("),t&&(o=(o=(o=(o=(o=(o=(o=o.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(n?"":"out vec4 glFragColor;\n")+"void main(")),i(o)}else i(r.replace("#version 300 es",""));else i(r)},e.prototype._processIncludes=function(t,i){for(var r=this,n=/#include<(.+)>(\((.*)\))*(\[(.*)\])*/g,o=n.exec(t),s=new String(t);null!=o;){var a=o[1];if(-1!==a.indexOf("__decl__")&&(a=a.replace(/__decl__/,""),this._engine.supportsUniformBuffers&&(a=(a=a.replace(/Vertex/,"Ubo")).replace(/Fragment/,"Ubo")),a+="Declaration"),!e.IncludesShadersStore[a]){var c=e.ShadersRepository+"ShadersInclude/"+a+".fx";return void this._engine._loadFile(c,function(t){e.IncludesShadersStore[a]=t,r._processIncludes(s,i)})}var l=e.IncludesShadersStore[a];if(o[2])for(var u=o[3].split(","),h=0;h0},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,i=this._observers;t
";e._AddLogEntry(r)},e._WarnDisabled=function(e){},e._WarnEnabled=function(t){var i=e._FormatMessage(t);console.warn("BJS - "+i);var r="
"+i+"

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

";e._AddLogEntry(r)},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}()},function(e,t,i){"use strict";i.d(t,"c",function(){return m}),i.d(t,"b",function(){return g}),i.d(t,"d",function(){return v}),i.d(t,"e",function(){return y}),i.d(t,"g",function(){return b}),i.d(t,"h",function(){return T}),i.d(t,"f",function(){return E}),i.d(t,"i",function(){return x}),i.d(t,"a",function(){return A});var r,n=i(1),o=i(0),s=i(12),a=i(7),c=i(58),l=i(3),u=i(38),h=i(8),d=i(21),f=i(32),p=i(44),_=i(18),m=function(){function e(){}return e.prototype.getColorToRef=function(e){this.color2?o.f.LerpToRef(this.color1,this.color2,Math.random(),e):e.copyFrom(this.color1)},e}(),g=function(){return function(){}}(),v=function(){function e(){}return e.prototype.getFactor=function(){return void 0===this.factor2?this.factor1:s.a.Lerp(this.factor1,this.factor2,Math.random())},e}(),y=function(e){function t(i,r){var n=e.call(this,i)||this;return n.request=r,n.name="LoadFileError",t._setPrototypeOf(n,t.prototype),n}return n.d(t,e),t._setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t}(Error),b=function(){function e(){}return e.ExponentialBackoff=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=500),function(i,r,n){return 0!==r.status||n>=e||-1!==i.indexOf("file:")?-1:Math.pow(2,n)*t}},e}(),T=function(){function e(){}return e.FetchToRef=function(e,t,i,r,n,o){var s=4*((Math.abs(e)*i%i|0)+(Math.abs(t)*r%r|0)*i);o.r=n[s]/255,o.g=n[s+1]/255,o.b=n[s+2]/255,o.a=n[s+3]/255},e.Mix=function(e,t,i){return e*(1-i)+t*i},e.Instantiate=function(t){if(e.RegisteredExternalClasses&&e.RegisteredExternalClasses[t])return e.RegisteredExternalClasses[t];var i=d.a.GetClass(t);if(i)return i;h.a.Warn(t+" not found, you may have missed an import.");for(var r=t.split("."),n=window||this,o=0,s=r.length;o>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 i=e.CeilingPOT(t),r=e.FloorPOT(t);return i-t>t-r?r:i},e.GetExponentOfTwo=function(t,i,r){var n;switch(void 0===r&&(r=l.a.SCALEMODE_NEAREST),r){case l.a.SCALEMODE_FLOOR:n=e.FloorPOT(t);break;case l.a.SCALEMODE_NEAREST:n=e.NearestPOT(t);break;case l.a.SCALEMODE_CEILING:default:n=e.CeilingPOT(t)}return Math.min(n,i)},e.GetFilename=function(e){var t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)},e.GetFolderPath=function(e,t){void 0===t&&(t=!1);var i=e.lastIndexOf("/");return i<0?t?e:"":e.substring(0,i+1)},e.ToDegrees=function(e){return 180*e/Math.PI},e.ToRadians=function(e){return e*Math.PI/180},e.EncodeArrayBufferTobase64=function(e){for(var t,i,r,n,o,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0,h=new Uint8Array(e);u>2,o=(3&t)<<4|(i=u>4,s=(15&i)<<2|(r=u>6,a=63&r,isNaN(i)?s=a=64:isNaN(r)&&(a=64),l+=c.charAt(n)+c.charAt(o)+c.charAt(s)+c.charAt(a);return"data:image/png;base64,"+l},e.ExtractMinAndMaxIndexed=function(e,t,i,r,n){void 0===n&&(n=null);for(var s=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new o.x(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=i;c=200&&t.status<300||0===t.status&&(!u.a.IsWindowObjectExist()||e.IsFileURL()))return void i(o?t.response:t.responseText,t.responseURL);var r=e.DefaultRetryStrategy;if(r){var f=r(h,t,c);if(-1!==f)return t.removeEventListener("loadend",l),t=new XMLHttpRequest,void(n=setTimeout(function(){return a(c+1)},f))}var _=new y("Error status: "+t.status+" "+t.statusText+" - Unable to load "+h,t);if(!s)throw _;s(t,_)}};t.addEventListener("readystatechange",p),e.UseCustomRequestHeaders&&e.InjectCustomRequestHeaders(t),t.send()};a(0)};if(n&&n.enableSceneOffline){var _=function(e){e&&e.status>400?s&&s(e):d||p()};n.open(function(){d||n&&n.loadFile(t,function(e){d||i(e),f.onCompleteObservable.notifyObservers(f)},r?function(e){d||r(e)}:void 0,_,o)},_)}else p();return f},e.LoadScript=function(e,t,i){if(u.a.IsWindowObjectExist()){var r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(){t&&t()},n.onerror=function(t){i&&i("Unable to load script '"+e+"'",t)},r.appendChild(n)}},e.ReadFileAsDataURL=function(e,t,i){var r=new FileReader,n={onCompleteObservable:new a.c,abort:function(){return r.abort()}};return r.onloadend=function(e){n.onCompleteObservable.notifyObservers(n)},r.onload=function(e){t(e.target.result)},r.onprogress=i,r.readAsDataURL(e),n},e.ReadFile=function(e,t,i,r){var n=new FileReader,o={onCompleteObservable:new a.c,abort:function(){return n.abort()}};return n.onloadend=function(e){return o.onCompleteObservable.notifyObservers(o)},n.onerror=function(i){h.a.Log("Error while reading file: "+e.name),t(JSON.stringify({autoClear:!0,clearColor:[1,0,0],ambientColor:[0,0,0],gravity:[0,-9.807,0],meshes:[],cameras:[],lights:[]}))},n.onload=function(e){t(e.target.result)},i&&(n.onprogress=i),r?n.readAsArrayBuffer(e):n.readAsText(e),o},e.FileAsURL=function(e){var t=new Blob([e]);return(window.URL||window.webkitURL).createObjectURL(t)},e.Format=function(e,t){return void 0===t&&(t=2),e.toFixed(t)},e.CheckExtends=function(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)},e.DeepCopy=function(e,t,i,r){f.a.DeepCopy(e,t,i,r)},e.IsEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},e.RegisterTopRootEvents=function(e){for(var t=0;t=n.gradient&&e<=o.gradient)return void i(n,o,(e-n.gradient)/(o.gradient-n.gradient))}var s=t.length-1;i(t[s],t[s],1)},e.BaseUrl="",e.UseCustomRequestHeaders=!1,e.CustomRequestHeaders={},e.DefaultRetryStrategy=b.ExponentialBackoff(),e.CorsBehavior="anonymous",e.UseFallbackTexture=!0,e.RegisteredExternalClasses={},e.fallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z",e._tmpFloatArray=new Float32Array(1),e.GetDOMTextContent=u.a.GetDOMTextContent,e.PreprocessUrl=function(e){return e},e.NoneLogLevel=h.a.NoneLogLevel,e.MessageLogLevel=h.a.MessageLogLevel,e.WarningLogLevel=h.a.WarningLogLevel,e.ErrorLogLevel=h.a.ErrorLogLevel,e.AllLogLevel=h.a.AllLogLevel,e.IsWindowObjectExist=u.a.IsWindowObjectExist,e.PerformanceNoneLogLevel=0,e.PerformanceUserMarkLogLevel=1,e.PerformanceConsoleLogLevel=2,e.StartPerformanceCounter=e._StartPerformanceCounterDisabled,e.EndPerformanceCounter=e._EndPerformanceCounterDisabled,e}(),E=function(){function e(){this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}return Object.defineProperty(e.prototype,"min",{get:function(){return this._min},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"average",{get:function(){return this._average},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastSecAverage",{get:function(){return this._lastSecAverage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this._totalAccumulated},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._totalValueCount},enumerable:!0,configurable:!0}),e.prototype.fetchNewFrame=function(){this._totalValueCount++,this._current=0,this._lastSecValueCount++},e.prototype.addCount=function(t,i){e.Enabled&&(this._current+=t,i&&this._fetchResult())},e.prototype.beginMonitoring=function(){e.Enabled&&(this._startMonitoringTime=p.a.Now)},e.prototype.endMonitoring=function(t){if(void 0===t&&(t=!0),e.Enabled){t&&this.fetchNewFrame();var i=p.a.Now;this._current=i-this._startMonitoringTime,t&&this._fetchResult()}},e.prototype._fetchResult=function(){this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;var e=p.a.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)},e.Enabled=!0,e}();function x(e,t){return function(i){i.__bjsclassName__=e,i.__bjsmoduleName__=null!=t?t:null}}var A=function(){function e(e,t,i,r){void 0===r&&(r=0),this.iterations=e,this.index=r-1,this._done=!1,this._fn=t,this._successCallback=i}return e.prototype.executeNext=function(){this._done||(this.index+1=t)break;if(r(s),o&&o()){e.breakLoop();break}}e.executeNext()},s)},n)},e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return A}),i.d(t,"c",function(){return P}),i.d(t,"d",function(){return S}),i.d(t,"a",function(){return C});var r=i(1),n=i(7),o=i(9),s=i(32),a=i(28),c=i(0),l=i(25),u=i(4),h=i(13),d=i(56),f=i(24),p=i(47),_=i(42),m=i(19),g=i(63),v=i(53),y=i(3),b=i(2),T=i(8),E=i(21),x=i(18),A=function(){return function(e,t){this.distance=e,this.mesh=t}}(),P=function(){return function(){}}(),R=function(){return function(){this.visibleInstances={},this.renderIdForInstances=new Array,this.batchCache=new S,this.instancesBufferSize=2048}}(),S=function(){return function(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=new Array}}(),C=function(e){function t(i,r,n,o,c,l){void 0===r&&(r=null),void 0===n&&(n=null),void 0===o&&(o=null),void 0===l&&(l=!0);var u=e.call(this,i,r)||this;if(u.delayLoadState=y.a.DELAYLOADSTATE_NONE,u.instances=new Array,u._LODLevels=new Array,u._instanceDataStorage=new R,u._originalBuilderSideOrientation=t.DEFAULTSIDE,u.overrideMaterialSideOrientation=null,u._areNormalsFrozen=!1,u._source=null,u._isMesh=!0,r=u.getScene(),o){if(o._geometry&&o._geometry.applyToMesh(u),s.a.DeepCopy(o,u,["name","material","skeleton","instances","parent","uniqueId","source","metadata","hasLODLevels","geometry","isBlocked","areNormalsFrozen","onBeforeDrawObservable","onBeforeRenderObservable","onAfterRenderObservable","onBeforeDraw","onAfterWorldMatrixUpdateObservable","onCollideObservable","onCollisionPositionChangeObservable","onRebuildObservable","onDisposeObservable"],["_poseMatrix"]),u._source=o,r.useClonedMeshhMap&&(o.meshMap||(o.meshMap={}),o.meshMap[u.uniqueId]=u),u._originalBuilderSideOrientation=o._originalBuilderSideOrientation,u._creationDataStorage=o._creationDataStorage,u._source._ranges){var h=u._source._ranges;for(var i in h)h.hasOwnProperty(i)&&h[i]&&u.createAnimationRange(i,h[i].from,h[i].to)}var d;if(o.metadata&&o.metadata.clone?u.metadata=o.metadata.clone():u.metadata=o.metadata,a.a&&a.a.HasTags(o)&&a.a.AddTagsTo(u,a.a.GetTags(o,!0)),u.parent=o.parent,u.setPivotMatrix(o.getPivotMatrix()),u.id=i+"."+o.id,u.material=o.material,!c)for(var f=o.getDescendants(!0),p=0;p0},enumerable:!0,configurable:!0}),t.prototype.getLODLevels=function(){return this._LODLevels},t.prototype._sortLODLevels=function(){this._LODLevels.sort(function(e,t){return e.distancet.distance?-1:0})},t.prototype.addLODLevel=function(e,t){if(t&&t._masterMesh)return T.a.Warn("You cannot use a mesh as LOD level twice"),this;var i=new A(e,t);return this._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this},t.prototype.getLODLevelAtDistance=function(e){for(var t=0;tr)return this.onLODLevelSelection&&this.onLODLevelSelection(r,this,this._LODLevels[this._LODLevels.length-1].mesh),this;for(var n=0;n0;this.computeWorldMatrix();var s=this.material||n.defaultMaterial;if(s)if(s._storeEffectOnSubMeshes)for(var a=0,c=this.subMeshes;a0){var i=this.getIndices();if(!i)return null;var r=i.length,n=!1;if(e)n=!0;else for(var o=0,s=this.subMeshes;o=r){n=!0;break}if(a.verticesStart+a.verticesCount>=t){n=!0;break}}if(!n)return this.subMeshes[0]}return this.releaseSubMeshes(),new p.b(0,0,t,0,this.getTotalIndices(),this)},t.prototype.subdivide=function(e){if(!(e<1)){for(var t=this.getTotalIndices(),i=t/e|0,r=0;i%3!=0;)i++;this.releaseSubMeshes();for(var n=0;n=t);n++)p.b.CreateFromIndices(0,r,Math.min(i,t-r),this),r+=i;this.synchronizeInstances()}},t.prototype.setVerticesData=function(e,t,i,r){if(void 0===i&&(i=!1),this._geometry)this._geometry.setVerticesData(e,t,i,r);else{var n=new h.a;n.set(t,e);var o=this.getScene();new d.a(d.a.RandomId(),o,n,i,this)}return this},t.prototype.markVerticesDataAsUpdatable=function(e,t){void 0===t&&(t=!0);var i=this.getVertexBuffer(e);i&&i.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)},t.prototype.setVerticesBuffer=function(e){return this._geometry||(this._geometry=d.a.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e),this},t.prototype.updateVerticesData=function(e,t,i,r){return this._geometry?(r?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this},t.prototype.updateMeshPositions=function(e,t){void 0===t&&(t=!0);var i=this.getVerticesData(u.b.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(u.b.PositionKind,i,!1,!1),t){var r=this.getIndices(),n=this.getVerticesData(u.b.NormalKind);if(!n)return this;h.a.ComputeNormals(i,r,n),this.updateVerticesData(u.b.NormalKind,n,!1,!1)}return this},t.prototype.makeGeometryUnique=function(){if(!this._geometry)return this;var e=this._geometry,t=this._geometry.copy(d.a.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this},t.prototype.setIndices=function(e,t,i){if(void 0===t&&(t=null),void 0===i&&(i=!1),this._geometry)this._geometry.setIndices(e,t,i);else{var r=new h.a;r.indices=e;var n=this.getScene();new d.a(d.a.RandomId(),n,r,i,this)}return this},t.prototype.updateIndices=function(e,t){return this._geometry?(this._geometry.updateIndices(e,t),this):this},t.prototype.toLeftHanded=function(){return this._geometry?(this._geometry.toLeftHanded(),this):this},t.prototype._bind=function(e,t,i){if(!this._geometry)return this;var r,n=this.getScene().getEngine();if(this._unIndexed)r=null;else switch(i){case m.a.PointFillMode:r=null;break;case m.a.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),n);break;default:case m.a.TriangleFillMode:r=this._unIndexed?null:this._geometry.getIndexBuffer()}return this._geometry._bind(t,r),this},t.prototype._draw=function(e,t,i,r){if(void 0===r&&(r=!1),!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._onBeforeDrawObservable&&this._onBeforeDrawObservable.notifyObservers(this);var n=this.getScene(),o=n.getEngine();if(this._unIndexed||t==m.a.PointFillMode?o.drawArraysType(t,e.verticesStart,e.verticesCount,i):t==m.a.WireFrameFillMode?o.drawElementsType(t,0,e._linesIndexCount,i):o.drawElementsType(t,e.indexStart,e.indexCount,i),n._isAlternateRenderingEnabled&&!r){var s=e.effect||this._effectiveMaterial.getEffect();if(!s||!n.activeCamera)return this;n._switchToAlternateCameraConfiguration(!0),this._effectiveMaterial.bindView(s),this._effectiveMaterial.bindViewProjection(s),o.setViewport(n.activeCamera._alternateCamera.viewport),this._draw(e,t,i,!0),o.setViewport(n.activeCamera.viewport),n._switchToAlternateCameraConfiguration(!1),this._effectiveMaterial.bindView(s),this._effectiveMaterial.bindViewProjection(s)}return this},t.prototype.registerBeforeRender=function(e){return this.onBeforeRenderObservable.add(e),this},t.prototype.unregisterBeforeRender=function(e){return this.onBeforeRenderObservable.removeCallback(e),this},t.prototype.registerAfterRender=function(e){return this.onAfterRenderObservable.add(e),this},t.prototype.unregisterAfterRender=function(e){return this.onAfterRenderObservable.removeCallback(e),this},t.prototype._getInstancesRenderList=function(e){var t=this.getScene(),i=this._instanceDataStorage.batchCache;if(i.mustReturn=!1,i.renderSelf[e]=this.isEnabled()&&this.isVisible,i.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances){var r=this._instanceDataStorage.visibleInstances,n=t.getRenderId(),o=t._isInIntermediateRendering()?r.intermediateDefaultRenderId:r.defaultRenderId;i.visibleInstances[e]=r[n];var s=this._renderId;!i.visibleInstances[e]&&o&&(i.visibleInstances[e]=r[o],n=Math.max(o,n),s=Math.max(r.selfDefaultRenderId,n));var a=i.visibleInstances[e];if(a&&a.length){if(this._instanceDataStorage.renderIdForInstances[e]===n)return i.mustReturn=!0,i;n!==s&&(i.renderSelf[e]=!1)}this._instanceDataStorage.renderIdForInstances[e]=n}return i},t.prototype._renderWithInstances=function(e,t,i,r,n){var o=i.visibleInstances[e._id];if(!o)return this;for(var s=16*(o.length+1)*4,a=this._instanceDataStorage,c=a.instancesBufferSize,l=a.instancesBuffer;a.instancesBufferSizeh&&r++,0!==_&&f++,d+=_,h=_}if(c[f]++,f>o&&(o=f),0===d)n++;else{var m=1/d,g=0;for(p=0;p.001&&s++}}var v=this.skeleton.bones.length,y=this.getVerticesData(u.b.MatricesIndicesKind),b=this.getVerticesData(u.b.MatricesIndicesExtraKind),T=0;for(l=0;l=v||E<0)&&T++}return{skinned:!0,valid:0===n&&0===s&&0===T,report:"Number of Weights = "+i/4+"\nMaximum influences = "+o+"\nMissing Weights = "+n+"\nNot Sorted = "+r+"\nNot Normalized = "+s+"\nWeightCounts = ["+c+"]\nNumber of bones = "+v+"\nBad Bone Indices = "+T}},t.prototype._checkDelayState=function(){var e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===y.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=y.a.DELAYLOADSTATE_LOADING,this._queueLoad(e)),this},t.prototype._queueLoad=function(e){var t=this;e._addPendingData(this);var i=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return o.h.LoadFile(this.delayLoadingFile,function(i){i instanceof ArrayBuffer?t._delayLoadingFunction(i,t):t._delayLoadingFunction(JSON.parse(i),t),t.instances.forEach(function(e){e._syncSubMeshes()}),t.delayLoadState=y.a.DELAYLOADSTATE_LOADED,e._removePendingData(t)},function(){},e.offlineProvider,i),this},t.prototype.isInFrustum=function(t){return this.delayLoadState!==y.a.DELAYLOADSTATE_LOADING&&(!!e.prototype.isInFrustum.call(this,t)&&(this._checkDelayState(),!0))},t.prototype.setMaterialByID=function(e){var t,i=this.getScene().materials;for(t=i.length-1;t>-1;t--)if(i[t].id===e)return this.material=i[t],this;var r=this.getScene().multiMaterials;for(t=r.length-1;t>-1;t--)if(r[t].id===e)return this.material=r[t],this;return this},t.prototype.getAnimatables=function(){var e=new Array;return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e},t.prototype.bakeTransformIntoVertices=function(e){if(!this.isVerticesDataPresent(u.b.PositionKind))return this;var t=this.subMeshes.splice(0);this._resetPointsArrayCache();var i,r=this.getVerticesData(u.b.PositionKind),n=new Array;for(i=0;i-1&&(n.morphTargetManager=i.getMorphTargetManagerById(e.morphTargetManagerId)),e.skeletonId>-1&&(n.skeleton=i.getLastSkeletonByID(e.skeletonId),e.numBoneInfluencers&&(n.numBoneInfluencers=e.numBoneInfluencers)),e.animations){for(var o=0;o4,l=a?this.getVerticesData(u.b.MatricesIndicesExtraKind):null,h=a?this.getVerticesData(u.b.MatricesWeightsExtraKind):null,d=e.getTransformMatrices(this),f=c.x.Zero(),p=new c.j,_=new c.j,m=0,g=0;g0&&(c.j.FromFloat32ArrayToRefScaled(d,Math.floor(16*n[m+s]),v,_),p.addToSelf(_));if(a)for(s=0;s<4;s++)(v=h[m+s])>0&&(c.j.FromFloat32ArrayToRefScaled(d,Math.floor(16*l[m+s]),v,_),p.addToSelf(_));c.x.TransformCoordinatesFromFloatsToRef(this._sourcePositions[g],this._sourcePositions[g+1],this._sourcePositions[g+2],p,f),f.toArray(i,g),c.x.TransformNormalFromFloatsToRef(this._sourceNormals[g],this._sourceNormals[g+1],this._sourceNormals[g+2],p,f),f.toArray(r,g),p.reset()}return this.updateVerticesData(u.b.PositionKind,i),this.updateVerticesData(u.b.NormalKind,r),this},t.MinMax=function(e){var t=null,i=null;return e.forEach(function(e){var r=e.getBoundingInfo().boundingBox;t&&i?(t.minimizeInPlace(r.minimumWorld),i.maximizeInPlace(r.maximumWorld)):(t=r.minimumWorld,i=r.maximumWorld)}),t&&i?{min:t,max:i}:{min:c.x.Zero(),max:c.x.Zero()}},t.Center=function(e){var i=e instanceof Array?t.MinMax(e):e;return c.x.Center(i.min,i.max)},t.MergeMeshes=function(e,i,r,n,o,s){var a;if(void 0===i&&(i=!0),!r){var c=0;for(a=0;a65536)return T.a.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}if(s){var l,u,d=null;o=!1}var f,_=new Array,m=new Array,v=null,y=new Array,b=null;for(a=0;a-1){if(y.capture&&y.captureConstraint){var x=y.capture,A=y.captureConstraint,P=new RegExp(x).exec(d);if(P&&P.length>0)if(parseInt(P[P.length-1])>=A)continue}for(var R=0,S=T;R1&&!this.disableUniformBuffers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needPOTTextures",{get:function(){return this._webGLVersion<2||this.forcePOTTextures},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doNotHandleContextLost",{get:function(){return this._doNotHandleContextLost},set:function(e){this._doNotHandleContextLost=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"performanceMonitor",{get:function(){return this._performanceMonitor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"texturesSupported",{get:function(){return this._texturesSupported},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureFormatInUse",{get:function(){return this._textureFormatInUse},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentViewport",{get:function(){return this._cachedViewport},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture",{get:function(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,e.TEXTUREFORMAT_RGBA,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture3D",{get:function(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,e.TEXTUREFORMAT_RGBA,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture3D},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyCubeTexture",{get:function(){if(!this._emptyCubeTexture){var t=new Uint8Array(4),i=[t,t,t,t,t,t];this._emptyCubeTexture=this.createRawCubeTexture(i,1,e.TEXTUREFORMAT_RGBA,e.TEXTURETYPE_UNSIGNED_INT,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)}return this._emptyCubeTexture},enumerable:!0,configurable:!0}),e.prototype._disableTouchAction=function(){this._renderingCanvas&&(this._renderingCanvas.setAttribute("touch-action","none"),this._renderingCanvas.style.touchAction="none",this._renderingCanvas.style.msTouchAction="none")},e.prototype._rebuildInternalTextures=function(){for(var e=0,t=this._internalTexturesCache.slice();e1||null!==this._gl.getExtension("OES_standard_derivatives"),this._caps.astc=this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),this._caps.s3tc=this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),this._caps.pvrtc=this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this._caps.etc1=this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),this._caps.etc2=this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),this._caps.textureAnisotropicFilterExtension=this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.uintIndices=this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),this._caps.fragmentDepthSupported=this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),this._caps.highPrecisionShaderSupported=!1,this._caps.timerQuery=this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)>0),this._caps.colorBufferFloat=this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float"),this._caps.textureFloat=!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloat=!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._webGLVersion>1&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._caps.textureLOD=!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),this._webGLVersion>1)this._caps.drawBuffersExtension=!0;else{var t=this._gl.getExtension("WEBGL_draw_buffers");if(null!==t){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=t.drawBuffersWEBGL.bind(t),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(var i=0;i<16;i++)this._gl["COLOR_ATTACHMENT"+i+"_WEBGL"]=t["COLOR_ATTACHMENT"+i+"_WEBGL"]}else this._caps.drawBuffersExtension=!1}if(this._caps.parallelShaderCompile=this._gl.getExtension("KHR_parallel_shader_compile"),this._caps.parallelShaderCompile){var r=this._gl.getParameter(this._caps.parallelShaderCompile.MAX_SHADER_COMPILER_THREADS_KHR);this._caps.parallelShaderCompile.maxShaderCompilerThreadsKHR(r)}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._webGLVersion>1)this._caps.vertexArrayObject=!0;else{var o=this._gl.getExtension("OES_vertex_array_object");null!=o?(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=o.createVertexArrayOES.bind(o),this._gl.bindVertexArray=o.bindVertexArrayOES.bind(o),this._gl.deleteVertexArray=o.deleteVertexArrayOES.bind(o)):this._caps.vertexArrayObject=!1}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{var s=this._gl.getExtension("ANGLE_instanced_arrays");null!=s?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=s.drawArraysInstancedANGLE.bind(s),this._gl.drawElementsInstanced=s.drawElementsInstancedANGLE.bind(s),this._gl.vertexAttribDivisor=s.vertexAttribDivisorANGLE.bind(s)):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 a=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),c=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);a&&c&&(this._caps.highPrecisionShaderSupported=0!==a.precision&&0!==c.precision)}this.setDepthBuffer(!0),this.setDepthFunctionToLessOrEqual(),this.setDepthWrite(!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.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=c.h.QueueNewFrame(this.customAnimationFrameRequester.renderFunction||this._bindedRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._vrDisplay&&this._vrDisplay.isPresenting?this._frameHandler=c.h.QueueNewFrame(this._bindedRenderFunction,this._vrDisplay):this._frameHandler=c.h.QueueNewFrame(this._bindedRenderFunction):this._renderingQueueLaunched=!1},e.prototype.runRenderLoop=function(e){-1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._bindedRenderFunction=this._renderLoop.bind(this),this._frameHandler=c.h.QueueNewFrame(this._bindedRenderFunction)))},e.prototype.switchFullscreen=function(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)},e.prototype.enterFullscreen=function(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&c.h.RequestFullscreen(this._renderingCanvas))},e.prototype.exitFullscreen=function(){this.isFullscreen&&c.h.ExitFullscreen()},e.prototype.clear=function(e,t,i,r){void 0===r&&(r=!1),this.applyStates();var n=0;t&&e&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),n|=this._gl.COLOR_BUFFER_BIT),i&&(this._gl.clearDepth(1),n|=this._gl.DEPTH_BUFFER_BIT),r&&(this._gl.clearStencil(0),n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)},e.prototype.scissorClear=function(e,t,i,r,n){this.enableScissor(e,t,i,r),this.clear(n,!0,!0,!0),this.disableScissor()},e.prototype.enableScissor=function(e,t,i,r){var n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(e,t,i,r)},e.prototype.disableScissor=function(){var e=this._gl;e.disable(e.SCISSOR_TEST)},e.prototype._viewport=function(e,t,i,r){e===this._viewportCached.x&&t===this._viewportCached.y&&i===this._viewportCached.z&&r===this._viewportCached.w||(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=r,this._gl.viewport(e,t,i,r))},e.prototype.setViewport=function(e,t,i){var r=t||this.getRenderWidth(),n=i||this.getRenderHeight(),o=e.x||0,s=e.y||0;this._cachedViewport=e,this._viewport(o*r,s*n,r*e.width,n*e.height)},e.prototype.setDirectViewport=function(e,t,i,r){var n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,r),n},e.prototype.beginFrame=function(){this.onBeginFrameObservable.notifyObservers(this),this._measureFps()},e.prototype.endFrame=function(){if(this._badOS&&this.flushFramebuffer(),this._vrDisplay&&this._vrDisplay.isPresenting)try{this._vrDisplay.submitFrame()}catch(e){c.h.Warn("webVR submitFrame has had an unexpected failure: "+e)}this.onEndFrameObservable.notifyObservers(this)},e.prototype.resize=function(){if(!this._vrDisplay||!this._vrDisplay.isPresenting){var e=this._renderingCanvas?this._renderingCanvas.clientWidth:window.innerWidth,t=this._renderingCanvas?this._renderingCanvas.clientHeight:window.innerHeight;this.setSize(e/this._hardwareScalingLevel,t/this._hardwareScalingLevel)}},e.prototype.setSize=function(e,t){if(this._renderingCanvas&&(this._renderingCanvas.width!==e||this._renderingCanvas.height!==t)){this._renderingCanvas.width=e,this._renderingCanvas.height=t;for(var i=0;i1?"COLOR_ATTACHMENT"+o:"COLOR_ATTACHMENT"+o+"_WEBGL"],r.readBuffer(n[o]),r.drawBuffers(n),r.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,r.COLOR_BUFFER_BIT,r.NEAREST)}for(o=0;o1?"COLOR_ATTACHMENT"+o:"COLOR_ATTACHMENT"+o+"_WEBGL"];r.drawBuffers(n)}for(o=0;o65535){n=!0;break}i=n?new Uint32Array(e):new Uint16Array(e)}else i=new Uint16Array(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),r.references=1,r.is32Bits=n,r},e.prototype.bindArrayBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ARRAY_BUFFER)},e.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e)},e.prototype.bindUniformBufferBase=function(e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e)},e.prototype.bindUniformBlock=function(e,t,i){var r=this._gl.getUniformBlockIndex(e,t);this._gl.uniformBlockBinding(e,r,i)},e.prototype.bindIndexBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)},e.prototype.bindBuffer=function(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e),this._currentBoundBuffer[t]=e)},e.prototype.updateArrayBuffer=function(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)},e.prototype._vertexAttribPointer=function(e,t,i,r,n,o,s){var a=this._currentBufferPointers[t],c=!1;a.active?(a.buffer!==e&&(a.buffer=e,c=!0),a.size!==i&&(a.size=i,c=!0),a.type!==r&&(a.type=r,c=!0),a.normalized!==n&&(a.normalized=n,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=i,a.type=r,a.normalized=n,a.stride=o,a.offset=s,a.buffer=e),(c||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),this._gl.vertexAttribPointer(t,i,r,n,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 i=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var r=0;r=0){var o=e[i[r]];if(!o)continue;this._gl.enableVertexAttribArray(n),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[n]=!0);var s=o.getBuffer();s&&(this._vertexAttribPointer(s,n,o.getSize(),o.type,o.normalized,o.byteStride,o.byteOffset),o.getIsInstanced()&&(this._gl.vertexAttribDivisor(n,o.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(n),this._currentInstanceBuffers.push(s))))}}},e.prototype.recordVertexArrayObject=function(e,t,i){var r=this._gl.createVertexArray();return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(r),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),r},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,i,r,n){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==n){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=n;var o=n.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,i[a],this._gl.FLOAT,!1,r,s)),s+=4*i[a]}}this._bindIndexBufferWithCache(t)},e.prototype._unbindVertexArrayObject=function(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))},e.prototype.bindBuffers=function(e,t,i){this._cachedVertexBuffers===e&&this._cachedEffectForVertexBuffers===i||(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i)),this._bindIndexBufferWithCache(t)},e.prototype.unbindInstanceAttributes=function(){for(var e,t=0,i=this._currentInstanceLocations.length;t1?"#version 300 es\n#define WEBGL2 \n":"",s=this._compileShader(e,"vertex",i,o),a=this._compileShader(t,"fragment",i,o),c=this._createShaderProgram(s,a,r,n);return this.onAfterShaderCompilationObservable.notifyObservers(this),c},e.prototype._createShaderProgram=function(e,t,i,r){void 0===r&&(r=null);var n=i.createProgram();if(!n)throw new Error("Unable to create program");if(i.attachShader(n,e),i.attachShader(n,t),this.webGLVersion>1&&r){var o=this.createTransformFeedback();this.bindTransformFeedback(o),this.setTranformFeedbackVaryings(n,r),n.transformFeedback=o}return i.linkProgram(n),this.webGLVersion>1&&r&&this.bindTransformFeedback(null),n.context=i,n.vertexShader=e,n.fragmentShader=t,this._caps.parallelShaderCompile?n.isParallelCompiled=!0:this._finalizeProgram(n),n},e.prototype._finalizeProgram=function(e){var t,i=e.context,r=e.vertexShader,n=e.fragmentShader;if(!i.getProgramParameter(e,i.LINK_STATUS)&&(t=i.getProgramInfoLog(e)))throw new Error(t);if(this.validateShaderPrograms&&(i.validateProgram(e),!i.getProgramParameter(e,i.VALIDATE_STATUS)&&(t=i.getProgramInfoLog(e))))throw new Error(t);i.deleteShader(r),i.deleteShader(n),e.context=void 0,e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)},e.prototype._isProgramCompiled=function(e){return!e.isParallelCompiled||!!this._gl.getProgramParameter(e,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)&&(this._finalizeProgram(e),!0)},e.prototype._executeWhenProgramIsCompiled=function(e,t){e.isParallelCompiled?e.onCompiled=t:t()},e.prototype.getUniforms=function(e,t){for(var i=new Array,r=0;r-1?m.substring(T).toLowerCase():""),x=null,A=0,P=e._TextureLoaders;Al||t.height>l||null===e._RescalePostProcessFactory)return _._prepareWorkingCanvas(),!(!_._workingCanvas||!_._workingContext)&&(_._workingCanvas.width=i,_._workingCanvas.height=r,_._workingContext.drawImage(t,0,0,t.width,t.height,0,0,i,r),s.texImage2D(s.TEXTURE_2D,0,c,c,s.UNSIGNED_BYTE,_._workingCanvas),b.width=i,b.height=r,!1);var u=new p.a(_,p.a.DATASOURCE_TEMP);return _._bindTextureDirectly(s.TEXTURE_2D,u,!0),s.texImage2D(s.TEXTURE_2D,0,c,c,s.UNSIGNED_BYTE,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),_._rescaleTexture(u,b,n,c,function(){_._releaseTexture(u),_._bindTextureDirectly(s.TEXTURE_2D,b,!0),o()}),!0},o)};!g||y?l instanceof HTMLImageElement?O(l):c.h.LoadImage(m,O,C,n?n.offlineProvider:null):"string"==typeof l||l instanceof ArrayBuffer||l instanceof Blob?c.h.LoadImage(l,O,C,n?n.offlineProvider:null):O(l)}return b},e.prototype._rescaleTexture=function(t,i,r,n,o){var s=this,a=this.createRenderTargetTexture({width:i.width,height:i.height},{generateMipMaps:!1,type:e.TEXTURETYPE_UNSIGNED_INT,samplingMode:e.TEXTURE_BILINEAR_SAMPLINGMODE,generateDepthBuffer:!1,generateStencilBuffer:!1});!this._rescalePostProcess&&e._RescalePostProcessFactory&&(this._rescalePostProcess=e._RescalePostProcessFactory(this)),this._rescalePostProcess.getEffect().executeWhenCompiled(function(){s._rescalePostProcess.onApply=function(e){e._bindTexture("textureSampler",t)};var e=r;e||(e=s.scenes[s.scenes.length-1]),e.postProcessManager.directRender([s._rescalePostProcess],a,!0),s._bindTextureDirectly(s._gl.TEXTURE_2D,i,!0),s._gl.copyTexImage2D(s._gl.TEXTURE_2D,0,n,0,0,i.width,i.height,0),s.unBindFramebuffer(a),s._releaseTexture(a),o&&o()})},e.prototype.updateRawTexture=function(t,i,r,n,o,s){if(void 0===o&&(o=null),void 0===s&&(s=e.TEXTURETYPE_UNSIGNED_INT),t){var a=this._getRGBABufferInternalSizedFormat(s,r),c=this._getInternalFormat(r),l=this._getWebGLTextureType(s);this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(t._bufferView=i,t.format=r,t.type=s,t.invertY=n,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&i?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[o],t.width,t.height,0,i):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,t.width,t.height,0,c,l,i),t.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),t.isReady=!0}},e.prototype.createRawTexture=function(t,i,r,n,o,s,a,c,l){void 0===c&&(c=null),void 0===l&&(l=e.TEXTURETYPE_UNSIGNED_INT);var u=new p.a(this,p.a.DATASOURCE_RAW);u.baseWidth=i,u.baseHeight=r,u.width=i,u.height=r,u.format=n,u.generateMipMaps=o,u.samplingMode=a,u.invertY=s,u._compression=c,u.type=l,this._doNotHandleContextLost||(u._bufferView=t),this.updateRawTexture(u,t,n,s,c,l),this._bindTextureDirectly(this._gl.TEXTURE_2D,u,!0);var h=this._getSamplingParameters(a,o);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,h.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,h.min),o&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(u),u},e.prototype._unpackFlipY=function(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))},e.prototype._getUnpackAlignement=function(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)},e.prototype.createDynamicTexture=function(e,t,i,r){var n=new p.a(this,p.a.DATASOURCE_DYNAMIC);return n.baseWidth=e,n.baseHeight=t,i&&(e=this.needPOTTextures?c.h.GetExponentOfTwo(e,this._caps.maxTextureSize):e,t=this.needPOTTextures?c.h.GetExponentOfTwo(t,this._caps.maxTextureSize):t),n.width=e,n.height=t,n.isReady=!1,n.generateMipMaps=i,n.samplingMode=r,this.updateTextureSamplingMode(r,n),this._internalTexturesCache.push(n),n},e.prototype.updateTextureSamplingMode=function(e,t){var i=this._getSamplingParameters(e,t.generateMipMaps);t.isCube?(this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_MIN_FILTER,i.min),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):t.is3D?(this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_MIN_FILTER,i.min),this._bindTextureDirectly(this._gl.TEXTURE_3D,null)):(this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,i.min),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),t.samplingMode=e},e.prototype.updateDynamicTexture=function(e,t,i,r,n,o){if(void 0===r&&(r=!1),void 0===o&&(o=!1),e){this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0,o),this._unpackFlipY(i),r&&this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);var s=n?this._getInternalFormat(n):this._gl.RGBA;this._gl.texImage2D(this._gl.TEXTURE_2D,0,s,s,this._gl.UNSIGNED_BYTE,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),r&&this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),e.isReady=!0}},e.prototype.updateVideoTexture=function(e,t,i){if(e&&!e._isDisabled){var r=this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0);this._unpackFlipY(!i);try{if(void 0===this._videoTextureSupported&&(this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t),0!==this._gl.getError()?this._videoTextureSupported=!1:this._videoTextureSupported=!0),this._videoTextureSupported)this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t);else{if(!e._workingCanvas){e._workingCanvas=document.createElement("canvas");var n=e._workingCanvas.getContext("2d");if(!n)throw new Error("Unable to get 2d context");e._workingContext=n,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),r||this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}catch(t){e._isDisabled=!0}}},e.prototype.updateTextureComparisonFunction=function(t,i){if(1!==this.webGLVersion){var r=this._gl;t.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,t,!0),0===i?(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,e.LEQUAL),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,i),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,t,!0),0===i?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,e.LEQUAL),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,i),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),t._comparisonFunction=i}else v.a.Error("WebGL 1 does not support texture comparison.")},e.prototype._setupDepthStencilTexture=function(t,i,r,n,o){var s=i.width||i,a=i.height||i;t.baseWidth=s,t.baseHeight=a,t.width=s,t.height=a,t.isReady=!0,t.samples=1,t.generateMipMaps=!1,t._generateDepthBuffer=!0,t._generateStencilBuffer=r,t.samplingMode=n?e.TEXTURE_BILINEAR_SAMPLINGMODE:e.TEXTURE_NEAREST_SAMPLINGMODE,t.type=e.TEXTURETYPE_UNSIGNED_INT,t._comparisonFunction=o;var c=this._gl,l=t.isCube?c.TEXTURE_CUBE_MAP:c.TEXTURE_2D,u=this._getSamplingParameters(t.samplingMode,!1);c.texParameteri(l,c.TEXTURE_MAG_FILTER,u.mag),c.texParameteri(l,c.TEXTURE_MIN_FILTER,u.min),c.texParameteri(l,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(l,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),0===o?(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,e.LEQUAL),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.NONE)):(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,o),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE))},e.prototype.createDepthStencilTexture=function(e,t){if(t.isCube){var i=e.width||e;return this._createDepthStencilCubeTexture(i,t)}return this._createDepthStencilTexture(e,t)},e.prototype._createDepthStencilTexture=function(e,t){var i=new p.a(this,p.a.DATASOURCE_DEPTHTEXTURE);if(!this._caps.depthTextureExtension)return v.a.Error("Depth texture is not supported by your browser or hardware."),i;var n=r.a({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),o=this._gl;return this._bindTextureDirectly(o.TEXTURE_2D,i,!0),this._setupDepthStencilTexture(i,e,n.generateStencil,n.bilinearFiltering,n.comparisonFunction),this.webGLVersion>1?n.generateStencil?o.texImage2D(o.TEXTURE_2D,0,o.DEPTH24_STENCIL8,i.width,i.height,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_COMPONENT24,i.width,i.height,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null):n.generateStencil?o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_STENCIL,i.width,i.height,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_COMPONENT,i.width,i.height,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null),this._bindTextureDirectly(o.TEXTURE_2D,null),i},e.prototype._createDepthStencilCubeTexture=function(e,t){var i=new p.a(this,p.a.DATASOURCE_UNKNOWN);if(i.isCube=!0,1===this.webGLVersion)return v.a.Error("Depth cube texture is not supported by WebGL 1."),i;var n=r.a({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),o=this._gl;this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,i,!0),this._setupDepthStencilTexture(i,e,n.generateStencil,n.bilinearFiltering,n.comparisonFunction);for(var s=0;s<6;s++)n.generateStencil?o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,o.DEPTH24_STENCIL8,e,e,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,o.DEPTH_COMPONENT24,e,e,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null);return this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),i},e.prototype.setFrameBufferDepthStencilTexture=function(e){var t=e.getInternalTexture();if(t&&t._framebuffer&&e.depthStencilTexture){var i=this._gl,r=e.depthStencilTexture;this.bindUnboundFramebuffer(t._framebuffer),r.isCube?r._generateStencilBuffer?i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_CUBE_MAP_POSITIVE_X,r._webGLTexture,0):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_CUBE_MAP_POSITIVE_X,r._webGLTexture,0):r._generateStencilBuffer?i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,r._webGLTexture,0):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,r._webGLTexture,0),this.bindUnboundFramebuffer(null)}},e.prototype.createRenderTargetTexture=function(t,i){var r=new b.a;void 0!==i&&"object"==typeof i?(r.generateMipMaps=i.generateMipMaps,r.generateDepthBuffer=void 0===i.generateDepthBuffer||i.generateDepthBuffer,r.generateStencilBuffer=r.generateDepthBuffer&&i.generateStencilBuffer,r.type=void 0===i.type?e.TEXTURETYPE_UNSIGNED_INT:i.type,r.samplingMode=void 0===i.samplingMode?e.TEXTURE_TRILINEAR_SAMPLINGMODE:i.samplingMode,r.format=void 0===i.format?e.TEXTUREFORMAT_RGBA:i.format):(r.generateMipMaps=i,r.generateDepthBuffer=!0,r.generateStencilBuffer=!1,r.type=e.TEXTURETYPE_UNSIGNED_INT,r.samplingMode=e.TEXTURE_TRILINEAR_SAMPLINGMODE,r.format=e.TEXTUREFORMAT_RGBA),(r.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(r.type!==e.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=e.TEXTURE_NEAREST_SAMPLINGMODE);var n=this._gl,o=new p.a(this,p.a.DATASOURCE_RENDERTARGET);this._bindTextureDirectly(n.TEXTURE_2D,o,!0);var s=t.width||t,a=t.height||t,c=this._getSamplingParameters(r.samplingMode,!!r.generateMipMaps);r.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloat||(r.type=e.TEXTURETYPE_UNSIGNED_INT,v.a.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,c.mag),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,c.min),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texImage2D(n.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(r.type,r.format),s,a,0,this._getInternalFormat(r.format),this._getWebGLTextureType(r.type),null);var l=this._currentFramebuffer,u=n.createFramebuffer();return this.bindUnboundFramebuffer(u),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,o._webGLTexture,0),o._depthStencilBuffer=this._setupFramebufferDepthAttachments(!!r.generateStencilBuffer,r.generateDepthBuffer,s,a),r.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),this.bindUnboundFramebuffer(l),o._framebuffer=u,o.baseWidth=s,o.baseHeight=a,o.width=s,o.height=a,o.isReady=!0,o.samples=1,o.generateMipMaps=!!r.generateMipMaps,o.samplingMode=r.samplingMode,o.type=r.type,o.format=r.format,o._generateDepthBuffer=r.generateDepthBuffer,o._generateStencilBuffer=!!r.generateStencilBuffer,this._internalTexturesCache.push(o),o},e.prototype.createMultipleRenderTarget=function(t,i){var r=!1,n=!0,o=!1,s=!1,a=1,c=e.TEXTURETYPE_UNSIGNED_INT,l=e.TEXTURE_TRILINEAR_SAMPLINGMODE,u=new Array,h=new Array;void 0!==i&&(r=void 0!==i.generateMipMaps&&i.generateMipMaps,n=void 0===i.generateDepthBuffer||i.generateDepthBuffer,o=void 0!==i.generateStencilBuffer&&i.generateStencilBuffer,s=void 0!==i.generateDepthTexture&&i.generateDepthTexture,a=i.textureCount||1,i.types&&(u=i.types),i.samplingModes&&(h=i.samplingModes));var d=this._gl,f=d.createFramebuffer();this.bindUnboundFramebuffer(f);for(var _=t.width||t,m=t.height||t,g=[],y=[],b=this._setupFramebufferDepthAttachments(o,n,_,m),T=0;T1?"COLOR_ATTACHMENT"+T:"COLOR_ATTACHMENT"+T+"_WEBGL"];g.push(P),y.push(R),d.activeTexture(d["TEXTURE"+T]),d.bindTexture(d.TEXTURE_2D,P._webGLTexture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,A.mag),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,A.min),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texImage2D(d.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(x),_,m,0,d.RGBA,this._getWebGLTextureType(x),null),d.framebufferTexture2D(d.DRAW_FRAMEBUFFER,R,d.TEXTURE_2D,P._webGLTexture,0),r&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(d.TEXTURE_2D,null),P._framebuffer=f,P._depthStencilBuffer=b,P.baseWidth=_,P.baseHeight=m,P.width=_,P.height=m,P.isReady=!0,P.samples=1,P.generateMipMaps=r,P.samplingMode=E,P.type=x,P._generateDepthBuffer=n,P._generateStencilBuffer=o,P._attachments=y,this._internalTexturesCache.push(P)}if(s&&this._caps.depthTextureExtension){var S=new p.a(this,p.a.DATASOURCE_MULTIRENDERTARGET);d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,S._webGLTexture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texImage2D(d.TEXTURE_2D,0,this.webGLVersion<2?d.DEPTH_COMPONENT:d.DEPTH_COMPONENT16,_,m,0,d.DEPTH_COMPONENT,d.UNSIGNED_SHORT,null),d.framebufferTexture2D(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.TEXTURE_2D,S._webGLTexture,0),S._framebuffer=f,S.baseWidth=_,S.baseHeight=m,S.width=_,S.height=m,S.isReady=!0,S.samples=1,S.generateMipMaps=r,S.samplingMode=d.NEAREST,S._generateDepthBuffer=n,S._generateStencilBuffer=o,g.push(S),this._internalTexturesCache.push(S)}return d.drawBuffers(y),d.bindRenderbuffer(d.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),this.resetTextureCache(),g},e.prototype._setupFramebufferDepthAttachments=function(e,t,i,r,n){void 0===n&&(n=1);var o=null,s=this._gl;return e?(o=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,o),n>1?s.renderbufferStorageMultisample(s.RENDERBUFFER,n,s.DEPTH24_STENCIL8,i,r):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,r),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,o)):t&&(o=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,o),n>1?s.renderbufferStorageMultisample(s.RENDERBUFFER,n,s.DEPTH_COMPONENT16,i,r):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,i,r),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,o)),o},e.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;var i=this._gl;if(t=Math.min(t,i.getParameter(i.MAX_SAMPLES)),e._depthStencilBuffer&&(i.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(i.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(i.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null),t>1){var r=i.createFramebuffer();if(!r)throw new Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=r,this.bindUnboundFramebuffer(e._MSAAFramebuffer);var n=i.createRenderbuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");i.bindRenderbuffer(i.RENDERBUFFER,n),i.renderbufferStorageMultisample(i.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(e.type),e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n),e._MSAARenderBuffer=n}else this.bindUnboundFramebuffer(e._framebuffer);return e.samples=t,e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t),i.bindRenderbuffer(i.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),t},e.prototype.updateMultipleRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e||0==e.length)return 1;if(e[0].samples===t)return t;var i=this._gl;t=Math.min(t,i.getParameter(i.MAX_SAMPLES)),e[0]._depthStencilBuffer&&(i.deleteRenderbuffer(e[0]._depthStencilBuffer),e[0]._depthStencilBuffer=null),e[0]._MSAAFramebuffer&&(i.deleteFramebuffer(e[0]._MSAAFramebuffer),e[0]._MSAAFramebuffer=null);for(var r=0;r1){var n=i.createFramebuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");this.bindUnboundFramebuffer(n);var o=this._setupFramebufferDepthAttachments(e[0]._generateStencilBuffer,e[0]._generateDepthBuffer,e[0].width,e[0].height,t),s=[];for(r=0;r1?"COLOR_ATTACHMENT"+r:"COLOR_ATTACHMENT"+r+"_WEBGL"],l=i.createRenderbuffer();if(!l)throw new Error("Unable to create multi sampled framebuffer");i.bindRenderbuffer(i.RENDERBUFFER,l),i.renderbufferStorageMultisample(i.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(a.type),a.width,a.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,c,i.RENDERBUFFER,l),a._MSAAFramebuffer=n,a._MSAARenderBuffer=l,a.samples=t,a._depthStencilBuffer=o,i.bindRenderbuffer(i.RENDERBUFFER,null),s.push(c)}i.drawBuffers(s)}else this.bindUnboundFramebuffer(e[0]._framebuffer);return this.bindUnboundFramebuffer(null),t},e.prototype._uploadCompressedDataToTextureDirectly=function(e,t,i,r,n,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,i,r,0,n)},e.prototype._uploadDataToTextureDirectly=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=this._gl,o=this._getWebGLTextureType(e.type),s=this._getInternalFormat(e.format),a=this._getRGBABufferInternalSizedFormat(e.type,s);this._unpackFlipY(e.invertY);var c=n.TEXTURE_2D;e.isCube&&(c=n.TEXTURE_CUBE_MAP_POSITIVE_X+i);var l=Math.round(u.a.Log2(e.width)),h=Math.round(u.a.Log2(e.height)),d=Math.pow(2,Math.max(l-r,0)),f=Math.pow(2,Math.max(h-r,0));n.texImage2D(c,r,a,d,f,0,s,o,t)},e.prototype._uploadArrayBufferViewToTexture=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=this._gl,o=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,i,r),this._bindTextureDirectly(o,null,!0)},e.prototype._uploadImageToTexture=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=this._gl,o=this._getWebGLTextureType(e.type),s=this._getInternalFormat(e.format),a=this._getRGBABufferInternalSizedFormat(e.type,s),c=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(c,e,!0),this._unpackFlipY(e.invertY);var l=n.TEXTURE_2D;e.isCube&&(l=n.TEXTURE_CUBE_MAP_POSITIVE_X+i),n.texImage2D(l,r,a,s,o,t),this._bindTextureDirectly(c,null,!0)},e.prototype.createRenderTargetCubeTexture=function(t,i){var n=r.a({generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:e.TEXTURETYPE_UNSIGNED_INT,samplingMode:e.TEXTURE_TRILINEAR_SAMPLINGMODE,format:e.TEXTUREFORMAT_RGBA},i);n.generateStencilBuffer=n.generateDepthBuffer&&n.generateStencilBuffer,(n.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(n.type!==e.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(n.samplingMode=e.TEXTURE_NEAREST_SAMPLINGMODE);var o=this._gl,s=new p.a(this,p.a.DATASOURCE_RENDERTARGET);this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,s,!0);var a=this._getSamplingParameters(n.samplingMode,n.generateMipMaps);n.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloat||(n.type=e.TEXTURETYPE_UNSIGNED_INT,v.a.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,a.mag),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,a.min),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);for(var c=0;c<6;c++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,this._getRGBABufferInternalSizedFormat(n.type,n.format),t,t,0,this._getInternalFormat(n.format),this._getWebGLTextureType(n.type),null);var l=o.createFramebuffer();return this.bindUnboundFramebuffer(l),s._depthStencilBuffer=this._setupFramebufferDepthAttachments(n.generateStencilBuffer,n.generateDepthBuffer,t,t),n.generateMipMaps&&o.generateMipmap(o.TEXTURE_CUBE_MAP),this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),o.bindRenderbuffer(o.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),s._framebuffer=l,s.width=t,s.height=t,s.isReady=!0,s.isCube=!0,s.samples=1,s.generateMipMaps=n.generateMipMaps,s.samplingMode=n.samplingMode,s.type=n.type,s.format=n.format,s._generateDepthBuffer=n.generateDepthBuffer,s._generateStencilBuffer=n.generateStencilBuffer,this._internalTexturesCache.push(s),s},e.prototype.createCubeTexture=function(t,i,r,n,o,s,a,l,u,h,d,f,_){var m=this;void 0===o&&(o=null),void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=!1),void 0===h&&(h=0),void 0===d&&(d=0),void 0===f&&(f=null),void 0===_&&(_=[]);var g=this._gl,y=f||new p.a(this,p.a.DATASOURCE_CUBE);y.isCube=!0,y.url=t,y.generateMipMaps=!n,y._lodGenerationScale=h,y._lodGenerationOffset=d,this._doNotHandleContextLost||(y._extension=l,y._files=r);for(var b=t.lastIndexOf("."),T=l||(b>-1?t.substring(b).toLowerCase():""),E=null,x=0,A=e._TextureLoaders;x>v,b=0;b<6;b++){var T=g[v][b];m&&(T=f._convertRGBtoRGBATextureData(T,y,y,o)),p.texImage2D(b,v,h,y,y,0,u,s,T)}f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null)}else f.updateRawCubeTexture(_,r,n,o,d);_.isReady=!0,i._removePendingData(_),l&&l()}}(e)},void 0,i.offlineProvider,!0,function(e,t){i._removePendingData(_),u&&e&&u(e.status+" "+e.statusText,t)}),_},e.prototype.updateRawTexture3D=function(t,i,r,n,o,s){void 0===o&&(o=null),void 0===s&&(s=e.TEXTURETYPE_UNSIGNED_INT);var a=this._getWebGLTextureType(s),c=this._getInternalFormat(r),l=this._getRGBABufferInternalSizedFormat(s,r);this._bindTextureDirectly(this._gl.TEXTURE_3D,t,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(t._bufferView=i,t.format=r,t.invertY=n,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&i?this._gl.compressedTexImage3D(this._gl.TEXTURE_3D,0,this.getCaps().s3tc[o],t.width,t.height,t.depth,0,i):this._gl.texImage3D(this._gl.TEXTURE_3D,0,l,t.width,t.height,t.depth,0,c,a,i),t.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_3D),this._bindTextureDirectly(this._gl.TEXTURE_3D,null),t.isReady=!0},e.prototype.createRawTexture3D=function(t,i,r,n,o,s,a,c,l,u){void 0===l&&(l=null),void 0===u&&(u=e.TEXTURETYPE_UNSIGNED_INT);var h=new p.a(this,p.a.DATASOURCE_RAW3D);h.baseWidth=i,h.baseHeight=r,h.baseDepth=n,h.width=i,h.height=r,h.depth=n,h.format=o,h.type=u,h.generateMipMaps=s,h.samplingMode=c,h.is3D=!0,this._doNotHandleContextLost||(h._bufferView=t),this.updateRawTexture3D(h,t,o,a,l,u),this._bindTextureDirectly(this._gl.TEXTURE_3D,h,!0);var d=this._getSamplingParameters(c,s);return this._gl.texParameteri(this._gl.TEXTURE_3D,this._gl.TEXTURE_MAG_FILTER,d.mag),this._gl.texParameteri(this._gl.TEXTURE_3D,this._gl.TEXTURE_MIN_FILTER,d.min),s&&this._gl.generateMipmap(this._gl.TEXTURE_3D),this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._internalTexturesCache.push(h),h},e.prototype._prepareWebGLTextureContinuation=function(e,t,i,r,n){var o=this._gl;if(o){var s=this._getSamplingParameters(n,!i);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,s.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,s.min),i||r||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,i,r,n,o,s,a,l,u){var h=this;void 0===u&&(u=e.TEXTURE_TRILINEAR_SAMPLINGMODE);var d=this.getCaps().maxTextureSize,f=Math.min(d,this.needPOTTextures?c.h.GetExponentOfTwo(r,d):r),p=Math.min(d,this.needPOTTextures?c.h.GetExponentOfTwo(n,d):n),_=this._gl;_&&(t._webGLTexture?(this._bindTextureDirectly(_.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===o||!!o),t.baseWidth=r,t.baseHeight=n,t.width=f,t.height=p,t.isReady=!0,l(f,p,function(){h._prepareWebGLTextureContinuation(t,i,s,a,u)})||this._prepareWebGLTextureContinuation(t,i,s,a,u)):i&&i._removePendingData(t))},e.prototype._convertRGBtoRGBATextureData=function(t,i,r,n){var o;o=n===e.TEXTURETYPE_FLOAT?new Float32Array(i*r*4):new Uint32Array(i*r*4);for(var s=0;s-1?t._designatedSlot:this._nextFreeTextureSlots.length?this._nextFreeTextureSlots[0]:(this._textureCollisions.addCount(1,!1),this._removeDesignatedSlot(this._firstBoundInternalTextureTracker.next));return e},e.prototype._linkTrackers=function(e,t){e.next=t,t.previous=e},e.prototype._removeDesignatedSlot=function(e){var t=e._designatedSlot;return-1===t?-1:(e._designatedSlot=-1,this.disableTextureBindingOptimization?-1:(this._linkTrackers(e.previous,e.next),this._boundTexturesCache[t]=null,this._nextFreeTextureSlots.push(t),t))},e.prototype._activateCurrentTexture=function(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)},e.prototype._bindTextureDirectly=function(e,t,i,r){void 0===i&&(i=!1),void 0===r&&(r=!1);var n=!1;i&&t&&t._designatedSlot>-1&&(this._activeChannel=t._designatedSlot);var o=this._boundTexturesCache[this._activeChannel],s=t&&t._initialSlot>-1;if(o!==t||r){if(o&&this._removeDesignatedSlot(o),this._activateCurrentTexture(),this._gl.bindTexture(e,t?t._webGLTexture:null),this._boundTexturesCache[this._activeChannel]=t,t){if(!this.disableTextureBindingOptimization){var a=this._nextFreeTextureSlots.indexOf(this._activeChannel);a>-1&&this._nextFreeTextureSlots.splice(a,1),this._linkTrackers(this._lastBoundInternalTextureTracker.previous,t),this._linkTrackers(t,this._lastBoundInternalTextureTracker)}t._designatedSlot=this._activeChannel}}else i&&(n=!0,this._activateCurrentTexture());return s&&!i&&this._bindSamplerUniformToChannel(t._initialSlot,this._activeChannel),n},e.prototype._bindTexture=function(e,t){e<0||(t&&(e=this._getCorrectTextureChannel(e,t)),this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,t))},e.prototype.setTextureFromPostProcess=function(e,t){this._bindTexture(e,t?t._textures.data[t._currentRenderTextureInd]:null)},e.prototype.setTextureFromPostProcessOutput=function(e,t){this._bindTexture(e,t?t._outputTexture:null)},e.prototype.unbindAllTextures=function(){for(var e=0;e1&&this._bindTextureDirectly(this._gl.TEXTURE_3D,null)},e.prototype.setTexture=function(e,t,i){e<0||(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))},e.prototype.setDepthStencilTexture=function(e,t,i){e<0||(t&&(this._boundUniforms[e]=t),i&&i.depthStencilTexture?this._setTexture(e,i,!1,!0):this._setTexture(e,null))},e.prototype._bindSamplerUniformToChannel=function(e,t){var i=this._boundUniforms[e];i._currentState!==t&&(this._gl.uniform1i(i,t),i._currentState=t)},e.prototype._getTextureWrapMode=function(t){switch(t){case e.TEXTURE_WRAP_ADDRESSMODE:return this._gl.REPEAT;case e.TEXTURE_CLAMP_ADDRESSMODE:return this._gl.CLAMP_TO_EDGE;case e.TEXTURE_MIRROR_ADDRESSMODE:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT},e.prototype._setTexture=function(t,i,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!1),!i)return null!=this._boundTexturesCache[t]&&(this._activeChannel=t,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&this._bindTextureDirectly(this._gl.TEXTURE_3D,null)),!1;if(i.video)this._activeChannel=t,i.update();else if(i.delayLoadState===e.DELAYLOADSTATE_NOTLOADED)return i.delayLoad(),!1;var o;o=n?i.depthStencilTexture:i.isReady()?i.getInternalTexture():i.isCube?this.emptyCubeTexture:i.is3D?this.emptyTexture3D:this.emptyTexture,r||(t=this._getCorrectTextureChannel(t,o));var s=!0;if(this._boundTexturesCache[t]===o&&(this._moveBoundTextureOnTop(o),r||this._bindSamplerUniformToChannel(o._initialSlot,t),s=!1),this._activeChannel=t,o&&o.is3D)s&&this._bindTextureDirectly(this._gl.TEXTURE_3D,o,r),o&&o._cachedWrapU!==i.wrapU&&(o._cachedWrapU=i.wrapU,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(i.wrapU),o)),o&&o._cachedWrapV!==i.wrapV&&(o._cachedWrapV=i.wrapV,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i.wrapV),o)),o&&o._cachedWrapR!==i.wrapR&&(o._cachedWrapR=i.wrapR,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(i.wrapR),o)),this._setAnisotropicLevel(this._gl.TEXTURE_3D,i);else if(o&&o.isCube){if(s&&this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,o,r),o._cachedCoordinatesMode!==i.coordinatesMode){o._cachedCoordinatesMode=i.coordinatesMode;var a=i.coordinatesMode!==e.TEXTURE_CUBIC_MODE&&i.coordinatesMode!==e.TEXTURE_SKYBOX_MODE?this._gl.REPEAT:this._gl.CLAMP_TO_EDGE;this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_WRAP_S,a,o),this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_WRAP_T,a)}this._setAnisotropicLevel(this._gl.TEXTURE_CUBE_MAP,i)}else s&&this._bindTextureDirectly(this._gl.TEXTURE_2D,o,r),o&&o._cachedWrapU!==i.wrapU&&(o._cachedWrapU=i.wrapU,this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(i.wrapU),o)),o&&o._cachedWrapV!==i.wrapV&&(o._cachedWrapV=i.wrapV,this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i.wrapV),o)),this._setAnisotropicLevel(this._gl.TEXTURE_2D,i);return!0},e.prototype.setTextureArray=function(e,t,i){if(!(e<0)&&t){this._textureUnits&&this._textureUnits.length===i.length||(this._textureUnits=new Int32Array(i.length));for(var r=0;r=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||(this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1)}},e.prototype.releaseEffects=function(){for(var e in this._compiledEffects)this._deleteProgram(this._compiledEffects[e]._program);this._compiledEffects={}},e.prototype.dispose=function(){for(this.hideLoadingUI(),this.stopRenderLoop(),this.onNewSceneAddedObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._rescalePostProcess&&this._rescalePostProcess.dispose();this.scenes.length;)this.scenes[0].dispose();1===e.Instances.length&&e.audioEngine&&e.audioEngine.dispose(),this.releaseEffects(),this.unbindAllAttributes(),this._boundUniforms=[],this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.disableVR(),g.a.IsWindowObjectExist()&&(window.removeEventListener("blur",this._onBlur),window.removeEventListener("focus",this._onFocus),window.removeEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted),window.removeEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted),this._renderingCanvas&&(this._renderingCanvas.removeEventListener("focus",this._onCanvasFocus),this._renderingCanvas.removeEventListener("blur",this._onCanvasBlur),this._renderingCanvas.removeEventListener("pointerout",this._onCanvasPointerOut),this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange),this._onVrDisplayConnect&&(window.removeEventListener("vrdisplayconnect",this._onVrDisplayConnect),this._onVrDisplayDisconnect&&window.removeEventListener("vrdisplaydisconnect",this._onVrDisplayDisconnect),this._onVrDisplayPresentChange&&window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),this._onVrDisplayConnect=null,this._onVrDisplayDisconnect=null));var t=e.Instances.indexOf(this);t>=0&&e.Instances.splice(t,1),this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers=[],this._renderingCanvas=null,this._currentProgram=null,this._bindedRenderFunction=null,this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear(),h.a.ResetCache();for(var i=0,r=this._activeRequests;i-1?s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+r,e._webGLTexture,n):s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e._webGLTexture,n);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*i)),c=s.UNSIGNED_BYTE;break;default:o||(o=new Float32Array(4*t*i)),c=s.FLOAT}return s.readPixels(0,0,t,i,s.RGBA,c,o),s.bindFramebuffer(s.FRAMEBUFFER,this._currentFramebuffer),o},e.prototype._canRenderToFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(e.TEXTURETYPE_FLOAT)},e.prototype._canRenderToHalfFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(e.TEXTURETYPE_HALF_FLOAT)},e.prototype._canRenderToFramebuffer=function(e){for(var t=this._gl;t.getError()!==t.NO_ERROR;);var i=!0,r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),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 n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);var o=t.checkFramebufferStatus(t.FRAMEBUFFER);if((i=(i=i&&o===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){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),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(r),t.deleteFramebuffer(n),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i},e.prototype._getWebGLTextureType=function(t){if(1===this._webGLVersion){switch(t){case e.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case e.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT_OES;case e.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE}return this._gl.UNSIGNED_BYTE}switch(t){case e.TEXTURETYPE_BYTE:return this._gl.BYTE;case e.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case e.TEXTURETYPE_SHORT:return this._gl.SHORT;case e.TEXTURETYPE_UNSIGNED_SHORT:return this._gl.UNSIGNED_SHORT;case e.TEXTURETYPE_INT:return this._gl.INT;case e.TEXTURETYPE_UNSIGNED_INTEGER:return this._gl.UNSIGNED_INT;case e.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case e.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT;case e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5;case e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case e.TEXTURETYPE_UNSIGNED_INT_24_8:return this._gl.UNSIGNED_INT_24_8;case e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE},e.prototype._getInternalFormat=function(t){var i=this._gl.RGBA;switch(t){case e.TEXTUREFORMAT_ALPHA:i=this._gl.ALPHA;break;case e.TEXTUREFORMAT_LUMINANCE:i=this._gl.LUMINANCE;break;case e.TEXTUREFORMAT_LUMINANCE_ALPHA:i=this._gl.LUMINANCE_ALPHA;break;case e.TEXTUREFORMAT_RED:i=this._gl.RED;break;case e.TEXTUREFORMAT_RG:i=this._gl.RG;break;case e.TEXTUREFORMAT_RGB:i=this._gl.RGB;break;case e.TEXTUREFORMAT_RGBA:i=this._gl.RGBA}if(this._webGLVersion>1)switch(t){case e.TEXTUREFORMAT_RED_INTEGER:i=this._gl.RED_INTEGER;break;case e.TEXTUREFORMAT_RG_INTEGER:i=this._gl.RG_INTEGER;break;case e.TEXTUREFORMAT_RGB_INTEGER:i=this._gl.RGB_INTEGER;break;case e.TEXTUREFORMAT_RGBA_INTEGER:i=this._gl.RGBA_INTEGER}return i},e.prototype._getRGBABufferInternalSizedFormat=function(t,i){if(1===this._webGLVersion){if(void 0!==i)switch(i){case e.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case e.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case e.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA}return this._gl.RGBA}switch(t){case e.TEXTURETYPE_BYTE:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R8_SNORM;case e.TEXTUREFORMAT_RG:return this._gl.RG8_SNORM;case e.TEXTUREFORMAT_RGB:return this._gl.RGB8_SNORM;case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8I;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case e.TEXTURETYPE_UNSIGNED_BYTE:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R8;case e.TEXTUREFORMAT_RG:return this._gl.RG8;case e.TEXTUREFORMAT_RGB:return this._gl.RGB8;case e.TEXTUREFORMAT_RGBA:return this._gl.RGBA8;case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8UI;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8UI;default:return this._gl.RGBA8}case e.TEXTURETYPE_SHORT:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16I;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16I}case e.TEXTURETYPE_UNSIGNED_SHORT:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16UI;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16UI}case e.TEXTURETYPE_INT:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32I;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32I}case e.TEXTURETYPE_UNSIGNED_INTEGER:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32UI;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32UI}case e.TEXTURETYPE_FLOAT:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R32F;case e.TEXTUREFORMAT_RG:return this._gl.RG32F;case e.TEXTUREFORMAT_RGB:return this._gl.RGB32F;case e.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA32F}case e.TEXTURETYPE_HALF_FLOAT:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R16F;case e.TEXTUREFORMAT_RG:return this._gl.RG16F;case e.TEXTUREFORMAT_RGB:return this._gl.RGB16F;case e.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA16F}case e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.RGB565;case e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.R11F_G11F_B10F;case e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.RGB9_E5;case e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.RGBA4;case e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.RGB5_A1;case e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:switch(i){case e.TEXTUREFORMAT_RGBA:return this._gl.RGB10_A2;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return this._gl.RGBA8},e.prototype._getRGBAMultiSampleBufferFormat=function(t){return t===e.TEXTURETYPE_FLOAT?this._gl.RGBA32F:t===e.TEXTURETYPE_HALF_FLOAT?this._gl.RGBA16F:this._gl.RGBA8},e.prototype._loadFile=function(e,t,i,r,n,o){var s=this,a=c.h.LoadFile(e,t,i,r,n,o);return this._activeRequests.push(a),a.onCompleteObservable.add(function(e){s._activeRequests.splice(s._activeRequests.indexOf(e),1)}),a},e.prototype._loadFileAsync=function(e,t,i){var r=this;return new Promise(function(n,o){r._loadFile(e,function(e){n(e)},void 0,t,i,function(e,t){o(t)})})},e.prototype._partialLoadFile=function(e,t,i,r,n){void 0===n&&(n=null);this._loadFile(e,function(e){i[t]=e,i._internalCount++,6===i._internalCount&&r(i)},void 0,void 0,!0,function(e,t){n&&e&&n(e.status+" "+e.statusText,t)})},e.prototype._cascadeLoadFiles=function(e,t,i,r){void 0===r&&(r=null);var n=[];n._internalCount=0;for(var o=0;o<6;o++)this._partialLoadFile(i[o],o,n,t,r)},e.isSupported=function(){try{var e=document.createElement("canvas");return null!=(e.getContext("webgl")||e.getContext("experimental-webgl"))&&!!window.WebGLRenderingContext}catch(e){return!1}},e.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Macintosh",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]},{key:"iPhone",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]},{key:"iPad",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]}],e._TextureLoaders=[],e.ALPHA_DISABLE=m.a.ALPHA_DISABLE,e.ALPHA_ADD=m.a.ALPHA_ADD,e.ALPHA_COMBINE=m.a.ALPHA_COMBINE,e.ALPHA_SUBTRACT=m.a.ALPHA_SUBTRACT,e.ALPHA_MULTIPLY=m.a.ALPHA_MULTIPLY,e.ALPHA_MAXIMIZED=m.a.ALPHA_MAXIMIZED,e.ALPHA_ONEONE=m.a.ALPHA_ONEONE,e.ALPHA_PREMULTIPLIED=m.a.ALPHA_PREMULTIPLIED,e.ALPHA_PREMULTIPLIED_PORTERDUFF=m.a.ALPHA_PREMULTIPLIED_PORTERDUFF,e.ALPHA_INTERPOLATE=m.a.ALPHA_INTERPOLATE,e.ALPHA_SCREENMODE=m.a.ALPHA_SCREENMODE,e.DELAYLOADSTATE_NONE=m.a.DELAYLOADSTATE_NONE,e.DELAYLOADSTATE_LOADED=m.a.DELAYLOADSTATE_LOADED,e.DELAYLOADSTATE_LOADING=m.a.DELAYLOADSTATE_LOADING,e.DELAYLOADSTATE_NOTLOADED=m.a.DELAYLOADSTATE_NOTLOADED,e.NEVER=m.a.NEVER,e.ALWAYS=m.a.ALWAYS,e.LESS=m.a.LESS,e.EQUAL=m.a.EQUAL,e.LEQUAL=m.a.LEQUAL,e.GREATER=m.a.GREATER,e.GEQUAL=m.a.GEQUAL,e.NOTEQUAL=m.a.NOTEQUAL,e.KEEP=m.a.KEEP,e.REPLACE=m.a.REPLACE,e.INCR=m.a.INCR,e.DECR=m.a.DECR,e.INVERT=m.a.INVERT,e.INCR_WRAP=m.a.INCR_WRAP,e.DECR_WRAP=m.a.DECR_WRAP,e.TEXTURE_CLAMP_ADDRESSMODE=m.a.TEXTURE_CLAMP_ADDRESSMODE,e.TEXTURE_WRAP_ADDRESSMODE=m.a.TEXTURE_WRAP_ADDRESSMODE,e.TEXTURE_MIRROR_ADDRESSMODE=m.a.TEXTURE_MIRROR_ADDRESSMODE,e.TEXTUREFORMAT_ALPHA=m.a.TEXTUREFORMAT_ALPHA,e.TEXTUREFORMAT_LUMINANCE=m.a.TEXTUREFORMAT_LUMINANCE,e.TEXTUREFORMAT_LUMINANCE_ALPHA=m.a.TEXTUREFORMAT_LUMINANCE_ALPHA,e.TEXTUREFORMAT_RGB=m.a.TEXTUREFORMAT_RGB,e.TEXTUREFORMAT_RGBA=m.a.TEXTUREFORMAT_RGBA,e.TEXTUREFORMAT_RED=m.a.TEXTUREFORMAT_RED,e.TEXTUREFORMAT_R=m.a.TEXTUREFORMAT_R,e.TEXTUREFORMAT_RG=m.a.TEXTUREFORMAT_RG,e.TEXTUREFORMAT_RED_INTEGER=m.a.TEXTUREFORMAT_RED_INTEGER,e.TEXTUREFORMAT_R_INTEGER=m.a.TEXTUREFORMAT_R_INTEGER,e.TEXTUREFORMAT_RG_INTEGER=m.a.TEXTUREFORMAT_RG_INTEGER,e.TEXTUREFORMAT_RGB_INTEGER=m.a.TEXTUREFORMAT_RGB_INTEGER,e.TEXTUREFORMAT_RGBA_INTEGER=m.a.TEXTUREFORMAT_RGBA_INTEGER,e.TEXTURETYPE_UNSIGNED_BYTE=m.a.TEXTURETYPE_UNSIGNED_BYTE,e.TEXTURETYPE_UNSIGNED_INT=m.a.TEXTURETYPE_UNSIGNED_INT,e.TEXTURETYPE_FLOAT=m.a.TEXTURETYPE_FLOAT,e.TEXTURETYPE_HALF_FLOAT=m.a.TEXTURETYPE_HALF_FLOAT,e.TEXTURETYPE_BYTE=m.a.TEXTURETYPE_BYTE,e.TEXTURETYPE_SHORT=m.a.TEXTURETYPE_SHORT,e.TEXTURETYPE_UNSIGNED_SHORT=m.a.TEXTURETYPE_UNSIGNED_SHORT,e.TEXTURETYPE_INT=m.a.TEXTURETYPE_INT,e.TEXTURETYPE_UNSIGNED_INTEGER=m.a.TEXTURETYPE_UNSIGNED_INTEGER,e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4,e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1,e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=m.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV,e.TEXTURETYPE_UNSIGNED_INT_24_8=m.a.TEXTURETYPE_UNSIGNED_INT_24_8,e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=m.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV,e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=m.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV,e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=m.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV,e.TEXTURE_NEAREST_SAMPLINGMODE=m.a.TEXTURE_NEAREST_SAMPLINGMODE,e.TEXTURE_BILINEAR_SAMPLINGMODE=m.a.TEXTURE_BILINEAR_SAMPLINGMODE,e.TEXTURE_TRILINEAR_SAMPLINGMODE=m.a.TEXTURE_TRILINEAR_SAMPLINGMODE,e.TEXTURE_NEAREST_NEAREST_MIPLINEAR=m.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR,e.TEXTURE_LINEAR_LINEAR_MIPNEAREST=m.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST,e.TEXTURE_LINEAR_LINEAR_MIPLINEAR=m.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR,e.TEXTURE_NEAREST_NEAREST_MIPNEAREST=m.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST,e.TEXTURE_NEAREST_LINEAR_MIPNEAREST=m.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST,e.TEXTURE_NEAREST_LINEAR_MIPLINEAR=m.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR,e.TEXTURE_NEAREST_LINEAR=m.a.TEXTURE_NEAREST_LINEAR,e.TEXTURE_NEAREST_NEAREST=m.a.TEXTURE_NEAREST_NEAREST,e.TEXTURE_LINEAR_NEAREST_MIPNEAREST=m.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST,e.TEXTURE_LINEAR_NEAREST_MIPLINEAR=m.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR,e.TEXTURE_LINEAR_LINEAR=m.a.TEXTURE_LINEAR_LINEAR,e.TEXTURE_LINEAR_NEAREST=m.a.TEXTURE_LINEAR_NEAREST,e.TEXTURE_EXPLICIT_MODE=m.a.TEXTURE_EXPLICIT_MODE,e.TEXTURE_SPHERICAL_MODE=m.a.TEXTURE_SPHERICAL_MODE,e.TEXTURE_PLANAR_MODE=m.a.TEXTURE_PLANAR_MODE,e.TEXTURE_CUBIC_MODE=m.a.TEXTURE_CUBIC_MODE,e.TEXTURE_PROJECTION_MODE=m.a.TEXTURE_PROJECTION_MODE,e.TEXTURE_SKYBOX_MODE=m.a.TEXTURE_SKYBOX_MODE,e.TEXTURE_INVCUBIC_MODE=m.a.TEXTURE_INVCUBIC_MODE,e.TEXTURE_EQUIRECTANGULAR_MODE=m.a.TEXTURE_EQUIRECTANGULAR_MODE,e.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=m.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,e.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=m.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,e.SCALEMODE_FLOOR=m.a.SCALEMODE_FLOOR,e.SCALEMODE_NEAREST=m.a.SCALEMODE_NEAREST,e.SCALEMODE_CEILING=m.a.SCALEMODE_CEILING,e.CollisionsEpsilon=.001,e._RescalePostProcessFactory=null,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.WithinEpsilon=function(e,t,i){void 0===i&&(i=1.401298e-45);var r=e-t;return-i<=r&&r<=i},e.ToHex=function(e){var t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},e.Sign=function(e){return 0===(e=+e)||isNaN(e)?e:e>0?1:-1},e.Clamp=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=1),Math.min(i,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,i){return(e-t)/(i-t)},e.Denormalize=function(e,t,i){return e*(i-t)+t},e.DeltaAngle=function(t,i){var r=e.Repeat(i-t,360);return r>180&&(r-=360),r},e.PingPong=function(t,i){var r=e.Repeat(t,2*i);return i-Math.abs(r-i)},e.SmoothStep=function(t,i,r){var n=e.Clamp(r);return i*(n=-2*n*n*n+3*n*n)+t*(1-n)},e.MoveTowards=function(t,i,r){return Math.abs(i-t)<=r?i:t+e.Sign(i-t)*r},e.MoveTowardsAngle=function(t,i,r){var n=e.DeltaAngle(t,i),o=0;return-r180&&(n-=360),t+n*e.Clamp(r)},e.InverseLerp=function(t,i,r){return t!=i?e.Clamp((r-t)/(i-t)):0},e.Hermite=function(e,t,i,r,n){var o=n*n,s=n*o;return e*(2*s-3*o+1)+i*(-2*s+3*o)+t*(s-2*o+n)+r*(s-o)},e.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},e.RangeToPercent=function(e,t,i){return(e-t)/(i-t)},e.PercentToRange=function(e,t,i){return(i-t)*e+t},e.NormalizeRadians=function(t){return t-=e.TwoPi*Math.floor((t+Math.PI)/e.TwoPi)},e.TwoPi=2*Math.PI,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=i(4),o=i(18),s=function(){function e(){}return e.prototype.set=function(e,t){switch(t){case n.b.PositionKind:this.positions=e;break;case n.b.NormalKind:this.normals=e;break;case n.b.TangentKind:this.tangents=e;break;case n.b.UVKind:this.uvs=e;break;case n.b.UV2Kind:this.uvs2=e;break;case n.b.UV3Kind:this.uvs3=e;break;case n.b.UV4Kind:this.uvs4=e;break;case n.b.UV5Kind:this.uvs5=e;break;case n.b.UV6Kind:this.uvs6=e;break;case n.b.ColorKind:this.colors=e;break;case n.b.MatricesIndicesKind:this.matricesIndices=e;break;case n.b.MatricesWeightsKind:this.matricesWeights=e;break;case n.b.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case n.b.MatricesWeightsExtraKind:this.matricesWeightsExtra=e}},e.prototype.applyToMesh=function(e,t){return this._applyTo(e,t),this},e.prototype.applyToGeometry=function(e,t){return this._applyTo(e,t),this},e.prototype.updateMesh=function(e){return this._update(e),this},e.prototype.updateGeometry=function(e){return this._update(e),this},e.prototype._applyTo=function(e,t){return void 0===t&&(t=!1),this.positions&&e.setVerticesData(n.b.PositionKind,this.positions,t),this.normals&&e.setVerticesData(n.b.NormalKind,this.normals,t),this.tangents&&e.setVerticesData(n.b.TangentKind,this.tangents,t),this.uvs&&e.setVerticesData(n.b.UVKind,this.uvs,t),this.uvs2&&e.setVerticesData(n.b.UV2Kind,this.uvs2,t),this.uvs3&&e.setVerticesData(n.b.UV3Kind,this.uvs3,t),this.uvs4&&e.setVerticesData(n.b.UV4Kind,this.uvs4,t),this.uvs5&&e.setVerticesData(n.b.UV5Kind,this.uvs5,t),this.uvs6&&e.setVerticesData(n.b.UV6Kind,this.uvs6,t),this.colors&&e.setVerticesData(n.b.ColorKind,this.colors,t),this.matricesIndices&&e.setVerticesData(n.b.MatricesIndicesKind,this.matricesIndices,t),this.matricesWeights&&e.setVerticesData(n.b.MatricesWeightsKind,this.matricesWeights,t),this.matricesIndicesExtra&&e.setVerticesData(n.b.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),this.matricesWeightsExtra&&e.setVerticesData(n.b.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),this.indices?e.setIndices(this.indices,null,t):e.setIndices([],null),this},e.prototype._update=function(e,t,i){return this.positions&&e.updateVerticesData(n.b.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(n.b.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(n.b.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(n.b.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(n.b.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(n.b.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(n.b.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(n.b.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(n.b.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(n.b.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(n.b.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(n.b.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(n.b.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(n.b.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this},e.prototype.transform=function(e){var t,i=e.m[0]*e.m[5]*e.m[10]<0,n=r.x.Zero();if(this.positions){var o=r.x.Zero();for(t=0;tn.bbSize.y?n.bbSize.x:n.bbSize.y;$=$>n.bbSize.z?$:n.bbSize.z,w=n.subDiv.X*O/n.bbSize.x,L=n.subDiv.Y*O/n.bbSize.y,F=n.subDiv.Z*O/n.bbSize.z,N=n.subDiv.max*n.subDiv.max,n.facetPartitioning.length=0}for(o=0;o0){for(var e=0,t=this._transientComponents;et.LongPressDelay&&!r._isPointerSwiping()&&(r._startingPointerTime=0,n.processTrigger(A.a.ACTION_OnLongPressTrigger,b.a.CreateNew(e.pickedMesh,i)))},t.LongPressDelay)}}else for(var o=0,s=this._pointerDownStage;ot.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>t.DragMovementThreshold},t.prototype.attachControl=function(e,i,r){var o=this;void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===r&&(r=!0),this._initActionManager=function(e,t){if(!o._meshPickProceed){var i=o.pick(o._unTranslatedPointerX,o._unTranslatedPointerY,o.pointerDownPredicate,!1,o.cameraToUseForPointers);o._currentPickResult=i,i&&(e=i.hit&&i.pickedMesh?i.pickedMesh.actionManager:null),o._meshPickProceed=!0}return e},this._delayedSimpleClick=function(e,i,r){(Date.now()-o._previousStartingPointerTime>t.DoubleClickDelay&&!o._doubleClickOccured||e!==o._previousButtonPressed)&&(o._doubleClickOccured=!1,i.singleClick=!0,i.ignore=!1,r(i,o._currentPickResult))},this._initClickEvent=function(e,i,r,n){var s=new O;o._currentPickResult=null;var a=null,c=e.hasSpecificMask(v.a.POINTERPICK)||i.hasSpecificMask(v.a.POINTERPICK)||e.hasSpecificMask(v.a.POINTERTAP)||i.hasSpecificMask(v.a.POINTERTAP)||e.hasSpecificMask(v.a.POINTERDOUBLETAP)||i.hasSpecificMask(v.a.POINTERDOUBLETAP);!c&&C.a&&(a=o._initActionManager(a,s))&&(c=a.hasPickTriggers);var l=!1;if(c){var u=r.button;if(s.hasSwiped=o._isPointerSwiping(),!s.hasSwiped){var h=!t.ExclusiveDoubleClickMode;h||(h=!e.hasSpecificMask(v.a.POINTERDOUBLETAP)&&!i.hasSpecificMask(v.a.POINTERDOUBLETAP))&&!C.a.HasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)&&(a=o._initActionManager(a,s))&&(h=!a.hasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)),h?(Date.now()-o._previousStartingPointerTime>t.DoubleClickDelay||u!==o._previousButtonPressed)&&(s.singleClick=!0,n(s,o._currentPickResult),l=!0):(o._previousDelayedSimpleClickTimeout=o._delayedSimpleClickTimeout,o._delayedSimpleClickTimeout=window.setTimeout(o._delayedSimpleClick.bind(o,u,s,n),t.DoubleClickDelay));var d=e.hasSpecificMask(v.a.POINTERDOUBLETAP)||i.hasSpecificMask(v.a.POINTERDOUBLETAP);!d&&C.a.HasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)&&(a=o._initActionManager(a,s))&&(d=a.hasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)),d&&(u===o._previousButtonPressed&&Date.now()-o._previousStartingPointerTime0)return!1;for(e=0;e0,n=0,o=this._isReadyForMeshStage;n0)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;if(this._registerTransientComponents(),this.isReady())return this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1);this._executeWhenReadyTimeoutId=setTimeout(function(){e._checkIsReady()},150)},Object.defineProperty(t.prototype,"animatables",{get:function(){return this._activeAnimatables},enumerable:!0,configurable:!0}),t.prototype.resetLastAnimationTimeFrame=function(){this._animationTimeLast=o.a.Now},t.prototype._switchToAlternateCameraConfiguration=function(e){this._useAlternateCameraConfiguration=e},t.prototype.getViewMatrix=function(){return this._useAlternateCameraConfiguration?this._alternateViewMatrix:this._viewMatrix},t.prototype.getProjectionMatrix=function(){return this._useAlternateCameraConfiguration?this._alternateProjectionMatrix:this._projectionMatrix},t.prototype.getTransformMatrix=function(){return this._useAlternateCameraConfiguration?this._alternateTransformMatrix:this._transformMatrix},t.prototype.setTransformMatrix=function(e,t){if(this._viewUpdateFlag!==e.updateFlag||this._projectionUpdateFlag!==t.updateFlag){if(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?u.i.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=u.i.GetPlanes(this._transformMatrix),this.activeCamera&&this.activeCamera._alternateCamera){var i=this.activeCamera._alternateCamera;i.getViewMatrix().multiplyToRef(i.getProjectionMatrix(),u.t.Matrix[0]),u.i.GetRightPlaneToRef(u.t.Matrix[0],this._frustumPlanes[3])}this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.update())}},t.prototype._setAlternateTransformMatrix=function(e,t){this._alternateViewUpdateFlag===e.updateFlag&&this._alternateProjectionUpdateFlag===t.updateFlag||(this._alternateViewUpdateFlag=e.updateFlag,this._alternateProjectionUpdateFlag=t.updateFlag,this._alternateViewMatrix=e,this._alternateProjectionMatrix=t,this._alternateTransformMatrix||(this._alternateTransformMatrix=u.j.Zero()),this._alternateViewMatrix.multiplyToRef(this._alternateProjectionMatrix,this._alternateTransformMatrix),this._alternateSceneUbo||this._createAlternateUbo(),this._alternateSceneUbo.useUbo&&(this._alternateSceneUbo.updateMatrix("viewProjection",this._alternateTransformMatrix),this._alternateSceneUbo.updateMatrix("view",this._alternateViewMatrix),this._alternateSceneUbo.update()))},t.prototype.getSceneUniformBuffer=function(){return this._useAlternateCameraConfiguration?this._alternateSceneUbo:this._sceneUbo},t.prototype.getUniqueId=function(){var e=t._uniqueIdCounter;return t._uniqueIdCounter++,e},t.prototype.addMesh=function(e,t){var i=this;void 0===t&&(t=!1),this.meshes.push(e),e._resyncLightSources(),this.onNewMeshAddedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){i.addMesh(e)})},t.prototype.removeMesh=function(e,t){var i=this;void 0===t&&(t=!1);var r=this.meshes.indexOf(e);return-1!==r&&(this.meshes[r]=this.meshes[this.meshes.length-1],this.meshes.pop()),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){i.removeMesh(e)}),r},t.prototype.addTransformNode=function(e){e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),this.onNewTransformNodeAddedObservable.notifyObservers(e)},t.prototype.removeTransformNode=function(e){var t=e._indexInSceneTransformNodesArray;if(-1!==t){if(t!==this.transformNodes.length-1){var i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t},t.prototype.removeSkeleton=function(e){var t=this.skeletons.indexOf(e);return-1!==t&&this.skeletons.splice(t,1),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 i=0,r=this.meshes;i0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t},t.prototype.removeParticleSystem=function(e){var t=this.particleSystems.indexOf(e);return-1!==t&&this.particleSystems.splice(t,1),t},t.prototype.removeAnimation=function(e){var t=this.animations.indexOf(e);return-1!==t&&this.animations.splice(t,1),t},t.prototype.removeAnimationGroup=function(e){var t=this.animationGroups.indexOf(e);return-1!==t&&this.animationGroups.splice(t,1),t},t.prototype.removeMultiMaterial=function(e){var t=this.multiMaterials.indexOf(e);return-1!==t&&this.multiMaterials.splice(t,1),t},t.prototype.removeMaterial=function(e){var t=e._indexInSceneMaterialArray;if(-1!==t&&t=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 i=this.getTransformNodeByID(e);if(i)return i;var r=this.getLightByID(e);if(r)return r;var n=this.getCameraByID(e);if(n)return n;var o=this.getBoneByID(e);return o||null},t.prototype.getNodeByName=function(e){var t=this.getMeshByName(e);if(t)return t;var i=this.getTransformNodeByName(e);if(i)return i;var r=this.getLightByName(e);if(r)return r;var n=this.getCameraByName(e);if(n)return n;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.getSkeletonById=function(e){for(var t=0;t0&&0!=(o.layerMask&this.activeCamera.layerMask)&&(o.alwaysSelectAsActiveMesh||o.isInFrustum(this._frustumPlanes))&&(this._activeMeshes.push(o),this.activeCamera._activeMeshes.push(o),o._activate(this._renderId),s!==o&&s._activate(this._renderId),this._activeMesh(o,s)))}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(var a=0;a0)for(var n=this.getActiveSubMeshCandidates(t),o=n.length,s=0;s0&&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){n.h.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(var c=0;c0),this._renderId++}for(var h=0,d=this._cameraDrawRenderTargetStage;h-1&&(r.trigger===A.a.ACTION_OnIntersectionExitTrigger&&r._executeCurrent(b.a.CreateNew(t,void 0,o)),t.actionManager.hasSpecificTrigger(A.a.ACTION_OnIntersectionExitTrigger,function(e){var t=e instanceof h.a?e:e.mesh;return o===t})&&r.trigger!==A.a.ACTION_OnIntersectionExitTrigger||t._intersectionsInProgress.splice(a,1))}}}},t.prototype._advancePhysicsEngineStep=function(e){},t.prototype._animate=function(){},t.prototype.render=function(e){if(void 0===e&&(e=!0),!this.isDisposed){if(this._frameId++,this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(A.a.ACTION_OnEveryFrameTrigger),this._engine.isDeterministicLockStep()){var i=Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime))+this._timeAccumulator,r=this.getDeterministicFrameTime(),o=0,s=this._engine.getLockstepMaxSteps(),a=Math.floor(i/60);a=Math.min(a,s);do{this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=.06*r,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this._advancePhysicsEngineStep(r),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,o++,i-=r}while(i>0&&o0)for(var u=0;u0),this._intermediateRendering=!0;for(var m=0;m0),this._intermediateRendering=!1,this._renderId++}this.customRenderTargets.length>0&&p.restoreDefaultFramebuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.activeCamera=_;for(var v=0,y=this._beforeClearStage;v0)for(u=0;u0&&this._engine.clear(null,!1,!0,!0),this._processSubCameras(this.activeCameras[u]);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera)}this._checkIntersections();for(var E=0,x=this._afterRenderStage;E-1&&this._engine.scenes.splice(n,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;e0,t.NUM_MORPH_INFLUENCERS=l.numInfluencers):(t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)}return!0},e.PrepareDefinesForLights=function(e,t,i,r,n,o){if(void 0===n&&(n=4),void 0===o&&(o=!1),!i._areLightsDirty)return i._needNormals;var s=0,a=!1,l=!1,u=!1,h=!1,d=!1;if(e.lightsEnabled&&!o)for(var f=0,p=t._lightSources;f0&&(h=!0,m.prepareDefines(i,s))}}if(_.lightmapMode!=c.a.LIGHTMAP_DEFAULT?(u=!0,i["LIGHTMAPEXCLUDED"+s]=!0,i["LIGHTMAPNOSPECULAR"+s]=_.lightmapMode==c.a.LIGHTMAP_SHADOWSONLY):(i["LIGHTMAPEXCLUDED"+s]=!1,i["LIGHTMAPNOSPECULAR"+s]=!1),++s===n)break}i.SPECULARTERM=d,i.SHADOWS=h;for(var v=s;v0&&(n=r+o,t.addFallback(n,"LIGHT"+o)),e.SHADOWS||(e["SHADOW"+o]&&t.addFallback(r,"SHADOW"+o),e["SHADOWPCF"+o]&&t.addFallback(r,"SHADOWPCF"+o),e["SHADOWPCSS"+o]&&t.addFallback(r,"SHADOWPCSS"+o),e["SHADOWPOISSON"+o]&&t.addFallback(r,"SHADOWPOISSON"+o),e["SHADOWESM"+o]&&t.addFallback(r,"SHADOWESM"+o));return n++},e.PrepareAttributesForMorphTargets=function(e,t,i){var n=i.NUM_MORPH_INFLUENCERS;if(n>0&&s.a.LastCreatedEngine)for(var o=s.a.LastCreatedEngine.getCaps().maxVertexAttribs,c=t.morphTargetManager,l=c&&c.supportsNormals&&i.NORMAL,u=c&&c.supportsTangents&&i.TANGENT,h=0;ho&&r.a.Error("Cannot add more vertex attributes for mesh "+t.name)},e.PrepareAttributesForBones=function(e,t,i,r){i.NUM_BONE_INFLUENCERS>0&&(r.addCPUSkinningFallback(0,t),e.push(a.b.MatricesIndicesKind),e.push(a.b.MatricesWeightsKind),i.NUM_BONE_INFLUENCERS>4&&(e.push(a.b.MatricesIndicesExtraKind),e.push(a.b.MatricesWeightsExtraKind)))},e.PrepareAttributesForInstances=function(e,t){t.INSTANCES&&(e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3"))},e.BindLightShadow=function(e,t,i,r){if(e.shadowEnabled&&t.receiveShadows){var n=e.getShadowGenerator();n&&n.bindShadowLight(i,r)}},e.BindLightProperties=function(e,t,i){e.transferToEffect(t,i+"")},e.BindLights=function(t,i,r,n,s,a){void 0===s&&(s=4),void 0===a&&(a=!1);for(var c=Math.min(i._lightSources.length,s),l=0;l-1){var r=i.getTransformMatrixTexture();t.setTexture("boneSampler",r),t.setFloat("boneTextureWidth",4*(i.bones.length+1))}else{var n=i.getTransformMatrices(e);n&&t.setMatrices("mBones",n)}}},e.BindMorphTargetParameters=function(e,t){var i=e.morphTargetManager;e&&i&&t.setFloatArray("morphTargetInfluences",i.influences)},e.BindLogDepth=function(e,t,i){e.LOGARITHMICDEPTH&&t.setFloat("logarithmicDepthConstant",2/(Math.log(i.activeCamera.maxZ+1)/Math.LN2))},e.BindClipPlane=function(e,t){if(t.clipPlane){var i=t.clipPlane;e.setFloat4("vClipPlane",i.normal.x,i.normal.y,i.normal.z,i.d)}if(t.clipPlane2){i=t.clipPlane2;e.setFloat4("vClipPlane2",i.normal.x,i.normal.y,i.normal.z,i.d)}if(t.clipPlane3){i=t.clipPlane3;e.setFloat4("vClipPlane3",i.normal.x,i.normal.y,i.normal.z,i.d)}if(t.clipPlane4){i=t.clipPlane4;e.setFloat4("vClipPlane4",i.normal.x,i.normal.y,i.normal.z,i.d)}},e._tempFogColor=o.e.Black(),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.WarnImport=function(e){return e+" needs to be imported before as it contains a side-effect required by your code."},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var r=i(1),n=i(2),o=i(9),s=i(7),a=i(0),c=i(23),l=i(47),u=i(68),h=i(3),d=i(8),f=function(){function e(t,i,r){this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.onDisposeObservable=new s.c,this._alphaMode=h.a.ALPHA_COMBINE,this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.forceDepthWrite=!1,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this._wasPreviouslyReady=!1,this._fillMode=e.TriangleFillMode,this._indexInSceneMaterialArray=-1,this.name=t,this.id=t||o.h.RandomId(),this._scene=i||c.a.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.useRightHandedSystem?this.sideOrientation=e.ClockWiseSideOrientation:this.sideOrientation=e.CounterClockWiseSideOrientation,this._uniformBuffer=new u.a(this._scene.getEngine()),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,r||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.c),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.c),this._onUnBindObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alphaMode",{get:function(){return this._alphaMode},set:function(t){this._alphaMode!==t&&(this._alphaMode=t,this.markAsDirty(e.TextureDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needDepthPrePass",{get:function(){return this._needDepthPrePass},set:function(e){this._needDepthPrePass!==e&&(this._needDepthPrePass=e,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fogEnabled",{get:function(){return this._fogEnabled},set:function(t){this._fogEnabled!==t&&(this._fogEnabled=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wireframe",{get:function(){switch(this._fillMode){case e.WireFrameFillMode:case e.LineListDrawMode:case e.LineLoopDrawMode:case e.LineStripDrawMode:return!0}return this._scene.forceWireframe},set:function(t){this.fillMode=t?e.WireFrameFillMode:e.TriangleFillMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pointsCloud",{get:function(){switch(this._fillMode){case e.PointFillMode:case e.PointListDrawMode:return!0}return this._scene.forcePointsCloud},set:function(t){this.fillMode=t?e.PointFillMode:e.TriangleFillMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(t){this._fillMode!==t&&(this._fillMode=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){return"Name: "+this.name},e.prototype.getClassName=function(){return"Material"},Object.defineProperty(e.prototype,"isFrozen",{get:function(){return this.checkReadyOnlyOnce},enumerable:!0,configurable:!0}),e.prototype.freeze=function(){this.checkReadyOnlyOnce=!0},e.prototype.unfreeze=function(){this.checkReadyOnlyOnce=!1},e.prototype.isReady=function(e,t){return!0},e.prototype.isReadyForSubMesh=function(e,t,i){return!1},e.prototype.getEffect=function(){return this._effect},e.prototype.getScene=function(){return this._scene},e.prototype.needAlphaBlending=function(){return this.alpha<1},e.prototype.needAlphaBlendingForMesh=function(e){return this.needAlphaBlending()||e.visibility<1||e.hasVertexAlpha},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.markDirty=function(){this._wasPreviouslyReady=!1},e.prototype._preBind=function(t,i){void 0===i&&(i=null);var r=this._scene.getEngine(),n=(null==i?this.sideOrientation:i)===e.ClockWiseSideOrientation;return r.enableEffect(t||this._effect),r.setState(this.backFaceCulling,this.zOffset,!1,n),n},e.prototype.bind=function(e,t){},e.prototype.bindForSubMesh=function(e,t,i){},e.prototype.bindOnlyWorldMatrix=function(e){},e.prototype.bindSceneUniformBuffer=function(e,t){t.bindToEffect(e,"Scene")},e.prototype.bindView=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("view",this.getScene().getViewMatrix())},e.prototype.bindViewProjection=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("viewProjection",this.getScene().getTransformMatrix())},e.prototype._shouldTurnAlphaTestOn=function(e){return!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()},e.prototype._afterBind=function(e){if(this._scene._cachedMaterial=this,this._scene._cachedVisibility=e?e.visibility:1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){var t=this._scene.getEngine();this._cachedDepthWriteState=t.getDepthWrite(),t.setDepthWrite(!1)}},e.prototype.unbind=function(){(this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.disableDepthWrite)&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState)},e.prototype.getActiveTextures=function(){return[]},e.prototype.hasTexture=function(e){return!1},e.prototype.clone=function(e){return null},e.prototype.getBindedMeshes=function(){var e=this;if(this.meshMap){var t=new Array;for(var i in this.meshMap){var r=this.meshMap[i];r&&t.push(r)}return t}return this._scene.meshes.filter(function(t){return t.material===e})},e.prototype.forceCompilation=function(e,t,i){var n=this,o=r.a({clipPlane:!1},i),s=new l.a,c=this.getScene(),u=function(){if(n._scene&&n._scene.getEngine()){s._materialDefines&&(s._materialDefines._renderId=-1);var i=c.clipPlane;o.clipPlane&&(c.clipPlane=new a.n(0,0,0,1)),n._storeEffectOnSubMeshes?n.isReadyForSubMesh(e,s)?t&&t(n):setTimeout(u,16):n.isReady()?t&&t(n):setTimeout(u,16),o.clipPlane&&(c.clipPlane=i)}};u()},e.prototype.forceCompilationAsync=function(e,t){var i=this;return new Promise(function(r){i.forceCompilation(e,function(){r()},t)})},e.prototype.markAsDirty=function(t){this.getScene().blockMaterialDirtyMechanism||(e._DirtyCallbackArray.length=0,t&e.TextureDirtyFlag&&e._DirtyCallbackArray.push(e._TextureDirtyCallBack),t&e.LightDirtyFlag&&e._DirtyCallbackArray.push(e._LightsDirtyCallBack),t&e.FresnelDirtyFlag&&e._DirtyCallbackArray.push(e._FresnelDirtyCallBack),t&e.AttributesDirtyFlag&&e._DirtyCallbackArray.push(e._AttributeDirtyCallBack),t&e.MiscDirtyFlag&&e._DirtyCallbackArray.push(e._MiscDirtyCallBack),e._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(e._RunDirtyCallBacks),this.getScene().resetCachedMaterial())},e.prototype._markAllSubMeshesAsDirty=function(e){if(!this.getScene().blockMaterialDirtyMechanism)for(var t=0,i=this.getScene().meshes;t-1?(u.a.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.j.Identity()},t.prototype.getViewMatrix=function(e){return!e&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childRenderId=this._currentRenderId,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._computedViewMatrix)},t.prototype.freezeProjectionMatrix=function(e){this._doNotComputeProjectionMatrix=!0,void 0!==e&&(this._projectionMatrix=e)},t.prototype.unfreezeProjectionMatrix=function(){this._doNotComputeProjectionMatrix=!1},t.prototype.getProjectionMatrix=function(e){if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=this.maxZ,this._refreshFrustumPlanes=!0;var i=this.getEngine(),r=this.getScene();if(this.mode===t.PERSPECTIVE_CAMERA)this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=i.getAspectRatio(this),this.minZ<=0&&(this.minZ=.1),r.useRightHandedSystem?c.j.PerspectiveFovRHToRef(this.fov,i.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED):c.j.PerspectiveFovLHToRef(this.fov,i.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED);else{var n=i.getRenderWidth()/2,o=i.getRenderHeight()/2;r.useRightHandedSystem?c.j.OrthoOffCenterRHToRef(this.orthoLeft||-n,this.orthoRight||n,this.orthoBottom||-o,this.orthoTop||o,this.minZ,this.maxZ,this._projectionMatrix):c.j.OrthoOffCenterLHToRef(this.orthoLeft||-n,this.orthoRight||n,this.orthoBottom||-o,this.orthoTop||o,this.minZ,this.maxZ,this._projectionMatrix),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.renderWidth=i.getRenderWidth(),this._cache.renderHeight=i.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix},t.prototype.getTransformationMatrix=function(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix},t.prototype._updateFrustumPlanes=function(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?c.i.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=c.i.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)},t.prototype.isInFrustum=function(e){return this._updateFrustumPlanes(),e.isInFrustum(this._frustumPlanes)},t.prototype.isCompletelyInFrustum=function(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)},t.prototype.getForwardRay=function(e,t,i){throw void 0===e&&(e=100),d.a.WarnImport("Ray")},t.prototype.dispose=function(i,r){for(void 0===r&&(r=!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 n=this._rigCameras.pop();n&&n.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,i,r)},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,i){if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){var r=this._rigCameras.pop();r&&r.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=i.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=s.h.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==t.RIG_MODE_NONE){var n=this.createRigCamera(this.name+"_L",0),o=this.createRigCamera(this.name+"_R",1);n&&o&&(this._rigCameras.push(n),this._rigCameras.push(o))}switch(this.cameraRigMode){case t.RIG_MODE_STEREOSCOPIC_ANAGLYPH:t._setStereoscopicAnaglyphRigMode(this);break;case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case t.RIG_MODE_STEREOSCOPIC_OVERUNDER:t._setStereoscopicRigMode(this);break;case t.RIG_MODE_VR:t._setVRRigMode(this,i);break;case t.RIG_MODE_WEBVR:t._setWebVRRigMode(this,i)}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.j.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.j.Identity()},t.prototype._getWebVRViewMatrix=function(){return c.j.Identity()},t.prototype.setCameraRigParameter=function(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,"interaxialDistance"===e&&(this._cameraRigParams.stereoHalfAngle=s.h.ToRadians(t/.0637))},t.prototype.createRigCamera=function(e,t){return null},t.prototype._updateRigCameras=function(){for(var e=0;ea.b.CollisionsEpsilon&&n.position.addInPlace(n._diffPositionForCollisions),i&&n.onCollideObservable.notifyObservers(i),n.onCollisionPositionChangeObservable.notifyObservers(n.position)},n.getScene().addMesh(n),n._resyncLightSources(),n}return r.d(t,e),Object.defineProperty(t,"BILLBOARDMODE_NONE",{get:function(){return u.a.BILLBOARDMODE_NONE},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_X",{get:function(){return u.a.BILLBOARDMODE_X},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Y",{get:function(){return u.a.BILLBOARDMODE_Y},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Z",{get:function(){return u.a.BILLBOARDMODE_Z},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_ALL",{get:function(){return u.a.BILLBOARDMODE_ALL},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetNb",{get:function(){return this._facetData.facetNb},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningSubdivisions",{get:function(){return this._facetData.partitioningSubdivisions},set:function(e){this._facetData.partitioningSubdivisions=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningBBoxRatio",{get:function(){return this._facetData.partitioningBBoxRatio},set:function(e){this._facetData.partitioningBBoxRatio=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mustDepthSortFacets",{get:function(){return this._facetData.facetDepthSort},set:function(e){this._facetData.facetDepthSort=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetDepthSortFrom",{get:function(){return this._facetData.facetDepthSortFrom},set:function(e){this._facetData.facetDepthSortFrom=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFacetDataEnabled",{get:function(){return this._facetData.facetDataEnabled},enumerable:!0,configurable:!0}),t.prototype._updateNonUniformScalingState=function(t){return!!e.prototype._updateNonUniformScalingState.call(this,t)&&(this._markSubMeshesAsMiscDirty(),!0)},Object.defineProperty(t.prototype,"onCollide",{set:function(e){this._onCollideObserver&&this.onCollideObservable.remove(this._onCollideObserver),this._onCollideObserver=this.onCollideObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onCollisionPositionChange",{set:function(e){this._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._onCollisionPositionChangeObserver),this._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._visibility},set:function(e){this._visibility!==e&&(this._visibility=e,this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},set:function(e){this._material!==e&&(this._material&&this._material.meshMap&&(this._material.meshMap[this.uniqueId]=void 0),this._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&this._unBindEffect())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this._markSubMeshesAsLightDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasVertexAlpha",{get:function(){return this._hasVertexAlpha},set:function(e){this._hasVertexAlpha!==e&&(this._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useVertexColors",{get:function(){return this._useVertexColors},set:function(e){this._useVertexColors!==e&&(this._useVertexColors=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._computeBonesUsingShaders},set:function(e){this._computeBonesUsingShaders!==e&&(this._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numBoneInfluencers",{get:function(){return this._numBoneInfluencers},set:function(e){this._numBoneInfluencers!==e&&(this._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"applyFog",{get:function(){return this._applyFog},set:function(e){this._applyFog!==e&&(this._applyFog=e,this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layerMask",{get:function(){return this._layerMask},set:function(e){e!==this._layerMask&&(this._layerMask=e,this._resyncLightSources())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionGroup",{get:function(){return this._collisionGroup},set:function(e){this._collisionGroup=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_positions",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._skeleton},set:function(e){this._skeleton&&this._skeleton.needInitialSkinMatrix&&this._skeleton._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._skeleton=e,this._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"AbstractMesh"},t.prototype.toString=function(e){var t="Name: "+this.name+", isInstance: "+("InstancedMesh"!==this.getClassName()?"YES":"NO");return t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0),this._skeleton&&(t+=", skeleton: "+this._skeleton.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingFreezeWorldMatrix?"YES":"NO")),t},t.prototype._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.b.MatricesIndicesExtraKind):null,l=o?this.getVerticesData(c.b.MatricesWeightsExtraKind):null,u=this.skeleton.getTransformMatrices(this),h=s.t.Vector3[0],d=s.t.Matrix[0],f=s.t.Matrix[1],p=0,_=0;_0&&(s.j.FromFloat32ArrayToRefScaled(u,Math.floor(16*i[p+m]),g,f),d.addToSelf(f));if(o)for(m=0;m<4;m++)(g=l[p+m])>0&&(s.j.FromFloat32ArrayToRefScaled(u,Math.floor(16*a[p+m]),g,f),d.addToSelf(f));s.x.TransformCoordinatesFromFloatsToRef(t[_],t[_+1],t[_+2],d,h),h.toArray(t,_)}}return t},t.prototype._updateBoundingInfo=function(){var e=this.skeleton&&this.skeleton.overrideMesh||this;return this._boundingInfo?this._boundingInfo.update(e.worldMatrixFromCache):this._boundingInfo=new d.a(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,i=0;i1||!r.IsGlobal)&&r.updateBoundingInfo(e)}return this},t.prototype._afterComputeWorldMatrix=function(){this._updateBoundingInfo()},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,i){if(void 0===t&&(t=!1),!this._boundingInfo||!e._boundingInfo)return!1;if(this._boundingInfo.intersects(e._boundingInfo,t))return!0;if(i)for(var r=0,n=this.getChildMeshes();r1&&!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.t.Matrix[0],i=s.t.Matrix[1];return s.j.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this},t.prototype._generatePointsArray=function(){return!1},t.prototype.intersects=function(e,t){var i=new h.a,r="InstancedLinesMesh"===this.getClassName()||"LinesMesh"===this.getClassName()?this.intersectionThreshold:0,n=this._boundingInfo;if(!(this.subMeshes&&n&&e.intersectsSphere(n.boundingSphere,r)&&e.intersectsBox(n.boundingBox,r)))return i;if(!this._generatePointsArray())return i;for(var o=null,a=this._scene.getIntersectingSubMeshCandidates(this,e),c=a.length,l=0;l1)||u.canIntersects(e)){var d=u.intersects(e,this._positions,this.getIndices(),t);if(d&&(t||!o||d.distance65535){o=!0;break}e.depthSortedIndices=o?new Uint32Array(i):new Uint16Array(i)}if(e.facetDepthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},!e.facetDepthSortFrom){var u=this.getScene().activeCamera;e.facetDepthSortFrom=u?u.position:s.x.Zero()}e.depthSortedFacets=[];for(var h=0;hs.h?n.maximum.x-n.minimum.x:s.h,e.bbSize.y=n.maximum.y-n.minimum.y>s.h?n.maximum.y-n.minimum.y:s.h,e.bbSize.z=n.maximum.z-n.minimum.z>s.h?n.maximum.z-n.minimum.z:s.h;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=n,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.x.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,l.a.ComputeNormals(t,i,r,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);var p=e.depthSortedIndices.length/3|0;for(h=0;hn.subDiv.max||s<0||s>n.subDiv.max||a<0||a>n.subDiv.max?null:n.facetPartitioning[o+n.subDiv.max*s+n.subDiv.max*n.subDiv.max*a]},t.prototype.getClosestFacetAtCoordinates=function(e,t,i,r,n,o){void 0===n&&(n=!1),void 0===o&&(o=!0);var a=this.getWorldMatrix(),c=s.t.Matrix[5];a.invertToRef(c);var l=s.t.Vector3[8];s.x.TransformCoordinatesFromFloatsToRef(e,t,i,c,l);var u=this.getClosestFacetAtLocalCoordinates(l.x,l.y,l.z,r,n,o);return r&&s.x.TransformCoordinatesFromFloatsToRef(r.x,r.y,r.z,a,r),u},t.prototype.getClosestFacetAtLocalCoordinates=function(e,t,i,r,n,o){void 0===n&&(n=!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,_=this.getFacetLocalPositions(),m=this.getFacetLocalNormals(),g=this.getFacetsAtLocalCoordinates(e,t,i);if(!g)return null;for(var v,y,b,T=Number.MAX_VALUE,E=T,x=0;x=0||n&&!o&&u<=0)&&(u=y.x*b.x+y.y*b.y+y.z*b.z,h=-(y.x*e+y.y*t+y.z*i-u)/(y.x*y.x+y.y*y.y+y.z*y.z),(E=(a=(d=e+y.x*h)-e)*a+(c=(f=t+y.y*h)-t)*c+(l=(p=i+y.z*h)-i)*l)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 r.d(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-1?this._onBeforePhysicsStepCallbacks.splice(t,1):r.a.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):r.a.Warn("Function to remove was not found")},e.prototype.registerOnPhysicsCollide=function(e,t){var i=e instanceof Array?e:[e];this._onPhysicsCollideCallbacks.push({callback:t,otherImpostors:i})},e.prototype.unregisterOnPhysicsCollide=function(e,t){var i=e instanceof Array?e:[e],n=-1;this._onPhysicsCollideCallbacks.some(function(e,r){if(e.callback===t&&e.otherImpostors.length===i.length){var o=e.otherImpostors.every(function(e){return i.indexOf(e)>-1});return o&&(n=r),o}return!1})?this._onPhysicsCollideCallbacks.splice(n,1):r.a.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.q.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,i){var r=new c.e(t,i);return this.addJoint(e,r),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.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.q),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,i,r,n,s){var a=e._tmpVecs[0],c=this.object;if(c.rotationQuaternion)if(s){var l=e._tmpQuat;c.rotationQuaternion.multiplyToRef(s,l),t.setRotationQuaternion(l,o.s.WORLD,i)}else t.setRotationQuaternion(c.rotationQuaternion,o.s.WORLD,i);a.x=0,a.y=0,a.z=0,r&&(a.x=r.x,a.y=r.y,a.z=r.z,t.getDirectionToRef(a,i,a),null==n&&(n=r.length()),a.x*=n,a.y*=n,a.z*=n),t.getParent()?(a.addInPlace(c.getAbsolutePosition()),t.setAbsolutePosition(a,i)):(i.setAbsolutePosition(c.getAbsolutePosition()),i.position.x-=a.x,i.position.y-=a.y,i.position.z-=a.z)},e.prototype.syncImpostorWithBone=function(t,i,r,n,s,a){var c=this.object;if(c.rotationQuaternion)if(s){var l=e._tmpQuat;t.getRotationQuaternionToRef(o.s.WORLD,i,l),l.multiplyToRef(s,c.rotationQuaternion)}else t.getRotationQuaternionToRef(o.s.WORLD,i,c.rotationQuaternion);var u=e._tmpVecs[0],h=e._tmpVecs[1];a||((a=e._tmpVecs[2]).x=0,a.y=1,a.z=0),t.getDirectionToRef(a,i,h),t.getAbsolutePositionToRef(i,u),null==n&&r&&(n=r.length()),null!=n&&(u.x+=h.x*n,u.y+=h.y*n,u.z+=h.z*n),c.setAbsolutePosition(u)},e.DEFAULT_OBJECT_SIZE=new o.x(1,1,1),e.IDENTITY_QUATERNION=o.q.Identity(),e._tmpVecs=n.a.BuildArray(3,o.x.Zero),e._tmpQuat=o.q.Identity(),e.NoImpostor=0,e.SphereImpostor=1,e.BoxImpostor=2,e.PlaneImpostor=3,e.MeshImpostor=4,e.CylinderImpostor=7,e.ParticleImpostor=8,e.HeightmapImpostor=9,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=function(e,t){return e?e.getClassName&&"Mesh"===e.getClassName()?null:e.getClassName&&"SubMesh"===e.getClassName()?e.clone(t):e.clone?e.clone():null:null},n=function(){function e(){}return e.DeepCopy=function(e,t,i,n){for(var o in e)if(("_"!==o[0]||n&&-1!==n.indexOf(o))&&(!i||-1===i.indexOf(o))){var s=e[o],a=typeof s;if("function"!==a)try{if("object"===a)if(s instanceof Array){if(t[o]=[],s.length>0)if("object"==typeof s[0])for(var c=0;c0,o.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,o.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===p.a.INVCUBIC_MODE,o.REFLECTIONMAP_3D=this._reflectionTexture.isCube,this._reflectionTexture.coordinatesMode){case p.a.EXPLICIT_MODE:o.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case p.a.PLANAR_MODE:o.setReflectionMode("REFLECTIONMAP_PLANAR");break;case p.a.PROJECTION_MODE:o.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case p.a.SKYBOX_MODE:o.setReflectionMode("REFLECTIONMAP_SKYBOX"),o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!this._reflectionTexture.getReflectionTextureMatrix().isIdentity();break;case p.a.SPHERICAL_MODE:o.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case p.a.EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case p.a.FIXED_EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case p.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case p.a.CUBIC_MODE:case p.a.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.a.PrepareDefinesForMergedUV(this._emissiveTexture,o,"EMISSIVE")}else o.EMISSIVE=!1;if(this._lightmapTexture&&t.LightmapTextureEnabled){if(!this._lightmapTexture.isReadyOrNotBlocking())return!1;f.a.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.a.PrepareDefinesForMergedUV(this._specularTexture,o,"SPECULAR"),o.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha}else o.SPECULAR=!1;if(n.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&t.BumpTextureEnabled){if(!this._bumpTexture.isReady())return!1;f.a.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===x.a.ALPHA_PREMULTIPLIED||this.alphaMode===x.a.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.a.PrepareDefinesForMisc(e,n,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),f.a.PrepareDefinesForAttributes(e,o,!0,!0,!0),f.a.PrepareDefinesForFrameBoundValues(n,s,o,r),o.isDirty){o.markAsProcessed();var a=new u.c;o.REFLECTION&&a.addFallback(0,"REFLECTION"),o.SPECULAR&&a.addFallback(0,"SPECULAR"),o.BUMP&&a.addFallback(0,"BUMP"),o.PARALLAX&&a.addFallback(1,"PARALLAX"),o.PARALLAXOCCLUSION&&a.addFallback(0,"PARALLAXOCCLUSION"),o.SPECULAROVERALPHA&&a.addFallback(0,"SPECULAROVERALPHA"),o.FOG&&a.addFallback(1,"FOG"),o.POINTSIZE&&a.addFallback(0,"POINTSIZE"),o.LOGARITHMICDEPTH&&a.addFallback(0,"LOGARITHMICDEPTH"),f.a.HandleFallbacksForShadows(o,a,this._maxSimultaneousLights),o.SPECULARTERM&&a.addFallback(0,"SPECULARTERM"),o.DIFFUSEFRESNEL&&a.addFallback(1,"DIFFUSEFRESNEL"),o.OPACITYFRESNEL&&a.addFallback(2,"OPACITYFRESNEL"),o.REFLECTIONFRESNEL&&a.addFallback(3,"REFLECTIONFRESNEL"),o.EMISSIVEFRESNEL&&a.addFallback(4,"EMISSIVEFRESNEL"),o.FRESNEL&&a.addFallback(4,"FRESNEL");var h=[c.b.PositionKind];o.NORMAL&&h.push(c.b.NormalKind),o.UV1&&h.push(c.b.UVKind),o.UV2&&h.push(c.b.UV2Kind),o.VERTEXCOLOR&&h.push(c.b.ColorKind),f.a.PrepareAttributesForBones(h,e,o,a),f.a.PrepareAttributesForInstances(h,o),f.a.PrepareAttributesForMorphTargets(h,e,o);var d="default",_=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth"],m=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler"],g=["Material","Scene"];l.a&&(l.a.PrepareUniforms(_,o),l.a.PrepareSamplers(m,o)),f.a.PrepareUniformsAndSamplersList({uniformsNames:_,uniformBuffersNames:g,samplers:m,defines:o,maxSimultaneousLights:this._maxSimultaneousLights}),this.customShaderNameResolve&&(d=this.customShaderNameResolve(d,_,g,m,o));var v=o.toString(),y=i.effect,b=n.getEngine().createEffect(d,{attributes:h,uniformsNames:_,uniformBuffersNames:g,samplers:m,defines:v,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:o.NUM_MORPH_INFLUENCERS}},s);b&&(this.allowShaderHotSwapping&&y&&!b.isReady()?(b=y,o.markAsUnprocessed()):(n.resetCachedMaterial(),i.setEffect(b,o),this.buildUniformLayout()))}return!(!i.effect||!i.effect.isReady())&&(o._renderId=n.getRenderId(),this._wasPreviouslyReady=!0,!0)},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("diffuseLeftColor",4),this._uniformBuffer.addUniform("diffuseRightColor",4),this._uniformBuffer.addUniform("opacityParts",4),this._uniformBuffer.addUniform("reflectionLeftColor",4),this._uniformBuffer.addUniform("reflectionRightColor",4),this._uniformBuffer.addUniform("refractionLeftColor",4),this._uniformBuffer.addUniform("refractionRightColor",4),this._uniformBuffer.addUniform("emissiveLeftColor",4),this._uniformBuffer.addUniform("emissiveRightColor",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vAmbientInfos",2),this._uniformBuffer.addUniform("vOpacityInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("vReflectionPosition",3),this._uniformBuffer.addUniform("vReflectionSize",3),this._uniformBuffer.addUniform("vEmissiveInfos",2),this._uniformBuffer.addUniform("vLightmapInfos",2),this._uniformBuffer.addUniform("vSpecularInfos",2),this._uniformBuffer.addUniform("vBumpInfos",3),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("ambientMatrix",16),this._uniformBuffer.addUniform("opacityMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("emissiveMatrix",16),this._uniformBuffer.addUniform("lightmapMatrix",16),this._uniformBuffer.addUniform("specularMatrix",16),this._uniformBuffer.addUniform("bumpMatrix",16),this._uniformBuffer.addUniform("vTangentSpaceParams",2),this._uniformBuffer.addUniform("refractionMatrix",16),this._uniformBuffer.addUniform("vRefractionInfos",4),this._uniformBuffer.addUniform("vSpecularColor",4),this._uniformBuffer.addUniform("vEmissiveColor",3),this._uniformBuffer.addUniform("vDiffuseColor",4),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this._refractionTexture&&this._refractionTexture.isRenderTarget&&(this._activeEffect.setTexture("refraction2DSampler",null),t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,i,r){var n=this.getScene(),o=r._materialDefines;if(o){var c=r.effect;if(c){this._activeEffect=c,this.bindOnlyWorldMatrix(e),o.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var l=this._mustRebind(n,c,i.visibility);if(f.a.BindBonesParameters(i,c),l){if(this._uniformBuffer.bindToEffect(c,"Material"),this.bindViewProjection(c),!this._uniformBuffer.useUbo||!this.isFrozen||!this._uniformBuffer.isSync){if(t.FresnelEnabled&&o.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),this._uniformBuffer.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&this._uniformBuffer.updateColor4("opacityParts",new a.e(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),this._uniformBuffer.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),this._uniformBuffer.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),this._uniformBuffer.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),n.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),f.a.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse"),this._diffuseTexture.hasAlpha&&c.setFloat("alphaCutOff",this.alphaCutOff)),this._ambientTexture&&t.AmbientTextureEnabled&&(this._uniformBuffer.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),f.a.BindTextureMatrix(this._ambientTexture,this._uniformBuffer,"ambient")),this._opacityTexture&&t.OpacityTextureEnabled&&(this._uniformBuffer.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),f.a.BindTextureMatrix(this._opacityTexture,this._uniformBuffer,"opacity")),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._uniformBuffer.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),this._uniformBuffer.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){var u=this._reflectionTexture;this._uniformBuffer.updateVector3("vReflectionPosition",u.boundingBoxPosition),this._uniformBuffer.updateVector3("vReflectionSize",u.boundingBoxSize)}if(this._emissiveTexture&&t.EmissiveTextureEnabled&&(this._uniformBuffer.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),f.a.BindTextureMatrix(this._emissiveTexture,this._uniformBuffer,"emissive")),this._lightmapTexture&&t.LightmapTextureEnabled&&(this._uniformBuffer.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),f.a.BindTextureMatrix(this._lightmapTexture,this._uniformBuffer,"lightmap")),this._specularTexture&&t.SpecularTextureEnabled&&(this._uniformBuffer.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),f.a.BindTextureMatrix(this._specularTexture,this._uniformBuffer,"specular")),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&(this._uniformBuffer.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),f.a.BindTextureMatrix(this._bumpTexture,this._uniformBuffer,"bump"),n._mirroredCameraPosition?this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&t.RefractionTextureEnabled){var h=1;this._refractionTexture.isCube||(this._uniformBuffer.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(h=this._refractionTexture.depth)),this._uniformBuffer.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,h,this.invertRefractionY?-1:1)}}this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),o.SPECULARTERM&&this._uniformBuffer.updateColor4("vSpecularColor",this.specularColor,this.specularPower),this._uniformBuffer.updateColor3("vEmissiveColor",t.EmissiveTextureEnabled?this.emissiveColor:a.e.BlackReadOnly),this._uniformBuffer.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha*i.visibility)}if(n.texturesEnabled&&(this._diffuseTexture&&t.DiffuseTextureEnabled&&c.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&t.AmbientTextureEnabled&&c.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&t.OpacityTextureEnabled&&c.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?c.setTexture("reflectionCubeSampler",this._reflectionTexture):c.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&t.EmissiveTextureEnabled&&c.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&t.LightmapTextureEnabled&&c.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&t.SpecularTextureEnabled&&c.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&c.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&t.RefractionTextureEnabled)){h=1;this._refractionTexture.isCube?c.setTexture("refractionCubeSampler",this._refractionTexture):c.setTexture("refraction2DSampler",this._refractionTexture)}f.a.BindClipPlane(c,n),n.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),f.a.BindEyePosition(c,n),c.setColor3("vAmbientColor",this._globalAmbientColor)}!l&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&f.a.BindLights(n,i,c,o,this._maxSimultaneousLights),(n.fogEnabled&&i.applyFog&&n.fogMode!==s.a.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture)&&this.bindView(c),f.a.BindFogParameters(n,i,c),o.NUM_MORPH_INFLUENCERS&&f.a.BindMorphTargetParameters(i,c),f.a.BindLogDepth(o,c,n),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(i,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,i){i&&(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,i)},t.prototype.clone=function(e){var i=this,r=n.a.Clone(function(){return new t(e,i.getScene())},this);return r.name=e,r.id=e,r},t.prototype.serialize=function(){return n.a.Serialize(this)},t.Parse=function(e,i,r){return n.a.Parse(function(){return new t(e.name,i)},e,i,r)},Object.defineProperty(t,"DiffuseTextureEnabled",{get:function(){return m.a.DiffuseTextureEnabled},set:function(e){m.a.DiffuseTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AmbientTextureEnabled",{get:function(){return m.a.AmbientTextureEnabled},set:function(e){m.a.AmbientTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OpacityTextureEnabled",{get:function(){return m.a.OpacityTextureEnabled},set:function(e){m.a.OpacityTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ReflectionTextureEnabled",{get:function(){return m.a.ReflectionTextureEnabled},set:function(e){m.a.ReflectionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"EmissiveTextureEnabled",{get:function(){return m.a.EmissiveTextureEnabled},set:function(e){m.a.EmissiveTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpecularTextureEnabled",{get:function(){return m.a.SpecularTextureEnabled},set:function(e){m.a.SpecularTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BumpTextureEnabled",{get:function(){return m.a.BumpTextureEnabled},set:function(e){m.a.BumpTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightmapTextureEnabled",{get:function(){return m.a.LightmapTextureEnabled},set:function(e){m.a.LightmapTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RefractionTextureEnabled",{get:function(){return m.a.RefractionTextureEnabled},set:function(e){m.a.RefractionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ColorGradingTextureEnabled",{get:function(){return m.a.ColorGradingTextureEnabled},set:function(e){m.a.ColorGradingTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FresnelEnabled",{get:function(){return m.a.FresnelEnabled},set:function(e){m.a.FresnelEnabled=e},enumerable:!0,configurable:!0}),r.c([Object(n.l)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"diffuseTexture",void 0),r.c([Object(n.l)("ambientTexture")],t.prototype,"_ambientTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),r.c([Object(n.l)("opacityTexture")],t.prototype,"_opacityTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),r.c([Object(n.l)("reflectionTexture")],t.prototype,"_reflectionTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),r.c([Object(n.l)("emissiveTexture")],t.prototype,"_emissiveTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),r.c([Object(n.l)("specularTexture")],t.prototype,"_specularTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularTexture",void 0),r.c([Object(n.l)("bumpTexture")],t.prototype,"_bumpTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),r.c([Object(n.l)("lightmapTexture")],t.prototype,"_lightmapTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"lightmapTexture",void 0),r.c([Object(n.l)("refractionTexture")],t.prototype,"_refractionTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),r.c([Object(n.e)("ambient")],t.prototype,"ambientColor",void 0),r.c([Object(n.e)("diffuse")],t.prototype,"diffuseColor",void 0),r.c([Object(n.e)("specular")],t.prototype,"specularColor",void 0),r.c([Object(n.e)("emissive")],t.prototype,"emissiveColor",void 0),r.c([Object(n.c)()],t.prototype,"specularPower",void 0),r.c([Object(n.c)("useAlphaFromDiffuseTexture")],t.prototype,"_useAlphaFromDiffuseTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFromDiffuseTexture",void 0),r.c([Object(n.c)("useEmissiveAsIllumination")],t.prototype,"_useEmissiveAsIllumination",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useEmissiveAsIllumination",void 0),r.c([Object(n.c)("linkEmissiveWithDiffuse")],t.prototype,"_linkEmissiveWithDiffuse",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkEmissiveWithDiffuse",void 0),r.c([Object(n.c)("useSpecularOverAlpha")],t.prototype,"_useSpecularOverAlpha",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),r.c([Object(n.c)("useReflectionOverAlpha")],t.prototype,"_useReflectionOverAlpha",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useReflectionOverAlpha",void 0),r.c([Object(n.c)("disableLighting")],t.prototype,"_disableLighting",void 0),r.c([Object(n.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),r.c([Object(n.c)("useObjectSpaceNormalMap")],t.prototype,"_useObjectSpaceNormalMap",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),r.c([Object(n.c)("useParallax")],t.prototype,"_useParallax",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),r.c([Object(n.c)("useParallaxOcclusion")],t.prototype,"_useParallaxOcclusion",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),r.c([Object(n.c)()],t.prototype,"parallaxScaleBias",void 0),r.c([Object(n.c)("roughness")],t.prototype,"_roughness",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),r.c([Object(n.c)()],t.prototype,"indexOfRefraction",void 0),r.c([Object(n.c)()],t.prototype,"invertRefractionY",void 0),r.c([Object(n.c)()],t.prototype,"alphaCutOff",void 0),r.c([Object(n.c)("useLightmapAsShadowmap")],t.prototype,"_useLightmapAsShadowmap",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),r.c([Object(n.h)("diffuseFresnelParameters")],t.prototype,"_diffuseFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"diffuseFresnelParameters",void 0),r.c([Object(n.h)("opacityFresnelParameters")],t.prototype,"_opacityFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelAndMiscDirty")],t.prototype,"opacityFresnelParameters",void 0),r.c([Object(n.h)("reflectionFresnelParameters")],t.prototype,"_reflectionFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"reflectionFresnelParameters",void 0),r.c([Object(n.h)("refractionFresnelParameters")],t.prototype,"_refractionFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"refractionFresnelParameters",void 0),r.c([Object(n.h)("emissiveFresnelParameters")],t.prototype,"_emissiveFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"emissiveFresnelParameters",void 0),r.c([Object(n.c)("useReflectionFresnelFromSpecular")],t.prototype,"_useReflectionFresnelFromSpecular",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"useReflectionFresnelFromSpecular",void 0),r.c([Object(n.c)("useGlossinessFromSpecularMapAlpha")],t.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useGlossinessFromSpecularMapAlpha",void 0),r.c([Object(n.c)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),r.c([Object(n.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),r.c([Object(n.c)("invertNormalMapX")],t.prototype,"_invertNormalMapX",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),r.c([Object(n.c)("invertNormalMapY")],t.prototype,"_invertNormalMapY",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),r.c([Object(n.c)("twoSidedLighting")],t.prototype,"_twoSidedLighting",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),r.c([Object(n.c)()],t.prototype,"useLogarithmicDepth",null),t}(d.a);_.a.RegisteredTypes["BABYLON.StandardMaterial"]=P,s.a.DefaultMaterialFactory=function(e){return new P("default material",e)}},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.BuildArray=function(e,t){for(var i=[],r=0;r0&&(t.push(a-1),t.push(a)),a++}var d=new o.a;return d.indices=t,d.positions=i,n&&(d.colors=s),d},o.a.CreateDashedLines=function(e){var t,i,n=e.dashSize||3,s=e.gapSize||1,a=e.dashNb||200,c=e.points,l=new Array,u=new Array,h=r.x.Zero(),d=0,f=0,p=0,_=0,m=0;for(m=0;m0&&-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,i){void 0===i&&(i=!1),this._shadowGenerator&&(this._shadowGenerator.dispose(),this._shadowGenerator=null),this.getScene().stopAnimation(this);for(var r=0,n=this.getScene().meshes;r0&&(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)})),n.a.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e},t.GetConstructorFromName=function(e,t,i){var r=s.a.Construct("Light_Type_"+e,t,i);return r||null},t.Parse=function(e,i){var r=t.GetConstructorFromName(e.type,e.name,i);if(!r)return null;var o=n.a.Parse(r,e,i);if(e.excludedMeshesIds&&(o._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(o._includedOnlyMeshesIds=e.includedOnlyMeshesIds),e.parentId&&(o._waitingParentId=e.parentId),e.animations){for(var a=0;al.x)return!1}else if(n=1/this.direction.x,o=(c.x-this.origin.x)*n,(s=(l.x-this.origin.x)*n)===-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(n=1/this.direction.y,o=(c.y-this.origin.y)*n,(s=(l.y-this.origin.y)*n)===-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(n=1/this.direction.z,o=(c.z-this.origin.z)*n,(s=(l.z-this.origin.z)*n)===-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 i=e.center.x-this.origin.x,r=e.center.y-this.origin.y,n=e.center.z-this.origin.z,o=i*i+r*r+n*n,s=e.radius+t,a=s*s;if(o<=a)return!0;var c=i*this.direction.x+r*this.direction.y+n*this.direction.z;return!(c<0)&&o-c*c<=a},e.prototype.intersectsTriangle=function(t,i,r){var o=e.TmpVector3[0],a=e.TmpVector3[1],c=e.TmpVector3[2],l=e.TmpVector3[3],u=e.TmpVector3[4];i.subtractToRef(t,o),r.subtractToRef(t,a),n.x.CrossToRef(this.direction,a,c);var h=n.x.Dot(o,c);if(0===h)return null;var d=1/h;this.origin.subtractToRef(t,l);var f=n.x.Dot(l,c)*d;if(f<0||f>1)return null;n.x.CrossToRef(l,o,u);var p=n.x.Dot(this.direction,u)*d;if(p<0||f+p>1)return null;var _=n.x.Dot(a,u)*d;return _>this.length?null:new s.a(f,p,_)},e.prototype.intersectsPlane=function(e){var t,i=n.x.Dot(e.normal,this.direction);if(Math.abs(i)<9.99999997475243e-7)return null;var r=n.x.Dot(e.normal,this.origin);return(t=(-e.d-r)/i)<0?t<-9.99999997475243e-7?null:0:t},e.prototype.intersectsMesh=function(t,i){var r=n.t.Matrix[0];return t.getWorldMatrix().invertToRef(r),this._tmpRay?e.TransformToRef(this,r,this._tmpRay):this._tmpRay=e.Transform(this,r),t.intersects(this._tmpRay,i)},e.prototype.intersectsMeshes=function(e,t,i){i?i.length=0:i=[];for(var r=0;rt.distance?1:0},e.prototype.intersectionSegment=function(t,i,r){var o=this.origin,s=n.t.Vector3[0],a=n.t.Vector3[1],c=n.t.Vector3[2],l=n.t.Vector3[3];i.subtractToRef(t,s),this.direction.scaleToRef(e.rayl,c),o.addToRef(c,a),t.subtractToRef(o,l);var u,h,d,f,p=n.x.Dot(s,s),_=n.x.Dot(s,c),m=n.x.Dot(c,c),g=n.x.Dot(s,l),v=n.x.Dot(c,l),y=p*m-_*_,b=y,T=y;yb&&(h=b,f=v+_,T=m)),f<0?(f=0,-g<0?h=0:-g>p?h=b:(h=-g,b=p)):f>T&&(f=T,-g+_<0?h=0:-g+_>p?h=b:(h=-g+_,b=p)),u=Math.abs(h)0&&d<=this.length&&A.lengthSquared()=r.distance))&&(r=c,i)))break}return r||new o.a},a.a.prototype._internalMultiPick=function(e,t){if(!o.a)return null;for(var i=new Array,r=0;r0)):!i._pointerCaptures[c.pointerId]&&s.distance>a.distance&&(i.mainSceneTrackerPredicate&&i.mainSceneTrackerPredicate(a.pickedMesh)?(i._notifyObservers(t,a,c),t.skipOnPointerObservable=!0):i._lastPointerEvents[c.pointerId]&&(i.onPointerOutObservable.notifyObservers(c.pointerId),delete i._lastPointerEvents[c.pointerId])),t.type===o.a.POINTERUP&&i._pointerCaptures[c.pointerId]&&(i._pointerCaptures[c.pointerId]=!1))}}}})),this.utilityLayerScene.autoClear=!1,this._afterRenderObserver=this.originalScene.onAfterRenderObservable.add(function(){i.shouldRender&&i.render()}),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add(function(){i.dispose()}),this._updateCamera()}return Object.defineProperty(e,"DefaultUtilityLayer",{get:function(){return null==e._DefaultUtilityLayer&&(e._DefaultUtilityLayer=new e(s.a.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.a.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,i){e.skipOnPointerObservable||(this.utilityLayerScene.onPointerObservable.notifyObservers(new o.b(e.type,e.event,t)),this._lastPointerEvents[i.pointerId]=!0)},e.prototype.render=function(){if(this._updateCamera(),this.utilityLayerScene.activeCamera){var e=this.utilityLayerScene.activeCamera.getScene(),t=this.utilityLayerScene.activeCamera;t._scene=this.utilityLayerScene,t.leftCamera&&(t.leftCamera._scene=this.utilityLayerScene),t.rightCamera&&(t.rightCamera._scene=this.utilityLayerScene),this.utilityLayerScene.render(!1),t._scene=e,t.leftCamera&&(t.leftCamera._scene=e),t.rightCamera&&(t.rightCamera._scene=e)}},e.prototype.dispose=function(){this.onPointerOutObservable.clear(),this._afterRenderObserver&&this.originalScene.onAfterRenderObservable.remove(this._afterRenderObserver),this._sceneDisposeObserver&&this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver),this._originalPointerObserver&&this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver),this.utilityLayerScene.dispose()},e.prototype._updateCamera=function(){this.originalScene.activeCameras.length>1?this.utilityLayerScene.activeCamera=this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:this.utilityLayerScene.activeCamera=this.originalScene.activeCamera},e._DefaultUtilityLayer=null,e._DefaultKeepDepthUtilityLayer=null,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(34),n=i(0),o=i(3),s=i(73),a=i(76),c={min:0,max:0},l={min:0,max:0},u=function(e,t,i){var r=n.x.Dot(t.centerWorld,e),o=Math.abs(n.x.Dot(t.directions[0],e))*t.extendSize.x+Math.abs(n.x.Dot(t.directions[1],e))*t.extendSize.y+Math.abs(n.x.Dot(t.directions[2],e))*t.extendSize.z;i.min=r-o,i.max=r+o},h=function(e,t,i){return u(e,t,c),u(e,i,l),!(c.min>l.max||l.min>c.max)},d=function(){function e(e,t,i){this._isLocked=!1,this.boundingBox=new s.a(e,t,i),this.boundingSphere=new a.a(e,t,i)}return e.prototype.reConstruct=function(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)},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,i){var r=e.TmpVector3[0].copyFrom(t).subtractInPlace(i),n=e.TmpVector3[1].copyFrom(t).addInPlace(i);return this.boundingBox.reConstruct(r,n,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(r,n,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.a.MESHES_CULLINGSTRATEGY_STANDARD),!(t!==o.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION&&t!==o.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY||!this.boundingSphere.isCenterInFrustum(e))||!!this.boundingSphere.isInFrustum(e)&&(!(t!==o.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY&&t!==o.a.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.a.Intersects(this.boundingSphere,e.boundingSphere))return!1;if(!s.a.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;var i=this.boundingBox,r=e.boundingBox;return!!h(i.directions[0],i,r)&&(!!h(i.directions[1],i,r)&&(!!h(i.directions[2],i,r)&&(!!h(r.directions[0],i,r)&&(!!h(r.directions[1],i,r)&&(!!h(r.directions[2],i,r)&&(!!h(n.x.Cross(i.directions[0],r.directions[0]),i,r)&&(!!h(n.x.Cross(i.directions[0],r.directions[1]),i,r)&&(!!h(n.x.Cross(i.directions[0],r.directions[2]),i,r)&&(!!h(n.x.Cross(i.directions[1],r.directions[0]),i,r)&&(!!h(n.x.Cross(i.directions[1],r.directions[1]),i,r)&&(!!h(n.x.Cross(i.directions[1],r.directions[2]),i,r)&&(!!h(n.x.Cross(i.directions[2],r.directions[0]),i,r)&&(!!h(n.x.Cross(i.directions[2],r.directions[1]),i,r)&&!!h(n.x.Cross(i.directions[2],r.directions[2]),i,r))))))))))))))},e.TmpVector3=r.a.BuildArray(2,n.x.Zero),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=function(){function e(){}return e._RemoveAndStorePivotPoint=function(t){t&&0===e._PivotCached&&(t.getPivotPointToRef(e._OldPivotPoint),e._OldPivotPoint.equalsToFloats(0,0,0)||(t.setPivotMatrix(r.j.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 r.x,e._PivotTranslation=new r.x,e._PivotTmpVector=new r.x,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(38),n=function(){function e(){}return Object.defineProperty(e,"Now",{get:function(){return r.a.IsWindowObjectExist()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!0,configurable:!0}),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=i(10),o=i(41),s=function(){function e(e){void 0===e&&(e=o.a.DefaultUtilityLayer);var t=this;this.gizmoLayer=e,this.scaleRatio=1,this._tmpMatrix=new r.j,this._customMeshSet=!1,this.updateGizmoRotationToMatchAttachedMesh=!0,this.updateGizmoPositionToMatchAttachedMesh=!0,this._updateScale=!0,this._interactionsEnabled=!0,this._tempVector=new r.x,this._rootMesh=new n.a("gizmoRootNode",e.utilityLayerScene),this._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function(){t._update()}),this.attachedMesh=null}return Object.defineProperty(e.prototype,"attachedMesh",{get:function(){return this._attachedMesh},set:function(e){this._attachedMesh=e,this._rootMesh.setEnabled(!!e),this._attachedMeshChanged(e)},enumerable:!0,configurable:!0}),e.prototype.setCustomMesh=function(e){if(e.getScene()!=this.gizmoLayer.utilityLayerScene)throw"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";this._rootMesh.getChildMeshes().forEach(function(e){e.dispose()}),e.parent=this._rootMesh,this._customMeshSet=!0},e.prototype._attachedMeshChanged=function(e){},e.prototype._update=function(){if(this.attachedMesh&&(this.updateGizmoRotationToMatchAttachedMesh?(this._rootMesh.rotationQuaternion||(this._rootMesh.rotationQuaternion=r.q.RotationYawPitchRoll(this._rootMesh.rotation.y,this._rootMesh.rotation.x,this._rootMesh.rotation.z)),this._tempVector.copyFrom(this.attachedMesh.scaling),this.attachedMesh.scaling.x<0&&(this.attachedMesh.scaling.x*=-1),this.attachedMesh.scaling.y<0&&(this.attachedMesh.scaling.y*=-1),this.attachedMesh.scaling.z<0&&(this.attachedMesh.scaling.z*=-1),this.attachedMesh.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix),this.attachedMesh.scaling.copyFrom(this._tempVector),this.attachedMesh.computeWorldMatrix(),r.q.FromRotationMatrixToRef(this._tmpMatrix,this._rootMesh.rotationQuaternion)):this._rootMesh.rotationQuaternion&&this._rootMesh.rotationQuaternion.set(0,0,0,1),this.updateGizmoPositionToMatchAttachedMesh&&this._rootMesh.position.copyFrom(this.attachedMesh.absolutePosition),this._updateScale&&this.gizmoLayer.utilityLayerScene.activeCamera&&this.attachedMesh)){var e=this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition;this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition&&(e=this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition),this._rootMesh.position.subtractToRef(e,this._tempVector);var t=this._tempVector.length()*this.scaleRatio;this._rootMesh.scaling.set(t,t,t)}},e.prototype.dispose=function(){this._rootMesh.dispose(),this._beforeRenderObserver&&this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return h});var r=i(1),n=i(2),o=i(7),s=i(9),a=i(69),c=i(0),l=i(23),u=i(3),h=function(){function e(t){this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this.getAlphaFromRGB=!1,this.level=1,this.coordinatesIndex=0,this._coordinatesMode=u.a.TEXTURE_EXPLICIT_MODE,this.wrapU=u.a.TEXTURE_WRAP_ADDRESSMODE,this.wrapV=u.a.TEXTURE_WRAP_ADDRESSMODE,this.wrapR=u.a.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.c,this.delayLoadState=u.a.DELAYLOADSTATE_NONE,this._cachedSize=c.r.Zero(),this._scene=t||l.a.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this)),this._uid=null}return Object.defineProperty(e.prototype,"hasAlpha",{get:function(){return this._hasAlpha},set:function(e){this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(u.a.MATERIAL_TextureDirtyFlag|u.a.MATERIAL_MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"coordinatesMode",{get:function(){return this._coordinatesMode},set:function(e){this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(u.a.MATERIAL_TextureDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCube",{get:function(){return!!this._texture&&this._texture.isCube},set:function(e){this._texture&&(this._texture.isCube=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is3D",{get:function(){return!!this._texture&&this._texture.is3D},set:function(e){this._texture&&(this._texture.is3D=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRGBD",{get:function(){return null!=this._texture&&this._texture._isRGBD},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noMipmap",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lodGenerationOffset",{get:function(){return this._texture?this._texture._lodGenerationOffset:0},set:function(e){this._texture&&(this._texture._lodGenerationOffset=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lodGenerationScale",{get:function(){return this._texture?this._texture._lodGenerationScale:0},set:function(e){this._texture&&(this._texture._lodGenerationScale=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uid",{get:function(){return this._uid||(this._uid=s.h.RandomId()),this._uid},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.name},e.prototype.getClassName=function(){return"BaseTexture"},Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBlocking",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getTextureMatrix=function(){return c.j.IdentityReadOnly},e.prototype.getReflectionTextureMatrix=function(){return c.j.IdentityReadOnly},e.prototype.getInternalTexture=function(){return this._texture},e.prototype.isReadyOrNotBlocking=function(){return!this.isBlocking||this.isReady()},e.prototype.isReady=function(){return this.delayLoadState===u.a.DELAYLOADSTATE_NOTLOADED?(this.delayLoad(),!1):!!this._texture&&this._texture.isReady},e.prototype.getSize=function(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize},e.prototype.getBaseSize=function(){return this.isReady()&&this._texture?this._texture._size?new c.r(this._texture._size,this._texture._size):new c.r(this._texture.baseWidth,this._texture.baseHeight):c.r.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,i){if(!this._scene)return null;for(var r=this._scene.getEngine().getLoadedTexturesCache(),n=0;n=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=n.a.Serialize(this);return n.a.AppendSerializedAnimations(this,e),e},e.WhenAllReady=function(e,t){var i=e.length;if(0!==i)for(var r,n,o=function(){if((r=e[s]).isReady())0==--i&&t();else{n=r.onLoadObservable;var o=function(){n.removeCallback(o),0==--i&&t()};n.add(o)}},s=0;sa&&(a=u)}return new t(e,s,a-s+1,i,r,n,o)},t}(l)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=i(2),o=i(7),s=i(0),a=function(e){function t(i,r,n){void 0===r&&(r=null),void 0===n&&(n=!0);var a=e.call(this,i,r)||this;return a._forward=new s.x(0,0,1),a._forwardInverted=new s.x(0,0,-1),a._up=new s.x(0,1,0),a._right=new s.x(1,0,0),a._rightInverted=new s.x(-1,0,0),a._position=s.x.Zero(),a._rotation=s.x.Zero(),a._scaling=s.x.One(),a._isDirty=!1,a.billboardMode=t.BILLBOARDMODE_NONE,a.scalingDeterminant=1,a.infiniteDistance=!1,a.ignoreNonUniformScaling=!1,a._localMatrix=s.j.Zero(),a._absolutePosition=s.x.Zero(),a._pivotMatrix=s.j.Identity(),a._postMultiplyPivotMatrix=!1,a._isWorldMatrixFrozen=!1,a._indexInSceneTransformNodesArray=-1,a.onAfterWorldMatrixUpdateObservable=new o.c,a._nonUniformScaling=!1,n&&a.getScene().addTransformNode(a),a}return r.d(t,e),t.prototype.getClassName=function(){return"TransformNode"},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._rotationQuaternion},set:function(e){this._rotationQuaternion=e,e&&this.rotation.setAll(0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"forward",{get:function(){return s.x.Normalize(s.x.TransformNormal(this.getScene().useRightHandedSystem?this._forwardInverted:this._forward,this.getWorldMatrix()))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"up",{get:function(){return s.x.Normalize(s.x.TransformNormal(this._up,this.getWorldMatrix()))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return s.x.Normalize(s.x.TransformNormal(this.getScene().useRightHandedSystem?this._rightInverted:this._right,this.getWorldMatrix()))},enumerable:!0,configurable:!0}),t.prototype.updatePoseMatrix=function(e){return this._poseMatrix.copyFrom(e),this},t.prototype.getPoseMatrix=function(){return this._poseMatrix},t.prototype._isSynchronized=function(){return!this._isDirty&&(this.billboardMode===this._cache.billboardMode&&this.billboardMode===t.BILLBOARDMODE_NONE&&(!this._cache.pivotMatrixUpdated&&(!this.infiniteDistance&&(!!this._cache.position.equals(this._position)&&(!(this._rotationQuaternion&&!this._cache.rotationQuaternion.equals(this._rotationQuaternion))&&(!!this._cache.rotation.equals(this._rotation)&&!!this._cache.scaling.equals(this._scaling)))))))},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.localMatrixUpdated=!1,this._cache.position=s.x.Zero(),this._cache.scaling=s.x.Zero(),this._cache.rotation=s.x.Zero(),this._cache.rotationQuaternion=new s.q(0,0,0,0),this._cache.billboardMode=-1,this._cache.infiniteDistance=!1},t.prototype.markAsDirty=function(e){return"rotation"===e&&(this.rotationQuaternion=null),this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this},Object.defineProperty(t.prototype,"absolutePosition",{get:function(){return this._absolutePosition},enumerable:!0,configurable:!0}),t.prototype.setPreTransformMatrix=function(e){return this.setPivotMatrix(e,!1)},t.prototype.setPivotMatrix=function(e,t){return void 0===t&&(t=!0),this._pivotMatrix.copyFrom(e),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=s.j.Invert(this._pivotMatrix)),this},t.prototype.getPivotMatrix=function(){return this._pivotMatrix},t.prototype.freezeWorldMatrix=function(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this._isWorldMatrixFrozen=!0,this},t.prototype.unfreezeWorldMatrix=function(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this},Object.defineProperty(t.prototype,"isWorldMatrixFrozen",{get:function(){return this._isWorldMatrixFrozen},enumerable:!0,configurable:!0}),t.prototype.getAbsolutePosition=function(){return this.computeWorldMatrix(),this._absolutePosition},t.prototype.setAbsolutePosition=function(e){if(!e)return this;var t,i,r;if(void 0===e.x){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],r=arguments[2]}else t=e.x,i=e.y,r=e.z;if(this.parent){var n=s.t.Matrix[0];this.parent.getWorldMatrix().invertToRef(n),s.x.TransformCoordinatesFromFloatsToRef(t,i,r,n,this.position)}else this.position.x=t,this.position.y=i,this.position.z=r;return this},t.prototype.setPositionWithLocalVector=function(e){return this.computeWorldMatrix(),this.position=s.x.TransformNormal(e,this._localMatrix),this},t.prototype.getPositionExpressedInLocalSpace=function(){this.computeWorldMatrix();var e=s.t.Matrix[0];return this._localMatrix.invertToRef(e),s.x.TransformNormal(this.position,e)},t.prototype.locallyTranslate=function(e){return this.computeWorldMatrix(!0),this.position=s.x.TransformCoordinates(e,this._localMatrix),this},t.prototype.lookAt=function(e,i,r,n,o){void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=s.s.LOCAL);var a=t._lookAtVectorCache,c=o===s.s.LOCAL?this.position:this.getAbsolutePosition();if(e.subtractToRef(c,a),this.setDirection(a,i,r,n),o===s.s.WORLD&&this.parent)if(this.rotationQuaternion){var l=s.t.Matrix[0];this.rotationQuaternion.toRotationMatrix(l);var u=s.t.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(u),u.invert(),l.multiplyToRef(u,l),this.rotationQuaternion.fromRotationMatrix(l)}else{var h=s.t.Quaternion[0];s.q.FromEulerVectorToRef(this.rotation,h);l=s.t.Matrix[0];h.toRotationMatrix(l);u=s.t.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(u),u.invert(),l.multiplyToRef(u,l),h.fromRotationMatrix(l),h.toEulerAnglesToRef(this.rotation)}return this},t.prototype.getDirection=function(e){var t=s.x.Zero();return this.getDirectionToRef(e,t),t},t.prototype.getDirectionToRef=function(e,t){return s.x.TransformNormalToRef(e,this.getWorldMatrix(),t),this},t.prototype.setDirection=function(e,t,i,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=0);var n=-Math.atan2(e.z,e.x)+Math.PI/2,o=Math.sqrt(e.x*e.x+e.z*e.z),a=-Math.atan2(e.y,o);return this.rotationQuaternion?s.q.RotationYawPitchRollToRef(n+t,a+i,r,this.rotationQuaternion):(this.rotation.x=a+i,this.rotation.y=n+t,this.rotation.z=r),this},t.prototype.setPivotPoint=function(e,t){void 0===t&&(t=s.s.LOCAL),0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);var i=this.getWorldMatrix();if(t==s.s.WORLD){var r=s.t.Matrix[0];i.invertToRef(r),e=s.x.TransformCoordinates(e,r)}return this.setPivotMatrix(s.j.Translation(-e.x,-e.y,-e.z),!0)},t.prototype.getPivotPoint=function(){var e=s.x.Zero();return this.getPivotPointToRef(e),e},t.prototype.getPivotPointToRef=function(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this},t.prototype.getAbsolutePivotPoint=function(){var e=s.x.Zero();return this.getAbsolutePivotPointToRef(e),e},t.prototype.getAbsolutePivotPointToRef=function(e){return e.x=this._pivotMatrix.m[12],e.y=this._pivotMatrix.m[13],e.z=this._pivotMatrix.m[14],this.getPivotPointToRef(e),s.x.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this},t.prototype.setParent=function(e){if(!e&&!this.parent)return this;var t=s.t.Quaternion[0],i=s.t.Vector3[0],r=s.t.Vector3[1];if(e){var n=s.t.Matrix[0],o=s.t.Matrix[1];this.computeWorldMatrix(!0),e.computeWorldMatrix(!0),e.getWorldMatrix().invertToRef(o),this.getWorldMatrix().multiplyToRef(o,n),n.decompose(r,t,i)}else this.parent&&this.parent.computeWorldMatrix&&this.parent.computeWorldMatrix(!0),this.computeWorldMatrix(!0),this.getWorldMatrix().decompose(r,t,i);return this.rotationQuaternion?this.rotationQuaternion.copyFrom(t):t.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(r),this.position.copyFrom(i),this.parent=e,this},Object.defineProperty(t.prototype,"nonUniformScaling",{get:function(){return this._nonUniformScaling},enumerable:!0,configurable:!0}),t.prototype._updateNonUniformScalingState=function(e){return this._nonUniformScaling!==e&&(this._nonUniformScaling=e,!0)},t.prototype.attachToBone=function(e,t){return this._transformToBoneReferal=t,this.parent=e,e.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this},t.prototype.detachFromBone=function(){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,this.parent=null,this):this},t.prototype.rotate=function(e,i,r){var n;if(e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0)),r&&r!==s.s.LOCAL){if(this.parent){var o=s.t.Matrix[0];this.parent.getWorldMatrix().invertToRef(o),e=s.x.TransformNormal(e,o)}(n=s.q.RotationAxisToRef(e,i,t._rotationAxisCache)).multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}else n=s.q.RotationAxisToRef(e,i,t._rotationAxisCache),this.rotationQuaternion.multiplyToRef(n,this.rotationQuaternion);return this},t.prototype.rotateAround=function(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=s.q.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));var r=s.t.Vector3[0],n=s.t.Vector3[1],o=s.t.Vector3[2],a=s.t.Quaternion[0],c=s.t.Matrix[0],l=s.t.Matrix[1],u=s.t.Matrix[2],h=s.t.Matrix[3];return e.subtractToRef(this.position,r),s.j.TranslationToRef(r.x,r.y,r.z,c),s.j.TranslationToRef(-r.x,-r.y,-r.z,l),s.j.RotationAxisToRef(t,i,u),l.multiplyToRef(u,h),h.multiplyToRef(c,h),h.decompose(n,a,o),this.position.addInPlace(o),a.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this},t.prototype.translate=function(e,t,i){var r=e.scale(t);if(i&&i!==s.s.LOCAL)this.setAbsolutePosition(this.getAbsolutePosition().add(r));else{var n=this.getPositionExpressedInLocalSpace().add(r);this.setPositionWithLocalVector(n)}return this},t.prototype.addRotation=function(e,t,i){var r;this.rotationQuaternion?r=this.rotationQuaternion:(r=s.t.Quaternion[1],s.q.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,r));var n=s.t.Quaternion[0];return s.q.RotationYawPitchRollToRef(t,e,i,n),r.multiplyInPlace(n),this.rotationQuaternion||r.toEulerAnglesToRef(this.rotation),this},t.prototype.computeWorldMatrix=function(e){if(this._isWorldMatrixFrozen)return this._worldMatrix;if(!e&&this.isSynchronized())return this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix;(this._updateCache(),this._cache.position.copyFrom(this.position),this._cache.scaling.copyFrom(this.scaling),this._cache.pivotMatrixUpdated=!1,this._cache.billboardMode=this.billboardMode,this._cache.infiniteDistance=this.infiniteDistance,this._currentRenderId=this.getScene().getRenderId(),this._childRenderId=this.getScene().getRenderId(),this._isDirty=!1,s.j.ScalingToRef(this.scaling.x*this.scalingDeterminant,this.scaling.y*this.scalingDeterminant,this.scaling.z*this.scalingDeterminant,s.t.Matrix[1]),this.rotationQuaternion)&&(this.rotation.length()&&(this.rotationQuaternion.multiplyInPlace(s.q.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)),this.rotation.copyFromFloats(0,0,0)));this.rotationQuaternion?(this.rotationQuaternion.toRotationMatrix(s.t.Matrix[0]),this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)):(s.j.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s.t.Matrix[0]),this._cache.rotation.copyFrom(this.rotation));var i=this.getScene().activeCamera;if(this.infiniteDistance&&!this.parent&&i){var r=i.getWorldMatrix(),n=new s.x(r.m[12],r.m[13],r.m[14]);s.j.TranslationToRef(this.position.x+n.x,this.position.y+n.y,this.position.z+n.z,s.t.Matrix[2])}else s.j.TranslationToRef(this.position.x,this.position.y,this.position.z,s.t.Matrix[2]);if(this._pivotMatrix.multiplyToRef(s.t.Matrix[1],s.t.Matrix[4]),s.t.Matrix[4].multiplyToRef(s.t.Matrix[0],s.t.Matrix[5]),this.billboardMode!==t.BILLBOARDMODE_NONE&&i){if((this.billboardMode&t.BILLBOARDMODE_ALL)!==t.BILLBOARDMODE_ALL){var o=s.t.Vector3[3];this.parent&&this.parent.getWorldMatrix?this._transformToBoneReferal?(this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.t.Matrix[6]),s.x.TransformCoordinatesToRef(this.position,s.t.Matrix[6],o)):s.x.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),o):o.copyFrom(this.position),o.subtractInPlace(i.globalPosition);var a=s.t.Vector3[4].copyFromFloats(0,0,0);(this.billboardMode&t.BILLBOARDMODE_X)===t.BILLBOARDMODE_X&&(a.x=Math.atan2(-o.y,o.z)),(this.billboardMode&t.BILLBOARDMODE_Y)===t.BILLBOARDMODE_Y&&(a.y=Math.atan2(o.x,o.z)),(this.billboardMode&t.BILLBOARDMODE_Z)===t.BILLBOARDMODE_Z&&(a.z=Math.atan2(o.y,o.x)),s.j.RotationYawPitchRollToRef(a.y,a.x,a.z,s.t.Matrix[0])}else s.t.Matrix[1].copyFrom(i.getViewMatrix()),s.t.Matrix[1].setTranslationFromFloats(0,0,0),s.t.Matrix[1].invertToRef(s.t.Matrix[0]);s.t.Matrix[1].copyFrom(s.t.Matrix[5]),s.t.Matrix[1].multiplyToRef(s.t.Matrix[0],s.t.Matrix[5])}return this._postMultiplyPivotMatrix&&s.t.Matrix[5].multiplyToRef(this._pivotMatrixInverse,s.t.Matrix[5]),s.t.Matrix[5].multiplyToRef(s.t.Matrix[2],this._localMatrix),this.parent&&this.parent.getWorldMatrix?(this.billboardMode!==t.BILLBOARDMODE_NONE?(this._transformToBoneReferal?(this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.t.Matrix[6]),s.t.Matrix[5].copyFrom(s.t.Matrix[6])):s.t.Matrix[5].copyFrom(this.parent.getWorldMatrix()),this._localMatrix.getTranslationToRef(s.t.Vector3[5]),s.x.TransformCoordinatesToRef(s.t.Vector3[5],s.t.Matrix[5],s.t.Vector3[5]),this._worldMatrix.copyFrom(this._localMatrix),this._worldMatrix.setTranslation(s.t.Vector3[5])):this._transformToBoneReferal?(this._localMatrix.multiplyToRef(this.parent.getWorldMatrix(),s.t.Matrix[6]),s.t.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)):this._localMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()):this._worldMatrix.copyFrom(this._localMatrix),this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this.scaling.isNonUniform?this._updateNonUniformScalingState(!0):this.parent&&this.parent._nonUniformScaling?this._updateNonUniformScalingState(this.parent._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=s.j.Invert(this._worldMatrix)),this._worldMatrixDeterminant=this._worldMatrix.determinant(),this._worldMatrix},t.prototype._afterComputeWorldMatrix=function(){},t.prototype.registerAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.add(e),this},t.prototype.unregisterAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.removeCallback(e),this},t.prototype.getPositionInCameraSpace=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),s.x.TransformCoordinates(this.absolutePosition,e.getViewMatrix())},t.prototype.getDistanceToCamera=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),this.absolutePosition.subtract(e.position).length()},t.prototype.clone=function(e,i,r){var o=this,s=n.a.Clone(function(){return new t(e,o.getScene())},this);if(s.name=e,s.id=e,i&&(s.parent=i),!r)for(var a=this.getDescendants(!0),c=0;c1)throw"Multiple drag modes specified in dragBehavior options. Only one expected"}return Object.defineProperty(e.prototype,"name",{get:function(){return"PointerDrag"},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t){var i=this;this._scene=t.getScene(),this._attachedNode=t,e._planeScene||(this._debugMode?e._planeScene=this._scene:(e._planeScene=new n.a(this._scene.getEngine()),e._planeScene.detachControl(),this._scene.getEngine().scenes.pop(),this._scene.onDisposeObservable.addOnce(function(){e._planeScene.dispose(),e._planeScene=null}))),this._dragPlane=r.a.CreatePlane("pointerDragPlane",this._debugMode?1:1e4,e._planeScene,!1,r.a.DOUBLESIDE),this.lastDragPosition=new s.x(0,0,0);this._pointerObserver=this._scene.onPointerObservable.add(function(t,r){var n;if(i.enabled)if(t.type==a.a.POINTERDOWN)!i.dragging&&t.pickInfo&&t.pickInfo.hit&&t.pickInfo.pickedMesh&&t.pickInfo.pickedPoint&&t.pickInfo.ray&&(n=t.pickInfo.pickedMesh,i._attachedNode==n||n.isDescendantOf(i._attachedNode))&&i._startDrag(t.event.pointerId,t.pickInfo.ray,t.pickInfo.pickedPoint);else if(t.type==a.a.POINTERUP)i.currentDraggingPointerID==t.event.pointerId&&i.releaseDrag();else if(t.type==a.a.POINTERMOVE){var o=t.event.pointerId;i.currentDraggingPointerID===e._AnyMouseID&&o!==e._AnyMouseID&&"mouse"==t.event.pointerType&&(i._lastPointerRay[i.currentDraggingPointerID]&&(i._lastPointerRay[o]=i._lastPointerRay[i.currentDraggingPointerID],delete i._lastPointerRay[i.currentDraggingPointerID]),i.currentDraggingPointerID=o),i._lastPointerRay[o]||(i._lastPointerRay[o]=new c.a(new s.x,new s.x)),t.pickInfo&&t.pickInfo.ray&&(i._lastPointerRay[o].origin.copyFrom(t.pickInfo.ray.origin),i._lastPointerRay[o].direction.copyFrom(t.pickInfo.ray.direction),i.currentDraggingPointerID==o&&i.dragging&&i._moveDrag(t.pickInfo.ray))}}),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(function(){i._moving&&i.moveAttached&&(l.a._RemoveAndStorePivotPoint(i._attachedNode),i._targetPosition.subtractToRef(i._attachedNode.absolutePosition,i._tmpVector),i._tmpVector.scaleInPlace(i.dragDeltaRatio),i._attachedNode.getAbsolutePosition().addToRef(i._tmpVector,i._tmpVector),i.validateDrag(i._tmpVector)&&i._attachedNode.setAbsolutePosition(i._tmpVector),l.a._RestorePivotPoint(i._attachedNode))})},e.prototype.releaseDrag=function(){this.dragging=!1,this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerID}),this.currentDraggingPointerID=-1,this._moving=!1,this.detachCameraControls&&this._attachedElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera&&this._scene.activeCamera.attachControl(this._attachedElement,!0)},e.prototype.startDrag=function(t,i,r){void 0===t&&(t=e._AnyMouseID),this._startDrag(t,i,r);var n=this._lastPointerRay[t];t===e._AnyMouseID&&(n=this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]),n&&this._moveDrag(n)},e.prototype._startDrag=function(e,t,i){if(this._scene.activeCamera&&!this.dragging&&this._attachedNode){l.a._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,i||this._tmpVector);var r=this._pickWithRayOnDragPlane(this._startDragRay);r&&(this.dragging=!0,this.currentDraggingPointerID=e,this.lastDragPosition.copyFrom(r),this.onDragStartObservable.notifyObservers({dragPlanePoint:r,pointerId:this.currentDraggingPointerID}),this._targetPosition.copyFrom(this._attachedNode.absolutePosition),this.detachCameraControls&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera&&(this._scene.activeCamera.inputs.attachedElement?(this._attachedElement=this._scene.activeCamera.inputs.attachedElement,this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement)):this._attachedElement=null)),l.a._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 i=0;this._options.dragAxis?(s.x.TransformCoordinatesToRef(this._options.dragAxis,this._attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis),t.subtractToRef(this.lastDragPosition,this._tmpVector),i=s.x.Dot(this._tmpVector,this._worldDragAxis),this._worldDragAxis.scaleToRef(i,this._dragDelta)):(i=this._dragDelta.length(),t.subtractToRef(this.lastDragPosition,this._dragDelta)),this._targetPosition.addInPlace(this._dragDelta),this.onDragObservable.notifyObservers({dragDistance:i,delta:this._dragDelta,dragPlanePoint:t,dragPlaneNormal:this._dragPlane.forward,pointerId:this.currentDraggingPointerID}),this.lastDragPosition.copyFrom(t)}},e.prototype._pickWithRayOnDragPlane=function(t){var i=this;if(!t)return null;var r=Math.acos(s.x.Dot(this._dragPlane.forward,t.direction));if(r>Math.PI/2&&(r=Math.PI-r),this.maxDragAngle>0&&r>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.x.Dot(this._alternatePickedPoint,this._tmpVector)),this._tmpVector.addInPlace(this._alternatePickedPoint);var n=s.x.Dot(this._dragPlane.forward,this._tmpVector);return this._dragPlane.forward.scaleToRef(-n,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==i._dragPlane});return o&&o.hit&&o.pickedMesh&&o.pickedPoint?o.pickedPoint:null},e.prototype._updateDragPlanePosition=function(e,t){this._pointA.copyFrom(t),this._options.dragAxis?(this.useObjectOrienationForDragging?s.x.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.x.CrossToRef(this._lineA,this._lineB,this._lookAt),s.x.CrossToRef(this._lineA,this._lookAt,this._lookAt),this._lookAt.normalize(),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._lookAt,this._lookAt),this._dragPlane.lookAt(this._lookAt)):this._options.dragPlaneNormal?(this.useObjectOrienationForDragging?s.x.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)},e._AnyMouseID=-2,e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(3),n=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return e._ForceFullSceneLoadingForIncremental},set:function(t){e._ForceFullSceneLoadingForIncremental=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return e._ShowLoadingScreen},set:function(t){e._ShowLoadingScreen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return e._loggingLevel},set:function(t){e._loggingLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return e._CleanBoneMatrixWeights},set:function(t){e._CleanBoneMatrixWeights=t},enumerable:!0,configurable:!0}),e._ForceFullSceneLoadingForIncremental=!1,e._ShowLoadingScreen=!0,e._CleanBoneMatrixWeights=!1,e._loggingLevel=r.a.SCENELOADER_NO_LOGGING,e}()},function(e,t,i){"use strict";var r="helperFunctions",n="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);\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.0,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\nvec3 applyEaseInOut(vec3 x){\nreturn x*x*(3.0-2.0*x);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat 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=max(0.0000001,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}";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=i(10),o=i(13);o.a.CreateSphere=function(e){for(var t=e.segments||32,i=e.diameterX||e.diameter||1,n=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.a.DEFAULTSIDE,u=new r.x(i/2,n/2,s/2),h=2+t,d=2*h,f=[],p=[],_=[],m=[],g=0;g<=h;g++){for(var v=g/h,y=v*Math.PI*c,b=0;b<=d;b++){var T=b/d,E=T*Math.PI*2*a,x=r.j.RotationZ(-y),A=r.j.RotationY(E),P=r.x.TransformCoordinates(r.x.Up(),x),R=r.x.TransformCoordinates(P,A),S=R.multiply(u),C=R.divide(u).normalize();p.push(S.x,S.y,S.z),_.push(C.x,C.y,C.z),m.push(T,v)}if(g>0)for(var M=p.length/3,O=M-2*(d+1);O+d+20&&(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,i=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);i.setVerticesData(o.b.PositionKind,u,!1)}if(l.normalsAttrDesc&&l.normalsAttrDesc.count>0){var h=new Float32Array(t,l.normalsAttrDesc.offset,l.normalsAttrDesc.count);i.setVerticesData(o.b.NormalKind,h,!1)}if(l.tangetsAttrDesc&&l.tangetsAttrDesc.count>0){var d=new Float32Array(t,l.tangetsAttrDesc.offset,l.tangetsAttrDesc.count);i.setVerticesData(o.b.TangentKind,d,!1)}if(l.uvsAttrDesc&&l.uvsAttrDesc.count>0){var f=new Float32Array(t,l.uvsAttrDesc.offset,l.uvsAttrDesc.count);i.setVerticesData(o.b.UVKind,f,!1)}if(l.uvs2AttrDesc&&l.uvs2AttrDesc.count>0){var p=new Float32Array(t,l.uvs2AttrDesc.offset,l.uvs2AttrDesc.count);i.setVerticesData(o.b.UV2Kind,p,!1)}if(l.uvs3AttrDesc&&l.uvs3AttrDesc.count>0){var _=new Float32Array(t,l.uvs3AttrDesc.offset,l.uvs3AttrDesc.count);i.setVerticesData(o.b.UV3Kind,_,!1)}if(l.uvs4AttrDesc&&l.uvs4AttrDesc.count>0){var m=new Float32Array(t,l.uvs4AttrDesc.offset,l.uvs4AttrDesc.count);i.setVerticesData(o.b.UV4Kind,m,!1)}if(l.uvs5AttrDesc&&l.uvs5AttrDesc.count>0){var g=new Float32Array(t,l.uvs5AttrDesc.offset,l.uvs5AttrDesc.count);i.setVerticesData(o.b.UV5Kind,g,!1)}if(l.uvs6AttrDesc&&l.uvs6AttrDesc.count>0){var v=new Float32Array(t,l.uvs6AttrDesc.offset,l.uvs6AttrDesc.count);i.setVerticesData(o.b.UV6Kind,v,!1)}if(l.colorsAttrDesc&&l.colorsAttrDesc.count>0){var y=new Float32Array(t,l.colorsAttrDesc.offset,l.colorsAttrDesc.count);i.setVerticesData(o.b.ColorKind,y,!1,l.colorsAttrDesc.stride)}if(l.matricesIndicesAttrDesc&&l.matricesIndicesAttrDesc.count>0){for(var b=new Int32Array(t,l.matricesIndicesAttrDesc.offset,l.matricesIndicesAttrDesc.count),T=[],E=0;E>8),T.push((16711680&x)>>16),T.push(x>>24)}i.setVerticesData(o.b.MatricesIndicesKind,T,!1)}if(l.matricesWeightsAttrDesc&&l.matricesWeightsAttrDesc.count>0){var A=new Float32Array(t,l.matricesWeightsAttrDesc.offset,l.matricesWeightsAttrDesc.count);i.setVerticesData(o.b.MatricesWeightsKind,A,!1)}if(l.indicesAttrDesc&&l.indicesAttrDesc.count>0){var P=new Int32Array(t,l.indicesAttrDesc.offset,l.indicesAttrDesc.count);i.setIndices(P,null)}if(l.subMeshesAttrDesc&&l.subMeshesAttrDesc.count>0){var R=new Int32Array(t,l.subMeshesAttrDesc.offset,5*l.subMeshesAttrDesc.count);i.subMeshes=[];for(E=0;E>8),T.push((16711680&D)>>16),T.push(D>>24)}i.setVerticesData(o.b.MatricesIndicesKind,T,t.matricesIndices._updatable)}if(t.matricesIndicesExtra)if(t.matricesIndicesExtra._isExpanded)delete t.matricesIndices._isExpanded,i.setVerticesData(o.b.MatricesIndicesExtraKind,t.matricesIndicesExtra,t.matricesIndicesExtra._updatable);else{for(T=[],E=0;E>8),T.push((16711680&D)>>16),T.push(D>>24)}i.setVerticesData(o.b.MatricesIndicesExtraKind,T,t.matricesIndicesExtra._updatable)}t.matricesWeights&&(e._CleanMatricesWeights(t,i),i.setVerticesData(o.b.MatricesWeightsKind,t.matricesWeights,t.matricesWeights._updatable)),t.matricesWeightsExtra&&i.setVerticesData(o.b.MatricesWeightsExtraKind,t.matricesWeightsExtra,t.matricesWeights._updatable),i.setIndices(t.indices,null)}if(t.subMeshes){i.subMeshes=[];for(var w=0;w-1){var r=t.getScene().getLastSkeletonByID(e.skeletonId);if(r){i=r.bones.length;for(var n=t.getVerticesData(o.b.MatricesIndicesKind),s=t.getVerticesData(o.b.MatricesIndicesExtraKind),c=e.matricesWeights,l=e.matricesWeightsExtra,u=e.numBoneInfluencer,h=c.length,d=0;du-1)&&(p=u-1),f>.001){var g=1/f;for(_=0;_<4;_++)c[d+_]*=g;if(l)for(_=0;_<4;_++)l[d+_]*=g}else p>=4?(l[d+p-4]=1-f,s[d+p-4]=i):(c[d+p]=1-f,n[d+p]=i)}t.setVerticesData(o.b.MatricesIndicesKind,n),e.matricesWeightsExtra&&t.setVerticesData(o.b.MatricesIndicesExtraKind,s)}}}},e.Parse=function(t,i,s){if(i.getGeometryByID(t.id))return null;var a=new e(t.id,i,void 0,t.updatable);return h.a&&h.a.AddTagsTo(a,t.tags),t.delayLoadingFile?(a.delayLoadState=l.a.DELAYLOADSTATE_NOTLOADED,a.delayLoadingFile=s+t.delayLoadingFile,a._boundingInfo=new c.a(r.x.FromArray(t.boundingBoxMinimum),r.x.FromArray(t.boundingBoxMaximum)),a._delayInfo=[],t.hasUVs&&a._delayInfo.push(o.b.UVKind),t.hasUVs2&&a._delayInfo.push(o.b.UV2Kind),t.hasUVs3&&a._delayInfo.push(o.b.UV3Kind),t.hasUVs4&&a._delayInfo.push(o.b.UV4Kind),t.hasUVs5&&a._delayInfo.push(o.b.UV5Kind),t.hasUVs6&&a._delayInfo.push(o.b.UV6Kind),t.hasColors&&a._delayInfo.push(o.b.ColorKind),t.hasMatricesIndices&&a._delayInfo.push(o.b.MatricesIndicesKind),t.hasMatricesWeights&&a._delayInfo.push(o.b.MatricesWeightsKind),a._delayLoadingFunction=n.a.ImportVertexData):n.a.ImportVertexData(t,a),i.pushGeometry(a,!0),a},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var r=i(1),n=i(7),o=i(0),s=i(48),a=i(62),c=i(35),l=i(52),u=i(45),h=i(41),d=i(33),f=function(e){function t(i,r,s){void 0===r&&(r=o.e.Gray()),void 0===s&&(s=h.a.DefaultUtilityLayer);var a=e.call(this,s)||this;a._pointerObserver=null,a.snapDistance=0,a.onSnapObservable=new n.c;var c=new d.a("",s.utilityLayerScene);c.disableLighting=!0,c.emissiveColor=r;var u=new d.a("",s.utilityLayerScene);u.disableLighting=!0,u.emissiveColor=r.add(new o.e(.3,.3,.3));var f=t._CreateArrow(s.utilityLayerScene,c);f.lookAt(a._rootMesh.position.add(i)),f.scaling.scaleInPlace(1/3),f.parent=a._rootMesh;var p=0,_=new o.x,m={snapDistance:0};a.dragBehavior=new l.a({dragAxis:i}),a.dragBehavior.moveAttached=!1,a._rootMesh.addBehavior(a.dragBehavior);var g=new o.x,v=new o.j;return a.dragBehavior.onDragObservable.add(function(e){if(a.attachedMesh)if(a.attachedMesh.parent?(a.attachedMesh.parent.computeWorldMatrix().invertToRef(v),v.setTranslationFromFloats(0,0,0),o.x.TransformCoordinatesToRef(e.delta,v,g)):g.copyFrom(e.delta),0==a.snapDistance)a.attachedMesh.position.addInPlace(g);else if(p+=e.dragDistance,Math.abs(p)>a.snapDistance){var t=Math.floor(Math.abs(p)/a.snapDistance);p%=a.snapDistance,g.normalizeToRef(_),_.scaleInPlace(a.snapDistance*t),a.attachedMesh.position.addInPlace(_),m.snapDistance=a.snapDistance*t,a.onSnapObservable.notifyObservers(m)}}),a._pointerObserver=s.utilityLayerScene.onPointerObservable.add(function(e){if(!a._customMeshSet){var t=e.pickInfo&&-1!=a._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?u:c;a._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),a}return r.d(t,e),t._CreateArrow=function(e,t){var i=new s.a("arrow",e),r=a.a.CreateCylinder("cylinder",{diameterTop:0,height:1.5,diameterBottom:.75,tessellation:96},e),n=c.a.CreateLines("line",{points:[new o.x(0,0,0),new o.x(0,1.1,0)]},e);return n.color=t.emissiveColor,r.parent=i,n.parent=i,r.scaling.scaleInPlace(.05),r.material=t,r.rotation.x=Math.PI/2,r.position.z+=.3,n.scaling.scaleInPlace(.26),n.rotation.x=Math.PI/2,n.material=t,i},t._CreateArrowInstance=function(e,t){for(var i=new s.a("arrow",e),r=0,n=t.getChildMeshes();r1)?1:e.arc||1,d=0===e.sideOrientation?0:e.sideOrientation||o.a.DEFAULTSIDE,f=e.faceUV||new Array(3),p=e.faceColors,_=2+(1+(1!==h&&u?2:0))*(l?c:1);for(t=0;t<_;t++)p&&void 0===p[t]&&(p[t]=new r.f(1,1,1,1));for(t=0;t<_;t++)f&&void 0===f[t]&&(f[t]=new r.y(0,0,1,1));var m,g,v,y,b,T,E=new Array,x=new Array,A=new Array,P=new Array,R=new Array,S=2*Math.PI*h/a,C=(s-n)/2/i,M=r.x.Zero(),O=r.x.Zero(),I=r.x.Zero(),D=r.x.Zero(),w=r.x.Zero(),L=r.c.Y,F=1,N=1,B=0,U=0;for(y=0;y<=c;y++)for(v=((g=y/c)*(n-s)+s)/2,F=l&&0!==y&&y!==c?2:1,T=0;T=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,i){for(var r=0;r=0&&n.multiMaterials.splice(o,1),e.prototype.dispose.call(this,t,i)}},t.ParseMultiMaterial=function(e,i){var r=new t(e.name,i);r.id=e.id,o.a&&o.a.AddTagsTo(r,e.tags);for(var n=0;n4&&(o.push(s.b.MatricesIndicesExtraKind),o.push(s.b.MatricesWeightsExtraKind));var h=e.skeleton;n.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),a.addCPUSkinningFallback(0,e),h.isUsingTextureForMatrices?(n.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")):(n.push("#define BonesPerMesh "+(h.bones.length+1)),-1===this._options.uniforms.indexOf("mBones")&&this._options.uniforms.push("mBones"))}else n.push("#define NUM_BONE_INFLUENCERS 0");for(var d in this._textures)if(!this._textures[d].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&n.push("#define ALPHATEST");var f=this._effect,p=n.join("\n");return this._effect=r.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},r),!!this._effect.isReady()&&(f!==this._effect&&i.resetCachedMaterial(),this._renderId=i.getRenderId(),!0)},t.prototype.bindOnlyWorldMatrix=function(e){var t=this.getScene();this._effect&&(-1!==this._options.uniforms.indexOf("world")&&this._effect.setMatrix("world",e),-1!==this._options.uniforms.indexOf("worldView")&&(e.multiplyToRef(t.getViewMatrix(),this._cachedWorldViewMatrix),this._effect.setMatrix("worldView",this._cachedWorldViewMatrix)),-1!==this._options.uniforms.indexOf("worldViewProjection")&&this._effect.setMatrix("worldViewProjection",e.multiply(t.getTransformMatrix())))},t.prototype.bind=function(e,t){if(this.bindOnlyWorldMatrix(e),this._effect&&this.getScene().getCachedMaterial()!==this){var i;for(i in-1!==this._options.uniforms.indexOf("view")&&this._effect.setMatrix("view",this.getScene().getViewMatrix()),-1!==this._options.uniforms.indexOf("projection")&&this._effect.setMatrix("projection",this.getScene().getProjectionMatrix()),-1!==this._options.uniforms.indexOf("viewProjection")&&this._effect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),c.a.BindBonesParameters(t,this._effect),this._textures)this._effect.setTexture(i,this._textures[i]);for(i in this._textureArrays)this._effect.setTextureArray(i,this._textureArrays[i]);for(i in this._ints)this._effect.setInt(i,this._ints[i]);for(i in this._floats)this._effect.setFloat(i,this._floats[i]);for(i in this._floatsArrays)this._effect.setArray(i,this._floatsArrays[i]);for(i in this._colors3)this._effect.setColor3(i,this._colors3[i]);for(i in this._colors3Arrays)this._effect.setArray3(i,this._colors3Arrays[i]);for(i in this._colors4){var r=this._colors4[i];this._effect.setFloat4(i,r.r,r.g,r.b,r.a)}for(i in this._vectors2)this._effect.setVector2(i,this._vectors2[i]);for(i in this._vectors3)this._effect.setVector3(i,this._vectors3[i]);for(i in this._vectors4)this._effect.setVector4(i,this._vectors4[i]);for(i in this._matrices)this._effect.setMatrix(i,this._matrices[i]);for(i in this._matrices3x3)this._effect.setMatrix3x3(i,this._matrices3x3[i]);for(i in this._matrices2x2)this._effect.setMatrix2x2(i,this._matrices2x2[i]);for(i in this._vectors2Arrays)this._effect.setArray2(i,this._vectors2Arrays[i]);for(i in this._vectors3Arrays)this._effect.setArray3(i,this._vectors3Arrays[i])}this._afterBind(t)},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);for(var i in this._textures)t.push(this._textures[i]);for(var i in this._textureArrays)for(var r=this._textureArrays[i],n=0;nu-r)&&(!(c-hh-o)&&!(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 i=this.minimumWorld,r=this.maximumWorld,n=i.x,o=i.y,s=i.z,a=r.x,c=r.y,l=r.z,u=e.x,h=e.y,d=e.z,f=t.x,p=t.y,_=t.z;return!(af)&&(!(cp)&&!(l_))},e.Intersects=function(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)},e.IntersectsSphere=function(t,i,r,o){var s=e.TmpVector3[0];return n.x.ClampToRef(r,t,i,s),n.x.DistanceSquared(r,s)<=o*o},e.IsCompletelyInFrustum=function(e,t){for(var i=0;i<6;++i)for(var r=t[i],n=0;n<8;++n)if(r.dotCoordinate(e[n])<0)return!1;return!0},e.IsInFrustum=function(e,t){for(var i=0;i<6;++i){for(var r=!0,n=t[i],o=0;o<8;++o)if(n.dotCoordinate(e[o])>=0){r=!1;break}if(r)return!1}return!0},e.TmpVector3=r.a.BuildArray(3,n.x.Zero),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(3),n=function(){function e(){this.hoverCursor="",this.actions=new Array}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 i=parseInt(t);if(i>=r.a.ACTION_OnPickTrigger&&i<=r.a.ACTION_OnPickUpTrigger)return!0}return!1},enumerable:!0,configurable:!0}),e.HasSpecificTrigger=function(t){for(var i in e.Triggers){if(e.Triggers.hasOwnProperty(i))if(parseInt(i)===t)return!0}return!1},e.Triggers={},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(10),n=i(13);n.a.CreatePlane=function(e){var t=[],i=[],r=[],o=[],s=e.width||e.size||1,a=e.height||e.size||1,c=0===e.sideOrientation?0:e.sideOrientation||n.a.DEFAULTSIDE,l=s/2,u=a/2;i.push(-l,-u,0),r.push(0,0,-1),o.push(0,0),i.push(l,-u,0),r.push(0,0,-1),o.push(1,0),i.push(l,u,0),r.push(0,0,-1),o.push(1,1),i.push(-l,u,0),r.push(0,0,-1),o.push(0,1),t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),n.a._ComputeSides(c,i,t,r,o,e.frontUVs,e.backUVs);var h=new n.a;return h.indices=t,h.positions=i,h.normals=r,h.uvs=o,h},r.a.CreatePlane=function(e,t,i,r,n){var s={size:t,width:t,height:t,sideOrientation:n,updatable:r};return o.CreatePlane(e,s,i)};var o=function(){function e(){}return e.CreatePlane=function(e,t,i){var o=new r.a(e,i);return t.sideOrientation=r.a._GetDefaultSideOrientation(t.sideOrientation),o._originalBuilderSideOrientation=t.sideOrientation,n.a.CreatePlane(t).applyToMesh(o,t.updatable),t.sourcePlane&&(o.translate(t.sourcePlane.normal,-t.sourcePlane.d),o.setDirection(t.sourcePlane.normal.scale(-1))),o},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(34),n=i(0),o=function(){function e(e,t,i){this.center=n.x.Zero(),this.centerWorld=n.x.Zero(),this.minimum=n.x.Zero(),this.maximum=n.x.Zero(),this.reConstruct(e,t,i)}return e.prototype.reConstruct=function(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);var r=n.x.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=.5*r,this._update(i||n.j.IdentityReadOnly)},e.prototype.scale=function(t){var i=this.radius*t,r=e.TmpVector3,n=r[0].setAll(i),o=this.center.subtractToRef(n,r[1]),s=this.center.addToRef(n,r[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{n.x.TransformCoordinatesToRef(this.center,t,this.centerWorld);var i=e.TmpVector3[0];n.x.TransformNormalFromFloatsToRef(1,1,1,t,i),this.radiusWorld=Math.max(Math.abs(i.x),Math.abs(i.y),Math.abs(i.z))*this.radius}},e.prototype.isInFrustum=function(e){for(var t=this.centerWorld,i=this.radiusWorld,r=0;r<6;r++)if(e[r].dotCoordinate(t)<=-i)return!1;return!0},e.prototype.isCenterInFrustum=function(e){for(var t=this.centerWorld,i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0},e.prototype.intersectsPoint=function(e){var t=n.x.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorldthis.value;case t.IsLesser:return this._effectiveTarget[this._property]-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 i=0;i=t.OnPickTrigger&&i.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&&i.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?(p.a.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 i=this.actions.indexOf(e);return-1!==i&&(this.actions.splice(i,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,i){for(var r=0;r0;if(2===e.type?f.push(n):f.push(i),m){for(var g=new Array,v=0;v0){var p=f.properties[0].value,_=null===f.properties[0].targetType?p:r.getMeshByName(p);_._meshId&&(_.mesh=r.getMeshByID(_._meshId)),d={trigger:t[f.name],parameter:_}}else d=t[f.name];for(var m=0;m=0;o--)this._keys[o].frame>=r&&this._keys[o].frame<=n&&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,i=this._keys.length;t0)return s.clone?s.clone():s;var a=this.getKeys(),c=Math.max(0,Math.min(a.length-1,Math.floor(a.length*(t-a[0].frame)/(a[a.length-1].frame-a[0].frame))-1));if(a[c].frame>=t)for(;c-1>=0&&a[c].frame>=t;)c--;for(var l=c;l=t){var h=a[l],d=this._getKeyValue(h.value);if(h.interpolation===I.STEP)return d;var f=this._getKeyValue(u.value),p=void 0!==h.outTangent&&void 0!==u.inTangent,_=u.frame-h.frame,m=(t-h.frame)/_,g=this.getEasingFunction();switch(null!=g&&(m=g.ease(m)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var v=p?this.floatInterpolateFunctionWithTangents(d,h.outTangent*_,f,u.inTangent*_,m):this.floatInterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return v;case e.ANIMATIONLOOPMODE_RELATIVE:return o*i+v}break;case e.ANIMATIONTYPE_QUATERNION:var y=p?this.quaternionInterpolateFunctionWithTangents(d,h.outTangent.scale(_),f,u.inTangent.scale(_),m):this.quaternionInterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return y;case e.ANIMATIONLOOPMODE_RELATIVE:return y.addInPlace(o.scale(i))}return y;case e.ANIMATIONTYPE_VECTOR3:var b=p?this.vector3InterpolateFunctionWithTangents(d,h.outTangent.scale(_),f,u.inTangent.scale(_),m):this.vector3InterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return b;case e.ANIMATIONLOOPMODE_RELATIVE:return b.add(o.scale(i))}case e.ANIMATIONTYPE_VECTOR2:var T=p?this.vector2InterpolateFunctionWithTangents(d,h.outTangent.scale(_),f,u.inTangent.scale(_),m):this.vector2InterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return T;case e.ANIMATIONLOOPMODE_RELATIVE:return T.add(o.scale(i))}case e.ANIMATIONTYPE_SIZE:switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(d,f,m);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(d,f,m).add(o.scale(i))}case e.ANIMATIONTYPE_COLOR3:switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(d,f,m);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(d,f,m).add(o.scale(i))}case e.ANIMATIONTYPE_MATRIX:switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:if(e.AllowMatricesInterpolation)return this.matrixInterpolateFunction(d,f,m,r);case e.ANIMATIONLOOPMODE_RELATIVE:return d}}break}}return this._getKeyValue(a[a.length-1].value)},e.prototype.matrixInterpolateFunction=function(t,i,r,n){return e.AllowMatrixDecomposeForInterpolation?n?(o.j.DecomposeLerpToRef(t,i,r,n),n):o.j.DecomposeLerp(t,i,r):n?(o.j.LerpToRef(t,i,r,n),n):o.j.Lerp(t,i,r)},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 i in t._ranges={},this._ranges){var r=this._ranges[i];r&&(t._ranges[i]=r.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 i=this.dataType;t.keys=[];for(var r=this.getKeys(),n=0;n=1&&(c=u.values[1]),u.values.length>=2&&(l=u.values[2]);break;case e.ANIMATIONTYPE_QUATERNION:if(i=o.q.FromArray(u.values),u.values.length>=8){var h=o.q.FromArray(u.values.slice(4,8));h.equals(o.q.Zero())||(c=h)}if(u.values.length>=12){var d=o.q.FromArray(u.values.slice(8,12));d.equals(o.q.Zero())||(l=d)}break;case e.ANIMATIONTYPE_MATRIX:i=o.j.FromArray(u.values);break;case e.ANIMATIONTYPE_COLOR3:i=o.e.FromArray(u.values);break;case e.ANIMATIONTYPE_VECTOR3:default:i=o.x.FromArray(u.values)}var f={};f.frame=u.frame,f.value=i,null!=c&&(f.inTangent=c),null!=l&&(f.outTangent=l),a.push(f)}if(n.setKeys(a),t.ranges)for(r=0;r0&&o.forEach(function(e){n._events.push(e._clone())})}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._activeTarget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),e.prototype.reset=function(e){if(void 0===e&&(e=!1),e)if(this._target instanceof Array)for(var t=0,i=0,r=this._target;i-1&&this._animation.runtimeAnimations.splice(e,1)},e.prototype._interpolate=function(e,t,i,r,n){return this._currentFrame=e,this._animation.dataType!==N.ANIMATIONTYPE_MATRIX||this._workValue||(this._workValue=o.j.Zero()),this._animation._interpolate(e,t,this._workValue,i,r,n)},e.prototype.setValue=function(e,t){if(void 0===t&&(t=1),this._target instanceof Array)for(var i=0,r=0,n=this._target;r1){for(var c=e[a[0]],l=1;lt[t.length-1].frame&&(e=t[t.length-1].frame);var i=this._interpolate(e,0,this._getCorrectLoopMode());this.setValue(i,-1)},e.prototype._prepareForSpeedRatioChange=function(e){var t=this._previousDelay*(this._animation.framePerSecond*e)/1e3;this._ratioOffset=this._previousRatio-t},e.prototype.animate=function(e,t,i,r,n,o,s){void 0===o&&(o=-1);var a=this._animation.targetPropertyPath;if(!a||a.length<1)return this._stopped=!0,!1;var c=!0,l=this._animation.getKeys();if(0!==l[0].frame){var u={frame:0,value:l[0].value};l.splice(0,0,u)}else if(1===l.length){u={frame:.001,value:l[0].value};l.push(u)}(tl[l.length-1].frame)&&(t=l[0].frame),(il[l.length-1].frame)&&(i=l[l.length-1].frame),t===i&&(t>l[0].frame?t--:it&&f>=d||t>i&&f<=d)&&!r)c=!1,p=this._animation._getKeyValue(l[l.length-1].value);else if(this._getCorrectLoopMode()!==N.ANIMATIONLOOPMODE_CYCLE){var _=i.toString()+t.toString();if(!this._offsetsCache[_]){var m=this._interpolate(t,0,N.ANIMATIONLOOPMODE_CYCLE),g=this._interpolate(i,0,N.ANIMATIONLOOPMODE_CYCLE);switch(this._animation.dataType){case N.ANIMATIONTYPE_FLOAT:this._offsetsCache[_]=g-m;break;case N.ANIMATIONTYPE_QUATERNION:this._offsetsCache[_]=g.subtract(m);break;case N.ANIMATIONTYPE_VECTOR3:this._offsetsCache[_]=g.subtract(m);case N.ANIMATIONTYPE_VECTOR2:this._offsetsCache[_]=g.subtract(m);case N.ANIMATIONTYPE_SIZE:this._offsetsCache[_]=g.subtract(m);case N.ANIMATIONTYPE_COLOR3:this._offsetsCache[_]=g.subtract(m)}this._highLimitsCache[_]=g}p=this._highLimitsCache[_],h=this._offsetsCache[_]}if(void 0===h)switch(this._animation.dataType){case N.ANIMATIONTYPE_FLOAT:h=0;break;case N.ANIMATIONTYPE_QUATERNION:h=U;break;case N.ANIMATIONTYPE_VECTOR3:h=V;break;case N.ANIMATIONTYPE_VECTOR2:h=G;break;case N.ANIMATIONTYPE_SIZE:h=k;break;case N.ANIMATIONTYPE_COLOR3:h=z}var v=f/d>>0,y=c?t+f%d:i;if(this._host&&this._host.syncRoot){var b=this._host.syncRoot;y=t+(i-t)*((b.masterFrame-b.fromFrame)/(b.toFrame-b.fromFrame))}var T=this._events;if(d>0&&this.currentFrame>y||d<0&&this.currentFrame0&&y>=T[E].frame&&T[E].frame>=t||d<0&&y<=T[E].frame&&T[E].frame<=t){var A=T[E];A.isDone||(A.onlyOnce&&(T.splice(E,1),E--),A.isDone=!0,A.action(y))}return c||(this._stopped=!0),c},e}(),W=i(16),H=i(44),X=i(34),Y=function(e){function t(t,i,r,n,s,a,c){void 0===r&&(r=null),void 0===n&&(n=null),void 0===s&&(s=null),void 0===a&&(a=null),void 0===c&&(c=null);var l=e.call(this,t,i.getScene(),!1)||this;return l.name=t,l.children=new Array,l.animations=new Array,l._index=null,l._absoluteTransform=new o.j,l._invertedAbsoluteTransform=new o.j,l._scalingDeterminant=1,l._worldTransform=new o.j,l._needToDecompose=!0,l._needToCompose=!1,l._linkedTransformNode=null,l._skeleton=i,l._localMatrix=n?n.clone():o.j.Identity(),l._restPose=s||l._localMatrix.clone(),l._baseMatrix=a||l._localMatrix.clone(),l._index=c,i.bones.push(l),l.setParent(r,!1),(a||n)&&l._updateDifferenceMatrix(),l}return l.d(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.getSkeleton=function(){return this._skeleton},t.prototype.getParent=function(){return this._parent},t.prototype.setParent=function(e,t){if(void 0===t&&(t=!0),this._parent!==e){if(this._parent){var i=this._parent.children.indexOf(this);-1!==i&&this._parent.children.splice(i,1)}this._parent=e,this._parent&&this._parent.children.push(this),t&&this._updateDifferenceMatrix(),this.markAsDirty()}},t.prototype.getLocalMatrix=function(){return this._compose(),this._localMatrix},t.prototype.getBaseMatrix=function(){return this._baseMatrix},t.prototype.getRestPose=function(){return this._restPose},t.prototype.getWorldMatrix=function(){return this._worldTransform},t.prototype.returnToRest=function(){this.updateMatrix(this._restPose.clone())},t.prototype.getInvertedAbsoluteTransform=function(){return this._invertedAbsoluteTransform},t.prototype.getAbsoluteTransform=function(){return this._absoluteTransform},t.prototype.linkTransformNode=function(e){this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=e,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++},Object.defineProperty(t.prototype,"position",{get:function(){return this._decompose(),this._localPosition},set:function(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.getRotation()},set:function(e){this.setRotation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._decompose(),this._localRotation},set:function(e){this.setRotationQuaternion(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this.getScale()},set:function(e){this.setScale(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._skeleton.animationPropertiesOverride},enumerable:!0,configurable:!0}),t.prototype._decompose=function(){this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=o.x.Zero(),this._localRotation=o.q.Zero(),this._localPosition=o.x.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))},t.prototype._compose=function(){this._needToCompose&&(this._needToCompose=!1,o.j.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix))},t.prototype.updateMatrix=function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!0),this._baseMatrix.copyFrom(e),t&&this._updateDifferenceMatrix(),i?(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 i=0;i-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 i=0;i-1){for(var r=(o=this._runtimeAnimations).length-1;r>=0;r--){var n=o[r];e&&n.animation.name!=e||(t&&!t(n.target)||(n.dispose(),o.splice(r,1)))}0==o.length&&(this._scene._activeAnimatables.splice(i,1),this._raiseOnAnimationEnd())}}else{if((r=this._scene._activeAnimatables.indexOf(this))>-1){this._scene._activeAnimatables.splice(r,1);var o=this._runtimeAnimations;for(r=0;r0)return;this._animationTimeLast=e}var t=this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale;this._animationTime+=t,this._animationTimeLast=e;for(var i=0;ii&&n>0&&(n*=-1),a&&this.stopAnimation(e,void 0,c),s||(s=new K(this,e,t,i,r,n,o,void 0,l));var u=!c||c(e);if(e.animations&&u&&s.appendAnimations(e,e.animations),e.getAnimatables)for(var h=e.getAnimatables(),d=0;d=l&&s.frame<=u&&(r?(c=s.value.clone(),_?(a=c.getTranslation(),c.setTranslation(a.scaleInPlace(m))):g&&n?(a=c.getTranslation(),c.setTranslation(a.multiplyInPlace(n))):c=s.value):c=s.value,v.push({frame:s.frame+i,value:c}));return this.animations[0].createRange(t,l+i,u+i),!0};var Q=function(){return function(){}}(),q=function(){function e(e,t){void 0===t&&(t=null),this.name=e,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this.onAnimationEndObservable=new n.c,this.onAnimationLoopObservable=new n.c,this.onAnimationGroupEndObservable=new n.c,this.onAnimationGroupPauseObservable=new n.c,this.onAnimationGroupPlayObservable=new n.c,this._scene=t||R.a.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.animationGroups.push(this)}return Object.defineProperty(e.prototype,"from",{get:function(){return this._from},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"to",{get:function(){return this._to},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStarted",{get:function(){return this._isStarted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._isStarted&&!this._isPaused},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){if(this._speedRatio!==e){this._speedRatio=e;for(var t=0;tr[0].frame&&(this._from=r[0].frame),this._toe){var s={frame:e,value:n.value,inTangent:n.inTangent,outTangent:n.outTangent,interpolation:n.interpolation};r.splice(0,0,s)}if(o.framer&&this._speedRatio>0&&(this._speedRatio=-t),this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.pause=function(){if(!this._isStarted)return this;this._isPaused=!0;for(var e=0;e-1&&this._scene.animationGroups.splice(e,1),this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear()},e.prototype._checkAnimationGroupEnded=function(e){var t=this._animatables.indexOf(e);t>-1&&this._animatables.splice(t,1),0===this._animatables.length&&(this._isStarted=!1,this.onAnimationGroupEndObservable.notifyObservers(this))},e.prototype.clone=function(t,i){for(var r=new e(t||this.name,this._scene),n=0,o=this._targetedAnimations;n=.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}(),$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e=Math.max(0,Math.min(1,e)),1-Math.sqrt(1-e*e)},t}(J),ee=function(e){function t(t){void 0===t&&(t=1);var i=e.call(this)||this;return i.amplitude=t,i}return l.d(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}(J),te=function(e){function t(t,i){void 0===t&&(t=3),void 0===i&&(i=2);var r=e.call(this)||this;return r.bounces=t,r.bounciness=i,r}return l.d(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.bounces),i=this.bounciness;i<=1&&(i=1.001);var r=Math.pow(i,t),n=1-i,o=(1-r)/n+.5*r,s=e*o,a=Math.log(-s*(1-i)+1)/Math.log(i),c=Math.floor(a),l=c+1,u=(1-Math.pow(i,c))/(n*o),h=.5*(u+(1-Math.pow(i,l))/(n*o)),d=e-h,f=h-u;return-Math.pow(1/i,t-c)/(f*f)*(d-f)*(d+f)},t}(J),ie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e*e},t}(J),re=function(e){function t(t,i){void 0===t&&(t=3),void 0===i&&(i=3);var r=e.call(this)||this;return r.oscillations=t,r.springiness=i,r}return l.d(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.oscillations),i=Math.max(0,this.springiness);return(0==i?e:(Math.exp(i*e)-1)/(Math.exp(i)-1))*Math.sin((6.283185307179586*t+1.5707963267948966)*e)},t}(J),ne=function(e){function t(t){void 0===t&&(t=2);var i=e.call(this)||this;return i.exponent=t,i}return l.d(t,e),t.prototype.easeInCore=function(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)},t}(J),oe=function(e){function t(t){void 0===t&&(t=2);var i=e.call(this)||this;return i.power=t,i}return l.d(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.power);return Math.pow(e,t)},t}(J),se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e},t}(J),ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e*e*e},t}(J),ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e*e*e*e},t}(J),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return 1-Math.sin(1.5707963267948966*(1-e))},t}(J),ue=function(e){function t(t,i,r,n){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=1);var o=e.call(this)||this;return o.x1=t,o.y1=i,o.x2=r,o.y2=n,o}return l.d(t,e),t.prototype.easeInCore=function(e){return o.d.Interpolate(e,this.x1,this.y1,this.x2,this.y2)},t}(J),he=function(){function e(e,t,i){this.frame=e,this.action=t,this.onlyOnce=i,this.isDone=!1}return e.prototype._clone=function(){return new e(this.frame,this.action,this.onlyOnce)},e}(),de=i(10),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t}(r.a),pe=function(e){function t(t){var i=e.call(this)||this;return i.scene=t,i.sounds=[],i.effectLayers=[],i.layers=[],i.lensFlareSystems=[],i.proceduralTextures=[],i.reflectionProbes=[],i}return l.d(t,e),t.prototype.addAllToScene=function(){var e=this;this.cameras.forEach(function(t){e.scene.addCamera(t)}),this.lights.forEach(function(t){e.scene.addLight(t)}),this.meshes.forEach(function(t){e.scene.addMesh(t)}),this.skeletons.forEach(function(t){e.scene.addSkeleton(t)}),this.animations.forEach(function(t){e.scene.addAnimation(t)}),this.animationGroups.forEach(function(t){e.scene.addAnimationGroup(t)}),this.multiMaterials.forEach(function(t){e.scene.addMultiMaterial(t)}),this.materials.forEach(function(t){e.scene.addMaterial(t)}),this.morphTargetManagers.forEach(function(t){e.scene.addMorphTargetManager(t)}),this.geometries.forEach(function(t){e.scene.addGeometry(t)}),this.transformNodes.forEach(function(t){e.scene.addTransformNode(t)}),this.actionManagers.forEach(function(t){e.scene.addActionManager(t)}),this.textures.forEach(function(t){e.scene.addTexture(t)}),this.reflectionProbes.forEach(function(t){e.scene.addReflectionProbe(t)});for(var t=0,i=this.scene._serializableComponents;t0&&(h=!0,this._soundLoaded(i));break;case"String":u.push(i);case"Array":0===u.length&&(u=i);for(var d=0;d0&&(this._htmlAudioElement.currentTime=0)):this._streamingSource.disconnect();else if(_e.b.audioEngine.audioContext&&this._soundSource){var t=e?_e.b.audioEngine.audioContext.currentTime+e:_e.b.audioEngine.audioContext.currentTime;this._soundSource.stop(t),this._soundSource.onended=function(){},this.isPaused||(this._startOffset=0)}this.isPlaying=!1}},e.prototype.pause=function(){this.isPlaying&&(this.isPaused=!0,this._streaming?this._htmlAudioElement?this._htmlAudioElement.pause():this._streamingSource.disconnect():_e.b.audioEngine.audioContext&&(this.stop(0),this._startOffset+=_e.b.audioEngine.audioContext.currentTime-this._startTime))},e.prototype.setVolume=function(e,t){_e.b.audioEngine.canUseWebAudio&&this._soundGain&&(t&&_e.b.audioEngine.audioContext?(this._soundGain.gain.cancelScheduledValues(_e.b.audioEngine.audioContext.currentTime),this._soundGain.gain.setValueAtTime(this._soundGain.gain.value,_e.b.audioEngine.audioContext.currentTime),this._soundGain.gain.linearRampToValueAtTime(e,_e.b.audioEngine.audioContext.currentTime+t)):this._soundGain.gain.value=e),this._volume=e},e.prototype.setPlaybackRate=function(e){this._playbackRate=e,this.isPlaying&&(this._streaming&&this._htmlAudioElement?this._htmlAudioElement.playbackRate=this._playbackRate:this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate))},e.prototype.getVolume=function(){return this._volume},e.prototype.attachToMesh=function(e){var t=this;this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=e,this.spatialSound||(this.spatialSound=!0,this._createSpatialParameters(),this.isPlaying&&this.loop&&(this.stop(),this.play())),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=function(e){return t._onRegisterAfterWorldMatrixUpdate(e)},this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)},e.prototype.detachFromMesh=function(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)},e.prototype._onRegisterAfterWorldMatrixUpdate=function(e){if(e.getBoundingInfo){var t=e;if(this._positionInEmitterSpace)t.worldMatrixFromCache.invertToRef(o.t.Matrix[0]),this.setPosition(o.t.Matrix[0].getTranslation());else{var i=t.getBoundingInfo();this.setPosition(i.boundingSphere.centerWorld)}_e.b.audioEngine.canUseWebAudio&&this._isDirectional&&this.isPlaying&&this._updateDirection()}},e.prototype.clone=function(){var t=this;if(this._streaming)return null;var i=function(){t._isReadyToPlay?(n._audioBuffer=t.getAudioBuffer(),n._isReadyToPlay=!0,n.autoplay&&n.play()):window.setTimeout(i,300)},r={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},n=new e(this.name+"_cloned",new ArrayBuffer(0),this._scene,null,r);return this.useCustomAttenuation&&n.setAttenuationFunction(this._customAttenuationFunction),n.setPosition(this._position),n.setPlaybackRate(this._playbackRate),i(),n},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,i,r,n){var s,a=t.name;s=t.url?r+t.url:r+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(n){var u=function(){n._isReadyToPlay?(c._audioBuffer=n.getAudioBuffer(),c._isReadyToPlay=!0,c.autoplay&&c.play()):window.setTimeout(u,300)};c=new e(a,new ArrayBuffer(0),i,null,l),u()}else c=new e(a,s,i,function(){i._removePendingData(c)},l),i._addPendingData(c);if(t.position){var h=o.x.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.x.FromArray(t.localDirectionToMesh);c.setLocalDirectionToMesh(d)}if(t.connectedMeshId){var f=i.getMeshByID(t.connectedMeshId);f&&c.attachToMesh(f)}return c},e._SceneComponentInitialization=function(e){throw ye.a.WarnImport("AudioSceneComponent")},e}(),Te=function(){function e(e,t){void 0===t&&(t={}),this.id=-1,this._isMainTrack=!1,this._isInitialized=!1,this._scene=e,this.soundCollection=new Array,this._options=t,!this._isMainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1)}return e.prototype._initializeSoundTrackAudioGraph=function(){_e.b.audioEngine.canUseWebAudio&&_e.b.audioEngine.audioContext&&(this._outputAudioNode=_e.b.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(_e.b.audioEngine.masterGain),this._options&&(this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._options.mainTrack&&(this._isMainTrack=this._options.mainTrack)),this._isInitialized=!0)},e.prototype.dispose=function(){if(_e.b.audioEngine&&_e.b.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(),_e.b.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){_e.b.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=e)},e.prototype.switchPanningModelToHRTF=function(){if(_e.b.audioEngine.canUseWebAudio)for(var e=0;e0?e.activeCameras[0]:e.activeCamera)&&i.audioContext){i.audioContext.listener.setPosition(t.position.x,t.position.y,t.position.z),t.rigCameras&&t.rigCameras.length>0&&(t=t.rigCameras[0]);var r,n=o.j.Invert(t.getViewMatrix()),s=o.x.TransformNormal(new o.x(0,0,-1),n);for(s.normalize(),isNaN(s.x)||isNaN(s.y)||isNaN(s.z)||i.audioContext.listener.setOrientation(s.x,s.y,s.z,0,1,0),r=0;r0?1/n:0,c=0;c0},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){var t=this;this._attachedCamera=e;var i=this._attachedCamera.getScene();this._onPrePointerObservableObserver=i.onPrePointerObservable.add(function(e){e.type!==Pe.a.POINTERDOWN?e.type===Pe.a.POINTERUP&&(t._isPointerDown=!1):t._isPointerDown=!0}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(function(){var e=H.a.Now,i=0;null!=t._lastFrameTime&&(i=e-t._lastFrameTime),t._lastFrameTime=e,t._applyUserInteraction();var r=e-t._lastInteractionTime-t._idleRotationWaitTime,n=Math.max(Math.min(r/t._idleRotationSpinupTime,1),0);t._cameraRotationSpeed=t._idleRotationSpeed*n,t._attachedCamera&&(t._attachedCamera.alpha-=t._cameraRotationSpeed*(i/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=H.a.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}(),Se=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 i=this._attachedCamera;i&&(e?this._onMeshTargetChangedObserver=i.onMeshTargetChangedObservable.add(function(e){if(e){e.computeWorldMatrix(!0);var i=e.getBoundingInfo().diagonalLength;t.lowerRadiusTransitionRange=.05*i,t.upperRadiusTransitionRange=.05*i}}):this._onMeshTargetChangedObserver&&i.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 i=this;if(this._attachedCamera){this._radiusBounceTransition||(e.EasingFunction.setEasingMode(e.EasingMode),this._radiusBounceTransition=N.CreateAnimation("radius",N.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 r=N.TransitionTo("radius",this._attachedCamera.radius+t,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,function(){return i._clearAnimationLocks()});r&&this._animatables.push(r)}},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 ee(.3),e.EasingMode=J.EASINGMODE_EASEOUT,e}(),Ce=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 i=this;this._attachedCamera=t;var r=this._attachedCamera.getScene();e.EasingFunction.setEasingMode(e.EasingMode),this._onPrePointerObservableObserver=r.onPrePointerObservable.add(function(e){e.type!==Pe.a.POINTERDOWN?e.type===Pe.a.POINTERUP&&(i._isPointerDown=!1):i._isPointerDown=!0}),this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(function(e){e&&i.zoomOnMesh(e)}),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(function(){i._applyUserInteraction(),i._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,i){void 0===t&&(t=!1),void 0===i&&(i=null),e.computeWorldMatrix(!0);var r=e.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(r.minimumWorld,r.maximumWorld,t,i)},e.prototype.zoomOnMeshHierarchy=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),e.computeWorldMatrix(!0);var r=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(r.min,r.max,t,i)},e.prototype.zoomOnMeshesHierarchy=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null);for(var r=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new o.x(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),s=0;sl.upperRadiusLimit?l.upperRadiusLimit:c),c):0},e.prototype._maintainCameraAboveGround=function(){var t=this;if(!(this._elevationReturnTime<0)){var i=H.a.Now-this._lastInteractionTime,r=.5*Math.PI-this._defaultElevation,n=.5*Math.PI;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>n&&i>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=N.CreateAnimation("beta",N.ANIMATIONTYPE_FLOAT,60,e.EasingFunction));var o=N.TransitionTo("beta",r,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,function(){t._clearAnimationLocks(),t.stopAllAnimations()});o&&this._animatables.push(o)}}},e.prototype._getFrustumSlope=function(){var e=this._attachedCamera;if(!e)return o.w.Zero();var t=e.getScene().getEngine().getAspectRatio(e),i=Math.tan(e.fov/2),r=i*t;return new o.w(r,i)},e.prototype._clearAnimationLocks=function(){this._betaIsAnimating=!1},e.prototype._applyUserInteraction=function(){this.isUserIsMoving&&(this._lastInteractionTime=H.a.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 ne,e.EasingMode=J.EASINGMODE_EASEINOUT,e.IgnoreBoundsSizeMode=0,e.FitFrustumSidesMode=1,e}(),Me=function(){return function(e,t,i,r){void 0===t&&(t=new o.x),void 0===i&&(i=0),void 0===r&&(r=!1),this.direction=e,this.rotatedDirection=t,this.diff=i,this.ignore=r}}(),Oe=function(){function e(e){this.ui=e,this.name="AttachToBoxBehavior",this.distanceAwayFromFace=.15,this.distanceAwayFromBottomOfFace=.15,this._faceVectors=[new Me(o.x.Up()),new Me(o.x.Down()),new Me(o.x.Left()),new Me(o.x.Right()),new Me(o.x.Forward()),new Me(o.x.Forward().scaleInPlace(-1))],this._tmpMatrix=new o.j,this._tmpVector=new o.x,this._zeroVector=o.x.Zero(),this._lookAtTmpMatrix=new o.j}return e.prototype.init=function(){},e.prototype._closestFace=function(e){var t=this;return this._faceVectors.forEach(function(i){t._target.rotationQuaternion||(t._target.rotationQuaternion=o.q.RotationYawPitchRoll(t._target.rotation.y,t._target.rotation.x,t._target.rotation.z)),t._target.rotationQuaternion.toRotationMatrix(t._tmpMatrix),o.x.TransformCoordinatesToRef(i.direction,t._tmpMatrix,i.rotatedDirection),i.diff=o.x.GetAngleBetweenVectors(i.rotatedDirection,e,o.x.Cross(i.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 i=this;e.visibility=t,e.getChildMeshes().forEach(function(e){i._setAllVisibility(e,t)})},e}(),De=i(52),we=function(){function e(){this._startDistance=0,this._initialScale=new o.x(0,0,0),this._targetScale=new o.x(0,0,0),this._sceneRenderObserver=null,this._dragBehaviorA=new De.a({}),this._dragBehaviorA.moveAttached=!1,this._dragBehaviorB=new De.a({}),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(i){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(i){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 i=t._targetScale.subtract(e.scaling).scaleInPlace(.1);i.length()>.01&&e.scaling.addInPlace(i)}})},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}(),Le=i(24),Fe=i(20),Ne=i(43),Be=function(){function e(){this._sceneRenderObserver=null,this._targetPosition=new o.x(0,0,0),this._moving=!1,this._startingOrientation=new o.q,this.zDragFactor=3,this.rotateDraggedObject=!0,this.dragging=!1,this.dragDeltaRatio=.2,this.currentDraggingPointerID=-1,this.detachCameraControls=!0,this.onDragStartObservable=new n.c,this.onDragEndObservable=new n.c}return Object.defineProperty(e.prototype,"name",{get:function(){return"SixDofDrag"},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t){var i=this;this._ownerNode=t,this._scene=this._ownerNode.getScene(),e._virtualScene||(e._virtualScene=new W.a(this._scene.getEngine()),e._virtualScene.detachControl(),this._scene.getEngine().scenes.pop());var r=null,n=new o.x(0,0,0);this._virtualOriginMesh=new Le.a("",e._virtualScene),this._virtualOriginMesh.rotationQuaternion=new o.q,this._virtualDragMesh=new Le.a("",e._virtualScene),this._virtualDragMesh.rotationQuaternion=new o.q;var s=null;this._pointerObserver=this._scene.onPointerObservable.add(function(e,t){if(e.type==Pe.a.POINTERDOWN){if(!i.dragging&&e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh&&e.pickInfo.ray&&(h=e.pickInfo.pickedMesh,i._ownerNode==h||h.isDescendantOf(i._ownerNode))){i._scene.activeCamera&&i._scene.activeCamera.cameraRigMode==Fe.a.RIG_MODE_NONE&&e.pickInfo.ray.origin.copyFrom(i._scene.activeCamera.globalPosition),r=i._ownerNode,Ne.a._RemoveAndStorePivotPoint(r),n.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),i._virtualOriginMesh.removeChild(i._virtualDragMesh),r.computeWorldMatrix(),i._virtualDragMesh.position.copyFrom(r.absolutePosition),r.rotationQuaternion||(r.rotationQuaternion=o.q.RotationYawPitchRoll(r.rotation.y,r.rotation.x,r.rotation.z));var a=r.parent;r.setParent(null),i._virtualDragMesh.rotationQuaternion.copyFrom(r.rotationQuaternion),r.setParent(a),i._virtualOriginMesh.addChild(i._virtualDragMesh),i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition),i.dragging=!0,i.currentDraggingPointerID=e.event.pointerId,i.detachCameraControls&&i._scene.activeCamera&&!i._scene.activeCamera.leftCamera&&(i._scene.activeCamera.inputs.attachedElement?(s=i._scene.activeCamera.inputs.attachedElement,i._scene.activeCamera.detachControl(i._scene.activeCamera.inputs.attachedElement)):s=null),Ne.a._RestorePivotPoint(r),i.onDragStartObservable.notifyObservers({})}}else if(e.type==Pe.a.POINTERUP)i.currentDraggingPointerID==e.event.pointerId&&(i.dragging=!1,i._moving=!1,i.currentDraggingPointerID=-1,r=null,i._virtualOriginMesh.removeChild(i._virtualDragMesh),i.detachCameraControls&&s&&i._scene.activeCamera&&!i._scene.activeCamera.leftCamera&&i._scene.activeCamera.attachControl(s,!0),i.onDragEndObservable.notifyObservers({}));else if(e.type==Pe.a.POINTERMOVE&&i.currentDraggingPointerID==e.event.pointerId&&i.dragging&&e.pickInfo&&e.pickInfo.ray&&r){var c=i.zDragFactor;i._scene.activeCamera&&i._scene.activeCamera.cameraRigMode==Fe.a.RIG_MODE_NONE&&(e.pickInfo.ray.origin.copyFrom(i._scene.activeCamera.globalPosition),c=0);var l=e.pickInfo.ray.origin.subtract(n);n.copyFrom(e.pickInfo.ray.origin);var u=-o.x.Dot(l,e.pickInfo.ray.direction);i._virtualOriginMesh.addChild(i._virtualDragMesh),i._virtualDragMesh.position.z-=i._virtualDragMesh.position.z<1?u*i.zDragFactor:u*c*i._virtualDragMesh.position.z,i._virtualDragMesh.position.z<0&&(i._virtualDragMesh.position.z=0),i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),i._virtualOriginMesh.removeChild(i._virtualDragMesh),i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition),r.parent&&o.x.TransformCoordinatesToRef(i._targetPosition,o.j.Invert(r.parent.getWorldMatrix()),i._targetPosition),i._moving||i._startingOrientation.copyFrom(i._virtualDragMesh.rotationQuaternion),i._moving=!0}var h});var a=new o.q;this._sceneRenderObserver=t.getScene().onBeforeRenderObservable.add(function(){if(i.dragging&&i._moving&&r){if(Ne.a._RemoveAndStorePivotPoint(r),r.position.addInPlace(i._targetPosition.subtract(r.position).scale(i.dragDeltaRatio)),i.rotateDraggedObject){a.copyFrom(i._startingOrientation),a.x=-a.x,a.y=-a.y,a.z=-a.z,i._virtualDragMesh.rotationQuaternion.multiplyToRef(a,a),o.q.RotationYawPitchRollToRef(a.toEulerAngles("xyz").y,0,0,a),a.multiplyToRef(i._startingOrientation,a);var e=r.parent;(!e||e.scaling&&!e.scaling.isNonUniformWithinEpsilon(.001))&&(r.setParent(null),o.q.SlerpToRef(r.rotationQuaternion,a,i.dragDeltaRatio,r.rotationQuaternion),r.setParent(e))}Ne.a._RestorePivotPoint(r)}})},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}(),Ue=function(){function e(e,t,i){if(this.targetPosition=o.x.Zero(),this.poleTargetPosition=o.x.Zero(),this.poleTargetLocalOffset=o.x.Zero(),this.poleAngle=0,this.slerpAmount=1,this._bone1Quat=o.q.Identity(),this._bone1Mat=o.j.Identity(),this._bone2Ang=Math.PI,this._maxAngle=Math.PI,this._rightHandedSystem=!1,this._bendAxis=o.x.Right(),this._slerping=!1,this._adjustRoll=0,this._bone2=t,this._bone1=t.getParent(),this._bone1){this.mesh=e;var r=t.getPosition();if(t.getAbsoluteTransform().determinant()>0&&(this._rightHandedSystem=!0,this._bendAxis.x=0,this._bendAxis.y=0,this._bendAxis.z=-1,r.x>r.y&&r.x>r.z&&(this._adjustRoll=.5*Math.PI,this._bendAxis.z=1)),this._bone1.length){var n=this._bone1.getScale(),s=this._bone2.getScale();this._bone1Length=this._bone1.length*n.y*this.mesh.scaling.y,this._bone2Length=this._bone2.length*s.y*this.mesh.scaling.y}else if(this._bone1.children[0]){e.computeWorldMatrix(!0);var a=this._bone2.children[0].getAbsolutePosition(e),c=this._bone2.getAbsolutePosition(e),l=this._bone1.getAbsolutePosition(e);this._bone1Length=o.x.Distance(a,c),this._bone2Length=o.x.Distance(c,l)}this._bone1.getRotationMatrixToRef(o.s.WORLD,e,this._bone1Mat),this.maxAngle=Math.PI,i&&(i.targetMesh&&(this.targetMesh=i.targetMesh,this.targetMesh.computeWorldMatrix(!0)),i.poleTargetMesh?(this.poleTargetMesh=i.poleTargetMesh,this.poleTargetMesh.computeWorldMatrix(!0)):i.poleTargetBone?this.poleTargetBone=i.poleTargetBone:this._bone1.getParent()&&(this.poleTargetBone=this._bone1.getParent()),i.poleTargetLocalOffset&&this.poleTargetLocalOffset.copyFrom(i.poleTargetLocalOffset),i.poleAngle&&(this.poleAngle=i.poleAngle),i.bendAxis&&this._bendAxis.copyFrom(i.bendAxis),i.maxAngle&&(this.maxAngle=i.maxAngle),i.slerpAmount&&(this.slerpAmount=i.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,i=this._bone2Length;this._maxReach=Math.sqrt(t*t+i*i-2*t*i*Math.cos(e))},e.prototype.update=function(){var t=this._bone1;if(t){var i=this.targetPosition,r=this.poleTargetPosition,n=e._tmpMats[0],s=e._tmpMats[1];this.targetMesh&&i.copyFrom(this.targetMesh.getAbsolutePosition()),this.poleTargetBone?this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset,this.mesh,r):this.poleTargetMesh&&o.x.TransformCoordinatesToRef(this.poleTargetLocalOffset,this.poleTargetMesh.getWorldMatrix(),r);var a=e._tmpVecs[0],c=e._tmpVecs[1],l=e._tmpVecs[2],u=e._tmpVecs[3],h=e._tmpVecs[4],d=e._tmpQuat;t.getAbsolutePositionToRef(this.mesh,a),r.subtractToRef(a,h),0==h.x&&0==h.y&&0==h.z?h.y=1:h.normalize(),i.subtractToRef(a,u),u.normalize(),o.x.CrossToRef(u,h,c),c.normalize(),o.x.CrossToRef(u,c,l),l.normalize(),o.j.FromXYZAxesToRef(l,u,c,n);var f=this._bone1Length,p=this._bone2Length,_=o.x.Distance(a,i);this._maxReach>0&&(_=Math.min(this._maxReach,_));var m=(p*p+_*_-f*f)/(2*p*_),g=(_*_+f*f-p*p)/(2*_*f);m>1&&(m=1),g>1&&(g=1),m<-1&&(m=-1),g<-1&&(g=-1);var v=Math.acos(m),y=Math.acos(g),b=-v-y;if(this._rightHandedSystem)o.j.RotationYawPitchRollToRef(0,0,this._adjustRoll,s),s.multiplyToRef(n,n),o.j.RotationAxisToRef(this._bendAxis,y,s),s.multiplyToRef(n,n);else{var T=e._tmpVecs[5];T.copyFrom(this._bendAxis),T.x*=-1,o.j.RotationAxisToRef(T,-y,s),s.multiplyToRef(n,n)}this.poleAngle&&(o.j.RotationAxisToRef(u,this.poleAngle,s),n.multiplyToRef(s,n)),this._bone1&&(this.slerpAmount<1?(this._slerping||o.q.FromRotationMatrixToRef(this._bone1Mat,this._bone1Quat),o.q.FromRotationMatrixToRef(n,d),o.q.SlerpToRef(this._bone1Quat,d,this.slerpAmount,this._bone1Quat),b=this._bone2Ang*(1-this.slerpAmount)+b*this.slerpAmount,this._bone1.setRotationQuaternion(this._bone1Quat,o.s.WORLD,this.mesh),this._slerping=!0):(this._bone1.setRotationMatrix(n,o.s.WORLD,this.mesh),this._bone1Mat.copyFrom(n),this._slerping=!1)),this._bone2.setAxisAngle(this._bendAxis,b,o.s.LOCAL),this._bone2Ang=b}},e._tmpVecs=[o.x.Zero(),o.x.Zero(),o.x.Zero(),o.x.Zero(),o.x.Zero(),o.x.Zero()],e._tmpQuat=o.q.Identity(),e._tmpMats=[o.j.Identity(),o.j.Identity()],e}(),Ve=function(){function e(e,t,i,r){if(this.upAxis=o.x.Up(),this.upAxisSpace=o.s.LOCAL,this.adjustYaw=0,this.adjustPitch=0,this.adjustRoll=0,this.slerpAmount=1,this._boneQuat=o.q.Identity(),this._slerping=!1,this._firstFrameSkipped=!1,this._fowardAxis=o.x.Forward(),this.mesh=e,this.bone=t,this.target=i,r&&(r.adjustYaw&&(this.adjustYaw=r.adjustYaw),r.adjustPitch&&(this.adjustPitch=r.adjustPitch),r.adjustRoll&&(this.adjustRoll=r.adjustRoll),null!=r.maxYaw?this.maxYaw=r.maxYaw:this.maxYaw=Math.PI,null!=r.minYaw?this.minYaw=r.minYaw:this.minYaw=-Math.PI,null!=r.maxPitch?this.maxPitch=r.maxPitch:this.maxPitch=Math.PI,null!=r.minPitch?this.minPitch=r.minPitch:this.minPitch=-Math.PI,null!=r.slerpAmount&&(this.slerpAmount=r.slerpAmount),null!=r.upAxis&&(this.upAxis=r.upAxis),null!=r.upAxisSpace&&(this.upAxisSpace=r.upAxisSpace),null!=r.yawAxis||null!=r.pitchAxis)){var n=o.c.Y,s=o.c.X;null!=r.yawAxis&&(n=r.yawAxis.clone()).normalize(),null!=r.pitchAxis&&(s=r.pitchAxis.clone()).normalize();var a=o.x.Cross(s,n);this._transformYawPitch=o.j.Identity(),o.j.FromXYZAxesToRef(s,n,a,this._transformYawPitch),this._transformYawPitchInv=this._transformYawPitch.clone(),this._transformYawPitch.invert()}t.getParent()||this.upAxisSpace!=o.s.BONE||(this.upAxisSpace=o.s.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,i=e._tmpVecs[0];t.getAbsolutePositionToRef(this.mesh,i);var r=this.target,n=e._tmpMats[0],s=e._tmpMats[1],a=this.mesh,c=t.getParent(),l=e._tmpVecs[1];l.copyFrom(this.upAxis),this.upAxisSpace==o.s.BONE&&c?(this._transformYawPitch&&o.x.TransformCoordinatesToRef(l,this._transformYawPitchInv,l),c.getDirectionToRef(l,this.mesh,l)):this.upAxisSpace==o.s.LOCAL&&(a.getDirectionToRef(l,l),1==a.scaling.x&&1==a.scaling.y&&1==a.scaling.z||l.normalize());var u=!1,h=!1;if(this._maxYaw==Math.PI&&this._minYaw==-Math.PI||(u=!0),this._maxPitch==Math.PI&&this._minPitch==-Math.PI||(h=!0),u||h){var d=e._tmpMats[2],f=e._tmpMats[3];if(this.upAxisSpace==o.s.BONE&&1==l.y&&c)c.getRotationMatrixToRef(o.s.WORLD,this.mesh,d);else if(this.upAxisSpace!=o.s.LOCAL||1!=l.y||c){(_=e._tmpVecs[2]).copyFrom(this._fowardAxis),this._transformYawPitch&&o.x.TransformCoordinatesToRef(_,this._transformYawPitchInv,_),c?c.getDirectionToRef(_,this.mesh,_):a.getDirectionToRef(_,_);var p=o.x.Cross(l,_);p.normalize();var _=o.x.Cross(p,l);o.j.FromXYZAxesToRef(p,l,_,d)}else d.copyFrom(a.getWorldMatrix());d.invertToRef(f);var m=null;if(h){var g=e._tmpVecs[3];r.subtractToRef(i,g),o.x.TransformCoordinatesToRef(g,f,g),m=Math.sqrt(g.x*g.x+g.z*g.z);var v=Math.atan2(g.y,m),y=v;v>this._maxPitch?(g.y=this._maxPitchTan*m,y=this._maxPitch):vthis._maxYaw||bMath.PI?this._isAngleBetween(b,this._maxYaw,this._midYawConstraint)?(g.z=this._maxYawCos*m,g.x=this._maxYawSin*m,T=this._maxYaw):this._isAngleBetween(b,this._midYawConstraint,this._minYaw)&&(g.z=this._minYawCos*m,g.x=this._minYawSin*m,T=this._minYaw):b>this._maxYaw?(g.z=this._maxYawCos*m,g.x=this._maxYawSin*m,T=this._maxYaw):bMath.PI){var E=e._tmpVecs[8];E.copyFrom(o.c.Z),this._transformYawPitch&&o.x.TransformCoordinatesToRef(E,this._transformYawPitchInv,E);var x=e._tmpMats[4];this._boneQuat.toRotationMatrix(x),this.mesh.getWorldMatrix().multiplyToRef(x,x),o.x.TransformCoordinatesToRef(E,x,E),o.x.TransformCoordinatesToRef(E,f,E);var A=Math.atan2(E.x,E.z);if(this._getAngleBetween(A,b)>this._getAngleBetween(A,this._midYawConstraint)){null==m&&(m=Math.sqrt(g.x*g.x+g.z*g.z));var P=this._getAngleBetween(A,this._maxYaw);this._getAngleBetween(A,this._minYaw)Math.PI?i-=2*Math.PI:i<-Math.PI&&(i+=2*Math.PI),i},e.prototype._getAngleBetween=function(e,t){var i=0;return(i=(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&&(i=2*Math.PI-i),i},e.prototype._isAngleBetween=function(e,t,i){if(e=(e%=2*Math.PI)<0?e+2*Math.PI:e,(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)<(i=(i%=2*Math.PI)<0?i+2*Math.PI:i)){if(e>t&&ei&&e0}return Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isUsingTextureForMatrices",{get:function(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones&&!this.needInitialSkinMatrix},enumerable:!0,configurable:!0}),e.prototype.getTransformMatrices=function(e){return this.needInitialSkinMatrix&&e._bonesTransformMatrices?e._bonesTransformMatrices:(this._transformMatrices||this.prepare(),this._transformMatrices)},e.prototype.getTransformMatrixTexture=function(){return this._transformMatrixTexture},e.prototype.getScene=function(){return this._scene},e.prototype.toString=function(e){var t="Name: "+this.name+", nBones: "+this.bones.length;if(t+=", nAnimationRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var i=!0;for(var r in this._ranges)i&&(t+=", ",i=!1),t+=r;t+="}"}return t},e.prototype.getBoneIndexByName=function(e){for(var t=0,i=this.bones.length;t-1&&this._meshesWithPoseMatrix.splice(t,1)},e.prototype._computeTransformMatrices=function(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(var i=0;i0)for(var e=0,t=this.bones;e0&&(n.animation=i.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,i){var r,n=new e(t.name,t.id,i);for(t.dimensionsAtRest&&(n.dimensionsAtRest=o.x.FromArray(t.dimensionsAtRest)),n.needInitialSkinMatrix=t.needInitialSkinMatrix,r=0;r-1&&(a=n.bones[s.parentBoneIndex]);var c=s.rest?o.j.FromArray(s.rest):null,l=new Y(s.name,n,a,o.j.FromArray(s.matrix),c);void 0!==s.id&&null!==s.id&&(l.id=s.id),s.length&&(l.length=s.length),s.metadata&&(l.metadata=s.metadata),s.animation&&l.animations.push(N.Parse(s.animation))}if(t.ranges)for(r=0;r0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e},e.prototype.sortBones=function(){for(var e=new Array,t=new Array(this.bones.length),i=0;i=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}(),Ye=function(e){function t(t,i,r){var o=e.call(this,t,i,r)||this;return o.onButtonDownObservable=new n.c,o.onButtonUpObservable=new n.c,o.type=Xe.GENERIC,o._buttons=new Array(r.buttons.length),o}return l.d(t,e),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype._setButtonValue=function(e,t,i){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e},t.prototype.update=function(){e.prototype.update.call(this);for(var t=0;t.005&&(e.inertialAlphaOffset+=i)}if(0!=t.y){var r=t.y/this.gamepadRotationSensibility;0!=r&&Math.abs(r)>.005&&(e.inertialBetaOffset+=r)}}var n=this.gamepad.leftStick;if(n&&0!=n.y){var o=n.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"},l.c([Object(w.c)()],e.prototype,"gamepadRotationSensibility",void 0),l.c([Object(w.c)()],e.prototype,"gamepadMoveSensibility",void 0),e}();je.ArcRotateCameraGamepadInput=Ke;var Qe=i(50),qe=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 i=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){i._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(e){var r,n=e.event;n.metaKey||(e.type===Qe.a.KEYDOWN?(i._ctrlPressed=n.ctrlKey,i._altPressed=n.altKey,(-1!==i.keysUp.indexOf(n.keyCode)||-1!==i.keysDown.indexOf(n.keyCode)||-1!==i.keysLeft.indexOf(n.keyCode)||-1!==i.keysRight.indexOf(n.keyCode)||-1!==i.keysReset.indexOf(n.keyCode))&&(-1===(r=i._keys.indexOf(n.keyCode))&&i._keys.push(n.keyCode),n.preventDefault&&(t||n.preventDefault()))):-1===i.keysUp.indexOf(n.keyCode)&&-1===i.keysDown.indexOf(n.keyCode)&&-1===i.keysLeft.indexOf(n.keyCode)&&-1===i.keysRight.indexOf(n.keyCode)&&-1===i.keysReset.indexOf(n.keyCode)||((r=i._keys.indexOf(n.keyCode))>=0&&i._keys.splice(r,1),n.preventDefault&&(t||n.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?a/(1+i.wheelDeltaPercentage):a*(1+i.wheelDeltaPercentage)}else o=s.wheelDelta/(40*i.wheelPrecision);else o=-(n.deltaY||n.detail)/i.wheelPrecision;o&&(i.camera.inertialRadiusOffset+=o),n.preventDefault&&(t||n.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,Pe.a.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"},l.c([Object(w.c)()],e.prototype,"wheelPrecision",void 0),l.c([Object(w.c)()],e.prototype,"wheelDeltaPercentage",void 0),e}();je.ArcRotateCameraMouseWheelInput=Ze;var Je=function(){function e(){this.buttons=[0,1,2],this.angularSensibilityX=1e3,this.angularSensibilityY=1e3,this.pinchPrecision=12,this.pinchDeltaPercentage=0,this.panningSensibility=1e3,this.multiTouchPanning=!0,this.multiTouchPanAndZoom=!0,this.pinchInwards=!0,this._isPanClick=!1}return e.prototype.attachControl=function(e,t){var i,r=this,n=this.camera.getEngine(),o=null,s=null,a=0,c=0,l=0,u={x:0,y:0,isPaning:!1,isPinching:!1};this._pointerInput=function(h,d){var f=h.event,p="touch"===h.event.pointerType;if(!n.isInVRExclusivePointerMode&&(h.type===Pe.a.POINTERMOVE||-1!==r.buttons.indexOf(f.button))){var _=f.srcElement||f.target;if(h.type===Pe.a.POINTERDOWN&&_){try{_.setPointerCapture(f.pointerId)}catch(e){}r._isPanClick=f.button===r.camera._panningMouseButton,i={x:f.clientX,y:f.clientY,pointerId:f.pointerId,type:f.pointerType},null===o?o=i:null===s&&(s=i),t||(f.preventDefault(),e.focus())}else if(h.type===Pe.a.POINTERDOUBLETAP)r.camera.useInputToRestoreState&&r.camera.restoreState();else if(h.type===Pe.a.POINTERUP&&_){try{_.releasePointerCapture(f.pointerId)}catch(e){}i=null,a=0,u.isPaning=!1,u.isPinching=!1,l=0,c=0,p||(s=null),n._badOS?o=s=null:s&&o&&o.pointerId==f.pointerId?(o=s,s=null,i={x:o.x,y:o.y,pointerId:o.pointerId,type:f.pointerType}):o&&s&&s.pointerId==f.pointerId?(s=null,i={x:o.x,y:o.y,pointerId:o.pointerId,type:f.pointerType}):o=s=null,t||f.preventDefault()}else if(h.type===Pe.a.POINTERMOVE)if(t||f.preventDefault(),o&&null===s&&i){if(0!==r.panningSensibility&&(f.ctrlKey&&r.camera._useCtrlForPanning||r._isPanClick))r.camera.inertialPanningX+=-(f.clientX-i.x)/r.panningSensibility,r.camera.inertialPanningY+=(f.clientY-i.y)/r.panningSensibility;else{var m=f.clientX-i.x,g=f.clientY-i.y;r.camera.inertialAlphaOffset-=m/r.angularSensibilityX,r.camera.inertialBetaOffset-=g/r.angularSensibilityY}i.x=f.clientX,i.y=f.clientY}else if(o&&s){var v=o.pointerId===f.pointerId?o:s;v.x=f.clientX,v.y=f.clientY;var y=r.pinchInwards?1:-1,b=o.x-s.x,T=o.y-s.y,E=b*b+T*T,x=Math.sqrt(E);if(0===a)return c=x,a=E,u.x=(o.x+s.x)/2,void(u.y=(o.y+s.y)/2);if(r.multiTouchPanAndZoom){if(r.pinchDeltaPercentage?r.camera.inertialRadiusOffset+=.001*(E-a)*r.camera.radius*r.pinchDeltaPercentage:r.camera.inertialRadiusOffset+=(E-a)/(r.pinchPrecision*((r.angularSensibilityX+r.angularSensibilityY)/2)*y),0!==r.panningSensibility){var A=(o.x+s.x)/2,P=(o.y+s.y)/2,R=A-u.x,S=P-u.y;u.x=A,u.y=P,r.camera.inertialPanningX+=-R/r.panningSensibility,r.camera.inertialPanningY+=S/r.panningSensibility}}else{if(l++,u.isPinching||l<20&&Math.abs(x-c)>r.camera.pinchToPanMaxDistance)r.pinchDeltaPercentage?r.camera.inertialRadiusOffset+=.001*(E-a)*r.camera.radius*r.pinchDeltaPercentage:r.camera.inertialRadiusOffset+=(E-a)/(r.pinchPrecision*((r.angularSensibilityX+r.angularSensibilityY)/2)*y),u.isPaning=!1,u.isPinching=!0;else if(i&&i.pointerId===v.pointerId&&0!==r.panningSensibility&&r.multiTouchPanning){if(!u.isPaning)return u.isPaning=!0,u.isPinching=!1,u.x=v.x,void(u.y=v.y);r.camera.inertialPanningX+=-(v.x-u.x)/r.panningSensibility,r.camera.inertialPanningY+=(v.y-u.y)/r.panningSensibility}i&&i.pointerId===f.pointerId&&(u.x=v.x,u.y=v.y)}a=E}}},this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,Pe.a.POINTERDOWN|Pe.a.POINTERUP|Pe.a.POINTERMOVE|Pe.a.POINTERDOUBLETAP),this._onContextMenu=function(e){e.preventDefault()},this.camera._useCtrlForPanning||e.addEventListener("contextmenu",this._onContextMenu,!1),this._onLostFocus=function(){o=s=null,a=0,u.isPaning=!1,u.isPinching=!1,l=0,i=null,c=0},this._onMouseMove=function(e){if(n.isPointerLock){var i=e.movementX||e.mozMovementX||e.webkitMovementX||e.msMovementX||0,o=e.movementY||e.mozMovementY||e.webkitMovementY||e.msMovementY||0;r.camera.inertialAlphaOffset-=i/r.angularSensibilityX,r.camera.inertialBetaOffset-=o/r.angularSensibilityY,t||e.preventDefault()}},this._onGestureStart=function(t){void 0!==window.MSGesture&&(r._MSGestureHandler||(r._MSGestureHandler=new MSGesture,r._MSGestureHandler.target=e),r._MSGestureHandler.addPointer(t.pointerId))},this._onGesture=function(e){r.camera.radius*=e.scale,e.preventDefault&&(t||(e.stopPropagation(),e.preventDefault()))},e.addEventListener("mousemove",this._onMouseMove,!1),e.addEventListener("MSPointerDown",this._onGestureStart,!1),e.addEventListener("MSGestureChange",this._onGesture,!1),ve.h.RegisterTopRootEvents([{name:"blur",handler:this._onLostFocus}])},e.prototype.detachControl=function(e){this._onLostFocus&&ve.h.UnregisterTopRootEvents([{name:"blur",handler:this._onLostFocus}]),e&&this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._onContextMenu&&e.removeEventListener("contextmenu",this._onContextMenu),this._onMouseMove&&e.removeEventListener("mousemove",this._onMouseMove),this._onGestureStart&&e.removeEventListener("MSPointerDown",this._onGestureStart),this._onGesture&&e.removeEventListener("MSGestureChange",this._onGesture),this._isPanClick=!1,this.pinchInwards=!0,this._onMouseMove=null,this._onGestureStart=null,this._onGesture=null,this._MSGestureHandler=null,this._onLostFocus=null,this._onContextMenu=null)},e.prototype.getClassName=function(){return"ArcRotateCameraPointersInput"},e.prototype.getSimpleName=function(){return"pointers"},l.c([Object(w.c)()],e.prototype,"buttons",void 0),l.c([Object(w.c)()],e.prototype,"angularSensibilityX",void 0),l.c([Object(w.c)()],e.prototype,"angularSensibilityY",void 0),l.c([Object(w.c)()],e.prototype,"pinchPrecision",void 0),l.c([Object(w.c)()],e.prototype,"pinchDeltaPercentage",void 0),l.c([Object(w.c)()],e.prototype,"panningSensibility",void 0),l.c([Object(w.c)()],e.prototype,"multiTouchPanning",void 0),l.c([Object(w.c)()],e.prototype,"multiTouchPanAndZoom",void 0),e}();je.ArcRotateCameraPointersInput=Je;var $e=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addMouseWheel=function(){return this.add(new Ze),this},t.prototype.addPointers=function(){return this.add(new Je),this},t.prototype.addKeyboard=function(){return this.add(new qe),this},t}(We);$e.prototype.addVRDeviceOrientation=function(){return this.add(new et),this};var et=function(){function e(){this.alphaCorrection=1,this.gammaCorrection=1,this._alpha=0,this._gamma=0,this._dirty=!1,this._deviceOrientationHandler=this._onOrientationEvent.bind(this)}return e.prototype.attachControl=function(e,t){this.camera.attachControl(e,t),window.addEventListener("deviceorientation",this._deviceOrientationHandler)},e.prototype._onOrientationEvent=function(e){null!==e.alpha&&(this._alpha=(0|+e.alpha)*this.alphaCorrection),null!==e.gamma&&(this._gamma=(0|+e.gamma)*this.gammaCorrection),this._dirty=!0},e.prototype.checkInputs=function(){this._dirty&&(this._dirty=!1,this._gamma<0&&(this._gamma=180+this._gamma),this.camera.alpha=-this._alpha/180*Math.PI%Math.PI*2,this.camera.beta=this._gamma/180*Math.PI)},e.prototype.detachControl=function(e){window.removeEventListener("deviceorientation",this._deviceOrientationHandler)},e.prototype.getClassName=function(){return"ArcRotateCameraVRDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"VRDeviceOrientation"},e}();je.ArcRotateCameraVRDeviceOrientationInput=et;var tt=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 i=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){i._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(e){var r,n=e.event;e.type===Qe.a.KEYDOWN?-1===i.keysForward.indexOf(n.keyCode)&&-1===i.keysBackward.indexOf(n.keyCode)&&-1===i.keysUp.indexOf(n.keyCode)&&-1===i.keysDown.indexOf(n.keyCode)&&-1===i.keysLeft.indexOf(n.keyCode)&&-1===i.keysRight.indexOf(n.keyCode)||(-1===(r=i._keys.indexOf(n.keyCode))&&i._keys.push(n.keyCode),t||n.preventDefault()):-1===i.keysForward.indexOf(n.keyCode)&&-1===i.keysBackward.indexOf(n.keyCode)&&-1===i.keysUp.indexOf(n.keyCode)&&-1===i.keysDown.indexOf(n.keyCode)&&-1===i.keysLeft.indexOf(n.keyCode)&&-1===i.keysRight.indexOf(n.keyCode)||((r=i._keys.indexOf(n.keyCode))>=0&&i._keys.splice(r,1),t||n.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&&i._keys.splice(r,1),t||n.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(),i=new o.x(0,0,t*this._offsetY/this.touchMoveSensibility);o.j.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(o.x.TransformCoordinates(i,e._cameraRotationMatrix))}}},e.prototype.getClassName=function(){return"FreeCameraTouchInput"},e.prototype.getSimpleName=function(){return"touch"},l.c([Object(w.c)()],e.prototype,"touchAngularSensibility",void 0),l.c([Object(w.c)()],e.prototype,"touchMoveSensibility",void 0),e}();je.FreeCameraTouchInput=ot;var st=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addKeyboard=function(){return this.add(new rt),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this.add(new nt(e)),this},t.prototype.addTouch=function(){return this.add(new ot),this},t}(We);st.prototype.addDeviceOrientation=function(){return this.add(new at),this};var at=function(){function e(){var e=this;this._screenOrientationAngle=0,this._screenQuaternion=new o.q,this._alpha=0,this._beta=0,this._gamma=0,this._orientationChanged=function(){e._screenOrientationAngle=void 0!==window.orientation?+window.orientation:window.screen.orientation&&window.screen.orientation.angle?window.screen.orientation.angle:0,e._screenOrientationAngle=-ve.h.ToRadians(e._screenOrientationAngle/2),e._screenQuaternion.copyFromFloats(0,Math.sin(e._screenOrientationAngle),0,Math.cos(e._screenOrientationAngle))},this._deviceOrientation=function(t){e._alpha=null!==t.alpha?t.alpha:0,e._beta=null!==t.beta?t.beta:0,e._gamma=null!==t.gamma?t.gamma:0},this._constantTranform=new o.q(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this._orientationChanged()}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},set:function(e){this._camera=e,null==this._camera||this._camera.rotationQuaternion||(this._camera.rotationQuaternion=new o.q)},enumerable:!0,configurable:!0}),e.prototype.attachControl=function(e,t){window.addEventListener("orientationchange",this._orientationChanged),window.addEventListener("deviceorientation",this._deviceOrientation),this._orientationChanged()},e.prototype.detachControl=function(e){window.removeEventListener("orientationchange",this._orientationChanged),window.removeEventListener("deviceorientation",this._deviceOrientation)},e.prototype.checkInputs=function(){this._alpha&&(o.q.RotationYawPitchRollToRef(ve.h.ToRadians(this._alpha),ve.h.ToRadians(this._beta),-ve.h.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}();je.FreeCameraDeviceOrientationInput=at;var ct=function(){function e(){this.gamepadAngularSensibility=200,this.gamepadMoveSensibility=40,this._cameraTransform=o.j.Identity(),this._deltaTransform=o.x.Zero(),this._vector3=o.x.Zero(),this._vector2=o.w.Zero()}return e.prototype.attachControl=function(e,t){var i=this,r=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=r.onGamepadConnectedObservable.add(function(e){e.type!==Xe.POSE_ENABLED&&(i.gamepad&&e.type!==Xe.XBOX||(i.gamepad=e))}),this._onGamepadDisconnectedObserver=r.onGamepadDisconnectedObservable.add(function(e){i.gamepad===e&&(i.gamepad=null)}),this.gamepad=r.getGamepadByType(Xe.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,i=t.x/this.gamepadMoveSensibility,r=t.y/this.gamepadMoveSensibility;t.x=Math.abs(i)>.005?0+i:0,t.y=Math.abs(r)>.005?0+r:0;var n=this.gamepad.rightStick;if(n){var s=n.x/this.gamepadAngularSensibility,a=n.y/this.gamepadAngularSensibility;n.x=Math.abs(s)>.001?0+s:0,n.y=Math.abs(a)>.001?0+a:0}else n={x:0,y:0};e.rotationQuaternion?e.rotationQuaternion.toRotationMatrix(this._cameraTransform):o.j.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),o.x.TransformCoordinatesToRef(this._vector3,this._cameraTransform,this._deltaTransform),e.cameraDirection.addInPlace(this._deltaTransform),this._vector2.copyFromFloats(n.y,n.x),e.cameraRotation.addInPlace(this._vector2)}},e.prototype.getClassName=function(){return"FreeCameraGamepadInput"},e.prototype.getSimpleName=function(){return"gamepad"},l.c([Object(w.c)()],e.prototype,"gamepadAngularSensibility",void 0),l.c([Object(w.c)()],e.prototype,"gamepadMoveSensibility",void 0),e}();je.FreeCameraGamepadInput=ct;var lt,ut=i(59);!function(e){e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(lt||(lt={}));var ht=function(){function e(t){var i=this;if(this._leftJoystick=!!t,e._globalJoystickIndex++,this._axisTargetedByLeftAndRight=lt.X,this._axisTargetedByUpAndDown=lt.Y,this.reverseLeftRight=!1,this.reverseUpDown=!1,this._touches=new ut.a,this.deltaPosition=o.x.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 r=e.Canvas.getContext("2d");if(!r)throw new Error("Unable to create canvas for virtual joystick");e.vjCanvasContext=r,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 o.w(0,0),this._joystickPreviousPointerPos=new o.w(0,0),this._joystickPointerStartPos=new o.w(0,0),this._deltaJoystickVector=new o.w(0,0),this._onPointerDownHandlerRef=function(e){i._onPointerDown(e)},this._onPointerMoveHandlerRef=function(e){i._onPointerMove(e)},this._onPointerUpHandlerRef=function(e){i._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(){i._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 lt.X:this.deltaPosition.x=Math.min(1,Math.max(-1,t));break;case lt.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,t));break;case lt.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,t))}var i=(this.reverseUpDown?1:-1)*this._deltaJoystickVector.y/this._inversedSensibility;switch(this._axisTargetedByUpAndDown){case lt.X:this.deltaPosition.x=Math.min(1,Math.max(-1,i));break;case lt.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,i));break;case lt.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,i))}}else{var r=this._touches.get(e.pointerId.toString());r&&(r.x=e.clientX,r.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 i=this._touches.get(t.pointerId.toString());i&&e.vjCanvasContext.clearRect(i.prevX-44,i.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 lt.X:case lt.Y:case lt.Z:this._axisTargetedByLeftAndRight=e;break;default:this._axisTargetedByLeftAndRight=lt.X}},e.prototype.setAxisForUpDown=function(e){switch(e){case lt.X:case lt.Y:case lt.Z:this._axisTargetedByUpAndDown=e;break;default:this._axisTargetedByUpAndDown=lt.Y}},e.prototype._drawVirtualJoystick=function(){var t=this;this.pressed&&this._touches.forEach(function(i,r){r.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(r.prevX-44,r.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(r.x,r.y,40,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),r.prevX=r.x,r.prevY=r.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}();st.prototype.addVirtualJoystick=function(){return this.add(new dt),this};var dt=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(),i=o.j.RotationYawPitchRoll(e.rotation.y,e.rotation.x,0),r=o.x.TransformCoordinates(new o.x(this._leftjoystick.deltaPosition.x*t,this._leftjoystick.deltaPosition.y*t,this._leftjoystick.deltaPosition.z*t),i);e.cameraDirection=e.cameraDirection.add(r),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 ht(!0),this._leftjoystick.setAxisForUpDown(lt.Z),this._leftjoystick.setAxisForLeftRight(lt.X),this._leftjoystick.setJoystickSensibility(.15),this._rightjoystick=new ht(!1),this._rightjoystick.setAxisForUpDown(lt.X),this._rightjoystick.setAxisForLeftRight(lt.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}();je.FreeCameraVirtualJoystickInput=dt;var ft=function(e){function t(t,i,r,n){void 0===n&&(n=!0);var s=e.call(this,t,i,r,n)||this;return s.cameraDirection=new o.x(0,0,0),s.cameraRotation=new o.w(0,0),s.updateUpVectorFromRotation=!1,s._tmpQuaternion=new o.q,s.rotation=new o.x(0,0,0),s.speed=2,s.noRotationConstraint=!1,s.lockedTarget=null,s._currentTarget=o.x.Zero(),s._initialFocalDistance=1,s._viewMatrix=o.j.Zero(),s._camMatrix=o.j.Zero(),s._cameraTransformMatrix=o.j.Zero(),s._cameraRotationMatrix=o.j.Zero(),s._referencePoint=new o.x(0,0,1),s._transformedReferencePoint=o.x.Zero(),s._globalCurrentTarget=o.x.Zero(),s._globalCurrentUpVector=o.x.Zero(),s._defaultUp=o.x.Up(),s._cachedRotationZ=0,s._cachedQuaternionRotationZ=0,s}return l.d(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 o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new o.q(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this);var i=this._getLockedTargetPosition();i?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(i):this._cache.lockedTarget=i.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+=o.h),o.j.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&&o.q.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(o.t.Matrix[0]),o.x.TransformNormalToRef(this.cameraDirection,o.t.Matrix[0],o.t.Vector3[0]),void this.position.addInPlace(o.t.Vector3[0]);this.position.addInPlace(this.cameraDirection)},t.prototype._checkInputs=function(){var t=this._decideIfNeedsToMove(),i=Math.abs(this.cameraRotation.x)>0||Math.abs(this.cameraRotation.y)>0;if(t&&this._updatePosition(),i){if(this.rotation.x+=this.cameraRotation.x,this.rotation.y+=this.cameraRotation.y,this.rotationQuaternion)this.rotation.lengthSquared()&&o.q.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion);if(!this.noRotationConstraint){var r=Math.PI/2*.95;this.rotation.x>r&&(this.rotation.x=r),this.rotation.x<-r&&(this.rotation.x=-r)}}t&&(Math.abs(this.cameraDirection.x)_e.b.CollisionsEpsilon&&(s.position.addInPlace(s._diffPosition),s.onCollide&&i&&s.onCollide(i))},s.inputs=new st(s),s.inputs.addKeyboard().addMouse(),s}return l.d(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.x(0,0,0),this.cameraRotation=new o.w(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.x.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 i=e;this.applyGravity&&(i=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,i,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=o.x.Zero(),this._transformedDirection=o.x.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"},l.c([Object(w.n)()],t.prototype,"ellipsoid",void 0),l.c([Object(w.n)()],t.prototype,"ellipsoidOffset",void 0),l.c([Object(w.c)()],t.prototype,"checkCollisions",void 0),l.c([Object(w.c)()],t.prototype,"applyGravity",void 0),t}(ft);F.a.AddNodeConstructor("TouchCamera",function(e,t){return function(){return new _t(e,o.x.Zero(),t)}});var _t=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.inputs.addTouch(),n._setupInputs(),n}return l.d(t,e),Object.defineProperty(t.prototype,"touchAngularSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchAngularSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchAngularSensibility=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touchMoveSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchMoveSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchMoveSensibility=e)},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"TouchCamera"},t.prototype._setupInputs=function(){var e=this.inputs.attached.mouse;e&&(e.touchEnabled=!1)},t}(pt);F.a.AddNodeConstructor("ArcRotateCamera",function(e,t){return function(){return new mt(e,0,0,1,o.x.Zero(),t)}});var mt=function(e){function t(t,i,r,s,a,c,l){void 0===l&&(l=!0);var u=e.call(this,t,o.x.Zero(),c,l)||this;return u.inertialAlphaOffset=0,u.inertialBetaOffset=0,u.inertialRadiusOffset=0,u.lowerAlphaLimit=null,u.upperAlphaLimit=null,u.lowerBetaLimit=.01,u.upperBetaLimit=Math.PI-.01,u.lowerRadiusLimit=null,u.upperRadiusLimit=null,u.inertialPanningX=0,u.inertialPanningY=0,u.pinchToPanMaxDistance=20,u.panningDistanceLimit=null,u.panningOriginTarget=o.x.Zero(),u.panningInertia=.9,u.zoomOnFactor=1,u.targetScreenOffset=o.w.Zero(),u.allowUpsideDown=!0,u.useInputToRestoreState=!0,u._viewMatrix=new o.j,u.panningAxis=new o.x(1,1,0),u.onMeshTargetChangedObservable=new n.c,u.checkCollisions=!1,u.collisionRadius=new o.x(.5,.5,.5),u._previousPosition=o.x.Zero(),u._collisionVelocity=o.x.Zero(),u._newPosition=o.x.Zero(),u._computationVector=o.x.Zero(),u._onCollisionPositionChange=function(e,t,i){void 0===i&&(i=null),i?(u.setPosition(t),u.onCollide&&u.onCollide(i)):u._previousPosition.copyFrom(u.position);var r=Math.cos(u.alpha),n=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*r*s,u.radius*o,u.radius*n*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=o.x.Zero(),a&&u.setTarget(a),u.alpha=i,u.beta=r,u.radius=s,u.getViewMatrix(),u.inputs=new $e(u),u.inputs.addKeyboard().addMouseWheel().addPointers(),u}return l.d(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,"angularSensibilityX",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"angularSensibilityY",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityY:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityY=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pinchPrecision",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchPrecision:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchPrecision=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pinchDeltaPercentage",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchDeltaPercentage:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchDeltaPercentage=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"panningSensibility",{get:function(){var e=this.inputs.attached.pointers;return e?e.panningSensibility:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.panningSensibility=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wheelPrecision",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelPrecision:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelPrecision=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wheelDeltaPercentage",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelDeltaPercentage:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelDeltaPercentage=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bouncingBehavior",{get:function(){return this._bouncingBehavior},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useBouncingBehavior",{get:function(){return null!=this._bouncingBehavior},set:function(e){e!==this.useBouncingBehavior&&(e?(this._bouncingBehavior=new Se,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 Ce,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 Re,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 o.x(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=o.w.Zero()},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)},t.prototype._getTargetPosition=function(){if(this._targetHost&&this._targetHost.getAbsolutePosition){var e=this._targetHost.absolutePosition;this._targetBoundingCenter?e.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(e)}var t=this._getLockedTargetPosition();return t||this._target},t.prototype.storeState=function(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.setTarget(this._storedTarget.clone()),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0)},t.prototype._isSynchronizedViewMatrix=function(){return!!e.prototype._isSynchronizedViewMatrix.call(this)&&(this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset))},t.prototype.attachControl=function(e,t,i,r){var n=this;void 0===i&&(i=!0),void 0===r&&(r=2),this._useCtrlForPanning=i,this._panningMouseButton=r,this.inputs.attachElement(e,t),this._reset=function(){n.inertialAlphaOffset=0,n.inertialBetaOffset=0,n.inertialRadiusOffset=0,n.inertialPanningX=0,n.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),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4),this.alpha=Math.acos(this._computationVector.x/Math.sqrt(Math.pow(this._computationVector.x,2)+Math.pow(this._computationVector.z,2))),this._computationVector.z<0&&(this.alpha=2*Math.PI-this.alpha),this.beta=Math.acos(this._computationVector.y/this.radius),this._checkLimits()},t.prototype.setPosition=function(e){this.position.equals(e)||(this.position.copyFrom(e),this.rebuildAnglesAndRadius())},t.prototype.setTarget=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=!1),e.getBoundingInfo)this._targetBoundingCenter=t?e.getBoundingInfo().boundingBox.centerWorld.clone():null,this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{var r=e,n=this._getTargetPosition();if(n&&!i&&n.equals(r))return;this._targetHost=null,this._target=r,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}this.rebuildAnglesAndRadius()},t.prototype._getViewMatrix=function(){var e=Math.cos(this.alpha),t=Math.sin(this.alpha),i=Math.cos(this.beta),r=Math.sin(this.beta);0===r&&(r=1e-4);var n=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*r,this.radius*i,this.radius*t*r),0!==this.upVector.x||1!==this.upVector.y||0!==this.upVector.z){this._tempAxisVector||(this._tempAxisVector=new o.x,this._tempAxisRotationMatrix=new o.j),o.x.CrossToRef(o.x.Up(),this.upVector,this._tempAxisVector),this._tempAxisVector.normalize();var s=Math.acos(o.x.Dot(o.x.UpReadOnly,this.upVector));o.j.RotationAxisToRef(this._tempAxisVector,s,this._tempAxisRotationMatrix),this._tempAxisVector.copyFrom(this._computationVector),o.x.TransformCoordinatesToRef(this._tempAxisVector,this._tempAxisRotationMatrix,this._computationVector)}if(n.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){var a=this.getScene().collisionCoordinator;this._collider||(this._collider=a.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this.position,this._collisionVelocity),this._collisionTriggered=!0,a.getNewPosition(this.position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this.position.copyFrom(this._newPosition);var c=this.upVector;this.allowUpsideDown&&r<0&&(c=(c=c.clone()).negate()),this._computeViewMatrix(this.position,n,c),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget=n,this._viewMatrix},t.prototype.zoomOn=function(e,t){void 0===t&&(t=!1),e=e||this.getScene().meshes;var i=de.a.MinMax(e),r=o.x.Distance(i.min,i.max);this.radius=r*this.zoomOnFactor,this.focusOn({min:i.min,max:i.max,distance:r},t)},t.prototype.focusOn=function(e,t){var i,r;if(void 0===t&&(t=!1),void 0===e.min){var n=e||this.getScene().meshes;i=de.a.MinMax(n),r=o.x.Distance(i.min,i.max)}else{i=e,r=e.distance}this._target=de.a.Center(i),t||(this.maxZ=2*r)},t.prototype.createRigCamera=function(e,i){var r=0;switch(this.cameraRigMode){case Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Fe.a.RIG_MODE_VR:r=this._cameraRigParams.stereoHalfAngle*(0===i?1:-1);break;case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:r=this._cameraRigParams.stereoHalfAngle*(0===i?-1:1)}var n=new t(e,this.alpha+r,this.beta,this.radius,this._target,this.getScene());return n._cameraRigParams={},n},t.prototype._updateRigCameras=function(){var t=this._rigCameras[0],i=this._rigCameras[1];switch(t.beta=i.beta=this.beta,this.cameraRigMode){case Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Fe.a.RIG_MODE_VR:t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,i.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,i.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"},l.c([Object(w.c)()],t.prototype,"alpha",void 0),l.c([Object(w.c)()],t.prototype,"beta",void 0),l.c([Object(w.c)()],t.prototype,"radius",void 0),l.c([Object(w.n)("target")],t.prototype,"_target",void 0),l.c([Object(w.c)()],t.prototype,"inertialAlphaOffset",void 0),l.c([Object(w.c)()],t.prototype,"inertialBetaOffset",void 0),l.c([Object(w.c)()],t.prototype,"inertialRadiusOffset",void 0),l.c([Object(w.c)()],t.prototype,"lowerAlphaLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperAlphaLimit",void 0),l.c([Object(w.c)()],t.prototype,"lowerBetaLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperBetaLimit",void 0),l.c([Object(w.c)()],t.prototype,"lowerRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"inertialPanningX",void 0),l.c([Object(w.c)()],t.prototype,"inertialPanningY",void 0),l.c([Object(w.c)()],t.prototype,"pinchToPanMaxDistance",void 0),l.c([Object(w.c)()],t.prototype,"panningDistanceLimit",void 0),l.c([Object(w.n)()],t.prototype,"panningOriginTarget",void 0),l.c([Object(w.c)()],t.prototype,"panningInertia",void 0),l.c([Object(w.c)()],t.prototype,"zoomOnFactor",void 0),l.c([Object(w.c)()],t.prototype,"targetScreenOffset",void 0),l.c([Object(w.c)()],t.prototype,"allowUpsideDown",void 0),l.c([Object(w.c)()],t.prototype,"useInputToRestoreState",void 0),t}(ft);F.a.AddNodeConstructor("DeviceOrientationCamera",function(e,t){return function(){return new gt(e,o.x.Zero(),t)}});var gt=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n._quaternionCache=new o.q,n.inputs.addDeviceOrientation(),n}return l.d(t,e),t.prototype.getClassName=function(){return"DeviceOrientationCamera"},t.prototype._checkInputs=function(){e.prototype._checkInputs.call(this),this._quaternionCache.copyFrom(this.rotationQuaternion),this._initialQuaternion&&this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)},t.prototype.resetToCurrentRotation=function(e){var t=this;void 0===e&&(e=o.c.Y),this.rotationQuaternion&&(this._initialQuaternion||(this._initialQuaternion=new o.q),this._initialQuaternion.copyFrom(this._quaternionCache||this.rotationQuaternion),["x","y","z"].forEach(function(i){e[i]?t._initialQuaternion[i]*=-1:t._initialQuaternion[i]=0}),this._initialQuaternion.normalize(),this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion))},t}(pt),vt=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addKeyboard=function(){return this.add(new tt),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this.add(new it(e)),this},t}(We),yt=function(e){function t(t,i,r,n){void 0===n&&(n=!0);var s=e.call(this,t,i,r,n)||this;return s.ellipsoid=new o.x(1,1,1),s.ellipsoidOffset=new o.x(0,0,0),s.checkCollisions=!1,s.applyGravity=!1,s.cameraDirection=o.x.Zero(),s._trackRoll=0,s.rollCorrect=100,s.bankedTurn=!1,s.bankedTurnLimit=Math.PI/2,s.bankedTurnMultiplier=1,s._needMoveForGravity=!1,s._oldPosition=o.x.Zero(),s._diffPosition=o.x.Zero(),s._newPosition=o.x.Zero(),s._collisionMask=-1,s._onCollisionPositionChange=function(e,t,i){void 0===i&&(i=null);var r;r=t,s._newPosition.copyFrom(r),s._newPosition.subtractToRef(s._oldPosition,s._diffPosition),s._diffPosition.length()>_e.b.CollisionsEpsilon&&(s.position.addInPlace(s._diffPosition),s.onCollide&&i&&s.onCollide(i))},s.inputs=new vt(s),s.inputs.addKeyboard().addMouse(),s}return l.d(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.x(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.x.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 i=e;this.applyGravity&&(i=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,i,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=o.x.Zero(),this._transformedDirection=o.x.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,i=t-this.rotation.z;Math.abs(i)>=.001&&(this.rotation.z+=i/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"},l.c([Object(w.n)()],t.prototype,"ellipsoid",void 0),l.c([Object(w.n)()],t.prototype,"ellipsoidOffset",void 0),l.c([Object(w.c)()],t.prototype,"checkCollisions",void 0),l.c([Object(w.c)()],t.prototype,"applyGravity",void 0),t}(ft),bt=function(){function e(){this.keysHeightOffsetIncr=[38],this.keysHeightOffsetDecr=[40],this.keysHeightOffsetModifierAlt=!1,this.keysHeightOffsetModifierCtrl=!1,this.keysHeightOffsetModifierShift=!1,this.keysRotationOffsetIncr=[37],this.keysRotationOffsetDecr=[39],this.keysRotationOffsetModifierAlt=!1,this.keysRotationOffsetModifierCtrl=!1,this.keysRotationOffsetModifierShift=!1,this.keysRadiusIncr=[40],this.keysRadiusDecr=[38],this.keysRadiusModifierAlt=!0,this.keysRadiusModifierCtrl=!1,this.keysRadiusModifierShift=!1,this.heightSensibility=1,this.rotationSensibility=1,this.radiusSensibility=1,this._keys=new Array}return e.prototype.attachControl=function(e,t){var i=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){i._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(e){var r,n=e.event;n.metaKey||(e.type===Qe.a.KEYDOWN?(i._ctrlPressed=n.ctrlKey,i._altPressed=n.altKey,i._shiftPressed=n.shiftKey,(-1!==i.keysHeightOffsetIncr.indexOf(n.keyCode)||-1!==i.keysHeightOffsetDecr.indexOf(n.keyCode)||-1!==i.keysRotationOffsetIncr.indexOf(n.keyCode)||-1!==i.keysRotationOffsetDecr.indexOf(n.keyCode)||-1!==i.keysRadiusIncr.indexOf(n.keyCode)||-1!==i.keysRadiusDecr.indexOf(n.keyCode))&&(-1===(r=i._keys.indexOf(n.keyCode))&&i._keys.push(n.keyCode),n.preventDefault&&(t||n.preventDefault()))):-1===i.keysHeightOffsetIncr.indexOf(n.keyCode)&&-1===i.keysHeightOffsetDecr.indexOf(n.keyCode)&&-1===i.keysRotationOffsetIncr.indexOf(n.keyCode)&&-1===i.keysRotationOffsetDecr.indexOf(n.keyCode)&&-1===i.keysRadiusIncr.indexOf(n.keyCode)&&-1===i.keysRadiusDecr.indexOf(n.keyCode)||((r=i._keys.indexOf(n.keyCode))>=0&&i._keys.splice(r,1),n.preventDefault&&(t||n.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},l.c([Object(w.c)()],e.prototype,"keysHeightOffsetIncr",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetDecr",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetModifierAlt",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetModifierCtrl",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetModifierShift",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetIncr",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetDecr",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetModifierAlt",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetModifierCtrl",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetModifierShift",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusIncr",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusDecr",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusModifierAlt",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusModifierCtrl",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusModifierShift",void 0),l.c([Object(w.c)()],e.prototype,"heightSensibility",void 0),l.c([Object(w.c)()],e.prototype,"rotationSensibility",void 0),l.c([Object(w.c)()],e.prototype,"radiusSensibility",void 0),e}();je.FollowCameraKeyboardMoveInput=bt;var Tt=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 i=this;this._wheel=function(e,r){if(e.type===Pe.a.POINTERWHEEL){var n=e.event,o=0,s=Math.max(-1,Math.min(1,n.deltaY||n.wheelDelta||-n.detail));i.wheelDeltaPercentage?(console.assert(i.axisControlRadius+i.axisControlHeight+i.axisControlRotation<=1,"wheelDeltaPercentage only usable when mouse wheel controlls ONE axis. Currently enabled: axisControlRadius: "+i.axisControlRadius+", axisControlHeightOffset: "+i.axisControlHeight+", axisControlRotationOffset: "+i.axisControlRotation),i.axisControlRadius?o=.01*s*i.wheelDeltaPercentage*i.camera.radius:i.axisControlHeight?o=.01*s*i.wheelDeltaPercentage*i.camera.heightOffset:i.axisControlRotation&&(o=.01*s*i.wheelDeltaPercentage*i.camera.rotationOffset)):o=s*i.wheelPrecision,o&&(i.axisControlRadius?i.camera.radius+=o:i.axisControlHeight?i.camera.heightOffset-=o:i.axisControlRotation&&(i.camera.rotationOffset-=o)),n.preventDefault&&(t||n.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,Pe.a.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"},l.c([Object(w.c)()],e.prototype,"axisControlRadius",void 0),l.c([Object(w.c)()],e.prototype,"axisControlHeight",void 0),l.c([Object(w.c)()],e.prototype,"axisControlRotation",void 0),l.c([Object(w.c)()],e.prototype,"wheelPrecision",void 0),l.c([Object(w.c)()],e.prototype,"wheelDeltaPercentage",void 0),e}();je.FollowCameraMouseWheelInput=Tt;var Et=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addKeyboard=function(){return this.add(new bt),this},t.prototype.addMouseWheel=function(){return this.add(new Tt),this},t.prototype.addPointers=function(){return console.warn("Pointer support not yet implemented for FollowCamera."),this},t.prototype.addVRDeviceOrientation=function(){return console.warn("DeviceOrientation support not yet implemented for FollowCamera."),this},t}(We);F.a.AddNodeConstructor("FollowCamera",function(e,t){return function(){return new xt(e,o.x.Zero(),t)}}),F.a.AddNodeConstructor("ArcFollowCamera",function(e,t){return function(){return new At(e,0,0,1,null,t)}});var xt=function(e){function t(t,i,r,n){void 0===n&&(n=null);var o=e.call(this,t,i,r)||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=n,o.inputs=new Et(o),o.inputs.addKeyboard().addMouseWheel(),o}return l.d(t,e),t.prototype._follow=function(e){if(e){var t;if(e.rotationQuaternion){var i=new o.j;e.rotationQuaternion.toRotationMatrix(i),t=Math.atan2(i.m[8],i.m[10])}else t=e.rotation.y;var r=ve.h.ToRadians(this.rotationOffset)+t,n=e.getAbsolutePosition(),s=n.x+Math.sin(r)*this.radius,a=n.z+Math.cos(r)*this.radius,c=s-this.position.x,l=n.y+this.heightOffset-this.position.y,u=a-this.position.z,h=c*this.cameraAcceleration*2,d=l*this.cameraAcceleration,f=u*this.cameraAcceleration*2;(h>this.maxCameraSpeed||h<-this.maxCameraSpeed)&&(h=h<1?-this.maxCameraSpeed:this.maxCameraSpeed),(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),this.position=new o.x(this.position.x+h,this.position.y+d,this.position.z+f),this.setTarget(n)}},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"},l.c([Object(w.c)()],t.prototype,"radius",void 0),l.c([Object(w.c)()],t.prototype,"lowerRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"rotationOffset",void 0),l.c([Object(w.c)()],t.prototype,"lowerRotationOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperRotationOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"heightOffset",void 0),l.c([Object(w.c)()],t.prototype,"lowerHeightOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperHeightOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"cameraAcceleration",void 0),l.c([Object(w.c)()],t.prototype,"maxCameraSpeed",void 0),l.c([Object(w.j)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(ft),At=function(e){function t(t,i,r,n,s,a){var c=e.call(this,t,o.x.Zero(),a)||this;return c.alpha=i,c.beta=r,c.radius=n,c.target=s,c._cartesianCoordinates=o.x.Zero(),c._follow(),c}return l.d(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}(ft);F.a.AddNodeConstructor("FreeCamera",function(e,t){return function(){return new Pt(e,o.x.Zero(),t)}});var Pt=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.inputs.addGamepad(),n}return l.d(t,e),Object.defineProperty(t.prototype,"gamepadAngularSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadAngularSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadAngularSensibility=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gamepadMoveSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadMoveSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadMoveSensibility=e)},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"UniversalCamera"},t}(_t);Fe.a._createDefaultParsedCamera=function(e,t){return new Pt(e,o.x.Zero(),t)},F.a.AddNodeConstructor("GamepadCamera",function(e,t){return function(){return new Rt(e,o.x.Zero(),t)}});var Rt=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return l.d(t,e),t.prototype.getClassName=function(){return"GamepadCamera"},t}(Pt),St=i(27),Ct=i(5),Mt="\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}";Ct.a.ShadersStore.postprocessVertexShader=Mt;var Ot=function(){function e(e,t,i,r,s,a,c,l,u,h,d,f,p,m){void 0===c&&(c=_.a.TEXTURE_NEAREST_SAMPLINGMODE),void 0===h&&(h=null),void 0===d&&(d=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===f&&(f="postprocess"),void 0===m&&(m=!1),this.name=e,this.width=-1,this.height=-1,this._outputTexture=null,this.autoClear=!0,this.alphaMode=_.a.ALPHA_DISABLE,this.animations=new Array,this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=_.a.SCALEMODE_FLOOR,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._reusable=!1,this._textures=new St.a(2),this._currentRenderTextureInd=0,this._scaleRatio=new o.w(1,1),this._texelSize=o.w.Zero(),this.onActivateObservable=new n.c,this.onSizeChangedObservable=new n.c,this.onApplyObservable=new n.c,this.onBeforeRenderObservable=new n.c,this.onAfterRenderObservable=new n.c,null!=a?(this._camera=a,this._scene=a.getScene(),a.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.postProcesses.push(this)):l&&(this._engine=l,this._engine.postProcesses.push(this)),this._options=s,this.renderTargetSamplingMode=c||_.a.TEXTURE_NEAREST_SAMPLINGMODE,this._reusable=u||!1,this._textureType=d,this._samplers=r||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=f,this._parameters=i||[],this._parameters.push("scale"),this._indexParameters=p,m||this.updateEffect(h)}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._samples},set:function(e){var t=this;this._samples=e,this._textures.forEach(function(e){e.samples!==t._samples&&t._engine.updateRenderTargetTextureSampleCount(e,t._samples)})},enumerable:!0,configurable:!0}),e.prototype.getEffectName=function(){return this._fragmentUrl},Object.defineProperty(e.prototype,"onActivate",{set:function(e){this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSizeChanged",{set:function(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onApply",{set:function(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputTexture",{get:function(){return this._textures.data[this._currentRenderTextureInd]},set:function(e){this._forcedOutputTexture=e},enumerable:!0,configurable:!0}),e.prototype.getCamera=function(){return this._camera},Object.defineProperty(e.prototype,"texelSize",{get:function(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)},enumerable:!0,configurable:!0}),e.prototype.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 St.a(2)),this._shareOutputWithPostProcess=null},e.prototype.updateEffect=function(e,t,i,r,n,o){void 0===e&&(e=null),void 0===t&&(t=null),void 0===i&&(i=null),this._effect=this._engine.createEffect({vertex:this._vertexUrl,fragment:this._fragmentUrl},["position"],t||this._parameters,i||this._samplers,null!==e?e:"",void 0,n,o,r||this._indexParameters)},e.prototype.isReusable=function(){return this._reusable},e.prototype.markTextureDirty=function(){this.width=-1},e.prototype.activate=function(e,t,i){var r=this;void 0===t&&(t=null);var n=(e=e||this._camera).getScene(),o=n.getEngine(),s=o.getCaps().maxTextureSize,a=(t?t.width:this._engine.getRenderWidth(!0))*this._options|0,c=(t?t.height:this._engine.getRenderHeight(!0))*this._options|0,l=e.parent;!l||l.leftCamera!=e&&l.rightCamera!=e||(a/=2);var u,h=this._options.width||a,d=this._options.height||c;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){var f=o.currentViewport;f&&(h*=f.width,d*=f.height)}if((this.renderTargetSamplingMode===_.a.TEXTURE_TRILINEAR_SAMPLINGMODE||this.alwaysForcePOT)&&(this._options.width||(h=o.needPOTTextures?ve.h.GetExponentOfTwo(h,s,this.scaleMode):h),this._options.height||(d=o.needPOTTextures?ve.h.GetExponentOfTwo(d,s,this.scaleMode):d)),this.width!==h||this.height!==d){if(this._textures.length>0){for(var p=0;p0)for(var e=0;e0){var r=this._camera._getFirstPostProcess();r&&r.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear()}},e}(),It="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}";Ct.a.ShadersStore.passPixelShader=It;var Dt="\nvarying vec2 vUV;\nuniform samplerCube textureSampler;\nvoid main(void)\n{\nvec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}";Ct.a.ShadersStore.passCubePixelShader=Dt;var wt=function(e){function t(t,i,r,n,o,s,a,c){return void 0===r&&(r=null),void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1),e.call(this,t,"pass",null,null,i,r,n,o,s,void 0,a,void 0,null,c)||this}return l.d(t,e),t}(Ot),Lt=function(e){function t(t,i,r,n,o,s,a,c){void 0===r&&(r=null),void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"passCube",null,null,i,r,n,o,s,"#define POSITIVEX",a,void 0,null,c)||this;return l._face=0,l}return l.d(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}(Ot);_e.b._RescalePostProcessFactory=function(e){return new wt("rescale",1,null,_e.b.TEXTURE_BILINEAR_SAMPLINGMODE,e,!1,_e.b.TEXTURETYPE_UNSIGNED_INT)};var Ft="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}";Ct.a.ShadersStore.anaglyphPixelShader=Ft;var Nt=function(e){function t(t,i,r,n,o,s){var a=e.call(this,t,"anaglyph",null,["leftSampler"],i,r[1],n,o,s)||this;return a._passedProcess=r[0]._rigPostProcess,a.onApplyObservable.add(function(e){e.setTextureFromPostProcess("leftSampler",a._passedProcess)}),a}return l.d(t,e),t}(Ot);Fe.a._setStereoscopicAnaglyphRigMode=function(e){e._rigCameras[0]._rigPostProcess=new wt(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new Nt(e.name+"_anaglyph",1,e._rigCameras)},F.a.AddNodeConstructor("AnaglyphArcRotateCamera",function(e,t,i){return function(){return new Bt(e,0,0,1,o.x.Zero(),i.interaxial_distance,t)}});var Bt=function(e){function t(t,i,r,n,o,s,a){var c=e.call(this,t,i,r,n,o,a)||this;return c.interaxialDistance=s,c.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:s}),c}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphArcRotateCamera"},t}(mt);F.a.AddNodeConstructor("AnaglyphFreeCamera",function(e,t,i){return function(){return new Ut(e,o.x.Zero(),i.interaxial_distance,t)}});var Ut=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o.interaxialDistance=r,o.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:r}),o}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphFreeCamera"},t}(pt);F.a.AddNodeConstructor("AnaglyphGamepadCamera",function(e,t,i){return function(){return new Vt(e,o.x.Zero(),i.interaxial_distance,t)}});var Vt=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o.interaxialDistance=r,o.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:r}),o}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphGamepadCamera"},t}(Rt);F.a.AddNodeConstructor("AnaglyphUniversalCamera",function(e,t,i){return function(){return new Gt(e,o.x.Zero(),i.interaxial_distance,t)}});var Gt=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o.interaxialDistance=r,o.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:r}),o}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphUniversalCamera"},t}(Pt),kt="const vec3 TWO=vec3(2.0,2.0,2.0);\nvarying vec2 vUV;\nuniform sampler2D camASampler;\nuniform sampler2D textureSampler;\nuniform vec2 stepSize;\nvoid main(void)\n{\nbool useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else{\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}";Ct.a.ShadersStore.stereoscopicInterlacePixelShader=kt;var zt=function(e){function t(t,i,r,n,s,a){var c=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,i[1],n,s,a,r?"#define IS_STEREOSCOPIC_HORIZ 1":void 0)||this;return c._passedProcess=i[0]._rigPostProcess,c._stepSize=new o.w(1/c.width,1/c.height),c.onSizeChangedObservable.add(function(){c._stepSize=new o.w(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 l.d(t,e),t}(Ot);Fe.a._setStereoscopicRigMode=function(e){var t=e.cameraRigMode===Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL||e.cameraRigMode===Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;e._rigCameras[0]._rigPostProcess=new wt(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new zt(e.name+"_stereoInterlace",e._rigCameras,t)},F.a.AddNodeConstructor("StereoscopicArcRotateCamera",function(e,t,i){return function(){return new jt(e,0,0,1,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var jt=function(e){function t(t,i,r,n,o,s,a,c){var l=e.call(this,t,i,r,n,o,c)||this;return l.interaxialDistance=s,l.isStereoscopicSideBySide=a,l.setCameraRigMode(a?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:s}),l}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicArcRotateCamera"},t}(mt);F.a.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,i){return function(){return new Wt(e,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var Wt=function(e){function t(t,i,r,n,o){var s=e.call(this,t,i,o)||this;return s.interaxialDistance=r,s.isStereoscopicSideBySide=n,s.setCameraRigMode(n?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:r}),s}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicFreeCamera"},t}(pt);F.a.AddNodeConstructor("StereoscopicGamepadCamera",function(e,t,i){return function(){return new Ht(e,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var Ht=function(e){function t(t,i,r,n,o){var s=e.call(this,t,i,o)||this;return s.interaxialDistance=r,s.isStereoscopicSideBySide=n,s.setCameraRigMode(n?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:r}),s}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicGamepadCamera"},t}(Rt);F.a.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,i){return function(){return new Xt(e,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var Xt=function(e){function t(t,i,r,n,o){var s=e.call(this,t,i,o)||this;return s.interaxialDistance=r,s.isStereoscopicSideBySide=n,s.setCameraRigMode(n?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:r}),s}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicUniversalCamera"},t}(Pt);F.a.AddNodeConstructor("VirtualJoysticksCamera",function(e,t){return function(){return new Yt(e,o.x.Zero(),t)}});var Yt=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.inputs.addVirtualJoystick(),n}return l.d(t,e),t.prototype.getClassName=function(){return"VirtualJoysticksCamera"},t}(pt),Kt=function(){function e(){this.compensateDistortion=!0}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 o.j.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 o.j.Translation(-e,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftPreViewMatrix",{get:function(){return o.j.Translation(.5*this.interpupillaryDistance,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightPreViewMatrix",{get:function(){return o.j.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}(),Qt="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 LensCenter;\nuniform vec2 Scale;\nuniform vec2 ScaleIn;\nuniform vec4 HmdWarpParam;\nvec2 HmdWarp(vec2 in01) {\nvec2 theta=(in01-LensCenter)*ScaleIn;\nfloat rSq=theta.x*theta.x+theta.y*theta.y;\nvec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);\nreturn LensCenter+Scale*rvector;\n}\nvoid main(void)\n{\nvec2 tc=HmdWarp(vUV);\nif (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\nelse{\ngl_FragColor=texture2D(textureSampler,tc);\n}\n}";Ct.a.ShadersStore.vrDistortionCorrectionPixelShader=Qt;var qt=function(e){function t(t,i,r,n){var s=e.call(this,t,"vrDistortionCorrection",["LensCenter","Scale","ScaleIn","HmdWarpParam"],null,n.postProcessScaleFactor,i,Ge.a.BILINEAR_SAMPLINGMODE)||this;return s._isRightEye=r,s._distortionFactors=n.distortionK,s._postProcessScaleFactor=n.postProcessScaleFactor,s._lensCenterOffset=n.lensCenterOffset,s.adaptScaleToCurrentViewport=!0,s.onSizeChangedObservable.add(function(){s._scaleIn=new o.w(2,2/s.aspectRatio),s._scaleFactor=new o.w(1/s._postProcessScaleFactor*.5,1/s._postProcessScaleFactor*.5*s.aspectRatio),s._lensCenter=new o.w(s._isRightEye?.5-.5*s._lensCenterOffset:.5+.5*s._lensCenterOffset,.5)}),s.onApplyObservable.add(function(e){e.setFloat2("LensCenter",s._lensCenter.x,s._lensCenter.y),e.setFloat2("Scale",s._scaleFactor.x,s._scaleFactor.y),e.setFloat2("ScaleIn",s._scaleIn.x,s._scaleIn.y),e.setFloat4("HmdWarpParam",s._distortionFactors[0],s._distortionFactors[1],s._distortionFactors[2],s._distortionFactors[3])}),s}return l.d(t,e),t}(Ot);Fe.a._setVRRigMode=function(e,t){var i=t.vrCameraMetrics||Kt.GetDefault();e._rigCameras[0]._cameraRigParams.vrMetrics=i,e._rigCameras[0].viewport=new o.z(0,0,.5,1),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new o.j,e._rigCameras[0]._cameraRigParams.vrHMatrix=i.leftHMatrix,e._rigCameras[0]._cameraRigParams.vrPreViewMatrix=i.leftPreViewMatrix,e._rigCameras[0].getProjectionMatrix=e._rigCameras[0]._getVRProjectionMatrix,e._rigCameras[1]._cameraRigParams.vrMetrics=i,e._rigCameras[1].viewport=new o.z(.5,0,.5,1),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new o.j,e._rigCameras[1]._cameraRigParams.vrHMatrix=i.rightHMatrix,e._rigCameras[1]._cameraRigParams.vrPreViewMatrix=i.rightPreViewMatrix,e._rigCameras[1].getProjectionMatrix=e._rigCameras[1]._getVRProjectionMatrix,i.compensateDistortion&&(e._rigCameras[0]._rigPostProcess=new qt("VR_Distort_Compensation_Left",e._rigCameras[0],!1,i),e._rigCameras[1]._rigPostProcess=new qt("VR_Distort_Compensation_Right",e._rigCameras[1],!0,i))},F.a.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new Zt(e,0,0,1,o.x.Zero(),t)}});var Zt=function(e){function t(t,i,r,n,o,s,a,c){void 0===a&&(a=!0),void 0===c&&(c=Kt.GetDefault());var l=e.call(this,t,i,r,n,o,s)||this;return c.compensateDistortion=a,l.setCameraRigMode(Fe.a.RIG_MODE_VR,{vrCameraMetrics:c}),l.inputs.addVRDeviceOrientation(),l}return l.d(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationArcRotateCamera"},t}(mt);F.a.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new Jt(e,o.x.Zero(),t)}});var Jt=function(e){function t(t,i,r,n,o){void 0===n&&(n=!0),void 0===o&&(o=Kt.GetDefault());var s=e.call(this,t,i,r)||this;return o.compensateDistortion=n,s.setCameraRigMode(Fe.a.RIG_MODE_VR,{vrCameraMetrics:o}),s}return l.d(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationFreeCamera"},t}(gt);F.a.AddNodeConstructor("VRDeviceOrientationGamepadCamera",function(e,t){return function(){return new ei(e,o.x.Zero(),t)}});var $t,ei=function(e){function t(t,i,r,n,o){void 0===n&&(n=!0),void 0===o&&(o=Kt.GetDefault());var s=e.call(this,t,i,r,n,o)||this;return s.inputs.addGamepad(),s}return l.d(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationGamepadCamera"},t}(Jt),ti=i(40);!function(e){e[e.VIVE=0]="VIVE",e[e.OCULUS=1]="OCULUS",e[e.WINDOWS=2]="WINDOWS",e[e.GEAR_VR=3]="GEAR_VR",e[e.DAYDREAM=4]="DAYDREAM",e[e.GENERIC=5]="GENERIC"}($t||($t={}));var ii=function(){function e(){}return e.InitiateController=function(e){for(var t=0,i=this._ControllerFactories;tthis._maxRotationDistFromHeadset){var r=i-(i<0?-this._maxRotationDistFromHeadset:this._maxRotationDistFromHeadset);this._draggedRoomRotation+=r;var n=Math.sin(-r),s=Math.cos(-r);this._calculatedPosition.x=this._calculatedPosition.x*s-this._calculatedPosition.z*n,this._calculatedPosition.z=this._calculatedPosition.x*n+this._calculatedPosition.z*s}}o.x.TransformCoordinatesToRef(this._calculatedPosition,this._deviceToWorld,this.devicePosition),this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix),o.q.FromRotationMatrixToRef(this._workingMatrix,this.deviceRotationQuaternion),this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation),this._mesh&&(this._mesh.position.copyFrom(this.devicePosition),this._mesh.rotationQuaternion&&this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion))},t.prototype.updateFromDevice=function(e){if(e){this.rawPose=e,e.position&&(this._deviceRoomPosition.copyFromFloats(e.position[0],e.position[1],-e.position[2]),this._mesh&&this._mesh.getScene().useRightHandedSystem&&(this._deviceRoomPosition.z*=-1),this._trackPosition&&this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor,this._calculatedPosition),this._calculatedPosition.addInPlace(this.position));var t=this.rawPose;e.orientation&&t.orientation&&(this._deviceRoomRotationQuaternion.copyFromFloats(t.orientation[0],t.orientation[1],-t.orientation[2],-t.orientation[3]),this._mesh&&(this._mesh.getScene().useRightHandedSystem?(this._deviceRoomRotationQuaternion.z*=-1,this._deviceRoomRotationQuaternion.w*=-1):this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion,this._deviceRoomRotationQuaternion)),this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion,this._calculatedRotation))}},t.prototype.attachToMesh=function(e){if(this._mesh&&(this._mesh.parent=null),this._mesh=e,this._poseControlledCamera&&(this._mesh.parent=this._poseControlledCamera),this._mesh.rotationQuaternion||(this._mesh.rotationQuaternion=new o.q),this._updatePoseAndMesh(),this._pointingPoseNode){for(var t=[],i=this._pointingPoseNode;i.parent;)t.push(i.parent),i=i.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 ti.a(o.x.Zero(),new o.x(0,0,1),e);var t=this._pointingPoseNode?this._pointingPoseNode.getWorldMatrix():this.mesh.getWorldMatrix(),i=t.getTranslation(),r=new o.x(0,0,-1),n=o.x.TransformNormal(r,t),s=o.x.Normalize(n);return new ti.a(i,s,e)},t.POINTING_POSE="POINTING_POSE",t}(Xe),ni=i(39);F.a.AddNodeConstructor("Light_Type_3",function(e,t){return function(){return new oi(e,o.x.Zero(),t)}});var oi=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n.groundColor=new o.e(0,0,0),n.direction=i||o.x.Up(),n}return l.d(t,e),t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.getClassName=function(){return"HemisphericLight"},t.prototype.setDirectionToTarget=function(e){return this.direction=o.x.Normalize(e.subtract(o.x.Zero())),this.direction},t.prototype.getShadowGenerator=function(){return null},t.prototype.transferToEffect=function(e,t){var i=o.x.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",i.x,i.y,i.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this},t.prototype.computeWorldMatrix=function(){return this._worldMatrix||(this._worldMatrix=o.j.Identity()),this._worldMatrix},t.prototype.getTypeID=function(){return ni.a.LIGHTTYPEID_HEMISPHERICLIGHT},t.prototype.prepareLightSpecificDefines=function(e,t){e["HEMILIGHT"+t]=!0},l.c([Object(w.e)()],t.prototype,"groundColor",void 0),l.c([Object(w.n)()],t.prototype,"direction",void 0),t}(ni.a);Fe.a._setWebVRRigMode=function(e,t){if(t.vrDisplay){var i=t.vrDisplay.getEyeParameters("left"),r=t.vrDisplay.getEyeParameters("right");e._rigCameras[0].viewport=new o.z(0,0,.5,1),e._rigCameras[0].setCameraRigParameter("left",!0),e._rigCameras[0].setCameraRigParameter("specs",t.specs),e._rigCameras[0].setCameraRigParameter("eyeParameters",i),e._rigCameras[0].setCameraRigParameter("frameData",t.frameData),e._rigCameras[0].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new o.j,e._rigCameras[0].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[0].parent=e,e._rigCameras[0]._getViewMatrix=e._getWebVRViewMatrix,e._rigCameras[1].viewport=new o.z(.5,0,.5,1),e._rigCameras[1].setCameraRigParameter("eyeParameters",r),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 o.j,e._rigCameras[1].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[1].parent=e,e._rigCameras[1]._getViewMatrix=e._getWebVRViewMatrix,Fe.a.UseAlternateWebVRRendering&&(e._rigCameras[1]._skipRendering=!0,e._rigCameras[0]._alternateCamera=e._rigCameras[1])}},F.a.AddNodeConstructor("WebVRFreeCamera",function(e,t){return function(){return new ci(e,o.x.Zero(),t)}}),F.a.AddNodeConstructor("WebVRGamepadCamera",function(e,t){return function(){return new ci(e,o.x.Zero(),t)}});var si,ai,ci=function(e){function t(t,i,r,s){void 0===s&&(s={});var a=e.call(this,t,i,r)||this;a.webVROptions=s,a._vrDevice=null,a.rawPose=null,a._specsVersion="1.1",a._attached=!1,a._descendants=[],a._deviceRoomPosition=o.x.Zero(),a._deviceRoomRotationQuaternion=o.q.Identity(),a._standingMatrix=null,a.devicePosition=o.x.Zero(),a.deviceRotationQuaternion=o.q.Identity(),a.deviceScaleFactor=1,a._deviceToWorld=o.j.Identity(),a._worldToDevice=o.j.Identity(),a.controllers=[],a.onControllersAttachedObservable=new n.c,a.onControllerMeshLoadedObservable=new n.c,a.onPoseUpdatedFromDeviceObservable=new n.c,a._poseSet=!1,a.rigParenting=!0,a._defaultHeight=void 0,a._htmlElementAttached=null,a._detachIfAttached=function(){var e=a.getEngine().getVRDevice();e&&!e.isPresenting&&a._htmlElementAttached&&a.detachControl(a._htmlElementAttached)},a._workingVector=o.x.Zero(),a._oneVector=o.x.One(),a._workingMatrix=o.j.Identity(),a._tmpMatrix=new o.j,a._cache.position=o.x.Zero(),s.defaultHeight&&(a._defaultHeight=s.defaultHeight,a.position.y=a._defaultHeight),a.minZ=.1,5===arguments.length&&(a.webVROptions=arguments[4]),null==a.webVROptions.trackPosition&&(a.webVROptions.trackPosition=!0),null==a.webVROptions.controllerMeshes&&(a.webVROptions.controllerMeshes=!0),null==a.webVROptions.defaultLightingOnControllers&&(a.webVROptions.defaultLightingOnControllers=!0),a.rotationQuaternion=new o.q,a.webVROptions&&a.webVROptions.positionScale&&(a.deviceScaleFactor=a.webVROptions.positionScale);var c=a.getEngine();return a._onVREnabled=function(e){e&&a.initControllers()},c.onVRRequestPresentComplete.add(a._onVREnabled),c.initWebVR().add(function(e){e.vrDisplay&&a._vrDevice!==e.vrDisplay&&(a._vrDevice=e.vrDisplay,a.setCameraRigMode(Fe.a.RIG_MODE_WEBVR,{parentCamera:a,vrDisplay:a._vrDevice,frameData:a._frameData,specs:a._specsVersion}),a._attached&&a.getEngine().enableVR())}),"undefined"!=typeof VRFrameData&&(a._frameData=new VRFrameData),r.onBeforeCameraRenderObservable.add(function(e){e.parent===a&&a.rigParenting&&(a._descendants=a.getDescendants(!0,function(e){var t=a.controllers.some(function(t){return t._mesh===e}),i=-1!==a._rigCameras.indexOf(e);return!t&&!i}),a._descendants.forEach(function(t){t.parent=e}))}),r.onAfterCameraRenderObservable.add(function(e){e.parent===a&&a.rigParenting&&a._descendants.forEach(function(e){e.parent=a})}),a}return l.d(t,e),t.prototype.deviceDistanceToRoomGround=function(){return this._standingMatrix?(this._standingMatrix.getTranslationToRef(this._workingVector),this._deviceRoomPosition.y+this._workingVector.y):this._defaultHeight||0},t.prototype.useStandingMatrix=function(e){var t=this;void 0===e&&(e=function(e){}),this.getEngine().initWebVRAsync().then(function(i){i.vrDisplay&&i.vrDisplay.stageParameters&&i.vrDisplay.stageParameters.sittingToStandingTransform&&t.webVROptions.trackPosition?(t._standingMatrix=new o.j,o.j.FromFloat32ArrayToRefScaled(i.vrDisplay.stageParameters.sittingToStandingTransform,0,1,t._standingMatrix),t.getScene().useRightHandedSystem||t._standingMatrix&&t._standingMatrix.toggleModelMatrixHandInPlace(),e(!0)):e(!1)})},t.prototype.useStandingMatrixAsync=function(){var e=this;return new Promise(function(t){e.useStandingMatrix(function(e){t(e)})})},t.prototype.dispose=function(){this._detachIfAttached(),this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled),this._updateCacheWhenTrackingDisabledObserver&&this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver),e.prototype.dispose.call(this)},t.prototype.getControllerByName=function(e){for(var t=0,i=this.controllers;t=2&&e.onControllersAttachedObservable.notifyObservers(e.controllers)}}})},t}(pt),li=function(e){function t(t){var i=e.call(this,t)||this;return i.onTriggerStateChangedObservable=new n.c,i.onMainButtonStateChangedObservable=new n.c,i.onSecondaryButtonStateChangedObservable=new n.c,i.onPadStateChangedObservable=new n.c,i.onPadValuesChangedObservable=new n.c,i.pad={x:0,y:0},i._changes={pressChanged:!1,touchChanged:!1,valueChanged:!1,changed:!1},i._buttons=new Array(t.buttons.length),i.hand=t.hand,i}return l.d(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\n#include\n#include\nvoid main(void)\n{\nvec4 result=texture2D(textureSampler,vUV);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\n\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;\n}");Ct.a.ShadersStore.imageProcessingPixelShader=pi;var _i=function(e){function t(t,i,r,n,o,s,a,c){void 0===r&&(r=null),void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT);var l=e.call(this,t,"imageProcessing",[],[],i,r,n,o,s,null,a,"postprocess",null,!0)||this;return l._fromLinearSpace=!0,l._defines={IMAGEPROCESSING:!1,VIGNETTE:!1,VIGNETTEBLENDMODEMULTIPLY:!1,VIGNETTEBLENDMODEOPAQUE:!1,TONEMAPPING:!1,TONEMAPPING_ACES:!1,CONTRAST:!1,COLORCURVES:!1,COLORGRADING:!1,COLORGRADING3D:!1,FROMLINEARSPACE:!1,SAMPLER3DGREENDEPTH:!1,SAMPLER3DBGRMAP:!1,IMAGEPROCESSINGPOSTPROCESS:!1,EXPOSURE:!1},c?(c.applyByPostProcess=!0,l._attachImageProcessingConfiguration(c,!0),l.fromLinearSpace=!1):(l._attachImageProcessingConfiguration(null,!0),l.imageProcessingConfiguration.applyByPostProcess=!0),l.onApply=function(e){l.imageProcessingConfiguration.bind(e,l.aspectRatio)},l}return l.d(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e)},enumerable:!0,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e,t){var i=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 r=null,n=this.getEngine(),o=this.getCamera();if(o)r=o.getScene();else if(n&&n.scenes){var s=n.scenes;r=s[s.length-1]}else r=R.a.LastCreatedScene;this._imageProcessingConfiguration=r.imageProcessingConfiguration}this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){i._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,"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 i=["textureSampler"],r=["scale"];hi.a&&(hi.a.PrepareSamplers(i,this._defines),hi.a.PrepareUniforms(r,this._defines)),this.updateEffect(e,r,i)},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)},l.c([Object(w.c)()],t.prototype,"_fromLinearSpace",void 0),t}(Ot),mi=i(13),gi=i(4);de.a._GroundMeshParser=function(e,t){return vi.Parse(e,t)};var vi=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.generateOctree=!1,r}return l.d(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 i=this.getWorldMatrix(),r=o.t.Matrix[5];i.invertToRef(r);var n=o.t.Vector3[8];if(o.x.TransformCoordinatesFromFloatsToRef(e,0,t,r,n),e=n.x,t=n.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 o.x.TransformCoordinatesFromFloatsToRef(0,a,0,i,n),n.y},t.prototype.getNormalAtCoordinates=function(e,t){var i=new o.x(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i},t.prototype.getNormalAtCoordinatesToRef=function(e,t,i){var r=this.getWorldMatrix(),n=o.t.Matrix[5];r.invertToRef(n);var s=o.t.Vector3[8];if(o.x.TransformCoordinatesFromFloatsToRef(e,0,t,n,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 o.x.TransformNormalFromFloatsToRef(a.x,a.y,a.z,r,i),this},t.prototype.updateCoordinateHeights=function(){return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this},t.prototype._getFacetAt=function(e,t){var i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),r=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),n=this._heightQuads[r*this._subdivisionsX+i];return t=l?e.minHeight+(e.maxHeight-e.minHeight)*m:e.minHeight-o.h,n.push(u.x,u.y,u.z),s.push(0,0,0),a.push(i/e.subdivisions,1-t/e.subdivisions)}for(t=0;t=e.minHeight,E=n[3*v+1]>=e.minHeight,x=n[3*y+1]>=e.minHeight;T&&E&&x&&(r.push(g),r.push(v),r.push(y)),n[3*b+1]>=e.minHeight&&T&&x&&(r.push(b),r.push(g),r.push(y))}mi.a.ComputeNormals(n,r,s);var A=new mi.a;return A.indices=r,A.positions=n,A.normals=s,A.uvs=a,A},de.a.CreateGround=function(e,t,i,r,n,o){var s={width:t,height:i,subdivisions:r,updatable:o};return yi.CreateGround(e,s,n)},de.a.CreateTiledGround=function(e,t,i,r,n,o,s,a,c){var l={xmin:t,zmin:i,xmax:r,zmax:n,subdivisions:o,precision:s,updatable:c};return yi.CreateTiledGround(e,l,a)},de.a.CreateGroundFromHeightMap=function(e,t,i,r,n,o,s,a,c,l,u){var h={width:i,height:r,subdivisions:n,minHeight:o,maxHeight:s,updatable:c,onReady:l,alphaFilter:u};return yi.CreateGroundFromHeightMap(e,t,h,a)};var yi=function(){function e(){}return e.CreateGround=function(e,t,i){var r=new vi(e,i);return r._setReady(!1),r._subdivisionsX=t.subdivisionsX||t.subdivisions||1,r._subdivisionsY=t.subdivisionsY||t.subdivisions||1,r._width=t.width||1,r._height=t.height||1,r._maxX=r._width/2,r._maxZ=r._height/2,r._minX=-r._maxX,r._minZ=-r._maxZ,mi.a.CreateGround(t).applyToMesh(r,t.updatable),r._setReady(!0),r},e.CreateTiledGround=function(e,t,i){var r=new de.a(e,i);return mi.a.CreateTiledGround(t).applyToMesh(r,t.updatable),r},e.CreateGroundFromHeightMap=function(e,t,i,r){var n=i.width||10,s=i.height||10,a=i.subdivisions||1,c=i.minHeight||0,l=i.maxHeight||1,u=i.colorFilter||new o.e(.3,.59,.11),h=i.alphaFilter||0,d=i.updatable,f=i.onReady,p=new vi(e,r);p._subdivisionsX=a,p._subdivisionsY=a,p._width=n,p._height=s,p._maxX=p._width/2,p._maxZ=p._height/2,p._minX=-p._maxX,p._minZ=-p._maxZ,p._setReady(!1);return ve.h.LoadImage(t,function(e){var t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("Unable to get 2d context for CreateGroundFromHeightMap");if(!r.isDisposed){var o=e.width,_=e.height;t.width=o,t.height=_,i.drawImage(e,0,0);var m=i.getImageData(0,0,o,_).data;mi.a.CreateGroundFromHeightMap({width:n,height:s,subdivisions:a,minHeight:c,maxHeight:l,colorFilter:u,buffer:m,bufferWidth:o,bufferHeight:_,alphaFilter:h}).applyToMesh(p,d),f&&f(p),p._setReady(!0)}},function(){},r.offlineProvider),p},e}();mi.a.CreateTorus=function(e){for(var t=[],i=[],r=[],n=[],s=e.diameter||1,a=e.thickness||.5,c=e.tessellation||16,l=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE,u=c+1,h=0;h<=c;h++)for(var d=h/c,f=h*Math.PI*2/c-Math.PI/2,p=o.j.Translation(s/2,0,0).multiply(o.j.RotationY(f)),_=0;_<=c;_++){var m=1-_/c,g=_*Math.PI*2/c+Math.PI,v=Math.cos(g),y=Math.sin(g),b=new o.x(v,y,0),T=b.scale(a/2),E=new o.w(d,m);T=o.x.TransformCoordinates(T,p),b=o.x.TransformNormal(b,p),i.push(T.x,T.y,T.z),r.push(b.x,b.y,b.z),n.push(E.x,E.y);var x=(h+1)%u,A=(_+1)%u;t.push(h*u+_),t.push(h*u+A),t.push(x*u+_),t.push(h*u+A),t.push(x*u+A),t.push(x*u+_)}mi.a._ComputeSides(l,i,t,r,n,e.frontUVs,e.backUVs);var P=new mi.a;return P.indices=t,P.positions=i,P.normals=r,P.uvs=n,P},de.a.CreateTorus=function(e,t,i,r,n,o,s){var a={diameter:t,thickness:i,tessellation:r,sideOrientation:s,updatable:o};return bi.CreateTorus(e,a,n)};var bi=function(){function e(){}return e.CreateTorus=function(e,t,i){var r=new de.a(e,i);return t.sideOrientation=de.a._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,mi.a.CreateTorus(t).applyToMesh(r,t.updatable),r},e}(),Ti=i(62),Ei=i(38),xi=function(){function e(e){var t=this;this._scene=e,this._babylonGamepads=[],this._oneGamepadConnected=!1,this._isMonitoring=!1,this.onGamepadDisconnectedObservable=new n.c,Ei.a.IsWindowObjectExist()?(this._gamepadEventSupported="GamepadEvent"in window,this._gamepadSupport=navigator.getGamepads||navigator.webkitGetGamepads||navigator.msGetGamepads||navigator.webkitGamepads):this._gamepadEventSupported=!1,this.onGamepadConnectedObservable=new n.c(function(e){for(var i in t._babylonGamepads){var r=t._babylonGamepads[i];r&&r._isConnected&&t.onGamepadConnectedObservable.notifyObserver(e,r)}}),this._onGamepadConnectedEvent=function(e){var i,r=e.gamepad;r.index in t._babylonGamepads&&t._babylonGamepads[r.index].isConnected||(t._babylonGamepads[r.index]?((i=t._babylonGamepads[r.index]).browserGamepad=r,i._isConnected=!0):i=t._addNewGamepad(r),t.onGamepadConnectedObservable.notifyObservers(i),t._startMonitoringGamepads())},this._onGamepadDisconnectedEvent=function(e){var i=e.gamepad;for(var r in t._babylonGamepads)if(t._babylonGamepads[r].index===i.index){var n=t._babylonGamepads[r];n._isConnected=!1,t.onGamepadDisconnectedObservable.notifyObservers(n);break}},this._gamepadSupport&&(this._updateGamepadObjects(),this._babylonGamepads.length&&this._startMonitoringGamepads(),this._gamepadEventSupported?(window.addEventListener("gamepadconnected",this._onGamepadConnectedEvent,!1),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent,!1)):this._startMonitoringGamepads())}return Object.defineProperty(e.prototype,"gamepads",{get:function(){return this._babylonGamepads},enumerable:!0,configurable:!0}),e.prototype.getGamepadByType=function(e){void 0===e&&(e=Xe.XBOX);for(var t=0,i=this._babylonGamepads;t=0){r=i[n],this.webVRController._pointingPoseNode=r;break}this._laserPointer.parent=r},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}(Pi),Si=function(e){function t(t,i){var r=e.call(this,i)||this;return r.getCamera=t,r}return l.d(t,e),t.prototype._getForwardRay=function(e){var t=this.getCamera();return t?t.getForwardRay(e):new ti.a(o.x.Zero(),o.x.Forward())},t}(Pi),Ci=function(){function e(e,t){void 0===t&&(t={});var i=this;if(this.webVROptions=t,this._webVRsupported=!1,this._webVRready=!1,this._webVRrequesting=!1,this._webVRpresenting=!1,this._fullscreenVRpresenting=!1,this.onEnteringVRObservable=new n.c,this.onExitingVRObservable=new n.c,this.onControllerMeshLoadedObservable=new n.c,this._useCustomVRButton=!1,this._teleportationRequested=!1,this._teleportActive=!1,this._floorMeshesCollection=[],this._rotationAllowed=!0,this._teleportBackwardsVector=new o.x(0,-1,-1),this._isDefaultTeleportationTarget=!0,this._teleportationFillColor="#444444",this._teleportationBorderColor="#FFFFFF",this._rotationAngle=0,this._haloCenter=new o.x(0,0,0),this._padSensibilityUp=.65,this._padSensibilityDown=.35,this._leftController=null,this._rightController=null,this.onNewMeshSelected=new n.c,this.onNewMeshPicked=new n.c,this.onBeforeCameraTeleport=new n.c,this.onAfterCameraTeleport=new n.c,this.onSelectedMeshUnselected=new n.c,this.teleportationEnabled=!0,this._teleportationInitialized=!1,this._interactionsEnabled=!1,this._interactionsRequested=!1,this._displayGaze=!0,this._displayLaserPointer=!0,this.updateGazeTrackerScale=!0,this.updateGazeTrackerColor=!0,this.requestPointerLockOnFullScreen=!0,this._onResize=function(){i.moveButtonToBottomRight(),i._fullscreenVRpresenting&&i._webVRready&&i.exitVR()},this._onFullscreenChange=function(){void 0!==document.fullscreen?i._fullscreenVRpresenting=document.fullscreen:void 0!==document.mozFullScreen?i._fullscreenVRpresenting=document.mozFullScreen:void 0!==document.webkitIsFullScreen?i._fullscreenVRpresenting=document.webkitIsFullScreen:void 0!==document.msIsFullScreen?i._fullscreenVRpresenting=document.msIsFullScreen:void 0!==document.msFullscreenElement&&(i._fullscreenVRpresenting=document.msFullscreenElement),!i._fullscreenVRpresenting&&i._canvas&&(i.exitVR(),i._useCustomVRButton||(i._btnVR.style.top=i._canvas.offsetTop+i._canvas.offsetHeight-70+"px",i._btnVR.style.left=i._canvas.offsetLeft+i._canvas.offsetWidth-100+"px"))},this._cachedAngularSensibility={angularSensibilityX:null,angularSensibilityY:null,angularSensibility:null},this.beforeRender=function(){i._leftController&&i._leftController._activePointer&&i._castRayAndSelectObject(i._leftController),i._rightController&&i._rightController._activePointer&&i._castRayAndSelectObject(i._rightController),i._noControllerIsActive?i._castRayAndSelectObject(i._cameraGazer):i._cameraGazer._gazeTracker.isVisible=!1},this._onNewGamepadConnected=function(e){if(e.type!==Xe.POSE_ENABLED)e.leftStick&&e.onleftstickchanged(function(e){i._teleportationInitialized&&i.teleportationEnabled&&(!i._leftController&&!i._rightController||i._leftController&&!i._leftController._activePointer&&i._rightController&&!i._rightController._activePointer)&&(i._checkTeleportWithRay(e,i._cameraGazer),i._checkTeleportBackwards(e,i._cameraGazer))}),e.rightStick&&e.onrightstickchanged(function(e){i._teleportationInitialized&&i._checkRotate(e,i._cameraGazer)}),e.type===Xe.XBOX&&(e.onbuttondown(function(e){i._interactionsEnabled&&e===si.A&&i._cameraGazer._selectionPointerDown()}),e.onbuttonup(function(e){i._interactionsEnabled&&e===si.A&&i._cameraGazer._selectionPointerUp()}));else{var t=e,r=new Ri(t,i._scene,i._cameraGazer._gazeTracker);"right"===t.hand||i._leftController&&i._leftController.webVRController!=t?i._rightController=r:i._leftController=r,i._tryEnableInteractionOnController(r)}},this._tryEnableInteractionOnController=function(e){i._interactionsRequested&&!e._interactionsEnabled&&i._enableInteractionOnController(e),i._teleportationRequested&&!e._teleportationEnabled&&i._enableTeleportationOnController(e)},this._onNewGamepadDisconnected=function(e){e instanceof li&&("left"===e.hand&&null!=i._leftController&&(i._leftController.dispose(),i._leftController=null),"right"===e.hand&&null!=i._rightController&&(i._rightController.dispose(),i._rightController=null))},this._workingVector=o.x.Zero(),this._workingQuaternion=o.q.Identity(),this._workingMatrix=o.j.Identity(),this._scene=e,this._canvas=e.getEngine().getRenderingCanvas(),void 0===t.createFallbackVRDeviceOrientationFreeCamera&&(t.createFallbackVRDeviceOrientationFreeCamera=!0),void 0===t.createDeviceOrientationCamera&&(t.createDeviceOrientationCamera=!0),void 0===t.laserToggle&&(t.laserToggle=!0),void 0===t.defaultHeight&&(t.defaultHeight=1.7),t.useCustomVRButton&&(this._useCustomVRButton=!0,t.customVRButton&&(this._btnVR=t.customVRButton)),t.rayLength&&(this._rayLength=t.rayLength),this._defaultHeight=t.defaultHeight,t.positionScale&&(this._rayLength*=t.positionScale,this._defaultHeight*=t.positionScale),this._hasEnteredVR=!1,this._scene.activeCamera?this._position=this._scene.activeCamera.position.clone():this._position=new o.x(0,this._defaultHeight,0),t.createDeviceOrientationCamera||!this._scene.activeCamera){if(this._deviceOrientationCamera=new gt("deviceOrientationVRHelper",this._position.clone(),e),this._scene.activeCamera&&(this._deviceOrientationCamera.minZ=this._scene.activeCamera.minZ,this._deviceOrientationCamera.maxZ=this._scene.activeCamera.maxZ,this._scene.activeCamera instanceof ft&&this._scene.activeCamera.rotation)){var r=this._scene.activeCamera;r.rotationQuaternion?this._deviceOrientationCamera.rotationQuaternion.copyFrom(r.rotationQuaternion):this._deviceOrientationCamera.rotationQuaternion.copyFrom(o.q.RotationYawPitchRoll(r.rotation.y,r.rotation.x,r.rotation.z)),this._deviceOrientationCamera.rotation=r.rotation.clone()}this._scene.activeCamera=this._deviceOrientationCamera,this._canvas&&this._scene.activeCamera.attachControl(this._canvas)}else this._existingCamera=this._scene.activeCamera;if(t.createFallbackVRDeviceOrientationFreeCamera&&(this._vrDeviceOrientationCamera=new Jt("VRDeviceOrientationVRHelper",this._position,this._scene,!0,t.vrDeviceOrientationCameraMetrics),this._vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._webVRCamera=new ci("WebVRHelper",this._position,this._scene,t),this._webVRCamera.useStandingMatrix(),this._cameraGazer=new Si(function(){return i.currentVRCamera},e),!this._useCustomVRButton){this._btnVR=document.createElement("BUTTON"),this._btnVR.className="babylonVRicon",this._btnVR.id="babylonVRiconbtn",this._btnVR.title="Click to switch to VR";".babylonVRicon.vrdisplaypresenting { display: none; }";var s=document.createElement("style");s.appendChild(document.createTextNode(".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }.babylonVRicon.vrdisplaypresenting { display: none; }")),document.getElementsByTagName("head")[0].appendChild(s),this.moveButtonToBottomRight()}this._btnVR&&this._btnVR.addEventListener("click",function(){i.isInVRMode?i.exitVR():i.enterVR()}),window.addEventListener("resize",this._onResize),document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",this._onFullscreenChange,!1),document.onmsfullscreenchange=this._onFullscreenChange,t.createFallbackVRDeviceOrientationFreeCamera?this.displayVRButton():this._scene.getEngine().onVRDisplayChangedObservable.add(function(e){e.vrDisplay&&i.displayVRButton()}),this._onKeyDown=function(e){27===e.keyCode&&i.isInVRMode&&i.exitVR()},document.addEventListener("keydown",this._onKeyDown),this._scene.onPrePointerObservable.add(function(){i.isInVRMode&&(i.exitVR(),i._fullscreenVRpresenting&&i._scene.getEngine().exitFullscreen())},Pe.a.POINTERDOUBLETAP,!1),this._onVRDisplayChanged=function(e){return i.onVRDisplayChanged(e)},this._onVrDisplayPresentChange=function(){return i.onVrDisplayPresentChange()},this._onVRRequestPresentStart=function(){i._webVRrequesting=!0,i.updateButtonVisibility()},this._onVRRequestPresentComplete=function(){i._webVRrequesting=!1,i.updateButtonVisibility()},e.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged),e.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart),e.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete),window.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),e.onDisposeObservable.add(function(){i.dispose()}),this._webVRCamera.onControllerMeshLoadedObservable.add(function(e){return i._onDefaultMeshLoaded(e)}),this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected),this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected),this.updateButtonVisibility(),this._circleEase=new $,this._circleEase.setEasingMode(J.EASINGMODE_EASEINOUT),this.webVROptions.floorMeshes&&this.enableTeleportation({floorMeshes:this.webVROptions.floorMeshes})}return Object.defineProperty(e.prototype,"onEnteringVR",{get:function(){return this.onEnteringVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onExitingVR",{get:function(){return this.onExitingVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onControllerMeshLoaded",{get:function(){return this.onControllerMeshLoadedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"teleportationTarget",{get:function(){return this._teleportationTarget},set:function(e){e&&(e.name="teleportationTarget",this._isDefaultTeleportationTarget=!1,this._teleportationTarget=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gazeTrackerMesh",{get:function(){return this._cameraGazer._gazeTracker},set:function(e){e&&(this._cameraGazer._gazeTracker&&this._cameraGazer._gazeTracker.dispose(),this._leftController&&this._leftController._gazeTracker&&this._leftController._gazeTracker.dispose(),this._rightController&&this._rightController._gazeTracker&&this._rightController._gazeTracker.dispose(),this._cameraGazer._gazeTracker=e,this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(),this._cameraGazer._gazeTracker.isPickable=!1,this._cameraGazer._gazeTracker.isVisible=!1,this._cameraGazer._gazeTracker.name="gazeTracker",this._leftController&&(this._leftController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")),this._rightController&&(this._rightController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftControllerGazeTrackerMesh",{get:function(){return this._leftController?this._leftController._gazeTracker:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightControllerGazeTrackerMesh",{get:function(){return this._rightController?this._rightController._gazeTracker:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayGaze",{get:function(){return this._displayGaze},set:function(e){this._displayGaze=e,e||(this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayLaserPointer",{get:function(){return this._displayLaserPointer},set:function(e){this._displayLaserPointer=e,e?(this._rightController&&this._rightController._activatePointer(),this._leftController&&this._leftController._activatePointer()):(this._rightController&&(this._rightController._deactivatePointer(),this._rightController._gazeTracker.isVisible=!1),this._leftController&&(this._leftController._deactivatePointer(),this._leftController._gazeTracker.isVisible=!1))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deviceOrientationCamera",{get:function(){return this._deviceOrientationCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentVRCamera",{get:function(){return this._webVRready?this._webVRCamera:this._scene.activeCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"webVRCamera",{get:function(){return this._webVRCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vrDeviceOrientationCamera",{get:function(){return this._vrDeviceOrientationCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_teleportationRequestInitiated",{get:function(){return this._cameraGazer._teleportationRequestInitiated||null!==this._leftController&&this._leftController._teleportationRequestInitiated||null!==this._rightController&&this._rightController._teleportationRequestInitiated},enumerable:!0,configurable:!0}),e.prototype._onDefaultMeshLoaded=function(e){this._leftController&&this._leftController.webVRController==e&&e.mesh&&this._leftController._setLaserPointerParent(e.mesh),this._rightController&&this._rightController.webVRController==e&&e.mesh&&this._rightController._setLaserPointerParent(e.mesh);try{this.onControllerMeshLoadedObservable.notifyObservers(e)}catch(e){p.a.Warn("Error in your custom logic onControllerMeshLoaded: "+e)}},Object.defineProperty(e.prototype,"isInVRMode",{get:function(){return this._webVRpresenting||this._fullscreenVRpresenting},enumerable:!0,configurable:!0}),e.prototype.onVrDisplayPresentChange=function(){var e=this._scene.getEngine().getVRDevice();if(e){var t=this._webVRpresenting;this._webVRpresenting=e.isPresenting,t&&!this._webVRpresenting&&this.exitVR()}else p.a.Warn("Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?");this.updateButtonVisibility()},e.prototype.onVRDisplayChanged=function(e){this._webVRsupported=e.vrSupported,this._webVRready=!!e.vrDisplay,this._webVRpresenting=e.vrDisplay&&e.vrDisplay.isPresenting,this.updateButtonVisibility()},e.prototype.moveButtonToBottomRight=function(){this._canvas&&!this._useCustomVRButton&&(this._btnVR.style.top=this._canvas.offsetTop+this._canvas.offsetHeight-70+"px",this._btnVR.style.left=this._canvas.offsetLeft+this._canvas.offsetWidth-100+"px")},e.prototype.displayVRButton=function(){this._useCustomVRButton||this._btnVRDisplayed||(document.body.appendChild(this._btnVR),this._btnVRDisplayed=!0)},e.prototype.updateButtonVisibility=function(){this._btnVR&&!this._useCustomVRButton&&(this._btnVR.className="babylonVRicon",this.isInVRMode?this._btnVR.className+=" vrdisplaypresenting":(this._webVRready&&(this._btnVR.className+=" vrdisplayready"),this._webVRsupported&&(this._btnVR.className+=" vrdisplaysupported"),this._webVRrequesting&&(this._btnVR.className+=" vrdisplayrequesting")))},e.prototype.enterVR=function(){if(this.onEnteringVRObservable)try{this.onEnteringVRObservable.notifyObservers(this)}catch(e){p.a.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=o.q.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(),this.vrDeviceOrientationCamera.angularSensibility=2e3),this.webVRCamera){var e=this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y,t=o.q.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y-e,i=this.webVRCamera.rotationQuaternion.toEulerAngles().y;this.webVRCamera.rotationQuaternion=o.q.FromEulerAngles(0,i+t,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._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._scene.activeCamera&&this._canvas&&this._scene.activeCamera.attachControl(this._canvas),this._interactionsEnabled&&this._scene.registerBeforeRender(this.beforeRender),this._displayLaserPointer&&[this._leftController,this._rightController].forEach(function(e){e&&e._activatePointer()}),this._hasEnteredVR=!0)},e.prototype.exitVR=function(){if(this._hasEnteredVR){if(this.onExitingVRObservable)try{this.onExitingVRObservable.notifyObservers(this)}catch(e){p.a.Warn("Error in your custom logic onExitingVR: "+e)}this._webVRpresenting&&this._scene.getEngine().disableVR(),this._scene.activeCamera&&(this._position=this._scene.activeCamera.position.clone()),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._deviceOrientationCamera?(this._deviceOrientationCamera.position=this._position,this._scene.activeCamera=this._deviceOrientationCamera,this._canvas&&this._scene.activeCamera.attachControl(this._canvas),this._cachedAngularSensibility.angularSensibilityX&&(this._deviceOrientationCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._deviceOrientationCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._deviceOrientationCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)):this._existingCamera&&(this._existingCamera.position=this._position,this._scene.activeCamera=this._existingCamera,this._cachedAngularSensibility.angularSensibilityX&&(this._existingCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._existingCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._existingCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)),this.updateButtonVisibility(),this._interactionsEnabled&&(this._scene.unregisterBeforeRender(this.beforeRender),this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1)),this._scene.getEngine().resize(),[this._leftController,this._rightController].forEach(function(e){e&&e._deactivatePointer()}),this._hasEnteredVR=!1}},Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._scene.activeCamera&&(this._scene.activeCamera.position=e)},enumerable:!0,configurable:!0}),e.prototype.enableInteractions=function(){var e=this;this._interactionsEnabled||(this._interactionsRequested=!0,this._leftController&&this._enableInteractionOnController(this._leftController),this._rightController&&this._enableInteractionOnController(this._rightController),this.raySelectionPredicate=function(t){return t.isVisible&&(t.isPickable||t.name===e._floorMeshName)},this.meshSelectionPredicate=function(){return!0},this._raySelectionPredicate=function(t){return!!(e._isTeleportationFloor(t)||-1===t.name.indexOf("gazeTracker")&&-1===t.name.indexOf("teleportationTarget")&&-1===t.name.indexOf("torusTeleportation"))&&e.raySelectionPredicate(t)},this._interactionsEnabled=!0)},Object.defineProperty(e.prototype,"_noControllerIsActive",{get:function(){return!(this._leftController&&this._leftController._activePointer||this._rightController&&this._rightController._activePointer)},enumerable:!0,configurable:!0}),e.prototype._isTeleportationFloor=function(e){for(var t=0;t-1||this._floorMeshesCollection.push(e))},e.prototype.removeFloorMesh=function(e){if(this._floorMeshesCollection){var t=this._floorMeshesCollection.indexOf(e);-1!==t&&this._floorMeshesCollection.splice(t,1)}},e.prototype.enableTeleportation=function(e){if(void 0===e&&(e={}),!this._teleportationInitialized){this._teleportationRequested=!0,this.enableInteractions(),e.floorMeshName&&(this._floorMeshName=e.floorMeshName),e.floorMeshes&&(this._floorMeshesCollection=e.floorMeshes),null!=this._leftController&&this._enableTeleportationOnController(this._leftController),null!=this._rightController&&this._enableTeleportationOnController(this._rightController);var t=new hi.a;t.vignetteColor=new o.f(0,0,0,0),t.vignetteEnabled=!0,this._postProcessMove=new _i("postProcessMove",1,this._webVRCamera,void 0,void 0,void 0,void 0,t),this._webVRCamera.detachPostProcess(this._postProcessMove),this._teleportationInitialized=!0,this._isDefaultTeleportationTarget&&(this._createTeleportationCircles(),this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor))}},e.prototype._enableInteractionOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled=!0,this.isInVRMode&&this._displayLaserPointer&&e._activatePointer(),this.webVROptions.laserToggle&&e.webVRController.onMainButtonStateChangedObservable.add(function(i){t._displayLaserPointer&&1===i.value&&(e._activePointer?e._deactivatePointer():e._activatePointer(),t.displayGaze&&(e._gazeTracker.isVisible=e._activePointer))}),e.webVRController.onTriggerStateChangedObservable.add(function(i){var r=e;t._noControllerIsActive&&(r=t._cameraGazer),r._pointerDownOnMeshAsked?i.valuet._padSensibilityUp&&r._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 i=o.q.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()),r=this.currentVRCamera.position;this.currentVRCamera.devicePosition&&this.currentVRCamera.deviceRotationQuaternion&&(i=this.currentVRCamera.deviceRotationQuaternion,r=this.currentVRCamera.devicePosition),i.toEulerAnglesToRef(this._workingVector),this._workingVector.z=0,this._workingVector.x=0,o.q.RotationYawPitchRollToRef(this._workingVector.y,this._workingVector.x,this._workingVector.z,this._workingQuaternion),this._workingQuaternion.toRotationMatrix(this._workingMatrix),o.x.TransformCoordinatesToRef(this._teleportBackwardsVector,this._workingMatrix,this._workingVector);var n=new ti.a(r,this._workingVector),s=this._scene.pickWithRay(n,this._raySelectionPredicate);s&&s.pickedPoint&&s.pickedMesh&&this._isTeleportationFloor(s.pickedMesh)&&s.distance<5&&this.teleportCamera(s.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===$t.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(i){t.teleportationEnabled&&(t._checkTeleportBackwards(i,e),t._checkTeleportWithRay(i,e)),t._checkRotate(i,e)}))},e.prototype._createTeleportationCircles=function(){this._teleportationTarget=de.a.CreateGround("teleportationTarget",2,2,2,this._scene),this._teleportationTarget.isPickable=!1;var e=new fi("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 i=new di.a("TextPlaneMaterial",this._scene);i.diffuseTexture=e,this._teleportationTarget.material=i;var r=de.a.CreateTorus("torusTeleportation",.75,.1,25,this._scene,!1);r.isPickable=!1,r.parent=this._teleportationTarget;var n=new N("animationInnerCircle","position.y",30,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CYCLE),o=[];o.push({frame:0,value:0}),o.push({frame:30,value:.4}),o.push({frame:60,value:0}),n.setKeys(o);var s=new le;s.setEasingMode(J.EASINGMODE_EASEINOUT),n.setEasingFunction(s),r.animations=[],r.animations.push(n),this._scene.beginAnimation(r,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 pt){e?this._rotationAngle++:this._rotationAngle--,this.currentVRCamera.animations=[];var i=o.q.FromRotationMatrix(o.j.RotationY(Math.PI/4*this._rotationAngle)),r=new N("animationRotation","rotationQuaternion",90,N.ANIMATIONTYPE_QUATERNION,N.ANIMATIONLOOPMODE_CONSTANT),n=[];n.push({frame:0,value:this.currentVRCamera.rotationQuaternion}),n.push({frame:6,value:i}),r.setKeys(n),r.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(r),this._postProcessMove.animations=[];var s=new N("animationPP","vignetteWeight",90,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CONSTANT),a=[];a.push({frame:0,value:0}),a.push({frame:3,value:4}),a.push({frame:6,value:0}),s.setKeys(a),s.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(s);var c=new N("animationPP2","vignetteStretch",90,N.ANIMATIONTYPE_FLOAT,N.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,i){if(e.pickedPoint){t._teleportationRequestInitiated&&(this._displayTeleportationTarget(),this._haloCenter.copyFrom(e.pickedPoint),this._teleportationTarget.position.copyFrom(e.pickedPoint));var r=this._convertNormalToDirectionOfRay(e.getNormal(!0,!1),i);if(r){var n=o.x.Cross(o.c.Y,r),s=o.x.Cross(r,n);o.x.RotationFromAxisToRef(s,r,n,this._teleportationTarget.rotation)}this._teleportationTarget.position.y+=.1}},e.prototype.teleportCamera=function(e){var t=this;if(this.currentVRCamera instanceof pt){this.webVRCamera.leftCamera?(this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition),this._workingVector.subtractInPlace(this.webVRCamera.position),e.subtractToRef(this._workingVector,this._workingVector)):this._workingVector.copyFrom(e),this.isInVRMode?this._workingVector.y+=this.webVRCamera.deviceDistanceToRoomGround()*this._webVRCamera.deviceScaleFactor:this._workingVector.y+=this._defaultHeight,this.onBeforeCameraTeleport.notifyObservers(this._workingVector),this.currentVRCamera.animations=[];var i=new N("animationCameraTeleportation","position",90,N.ANIMATIONTYPE_VECTOR3,N.ANIMATIONLOOPMODE_CONSTANT),r=[{frame:0,value:this.currentVRCamera.position},{frame:11,value:this._workingVector}];i.setKeys(r),i.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(i),this._postProcessMove.animations=[];var n=new N("animationPP","vignetteWeight",90,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CONSTANT),o=[];o.push({frame:0,value:0}),o.push({frame:5,value:8}),o.push({frame:11,value:0}),n.setKeys(o),this._postProcessMove.animations.push(n);var s=new N("animationPP2","vignetteStretch",90,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CONSTANT),a=[];a.push({frame:0,value:0}),a.push({frame:5,value:10}),a.push({frame:11,value:0}),s.setKeys(a),this._postProcessMove.animations.push(s),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,11,!1,1,function(){t._webVRCamera.detachPostProcess(t._postProcessMove)}),this._scene.beginAnimation(this.currentVRCamera,0,11,!1,1,function(){t.onAfterCameraTeleport.notifyObservers(t._workingVector)}),this._hideTeleportationTarget()}},e.prototype._convertNormalToDirectionOfRay=function(e,t){e&&(Math.acos(o.x.Dot(e,t.direction))e;){var i=this.rigCameras.pop();i&&i.dispose()}},t.prototype._updateForDualEyeDebugging=function(e){void 0===e&&(e=.01),this._updateNumberOfRigCameras(2),this.rigCameras[0].viewport=new o.z(0,0,.5,1),this.rigCameras[0].position.x=-e/2,this.rigCameras[0].outputRenderTarget=null,this.rigCameras[1].viewport=new o.z(.5,0,.5,1),this.rigCameras[1].position.x=e/2,this.rigCameras[1].outputRenderTarget=null},t.prototype.updateFromXRSessionManager=function(e){var i=this;if(!e._currentXRFrame||!e._currentXRFrame.getDevicePose)return!1;var r=e._currentXRFrame.getDevicePose(e._frameOfReference);return!(!r||!r.poseModelMatrix)&&(o.j.FromFloat32ArrayToRefScaled(r.poseModelMatrix,0,1,t._TmpMatrix),this._scene.useRightHandedSystem||t._TmpMatrix.toggleModelMatrixHandInPlace(),t._TmpMatrix.getTranslationToRef(this.position),t._TmpMatrix.getRotationMatrixToRef(t._TmpMatrix),o.q.FromRotationMatrixToRef(t._TmpMatrix,this.rotationQuaternion),this.computeWorldMatrix(),this._updateNumberOfRigCameras(e._currentXRFrame.views.length),e._currentXRFrame.views.forEach(function(t,n){o.j.FromFloat32ArrayToRefScaled(r.getViewMatrix(t),0,1,i.rigCameras[n]._computedViewMatrix),o.j.FromFloat32ArrayToRefScaled(t.projectionMatrix,0,1,i.rigCameras[n]._projectionMatrix),i._scene.useRightHandedSystem||(i.rigCameras[n]._computedViewMatrix.toggleModelMatrixHandInPlace(),i.rigCameras[n]._projectionMatrix.toggleProjectionMatrixHandInPlace());var s=e._xrSession.baseLayer.getViewport(t),a=e._xrSession.baseLayer.framebufferWidth,c=e._xrSession.baseLayer.framebufferHeight;i.rigCameras[n].viewport.width=s.width/a,i.rigCameras[n].viewport.height=s.height/c,i.rigCameras[n].viewport.x=s.x/a,i.rigCameras[n].viewport.y=s.y/c,i.rigCameras[n].outputRenderTarget=e._sessionRenderTargetTexture}),!0)},t._TmpMatrix=new o.j,t}(pt),Oi=i(26),Ii=i(77),Di=i(84),wi=function(e){function t(t,i,r,s,a,c,l,u,h,d,f,p,m){void 0===a&&(a=!0),void 0===c&&(c=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1),void 0===u&&(u=Ge.a.TRILINEAR_SAMPLINGMODE),void 0===h&&(h=!0),void 0===d&&(d=!1),void 0===f&&(f=!1),void 0===p&&(p=_.a.TEXTUREFORMAT_RGBA),void 0===m&&(m=!1);var g=e.call(this,null,r,!s)||this;return g.isCube=l,g.renderParticles=!0,g.renderSprites=!1,g.coordinatesMode=Ge.a.PROJECTION_MODE,g.ignoreCameraViewport=!1,g.onBeforeBindObservable=new n.c,g.onAfterUnbindObservable=new n.c,g.onBeforeRenderObservable=new n.c,g.onAfterRenderObservable=new n.c,g.onClearObservable=new n.c,g._currentRefreshId=-1,g._refreshRate=1,g._samples=1,g.boundingBoxPosition=o.x.Zero(),(r=g.getScene())?(g.renderList=new Array,g._engine=r.getEngine(),g.name=t,g.isRenderTarget=!0,g._initialSizeParameter=i,g._processSizeParameter(i),g._resizeObserver=g.getScene().getEngine().onResizeObservable.add(function(){}),g._generateMipMaps=!!s,g._doNotChangeAspectRatio=a,g._renderingManager=new Di.b(r),g._renderingManager._useSceneAutoClearSetup=!0,f?g:(g._renderTargetOptions={generateMipMaps:s,type:c,format:p,samplingMode:u,generateDepthBuffer:h,generateStencilBuffer:d},u===Ge.a.NEAREST_SAMPLINGMODE&&(g.wrapU=Ge.a.CLAMP_ADDRESSMODE,g.wrapV=Ge.a.CLAMP_ADDRESSMODE),m||(l?(g._texture=r.getEngine().createRenderTargetCubeTexture(g.getRenderSize(),g._renderTargetOptions),g.coordinatesMode=Ge.a.INVCUBIC_MODE,g._textureMatrix=o.j.Identity()):g._texture=r.getEngine().createRenderTargetTexture(g._size,g._renderTargetOptions)),g)):g}return l.d(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,i=e.push;e.push=function(){for(var r=[],n=0;n0&&(this._postProcesses[0].autoClear=!1))}},t.prototype._shouldRender=function(){return-1===this._currentRefreshId?(this._currentRefreshId=1,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)},t.prototype.getRenderSize=function(){return this.getRenderWidth()},t.prototype.getRenderWidth=function(){return this._size.width?this._size.width:this._size},t.prototype.getRenderHeight=function(){return this._size.width?this._size.height:this._size},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.scale=function(e){var t=this.getRenderSize()*e;this.resize(t)},t.prototype.getReflectionTextureMatrix=function(){return this.isCube?this._textureMatrix:e.prototype.getReflectionTextureMatrix.call(this)},t.prototype.resize=function(e){this.releaseInternalTexture();var t=this.getScene();t&&(this._processSizeParameter(e),this.isCube?this._texture=t.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._texture=t.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions))},t.prototype.render=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=!1),a=this.getScene()){var i,r=a.getEngine();if(void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses),this._waitingRenderList){this.renderList=[];for(var n=0;n=0&&this._renderingManager.dispatchParticles(v))}if(this.isCube)for(var b=0;b<6;b++)this.renderToTarget(b,u,e,t),a.incrementRenderId(),a.resetCachedMaterial();else this.renderToTarget(0,u,e,t);this.onAfterUnbindObservable.notifyObservers(this),a.activeCamera&&(this.activeCamera&&this.activeCamera!==a.activeCamera&&a.setTransformMatrix(a.activeCamera.getViewMatrix(),a.activeCamera.getProjectionMatrix(!0)),r.setViewport(a.activeCamera.viewport)),a.resetCachedMaterial()}},t.prototype._bestReflectionRenderTargetDimension=function(e,t){var i=e*t,r=ve.h.NearestPOT(i+16384/(128+i));return Math.min(ve.h.FloorPOT(e),r)},t.prototype.unbindFrameBuffer=function(e,t){var i=this;this._texture&&e.unBindFramebuffer(this._texture,this.isCube,function(){i.onAfterRenderObservable.notifyObservers(t)})},t.prototype.renderToTarget=function(e,t,i,r){var n=this.getScene();if(n){var o=n.getEngine();if(this._texture){this._postProcessManager?this._postProcessManager._prepareFrame(this._texture,this._postProcesses):i&&n.postProcessManager._prepareFrame(this._texture)||this._texture&&o.bindFramebuffer(this._texture,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,this.depthStencilTexture?this.depthStencilTexture:void 0),this.onBeforeRenderObservable.notifyObservers(e),this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(o):o.clear(this.clearColor||n.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||n.updateTransformMatrix(!0);for(var s=0,a=n._beforeRenderTargetDrawStage;s=0&&t.customRenderTargets.splice(i,1);for(var r=0,n=t.cameras;r=0&&o.customRenderTargets.splice(i,1)}e.prototype.dispose.call(this)}},t.prototype._rebuild=function(){this.refreshRate===t.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=t.REFRESHRATE_RENDER_ONCE),this._postProcessManager&&this._postProcessManager._rebuild()},t.prototype.freeRenderingGroups=function(){this._renderingManager&&this._renderingManager.freeRenderingGroups()},t.REFRESHRATE_RENDER_ONCE=0,t.REFRESHRATE_RENDER_ONEVERYFRAME=1,t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2,t}(Ge.a);Ge.a._CreateRenderTargetTexture=function(e,t,i,r){return new wi(e,t,i,r)};var Li,Fi=function(){function e(e){this.scene=e,this.onXRFrameObservable=new n.c,this.onXRSessionEnded=new n.c,this._sessionRenderTargetTexture=null,this._tmpMatrix=new o.j}return e.prototype.initializeAsync=function(){var e=this;return p.a.Warn("The WebXR APIs are still under development and are subject to change in the future."),this._xrNavigator=navigator,this._xrNavigator.xr?this._xrNavigator.xr.requestDevice().then(function(t){return e._xrDevice=t,e.scene.getEngine()._gl.setCompatibleXRDevice(e._xrDevice)}):Promise.reject("webXR not supported by this browser")},e.prototype.enterXRAsync=function(t,i){var r=this;return this._xrDevice.requestSession(t).then(function(e){return r._xrSession=e,r._xrSession.addEventListener("end",function(){r._sessionRenderTargetTexture=null,r.scene.getEngine().restoreDefaultFramebuffer(),r.scene.getEngine().customAnimationFrameRequester=null,r.onXRSessionEnded.notifyObservers(null),r.scene.getEngine()._renderLoop()},{once:!0}),r._xrSession.baseLayer=new XRWebGLLayer(r._xrSession,r.scene.getEngine()._gl),r._xrSession.requestFrameOfReference(i)}).then(function(t){r._frameOfReference=t,r.scene.getEngine().customAnimationFrameRequester={requestAnimationFrame:r._xrSession.requestAnimationFrame.bind(r._xrSession),renderFunction:function(e,t){r._currentXRFrame=t,r.onXRFrameObservable.notifyObservers(null),r.scene.getEngine()._renderLoop()}},r._sessionRenderTargetTexture=e._CreateRenderTargetTextureFromSession(r._xrSession,r.scene),window.cancelAnimationFrame(r.scene.getEngine()._frameHandler),r.scene.getEngine()._renderLoop()})},e.prototype.exitXRAsync=function(){return this._xrSession.end()},e.prototype.environmentPointHitTestAsync=function(e){var t=this;return new Promise(function(i){var r=new Float32Array([e.origin.x,e.origin.y,e.origin.z]),n=new Float32Array([e.direction.x,e.direction.y,e.direction.z]);t.scene.useRightHandedSystem||(r[2]*=-1,n[2]*=-1),t._xrSession.requestHitTest(r,n,t._frameOfReference).then(function(e){if(e.length>0){o.j.FromFloat32ArrayToRefScaled(e[0].hitMatrix,0,1,t._tmpMatrix);var r=t._tmpMatrix.getTranslation();t.scene.useRightHandedSystem||(r.z*=-1),i(r)}else i(null)}).catch(function(){i(null)})})},e.prototype.supportsSessionAsync=function(e){return this._xrDevice.supportsSession(e).then(function(){return!0}).catch(function(){return!1})},e._CreateRenderTargetTextureFromSession=function(e,t){var i=new Oi.a(t.getEngine(),Oi.a.DATASOURCE_UNKNOWN,!0);i.width=e.baseLayer.framebufferWidth,i.height=e.baseLayer.framebufferHeight,i._framebuffer=e.baseLayer.framebuffer;var r=new wi("XR renderTargetTexture",{width:i.width,height:i.height},t,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0);return r._texture=i,r},e.prototype.dispose=function(){this.onXRFrameObservable.clear(),this.onXRSessionEnded.clear()},e}();!function(e){e[e.ENTERING_XR=0]="ENTERING_XR",e[e.EXITING_XR=1]="EXITING_XR",e[e.IN_XR=2]="IN_XR",e[e.NOT_IN_XR=3]="NOT_IN_XR"}(Li||(Li={}));var Ni,Bi=function(){function e(e){this.scene=e,this.state=Li.NOT_IN_XR,this.onStateChangedObservable=new n.c,this._nonVRCamera=null,this._originalSceneAutoClear=!0,this._supported=!1,this.camera=new Mi("",e),this._sessionManager=new Fi(e),this.container=new Le.a("",e),this.camera.parent=this.container}return e.prototype._setState=function(e){this.state=e,this.onStateChangedObservable.notifyObservers(this.state)},e.CreateAsync=function(t){var i=new e(t);return i._sessionManager.initializeAsync().then(function(){return i._supported=!0,i}).catch(function(){return i})},e.prototype.exitXRAsync=function(){return this._setState(Li.EXITING_XR),this._sessionManager.exitXRAsync()},e.prototype.enterXRAsync=function(e,t){var i=this;if(!this._supported)throw"XR session not supported by this browser";return this._setState(Li.ENTERING_XR),this._sessionManager.enterXRAsync(e,t).then(function(){i._originalSceneAutoClear=i.scene.autoClear,i._nonVRCamera=i.scene.activeCamera,i.scene.autoClear=!1,i.scene.activeCamera=i.camera,i._sessionManager.onXRFrameObservable.add(function(){i.camera.updateFromXRSessionManager(i._sessionManager)}),i._sessionManager.onXRSessionEnded.addOnce(function(){i.camera.rigCameras.forEach(function(e){e.outputRenderTarget=null}),i.scene.autoClear=i._originalSceneAutoClear,i.scene.activeCamera=i._nonVRCamera,i._sessionManager.onXRFrameObservable.clear(),i._setState(Li.NOT_IN_XR)}),i._setState(Li.IN_XR)})},e.prototype.environmentPointHitTestAsync=function(e){return this._sessionManager.environmentPointHitTestAsync(e)},e.prototype.setPositionOfCameraUsingContainer=function(t){this.camera.globalPosition.subtractToRef(t,e._TmpVector),this.container.position.subtractInPlace(e._TmpVector)},e.prototype.rotateCameraByQuaternionUsingContainer=function(e){this.container.rotationQuaternion||(this.container.rotationQuaternion=o.q.FromEulerVector(this.container.rotation)),this.container.rotationQuaternion.multiplyInPlace(e),this.container.position.rotateByQuaternionAroundPointToRef(e,this.camera.globalPosition,this.container.position)},e.prototype.supportsSessionAsync=function(e){return this._supported?this._sessionManager.supportsSessionAsync(e):Promise.resolve(!1)},e.prototype.dispose=function(){this.camera.dispose(),this.container.dispose(),this.onStateChangedObservable.clear(),this._sessionManager.dispose()},e._TmpVector=new o.x,e}(),Ui=function(){function e(e,t){this.element=e,this.initializationOptions=t}return e.prototype.update=function(e){},e}(),Vi=function(){return function(){}}(),Gi=function(){function e(e,t){var i=this;if(this.scene=e,this._buttons=[],this._activeButton=null,this.activeButtonChangedObservable=new n.c,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 r=document.createElement("button");r.style.cssText="color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-repeat:no-repeat; background-position: center; outline: none;",r.innerText="HMD",this._buttons.push(new Ui(r,{immersive:!0,outputContext:t.outputCanvasContext})),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",this.element.innerText=e===this?"EXIT":"HMD"};var o=document.createElement("button");o.style.cssText=r.style.cssText,o.innerText="Window",this._buttons.push(new Ui(o,{immersive:!1,environmentIntegration:!0,outputContext:t.outputCanvasContext})),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",this.element.innerText=e===this?"EXIT":"Window"},this._updateButtons(null)}var s=e.getEngine().getRenderingCanvas();s&&s.parentNode&&(s.parentNode.appendChild(this._overlay),e.onDisposeObservable.addOnce(function(){i.dispose()}))}return e.CreateAsync=function(t,i,r){var n=this,o=new e(t,r),s=o._buttons.map(function(e){return i.supportsSessionAsync(e.initializationOptions)});return i.onStateChangedObservable.add(function(e){e==Li.NOT_IN_XR&&o._updateButtons(null)}),Promise.all(s).then(function(e){return e.forEach(function(e,t){e&&(o._overlay.appendChild(o._buttons[t].element),o._buttons[t].element.onclick=function(){return l.b(n,void 0,void 0,function(){return l.e(this,function(e){switch(e.label){case 0:return i.state!=Li.IN_XR?[3,2]:(o._updateButtons(null),[4,i.exitXRAsync()]);case 1:return e.sent(),[2];case 2:return i.state!=Li.NOT_IN_XR?[3,4]:(o._updateButtons(o._buttons[t]),[4,i.enterXRAsync(o._buttons[t].initializationOptions,"eye-level")]);case 3:e.sent(),e.label=4;case 4:return[2]}})})})}),o})},e.prototype._updateButtons=function(e){var t=this;this._activeButton=e,this._buttons.forEach(function(e){e.update(t._activeButton)}),this.activeButtonChangedObservable.notifyObservers(this._activeButton)},e.prototype.dispose=function(){var e=this.scene.getEngine().getRenderingCanvas();e&&e.parentNode&&e.parentNode.contains(this._overlay)&&e.parentNode.removeChild(this._overlay),this.activeButtonChangedObservable.clear()},e}(),ki=function(){function e(e){this.pointer=new Le.a("controllerPointer",e)}return e.prototype.dispose=function(){this.grip&&this.grip.dispose(),this.pointer.dispose()},e}(),zi=function(){function e(e){var t=this;this.helper=e,this.controllers=[],this._tmpMatrix=new o.j,this._frameObserver=e._sessionManager.onXRFrameObservable.add(function(){if(e._sessionManager._currentXRFrame&&e._sessionManager._currentXRFrame.getDevicePose){var i=e._sessionManager._currentXRFrame;e._sessionManager._xrSession.getInputSources().forEach(function(r,n){var s=i.getInputPose(r,e._sessionManager._frameOfReference);if(s){t.controllers.length<=n&&t.controllers.push(new ki(e.container.getScene()));var a=t.controllers[n];s.gripMatrix&&(a.grip||(a.grip=new Le.a("controllerGrip",e.container.getScene())),o.j.FromFloat32ArrayToRefScaled(s.gripMatrix,0,1,t._tmpMatrix),a.grip.getScene().useRightHandedSystem||t._tmpMatrix.toggleModelMatrixHandInPlace(),a.grip.rotationQuaternion||(a.grip.rotationQuaternion=new o.q),t._tmpMatrix.decompose(a.grip.scaling,a.grip.rotationQuaternion,a.grip.position)),o.j.FromFloat32ArrayToRefScaled(s.targetRay.transformMatrix,0,1,t._tmpMatrix),a.pointer.getScene().useRightHandedSystem||t._tmpMatrix.toggleModelMatrixHandInPlace(),a.pointer.rotationQuaternion||(a.pointer.rotationQuaternion=new o.q),t._tmpMatrix.decompose(a.pointer.scaling,a.pointer.rotationQuaternion,a.pointer.position)}})}})}return e.prototype.dispose=function(){this.controllers.forEach(function(e){e.dispose()}),this.helper._sessionManager.onXRFrameObservable.remove(this._frameObserver)},e}(),ji=function(){function e(e,t){var i=this;this._canvas=null,this.canvasContext=null,t||((t=document.createElement("canvas")).style.cssText="position:absolute; bottom:0px;right:0px;z-index:10;width:100%;height:100%;background-color: #000000;"),this._setManagedOutputCanvas(t),e.onStateChangedObservable.add(function(t){t==Li.ENTERING_XR?i._addCanvas():e.state==Li.NOT_IN_XR&&i._removeCanvas()})}return e.prototype.dispose=function(){this._removeCanvas(),this._setManagedOutputCanvas(null)},e.prototype._setManagedOutputCanvas=function(e){this._removeCanvas(),e?(this._canvas=e,this.canvasContext=this._canvas.getContext("xrpresent")):(this._canvas=null,this.canvasContext=null)},e.prototype._addCanvas=function(){this._canvas&&document.body.appendChild(this._canvas)},e.prototype._removeCanvas=function(){this._canvas&&document.body.contains(this._canvas)&&document.body.removeChild(this._canvas)},e}(),Wi=(Ni={root:0,found:!1},function(e,t,i,r){Ni.root=0,Ni.found=!1;var n=t*t-4*e*i;if(n<0)return Ni;var o=Math.sqrt(n),s=(-t-o)/(2*e),a=(-t+o)/(2*e);if(s>a){var c=a;a=s,s=c}return s>0&&s0&&a=0))},e.prototype._canDoCollision=function(e,t,i,r){var n=o.x.Distance(this._basePointWorld,e),s=Math.max(this._radius.x,this._radius.y,this._radius.z);return!(n>this._velocityWorldLength+s+t)&&!!function(e,t,i,r){return!(e.x>i.x+r||i.x-r>t.x||e.y>i.y+r||i.y-r>t.y||e.z>i.z+r||i.z-r>t.z)}(i,r,this._basePointWorld,this._velocityWorldLength+s)},e.prototype._testTriangle=function(e,t,i,r,n,s){var a,c=!1;t||(t=[]),t[e]||(t[e]=new o.n(0,0,0,0),t[e].copyFromPoints(i,r,n));var l=t[e];if(s||l.isFrontFacingTo(this._normalizedVelocity,0)){var u=l.signedDistanceTo(this._basePoint),h=o.x.Dot(l.normal,this._velocity);if(0==h){if(Math.abs(u)>=1)return;c=!0,a=0}else{var d=(1-u)/h;if((a=(-1-u)/h)>d){var f=d;d=a,a=f}if(a>1||d<0)return;a<0&&(a=0),a>1&&(a=1)}this._collisionPoint.copyFromFloats(0,0,0);var p=!1,_=1;if(c||(this._basePoint.subtractToRef(l.normal,this._planeIntersectionPoint),this._velocity.scaleToRef(a,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,i,r,n,l.normal)&&(p=!0,_=a,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!p){var m=this._velocity.lengthSquared(),g=m;this._basePoint.subtractToRef(i,this._tempVector);var v=2*o.x.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,b=Wi(g,v,y,_);b.found&&(_=b.root,p=!0,this._collisionPoint.copyFrom(i)),this._basePoint.subtractToRef(r,this._tempVector),v=2*o.x.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(b=Wi(g,v,y,_)).found&&(_=b.root,p=!0,this._collisionPoint.copyFrom(r)),this._basePoint.subtractToRef(n,this._tempVector),v=2*o.x.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(b=Wi(g,v,y,_)).found&&(_=b.root,p=!0,this._collisionPoint.copyFrom(n)),r.subtractToRef(i,this._edge),i.subtractToRef(this._basePoint,this._baseToVertex);var T=this._edge.lengthSquared(),E=o.x.Dot(this._edge,this._velocity),x=o.x.Dot(this._edge,this._baseToVertex);if(g=T*-m+E*E,v=T*(2*o.x.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=Wi(g,v,y,_)).found){var A=(E*b.root-x)/T;A>=0&&A<=1&&(_=b.root,p=!0,this._edge.scaleInPlace(A),i.addToRef(this._edge,this._collisionPoint))}n.subtractToRef(r,this._edge),r.subtractToRef(this._basePoint,this._baseToVertex),T=this._edge.lengthSquared(),E=o.x.Dot(this._edge,this._velocity),x=o.x.Dot(this._edge,this._baseToVertex),g=T*-m+E*E,v=T*(2*o.x.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=Wi(g,v,y,_)).found&&(A=(E*b.root-x)/T)>=0&&A<=1&&(_=b.root,p=!0,this._edge.scaleInPlace(A),r.addToRef(this._edge,this._collisionPoint)),i.subtractToRef(n,this._edge),n.subtractToRef(this._basePoint,this._baseToVertex),T=this._edge.lengthSquared(),E=o.x.Dot(this._edge,this._velocity),x=o.x.Dot(this._edge,this._baseToVertex),g=T*-m+E*E,v=T*(2*o.x.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=Wi(g,v,y,_)).found&&(A=(E*b.root-x)/T)>=0&&A<=1&&(_=b.root,p=!0,this._edge.scaleInPlace(A),n.addToRef(this._edge,this._collisionPoint))}if(p){var P=_*this._velocity.length();(!this.collisionFound||P=r)n.copyFrom(e);else{var a=o?o.collisionMask:i.collisionMask;i._initialize(e,t,s);for(var c=0;cthis.capacity&&this._depth-1&&this.entries.splice(i,1)}},e.prototype.addEntries=function(e){for(var t=0;te.occlusionRetryCount))return!1;e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=e.occlusionType!==Le.a.OCCLUSION_TYPE_OPTIMISTIC&&e.isOccluded}var r=this.getScene();if(r.getBoundingBoxRenderer){var n=r.getBoundingBoxRenderer();this._occlusionQuery||(this._occlusionQuery=t.createQuery()),t.beginOcclusionQuery(e.occlusionQueryAlgorithmType,this._occlusionQuery),n.renderOcclusionBoundingBox(this),t.endOcclusionQuery(e.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0}return e.isOccluded};_e.b.prototype.createTransformFeedback=function(){return this._gl.createTransformFeedback()},_e.b.prototype.deleteTransformFeedback=function(e){this._gl.deleteTransformFeedback(e)},_e.b.prototype.bindTransformFeedback=function(e){this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK,e)},_e.b.prototype.beginTransformFeedback=function(e){void 0===e&&(e=!0),this._gl.beginTransformFeedback(e?this._gl.POINTS:this._gl.TRIANGLES)},_e.b.prototype.endTransformFeedback=function(){this._gl.endTransformFeedback()},_e.b.prototype.setTranformFeedbackVaryings=function(e,t){this._gl.transformFeedbackVaryings(e,t,this._gl.INTERLEAVED_ATTRIBS)},_e.b.prototype.bindTransformFeedbackBuffer=function(e){this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER,0,e)};var ar=function(){function e(){}return e.COPY=1,e.CUT=2,e.PASTE=3,e}(),cr=function(){function e(e,t){this.type=e,this.event=t}return e.GetTypeFromCharacter=function(e){switch(e){case 67:return ar.COPY;case 86:return ar.PASTE;case 88:return ar.CUT;default:return-1}},e}(),lr=i(58),ur=i(53),hr=function(){function e(e,t,i){this.lengthComputable=e,this.loaded=t,this.total=i}return e.FromProgressEvent=function(t){return new e(t.lengthComputable,t.loaded,t.total)},e}(),dr=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return ur.a.ForceFullSceneLoadingForIncremental},set:function(e){ur.a.ForceFullSceneLoadingForIncremental=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return ur.a.ShowLoadingScreen},set:function(e){ur.a.ShowLoadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return ur.a.loggingLevel},set:function(e){ur.a.loggingLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return ur.a.CleanBoneMatrixWeights},set:function(e){ur.a.CleanBoneMatrixWeights=e},enumerable:!0,configurable:!0}),e._getDefaultPlugin=function(){return e._registeredPlugins[".babylon"]},e._getPluginForExtension=function(t){var i=e._registeredPlugins[t];return i||(p.a.Warn("Unable to find a plugin to load "+t+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: http://doc.babylonjs.com/how_to/load_from_any_file_type"),e._getDefaultPlugin())},e._getPluginForDirectLoad=function(t){for(var i in e._registeredPlugins){var r=e._registeredPlugins[i].plugin;if(r.canDirectLoad&&r.canDirectLoad(t))return e._registeredPlugins[i]}return e._getDefaultPlugin()},e._getPluginForFilename=function(t){var i=t.indexOf("?");-1!==i&&(t=t.substring(0,i));var r=t.lastIndexOf("."),n=t.substring(r,t.length).toLowerCase();return e._getPluginForExtension(n)},e._getDirectLoad=function(e){return"data:"===e.substr(0,5)?e.substr(5):null},e._loadData=function(t,i,r,n,o,s,a){var c,l=e._getDirectLoad(t.name),u=a?e._getPluginForExtension(a):l?e._getPluginForDirectLoad(t.name):e._getPluginForFilename(t.name);if(!(c=u.plugin.createPlugin?u.plugin.createPlugin():u.plugin))throw"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.";var h,d=u.isBinary;e.OnPluginActivatedObservable.notifyObservers(c);var f=function(e,t){i.isDisposed?o("Scene has been disposed"):(i.offlineProvider=h,r(c,e,t))},p=null,_=!1,m=c.onDisposeObservable;m&&m.add(function(){_=!0,p&&(p.abort(),p=null),s()});var g=function(){_||(p=ve.h.LoadFile(t.url,f,n?function(e){n(hr.FromProgressEvent(e))}:void 0,h,d,function(e,t){o("Failed to load scene."+(t?" "+t.message:""),t)}))};if(l)return f(l),c;var v=t.file||lr.a.FilesToLoad[t.name.toLowerCase()];if(-1===t.rootUrl.indexOf("file:")||-1!==t.rootUrl.indexOf("file:")&&!v){var y=i.getEngine(),b=y.enableOfflineSupport;if(b){for(var T=!1,E=0,x=i.disableOfflineSupportExceptionRules;Es.snapDistance?(r=Math.floor(Math.abs(h)/s.snapDistance),h<0&&(r*=-1),h%=s.snapDistance,d.scaleToRef(s.snapDistance*r,d),i=!0):d.scaleInPlace(0)),s.attachedMesh.scaling.addInPlace(d),i&&(f.snapDistance=s.snapDistance*r,s.onSnapObservable.notifyObservers(f))}}),s._pointerObserver=r.utilityLayerScene.onPointerObservable.add(function(e){if(!s._customMeshSet){var t=e.pickInfo&&-1!=s._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?a:s._coloredMaterial;s._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),s}return l.d(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this)},t.prototype.setCustomMesh=function(t,i){var r=this;void 0===i&&(i=!1),e.prototype.setCustomMesh.call(this,t),i&&(this._rootMesh.getChildMeshes().forEach(function(e){e.material=r._coloredMaterial,e.color&&(e.color=r._coloredMaterial.emissiveColor)}),this._customMeshSet=!1)},t}(xr.a),Rr=i(55),Sr=function(e){function t(t,i){void 0===t&&(t=o.e.Gray()),void 0===i&&(i=Ar.a.DefaultKeepDepthUtilityLayer);var r=e.call(this,i)||this;r._boundingDimensions=new o.x(1,1,1),r._renderObserver=null,r._pointerObserver=null,r._scaleDragSpeed=.2,r._tmpQuaternion=new o.q,r._tmpVector=new o.x(0,0,0),r._tmpRotationMatrix=new o.j,r.ignoreChildren=!1,r.includeChildPredicate=null,r.rotationSphereSize=.1,r.scaleBoxSize=.1,r.fixedDragMeshScreenSize=!1,r.fixedDragMeshScreenSizeDistanceFactor=10,r.onDragStartObservable=new n.c,r.onScaleBoxDragObservable=new n.c,r.onScaleBoxDragEndObservable=new n.c,r.onRotationSphereDragObservable=new n.c,r.onRotationSphereDragEndObservable=new n.c,r.scalePivot=null,r._existingMeshScale=new o.x,r._dragMesh=null,r.pointerDragBehavior=new De.a,r._updateScale=!1,r._anchorMesh=new Le.a("anchor",i.utilityLayerScene);var s=new di.a("",i.utilityLayerScene);s.disableLighting=!0,s.emissiveColor=t;var a=new di.a("",i.utilityLayerScene);a.disableLighting=!0,a.emissiveColor=t.clone().add(new o.e(.3,.3,.3)),r._lineBoundingBox=new Le.a("",i.utilityLayerScene),r._lineBoundingBox.rotationQuaternion=new o.q;var c=[];c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,0),new o.x(r._boundingDimensions.x,0,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,0),new o.x(0,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,0),new o.x(0,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,0,0),new o.x(r._boundingDimensions.x,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,0,0),new o.x(r._boundingDimensions.x,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,r._boundingDimensions.y,0),new o.x(r._boundingDimensions.x,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,r._boundingDimensions.y,0),new o.x(0,r._boundingDimensions.y,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,r._boundingDimensions.z),new o.x(r._boundingDimensions.x,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,r._boundingDimensions.z),new o.x(0,r._boundingDimensions.y,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,r._boundingDimensions.y,r._boundingDimensions.z),new o.x(0,r._boundingDimensions.y,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,r._boundingDimensions.y,r._boundingDimensions.z),new o.x(r._boundingDimensions.x,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,r._boundingDimensions.y,r._boundingDimensions.z),new o.x(r._boundingDimensions.x,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.forEach(function(e){e.color=t,e.position.addInPlace(new o.x(-r._boundingDimensions.x/2,-r._boundingDimensions.y/2,-r._boundingDimensions.z/2)),e.isPickable=!1,r._lineBoundingBox.addChild(e)}),r._rootMesh.addChild(r._lineBoundingBox),r._rotateSpheresParent=new Le.a("",i.utilityLayerScene),r._rotateSpheresParent.rotationQuaternion=new o.q;for(var l=function(e){var t=Rr.a.CreateSphere("",{diameter:1},i.utilityLayerScene);t.rotationQuaternion=new o.q,t.material=s,(_=new De.a({})).moveAttached=!1,_.updateDragPlane=!1,t.addBehavior(_);var n=new o.x(1,0,0),a=0;_.onDragStartObservable.add(function(){n.copyFrom(t.forward),a=0}),_.onDragObservable.add(function(t){if(r.onRotationSphereDragObservable.notifyObservers({}),r.attachedMesh){var i=r.attachedMesh.parent;if(i&&i.scaling&&i.scaling.isNonUniformWithinEpsilon(.001))return void p.a.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");Ne.a._RemoveAndStorePivotPoint(r.attachedMesh);var s=n,c=t.dragPlaneNormal.scale(o.x.Dot(t.dragPlaneNormal,s)),l=s.subtract(c).normalizeToNew(),u=o.x.Dot(l,t.delta)<0?Math.abs(t.delta.length()):-Math.abs(t.delta.length());u=u/r._boundingDimensions.length()*r._anchorMesh.scaling.length(),r.attachedMesh.rotationQuaternion||(r.attachedMesh.rotationQuaternion=o.q.RotationYawPitchRoll(r.attachedMesh.rotation.y,r.attachedMesh.rotation.x,r.attachedMesh.rotation.z)),r._anchorMesh.rotationQuaternion||(r._anchorMesh.rotationQuaternion=o.q.RotationYawPitchRoll(r._anchorMesh.rotation.y,r._anchorMesh.rotation.x,r._anchorMesh.rotation.z)),a+=u,Math.abs(a)<=2*Math.PI&&(e>=8?o.q.RotationYawPitchRollToRef(0,0,u,r._tmpQuaternion):e>=4?o.q.RotationYawPitchRollToRef(u,0,0,r._tmpQuaternion):o.q.RotationYawPitchRollToRef(0,u,0,r._tmpQuaternion),r._anchorMesh.addChild(r.attachedMesh),r._anchorMesh.rotationQuaternion.multiplyToRef(r._tmpQuaternion,r._anchorMesh.rotationQuaternion),r._anchorMesh.removeChild(r.attachedMesh),r.attachedMesh.setParent(i)),r.updateBoundingBox(),Ne.a._RestorePivotPoint(r.attachedMesh)}r._updateDummy()}),_.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({}),r._selectNode(t)}),_.onDragEndObservable.add(function(){r.onRotationSphereDragEndObservable.notifyObservers({}),r._selectNode(null),r._updateDummy()}),u._rotateSpheresParent.addChild(t)},u=this,h=0;h<12;h++)l(h);r._rootMesh.addChild(r._rotateSpheresParent),r._scaleBoxesParent=new Le.a("",i.utilityLayerScene),r._scaleBoxesParent.rotationQuaternion=new o.q;for(var d=0;d<2;d++)for(var f=0;f<2;f++)for(var _,m=function(){var e=Tr.a.CreateBox("",{size:1},i.utilityLayerScene);e.material=s;var t=new o.x(0==d?-1:1,0==f?-1:1,0==v?-1:1);(_=new De.a({dragAxis:t})).moveAttached=!1,e.addBehavior(_),_.onDragObservable.add(function(t){if(r.onScaleBoxDragObservable.notifyObservers({}),r.attachedMesh){var i=r.attachedMesh.parent;if(i&&i.scaling&&i.scaling.isNonUniformWithinEpsilon(.001))return void p.a.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");Ne.a._RemoveAndStorePivotPoint(r.attachedMesh);var n=t.dragDistance/r._boundingDimensions.length()*r._anchorMesh.scaling.length(),s=new o.x(n,n,n);s.scaleInPlace(r._scaleDragSpeed),r.updateBoundingBox(),r.scalePivot?(r.attachedMesh.getWorldMatrix().getRotationMatrixToRef(r._tmpRotationMatrix),r._boundingDimensions.scaleToRef(.5,r._tmpVector),o.x.TransformCoordinatesToRef(r._tmpVector,r._tmpRotationMatrix,r._tmpVector),r._anchorMesh.position.subtractInPlace(r._tmpVector),r._boundingDimensions.multiplyToRef(r.scalePivot,r._tmpVector),o.x.TransformCoordinatesToRef(r._tmpVector,r._tmpRotationMatrix,r._tmpVector),r._anchorMesh.position.addInPlace(r._tmpVector)):(e.absolutePosition.subtractToRef(r._anchorMesh.position,r._tmpVector),r._anchorMesh.position.subtractInPlace(r._tmpVector)),r._anchorMesh.addChild(r.attachedMesh),r._anchorMesh.scaling.addInPlace(s),(r._anchorMesh.scaling.x<0||r._anchorMesh.scaling.y<0||r._anchorMesh.scaling.z<0)&&r._anchorMesh.scaling.subtractInPlace(s),r._anchorMesh.removeChild(r.attachedMesh),r.attachedMesh.setParent(i),Ne.a._RestorePivotPoint(r.attachedMesh)}r._updateDummy()}),_.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({}),r._selectNode(e)}),_.onDragEndObservable.add(function(){r.onScaleBoxDragEndObservable.notifyObservers({}),r._selectNode(null),r._updateDummy()}),g._scaleBoxesParent.addChild(e)},g=this,v=0;v<2;v++)m();r._rootMesh.addChild(r._scaleBoxesParent);var y=new Array;return r._pointerObserver=i.utilityLayerScene.onPointerObservable.add(function(e){y[e.event.pointerId]?e.pickInfo&&e.pickInfo.pickedMesh!=y[e.event.pointerId]&&(y[e.event.pointerId].material=s,delete y[e.event.pointerId]):r._rotateSpheresParent.getChildMeshes().concat(r._scaleBoxesParent.getChildMeshes()).forEach(function(t){e.pickInfo&&e.pickInfo.pickedMesh==t&&(y[e.event.pointerId]=t,t.material=a)})}),r._renderObserver=r.gizmoLayer.originalScene.onBeforeRenderObservable.add(function(){r.attachedMesh&&!r._existingMeshScale.equals(r.attachedMesh.scaling)?r.updateBoundingBox():r.fixedDragMeshScreenSize&&(r._updateRotationSpheres(),r._updateScaleBoxes()),r._dragMesh&&r.attachedMesh&&r.pointerDragBehavior.dragging&&(r._lineBoundingBox.position.rotateByQuaternionToRef(r._rootMesh.rotationQuaternion,r._tmpVector),r.attachedMesh.setAbsolutePosition(r._dragMesh.position.add(r._tmpVector.scale(-1))))}),r.updateBoundingBox(),r}return l.d(t,e),t.prototype._attachedMeshChanged=function(e){var t=this;if(e){Ne.a._RemoveAndStorePivotPoint(e);var i=e.parent;this._anchorMesh.addChild(e),this._anchorMesh.removeChild(e),e.setParent(i),Ne.a._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){Ne.a._RemoveAndStorePivotPoint(this.attachedMesh);var e=this.attachedMesh.parent;this.attachedMesh.setParent(null),this._update(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=o.q.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._anchorMesh.rotationQuaternion||(this._anchorMesh.rotationQuaternion=o.q.RotationYawPitchRoll(this._anchorMesh.rotation.y,this._anchorMesh.rotation.x,this._anchorMesh.rotation.z)),this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpVector.copyFrom(this.attachedMesh.position),this.attachedMesh.rotationQuaternion.set(0,0,0,1),this.attachedMesh.position.set(0,0,0);var t=this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren,this.includeChildPredicate);t.max.subtractToRef(t.min,this._boundingDimensions),this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions),this._lineBoundingBox.position.set((t.max.x+t.min.x)/2,(t.max.y+t.min.y)/2,(t.max.z+t.min.z)/2),this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position),this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position),this._lineBoundingBox.computeWorldMatrix(),this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition),this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion),this.attachedMesh.position.copyFrom(this._tmpVector),this.attachedMesh.setParent(e)}this._updateRotationSpheres(),this._updateScaleBoxes(),this.attachedMesh&&(this._existingMeshScale.copyFrom(this.attachedMesh.scaling),Ne.a._RestorePivotPoint(this.attachedMesh))},t.prototype._updateRotationSpheres=function(){for(var e=this._rotateSpheresParent.getChildMeshes(),t=0;t<3;t++)for(var i=0;i<2;i++)for(var r=0;r<2;r++){var n=4*t+2*i+r;if(0==t&&(e[n].position.set(this._boundingDimensions.x/2,this._boundingDimensions.y*i,this._boundingDimensions.z*r),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[n].lookAt(o.x.Cross(e[n].position.normalizeToNew(),o.x.Right()).normalizeToNew().add(e[n].position))),1==t&&(e[n].position.set(this._boundingDimensions.x*i,this._boundingDimensions.y/2,this._boundingDimensions.z*r),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[n].lookAt(o.x.Cross(e[n].position.normalizeToNew(),o.x.Up()).normalizeToNew().add(e[n].position))),2==t&&(e[n].position.set(this._boundingDimensions.x*i,this._boundingDimensions.y*r,this._boundingDimensions.z/2),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[n].lookAt(o.x.Cross(e[n].position.normalizeToNew(),o.x.Forward()).normalizeToNew().add(e[n].position))),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[n].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var s=this.rotationSphereSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[n].scaling.set(s,s,s)}else e[n].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 i=0;i<2;i++)for(var r=0;r<2;r++){var n=4*t+2*i+r;if(e[n])if(e[n].position.set(this._boundingDimensions.x*t,this._boundingDimensions.y*i,this._boundingDimensions.z*r),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[n].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var s=this.scaleBoxSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[n].scaling.set(s,s,s)}else e[n].scaling.set(this.scaleBoxSize,this.scaleBoxSize,this.scaleBoxSize)}},t.prototype.setEnabledRotationAxis=function(e){this._rotateSpheresParent.getChildMeshes().forEach(function(t,i){i<4?t.setEnabled(-1!=e.indexOf("x")):i<8?t.setEnabled(-1!=e.indexOf("y")):t.setEnabled(-1!=e.indexOf("z"))})},t.prototype.setEnabledScaling=function(e){this._scaleBoxesParent.getChildMeshes().forEach(function(t,i){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=de.a.CreateBox("dummy",1,this.gizmoLayer.utilityLayerScene),this._dragMesh.visibility=0,this._dragMesh.rotationQuaternion=new o.q,this.pointerDragBehavior.useObjectOrienationForDragging=!1,this._dragMesh.addBehavior(this.pointerDragBehavior)},t.prototype.dispose=function(){this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver),this._lineBoundingBox.dispose(),this._rotateSpheresParent.dispose(),this._scaleBoxesParent.dispose(),this._dragMesh&&this._dragMesh.dispose(),e.prototype.dispose.call(this)},t.MakeNotPickableAndWrapInBoundingBox=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach(function(e){t(e)})};t(e),e.rotationQuaternion||(e.rotationQuaternion=o.q.RotationYawPitchRoll(e.rotation.y,e.rotation.x,e.rotation.z));var i=e.position.clone(),r=e.rotationQuaternion.clone();e.rotationQuaternion.set(0,0,0,1),e.position.set(0,0,0);var n=Tr.a.CreateBox("box",{size:1},e.getScene()),s=e.getHierarchyBoundingVectors();return s.max.subtractToRef(s.min,n.scaling),0===n.scaling.y&&(n.scaling.y=o.h),0===n.scaling.x&&(n.scaling.x=o.h),0===n.scaling.z&&(n.scaling.z=o.h),n.position.set((s.max.x+s.min.x)/2,(s.max.y+s.min.y)/2,(s.max.z+s.min.z)/2),e.addChild(n),e.rotationQuaternion.copyFrom(r),e.position.copyFrom(i),e.removeChild(n),n.addChild(e),n.visibility=0,n},t.prototype.setCustomMesh=function(e){p.a.Error("Custom meshes are not supported on this gizmo")},t}(xr.a),Cr=function(e){function t(t,i,r,s){void 0===i&&(i=o.e.Gray()),void 0===r&&(r=Ar.a.DefaultUtilityLayer),void 0===s&&(s=32);var a=e.call(this,r)||this;a._pointerObserver=null,a.snapDistance=0,a.onSnapObservable=new n.c;var c=new di.a("",r.utilityLayerScene);c.disableLighting=!0,c.emissiveColor=i;var l=new di.a("",r.utilityLayerScene);l.disableLighting=!0,l.emissiveColor=i.add(new o.e(.3,.3,.3));for(var u=new Le.a("",r.utilityLayerScene),h=new Array,d=0;d0&&(g.scaleInPlace(-1),v.scaleInPlace(-1))}o.x.Dot(v,s)>0&&(l=-l);var h=!1;if(0!=a.snapDistance)if(b+=l,Math.abs(b)>a.snapDistance){var d=Math.floor(Math.abs(b)/a.snapDistance);b<0&&(d*=-1),b%=a.snapDistance,l=a.snapDistance*d,h=!0}else l=0;T.reset(),a.attachedMesh.parent&&(a.attachedMesh.parent.computeWorldMatrix().invertToRef(T),T.getRotationMatrixToRef(T),o.x.TransformCoordinatesToRef(g,T,g));var f=Math.sin(l/2);x.set(g.x*f,g.y*f,g.z*f,Math.cos(l/2)),T.determinant()>0&&(x.toEulerAnglesToRef(E),o.q.RotationYawPitchRollToRef(E.y,-E.x,-E.z,x)),a.updateGizmoRotationToMatchAttachedMesh?a.attachedMesh.rotationQuaternion.multiplyToRef(x,a.attachedMesh.rotationQuaternion):x.multiplyToRef(a.attachedMesh.rotationQuaternion,a.attachedMesh.rotationQuaternion),_.copyFrom(e.dragPlanePoint),h&&(y.snapDistance=l,a.onSnapObservable.notifyObservers(y))}}),a._pointerObserver=r.utilityLayerScene.onPointerObservable.add(function(e){if(!a._customMeshSet){var t=e.pickInfo&&-1!=a._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?l:c;a._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),a}return l.d(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this)},t}(xr.a),Mr=function(e){function t(t,i){void 0===t&&(t=Ar.a.DefaultUtilityLayer),void 0===i&&(i=32);var r=e.call(this,t)||this;return r.onDragStartObservable=new n.c,r.onDragEndObservable=new n.c,r.xGizmo=new Cr(new o.x(1,0,0),o.e.Red().scale(.5),t,i),r.yGizmo=new Cr(new o.x(0,1,0),o.e.Green().scale(.5),t,i),r.zGizmo=new Cr(new o.x(0,0,1),o.e.Blue().scale(.5),t,i),[r.xGizmo,r.yGizmo,r.zGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){r.onDragEndObservable.notifyObservers({})})}),r.attachedMesh=null,r}return l.d(t,e),Object.defineProperty(t.prototype,"attachedMesh",{set:function(e){this.xGizmo&&(this.xGizmo.attachedMesh=e,this.yGizmo.attachedMesh=e,this.zGizmo.attachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this.xGizmo.updateGizmoRotationToMatchAttachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this.xGizmo.snapDistance},set:function(e){this.xGizmo&&(this.xGizmo.snapDistance=e,this.yGizmo.snapDistance=e,this.zGizmo.snapDistance=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this.xGizmo.scaleRatio},set:function(e){this.xGizmo&&(this.xGizmo.scaleRatio=e,this.yGizmo.scaleRatio=e,this.zGizmo.scaleRatio=e)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){p.a.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}(xr.a),Or=function(e){function t(t){void 0===t&&(t=Ar.a.DefaultUtilityLayer);var i=e.call(this,t)||this;return i.onDragStartObservable=new n.c,i.onDragEndObservable=new n.c,i.xGizmo=new br.a(new o.x(1,0,0),o.e.Red().scale(.5),t),i.yGizmo=new br.a(new o.x(0,1,0),o.e.Green().scale(.5),t),i.zGizmo=new br.a(new o.x(0,0,1),o.e.Blue().scale(.5),t),[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 l.d(t,e),Object.defineProperty(t.prototype,"attachedMesh",{set:function(e){this.xGizmo&&(this.xGizmo.attachedMesh=e,this.yGizmo.attachedMesh=e,this.zGizmo.attachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this.xGizmo.updateGizmoRotationToMatchAttachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this.xGizmo.snapDistance},set:function(e){this.xGizmo&&(this.xGizmo.snapDistance=e,this.yGizmo.snapDistance=e,this.zGizmo.snapDistance=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this.xGizmo.scaleRatio},set:function(e){this.xGizmo&&(this.xGizmo.scaleRatio=e,this.yGizmo.scaleRatio=e,this.zGizmo.scaleRatio=e)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){p.a.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}(xr.a);mi.a.CreatePolyhedron=function(e){var t=[];t[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},t[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},t[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},t[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},t[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},t[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},t[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},t[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},t[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},t[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},t[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},t[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},t[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},t[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},t[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};var i,r,n,s,a,c,l=e.type&&(e.type<0||e.type>=t.length)?0:e.type||0,u=e.size,h=e.sizeX||u||1,d=e.sizeY||u||1,f=e.sizeZ||u||1,p=e.custom||t[l],_=p.face.length,m=e.faceUV||new Array(_),g=e.faceColors,v=void 0===e.flat||e.flat,y=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE,b=new Array,T=new Array,E=new Array,x=new Array,A=new Array,P=0,R=0,S=new Array,C=0,M=0;if(v)for(M=0;M<_;M++)g&&void 0===g[M]&&(g[M]=new o.f(1,1,1,1)),m&&void 0===m[M]&&(m[M]=new o.y(0,0,1,1));if(v)for(M=0;M<_;M++){var O=p.face[M].length;for(n=2*Math.PI/O,s=.5*Math.tan(n/2),a=.5,C=0;C0)return Math.max(n,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}(Ot),kr=function(e){function t(t,i,r,n,s,a,c){void 0===s&&(s=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===a&&(a=Ge.a.BILINEAR_SAMPLINGMODE),void 0===c&&(c=!0);var l=e.call(this,t,i,r,n,!0,s,!1,a,c)||this;return l.scene=r,l.mirrorPlane=new o.n(0,1,0,1),l._transformMatrix=o.j.Zero(),l._mirrorMatrix=o.j.Zero(),l._adaptiveBlurKernel=0,l._blurKernelX=0,l._blurKernelY=0,l._blurRatio=1,l.ignoreCameraViewport=!0,l._updateGammaSpace(),l._imageProcessingConfigChangeObserver=r.imageProcessingConfiguration.onUpdateParameters.add(function(){l._updateGammaSpace}),l.onBeforeRenderObservable.add(function(){o.j.ReflectionToRef(l.mirrorPlane,l._mirrorMatrix),l._savedViewMatrix=r.getViewMatrix(),l._mirrorMatrix.multiplyToRef(l._savedViewMatrix,l._transformMatrix),r.setTransformMatrix(l._transformMatrix,r.getProjectionMatrix()),r.clipPlane=l.mirrorPlane,r.getEngine().cullBackFaces=!1,r._mirroredCameraPosition=o.x.TransformCoordinates(r.activeCamera.globalPosition,l._mirrorMatrix)}),l.onAfterRenderObservable.add(function(){r.setTransformMatrix(l._savedViewMatrix,r.getProjectionMatrix()),r.getEngine().cullBackFaces=!0,r._mirroredCameraPosition=null,delete r.clipPlane}),l}return l.d(t,e),Object.defineProperty(t.prototype,"blurRatio",{get:function(){return this._blurRatio},set:function(e){this._blurRatio!==e&&(this._blurRatio=e,this._preparePostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adaptiveBlurKernel",{set:function(e){this._adaptiveBlurKernel=e,this._autoComputeBlurKernel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernel",{set:function(e){this.blurKernelX=e,this.blurKernelY=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelX",{get:function(){return this._blurKernelX},set:function(e){this._blurKernelX!==e&&(this._blurKernelX=e,this._preparePostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelY",{get:function(){return this._blurKernelY},set:function(e){this._blurKernelY!==e&&(this._blurKernelY=e,this._preparePostProcesses())},enumerable:!0,configurable:!0}),t.prototype._autoComputeBlurKernel=function(){var e=this.getScene().getEngine(),t=this.getRenderWidth()/e.getRenderWidth(),i=this.getRenderHeight()/e.getRenderHeight();this.blurKernelX=this._adaptiveBlurKernel*t,this.blurKernelY=this._adaptiveBlurKernel*i},t.prototype._onRatioRescale=function(){this._sizeRatio&&(this.resize(this._initialSizeParameter),this._adaptiveBlurKernel||this._preparePostProcesses()),this._adaptiveBlurKernel&&this._autoComputeBlurKernel()},t.prototype._updateGammaSpace=function(){this.gammaSpace=!this.scene.imageProcessingConfiguration.isEnabled||!this.scene.imageProcessingConfiguration.applyByPostProcess},t.prototype._preparePostProcesses=function(){if(this.clearPostProcesses(!0),this._blurKernelX&&this._blurKernelY){var e=this.getScene().getEngine(),t=e.getCaps().textureFloatRender?_.a.TEXTURETYPE_FLOAT:_.a.TEXTURETYPE_HALF_FLOAT;this._blurX=new Gr("horizontal blur",new o.w(1,0),this._blurKernelX,this._blurRatio,null,Ge.a.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurX.autoClear=!1,1===this._blurRatio&&this.samples<2&&this._texture?this._blurX.inputTexture=this._texture:this._blurX.alwaysForcePOT=!0,this._blurY=new Gr("vertical blur",new o.w(0,1),this._blurKernelY,this._blurRatio,null,Ge.a.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurY.autoClear=!1,this._blurY.alwaysForcePOT=1!==this._blurRatio,this.addPostProcess(this._blurX),this.addPostProcess(this._blurY)}else this._blurY&&(this.removePostProcess(this._blurY),this._blurY.dispose(),this._blurY=null),this._blurX&&(this.removePostProcess(this._blurX),this._blurX.dispose(),this._blurX=null)},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=this.getSize(),r=new t(this.name,i.width,e,this._renderTargetOptions.generateMipMaps,this._renderTargetOptions.type,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer);return r.hasAlpha=this.hasAlpha,r.level=this.level,r.mirrorPlane=this.mirrorPlane.clone(),this.renderList&&(r.renderList=this.renderList.slice(0)),r},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);return t.mirrorPlane=this.mirrorPlane.asArray(),t},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver)},t}(wi);Ge.a._CreateMirror=function(e,t,i,r){return new kr(e,t,i,r)};var zr=function(e){function t(t,i,r,n,s,a,c,l,u,h,d,f,p){void 0===r&&(r=null),void 0===n&&(n=!1),void 0===s&&(s=null),void 0===a&&(a=null),void 0===c&&(c=null),void 0===l&&(l=_.a.TEXTUREFORMAT_RGBA),void 0===u&&(u=!1),void 0===h&&(h=null),void 0===d&&(d=!1),void 0===f&&(f=.8),void 0===p&&(p=0);var m=e.call(this,i)||this;if(m.boundingBoxPosition=o.x.Zero(),m._rotationY=0,m._prefiltered=!1,m.name=t,m.url=t,m._noMipmap=n,m.hasAlpha=!1,m._format=l,m.isCube=!0,m._textureMatrix=o.j.Identity(),m._createPolynomials=d,m.coordinatesMode=Ge.a.CUBIC_MODE,!t&&!s)return m;var g=t.lastIndexOf("."),v=h||(g>-1?t.substring(g).toLowerCase():""),y=".dds"===v,b=".env"===v;if(b?(m.gammaSpace=!1,m._prefiltered=!1):(m._prefiltered=u,u&&(m.gammaSpace=!1)),m._texture=m._getFromCache(t,n),!s&&(b||y||r||(r=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),s=[],r))for(var T=0;T0,o.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!a.invertZ:a.invertZ,o.LODINREFLECTIONALPHA=a.lodLevelInAlpha,o.EQUIRECTANGULAR_RELFECTION_FOV=this.useEquirectangularFOV,o.REFLECTIONBGR=this.switchToBGR,a.coordinatesMode===Ge.a.INVCUBIC_MODE&&(o.INVERTCUBICMAP=!0),o.REFLECTIONMAP_3D=a.isCube,a.coordinatesMode){case Ge.a.EXPLICIT_MODE:o.REFLECTIONMAP_EXPLICIT=!0;break;case Ge.a.PLANAR_MODE:o.REFLECTIONMAP_PLANAR=!0;break;case Ge.a.PROJECTION_MODE:o.REFLECTIONMAP_PROJECTION=!0;break;case Ge.a.SKYBOX_MODE:o.REFLECTIONMAP_SKYBOX=!0,o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!a.getReflectionTextureMatrix().isIdentity();break;case Ge.a.SPHERICAL_MODE:o.REFLECTIONMAP_SPHERICAL=!0;break;case Ge.a.EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case Ge.a.CUBIC_MODE:case Ge.a.INVCUBIC_MODE:default:o.REFLECTIONMAP_CUBIC=!0}this.reflectionFresnel?(o.REFLECTIONFRESNEL=!0,o.REFLECTIONFALLOFF=this.reflectionFalloffDistance>0,this._reflectionControls.x=this.reflectionAmount,this._reflectionControls.y=this.reflectionReflectance0,this._reflectionControls.z=this.reflectionReflectance90,this._reflectionControls.w=1/this.reflectionFalloffDistance):(o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1)}else o.REFLECTION=!1,o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1,o.REFLECTIONBLUR=!1,o.REFLECTIONMAP_3D=!1,o.REFLECTIONMAP_SPHERICAL=!1,o.REFLECTIONMAP_PLANAR=!1,o.REFLECTIONMAP_CUBIC=!1,o.REFLECTIONMAP_PROJECTION=!1,o.REFLECTIONMAP_SKYBOX=!1,o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!1,o.REFLECTIONMAP_EXPLICIT=!1,o.REFLECTIONMAP_EQUIRECTANGULAR=!1,o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,o.INVERTCUBICMAP=!1,o.REFLECTIONMAP_OPPOSITEZ=!1,o.LODINREFLECTIONALPHA=!1,o.GAMMAREFLECTION=!1,o.RGBDREFLECTION=!1}o.PREMULTIPLYALPHA=this.alphaMode===_.a.ALPHA_PREMULTIPLIED||this.alphaMode===_.a.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(jr.a.PrepareDefinesForMisc(e,n,!1,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),jr.a.PrepareDefinesForFrameBoundValues(n,s,o,i),jr.a.PrepareDefinesForAttributes(e,o,!1,!0,!1)&&e&&(n.getEngine().getCaps().standardDerivatives||e.isVerticesDataPresent(gi.b.NormalKind)||(e.createNormals(!0),p.a.Warn("BackgroundMaterial: Normals have been created for the mesh: "+e.name))),o.isDirty){o.markAsProcessed(),n.resetCachedMaterial();var c=new Ct.c;o.FOG&&c.addFallback(0,"FOG"),o.POINTSIZE&&c.addFallback(1,"POINTSIZE"),jr.a.HandleFallbacksForShadows(o,c,this._maxSimultaneousLights),o.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e);var l=[gi.b.PositionKind];o.NORMAL&&l.push(gi.b.NormalKind),o.UV1&&l.push(gi.b.UVKind),o.UV2&&l.push(gi.b.UV2Kind),jr.a.PrepareAttributesForBones(l,e,o,c),jr.a.PrepareAttributesForInstances(l,o);var u=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","mBones","vPrimaryColor","vPrimaryColorShadow","vReflectionInfos","reflectionMatrix","vReflectionMicrosurfaceInfos","fFovMultiplier","shadowLevel","alpha","vBackgroundCenter","vReflectionControl","vDiffuseInfos","diffuseMatrix"],h=["diffuseSampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh"],d=["Material","Scene"];hi.a&&(hi.a.PrepareUniforms(u,o),hi.a.PrepareSamplers(h,o)),jr.a.PrepareUniformsAndSamplersList({uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var f=o.toString();t.setEffect(n.getEngine().createEffect("background",{attributes:l,uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:f,fallbacks:c,onCompiled:function(e){r.onCompiled&&r.onCompiled(e),r.bindSceneUniformBuffer(e,n.getSceneUniformBuffer())},onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},s),o),this.buildUniformLayout()}return!(!t.effect||!t.effect.isReady())&&(o._renderId=n.getRenderId(),this._wasPreviouslyReady=!0,!0)},t.prototype._computePrimaryColorFromPerceptualColor=function(){this.__perceptualColor&&(this._primaryColor.copyFrom(this.__perceptualColor),this._primaryColor.toLinearSpaceToRef(this._primaryColor),this._imageProcessingConfiguration&&this._primaryColor.scaleToRef(1/this._imageProcessingConfiguration.exposure,this._primaryColor),this._computePrimaryColors())},t.prototype._computePrimaryColors=function(){0===this._primaryColorShadowLevel&&0===this._primaryColorHighlightLevel||(this._primaryColor.scaleToRef(this._primaryColorShadowLevel,this._primaryShadowColor),this._primaryColor.subtractToRef(this._primaryShadowColor,this._primaryShadowColor),this._white.subtractToRef(this._primaryColor,this._primaryHighlightColor),this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel,this._primaryHighlightColor),this._primaryColor.addToRef(this._primaryHighlightColor,this._primaryHighlightColor))},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vPrimaryColor",4),this._uniformBuffer.addUniform("vPrimaryColorShadow",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("fFovMultiplier",1),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("shadowLevel",1),this._uniformBuffer.addUniform("alpha",1),this._uniformBuffer.addUniform("vBackgroundCenter",3),this._uniformBuffer.addUniform("vReflectionControl",4),this._uniformBuffer.create()},t.prototype.unbind=function(){this._diffuseTexture&&this._diffuseTexture.isRenderTarget&&this._uniformBuffer.setTexture("diffuseSampler",null),this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindOnlyWorldMatrix=function(e){this._activeEffect.setMatrix("world",e)},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),n=i._materialDefines;if(n){var o=i.effect;if(o){this._activeEffect=o,this.bindOnlyWorldMatrix(e),jr.a.BindBonesParameters(t,this._activeEffect);var s=this._mustRebind(r,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||(r.texturesEnabled&&(this._diffuseTexture&&Xr.a.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),jr.a.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse")),a&&Xr.a.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),n.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),r.texturesEnabled&&(this._diffuseTexture&&Xr.a.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("diffuseSampler",this._diffuseTexture),a&&Xr.a.ReflectionTextureEnabled&&(n.REFLECTIONBLUR&&n.TEXTURELODSUPPORT?this._uniformBuffer.setTexture("reflectionSampler",a):n.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),n.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)))),jr.a.BindClipPlane(this._activeEffect,r),jr.a.BindEyePosition(o,r)}!s&&this.isFrozen||(r.lightsEnabled&&jr.a.BindLights(r,t,this._activeEffect,n,this._maxSimultaneousLights,!1),this.bindView(o),jr.a.BindFogParameters(r,t,this._activeEffect,!0),this._imageProcessingConfiguration&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.dispose=function(t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),i&&(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 i=this;return w.a.Clone(function(){return new t(e,i.getScene())},this)},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.BackgroundMaterial",e},t.prototype.getClassName=function(){return"BackgroundMaterial"},t.Parse=function(e,i,r){return w.a.Parse(function(){return new t(e.name,i)},e,i,r)},t.StandardReflectance0=.05,t.StandardReflectance90=.5,l.c([Object(w.e)()],t.prototype,"_primaryColor",void 0),l.c([Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColor",void 0),l.c([Object(w.e)()],t.prototype,"__perceptualColor",void 0),l.c([Object(w.c)()],t.prototype,"_primaryColorShadowLevel",void 0),l.c([Object(w.c)()],t.prototype,"_primaryColorHighlightLevel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColorHighlightLevel",null),l.c([Object(w.l)()],t.prototype,"_reflectionTexture",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionBlur",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionBlur",void 0),l.c([Object(w.l)()],t.prototype,"_diffuseTexture",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLights",void 0),l.c([Object(w.c)()],t.prototype,"_shadowLevel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLevel",void 0),l.c([Object(w.n)()],t.prototype,"_sceneCenter",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"sceneCenter",void 0),l.c([Object(w.c)()],t.prototype,"_opacityFresnel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityFresnel",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionFresnel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFresnel",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionFalloffDistance",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFalloffDistance",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionAmount",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionAmount",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionReflectance0",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance0",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionReflectance90",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance90",void 0),l.c([Object(w.c)()],t.prototype,"_useRGBColor",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRGBColor",void 0),l.c([Object(w.c)()],t.prototype,"_enableNoise",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableNoise",void 0),l.c([Object(w.c)()],t.prototype,"_maxSimultaneousLights",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"maxSimultaneousLights",void 0),l.c([Object(w.i)()],t.prototype,"_imageProcessingConfiguration",void 0),t}(Hr.a);s.a.RegisteredTypes["BABYLON.BackgroundMaterial"]=$r;var en=i(75),tn=function(){function e(t,i){var r=this;this._errorHandler=function(e,t){r.onErrorObservable.notifyObservers({message:e,exception:t})},this._options=l.a({},e._getDefaultOptions(),t),this._scene=i,this.onErrorObservable=new n.c,this._setupBackground(),this._setupImageProcessing()}return e._getDefaultOptions=function(){return{createGround:!0,groundSize:15,groundTexture:this._groundTextureCDNUrl,groundColor:new o.e(.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:_.a.TEXTURETYPE_UNSIGNED_INT,groundYBias:1e-5,createSkybox:!0,skyboxSize:20,skyboxTexture:this._skyboxTextureCDNUrl,skyboxColor:new o.e(.2,.2,.3).toLinearSpace().scale(3),backgroundYRotation:0,sizeAuto:!0,rootPosition:o.x.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=l.a({},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 o.f(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 Fr.a)this._scene.environmentTexture=this._options.environmentTexture;else{var e=zr.CreateFromPrefilteredData(this._options.environmentTexture,this._scene);this._scene.environmentTexture=e}},e.prototype._setupBackground=function(){this._rootMesh||(this._rootMesh=new de.a("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,i=this._options.skyboxSize,r=this._options.rootPosition;if(!this._scene.meshes||1===this._scene.meshes.length)return{groundSize:t,skyboxSize:i,rootPosition:r};var n=this._scene.getWorldExtends(function(t){return t!==e._ground&&t!==e._rootMesh&&t!==e._skybox}),o=n.max.subtract(n.min);if(this._options.sizeAuto){this._scene.activeCamera instanceof mt&&this._scene.activeCamera.upperRadiusLimit&&(i=t=2*this._scene.activeCamera.upperRadiusLimit);var s=o.length();s>t&&(i=t=2*s),t*=1.1,i*=1.5,(r=n.min.add(o.scale(.5))).y=n.min.y-this._options.groundYBias}return{groundSize:t,skyboxSize:i,rootPosition:r}},e.prototype._setupGround=function(e){var t=this;this._ground&&!this._ground.isDisposed()||(this._ground=de.a.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 $r("BackgroundPlaneMaterial",this._scene)),this._groundMaterial.alpha=this._options.groundOpacity,this._groundMaterial.alphaMode=_.a.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 Fr.a)this._groundMaterial.diffuseTexture=this._options.groundTexture;else{var e=new Ge.a(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=Ge.a.CLAMP_ADDRESSMODE;if(!this._groundMirror&&(this._groundMirror=new kr("BackgroundPlaneMirrorTexture",{ratio:this._options.groundMirrorSizeRatio},this._scene,!1,this._options.groundMirrorTextureType,Ge.a.BILINEAR_SAMPLINGMODE,!0),this._groundMirror.mirrorPlane=new o.n(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 i=0;i0&&a.addCPUSkinningFallback(c++,e),t.MORPHTARGETS&&a.addFallback(c++,"MORPHTARGETS");var l=[gi.b.PositionKind];t.NORMAL&&l.push(gi.b.NormalKind),t.TANGENT&&l.push(gi.b.TangentKind),t.UV1&&l.push(gi.b.UVKind),t.UV2&&l.push(gi.b.UV2Kind),t.VERTEXCOLOR&&l.push(gi.b.ColorKind),jr.a.PrepareAttributesForBones(l,e,t,a),jr.a.PrepareAttributesForInstances(l,t),jr.a.PrepareAttributesForMorphTargets(l,e,t);var u=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","vReflectivityColor","vEmissiveColor","vReflectionColor","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vReflectionPosition","vReflectionSize","vEmissiveInfos","vReflectivityInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","albedoMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","refractionMatrix","vLightingIntensity","logarithmicDepthConstant","vSphericalX","vSphericalY","vSphericalZ","vSphericalXX","vSphericalYY","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vReflectionMicrosurfaceInfos","vRefractionMicrosurfaceInfos","vTangentSpaceParams","boneTextureWidth"],h=["albedoSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","microSurfaceSampler","environmentBrdfSampler","boneSampler"],d=["Material","Scene"];hi.a&&(hi.a.PrepareUniforms(u,t),hi.a.PrepareSamplers(h,t)),jr.a.PrepareUniformsAndSamplersList({uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:t,maxSimultaneousLights:this._maxSimultaneousLights});var f=t.toString();return s.createEffect("pbr",{attributes:l,uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:f,fallbacks:a,onCompiled:i,onError:r,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:t.NUM_MORPH_INFLUENCERS}},s)},t.prototype._prepareDefines=function(e,i,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o=this.getScene(),s=o.getEngine();if(jr.a.PrepareDefinesForLights(o,e,i,!0,this._maxSimultaneousLights,this._disableLighting),i._needNormals=!0,i.METALLICWORKFLOW=this.isMetallicWorkflow(),i._areTexturesDirty){if(i._needUVs=!1,o.texturesEnabled){o.getEngine().getCaps().textureLOD&&(i.LODBASEDMICROSFURACE=!0),this._albedoTexture&&Xr.a.DiffuseTextureEnabled?jr.a.PrepareDefinesForMergedUV(this._albedoTexture,i,"ALBEDO"):i.ALBEDO=!1,this._ambientTexture&&Xr.a.AmbientTextureEnabled?(jr.a.PrepareDefinesForMergedUV(this._ambientTexture,i,"AMBIENT"),i.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):i.AMBIENT=!1,this._opacityTexture&&Xr.a.OpacityTextureEnabled?(jr.a.PrepareDefinesForMergedUV(this._opacityTexture,i,"OPACITY"),i.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):i.OPACITY=!1;var a=this._getReflectionTexture();if(a&&Xr.a.ReflectionTextureEnabled){switch(i.REFLECTION=!0,i.GAMMAREFLECTION=a.gammaSpace,i.RGBDREFLECTION=a.isRGBD,i.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!a.invertZ:a.invertZ,i.LODINREFLECTIONALPHA=a.lodLevelInAlpha,a.coordinatesMode===Ge.a.INVCUBIC_MODE&&(i.INVERTCUBICMAP=!0),i.REFLECTIONMAP_3D=a.isCube,i.REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_SKYBOX_TRANSFORMED=!1,a.coordinatesMode){case Ge.a.EXPLICIT_MODE:i.REFLECTIONMAP_EXPLICIT=!0;break;case Ge.a.PLANAR_MODE:i.REFLECTIONMAP_PLANAR=!0;break;case Ge.a.PROJECTION_MODE:i.REFLECTIONMAP_PROJECTION=!0;break;case Ge.a.SKYBOX_MODE:i.REFLECTIONMAP_SKYBOX=!0;break;case Ge.a.SPHERICAL_MODE:i.REFLECTIONMAP_SPHERICAL=!0;break;case Ge.a.EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case Ge.a.CUBIC_MODE:case Ge.a.INVCUBIC_MODE:default:i.REFLECTIONMAP_CUBIC=!0,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!!a.boundingBoxSize}a.coordinatesMode!==Ge.a.SKYBOX_MODE?a.sphericalPolynomial&&(i.USESPHERICALFROMREFLECTIONMAP=!0,this._forceIrradianceInFragment||o.getEngine().getCaps().maxVaryingVectors<=8?i.USESPHERICALINVERTEX=!1:i.USESPHERICALINVERTEX=!0):i.REFLECTIONMAP_SKYBOX_TRANSFORMED=!a.getReflectionTextureMatrix().isIdentity()}else i.REFLECTION=!1,i.REFLECTIONMAP_3D=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_CUBIC=!1,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_SKYBOX_TRANSFORMED=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,i.INVERTCUBICMAP=!1,i.USESPHERICALFROMREFLECTIONMAP=!1,i.USESPHERICALINVERTEX=!1,i.REFLECTIONMAP_OPPOSITEZ=!1,i.LODINREFLECTIONALPHA=!1,i.GAMMAREFLECTION=!1,i.RGBDREFLECTION=!1;this._lightmapTexture&&Xr.a.LightmapTextureEnabled?(jr.a.PrepareDefinesForMergedUV(this._lightmapTexture,i,"LIGHTMAP"),i.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,i.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace):i.LIGHTMAP=!1,this._emissiveTexture&&Xr.a.EmissiveTextureEnabled?jr.a.PrepareDefinesForMergedUV(this._emissiveTexture,i,"EMISSIVE"):i.EMISSIVE=!1,Xr.a.SpecularTextureEnabled?(this._metallicTexture?(jr.a.PrepareDefinesForMergedUV(this._metallicTexture,i,"REFLECTIVITY"),i.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,i.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,i.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,i.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed):this._reflectivityTexture?(jr.a.PrepareDefinesForMergedUV(this._reflectivityTexture,i,"REFLECTIVITY"),i.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,i.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap):i.REFLECTIVITY=!1,this._microSurfaceTexture?jr.a.PrepareDefinesForMergedUV(this._microSurfaceTexture,i,"MICROSURFACEMAP"):i.MICROSURFACEMAP=!1):(i.REFLECTIVITY=!1,i.MICROSURFACEMAP=!1),o.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&Xr.a.BumpTextureEnabled&&!this._disableBumpMap?(jr.a.PrepareDefinesForMergedUV(this._bumpTexture,i,"BUMP"),this._useParallax&&this._albedoTexture&&Xr.a.DiffuseTextureEnabled?(i.PARALLAX=!0,i.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):i.PARALLAX=!1,i.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):i.BUMP=!1;var c=this._getRefractionTexture();c&&Xr.a.RefractionTextureEnabled?(i.REFRACTION=!0,i.REFRACTIONMAP_3D=c.isCube,i.GAMMAREFRACTION=c.gammaSpace,i.RGBDREFRACTION=c.isRGBD,i.REFRACTIONMAP_OPPOSITEZ=c.invertZ,i.LODINREFRACTIONALPHA=c.lodLevelInAlpha,this._linkRefractionWithTransparency&&(i.LINKREFRACTIONTOTRANSPARENCY=!0)):i.REFRACTION=!1,this._environmentBRDFTexture&&Xr.a.ReflectionTextureEnabled?i.ENVIRONMENTBRDF=!0:i.ENVIRONMENTBRDF=!1,this._shouldUseAlphaFromAlbedoTexture()?i.ALPHAFROMALBEDO=!0:i.ALPHAFROMALBEDO=!1}i.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===t.LIGHTFALLOFF_STANDARD?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===t.LIGHTFALLOFF_GLTF?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!0):(i.USEPHYSICALLIGHTFALLOFF=!0,i.USEGLTFLIGHTFALLOFF=!1),i.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?i.TWOSIDEDLIGHTING=!0:i.TWOSIDEDLIGHTING=!1,i.ALPHATESTVALUE=this._alphaCutOff+(this._alphaCutOff%1==0?".":""),i.PREMULTIPLYALPHA=this.alphaMode===_.a.ALPHA_PREMULTIPLIED||this.alphaMode===_.a.ALPHA_PREMULTIPLIED_PORTERDUFF,i.ALPHABLEND=this.needAlphaBlendingForMesh(e),i.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,i.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel,i.SPECULARAA=o.getEngine().getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}i._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(i),i.FORCENORMALFORWARD=this._forceNormalForward,i.RADIANCEOCCLUSION=this._useRadianceOcclusion,i.HORIZONOCCLUSION=this._useHorizonOcclusion,i._areMiscDirty&&(jr.a.PrepareDefinesForMisc(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,i),i.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent(gi.b.NormalKind)),jr.a.PrepareDefinesForFrameBoundValues(o,s,i,!!r,n),jr.a.PrepareDefinesForAttributes(e,i,!0,!0,!0,this._transparencyMode!==t.PBRMATERIAL_OPAQUE)},t.prototype.forceCompilation=function(e,t,i){var r=this,n=l.a({clipPlane:!1},i),o=new pn,s=this._prepareEffect(e,o,void 0,void 0,void 0,n.clipPlane);s.isReady()?t&&t(this):s.onCompileObservable.add(function(){t&&t(r)})},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vAlbedoInfos",2),this._uniformBuffer.addUniform("vAmbientInfos",4),this._uniformBuffer.addUniform("vOpacityInfos",2),this._uniformBuffer.addUniform("vEmissiveInfos",2),this._uniformBuffer.addUniform("vLightmapInfos",2),this._uniformBuffer.addUniform("vReflectivityInfos",3),this._uniformBuffer.addUniform("vMicroSurfaceSamplerInfos",2),this._uniformBuffer.addUniform("vRefractionInfos",4),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("vReflectionPosition",3),this._uniformBuffer.addUniform("vReflectionSize",3),this._uniformBuffer.addUniform("vBumpInfos",3),this._uniformBuffer.addUniform("albedoMatrix",16),this._uniformBuffer.addUniform("ambientMatrix",16),this._uniformBuffer.addUniform("opacityMatrix",16),this._uniformBuffer.addUniform("emissiveMatrix",16),this._uniformBuffer.addUniform("lightmapMatrix",16),this._uniformBuffer.addUniform("reflectivityMatrix",16),this._uniformBuffer.addUniform("microSurfaceSamplerMatrix",16),this._uniformBuffer.addUniform("bumpMatrix",16),this._uniformBuffer.addUniform("vTangentSpaceParams",2),this._uniformBuffer.addUniform("refractionMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionColor",3),this._uniformBuffer.addUniform("vAlbedoColor",4),this._uniformBuffer.addUniform("vLightingIntensity",4),this._uniformBuffer.addUniform("vRefractionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("vReflectivityColor",4),this._uniformBuffer.addUniform("vEmissiveColor",3),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.create()},t.prototype.unbind=function(){this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._uniformBuffer.setTexture("refractionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,i,r){var n=this.getScene(),s=r._materialDefines;if(s){var a=r.effect;if(a){this._activeEffect=a,this.bindOnlyWorldMatrix(e),s.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var c=this._mustRebind(n,a,i.visibility);jr.a.BindBonesParameters(i,this._activeEffect);var l=null;if(c){this._uniformBuffer.bindToEffect(a,"Material"),this.bindViewProjection(a),l=this._getReflectionTexture();var u=this._getRefractionTexture();if(!this._uniformBuffer.useUbo||!this.isFrozen||!this._uniformBuffer.isSync){if(n.texturesEnabled){if(this._albedoTexture&&Xr.a.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),jr.a.BindTextureMatrix(this._albedoTexture,this._uniformBuffer,"albedo")),this._ambientTexture&&Xr.a.AmbientTextureEnabled&&(this._uniformBuffer.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),jr.a.BindTextureMatrix(this._ambientTexture,this._uniformBuffer,"ambient")),this._opacityTexture&&Xr.a.OpacityTextureEnabled&&(this._uniformBuffer.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),jr.a.BindTextureMatrix(this._opacityTexture,this._uniformBuffer,"opacity")),l&&Xr.a.ReflectionTextureEnabled){if(this._uniformBuffer.updateMatrix("reflectionMatrix",l.getReflectionTextureMatrix()),this._uniformBuffer.updateFloat2("vReflectionInfos",l.level,0),l.boundingBoxSize){var h=l;this._uniformBuffer.updateVector3("vReflectionPosition",h.boundingBoxPosition),this._uniformBuffer.updateVector3("vReflectionSize",h.boundingBoxSize)}var d=l.sphericalPolynomial;s.USESPHERICALFROMREFLECTIONMAP&&d&&(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)),this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos",l.getSize().width,l.lodGenerationScale,l.lodGenerationOffset)}if(this._emissiveTexture&&Xr.a.EmissiveTextureEnabled&&(this._uniformBuffer.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),jr.a.BindTextureMatrix(this._emissiveTexture,this._uniformBuffer,"emissive")),this._lightmapTexture&&Xr.a.LightmapTextureEnabled&&(this._uniformBuffer.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),jr.a.BindTextureMatrix(this._lightmapTexture,this._uniformBuffer,"lightmap")),Xr.a.SpecularTextureEnabled&&(this._metallicTexture?(this._uniformBuffer.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),jr.a.BindTextureMatrix(this._metallicTexture,this._uniformBuffer,"reflectivity")):this._reflectivityTexture&&(this._uniformBuffer.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),jr.a.BindTextureMatrix(this._reflectivityTexture,this._uniformBuffer,"reflectivity")),this._microSurfaceTexture&&(this._uniformBuffer.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),jr.a.BindTextureMatrix(this._microSurfaceTexture,this._uniformBuffer,"microSurfaceSampler"))),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&Xr.a.BumpTextureEnabled&&!this._disableBumpMap&&(this._uniformBuffer.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),jr.a.BindTextureMatrix(this._bumpTexture,this._uniformBuffer,"bump"),n._mirroredCameraPosition?this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),u&&Xr.a.RefractionTextureEnabled){this._uniformBuffer.updateMatrix("refractionMatrix",u.getReflectionTextureMatrix());var f=1;u.isCube||u.depth&&(f=u.depth),this._uniformBuffer.updateFloat4("vRefractionInfos",u.level,this._indexOfRefraction,f,this._invertRefractionY?-1:1),this._uniformBuffer.updateFloat3("vRefractionMicrosurfaceInfos",u.getSize().width,u.lodGenerationScale,u.lodGenerationOffset)}}this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),s.METALLICWORKFLOW?(o.t.Color3[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,o.t.Color3[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness,this._uniformBuffer.updateColor4("vReflectivityColor",o.t.Color3[0],0)):this._uniformBuffer.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface),this._uniformBuffer.updateColor3("vEmissiveColor",Xr.a.EmissiveTextureEnabled?this._emissiveColor:o.e.BlackReadOnly),this._uniformBuffer.updateColor3("vReflectionColor",this._reflectionColor),this._uniformBuffer.updateColor4("vAlbedoColor",this._albedoColor,this.alpha*i.visibility),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity,this._lightingInfos.w=this._specularIntensity,this._uniformBuffer.updateVector4("vLightingIntensity",this._lightingInfos)}n.texturesEnabled&&(this._albedoTexture&&Xr.a.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("albedoSampler",this._albedoTexture),this._ambientTexture&&Xr.a.AmbientTextureEnabled&&this._uniformBuffer.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&Xr.a.OpacityTextureEnabled&&this._uniformBuffer.setTexture("opacitySampler",this._opacityTexture),l&&Xr.a.ReflectionTextureEnabled&&(s.LODBASEDMICROSFURACE?this._uniformBuffer.setTexture("reflectionSampler",l):(this._uniformBuffer.setTexture("reflectionSampler",l._lodTextureMid||l),this._uniformBuffer.setTexture("reflectionSamplerLow",l._lodTextureLow||l),this._uniformBuffer.setTexture("reflectionSamplerHigh",l._lodTextureHigh||l))),s.ENVIRONMENTBRDF&&this._uniformBuffer.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),u&&Xr.a.RefractionTextureEnabled&&(s.LODBASEDMICROSFURACE?this._uniformBuffer.setTexture("refractionSampler",u):(this._uniformBuffer.setTexture("refractionSampler",u._lodTextureMid||u),this._uniformBuffer.setTexture("refractionSamplerLow",u._lodTextureLow||u),this._uniformBuffer.setTexture("refractionSamplerHigh",u._lodTextureHigh||u))),this._emissiveTexture&&Xr.a.EmissiveTextureEnabled&&this._uniformBuffer.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&Xr.a.LightmapTextureEnabled&&this._uniformBuffer.setTexture("lightmapSampler",this._lightmapTexture),Xr.a.SpecularTextureEnabled&&(this._metallicTexture?this._uniformBuffer.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&this._uniformBuffer.setTexture("reflectivitySampler",this._reflectivityTexture),this._microSurfaceTexture&&this._uniformBuffer.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&Xr.a.BumpTextureEnabled&&!this._disableBumpMap&&this._uniformBuffer.setTexture("bumpSampler",this._bumpTexture)),jr.a.BindClipPlane(this._activeEffect,n),n.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor);var p=n._forcedViewPosition?n._forcedViewPosition:n._mirroredCameraPosition?n._mirroredCameraPosition:n.activeCamera.globalPosition,_=n.useRightHandedSystem===(null!=n._mirroredCameraPosition);a.setFloat4("vEyePosition",p.x,p.y,p.z,_?-1:1),a.setColor3("vAmbientColor",this._globalAmbientColor)}!c&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&jr.a.BindLights(n,i,this._activeEffect,s,this._maxSimultaneousLights,this._lightFalloff!==t.LIGHTFALLOFF_STANDARD),(n.fogEnabled&&i.applyFog&&n.fogMode!==W.a.FOGMODE_NONE||l)&&this.bindView(a),jr.a.BindFogParameters(n,i,this._activeEffect,!0),s.NUM_MORPH_INFLUENCERS&&jr.a.BindMorphTargetParameters(i,this._activeEffect),this._imageProcessingConfiguration.bind(this._activeEffect),jr.a.BindLogDepth(s,this._activeEffect,n)),this._uniformBuffer.update(),this._afterBind(i,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),e},t.prototype._getReflectionTexture=function(){return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture},t.prototype._getRefractionTexture=function(){return this._refractionTexture?this._refractionTexture:this._linkRefractionWithTransparency?this.getScene().environmentTexture:null},t.prototype.dispose=function(t,i){i&&(this._albedoTexture&&this._albedoTexture.dispose(),this._ambientTexture&&this._ambientTexture.dispose(),this._opacityTexture&&this._opacityTexture.dispose(),this._reflectionTexture&&this._reflectionTexture.dispose(),this._environmentBRDFTexture&&this.getScene()._environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._emissiveTexture&&this._emissiveTexture.dispose(),this._metallicTexture&&this._metallicTexture.dispose(),this._reflectivityTexture&&this._reflectivityTexture.dispose(),this._bumpTexture&&this._bumpTexture.dispose(),this._lightmapTexture&&this._lightmapTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t,i)},t.PBRMATERIAL_OPAQUE=0,t.PBRMATERIAL_ALPHATEST=1,t.PBRMATERIAL_ALPHABLEND=2,t.PBRMATERIAL_ALPHATESTANDBLEND=3,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=1,t.LIGHTFALLOFF_PHYSICAL=0,t.LIGHTFALLOFF_GLTF=1,t.LIGHTFALLOFF_STANDARD=2,l.c([Object(w.i)()],t.prototype,"_imageProcessingConfiguration",void 0),l.c([Object(w.c)()],t.prototype,"useLogarithmicDepth",null),l.c([Object(w.c)()],t.prototype,"transparencyMode",null),t}(Hr.a),mn=function(e){function t(i,r){var n=e.call(this,i,r)||this;return n.directIntensity=1,n.emissiveIntensity=1,n.environmentIntensity=1,n.specularIntensity=1,n.disableBumpMap=!1,n.ambientTextureStrength=1,n.ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,n.ambientColor=new o.e(0,0,0),n.albedoColor=new o.e(1,1,1),n.reflectivityColor=new o.e(1,1,1),n.reflectionColor=new o.e(1,1,1),n.emissiveColor=new o.e(0,0,0),n.microSurface=1,n.indexOfRefraction=.66,n.invertRefractionY=!1,n.linkRefractionWithTransparency=!1,n.useLightmapAsShadowmap=!1,n.useAlphaFromAlbedoTexture=!1,n.forceAlphaTest=!1,n.alphaCutOff=.4,n.useSpecularOverAlpha=!0,n.useMicroSurfaceFromReflectivityMapAlpha=!1,n.useRoughnessFromMetallicTextureAlpha=!0,n.useRoughnessFromMetallicTextureGreen=!1,n.useMetallnessFromMetallicTextureBlue=!1,n.useAmbientOcclusionFromMetallicTextureRed=!1,n.useAmbientInGrayScale=!1,n.useAutoMicroSurfaceFromReflectivityMap=!1,n.useRadianceOverAlpha=!0,n.useObjectSpaceNormalMap=!1,n.useParallax=!1,n.useParallaxOcclusion=!1,n.parallaxScaleBias=.05,n.disableLighting=!1,n.forceIrradianceInFragment=!1,n.maxSimultaneousLights=4,n.invertNormalMapX=!1,n.invertNormalMapY=!1,n.twoSidedLighting=!1,n.useAlphaFresnel=!1,n.useLinearAlphaFresnel=!1,n.environmentBRDFTexture=null,n.forceNormalForward=!1,n.enableSpecularAntiAliasing=!1,n.useHorizonOcclusion=!0,n.useRadianceOcclusion=!0,n.unlit=!1,n._environmentBRDFTexture=on.GetEnvironmentBRDFTexture(r),n}return l.d(t,e),Object.defineProperty(t.prototype,"usePhysicalLightFalloff",{get:function(){return this._lightFalloff===_n.LIGHTFALLOFF_PHYSICAL},set:function(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?_n.LIGHTFALLOFF_PHYSICAL:_n.LIGHTFALLOFF_STANDARD)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useGLTFLightFalloff",{get:function(){return this._lightFalloff===_n.LIGHTFALLOFF_GLTF},set:function(e){e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?_n.LIGHTFALLOFF_GLTF:_n.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.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._albedoTexture&&t.push(this._albedoTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._reflectivityTexture&&t.push(this._reflectivityTexture),this._metallicTexture&&t.push(this._metallicTexture),this._microSurfaceTexture&&t.push(this._microSurfaceTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this._refractionTexture&&t.push(this._refractionTexture),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._refractionTexture===t)))))))))},t.prototype.clone=function(e){var i=this,r=w.a.Clone(function(){return new t(e,i.getScene())},this);return r.id=e,r.name=e,r},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.PBRMaterial",e},t.Parse=function(e,i,r){return w.a.Parse(function(){return new t(e.name,i)},e,i,r)},t.PBRMATERIAL_OPAQUE=_n.PBRMATERIAL_OPAQUE,t.PBRMATERIAL_ALPHATEST=_n.PBRMATERIAL_ALPHATEST,t.PBRMATERIAL_ALPHABLEND=_n.PBRMATERIAL_ALPHABLEND,t.PBRMATERIAL_ALPHATESTANDBLEND=_n.PBRMATERIAL_ALPHATESTANDBLEND,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=_n.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"directIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"disableBumpMap",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureStrength",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurfaceTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),l.c([Object(w.e)("ambient"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientColor",void 0),l.c([Object(w.e)("albedo"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoColor",void 0),l.c([Object(w.e)("reflectivity"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityColor",void 0),l.c([Object(w.e)("reflection"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionColor",void 0),l.c([Object(w.e)("emissive"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurface",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"indexOfRefraction",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertRefractionY",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkRefractionWithTransparency",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromAlbedoTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"forceAlphaTest",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"alphaCutOff",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureGreen",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMetallnessFromMetallicTextureBlue",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientInGrayScale",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),l.c([Object(w.c)()],t.prototype,"usePhysicalLightFalloff",null),l.c([Object(w.c)()],t.prototype,"useGLTFLightFalloff",null),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOverAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"parallaxScaleBias",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceIrradianceInFragment",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFresnel",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLinearAlphaFresnel",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentBRDFTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceNormalForward",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableSpecularAntiAliasing",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useHorizonOcclusion",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOcclusion",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsMiscDirty")],t.prototype,"unlit",void 0),t}(_n);s.a.RegisteredTypes["BABYLON.PBRMaterial"]=mn;W.a.prototype.createDefaultLight=function(e){if(void 0===e&&(e=!1),e&&this.lights)for(var t=0;t=c.video.HAVE_CURRENT_DATA;return!a.poster||a.autoPlay&&l?l&&c._createInternalTexture():(c._texture=c._engine.createTexture(a.poster,!1,!0,r),c._displayingPosterTexture=!0),c}return l.d(t,e),Object.defineProperty(t.prototype,"onUserActionRequestedObservable",{get:function(){return this._onUserActionRequestedObservable||(this._onUserActionRequestedObservable=new n.c),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 ve.h.SetCorsBehavior(e.currentSrc,e),e;var t=document.createElement("video");return"string"==typeof e?(ve.h.SetCorsBehavior(e,t),t.src=e):(ve.h.SetCorsBehavior(e[0],t),e.forEach(function(e){var i=document.createElement("source");i.src=e,t.appendChild(i)})),t},t.prototype._rebuild=function(){this.update()},t.prototype.update=function(){this.autoUpdateTexture&&this.updateTexture(!0)},t.prototype.updateTexture=function(e){e&&(this.video.paused&&this._stillImageCaptured||(this._stillImageCaptured=!0,this._updateInternalTexture()))},t.prototype.updateURL=function(e){this.video.src=e},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._onUserActionRequestedObservable&&(this._onUserActionRequestedObservable.clear(),this._onUserActionRequestedObservable=null),this.video.removeEventListener(this._createInternalTextureOnEvent,this._createInternalTexture),this.video.removeEventListener("paused",this._updateInternalTexture),this.video.removeEventListener("seeked",this._updateInternalTexture),this.video.removeEventListener("emptied",this.reset),this.video.pause()},t.CreateFromWebCam=function(e,i,r){var n,o=document.createElement("video");o.setAttribute("autoplay",""),o.setAttribute("muted",""),o.setAttribute("playsinline",""),r&&r.deviceId&&(n={exact:r.deviceId}),window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,navigator.mediaDevices?navigator.mediaDevices.getUserMedia({video:r}).then(function(r){void 0!==o.mozSrcObject?o.mozSrcObject=r:o.srcObject=r;var n=function(){i&&i(new t("video",o,e,!0,!0)),o.removeEventListener("playing",n)};o.addEventListener("playing",n),o.play()}).catch(function(e){p.a.Error(e.name)}):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getUserMedia&&navigator.getUserMedia({video:{deviceId:n,width:{min:r&&r.minWidth||256,max:r&&r.maxWidth||640},height:{min:r&&r.minHeight||256,max:r&&r.maxHeight||480}}},function(r){void 0!==o.mozSrcObject?o.mozSrcObject=r:o.src=window.URL&&window.URL.createObjectURL(r)||r,o.play(),i&&i(new t("video",o,e,!0,!0))},function(e){p.a.Error(e.name)}))},t}(Ge.a),vn=function(e){function t(t,i,r,n){var o=e.call(this,t,n)||this;o._useDirectMapping=!1,t=t||"videoDome",r.resolution=0|Math.abs(r.resolution)||32,r.clickToPlay=Boolean(r.clickToPlay),r.autoPlay=void 0===r.autoPlay||Boolean(r.autoPlay),r.loop=void 0===r.loop||Boolean(r.loop),r.size=Math.abs(r.size)||(n.activeCamera?.48*n.activeCamera.maxZ:1e3),void 0===r.useDirectMapping?o._useDirectMapping=!0:o._useDirectMapping=r.useDirectMapping,o._setReady(!1);var s={loop:r.loop,autoPlay:r.autoPlay,autoUpdateTexture:!0,poster:r.poster},a=o._material=new $r(t+"_material",n),c=o._videoTexture=new gn(t+"_texture",i,n,!1,o._useDirectMapping,Ge.a.TRILINEAR_SAMPLINGMODE,s);return o._mesh=de.a.CreateSphere(t+"_mesh",r.resolution,r.size,n,!1,de.a.BACKSIDE),c.onLoadObservable.addOnce(function(){o._setReady(!0)}),a.useEquirectangularFOV=!0,a.fovMultiplier=1,a.opacityFresnel=!1,o._useDirectMapping?(c.wrapU=Ge.a.CLAMP_ADDRESSMODE,c.wrapV=Ge.a.CLAMP_ADDRESSMODE,a.diffuseTexture=c):(c.coordinatesMode=Ge.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE,c.wrapV=Ge.a.CLAMP_ADDRESSMODE,a.reflectionTexture=c),o._mesh.material=a,o._mesh.parent=o,r.clickToPlay&&(n.onPointerUp=function(){o._videoTexture.video.play()}),o}return l.d(t,e),Object.defineProperty(t.prototype,"videoTexture",{get:function(){return this._videoTexture},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._material.fovMultiplier},set:function(e){this._material.fovMultiplier=e},enumerable:!0,configurable:!0}),t.prototype.dispose=function(t,i){void 0===i&&(i=!1),this._videoTexture.dispose(),this._mesh.dispose(),this._material.dispose(),e.prototype.dispose.call(this,t,i)},t}(rn.a),yn=function(){function e(e){this.engine=e,this._captureGPUFrameTime=!1,this._gpuFrameTime=new ve.f,this._captureShaderCompilationTime=!1,this._shaderCompilationTime=new ve.f,this._onBeginFrameObserver=null,this._onEndFrameObserver=null,this._onBeforeShaderCompilationObserver=null,this._onAfterShaderCompilationObserver=null}return Object.defineProperty(e.prototype,"gpuFrameTimeCounter",{get:function(){return this._gpuFrameTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"captureGPUFrameTime",{get:function(){return this._captureGPUFrameTime},set:function(e){var t=this;e!==this._captureGPUFrameTime&&(this._captureGPUFrameTime=e,e?(this._onBeginFrameObserver=this.engine.onBeginFrameObservable.add(function(){t._gpuFrameTimeToken||(t._gpuFrameTimeToken=t.engine.startTimeQuery())}),this._onEndFrameObserver=this.engine.onEndFrameObservable.add(function(){if(t._gpuFrameTimeToken){var e=t.engine.endTimeQuery(t._gpuFrameTimeToken);e>-1&&(t._gpuFrameTimeToken=null,t._gpuFrameTime.fetchNewFrame(),t._gpuFrameTime.addCount(e,!0))}})):(this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shaderCompilationTimeCounter",{get:function(){return this._shaderCompilationTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"captureShaderCompilationTime",{get:function(){return this._captureShaderCompilationTime},set:function(e){var t=this;e!==this._captureShaderCompilationTime&&(this._captureShaderCompilationTime=e,e?(this._onBeforeShaderCompilationObserver=this.engine.onBeforeShaderCompilationObservable.add(function(){t._shaderCompilationTime.fetchNewFrame(),t._shaderCompilationTime.beginMonitoring()}),this._onAfterShaderCompilationObserver=this.engine.onAfterShaderCompilationObservable.add(function(){t._shaderCompilationTime.endMonitoring()})):(this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null,this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null,this.engine=null},e}(),bn=function(){function e(e){var t=this;this.scene=e,this._captureActiveMeshesEvaluationTime=!1,this._activeMeshesEvaluationTime=new ve.f,this._captureRenderTargetsRenderTime=!1,this._renderTargetsRenderTime=new ve.f,this._captureFrameTime=!1,this._frameTime=new ve.f,this._captureRenderTime=!1,this._renderTime=new ve.f,this._captureInterFrameTime=!1,this._interFrameTime=new ve.f,this._captureParticlesRenderTime=!1,this._particlesRenderTime=new ve.f,this._captureSpritesRenderTime=!1,this._spritesRenderTime=new ve.f,this._capturePhysicsTime=!1,this._physicsTime=new ve.f,this._captureAnimationsTime=!1,this._animationsTime=new ve.f,this._captureCameraRenderTime=!1,this._cameraRenderTime=new ve.f,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&&(ve.h.StartPerformanceCounter("Scene rendering"),t._frameTime.beginMonitoring()),t._captureInterFrameTime&&t._interFrameTime.endMonitoring(),t._captureParticlesRenderTime&&t._particlesRenderTime.fetchNewFrame(),t._captureSpritesRenderTime&&t._spritesRenderTime.fetchNewFrame(),t._captureAnimationsTime&&t._animationsTime.beginMonitoring(),t.scene.getEngine()._drawCalls.fetchNewFrame(),t.scene.getEngine()._textureCollisions.fetchNewFrame()}),this._onAfterRenderObserver=e.onAfterRenderObservable.add(function(){t._captureFrameTime&&(ve.h.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(){ve.h.StartPerformanceCounter("Active meshes evaluation"),t._activeMeshesEvaluationTime.beginMonitoring()}),this._onAfterActiveMeshesEvaluationObserver=this.scene.onAfterActiveMeshesEvaluationObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Render targets rendering"),t._renderTargetsRenderTime.beginMonitoring()}),this._onAfterRenderTargetsRenderObserver=this.scene.onAfterRenderTargetsRenderObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Particles"),t._particlesRenderTime.beginMonitoring()}),this._onAfterParticlesRenderingObserver=this.scene.onAfterParticlesRenderingObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Sprites"),t._spritesRenderTime.beginMonitoring()}),this._onAfterSpritesRenderingObserver=this.scene.onAfterSpritesRenderingObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Physics"),t._physicsTime.beginMonitoring()}),this._onAfterPhysicsObserver=this.scene.onAfterPhysicsObservable.add(function(){ve.h.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(),ve.h.StartPerformanceCounter("Main render")}),this._onAfterDrawPhaseObserver=this.scene.onAfterDrawPhaseObservable.add(function(){t._renderTime.endMonitoring(!1),ve.h.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(),ve.h.StartPerformanceCounter("Rendering camera "+e.name)}),this._onAfterCameraRenderObserver=this.scene.onAfterCameraRenderObservable.add(function(e){t._cameraRenderTime.endMonitoring(!1),ve.h.EndPerformanceCounter("Rendering camera "+e.name)})):(this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawCallsCounter",{get:function(){return this.scene.getEngine()._drawCalls},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureCollisionsCounter",{get:function(){return this.scene.getEngine()._textureCollisions},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=null,this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null,this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null,this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null,this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver&&(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null),this._onAfterSpritesRenderingObserver&&(this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null),this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null,this._onBeforePhysicsObserver&&(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null),this._onAfterPhysicsObserver&&(this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null),this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null,this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null,this.scene=null},e}(),Tn=i(19),En="#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform sampler2D opacitySampler;\nuniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\nuniform vec4 color;\nvoid main(void)\n{\nvec4 finalColor=color;\n\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a4&&(o.push(gi.b.MatricesIndicesExtraKind),o.push(gi.b.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 f=s.morphTargetManager,p=0;f&&f.numInfluencers>0&&(n.push("#define MORPHTARGETS"),p=f.numInfluencers,n.push("#define NUM_MORPH_INFLUENCERS "+p),jr.a.PrepareAttributesForMorphTargets(o,s,{NUM_MORPH_INFLUENCERS:p})),t&&(n.push("#define INSTANCES"),o.push("world0"),o.push("world1"),o.push("world2"),o.push("world3")),this._addCustomEffectDefines(n);var _=n.join("\n");return this._cachedDefines!==_&&(this._cachedDefines=_,this._effectLayerMapGenerationEffect=this._scene.getEngine().createEffect("glowMapGeneration",o,["world","mBones","viewProjection","color","morphTargetInfluences","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity"],["diffuseSampler","emissiveSampler","opacitySampler"],_,void 0,void 0,void 0,{maxSimultaneousMorphTargets:p})),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.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()},e.prototype.getClassName=function(){return"EffectLayer"},e.Parse=function(e,t,i){return ve.h.Instantiate(e.customType).Parse(e,t,i)},e._SceneComponentInitialization=function(e){throw ye.a.WarnImport("EffectLayerSceneComponent")},l.c([Object(w.c)()],e.prototype,"name",void 0),l.c([Object(w.f)()],e.prototype,"neutralColor",void 0),l.c([Object(w.c)()],e.prototype,"isEnabled",void 0),l.c([Object(w.d)()],e.prototype,"camera",null),l.c([Object(w.c)()],e.prototype,"renderingGroupId",null),e}();r.a.AddParser(Ee.a.NAME_EFFECTLAYER,function(e,t,i,r){if(e.effectLayers){i.effectLayers||(i.effectLayers=new Array);for(var n=0;n0){this._previousStencilState=this._engine.getStencilBuffer();for(var i=0,r=t;i-1)){this._renderEffects=!0,this._needStencil=this._needStencil||n.needStencil();var o=n._mainTexture;o._shouldRender()&&(this.scene.incrementRenderId(),o.render(!1,!1))}}this.scene.incrementRenderId()}},e.prototype._setStencil=function(){this._needStencil&&this._engine.setStencilBuffer(!0)},e.prototype._setStencilBack=function(){this._needStencil&&this._engine.setStencilBuffer(this._previousStencilState)},e.prototype._draw=function(e){if(this._renderEffects){this._engine.setDepthBuffer(!1);for(var t=this.scene.effectLayers,i=0;i0&&e.isBackground===t&&e.renderTargetTextures.indexOf(r)>-1&&0!=(e.layerMask&i)},e.prototype._drawRenderTargetBackground=function(e){var t=this;this._draw(function(i){return t._drawRenderTargetPredicate(i,!0,t.scene.activeCamera.layerMask,e)})},e.prototype._drawRenderTargetForeground=function(e){var t=this;this._draw(function(i){return t._drawRenderTargetPredicate(i,!1,t.scene.activeCamera.layerMask,e)})},e}(),wn="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}";Ct.a.ShadersStore.layerPixelShader=wn;var Ln="\nattribute vec2 position;\n\nuniform vec2 scale;\nuniform vec2 offset;\nuniform mat4 textureMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvec2 shiftedPosition=position*scale+offset;\nvUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));\ngl_Position=vec4(shiftedPosition,0.0,1.0);\n}";Ct.a.ShadersStore.layerVertexShader=Ln;var Fn=function(){function e(e,t,i,r,s){this.name=e,this.scale=new o.w(1,1),this.offset=new o.w(0,0),this.alphaBlendingMode=_.a.ALPHA_COMBINE,this.layerMask=268435455,this.renderTargetTextures=[],this.renderOnlyInRenderTargetTextures=!1,this._vertexBuffers={},this.onDisposeObservable=new n.c,this.onBeforeRenderObservable=new n.c,this.onAfterRenderObservable=new n.c,this.texture=t?new Ge.a(t,i,!0):null,this.isBackground=void 0===r||r,this.color=void 0===s?new o.f(1,1,1,1):s,this._scene=i||R.a.LastCreatedScene;var a=this._scene._getComponent(Ee.a.NAME_LAYER);a||(a=new Dn(this._scene),this._scene._addComponent(a)),this._scene.layers.push(this);var c=this._scene.getEngine(),l=[];l.push(1,1),l.push(-1,1),l.push(-1,-1),l.push(1,-1);var u=new gi.b(c,l,gi.b.PositionKind,!1,!1,2);this._vertexBuffers[gi.b.PositionKind]=u,this._createIndexBuffer(),this._effect=c.createEffect("layer",[gi.b.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],""),this._alphaTestEffect=c.createEffect("layer",[gi.b.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],"#define ALPHATEST")}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!0,configurable:!0}),e.prototype._createIndexBuffer=function(){var e=this._scene.getEngine(),t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},e.prototype._rebuild=function(){var e=this._vertexBuffers[gi.b.PositionKind];e&&e._rebuild(),this._createIndexBuffer()},e.prototype.render=function(){var e=this.alphaTest?this._alphaTestEffect:this._effect;if(e.isReady()&&this.texture&&this.texture.isReady()){var t=this._scene.getEngine();this.onBeforeRenderObservable.notifyObservers(this),t.enableEffect(e),t.setState(!1),e.setTexture("textureSampler",this.texture),e.setMatrix("textureMatrix",this.texture.getTextureMatrix()),e.setFloat4("color",this.color.r,this.color.g,this.color.b,this.color.a),e.setVector2("offset",this.offset),e.setVector2("scale",this.scale),t.bindBuffers(this._vertexBuffers,this._indexBuffer,e),this.alphaTest?t.drawElementsType(Tn.a.TriangleFillMode,0,6):(t.setAlphaMode(this.alphaBlendingMode),t.drawElementsType(Tn.a.TriangleFillMode,0,6),t.setAlphaMode(_.a.ALPHA_DISABLE)),this.onAfterRenderObservable.notifyObservers(this)}},e.prototype.dispose=function(){var e=this._vertexBuffers[gi.b.PositionKind];e&&(e.dispose(),this._vertexBuffers[gi.b.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this.texture&&(this.texture.dispose(),this.texture=null),this.renderTargetTextures=[];var t=this._scene.layers.indexOf(this);this._scene.layers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderObservable.clear()},e}(),Nn=function(){function e(e,t,i,r,n){this.size=e,this.position=t,this.alphaMode=_.a.ALPHA_ONEONE,this.color=i||new o.e(1,1,1),this.texture=r?new Ge.a(r,n.getScene(),!0):null,this._system=n,n.lensFlares.push(this)}return e.AddFlare=function(t,i,r,n,o){return new e(t,i,r,n,o)},e.prototype.dispose=function(){this.texture&&this.texture.dispose();var e=this._system.lensFlares.indexOf(this);this._system.lensFlares.splice(e,1)},e}(),Bn="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\ngl_FragColor=baseColor*color;\n}";Ct.a.ShadersStore.lensFlarePixelShader=Bn;var Un="\nattribute vec2 position;\n\nuniform mat4 viewportMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=viewportMatrix*vec4(position,0.0,1.0);\n}";Ct.a.ShadersStore.lensFlareVertexShader=Un;var Vn=function(){function e(t,i,r){this.name=t,this.lensFlares=new Array,this.borderLimit=300,this.viewportBorder=0,this.layerMask=268435455,this._vertexBuffers={},this._isEnabled=!0,this._scene=r||R.a.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._emitter=i,this.id=t,r.lensFlareSystems.push(this),this.meshesSelectionPredicate=function(e){return r.activeCamera&&e.material&&e.isVisible&&e.isEnabled()&&e.isBlocker&&0!=(e.layerMask&r.activeCamera.layerMask)};var n=r.getEngine(),o=[];o.push(1,1),o.push(-1,1),o.push(-1,-1),o.push(1,-1),this._vertexBuffers[gi.b.PositionKind]=new gi.b(n,o,gi.b.PositionKind,!1,!1,2);var s=[];s.push(0),s.push(1),s.push(2),s.push(0),s.push(2),s.push(3),this._indexBuffer=n.createIndexBuffer(s),this._effect=n.createEffect("lensFlare",[gi.b.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=o.x.Project(t,o.j.Identity(),this._scene.getTransformMatrix(),e),this._positionX=t.x,this._positionY=t.y,t=o.x.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 i=new ti.a(this._scene.activeCamera.globalPosition,e),r=this._scene.pickWithRay(i,this.meshesSelectionPredicate,!0);return!r||!r.hit||r.distance>t},e.prototype.render=function(){if(!this._effect.isReady()||!this._scene.activeCamera)return!1;var e,t,i=this._scene.getEngine(),r=this._scene.activeCamera.viewport.toGlobal(i.getRenderWidth(!0),i.getRenderHeight(!0));if(!this.computeEffectivePosition(r))return!1;if(!this._isVisible())return!1;var n=(e=this._positionXr.x+r.width-this.borderLimit?this._positionX-r.x-r.width+this.borderLimit:0)>(t=this._positionYr.y+r.height-this.borderLimit?this._positionY-r.y-r.height+this.borderLimit:0)?e:t;(n-=this.viewportBorder)>this.borderLimit&&(n=this.borderLimit);var s=1-D.a.Clamp(n/this.borderLimit,0,1);if(s<0)return!1;s>1&&(s=1),this.viewportBorder>0&&(r.x+=this.viewportBorder,r.y+=this.viewportBorder,r.width-=2*this.viewportBorder,r.height-=2*this.viewportBorder,this._positionX-=this.viewportBorder,this._positionY-=this.viewportBorder);var a=r.x+r.width/2,c=r.y+r.height/2,l=a-this._positionX,u=c-this._positionY;i.enableEffect(this._effect),i.setState(!1),i.setDepthBuffer(!1),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect);for(var h=0;h0);for(var i=0,r=t;i0)}},e}();Vn._SceneComponentInitialization=function(e){var t=e._getComponent(Ee.a.NAME_LENSFLARESYSTEM);t||(t=new Gn(e),e._addComponent(t))};var kn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._needProjectionMatrixCompute=!0,t}return l.d(t,e),t.prototype._setPosition=function(e){this._position=e},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._setPosition(e)},enumerable:!0,configurable:!0}),t.prototype._setDirection=function(e){this._direction=e},Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){this._setDirection(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowMinZ",{get:function(){return this._shadowMinZ},set:function(e){this._shadowMinZ=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowMaxZ",{get:function(){return this._shadowMaxZ},set:function(e){this._shadowMaxZ=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),t.prototype.computeTransformedInformation=function(){return!(!this.parent||!this.parent.getWorldMatrix)&&(this.transformedPosition||(this.transformedPosition=o.x.Zero()),o.x.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this.transformedPosition),this.direction&&(this.transformedDirection||(this.transformedDirection=o.x.Zero()),o.x.TransformNormalToRef(this.direction,this.parent.getWorldMatrix(),this.transformedDirection)),!0)},t.prototype.getDepthScale=function(){return 50},t.prototype.getShadowDirection=function(e){return this.transformedDirection?this.transformedDirection:this.direction},t.prototype.getAbsolutePosition=function(){return this.transformedPosition?this.transformedPosition:this.position},t.prototype.setDirectionToTarget=function(e){return this.direction=o.x.Normalize(e.subtract(this.position)),this.direction},t.prototype.getRotation=function(){this.direction.normalize();var e=o.x.Cross(this.direction,o.c.Y),t=o.x.Cross(e,this.direction);return o.x.RotationFromAxis(e,t,this.direction)},t.prototype.needCube=function(){return!1},t.prototype.needProjectionMatrixCompute=function(){return this._needProjectionMatrixCompute},t.prototype.forceProjectionMatrixCompute=function(){this._needProjectionMatrixCompute=!0},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.position=o.x.Zero()},t.prototype._isSynchronized=function(){return!!this._cache.position.equals(this.position)},t.prototype.computeWorldMatrix=function(e){return!e&&this.isSynchronized()?(this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix):(this._updateCache(),this._cache.position.copyFrom(this.position),this._worldMatrix||(this._worldMatrix=o.j.Identity()),o.j.TranslationToRef(this.position.x,this.position.y,this.position.z,this._worldMatrix),this.parent&&this.parent.getWorldMatrix&&(this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()),this._worldMatrixDeterminant=this._worldMatrix.determinant(),this._worldMatrix)},t.prototype.getDepthMinZ=function(e){return void 0!==this.shadowMinZ?this.shadowMinZ:e.minZ},t.prototype.getDepthMaxZ=function(e){return void 0!==this.shadowMaxZ?this.shadowMaxZ:e.maxZ},t.prototype.setShadowProjectionMatrix=function(e,t,i){return this.customProjectionMatrixBuilder?this.customProjectionMatrixBuilder(t,i,e):this._setDefaultShadowProjectionMatrix(e,t,i),this},l.c([Object(w.n)()],t.prototype,"position",null),l.c([Object(w.n)()],t.prototype,"direction",null),l.c([Object(w.c)()],t.prototype,"shadowMinZ",null),l.c([Object(w.c)()],t.prototype,"shadowMaxZ",null),t}(ni.a),zn="#ifndef FLOAT\nvec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\n#endif\nvarying float vDepthMetric;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nfloat depth=vDepthMetric;\n#ifdef ESM\ndepth=clamp(exp(-min(87.,biasAndScale.z*depth)),0.,1.);\n#endif\n#ifdef FLOAT\ngl_FragColor=vec4(depth,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depth);\n#endif\n}";Ct.a.ShadersStore.shadowMapPixelShader=zn;var jn="\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\nuniform vec3 lightData;\n#endif\n#include\n#include\n#include[0..maxSimultaneousMorphTargets]\n\n#include\n#include\nuniform mat4 viewProjection;\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvarying float vDepthMetric;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#include[0..maxSimultaneousMorphTargets]\n#include\n#include\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvec3 worldNor=normalize(normalWorld*normal);\n#ifdef DIRECTIONINLIGHTDATA\nvec3 worldLightDir=normalize(-lightData.xyz);\n#else\nvec3 directionToLight=lightData.xyz-worldPos.xyz;\nvec3 worldLightDir=normalize(directionToLight);\n#endif\nfloat ndl=dot(worldNor,worldLightDir);\nfloat sinNL=sqrt(1.0-ndl*ndl);\nfloat normalBias=biasAndScale.y*sinNL;\nworldPos.xyz-=worldNor*normalBias;\n#endif\n\ngl_Position=viewProjection*worldPos;\n#ifdef DEPTHTEXTURE\n\ngl_Position.z+=biasAndScale.x*gl_Position.w;\n#endif\n\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y))+biasAndScale.x;\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}";Ct.a.ShadersStore.shadowMapVertexShader=jn;var Wn="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}";Ct.a.ShadersStore.depthBoxBlurPixelShader=Wn;var Hn=function(){function e(t,i,r){this.onBeforeShadowMapRenderObservable=new n.c,this._bias=5e-5,this._normalBias=0,this._blurBoxOffset=1,this._blurScale=2,this._blurKernel=1,this._useKernelBlur=!1,this._filter=e.FILTER_NONE,this._filteringQuality=e.QUALITY_HIGH,this._contactHardeningLightSizeUVRatio=.1,this._darkness=0,this._transparencyShadow=!1,this.frustumEdgeFalloff=0,this.forceBackFacesOnly=!1,this._lightDirection=o.x.Zero(),this._viewMatrix=o.j.Zero(),this._projectionMatrix=o.j.Zero(),this._transformMatrix=o.j.Zero(),this._cachedPosition=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cachedDirection=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._currentFaceIndex=0,this._currentFaceIndexCache=0,this._defaultTextureMatrix=o.j.Identity(),this._mapSize=t,this._light=i,this._scene=i.getScene(),i._shadowGenerator=this,e._SceneComponentInitialization(this._scene);var s=this._scene.getEngine().getCaps();r?s.textureFloatRender&&s.textureFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_FLOAT:s.textureHalfFloatRender&&s.textureHalfFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_HALF_FLOAT:this._textureType=_.a.TEXTURETYPE_UNSIGNED_INT:s.textureHalfFloatRender&&s.textureHalfFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_HALF_FLOAT:s.textureFloatRender&&s.textureFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_FLOAT:this._textureType=_.a.TEXTURETYPE_UNSIGNED_INT,this._initializeGenerator(),this._applyFilterValues()}return Object.defineProperty(e.prototype,"bias",{get:function(){return this._bias},set:function(e){this._bias=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normalBias",{get:function(){return this._normalBias},set:function(e){this._normalBias=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurBoxOffset",{get:function(){return this._blurBoxOffset},set:function(e){this._blurBoxOffset!==e&&(this._blurBoxOffset=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurScale",{get:function(){return this._blurScale},set:function(e){this._blurScale!==e&&(this._blurScale=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurKernel",{get:function(){return this._blurKernel},set:function(e){this._blurKernel!==e&&(this._blurKernel=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useKernelBlur",{get:function(){return this._useKernelBlur},set:function(e){this._useKernelBlur!==e&&(this._useKernelBlur=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"depthScale",{get:function(){return void 0!==this._depthScale?this._depthScale:this._light.getDepthScale()},set:function(e){this._depthScale=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter},set:function(t){if(this._light.needCube()){if(t===e.FILTER_BLUREXPONENTIALSHADOWMAP)return void(this.useExponentialShadowMap=!0);if(t===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)return void(this.useCloseExponentialShadowMap=!0);if(t===e.FILTER_PCF||t===e.FILTER_PCSS)return void(this.usePoissonSampling=!0)}t!==e.FILTER_PCF&&t!==e.FILTER_PCSS||1!==this._scene.getEngine().webGLVersion?this._filter!==t&&(this._filter=t,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty()):this.usePoissonSampling=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usePoissonSampling",{get:function(){return this.filter===e.FILTER_POISSONSAMPLING},set:function(t){(t||this.filter===e.FILTER_POISSONSAMPLING)&&(this.filter=t?e.FILTER_POISSONSAMPLING:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useExponentialShadowMap",{get:function(){return this.filter===e.FILTER_EXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_EXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_EXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useBlurExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_BLUREXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_CLOSEEXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useBlurCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usePercentageCloserFiltering",{get:function(){return this.filter===e.FILTER_PCF},set:function(t){(t||this.filter===e.FILTER_PCF)&&(this.filter=t?e.FILTER_PCF:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filteringQuality",{get:function(){return this._filteringQuality},set:function(e){this._filteringQuality=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useContactHardeningShadow",{get:function(){return this.filter===e.FILTER_PCSS},set:function(t){(t||this.filter===e.FILTER_PCSS)&&(this.filter=t?e.FILTER_PCSS:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contactHardeningLightSizeUVRatio",{get:function(){return this._contactHardeningLightSizeUVRatio},set:function(e){this._contactHardeningLightSizeUVRatio=e},enumerable:!0,configurable:!0}),e.prototype.getDarkness=function(){return this._darkness},e.prototype.setDarkness=function(e){return this._darkness=e>=1?1:e<=0?0:e,this},e.prototype.setTransparencyShadow=function(e){return this._transparencyShadow=e,this},e.prototype.getShadowMap=function(){return this._shadowMap},e.prototype.getShadowMapForRendering=function(){return this._shadowMap2?this._shadowMap2:this._shadowMap},e.prototype.addShadowCaster=function(e,t){var i;return void 0===t&&(t=!0),this._shadowMap?(this._shadowMap.renderList||(this._shadowMap.renderList=[]),this._shadowMap.renderList.push(e),t&&(i=this._shadowMap.renderList).push.apply(i,e.getChildMeshes()),this):this},e.prototype.removeShadowCaster=function(e,t){if(void 0===t&&(t=!0),!this._shadowMap||!this._shadowMap.renderList)return this;var i=this._shadowMap.renderList.indexOf(e);if(-1!==i&&this._shadowMap.renderList.splice(i,1),t)for(var r=0,n=e.getChildren();r1?(this._shadowMap=new wi(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube(),void 0,!1,!1),this._shadowMap.createDepthStencilTexture(_.a.LESS,!0)):this._shadowMap=new wi(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube()),this._shadowMap.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap.anisotropicFilteringLevel=1,this._shadowMap.updateSamplingMode(Ge.a.BILINEAR_SAMPLINGMODE),this._shadowMap.renderParticles=!1,this._shadowMap.ignoreCameraViewport=!0,this._shadowMap.onBeforeRenderObservable.add(function(r){t._currentFaceIndex=r,t._filter===e.FILTER_PCF&&i.setColorWrite(!1)}),this._shadowMap.customRenderFunction=this._renderForShadowMap.bind(this),this._shadowMap.onAfterUnbindObservable.add(function(){if(t._filter===e.FILTER_PCF&&i.setColorWrite(!0),t.useBlurExponentialShadowMap||t.useBlurCloseExponentialShadowMap){var r=t.getShadowMapForRendering();r&&t._scene.postProcessManager.directRender(t._blurPostProcesses,r.getInternalTexture(),!0)}});var r=new o.f(0,0,0,0),n=new o.f(1,1,1,1);this._shadowMap.onClearObservable.add(function(i){t._filter===e.FILTER_PCF?i.clear(n,!1,!0,!1):t.useExponentialShadowMap||t.useBlurExponentialShadowMap?i.clear(r,!0,!0,!1):i.clear(n,!0,!0,!1)})},e.prototype._initializeBlurRTTAndPostProcesses=function(){var e=this,t=this._scene.getEngine(),i=this._mapSize/this.blurScale;this.useKernelBlur&&1===this.blurScale||(this._shadowMap2=new wi(this._light.name+"_shadowMap2",i,this._scene,!1,!0,this._textureType),this._shadowMap2.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap2.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap2.updateSamplingMode(Ge.a.BILINEAR_SAMPLINGMODE)),this.useKernelBlur?(this._kernelBlurXPostprocess=new Gr(this._light.name+"KernelBlurX",new o.w(1,0),this.blurKernel,1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.width=i,this._kernelBlurXPostprocess.height=i,this._kernelBlurXPostprocess.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._shadowMap)}),this._kernelBlurYPostprocess=new Gr(this._light.name+"KernelBlurY",new o.w(0,1),this.blurKernel,1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.autoClear=!1,this._kernelBlurYPostprocess.autoClear=!1,this._textureType===_.a.TEXTURETYPE_UNSIGNED_INT&&(this._kernelBlurXPostprocess.packedFloat=!0,this._kernelBlurYPostprocess.packedFloat=!0),this._blurPostProcesses=[this._kernelBlurXPostprocess,this._kernelBlurYPostprocess]):(this._boxBlurPostprocess=new Ot(this._light.name+"DepthBoxBlur","depthBoxBlur",["screenSize","boxOffset"],[],1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,"#define OFFSET "+this._blurBoxOffset,this._textureType),this._boxBlurPostprocess.onApplyObservable.add(function(t){t.setFloat2("screenSize",i,i),t.setTexture("textureSampler",e._shadowMap)}),this._boxBlurPostprocess.autoClear=!1,this._blurPostProcesses=[this._boxBlurPostprocess])},e.prototype._renderForShadowMap=function(e,t,i,r){var n,o=this._scene.getEngine();if(r.length){for(o.setColorWrite(!1),n=0;n=s.length)return void(e&&e(i));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(i){t.forceCompilation(function(){i()},e)})},e.prototype.isReady=function(e,t){var i=[];this._textureType!==_.a.TEXTURETYPE_UNSIGNED_INT&&i.push("#define FLOAT"),this.useExponentialShadowMap||this.useBlurExponentialShadowMap?i.push("#define ESM"):(this.usePercentageCloserFiltering||this.useContactHardeningShadow)&&i.push("#define DEPTHTEXTURE");var r=[gi.b.PositionKind],n=e.getMesh(),o=e.getMaterial();if(this.normalBias&&n.isVerticesDataPresent(gi.b.NormalKind)&&(r.push(gi.b.NormalKind),i.push("#define NORMAL"),n.nonUniformScaling&&i.push("#define NONUNIFORMSCALING"),this.getLight().getTypeID()===ni.a.LIGHTTYPEID_DIRECTIONALLIGHT&&i.push("#define DIRECTIONINLIGHTDATA")),o&&o.needAlphaTesting()){var s=o.getAlphaTestTexture();s&&(i.push("#define ALPHATEST"),n.isVerticesDataPresent(gi.b.UVKind)&&(r.push(gi.b.UVKind),i.push("#define UV1")),n.isVerticesDataPresent(gi.b.UV2Kind)&&1===s.coordinatesIndex&&(r.push(gi.b.UV2Kind),i.push("#define UV2")))}if(n.useBones&&n.computeBonesUsingShaders&&n.skeleton){r.push(gi.b.MatricesIndicesKind),r.push(gi.b.MatricesWeightsKind),n.numBoneInfluencers>4&&(r.push(gi.b.MatricesIndicesExtraKind),r.push(gi.b.MatricesWeightsExtraKind));var a=n.skeleton;i.push("#define NUM_BONE_INFLUENCERS "+n.numBoneInfluencers),a.isUsingTextureForMatrices?i.push("#define BONETEXTURE"):i.push("#define BonesPerMesh "+(a.bones.length+1))}else i.push("#define NUM_BONE_INFLUENCERS 0");var c=n.morphTargetManager,l=0;if(c&&c.numInfluencers>0&&(i.push("#define MORPHTARGETS"),l=c.numInfluencers,i.push("#define NUM_MORPH_INFLUENCERS "+l),jr.a.PrepareAttributesForMorphTargets(r,n,{NUM_MORPH_INFLUENCERS:l})),t&&(i.push("#define INSTANCES"),r.push("world0"),r.push("world1"),r.push("world2"),r.push("world3")),this.customShaderOptions&&this.customShaderOptions.defines)for(var u=0,h=this.customShaderOptions.defines;u0?this._setDefaultFixedFrustumShadowProjectionMatrix(e):this._setDefaultAutoExtendShadowProjectionMatrix(e,t,i)},t.prototype._setDefaultFixedFrustumShadowProjectionMatrix=function(e){var t=this.getScene().activeCamera;t&&o.j.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,i){var r=this.getScene().activeCamera;if(r){if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){var n=o.x.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=Number.MIN_VALUE,this._orthoTop=Number.MIN_VALUE,this._orthoBottom=Number.MAX_VALUE;for(var s=0;sthis._orthoRight&&(this._orthoRight=n.x),n.y>this._orthoTop&&(this._orthoTop=n.y)}}var u=this._orthoRight-this._orthoLeft,h=this._orthoTop-this._orthoBottom;o.j.OrthoOffCenterLHToRef(this._orthoLeft-u*this.shadowOrthoScale,this._orthoRight+u*this.shadowOrthoScale,this._orthoBottom-h*this.shadowOrthoScale,this._orthoTop+h*this.shadowOrthoScale,void 0!==this.shadowMinZ?this.shadowMinZ:r.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:r.maxZ,e)}},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,t),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,t),this)},t.prototype.getDepthMinZ=function(e){return 1},t.prototype.getDepthMaxZ=function(e){return 1},t.prototype.prepareLightSpecificDefines=function(e,t){e["DIRLIGHT"+t]=!0},l.c([Object(w.c)()],t.prototype,"shadowFrustumSize",null),l.c([Object(w.c)()],t.prototype,"shadowOrthoScale",null),l.c([Object(w.c)()],t.prototype,"autoUpdateExtends",void 0),t}(kn);F.a.AddNodeConstructor("Light_Type_0",function(e,t){return function(){return new Kn(e,o.x.Zero(),t)}});var Kn=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n._shadowAngle=Math.PI/2,n.position=i,n}return l.d(t,e),Object.defineProperty(t.prototype,"shadowAngle",{get:function(){return this._shadowAngle},set:function(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){var t=this.needCube();this._direction=e,this.needCube()!==t&&this._shadowGenerator&&this._shadowGenerator.recreateShadowMap()},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"PointLight"},t.prototype.getTypeID=function(){return ni.a.LIGHTTYPEID_POINTLIGHT},t.prototype.needCube=function(){return!this.direction},t.prototype.getShadowDirection=function(t){if(this.direction)return e.prototype.getShadowDirection.call(this,t);switch(t){case 0:return new o.x(1,0,0);case 1:return new o.x(-1,0,0);case 2:return new o.x(0,-1,0);case 3:return new o.x(0,1,0);case 4:return new o.x(0,0,1);case 5:return new o.x(0,0,-1)}return o.x.Zero()},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,i){var r=this.getScene().activeCamera;r&&o.j.PerspectiveFovLHToRef(this.shadowAngle,1,this.getDepthMinZ(r),this.getDepthMaxZ(r),e)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this},t.prototype.prepareLightSpecificDefines=function(e,t){e["POINTLIGHT"+t]=!0},l.c([Object(w.c)()],t.prototype,"shadowAngle",null),t}(kn);F.a.AddNodeConstructor("Light_Type_2",function(e,t){return function(){return new Qn(e,o.x.Zero(),o.x.Zero(),0,0,t)}});var Qn=function(e){function t(t,i,r,n,s,a){var c=e.call(this,t,a)||this;return c._innerAngle=0,c._projectionTextureMatrix=o.j.Zero(),c._projectionTextureLightNear=1e-6,c._projectionTextureLightFar=1e3,c._projectionTextureUpDirection=o.x.Up(),c._projectionTextureViewLightDirty=!0,c._projectionTextureProjectionLightDirty=!0,c._projectionTextureDirty=!0,c._projectionTextureViewTargetVector=o.x.Zero(),c._projectionTextureViewLightMatrix=o.j.Zero(),c._projectionTextureProjectionLightMatrix=o.j.Zero(),c._projectionTextureScalingMatrix=o.j.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),c.position=i,c.direction=r,c.angle=n,c.exponent=s,c}return l.d(t,e),Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._cosHalfAngle=Math.cos(.5*e),this._projectionTextureProjectionLightDirty=!0,this.forceProjectionMatrixCompute(),this._computeAngleValues()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"innerAngle",{get:function(){return this._innerAngle},set:function(e){this._innerAngle=e,this._computeAngleValues()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowAngleScale",{get:function(){return this._shadowAngleScale},set:function(e){this._shadowAngleScale=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureMatrix",{get:function(){return this._projectionTextureMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightNear",{get:function(){return this._projectionTextureLightNear},set:function(e){this._projectionTextureLightNear=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightFar",{get:function(){return this._projectionTextureLightFar},set:function(e){this._projectionTextureLightFar=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureUpDirection",{get:function(){return this._projectionTextureUpDirection},set:function(e){this._projectionTextureUpDirection=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTexture",{get:function(){return this._projectionTexture},set:function(e){this._projectionTexture=e,this._projectionTextureDirty=!0},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"SpotLight"},t.prototype.getTypeID=function(){return ni.a.LIGHTTYPEID_SPOTLIGHT},t.prototype._setDirection=function(t){e.prototype._setDirection.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setPosition=function(t){e.prototype._setPosition.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,i){var r=this.getScene().activeCamera;if(r){this._shadowAngleScale=this._shadowAngleScale||1;var n=this._shadowAngleScale*this._angle;o.j.PerspectiveFovLHToRef(n,1,this.getDepthMinZ(r),this.getDepthMaxZ(r),e)}},t.prototype._computeProjectionTextureViewLightMatrix=function(){this._projectionTextureViewLightDirty=!1,this._projectionTextureDirty=!0,this.position.addToRef(this.direction,this._projectionTextureViewTargetVector),o.j.LookAtLHToRef(this.position,this._projectionTextureViewTargetVector,this._projectionTextureUpDirection,this._projectionTextureViewLightMatrix)},t.prototype._computeProjectionTextureProjectionLightMatrix=function(){this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0;var e=this.projectionTextureLightFar,t=this.projectionTextureLightNear,i=e/(e-t),r=-i*t,n=1/Math.tan(this._angle/2);o.j.FromValuesToRef(n/1,0,0,0,0,n,0,0,0,0,i,1,0,0,r,0,this._projectionTextureProjectionLightMatrix)},t.prototype._computeProjectionTextureMatrix=function(){this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix,this._projectionTextureMatrix)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("vLightDirection",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype._computeAngleValues=function(){this._lightAngleScale=1/Math.max(.001,Math.cos(.5*this._innerAngle)-this._cosHalfAngle),this._lightAngleOffset=-this._cosHalfAngle*this._lightAngleScale},t.prototype.transferToEffect=function(e,t){var i;return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,this.exponent,t),i=o.x.Normalize(this.transformedDirection)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,this.exponent,t),i=o.x.Normalize(this.direction)),this._uniformBuffer.updateFloat4("vLightDirection",i.x,i.y,i.z,this._cosHalfAngle,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,this._lightAngleScale,this._lightAngleOffset,t),this.projectionTexture&&this.projectionTexture.isReady()&&(this._projectionTextureViewLightDirty&&this._computeProjectionTextureViewLightMatrix(),this._projectionTextureProjectionLightDirty&&this._computeProjectionTextureProjectionLightMatrix(),this._projectionTextureDirty&&this._computeProjectionTextureMatrix(),e.setMatrix("textureProjectionMatrix"+t,this._projectionTextureMatrix),e.setTexture("projectionLightSampler"+t,this.projectionTexture)),this},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._projectionTexture&&this._projectionTexture.dispose()},t.prototype.prepareLightSpecificDefines=function(e,t){e["SPOTLIGHT"+t]=!0,e["PROJECTEDLIGHTTEXTURE"+t]=!!this.projectionTexture},l.c([Object(w.c)()],t.prototype,"angle",null),l.c([Object(w.c)()],t.prototype,"innerAngle",null),l.c([Object(w.c)()],t.prototype,"shadowAngleScale",null),l.c([Object(w.c)()],t.prototype,"exponent",void 0),l.c([Object(w.c)()],t.prototype,"projectionTextureLightNear",null),l.c([Object(w.c)()],t.prototype,"projectionTextureLightFar",null),l.c([Object(w.c)()],t.prototype,"projectionTextureUpDirection",null),l.c([Object(w.l)("projectedLightTexture")],t.prototype,"_projectionTexture",void 0),t}(kn),qn=function(){function e(e,t,i){void 0===t&&(t=""),void 0===i&&(i="black");var r=this;this._renderingCanvas=e,this._loadingText=t,this._loadingDivBackgroundColor=i,this._resizeLoadingUI=function(){var e=r._renderingCanvas.getBoundingClientRect(),t=window.getComputedStyle(r._renderingCanvas).position;r._loadingDiv&&(r._loadingDiv.style.position="fixed"===t?"fixed":"absolute",r._loadingDiv.style.left=e.left+"px",r._loadingDiv.style.top=e.top+"px",r._loadingDiv.style.width=e.width+"px",r._loadingDiv.style.height=e.height+"px")}}return e.prototype.displayLoadingUI=function(){if(!this._loadingDiv){this._loadingDiv=document.createElement("div"),this._loadingDiv.id="babylonjsLoadingDiv",this._loadingDiv.style.opacity="0",this._loadingDiv.style.transition="opacity 1.5s ease",this._loadingDiv.style.pointerEvents="none",this._loadingTextDiv=document.createElement("div"),this._loadingTextDiv.style.position="absolute",this._loadingTextDiv.style.left="0",this._loadingTextDiv.style.top="50%",this._loadingTextDiv.style.marginTop="80px",this._loadingTextDiv.style.width="100%",this._loadingTextDiv.style.height="20px",this._loadingTextDiv.style.fontFamily="Arial",this._loadingTextDiv.style.fontSize="14px",this._loadingTextDiv.style.color="white",this._loadingTextDiv.style.textAlign="center",this._loadingTextDiv.innerHTML="Loading",this._loadingDiv.appendChild(this._loadingTextDiv),this._loadingTextDiv.innerHTML=this._loadingText;var e=document.createElement("style");e.type="text/css";e.innerHTML="@-webkit-keyframes spin1 { 0% { -webkit-transform: rotate(0deg);}\n 100% { -webkit-transform: rotate(360deg);}\n } @keyframes spin1 { 0% { transform: rotate(0deg);}\n 100% { transform: rotate(360deg);}\n }",document.getElementsByTagName("head")[0].appendChild(e);var t=new Image;t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAYq0lEQVR4Xu2dCZRcVZnHScAJUZSwjSOIbAJmEAZwQCCMoAInYRGIg8AwegQx7AFzUBBmzAFlE4EAwxz2GRk2w7AnAURZBiEOZgyEQDAQAjmEJqTpNd3V1V3Vmd+/6utKV7/1vnpVXd2p/zn3vOV+27vfu/fd/W3QQAPrBZqbm7fJZrN79vf3T+/r67uf4wO9vb37WXQDIwWtra0Tenp6voQTv5XP56/BkfcR3iLk1g6B7hEeI+zP5V+ZiAbqBZ2dnZ8lV+6Gg87CobfhpOc4byf0FjwYE9DneBkWcXrM2tmzNzTxDdQKJPyETCazI46YgiMuI9zJuXJltuChFIHsP/PSfIfTjU19A2mira1tcxy3ey6XO5vEnkV4kes11XBmENDVj97XOT2O03FmWgMuoNLzGRJva8IUnPkzjjcT/kLoKCZzfQB7XiX8M2G8md7AUJgzJ+Z6e88gZ1xGuj3HsY17PcVkrG9gp7CUF/F8PUvxqdZDrFq1ahNVfKjwTCYxZuDE2wjKlc2WViMePM+HPNsFPOdf22OPblD5OZQHvphnV65cjTMzxaQY3eA5V9OO/hmnm1lSjE7woFsQbiXki4++foHnXkW4mLC1JUl947333tsMY3emqfB9jtPJlXN5U0+bOXPmWCPxgOccSy4+AfqPio+9/oFnbyatbqVE28GSZfjQ1NT0KQzaHMcdyPfyaNoE12HcvdxT29K3Fkv8A2vWrPmcifAFZNtD91yRY+SBZ+9UsMtEgD+jTpeenp6JXI6xpKkuUDqRcA6Kr0Wpens+InQTnIpV6Fdi+BQT64ulS5eOIzefD62na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eXbhsdB2OdGiCeX8+/2ecqgnmk/VXNYtqYLSAnNposzpjgw3+H/belpVa8J7TAAAAAElFTkSuQmCC",t.style.position="absolute",t.style.left="50%",t.style.top="50%",t.style.marginLeft="-60px",t.style.marginTop="-60px",t.style.animation="spin1 2s infinite ease-in-out",t.style.webkitAnimation="spin1 2s infinite ease-in-out",t.style.transformOrigin="50% 50%",t.style.webkitTransformOrigin="50% 50%",this._loadingDiv.appendChild(t),this._resizeLoadingUI(),window.addEventListener("resize",this._resizeLoadingUI),this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor,document.body.appendChild(this._loadingDiv),this._loadingDiv.style.opacity="1"}},e.prototype.hideLoadingUI=function(){var e=this;if(this._loadingDiv){this._loadingDiv.style.opacity="0",this._loadingDiv.addEventListener("transitionend",function(){e._loadingDiv&&(e._loadingDiv.parentElement&&e._loadingDiv.parentElement.removeChild(e._loadingDiv),window.removeEventListener("resize",e._resizeLoadingUI),e._loadingDiv=null)})}},Object.defineProperty(e.prototype,"loadingUIText",{get:function(){return this._loadingText},set:function(e){this._loadingText=e,this._loadingTextDiv&&(this._loadingTextDiv.innerHTML=this._loadingText)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadingUIBackgroundColor",{get:function(){return this._loadingDivBackgroundColor},set:function(e){this._loadingDivBackgroundColor=e,this._loadingDiv&&(this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor)},enumerable:!0,configurable:!0}),e}();_e.b.DefaultLoadingScreenFactory=function(e){return new qn(e)};var Zn=i(56),Jn=i(63),$n=function(){function e(){}return e.ConvertPanoramaToCubemap=function(e,t,i,r){if(!e)throw"ConvertPanoramaToCubemap: input cannot be null";if(e.length!=t*i*3)throw"ConvertPanoramaToCubemap: input size is wrong";return{front:this.CreateCubemapTexture(r,this.FACE_FRONT,e,t,i),back:this.CreateCubemapTexture(r,this.FACE_BACK,e,t,i),left:this.CreateCubemapTexture(r,this.FACE_LEFT,e,t,i),right:this.CreateCubemapTexture(r,this.FACE_RIGHT,e,t,i),up:this.CreateCubemapTexture(r,this.FACE_UP,e,t,i),down:this.CreateCubemapTexture(r,this.FACE_DOWN,e,t,i),size:r,type:_.a.TEXTURETYPE_FLOAT,format:_.a.TEXTUREFORMAT_RGB,gammaSpace:!1}},e.CreateCubemapTexture=function(e,t,i,r,n){for(var o=new ArrayBuffer(e*e*4*3),s=new Float32Array(o),a=t[1].subtract(t[0]).scale(1/e),c=t[3].subtract(t[2]).scale(1/e),l=1/e,u=0,h=0;hMath.PI;)n-=2*Math.PI;var s=n/Math.PI,a=o/Math.PI;s=.5*s+.5;var c=Math.round(s*i);c<0?c=0:c>=i&&(c=i-1);var l=Math.round(a*r);l<0?l=0:l>=r&&(l=r-1);var u=r-l-1;return{r:t[u*i*3+3*c+0],g:t[u*i*3+3*c+1],b:t[u*i*3+3*c+2]}},e.FACE_FRONT=[new o.x(-1,-1,-1),new o.x(1,-1,-1),new o.x(-1,1,-1),new o.x(1,1,-1)],e.FACE_BACK=[new o.x(1,-1,1),new o.x(-1,-1,1),new o.x(1,1,1),new o.x(-1,1,1)],e.FACE_RIGHT=[new o.x(1,-1,-1),new o.x(1,-1,1),new o.x(1,1,-1),new o.x(1,1,1)],e.FACE_LEFT=[new o.x(-1,-1,1),new o.x(-1,-1,-1),new o.x(-1,1,1),new o.x(-1,1,-1)],e.FACE_DOWN=[new o.x(-1,1,-1),new o.x(1,1,-1),new o.x(-1,1,1),new o.x(1,1,1)],e.FACE_UP=[new o.x(-1,-1,1),new o.x(1,-1,1),new o.x(-1,-1,-1),new o.x(1,-1,-1)],e}(),eo=function(){function e(){}return e.Ldexp=function(e,t){return t>1023?e*Math.pow(2,1023)*Math.pow(2,t-1023):t<-1074?e*Math.pow(2,-1074)*Math.pow(2,t+1074):e*Math.pow(2,t)},e.Rgbe2float=function(e,t,i,r,n,o){n>0?(n=this.Ldexp(1,n-136),e[o+0]=t*n,e[o+1]=i*n,e[o+2]=r*n):(e[o+0]=0,e[o+1]=0,e[o+2]=0)},e.readStringLine=function(e,t){for(var i="",r="",n=t;n32767)throw"HDR Bad header format, unsupported size";return{height:t,width:i,dataPosition:s+=r.length+1}},e.GetCubeMapTextureData=function(e,t){var i=new Uint8Array(e),r=this.RGBE_ReadHeader(i),n=this.RGBE_ReadPixels_RLE(i,r);return $n.ConvertPanoramaToCubemap(n,r.width,r.height,t)},e.RGBE_ReadPixels=function(e,t){return this.RGBE_ReadPixels_RLE(e,t)},e.RGBE_ReadPixels_RLE=function(e,t){for(var i,r,n,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),_=new ArrayBuffer(t.width*t.height*4*3),m=new Float32Array(_);a>0;){if(i=e[l++],r=e[l++],n=e[l++],o=e[l++],2!=i||2!=r||128&n)throw"HDR Bad header format, not RLE";if((n<<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=i-128)||s>h-u)throw"HDR Bad Format, bad scanline data (run)";for(;s-- >0;)p[u++]=r}else{if(0==(s=i)||s>h-u)throw"HDR Bad Format, bad scanline data (non-run)";if(p[u++]=r,--s>0)for(var g=0;g255){var g=255/m;f*=g,p*=g,_*=g}c[3*d+0]=f,c[3*d+1]=p,c[3*d+2]=_}c?a.push(c):a.push(h)}return a},null,this._onLoad,this._onError))},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=new t(this.url,e,this._size,this._noMipmap,this._generateHarmonics,this.gammaSpace);return i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i.coordinatesIndex=this.coordinatesIndex,i.coordinatesMode=this.coordinatesMode,i},t.prototype.delayLoad=function(){this.delayLoadState===_e.b.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=_e.b.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.MATERIAL_TextureDirtyFlag,function(e){return-1!==e.getActiveTextures().indexOf(t)})},t.Parse=function(e,i,r){var n=null;return e.name&&!e.isRenderTarget&&((n=new t(r+e.name,i,e.size,e.noMipmap,e.generateHarmonics,e.useInGammaSpace)).name=e.name,n.hasAlpha=e.hasAlpha,n.level=e.level,n.coordinatesMode=e.coordinatesMode,n.isBlocking=e.isBlocking),n&&(e.boundingBoxPosition&&(n.boundingBoxPosition=o.x.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(n.boundingBoxSize=o.x.FromArray(e.boundingBoxSize)),e.rotationY&&(n.rotationY=e.rotationY)),n},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}(Fr.a);s.a.RegisteredTypes["BABYLON.HDRCubeTexture"]=io;var ro=function(){function e(e,t,i){void 0===t&&(t=0),void 0===i&&(i=null),this.name=e,this.animations=new Array,this._positions=null,this._normals=null,this._tangents=null,this.onInfluenceChanged=new n.c,this._onDataLayoutChanged=new n.c,this._animationPropertiesOverride=null,this._scene=i||R.a.LastCreatedScene,this.influence=t}return Object.defineProperty(e.prototype,"influence",{get:function(){return this._influence},set:function(e){if(this._influence!==e){var t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers&&this.onInfluenceChanged.notifyObservers(0===t||0===e)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPositions",{get:function(){return!!this._positions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNormals",{get:function(){return!!this._normals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTangents",{get:function(){return!!this._tangents},enumerable:!0,configurable:!0}),e.prototype.setPositions=function(e){var t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getPositions=function(){return this._positions},e.prototype.setNormals=function(e){var t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getNormals=function(){return this._normals},e.prototype.setTangents=function(e){var t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getTangents=function(){return this._tangents},e.prototype.serialize=function(){var e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),w.a.AppendSerializedAnimations(this,e),e},e.prototype.getClassName=function(){return"MorphTarget"},e.Parse=function(t){var i=new e(t.name,t.influence);if(i.setPositions(t.positions),null!=t.id&&(i.id=t.id),t.normals&&i.setNormals(t.normals),t.tangents&&i.setTangents(t.tangents),t.animations)for(var r=0;r=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._syncActiveTargets(!0))},e.prototype.serialize=function(){var e={};e.id=this.uniqueId,e.targets=[];for(var t=0,i=this._targets;t-1){var i=this._impostors.splice(t,1);i.length&&(i[0].physicsBody=null)}},e.prototype.addJoint=function(e,t,i){var r={mainImpostor:e,connectedImpostor:t,joint:i};i.physicsPlugin=this._physicsPlugin,this._joints.push(r),this._physicsPlugin.generateJoint(r)},e.prototype.removeJoint=function(e,t,i){var r=this._joints.filter(function(r){return r.connectedImpostor===t&&r.joint===i&&r.mainImpostor===e});r.length&&this._physicsPlugin.removeJoint(r[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;t1e3*i));a++);this.time+=r;for(var c=this.time%i/i,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}();ao.DefaultPluginFactory=function(){return new co};var lo=function(){function e(e,t){void 0===t&&(t=OIMO),this.name="OimoJSPlugin",this._tmpImpostorsArray=[],this._tmpPositionVector=o.x.Zero(),this.BJSOIMO=t,this.world=new this.BJSOIMO.World({iterations:e}),this.world.clear()}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 i=this;t.forEach(function(e){e.beforeStep()}),this.world.step(),t.forEach(function(e){e.afterStep(),i._tmpImpostorsArray[e.uniqueId]=e});for(var r=this.world.contacts;null!==r;)if(!r.touching||r.body1.sleeping||r.body2.sleeping){var n=this._tmpImpostorsArray[+r.body1.name],o=this._tmpImpostorsArray[+r.body2.name];n&&o?(n.onCollide({body:o.physicsBody}),o.onCollide({body:n.physicsBody}),r=r.next):r=r.next}else r=r.next},e.prototype.applyImpulse=function(e,t,i){var r=e.physicsBody.mass;e.physicsBody.applyImpulse(i.scale(this.world.invScale),t.scale(this.world.invScale*r))},e.prototype.applyForce=function(e,t,i){p.a.Warn("Oimo doesn't support applying force. Using impule instead."),this.applyImpulse(e,t,i)},e.prototype.generatePhysicsBody=function(e){var t=this;if(e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){var i={name:e.uniqueId,config:[e.getParam("mass")||1,e.getParam("friction"),e.getParam("restitution")],size:[],type:[],pos:[],posShape:[],rot:[],rotShape:[],move:0!==e.getParam("mass"),density:e.getParam("mass"),friction:e.getParam("friction"),restitution:e.getParam("restitution"),world:this.world},r=[e];(a=e.object).getChildMeshes&&a.getChildMeshes().forEach(function(e){e.physicsImpostor&&r.push(e.physicsImpostor)});var n=function(e){return Math.max(e,ao.Epsilon)},s=new o.q;r.forEach(function(r){if(r.object.rotationQuaternion){var o=r.object.rotationQuaternion;s=o.clone();var a=o.toEulerAngles(),c=r.getObjectExtendSize();if(r===e){var l=e.getObjectCenter();e.object.getAbsolutePivotPoint().subtractToRef(l,t._tmpPositionVector),t._tmpPositionVector.divideInPlace(e.object.scaling),i.pos.push(l.x),i.pos.push(l.y),i.pos.push(l.z),i.posShape.push(0,0,0),i.rotShape.push(0,0,0)}else{var u=r.object.getAbsolutePosition().subtract(e.object.getAbsolutePosition());i.posShape.push(u.x),i.posShape.push(u.y),i.posShape.push(u.z),i.pos.push(0,0,0),i.rotShape.push(57.29577951308232*a.x),i.rotShape.push(57.29577951308232*a.y),i.rotShape.push(57.29577951308232*a.z)}switch(r.type){case oo.a.ParticleImpostor:p.a.Warn("No Particle support in OIMO.js. using SphereImpostor instead");case oo.a.SphereImpostor:var h=c.x,d=c.y,f=c.z,_=Math.max(n(h),n(d),n(f))/2;i.type.push("sphere"),i.size.push(_),i.size.push(_),i.size.push(_);break;case oo.a.CylinderImpostor:var m=n(c.x)/2,g=n(c.y);i.type.push("cylinder"),i.size.push(m),i.size.push(g),i.size.push(g);break;case oo.a.PlaneImpostor:case oo.a.BoxImpostor:default:m=n(c.x),g=n(c.y);var v=n(c.z);i.type.push("box"),i.size.push(m),i.size.push(g),i.size.push(v)}r.object.rotationQuaternion=o}}),e.physicsBody=this.world.add(i),e.physicsBody.resetQuaternion(s),e.physicsBody.updatePosition(0)}else this._tmpPositionVector.copyFromFloats(0,0,0);var a;e.setDeltaPosition(this._tmpPositionVector)}},e.prototype.removePhysicsBody=function(e){this.world.removeRigidBody(e.physicsBody)},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(t&&i){var r,n=e.joint.jointData,o=n.nativeParams||{},s={body1:t,body2:i,axe1:o.axe1||(n.mainAxis?n.mainAxis.asArray():null),axe2:o.axe2||(n.connectedAxis?n.connectedAxis.asArray():null),pos1:o.pos1||(n.mainPivot?n.mainPivot.asArray():null),pos2:o.pos2||(n.connectedPivot?n.connectedPivot.asArray():null),min:o.min,max:o.max,collision:o.collision||n.collision,spring:o.spring,world:this.world};switch(e.joint.type){case so.e.BallAndSocketJoint:r="jointBall";break;case so.e.SpringJoint:p.a.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");var a=n;s.min=a.length||s.min,s.max=Math.max(s.min,s.max);case so.e.DistanceJoint:r="jointDistance",s.max=n.maxDistance;break;case so.e.PrismaticJoint:r="jointPrisme";break;case so.e.SliderJoint:r="jointSlide";break;case so.e.WheelJoint:r="jointWheel";break;case so.e.HingeJoint:default:r="jointHinge"}s.type=r,e.joint.physicsJoint=this.world.add(s)}},e.prototype.removeJoint=function(e){try{this.world.removeJoint(e.joint.physicsJoint)}catch(e){p.a.Warn(e)}},e.prototype.isSupported=function(){return void 0!==this.BJSOIMO},e.prototype.setTransformationFromPhysicsBody=function(e){e.physicsBody.sleeping||(e.object.position.copyFrom(e.physicsBody.getPosition()),e.object.rotationQuaternion&&e.object.rotationQuaternion.copyFrom(e.physicsBody.getQuaternion()))},e.prototype.setPhysicsBodyTransformation=function(e,t,i){var r=e.physicsBody;r.position.copy(t),r.orientation.copy(i),r.syncShapes(),r.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 o.x(t.x,t.y,t.z):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.angularVelocity;return t?new o.x(t.x,t.y,t.z):null},e.prototype.setBodyMass=function(e,t){var i=0===t;e.physicsBody.shapes.density=i?1:t,e.physicsBody.setupMass(i?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,i){e.physicsJoint.limitMotor.upperLimit=t,void 0!==i&&(e.physicsJoint.limitMotor.lowerLimit=i)},e.prototype.setMotor=function(e,t,i,r){void 0!==i?p.a.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter"):i=1e6,t*=-1;var n=r?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;n&&n.setMotor(t,i)},e.prototype.setLimit=function(e,t,i,r){var n=r?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;n&&n.setLimit(t,void 0===i?-t:i)},e.prototype.syncMeshWithImpostor=function(e,t){var i=t.physicsBody;e.position.x=i.position.x,e.position.y=i.position.y,e.position.z=i.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=i.orientation.x,e.rotationQuaternion.y=i.orientation.y,e.rotationQuaternion.z=i.orientation.z,e.rotationQuaternion.w=i.orientation.s)},e.prototype.getRadius=function(e){return e.physicsBody.shapes.radius},e.prototype.getBoxSizeToRef=function(e,t){var i=e.physicsBody.shapes;t.x=2*i.halfWidth,t.y=2*i.halfHeight,t.z=2*i.halfDepth},e.prototype.dispose=function(){this.world.clear()},e}();r.a.prototype.removeReflectionProbe=function(e){if(!this.reflectionProbes)return-1;var t=this.reflectionProbes.indexOf(e);return-1!==t&&this.reflectionProbes.splice(t,1),t},r.a.prototype.addReflectionProbe=function(e){this.reflectionProbes||(this.reflectionProbes=[]),this.reflectionProbes.push(e)};var uo=function(){function e(e,t,i,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var s=this;this.name=e,this._viewMatrix=o.j.Identity(),this._target=o.x.Zero(),this._add=o.x.Zero(),this._invertYAxis=!1,this.position=o.x.Zero(),this._scene=i,this._scene.reflectionProbes||(this._scene.reflectionProbes=new Array),this._scene.reflectionProbes.push(this),this._renderTargetTexture=new wi(e,t,i,r,!0,n?_.a.TEXTURETYPE_FLOAT:_.a.TEXTURETYPE_UNSIGNED_INT,!0),this._renderTargetTexture.onBeforeRenderObservable.add(function(e){switch(e){case 0:s._add.copyFromFloats(1,0,0);break;case 1:s._add.copyFromFloats(-1,0,0);break;case 2:s._add.copyFromFloats(0,s._invertYAxis?1:-1,0);break;case 3:s._add.copyFromFloats(0,s._invertYAxis?-1:1,0);break;case 4:s._add.copyFromFloats(0,0,1);break;case 5:s._add.copyFromFloats(0,0,-1)}s._attachedMesh&&s.position.copyFrom(s._attachedMesh.getAbsolutePosition()),s.position.addToRef(s._add,s._target),o.j.LookAtLHToRef(s.position,s._target,o.x.Up(),s._viewMatrix),i.activeCamera&&(s._projectionMatrix=o.j.PerspectiveFovLH(Math.PI/2,1,i.activeCamera.minZ,i.activeCamera.maxZ),i.setTransformMatrix(s._viewMatrix,s._projectionMatrix)),i._forcedViewPosition=s.position}),this._renderTargetTexture.onAfterUnbindObservable.add(function(){i._forcedViewPosition=null,i.updateTransformMatrix(!0)})}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._renderTargetTexture.samples},set:function(e){this._renderTargetTexture.samples=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._renderTargetTexture.refreshRate},set:function(e){this._renderTargetTexture.refreshRate=e},enumerable:!0,configurable:!0}),e.prototype.getScene=function(){return this._scene},Object.defineProperty(e.prototype,"cubeTexture",{get:function(){return this._renderTargetTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderList",{get:function(){return this._renderTargetTexture.renderList},enumerable:!0,configurable:!0}),e.prototype.attachToMesh=function(e){this._attachedMesh=e},e.prototype.setRenderingAutoClearDepthStencil=function(e,t){this._renderTargetTexture.setRenderingAutoClearDepthStencil(e,t)},e.prototype.dispose=function(){var e=this._scene.reflectionProbes.indexOf(this);-1!==e&&this._scene.reflectionProbes.splice(e,1),this._renderTargetTexture&&(this._renderTargetTexture.dispose(),this._renderTargetTexture=null)},e.prototype.toString=function(e){var t="Name: "+this.name;return e&&(t+=", position: "+this.position.toString(),this._attachedMesh&&(t+=", attached mesh: "+this._attachedMesh.name)),t},e.prototype.getClassName=function(){return"ReflectionProbe"},e.prototype.serialize=function(){var e=w.a.Serialize(this,this._renderTargetTexture.serialize());return e.isReflectionProbe=!0,e},e.Parse=function(t,i,r){var n=null;if(i.reflectionProbes)for(var o=0;o0){for(var Y=0;Y0){for(var Q=0;Q-1&&void 0!==u.skeletons&&null!==u.skeletons)if(!1===g.indexOf(y.skeletonId)>-1)for(var O=0,I=u.skeletons.length;O1,r.wrapU=_.a.TEXTURE_CLAMP_ADDRESSMODE,r.wrapV=_.a.TEXTURE_CLAMP_ADDRESSMODE,r.wrapR=_.a.TEXTURE_CLAMP_ADDRESSMODE,r.anisotropicFilteringLevel=1,r._texture=r._getFromCache(t,!0),r._texture||(i.useDelayedTextureLoading?r.delayLoadState=_.a.DELAYLOADSTATE_NOTLOADED:r.loadTexture()),r):r}return l.d(t,e),t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.load3dlTexture=function(){var e,i=this._engine;e=1===i.webGLVersion?i.createRawTexture(null,1,1,_.a.TEXTUREFORMAT_RGBA,!1,!1,_.a.TEXTURE_BILINEAR_SAMPLINGMODE):i.createRawTexture3D(null,1,1,1,_.a.TEXTUREFORMAT_RGBA,!1,!1,_.a.TEXTURE_BILINEAR_SAMPLINGMODE),this._texture=e;var r=function(r){if("string"==typeof r){for(var n,o=null,s=null,a=r.split("\n"),c=0,l=0,u=0,h=0,d=0,f=0;f0&&(f+1)%4==0)o[f]=255;else{var b=s[f];o[f]=b/d*255}e.is3D?(e.updateSize(c,c,c),i.updateRawTexture3D(e,o,_.a.TEXTUREFORMAT_RGBA,!1)):(e.updateSize(c*c,c),i.updateRawTexture(e,o,_.a.TEXTUREFORMAT_RGBA,!1))}},n=this.getScene();return n?n._loadFile(this.url,r):this._engine._loadFile(this.url,r),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===_.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=_.a.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,!0),this._texture||this.loadTexture())},t.Parse=function(e,i){var r=null;return e.name&&!e.isRenderTarget&&((r=new t(e.name,i)).name=e.name,r.level=e.level),r},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}(Fr.a);s.a.RegisteredTypes["BABYLON.ColorGradingTexture"]=Eo;var xo=i(90),Ao=i(60);function Po(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var Ro=Po("DXT1"),So=Po("DXT3"),Co=Po("DXT5"),Mo=Po("DX10"),Oo=function(){function e(){}return e.GetDDSInfo=function(e){var t=new Int32Array(e,0,31),i=new Int32Array(e,0,35),r=1;131072&t[2]&&(r=Math.max(1,t[7]));var n=t[21],o=n===Mo?i[32]:0,s=_.a.TEXTURETYPE_UNSIGNED_INT;switch(n){case 113:s=_.a.TEXTURETYPE_HALF_FLOAT;break;case 116:s=_.a.TEXTURETYPE_FLOAT;break;case Mo:if(10===o){s=_.a.TEXTURETYPE_HALF_FLOAT;break}}return{width:t[4],height:t[3],mipmapCount:r,isFourCC:4==(4&t[20]),isRGB:64==(64&t[20]),isLuminance:131072==(131072&t[20]),isCube:512==(512&t[28]),isCompressed:n===Ro||n===So||n===Co,dxgiFormat:o,textureType:s}},e._ToHalfFloat=function(t){e._FloatView||(e._FloatView=new Float32Array(1),e._Int32View=new Int32Array(e._FloatView.buffer)),e._FloatView[0]=t;var i=e._Int32View[0],r=i>>16&32768,n=i>>12&2047,o=i>>23&255;return o<103?r:o>142?(r|=31744,r|=(255==o?0:1)&&8388607&i):o<113?r|=((n|=2048)>>114-o)+(n>>113-o&1):(r|=o-112<<10|n>>1,r+=1&n)},e._FromHalfFloat=function(e){var t=(32768&e)>>15,i=(31744&e)>>10,r=1023&e;return 0===i?(t?-1:1)*Math.pow(2,-14)*(r/Math.pow(2,10)):31==i?r?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,i-15)*(1+r/Math.pow(2,10))},e._GetHalfFloatAsFloatRGBAArrayBuffer=function(t,i,r,n,o,s){for(var a=new Float32Array(n),c=new Uint16Array(o,r),l=0,u=0;u>8)},e._GetRGBArrayBuffer=function(e,t,i,r,n,o,s,a){for(var c=new Uint8Array(r),l=new Uint8Array(n,i),u=0,h=0;h>8&255,P>>16&255,P>>24&255)))}var C=e._ExtractLongWordOrder(b[23]),M=e._ExtractLongWordOrder(b[24]),O=e._ExtractLongWordOrder(b[25]),I=e._ExtractLongWordOrder(b[26]);R&&(E=t._getRGBABufferInternalSizedFormat(n.textureType)),g=1,131072&b[2]&&!1!==o&&(g=Math.max(1,b[7]));for(var D=0;D0?n.sphericalPolynomial=to.a.ConvertCubeMapToSphericalPolynomial({size:b[4],right:l[0],left:l[1],up:l[2],down:l[3],front:l[4],back:l[5],format:_.a.TEXTUREFORMAT_RGBA,type:_.a.TEXTURETYPE_FLOAT,gammaSpace:!1}):n.sphericalPolynomial=void 0}else p.a.Error("Compressed textures are not supported on this platform.");else p.a.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");else p.a.Error("Invalid magic number in DDS header")},e.StoreLODInAlphaChannel=!1,e}();_e.b.prototype.createPrefilteredCubeTexture=function(e,t,i,r,n,o,s,a,c){var l=this;void 0===n&&(n=null),void 0===o&&(o=null),void 0===a&&(a=null),void 0===c&&(c=!0);return this.createCubeTexture(e,t,null,!1,function(e){if(e){var o=e.texture;if(c?e.info.sphericalPolynomial&&(o._sphericalPolynomial=e.info.sphericalPolynomial):o._sphericalPolynomial=new Ao.b,o._dataSource=Oi.a.DATASOURCE_CUBEPREFILTERED,l.getCaps().textureLOD)n&&n(o);else{var s=l._gl,a=e.width;if(a){for(var u=[],h=0;h<3;h++){var d=1-h/2,f=r,_=D.a.Log2(a)*i+r,m=f+(_-f)*d,g=Math.round(Math.min(Math.max(m,0),_)),v=new Oi.a(l,Oi.a.DATASOURCE_TEMP);if(v.type=o.type,v.format=o.format,v.width=Math.pow(2,Math.max(D.a.Log2(a)-g,0)),v.height=v.width,v.isCube=!0,l._bindTextureDirectly(s.TEXTURE_CUBE_MAP,v,!0),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),e.isDDS){var y=e.info,b=e.data;l._unpackFlipY(y.isCompressed),Oo.UploadDDSLevels(l,v,b,y,!0,6,g)}else p.a.Warn("DDS is the only prefiltered cube map supported so far.");l._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null);var T=new Fr.a(t);T.isCube=!0,T._texture=v,v.isReady=!0,u.push(T)}o._lodTextureHigh=u[2],o._lodTextureMid=u[1],o._lodTextureLow=u[0],n&&n(o)}}}else n&&n(null)},o,s,a,c,i,r)};var Io=function(){function e(){this.supportCascades=!0}return e.prototype.canLoad=function(e,t,i,r,n){return 0===e.indexOf(".dds")},e.prototype.transformUrl=function(e,t){return e},e.prototype.getFallbackTextureUrl=function(e,t){return null},e.prototype.loadCubeData=function(e,t,i,r,n){var o,s=t.getEngine(),a=!1;if(Array.isArray(e))for(var c=0;c1)&&t.generateMipMaps,s._unpackFlipY(o.isCompressed),Oo.UploadDDSLevels(s,t,l,o,a,6,-1,c),o.isFourCC||1!==o.mipmapCount||s.generateMipMapsForCubemap(t)}else{var u=e;o=Oo.GetDDSInfo(u),t.width=o.width,t.height=o.height,i&&(o.sphericalPolynomial=new Ao.b),a=(o.isRGB||o.isLuminance||o.mipmapCount>1)&&t.generateMipMaps,s._unpackFlipY(o.isCompressed),Oo.UploadDDSLevels(s,t,u,o,a,6),o.isFourCC||1!==o.mipmapCount||s.generateMipMapsForCubemap(t)}s._setCubeMapTextureParams(a),t.isReady=!0,r&&r({isDDS:!0,width:t.width,info:o,data:e,texture:t})},e.prototype.loadData=function(e,t,i){var r=Oo.GetDDSInfo(e),n=(r.isRGB||r.isLuminance||r.mipmapCount>1)&&t.generateMipMaps&&r.width>>r.mipmapCount-1==1;i(r.width,r.height,n,r.isFourCC,function(){Oo.UploadDDSLevels(t.getEngine(),t,e,r,n,1)})},e}();_e.b._TextureLoaders.push(new Io);var Do="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include\nvoid main(void)\n{\ngl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);\n}";Ct.a.ShadersStore.rgbdEncodePixelShader=Do;var wo="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include\nvoid main(void)\n{\ngl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);\n}";Ct.a.ShadersStore.rgbdDecodePixelShader=wo;var Lo=function(){function e(){}return e.GetEnvInfo=function(t){for(var i=new DataView(t),r=0,n=0;n-1?e.substring(0,i):e)+t},e.prototype.getFallbackTextureUrl=function(e,t){var i=new RegExp(t+"$");return e.replace(i,"")},e.prototype.loadCubeData=function(e,t,i,r,n){if(!Array.isArray(e)){t._invertVScale=!t.invertY;var o=t.getEngine(),s=new No(e,6),a=s.numberOfMipmapLevels>1&&t.generateMipMaps;o._unpackFlipY(!0),s.uploadLevels(t,t.generateMipMaps),t.width=s.pixelWidth,t.height=s.pixelHeight,o._setCubeMapTextureParams(a),t.isReady=!0}},e.prototype.loadData=function(e,t,i){t._invertVScale=!t.invertY;var r=new No(e,1);i(r.pixelWidth,r.pixelHeight,!1,!0,function(){r.uploadLevels(t,t.generateMipMaps)},r.isInvalid)},e}();_e.b._TextureLoaders.unshift(new Bo);var Uo=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,i){if(i.length<19)p.a.Error("Unable to load TGA file - Not enough data to contain header");else{var r=18,n=e.GetTGAHeader(i);if(n.id_length+r>i.length)p.a.Error("Unable to load TGA file - Not enough data");else{r+=n.id_length;var o,s=!1,a=!1,c=!1;switch(n.image_type){case e._TYPE_RLE_INDEXED:s=!0;case e._TYPE_INDEXED:a=!0;break;case e._TYPE_RLE_RGB:s=!0;case e._TYPE_RGB:break;case e._TYPE_RLE_GREY:s=!0;case e._TYPE_GREY:c=!0}var l,u,h,d,f,_,m,g=n.pixel_size>>3,v=n.width*n.height*g;if(a&&(l=i.subarray(r,r+=n.colormap_length*(n.colormap_size>>3))),s){var y,b,T;o=new Uint8Array(v);for(var E=0,x=new Uint8Array(g);r>e._ORIGIN_SHIFT){default:case e._ORIGIN_UL:u=0,d=1,m=n.width,h=0,f=1,_=n.height;break;case e._ORIGIN_BL:u=0,d=1,m=n.width,h=n.height-1,f=-1,_=-1;break;case e._ORIGIN_UR:u=n.width-1,d=-1,m=-1,h=0,f=1,_=n.height;break;case e._ORIGIN_BR:u=n.width-1,d=-1,m=-1,h=n.height-1,f=-1,_=-1}var A=e["_getImageData"+(c?"Grey":"")+n.pixel_size+"bits"](n,l,o,h,f,_,u,d,m);t.getEngine()._uploadDataToTextureDirectly(t,A)}}},e._getImageData8bits=function(e,t,i,r,n,o,s,a,c){var l,u,h,d=i,f=t,p=e.width,_=e.height,m=0,g=new Uint8Array(p*_*4);for(h=r;h!==o;h+=n)for(u=s;u!==c;u+=a,m++)l=d[m],g[4*(u+p*h)+3]=255,g[4*(u+p*h)+2]=f[3*l+0],g[4*(u+p*h)+1]=f[3*l+1],g[4*(u+p*h)+0]=f[3*l+2];return g},e._getImageData16bits=function(e,t,i,r,n,o,s,a,c){var l,u,h,d=i,f=e.width,p=e.height,_=0,m=new Uint8Array(f*p*4);for(h=r;h!==o;h+=n)for(u=s;u!==c;u+=a,_+=2){var g=255*((31744&(l=d[_+0]+(d[_+1]<<8)))>>10)/31|0,v=255*((992&l)>>5)/31|0,y=255*(31&l)/31|0;m[4*(u+f*h)+0]=g,m[4*(u+f*h)+1]=v,m[4*(u+f*h)+2]=y,m[4*(u+f*h)+3]=32768&l?0:255}return m},e._getImageData24bits=function(e,t,i,r,n,o,s,a,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=r;u!==o;u+=n)for(l=s;l!==c;l+=a,p+=3)_[4*(l+d*u)+3]=255,_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+1]=h[p+1],_[4*(l+d*u)+0]=h[p+2];return _},e._getImageData32bits=function(e,t,i,r,n,o,s,a,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=r;u!==o;u+=n)for(l=s;l!==c;l+=a,p+=4)_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+1]=h[p+1],_[4*(l+d*u)+0]=h[p+2],_[4*(l+d*u)+3]=h[p+3];return _},e._getImageDataGrey8bits=function(e,t,i,r,n,o,s,a,c){var l,u,h,d=i,f=e.width,p=e.height,_=0,m=new Uint8Array(f*p*4);for(h=r;h!==o;h+=n)for(u=s;u!==c;u+=a,_++)l=d[_],m[4*(u+f*h)+0]=l,m[4*(u+f*h)+1]=l,m[4*(u+f*h)+2]=l,m[4*(u+f*h)+3]=255;return m},e._getImageDataGrey16bits=function(e,t,i,r,n,o,s,a,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=r;u!==o;u+=n)for(l=s;l!==c;l+=a,p+=2)_[4*(l+d*u)+0]=h[p+0],_[4*(l+d*u)+1]=h[p+0],_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+3]=h[p+1];return _},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}(),Vo=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e,t,i,r,n){return 0===e.indexOf(".tga")},e.prototype.transformUrl=function(e,t){return e},e.prototype.getFallbackTextureUrl=function(e,t){return null},e.prototype.loadCubeData=function(e,t,i,r,n){throw".env not supported in Cube."},e.prototype.loadData=function(e,t,i){var r=new Uint8Array(e),n=Uo.GetTGAHeader(r);i(n.width,n.height,t.generateMipMaps,!1,function(){Uo.UploadContent(t,r)})},e}();_e.b._TextureLoaders.push(new Vo);var Go=function(e){function t(t,i,r,n,o){var s=this,a=!(!o||!o.generateMipMaps)&&o.generateMipMaps,c=!(!o||!o.generateDepthTexture)&&o.generateDepthTexture,l=!o||void 0===o.doNotChangeAspectRatio||o.doNotChangeAspectRatio;if((s=e.call(this,t,i,n,a,l)||this)._engine=n.getEngine(),s.isSupported){for(var u=[],h=[],d=0;d1||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}(wi),ko=function(){function e(e){this.name=Ee.a.NAME_PROCEDURALTEXTURE,this.scene=e,this.scene.proceduralTextures=new Array,e.layers=new Array}return e.prototype.register=function(){this.scene._beforeClearStage.registerStep(Ee.a.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._beforeClear=function(){if(this.scene.proceduralTexturesEnabled){ve.h.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(var e=0;e0)}},e}(),zo="\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}";Ct.a.ShadersStore.proceduralVertexShader=zo;var jo=function(e){function t(t,i,r,o,s,a,c){void 0===s&&(s=null),void 0===a&&(a=!0),void 0===c&&(c=!1);var l=e.call(this,null,o,!a)||this;l.isCube=c,l.isEnabled=!0,l.autoClear=!0,l.onGeneratedObservable=new n.c,l._textures={},l._currentRefreshId=-1,l._refreshRate=1,l._vertexBuffers={},l._uniforms=new Array,l._samplers=new Array,l._floats={},l._ints={},l._floatsArrays={},l._colors3={},l._colors4={},l._vectors2={},l._vectors3={},l._matrices={},l._fallbackTextureUsed=!1,l._cachedDefines="",l._contentUpdateId=-1;var u=(o=l.getScene())._getComponent(Ee.a.NAME_PROCEDURALTEXTURE);u||(u=new ko(o),o._addComponent(u)),o.proceduralTextures.push(l),l._engine=o.getEngine(),l.name=t,l.isRenderTarget=!0,l._size=i,l._generateMipMaps=a,l.setFragment(r),l._fallbackTexture=s,c?(l._texture=l._engine.createRenderTargetCubeTexture(i,{generateMipMaps:a,generateDepthBuffer:!1,generateStencilBuffer:!1}),l.setFloat("face",0)):l._texture=l._engine.createRenderTargetTexture(i,{generateMipMaps:a,generateDepthBuffer:!1,generateStencilBuffer:!1});var h=[];return h.push(1,1),h.push(-1,1),h.push(-1,-1),h.push(1,-1),l._vertexBuffers[gi.b.PositionKind]=new gi.b(l._engine,h,gi.b.PositionKind,!1,!1,2),l._createIndexBuffer(),l}return l.d(t,e),t.prototype.getEffect=function(){return this._effect},t.prototype.getContent=function(){return this._contentData&&this._currentRefreshId==this._contentUpdateId?this._contentData:(this._contentData=this.readPixels(0,0,this._contentData),this._contentUpdateId=this._currentRefreshId,this._contentData)},t.prototype._createIndexBuffer=function(){var e=this._engine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},t.prototype._rebuild=function(){var e=this._vertexBuffers[gi.b.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===wi.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=wi.REFRESHRATE_RENDER_ONCE)},t.prototype.reset=function(){void 0!==this._effect&&this._engine._releaseEffect(this._effect)},t.prototype._getDefines=function(){return""},t.prototype.isReady=function(){var e,t=this,i=this._engine;if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;var r=this._getDefines();return!(!this._effect||r!==this._cachedDefines||!this._effect.isReady())||(e=void 0!==this._fragment.fragmentElement?{vertex:"procedural",fragmentElement:this._fragment.fragmentElement}:{vertex:"procedural",fragment:this._fragment},this._cachedDefines=r,this._effect=i.createEffect(e,[gi.b.PositionKind],this._uniforms,this._samplers,r,void 0,void 0,function(){t.releaseInternalTexture(),t._fallbackTexture&&(t._texture=t._fallbackTexture._texture,t._texture&&t._texture.incrementReferences()),t._fallbackTextureUsed=!0}),this._effect.isReady())},t.prototype.resetRefreshCounter=function(){this._currentRefreshId=-1},t.prototype.setFragment=function(e){this._fragment=e},Object.defineProperty(t.prototype,"refreshRate",{get:function(){return this._refreshRate},set:function(e){this._refreshRate=e,this.resetRefreshCounter()},enumerable:!0,configurable:!0}),t.prototype._shouldRender=function(){return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId?(this._currentRefreshId=1,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)):(this._texture&&(this._texture.isReady=!1),!1)},t.prototype.getRenderSize=function(){return this._size},t.prototype.resize=function(e,t){this._fallbackTextureUsed||(this.releaseInternalTexture(),this._texture=this._engine.createRenderTargetTexture(e,t),this._size=e,this._generateMipMaps=t)},t.prototype._checkUniform=function(e){-1===this._uniforms.indexOf(e)&&this._uniforms.push(e)},t.prototype.setTexture=function(e,t){return-1===this._samplers.indexOf(e)&&this._samplers.push(e),this._textures[e]=t,this},t.prototype.setFloat=function(e,t){return this._checkUniform(e),this._floats[e]=t,this},t.prototype.setInt=function(e,t){return this._checkUniform(e),this._ints[e]=t,this},t.prototype.setFloats=function(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this},t.prototype.setColor3=function(e,t){return this._checkUniform(e),this._colors3[e]=t,this},t.prototype.setColor4=function(e,t){return this._checkUniform(e),this._colors4[e]=t,this},t.prototype.setVector2=function(e,t){return this._checkUniform(e),this._vectors2[e]=t,this},t.prototype.setVector3=function(e,t){return this._checkUniform(e),this._vectors3[e]=t,this},t.prototype.setMatrix=function(e,t){return this._checkUniform(e),this._matrices[e]=t,this},t.prototype.render=function(e){var t=this.getScene();if(t){var i=this._engine;for(var r in i.enableEffect(this._effect),i.setState(!1),this._textures)this._effect.setTexture(r,this._textures[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._colors4){var n=this._colors4[r];this._effect.setFloat4(r,n.r,n.g,n.b,n.a)}for(r in this._vectors2)this._effect.setVector2(r,this._vectors2[r]);for(r in this._vectors3)this._effect.setVector3(r,this._vectors3[r]);for(r in this._matrices)this._effect.setMatrix(r,this._matrices[r]);if(this._texture){if(this.isCube)for(var o=0;o<6;o++)i.bindFramebuffer(this._texture,o,void 0,void 0,!0),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this._effect.setFloat("face",o),this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(Tn.a.TriangleFillMode,0,6),5===o&&i.generateMipMapsForCubemap(this._texture);else i.bindFramebuffer(this._texture,0,void 0,void 0,!0),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(Tn.a.TriangleFillMode,0,6);i.unBindFramebuffer(this._texture,this.isCube),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}}},t.prototype.clone=function(){var e=this.getSize(),i=new t(this.name,e.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.coordinatesMode=this.coordinatesMode,i},t.prototype.dispose=function(){var t=this.getScene();if(t){var i=t.proceduralTextures.indexOf(this);i>=0&&t.proceduralTextures.splice(i,1);var r=this._vertexBuffers[gi.b.PositionKind];r&&(r.dispose(),this._vertexBuffers[gi.b.PositionKind]=null),this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),e.prototype.dispose.call(this)}},l.c([Object(w.c)()],t.prototype,"isEnabled",void 0),l.c([Object(w.c)()],t.prototype,"autoClear",void 0),l.c([Object(w.c)()],t.prototype,"_generateMipMaps",void 0),l.c([Object(w.c)()],t.prototype,"_size",void 0),l.c([Object(w.c)()],t.prototype,"refreshRate",null),t}(Ge.a),Wo=function(e){function t(t,i,r,n,o,s){var a=e.call(this,t,r,null,n,o,s)||this;return a._animate=!0,a._time=0,a._texturePath=i,a._loadJson(i),a.refreshRate=1,a}return l.d(t,e),t.prototype._loadJson=function(e){var t=this,i=function(){p.a.Log("No config file found in "+e+" trying to use ShadersStore or DOM element");try{t.setFragment(t._texturePath)}catch(e){p.a.Error("No json or ShaderStore or DOM element found for CustomProceduralTexture")}},r=e+"/config.json",n=new XMLHttpRequest;n.open("GET",r,!0),n.addEventListener("load",function(){if(200===n.status||n.responseText&&n.responseText.length>0)try{t._config=JSON.parse(n.response),t.updateShaderUniforms(),t.updateTextures(),t.setFragment(t._texturePath+"/custom"),t._animate=t._config.animate,t.refreshRate=t._config.refreshrate}catch(e){i()}else i()},!1),n.addEventListener("error",function(){i()},!1);try{ve.h.UseCustomRequestHeaders&&ve.h.InjectCustomRequestHeaders(n),n.send()}catch(e){p.a.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 i=this.getScene();this._animate&&i&&(this._time+=.03*i.getAnimationRatio(),this.updateShaderUniforms()),e.prototype.render.call(this,t)},t.prototype.updateTextures=function(){for(var e=0;ee.EPSILON?1:0;l|=h,u.push(h)}switch(l){case 0:(o.x.Dot(this.normal,t.plane.normal)>0?i:r).push(t);break;case 1:n.push(t);break;case 2:s.push(t);break;case 3:var d,f=[],p=[];for(a=0;a=3&&(d=new is(f,t.shared)).plane&&n.push(d),p.length>=3&&(d=new is(p,t.shared)).plane&&s.push(d)}},e.EPSILON=1e-5,e}(),is=function(){function e(e,t){this.vertices=e,this.shared=t,this.plane=ts.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}(),rs=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;eo?o:Math.floor(s);var a,c,l,u,h=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE,d=e.uvs,f=e.colors,p=[],_=[],m=[],g=[],v=[],y=[],b=[],T=[],E=[],x=[];if(t.length<2){var A=[],P=[];for(l=0;l0&&(C=R[u].subtract(R[u-1]).length()+b[c],v[c].push(C),b[c]=C),u++;r&&(u--,p.push(R[0].x,R[0].y,R[0].z),C=R[u].subtract(R[0]).length()+b[c],v[c].push(C),b[c]=C),E[c]=S+D,x[c]=I,I+=S+D}var w,L,F=null,N=null;for(l=0;l1)?1:e.arc||1,c=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE;t.push(0,0,0),n.push(.5,.5);for(var l=2*Math.PI*a,u=l/s,h=0;ht.x&&(t.x=i.x),i.yt.y&&(t.y=i.y)}),{min:e,max:t,width:t.x-e.x,height:t.y-e.y}},e}(),ds=function(){function e(){}return e.Rectangle=function(e,t,i,r){return[new o.w(e,t),new o.w(i,t),new o.w(i,r),new o.w(e,r)]},e.Circle=function(e,t,i,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=32);for(var n=new Array,s=0,a=2*Math.PI/r,c=0;c0){var h=o.length/3;this._points.elements.forEach(function(e){n.push(0,-1,0),o.push(e.x,-t,e.y),s.push(1-(e.x-a.min.x)/a.width,1-(e.y-a.min.y)/a.height)});var d=c.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.x(f.x,0,f.y),_=new o.x(d.x,0,d.y).subtract(p),m=new o.x(0,1,0),g=o.x.Cross(_,m);g=g.normalize(),i.push(u/n.width,0),i.push(u/n.width,1),u+=_.length(),i.push(u/n.width,0),i.push(u/n.width,1),c?(t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),r.push(l),r.push(l+2),r.push(l+1),r.push(l+1),r.push(l+2),r.push(l+3)):(t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),r.push(l),r.push(l+1),r.push(l+2),r.push(l+1),r.push(l+3),r.push(l+2)),l+=4}},e}();mi.a.CreatePolygon=function(e,t,i,r,n,s){for(var a=i||new Array(3),c=r,l=[],u=0;u<3;u++)void 0===a[u]&&(a[u]=new o.y(0,0,1,1)),c&&void 0===c[u]&&(c[u]=new o.f(1,1,1,1));for(var h=e.getVerticesData(gi.b.PositionKind),d=e.getVerticesData(gi.b.NormalKind),f=e.getVerticesData(gi.b.UVKind),p=e.getIndices(),_=0,m=0,g=0;g3?0:u,h);var x=as.CreateRibbon(e,{pathArray:b,closeArray:c,closePath:l,updatable:f,sideOrientation:p,invertUV:m,frontUVs:g||void 0,backUVs:v||void 0},d);return x._creationDataStorage.pathArray=b,x._creationDataStorage.path3D=y,x._creationDataStorage.cap=u,x},e}();de.a.CreateLathe=function(e,t,i,r,n,o,s){var a={shape:t,radius:i,tessellation:r,sideOrientation:s,updatable:o};return ms.CreateLathe(e,a,n)};var ms=function(){function e(){}return e.CreateLathe=function(e,t,i){var r,n=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,s=void 0===t.closed||t.closed,a=t.shape,c=t.radius||1,l=t.tessellation||64,u=t.clip||0,h=t.updatable,d=de.a._GetDefaultSideOrientation(t.sideOrientation),f=t.cap||de.a.NO_CAP,p=2*Math.PI,_=new Array,m=t.invertUV||!1,g=0,v=0,y=p/l*n,b=new Array;for(g=0;g<=l-u;g++){b=[];for(f!=de.a.CAP_START&&f!=de.a.CAP_ALL||(b.push(new o.x(0,a[0].y,0)),b.push(new o.x(Math.cos(g*y)*a[0].x*c,a[0].y,Math.sin(g*y)*a[0].x*c))),v=0;v1)?1:t.arc||1;var f,p,_=function(e,t,i,r,n,s,a,c){for(var l,u,h,d,f=t.getTangents(),p=t.getNormals(),_=t.getDistances(),m=2*Math.PI/n*c,g=s||function(){return r},v=o.t.Matrix[0],y=a===de.a.NO_CAP||a===de.a.CAP_END?0:2,b=0;b3?0:l,t.arc);var v=as.CreateRibbon(e,{pathArray:p,closePath:!0,closeArray:!1,updatable:h,sideOrientation:d,invertUV:u,frontUVs:t.frontUVs,backUVs:t.backUVs},i);return v._creationDataStorage.pathArray=p,v._creationDataStorage.path3D=f,v._creationDataStorage.tessellation=a,v._creationDataStorage.cap=l,v._creationDataStorage.arc=t.arc,v._creationDataStorage.radius=s,v},e}();mi.a.CreateIcoSphere=function(e){var t,i=e.sideOrientation||mi.a.DEFAULTSIDE,r=e.radius||1,n=void 0===e.flat||e.flat,s=e.subdivisions||4,a=e.radiusX||r,c=e.radiusY||r,l=e.radiusZ||r,u=(1+Math.sqrt(5))/2,h=[-1,u,-0,1,u,0,-1,-u,0,1,-u,0,0,-1,-u,0,1,-u,0,-1,u,0,1,u,u,0,1,u,0,-1,-u,0,1,-u,0,-1],d=[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],f=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],p=[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],_=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],m=new Array,g=new Array,v=new Array,y=new Array,b=0,T=new Array(3),E=new Array(3);for(t=0;t<3;t++)T[t]=o.x.Zero(),E[t]=o.w.Zero();for(var x=0;x<20;x++){for(t=0;t<3;t++){var A=d[3*x+t];T[t].copyFromFloats(h[3*f[A]],h[3*f[A]+1],h[3*f[A]+2]),T[t].normalize().scaleInPlace(r),E[t].copyFromFloats(p[2*A]*(138/1024)+60/1024+_[x]*(-40/1024),p[2*A+1]*(239/1024)+26/1024+_[x]*(20/1024))}for(var P=function(e,t,i,r){var u,h=o.x.Lerp(T[0],T[2],t/s),d=o.x.Lerp(T[1],T[2],t/s),f=s===t?T[2]:o.x.Lerp(h,d,e/(s-t));if(f.normalize(),n){var p=o.x.Lerp(T[0],T[2],r/s),_=o.x.Lerp(T[1],T[2],r/s);u=o.x.Lerp(p,_,i/(s-r))}else u=new o.x(f.x,f.y,f.z);u.x/=a,u.y/=c,u.z/=l,u.normalize();var x=o.w.Lerp(E[0],E[2],t/s),A=o.w.Lerp(E[1],E[2],t/s),P=s===t?E[2]:o.w.Lerp(x,A,e/(s-t));g.push(f.x*a,f.y*c,f.z*l),v.push(u.x,u.y,u.z),y.push(P.x,P.y),m.push(b),b++},R=0;R0)?1:0)+((c=o.x.Dot(e[s+1].position,t)-i>0)?1:0)+((u=o.x.Dot(e[s+2].position,t)-i>0)?1:0)){case 0:n.push(e[s]),n.push(e[s+1]),n.push(e[s+2]);break;case 1:if(a&&(h=e[s+1],d=e[s+2],f=r(e[s],h),p=r(e[s],d)),c){h=e[s],d=e[s+2],f=r(e[s+1],h),p=r(e[s+1],d),n.push(f),n.push(d.clone()),n.push(h.clone()),n.push(d.clone()),n.push(f.clone()),n.push(p);break}u&&(h=e[s],d=e[s+1],f=r(e[s+2],h),p=r(e[s+2],d)),h&&d&&f&&p&&(n.push(h.clone()),n.push(d.clone()),n.push(f),n.push(p),n.push(f.clone()),n.push(d.clone()));break;case 2:a||(d=r(h=e[s].clone(),e[s+1]),f=r(h,e[s+2]),n.push(h),n.push(d),n.push(f)),c||(d=r(h=e[s+1].clone(),e[s+2]),f=r(h,e[s]),n.push(h),n.push(d),n.push(f)),u||(d=r(h=e[s+2].clone(),e[s]),f=r(h,e[s+1]),n.push(h),n.push(d),n.push(f))}}return n},A=0;Ac||i.deleted||i.isDirty))for(var n=0;n<3;++n)if(i.error[n]>0,function(e){if(n){var t=e+a.verticesStart,s=o.x.FromArray(n,3*t),l=function(e){if(i)for(var t=0;t0&&this._reconstructedMesh.setVerticesData(gi.b.UVKind,a),c.length>0&&this._reconstructedMesh.setVerticesData(gi.b.ColorKind,c);var y=this._mesh.subMeshes[e];e>0&&(this._reconstructedMesh.subMeshes=[],m.forEach(function(e){Jo.b.AddToMesh(e.materialIndex,e.verticesStart,e.verticesCount,e.indexStart,e.indexCount,e.getMesh())}),Jo.b.AddToMesh(y.materialIndex,_,d,p,3*n.length,this._reconstructedMesh))},e.prototype.initDecimatedMesh=function(){this._reconstructedMesh=new de.a(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,i,r,n){for(var s=0;s.999)return!0;var f=o.x.Cross(h,d).normalize();if(r[s]=!1,o.x.Dot(f,a.normal)<.2)return!0}else r[s]=!0,n.push(a)}}return!1},e.prototype.updateTriangles=function(e,t,i,r){for(var n=r,o=0;o=400&&o?o(l):i()},!1),l.addEventListener("error",function(){p.a.Error("error on XHR request."),i()},!1),ve.h.UseCustomRequestHeaders&&ve.h.InjectCustomRequestHeaders(l),l.send()}else p.a.Error("Error: IndexedDB not supported by your browser or Babylon.js Database is not open."),i()},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 i=Uo.GetTGAHeader(e.response);if(i.width&&i.height&&i.width>0&&i.height>0)return!0;if(2===t)return!1}if(4&t){var r=new Uint8Array(e.response,0,3);return 68===r[0]&&68===r[1]&&83===r[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("#")),i=e.substring(t.lastIndexOf("/")+1,e.length);return e.substring(0,e.indexOf(i,0))},e._ReturnFullUrlLocation=function(t){return-1===t.indexOf("http:/")&&-1===t.indexOf("https:/")?e._ParseURL(window.location.href)+t:t},e}(),Ds=function(){function e(){this.direction1=new o.x(0,1,0),this.direction2=new o.x(0,1,0),this.minEmitBox=new o.x(-.5,-.5,-.5),this.maxEmitBox=new o.x(.5,.5,.5)}return e.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=D.a.RandomRange(this.minEmitBox.x,this.maxEmitBox.x),n=D.a.RandomRange(this.minEmitBox.y,this.maxEmitBox.y),s=D.a.RandomRange(this.minEmitBox.z,this.maxEmitBox.z);o.x.TransformCoordinatesFromFloatsToRef(r,n,s,e,t)},e.prototype.clone=function(){var t=new e;return S.a.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){o.x.FromArrayToRef(e.direction1,0,this.direction1),o.x.FromArrayToRef(e.direction2,0,this.direction2),o.x.FromArrayToRef(e.minEmitBox,0,this.minEmitBox),o.x.FromArrayToRef(e.maxEmitBox,0,this.maxEmitBox)},e}(),ws=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=Math.PI),void 0===i&&(i=0),this.directionRandomizer=i,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,i){if(1===Math.abs(Math.cos(this._angle)))o.x.TransformNormalFromFloatsToRef(0,1,0,e,t);else{var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(0,this.directionRandomizer),s=D.a.RandomRange(0,this.directionRandomizer),a=D.a.RandomRange(0,this.directionRandomizer);r.x+=n,r.y+=s,r.z+=a,r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)}},e.prototype.startPositionFunction=function(e,t,i){var r,n=D.a.RandomRange(0,2*Math.PI);r=this.emitFromSpawnPointOnly?1e-4:1-(r=D.a.RandomRange(0,this.heightRange))*r;var s=this._radius-D.a.RandomRange(0,this._radius*this.radiusRange),a=(s*=r)*Math.sin(n),c=s*Math.cos(n),l=r*this._height;o.x.TransformCoordinatesFromFloatsToRef(a,l,c,e,t)},e.prototype.clone=function(){var t=new e(this._radius,this._angle,this.directionRandomizer);return S.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat2("radius",this._radius,this.radiusRange),e.setFloat("coneAngle",this._angle),e.setFloat2("height",this._height,this.heightRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){var e="#define CONEEMITTER";return this.emitFromSpawnPointOnly&&(e+="\n#define CONEEMITTERSPAWNPOINT"),e},e.prototype.getClassName=function(){return"ConeParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this._radius,e.angle=this._angle,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.angle=e.angle,this.directionRandomizer=e.directionRandomizer},e}(),Ls=function(){function e(e,t,i,r){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=1),void 0===r&&(r=0),this.radius=e,this.height=t,this.radiusRange=i,this.directionRandomizer=r}return e.prototype.startDirectionFunction=function(e,t,i){var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(-this.directionRandomizer/2,this.directionRandomizer/2),s=Math.atan2(r.x,r.z);s+=D.a.RandomRange(-Math.PI/2,Math.PI/2)*this.directionRandomizer,r.y=n,r.x=Math.sin(s),r.z=Math.cos(s),r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=D.a.RandomRange(-this.height/2,this.height/2),n=D.a.RandomRange(0,2*Math.PI),s=D.a.RandomRange((1-this.radiusRange)*(1-this.radiusRange),1),a=Math.sqrt(s)*this.radius,c=a*Math.cos(n),l=a*Math.sin(n);o.x.TransformCoordinatesFromFloatsToRef(c,r,l,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return S.a.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}(),Fs=function(e){function t(t,i,r,n,s){void 0===t&&(t=1),void 0===i&&(i=1),void 0===r&&(r=1),void 0===n&&(n=new o.x(0,1,0)),void 0===s&&(s=new o.x(0,1,0));var a=e.call(this,t,i,r)||this;return a.direction1=n,a.direction2=s,a}return l.d(t,e),t.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.height,this.radiusRange,this.direction1,this.direction2);return S.a.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}(Ls),Ns=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=i}return e.prototype.startDirectionFunction=function(e,t,i){var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(0,this.directionRandomizer),s=D.a.RandomRange(0,this.directionRandomizer),a=D.a.RandomRange(0,this.directionRandomizer);r.x+=n,r.y+=s,r.z+=a,r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=this.radius-D.a.RandomRange(0,this.radius*this.radiusRange),n=D.a.RandomRange(0,1),s=D.a.RandomRange(0,2*Math.PI),a=Math.acos(2*n-1),c=r*Math.cos(s)*Math.sin(a),l=r*Math.cos(a),u=r*Math.sin(s)*Math.sin(a);o.x.TransformCoordinatesFromFloatsToRef(c,Math.abs(l),u,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return S.a.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}(),Bs=function(){function e(){this.direction1=new o.x(0,1,0),this.direction2=new o.x(0,1,0)}return e.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},e.prototype.startPositionFunction=function(e,t,i){o.x.TransformCoordinatesFromFloatsToRef(0,0,0,e,t)},e.prototype.clone=function(){var t=new e;return S.a.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){o.x.FromArrayToRef(e.direction1,0,this.direction1),o.x.FromArrayToRef(e.direction2,0,this.direction2)},e}(),Us=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=i}return e.prototype.startDirectionFunction=function(e,t,i){var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(0,this.directionRandomizer),s=D.a.RandomRange(0,this.directionRandomizer),a=D.a.RandomRange(0,this.directionRandomizer);r.x+=n,r.y+=s,r.z+=a,r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=this.radius-D.a.RandomRange(0,this.radius*this.radiusRange),n=D.a.RandomRange(0,1),s=D.a.RandomRange(0,2*Math.PI),a=Math.acos(2*n-1),c=r*Math.cos(s)*Math.sin(a),l=r*Math.cos(a),u=r*Math.sin(s)*Math.sin(a);o.x.TransformCoordinatesFromFloatsToRef(c,l,u,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return S.a.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}(),Vs=function(e){function t(t,i,r){void 0===t&&(t=1),void 0===i&&(i=new o.x(0,1,0)),void 0===r&&(r=new o.x(0,1,0));var n=e.call(this,t)||this;return n.direction1=i,n.direction2=r,n}return l.d(t,e),t.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.direction1,this.direction2);return S.a.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}(Us),Gs=function(){function e(t){this.animations=[],this.renderingGroupId=0,this.emitter=null,this.emitRate=10,this.manualEmitCount=-1,this.updateSpeed=.01,this.targetStopDuration=0,this.disposeOnStop=!1,this.minEmitPower=1,this.maxEmitPower=1,this.minLifeTime=1,this.maxLifeTime=1,this.minSize=1,this.maxSize=1,this.minScaleX=1,this.maxScaleX=1,this.minScaleY=1,this.maxScaleY=1,this.minInitialRotation=0,this.maxInitialRotation=0,this.minAngularSpeed=0,this.maxAngularSpeed=0,this.layerMask=268435455,this.customShader=null,this.preventAutoStart=!1,this.noiseStrength=new o.x(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 o.w(0,0),this.beginAnimationOnStart=!1,this.beginAnimationFrom=0,this.beginAnimationTo=60,this.beginAnimationLoop=!1,this.gravity=o.x.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 o.f(1,1,1,1),this.color2=new o.f(1,1,1,1),this.colorDead=new o.f(0,0,0,1),this.textureMask=new o.f(1,1,1,1),this._isSubEmitter=!1,this.billboardMode=_.a.PARTICLES_BILLBOARDMODE_ALL,this._isBillboardBased=!0,this._imageProcessingConfigurationDefines=new hi.b,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:o.x.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:o.x.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:o.x.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:o.x.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,i){if(!t)return this;for(var r=0,n=0,o=t;n0&&this._attachedSubEmitters.forEach(function(t){e._inheritParticleInfoToSubEmitter(t)})},e.prototype._reset=function(){this.age=0,this._currentColorGradient=null,this._currentSizeGradient=null,this._currentAngularSpeedGradient=null,this._currentVelocityGradient=null,this._currentLimitVelocityGradient=null,this._currentDragGradient=null,this.cellIndex=this.particleSystem.startSpriteCellID,this._randomCellOffset=void 0},e.prototype.copyTo=function(e){e.position.copyFrom(this.position),this._initialDirection?e._initialDirection?e._initialDirection.copyFrom(this._initialDirection):e._initialDirection=this._initialDirection.clone():e._initialDirection=null,e.direction.copyFrom(this.direction),e.color.copyFrom(this.color),e.colorStep.copyFrom(this.colorStep),e.lifeTime=this.lifeTime,e.age=this.age,e._randomCellOffset=this._randomCellOffset,e.size=this.size,e.scale.copyFrom(this.scale),e.angle=this.angle,e.angularSpeed=this.angularSpeed,e.particleSystem=this.particleSystem,e.cellIndex=this.cellIndex,e.id=this.id,e._attachedSubEmitters=this._attachedSubEmitters,this._currentColorGradient&&(e._currentColorGradient=this._currentColorGradient,e._currentColor1.copyFrom(this._currentColor1),e._currentColor2.copyFrom(this._currentColor2)),this._currentSizeGradient&&(e._currentSizeGradient=this._currentSizeGradient,e._currentSize1=this._currentSize1,e._currentSize2=this._currentSize2),this._currentAngularSpeedGradient&&(e._currentAngularSpeedGradient=this._currentAngularSpeedGradient,e._currentAngularSpeed1=this._currentAngularSpeed1,e._currentAngularSpeed2=this._currentAngularSpeed2),this._currentVelocityGradient&&(e._currentVelocityGradient=this._currentVelocityGradient,e._currentVelocity1=this._currentVelocity1,e._currentVelocity2=this._currentVelocity2),this._currentLimitVelocityGradient&&(e._currentLimitVelocityGradient=this._currentLimitVelocityGradient,e._currentLimitVelocity1=this._currentLimitVelocity1,e._currentLimitVelocity2=this._currentLimitVelocity2),this._currentDragGradient&&(e._currentDragGradient=this._currentDragGradient,e._currentDrag1=this._currentDrag1,e._currentDrag2=this._currentDrag2),this.particleSystem.isAnimationSheetEnabled&&(e._initialStartSpriteCellID=this._initialStartSpriteCellID,e._initialEndSpriteCellID=this._initialEndSpriteCellID),this.particleSystem.useRampGradients&&e.remapData.copyFrom(this.remapData),this._randomNoiseCoordinates1&&(e._randomNoiseCoordinates1?(e._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1),e._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)):(e._randomNoiseCoordinates1=this._randomNoiseCoordinates1.clone(),e._randomNoiseCoordinates2=this._randomNoiseCoordinates2.clone()))},e._Count=0,e}();!function(e){e[e.ATTACHED=0]="ATTACHED",e[e.END=1]="END"}(Os||(Os={}));var zs=function(){function e(e){this.particleSystem=e,this.type=Os.END,this.inheritDirection=!1,this.inheritedVelocityAmount=0,e.emitter&&e.emitter.dispose||(e.emitter=new Le.a("SubemitterSystemEmitter",e.getScene())),e.onDisposeObservable.add(function(){e.emitter&&e.emitter.dispose&&e.emitter.dispose()})}return e.prototype.clone=function(){var t=this.particleSystem.emitter;t?t instanceof o.x?t=t.clone():t instanceof Le.a&&((t=new de.a("",t.getScene())).isVisible=!1):t=new o.x;var i=new e(this.particleSystem.clone("",t));return i.type=this.type,i.inheritDirection=this.inheritDirection,i.inheritedVelocityAmount=this.inheritedVelocityAmount,i.particleSystem._disposeEmitterOnDispose=!0,i.particleSystem.disposeOnStop=!0,i},e.prototype.serialize=function(){var e={};return e.type=this.type,e.inheritDirection=this.inheritDirection,e.inheritedVelocityAmount=this.inheritedVelocityAmount,e.particleSystem=this.particleSystem.serialize(),e},e._ParseParticleSystem=function(e,t,i){throw ye.a.WarnImport("ParseParticle")},e.Parse=function(t,i,r){var n=t.particleSystem,o=new e(e._ParseParticleSystem(n,i,r));return o.type=t.type,o.inheritDirection=t.inheritDirection,o.inheritedVelocityAmount=t.inheritedVelocityAmount,o.particleSystem._isSubEmitter=!0,o},e.prototype.dispose=function(){this.particleSystem.dispose()},e}(),js="\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#include\n#include\n#include\n#include\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\nuniform sampler2D rampSampler;\n#endif\nvoid main(void) {\n#include\nvec4 textureColor=texture2D(diffuseSampler,vUV);\nvec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;\nfloat remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);\nvec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));\nbaseColor.rgb*=rampColor.rgb;\n\nfloat finalAlpha=baseColor.a;\nbaseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;\nbaseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\nbaseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n}";Ct.a.ShadersStore.particlesPixelShader=js;var Ws="\nattribute vec3 position;\nattribute vec4 color;\nattribute float angle;\nattribute vec2 size;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD\nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;\n\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n#ifdef ANIMATESHEET\nuniform vec3 particlesInfos;\n#endif\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nuniform mat4 invView;\n#endif\n#include\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#endif\nvoid main(void) {\nvec2 cornerPos;\ncornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n#ifdef BILLBOARD\n\nvec3 rotatedCorner;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvec3 worldPos=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition;\nvec3 worldPos=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\n\ngl_Position=projection*vec4(viewPos,1.0);\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=normalize(direction);\nvec3 worldPos=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(worldPos,1.0);\n#endif\nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/particlesInfos.z);\nfloat columnOffset=cellIndex-rowOffset*particlesInfos.z;\nvec2 uvScale=particlesInfos.xy;\nvec2 uvOffset=vec2(offset.x ,1.0-offset.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nvec4 worldPos=invView*vec4(viewPos,1.0);\n#endif\n#include\n}";Ct.a.ShadersStore.particlesVertexShader=Ws;var Hs=function(e){function t(t,i,r,s,a,c){void 0===s&&(s=null),void 0===a&&(a=!1),void 0===c&&(c=.01);var l=e.call(this,t)||this;return l._inheritedVelocityOffset=new o.x,l.onDisposeObservable=new n.c,l._particles=new Array,l._stockParticles=new Array,l._newPartsExcess=0,l._vertexBuffers={},l._scaledColorStep=new o.f(0,0,0,0),l._colorDiff=new o.f(0,0,0,0),l._scaledDirection=o.x.Zero(),l._scaledGravity=o.x.Zero(),l._currentRenderId=-1,l._useInstancing=!1,l._started=!1,l._stopped=!1,l._actualFrame=0,l._currentEmitRate1=0,l._currentEmitRate2=0,l._currentStartSize1=0,l._currentStartSize2=0,l._rawTextureWidth=256,l._useRampGradients=!1,l._disposeEmitterOnDispose=!1,l.recycleParticle=function(e){var t=l._particles.pop();t!==e&&t.copyTo(e),l._stockParticles.push(t)},l._createParticle=function(){var e;if(0!==l._stockParticles.length?(e=l._stockParticles.pop())._reset():e=new ks(l),l._subEmitters&&l._subEmitters.length>0){var t=l._subEmitters[Math.floor(Math.random()*l._subEmitters.length)];e._attachedSubEmitters=[],t.forEach(function(t){if(t.type===Os.ATTACHED){var i=t.clone();e._attachedSubEmitters.push(i),i.particleSystem.start()}})}return e},l._emitFromParticle=function(e){if(l._subEmitters&&0!==l._subEmitters.length){var t=Math.floor(Math.random()*l._subEmitters.length);l._subEmitters[t].forEach(function(t){if(t.type===Os.END){var i=t.clone();e._inheritParticleInfoToSubEmitter(i),i.particleSystem._rootParticleSystem=l,l.activeSubSystems.push(i.particleSystem),i.particleSystem.start()}})}},l._capacity=i,l._epsilon=c,l._isAnimationSheetEnabled=a,l._scene=r||R.a.LastCreatedScene,l._attachImageProcessingConfiguration(null),l._customEffect=s,l._scene.particleSystems.push(l),l._useInstancing=l._scene.getEngine().getCaps().instancedArrays,l._createIndexBuffer(),l._createVertexBuffers(),l.particleEmitterType=new Ds,l.updateFunction=function(e){var t=null,i=null;l.noiseTexture&&(t=l.noiseTexture.getSize(),i=l.noiseTexture.getContent());for(var r,n=function(){r=e[s];var n=l._scaledUpdateSpeed,a=r.age;if(r.age+=n,r.age>r.lifeTime){var c=r.age-a;n=(r.lifeTime-a)*n/c,r.age=r.lifeTime}var u=r.age/r.lifeTime;l._colorGradients&&l._colorGradients.length>0?ve.h.GetCurrentGradient(u,l._colorGradients,function(e,t,i){e!==r._currentColorGradient&&(r._currentColor1.copyFrom(r._currentColor2),t.getColorToRef(r._currentColor2),r._currentColorGradient=e),o.f.LerpToRef(r._currentColor1,r._currentColor2,i,r.color)}):(r.colorStep.scaleToRef(n,l._scaledColorStep),r.color.addInPlace(l._scaledColorStep),r.color.a<0&&(r.color.a=0)),l._angularSpeedGradients&&l._angularSpeedGradients.length>0&&ve.h.GetCurrentGradient(u,l._angularSpeedGradients,function(e,t,i){e!==r._currentAngularSpeedGradient&&(r._currentAngularSpeed1=r._currentAngularSpeed2,r._currentAngularSpeed2=t.getFactor(),r._currentAngularSpeedGradient=e),r.angularSpeed=D.a.Lerp(r._currentAngularSpeed1,r._currentAngularSpeed2,i)}),r.angle+=r.angularSpeed*n;var h=n;if(l._velocityGradients&&l._velocityGradients.length>0&&ve.h.GetCurrentGradient(u,l._velocityGradients,function(e,t,i){e!==r._currentVelocityGradient&&(r._currentVelocity1=r._currentVelocity2,r._currentVelocity2=t.getFactor(),r._currentVelocityGradient=e),h*=D.a.Lerp(r._currentVelocity1,r._currentVelocity2,i)}),r.direction.scaleToRef(h,l._scaledDirection),l._limitVelocityGradients&&l._limitVelocityGradients.length>0&&ve.h.GetCurrentGradient(u,l._limitVelocityGradients,function(e,t,i){e!==r._currentLimitVelocityGradient&&(r._currentLimitVelocity1=r._currentLimitVelocity2,r._currentLimitVelocity2=t.getFactor(),r._currentLimitVelocityGradient=e);var n=D.a.Lerp(r._currentLimitVelocity1,r._currentLimitVelocity2,i);r.direction.length()>n&&r.direction.scaleInPlace(l.limitVelocityDamping)}),l._dragGradients&&l._dragGradients.length>0&&ve.h.GetCurrentGradient(u,l._dragGradients,function(e,t,i){e!==r._currentDragGradient&&(r._currentDrag1=r._currentDrag2,r._currentDrag2=t.getFactor(),r._currentDragGradient=e);var n=D.a.Lerp(r._currentDrag1,r._currentDrag2,i);l._scaledDirection.scaleInPlace(1-n)}),r.position.addInPlace(l._scaledDirection),i&&t&&r._randomNoiseCoordinates1){var d=l._fetchR(r._randomNoiseCoordinates1.x,r._randomNoiseCoordinates1.y,t.width,t.height,i),f=l._fetchR(r._randomNoiseCoordinates1.z,r._randomNoiseCoordinates2.x,t.width,t.height,i),p=l._fetchR(r._randomNoiseCoordinates2.y,r._randomNoiseCoordinates2.z,t.width,t.height,i),_=o.t.Vector3[0],m=o.t.Vector3[1];_.copyFromFloats((2*d-1)*l.noiseStrength.x,(2*f-1)*l.noiseStrength.y,(2*p-1)*l.noiseStrength.z),_.scaleToRef(n,m),r.direction.addInPlace(m)}if(l.gravity.scaleToRef(n,l._scaledGravity),r.direction.addInPlace(l._scaledGravity),l._sizeGradients&&l._sizeGradients.length>0&&ve.h.GetCurrentGradient(u,l._sizeGradients,function(e,t,i){e!==r._currentSizeGradient&&(r._currentSize1=r._currentSize2,r._currentSize2=t.getFactor(),r._currentSizeGradient=e),r.size=D.a.Lerp(r._currentSize1,r._currentSize2,i)}),l._useRampGradients&&(l._colorRemapGradients&&l._colorRemapGradients.length>0&&ve.h.GetCurrentGradient(u,l._colorRemapGradients,function(e,t,i){var n=D.a.Lerp(e.factor1,t.factor1,i),o=D.a.Lerp(e.factor2,t.factor2,i);r.remapData.x=n,r.remapData.y=o-n}),l._alphaRemapGradients&&l._alphaRemapGradients.length>0&&ve.h.GetCurrentGradient(u,l._alphaRemapGradients,function(e,t,i){var n=D.a.Lerp(e.factor1,t.factor1,i),o=D.a.Lerp(e.factor2,t.factor2,i);r.remapData.z=n,r.remapData.w=o-n})),l._isAnimationSheetEnabled&&r.updateCellIndex(),r._inheritParticleInfoToSubEmitters(),r.age>=r.lifeTime)return l._emitFromParticle(r),r._attachedSubEmitters&&(r._attachedSubEmitters.forEach(function(e){e.particleSystem.disposeOnStop=!0,e.particleSystem.stop()}),r._attachedSubEmitters=null),l.recycleParticle(r),s--,"continue"},s=0;st.gradient?1:0})},t.prototype._removeFactorGradient=function(e,t){if(e)for(var i=0,r=0,n=e;rt.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,i){this._colorGradients||(this._colorGradients=[]);var r=new ve.c;return r.gradient=e,r.color1=t,r.color2=i,this._colorGradients.push(r),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,i=0,r=this._colorGradients;i0&&(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 Le.a&&this.emitter.computeWorldMatrix(!0);var i=this.noiseTexture;if(i&&i.onGeneratedObservable)i.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,i,r,n){var o=e*this._vertexBufferSize;this._vertexData[o++]=i.position.x,this._vertexData[o++]=i.position.y,this._vertexData[o++]=i.position.z,this._vertexData[o++]=i.color.r,this._vertexData[o++]=i.color.g,this._vertexData[o++]=i.color.b,this._vertexData[o++]=i.color.a,this._vertexData[o++]=i.angle,this._vertexData[o++]=i.scale.x*i.size,this._vertexData[o++]=i.scale.y*i.size,this._isAnimationSheetEnabled&&(this._vertexData[o++]=i.cellIndex),this._isBillboardBased?this.billboardMode===t.BILLBOARDMODE_STRETCHED&&(this._vertexData[o++]=i.direction.x,this._vertexData[o++]=i.direction.y,this._vertexData[o++]=i.direction.z):i._initialDirection?(this._vertexData[o++]=i._initialDirection.x,this._vertexData[o++]=i._initialDirection.y,this._vertexData[o++]=i._initialDirection.z):(this._vertexData[o++]=i.direction.x,this._vertexData[o++]=i.direction.y,this._vertexData[o++]=i.direction.z),this._useRampGradients&&(this._vertexData[o++]=i.remapData.x,this._vertexData[o++]=i.remapData.y,this._vertexData[o++]=i.remapData.z,this._vertexData[o++]=i.remapData.w),this._useInstancing||(this._isAnimationSheetEnabled&&(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++]=r,this._vertexData[o++]=n)},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,i=this;if(this._alive=this._particles.length>0,this.emitter.position){var r=this.emitter;this._emitterWorldMatrix=r.getWorldMatrix()}else{var n=this.emitter;this._emitterWorldMatrix=o.j.Translation(n.x,n.y,n.z)}this.updateFunction(this._particles);for(var s,a=function(){if(c._particles.length===c._capacity)return"break";t=c._createParticle(),c._particles.push(t);var e=D.a.RandomRange(c.minEmitPower,c.maxEmitPower);if(c.startPositionFunction?c.startPositionFunction(c._emitterWorldMatrix,t.position,t):c.particleEmitterType.startPositionFunction(c._emitterWorldMatrix,t.position,t),c.startDirectionFunction?c.startDirectionFunction(c._emitterWorldMatrix,t.direction,t):c.particleEmitterType.startDirectionFunction(c._emitterWorldMatrix,t.direction,t),0===e?t._initialDirection?t._initialDirection.copyFrom(t.direction):t._initialDirection=t.direction.clone():t._initialDirection=null,t.direction.scaleInPlace(e),c.targetStopDuration&&c._lifeTimeGradients&&c._lifeTimeGradients.length>0){var r=D.a.Clamp(c._actualFrame/c.targetStopDuration);ve.h.GetCurrentGradient(r,c._lifeTimeGradients,function(e,i){var n=e,o=i,s=n.getFactor(),a=o.getFactor(),c=(r-n.gradient)/(o.gradient-n.gradient);t.lifeTime=D.a.Lerp(s,a,c)})}else t.lifeTime=D.a.RandomRange(c.minLifeTime,c.maxLifeTime);if(c._sizeGradients&&0!==c._sizeGradients.length?(t._currentSizeGradient=c._sizeGradients[0],t._currentSize1=t._currentSizeGradient.getFactor(),t.size=t._currentSize1,c._sizeGradients.length>1?t._currentSize2=c._sizeGradients[1].getFactor():t._currentSize2=t._currentSize1):t.size=D.a.RandomRange(c.minSize,c.maxSize),t.scale.copyFromFloats(D.a.RandomRange(c.minScaleX,c.maxScaleX),D.a.RandomRange(c.minScaleY,c.maxScaleY)),c._startSizeGradients&&c._startSizeGradients[0]&&c.targetStopDuration){var n=c._actualFrame/c.targetStopDuration;ve.h.GetCurrentGradient(n,c._startSizeGradients,function(e,r,n){e!==i._currentStartSizeGradient&&(i._currentStartSize1=i._currentStartSize2,i._currentStartSize2=r.getFactor(),i._currentStartSizeGradient=e);var o=D.a.Lerp(i._currentStartSize1,i._currentStartSize2,n);t.scale.scaleInPlace(o)})}c._angularSpeedGradients&&0!==c._angularSpeedGradients.length?(t._currentAngularSpeedGradient=c._angularSpeedGradients[0],t.angularSpeed=t._currentAngularSpeedGradient.getFactor(),t._currentAngularSpeed1=t.angularSpeed,c._angularSpeedGradients.length>1?t._currentAngularSpeed2=c._angularSpeedGradients[1].getFactor():t._currentAngularSpeed2=t._currentAngularSpeed1):t.angularSpeed=D.a.RandomRange(c.minAngularSpeed,c.maxAngularSpeed),t.angle=D.a.RandomRange(c.minInitialRotation,c.maxInitialRotation),c._velocityGradients&&c._velocityGradients.length>0&&(t._currentVelocityGradient=c._velocityGradients[0],t._currentVelocity1=t._currentVelocityGradient.getFactor(),c._velocityGradients.length>1?t._currentVelocity2=c._velocityGradients[1].getFactor():t._currentVelocity2=t._currentVelocity1),c._limitVelocityGradients&&c._limitVelocityGradients.length>0&&(t._currentLimitVelocityGradient=c._limitVelocityGradients[0],t._currentLimitVelocity1=t._currentLimitVelocityGradient.getFactor(),c._limitVelocityGradients.length>1?t._currentLimitVelocity2=c._limitVelocityGradients[1].getFactor():t._currentLimitVelocity2=t._currentLimitVelocity1),c._dragGradients&&c._dragGradients.length>0&&(t._currentDragGradient=c._dragGradients[0],t._currentDrag1=t._currentDragGradient.getFactor(),c._dragGradients.length>1?t._currentDrag2=c._dragGradients[1].getFactor():t._currentDrag2=t._currentDrag1),c._colorGradients&&0!==c._colorGradients.length?(t._currentColorGradient=c._colorGradients[0],t._currentColorGradient.getColorToRef(t.color),t._currentColor1.copyFrom(t.color),c._colorGradients.length>1?c._colorGradients[1].getColorToRef(t._currentColor2):t._currentColor2.copyFrom(t.color)):(s=D.a.RandomRange(0,1),o.f.LerpToRef(c.color1,c.color2,s,t.color),c.colorDead.subtractToRef(t.color,c._colorDiff),c._colorDiff.scaleToRef(1/t.lifeTime,t.colorStep)),c._isAnimationSheetEnabled&&(t._initialStartSpriteCellID=c.startSpriteCellID,t._initialEndSpriteCellID=c.endSpriteCellID),t.direction.addInPlace(c._inheritedVelocityOffset),c._useRampGradients&&(t.remapData=new o.y(0,1,0,1)),c.noiseTexture&&(t._randomNoiseCoordinates1?(t._randomNoiseCoordinates1.copyFromFloats(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2.copyFromFloats(Math.random(),Math.random(),Math.random())):(t._randomNoiseCoordinates1=new o.x(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2=new o.x(Math.random(),Math.random(),Math.random()))),t._inheritParticleInfoToSubEmitters()},c=this,l=0;l-1)i=this.manualEmitCount,this._newPartsExcess=0,this.manualEmitCount=0;else{var r=this.emitRate;if(this._emitRateGradients&&this._emitRateGradients.length>0&&this.targetStopDuration){var n=this._actualFrame/this.targetStopDuration;ve.h.GetCurrentGradient(n,this._emitRateGradients,function(e,i,n){e!==t._currentEmitRateGradient&&(t._currentEmitRate1=t._currentEmitRate2,t._currentEmitRate2=i.getFactor(),t._currentEmitRateGradient=e),r=D.a.Lerp(t._currentEmitRate1,t._currentEmitRate2,n)})}i=r*this._scaledUpdateSpeed>>0,this._newPartsExcess+=r*this._scaledUpdateSpeed-i}if(this._newPartsExcess>1&&(i+=this._newPartsExcess>>0,this._newPartsExcess-=this._newPartsExcess>>0),this._alive=!1,this._stopped?i=0:(this._actualFrame+=this._scaledUpdateSpeed,this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()),this._update(i),this._stopped&&(this._alive||(this._started=!1,this.onAnimationEnd&&this.onAnimationEnd(),this.disposeOnStop&&this._scene._toBeDisposed.push(this))),!e){for(var o=0,s=0;s-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,i){var r=null,n=null;if(null!=this.customShader){var o=(n=this.customShader).shaderOptions.defines.length>0?n.shaderOptions.defines.join("\n"):"";r=this._scene.getEngine().createEffectForParticles(n.shaderPath.fragmentElement,n.shaderOptions.uniforms,n.shaderOptions.samplers,o)}else this._customEffect&&(r=this._customEffect);var s=new t(e,this._capacity,this._scene,r);return s.customShader=n,S.a.DeepCopy(this,s,["particles","customShader","noiseTexture"]),void 0===i&&(i=this.emitter),s.noiseTexture=this.noiseTexture,s.emitter=i,this.particleTexture&&(s.particleTexture=new Ge.a(this.particleTexture.url,this._scene)),this._colorGradients&&this._colorGradients.forEach(function(e){s.addColorGradient(e.gradient,e.color1,e.color2)}),this._dragGradients&&this._dragGradients.forEach(function(e){s.addDragGradient(e.gradient,e.factor1,e.factor2)}),this._angularSpeedGradients&&this._angularSpeedGradients.forEach(function(e){s.addAngularSpeedGradient(e.gradient,e.factor1,e.factor2)}),this._emitRateGradients&&this._emitRateGradients.forEach(function(e){s.addEmitRateGradient(e.gradient,e.factor1,e.factor2)}),this._lifeTimeGradients&&this._lifeTimeGradients.forEach(function(e){s.addLifeTimeGradient(e.gradient,e.factor1,e.factor2)}),this._limitVelocityGradients&&this._limitVelocityGradients.forEach(function(e){s.addLimitVelocityGradient(e.gradient,e.factor1,e.factor2)}),this._sizeGradients&&this._sizeGradients.forEach(function(e){s.addSizeGradient(e.gradient,e.factor1,e.factor2)}),this._startSizeGradients&&this._startSizeGradients.forEach(function(e){s.addStartSizeGradient(e.gradient,e.factor1,e.factor2)}),this._velocityGradients&&this._velocityGradients.forEach(function(e){s.addVelocityGradient(e.gradient,e.factor1,e.factor2)}),this._rampGradients&&this._rampGradients.forEach(function(e){s.addRampGradient(e.gradient,e.color)}),this._colorRemapGradients&&this._colorRemapGradients.forEach(function(e){s.addColorRemapGradient(e.gradient,e.factor1,e.factor2)}),this._alphaRemapGradients&&this._alphaRemapGradients.forEach(function(e){s.addAlphaRemapGradient(e.gradient,e.factor1,e.factor2)}),this.preventAutoStart||s.start(),s},t.prototype.serialize=function(){var e={};if(t._Serialize(e,this),e.textureMask=this.textureMask.asArray(),e.customShader=this.customShader,e.preventAutoStart=this.preventAutoStart,this.subEmitters){e.subEmitters=[],this._subEmitters||this._prepareSubEmitterInternalArray();for(var i=0,r=this._subEmitters;i0?c.shaderOptions.defines.join("\n"):"";a=i.getEngine().createEffectForParticles(c.shaderPath.fragmentElement,c.shaderOptions.uniforms,c.shaderOptions.samplers,l)}var u=new t(s,e.capacity,i,a,e.isAnimationSheetEnabled);if(u.customShader=c,e.id&&(u.id=e.id),e.subEmitters){u.subEmitters=[];for(var h=0,d=e.subEmitters;h1},enumerable:!0,configurable:!0}),t.prototype.getCapacity=function(){return this._capacity},Object.defineProperty(t.prototype,"activeParticleCount",{get:function(){return this._activeCount},set:function(e){this._activeCount=Math.min(e,this._capacity)},enumerable:!0,configurable:!0}),t.prototype.isReady=function(){return this._updateEffect?!!(this.emitter&&this._updateEffect.isReady()&&this._imageProcessingConfiguration.isReady()&&this._renderEffect.isReady()&&this.particleTexture&&this.particleTexture.isReady()):(this._recreateUpdateEffect(),this._recreateRenderEffect(),!1)},t.prototype.isStarted=function(){return this._started},t.prototype.start=function(e){var t=this;if(void 0===e&&(e=this.startDelay),!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";e?setTimeout(function(){t.start(0)},e):(this._started=!0,this._stopped=!1,this._preWarmDone=!1,this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this.getScene().beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop))},t.prototype.stop=function(){this._stopped=!0},t.prototype.reset=function(){this._releaseBuffers(),this._releaseVAOs(),this._currentActiveCount=0,this._targetIndex=0},t.prototype.getClassName=function(){return"GPUParticleSystem"},t.prototype._removeGradientAndTexture=function(t,i,r){return e.prototype._removeGradientAndTexture.call(this,t,i,r),this._releaseBuffers(),this},t.prototype.addColorGradient=function(e,t,i){this._colorGradients||(this._colorGradients=[]);var r=new ve.c;return r.gradient=e,r.color1=t,this._colorGradients.push(r),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,i){var r=new ve.d;r.gradient=t,r.factor1=i,e.push(r),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,i){return this},t.prototype.removeEmitRateGradient=function(e){return this},t.prototype.addStartSizeGradient=function(e,t,i){return this},t.prototype.removeStartSizeGradient=function(e){return this},t.prototype.addColorRemapGradient=function(e,t,i){return this},t.prototype.removeColorRemapGradient=function(){return this},t.prototype.addAlphaRemapGradient=function(e,t,i){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,i){return this},t.prototype.removeLifeTimeGradient=function(e){return this},t.prototype._reset=function(){this._releaseBuffers()},t.prototype._createUpdateVAO=function(e){var t={};t.position=e.createVertexBuffer("position",0,3),t.age=e.createVertexBuffer("age",3,1),t.life=e.createVertexBuffer("life",4,1),t.seed=e.createVertexBuffer("seed",5,4),t.size=e.createVertexBuffer("size",9,3);var i=12;this._colorGradientsTexture||(t.color=e.createVertexBuffer("color",i,4),i+=4),t.direction=e.createVertexBuffer("direction",i,3),i+=3,this._isBillboardBased||(t.initialDirection=e.createVertexBuffer("initialDirection",i,3),i+=3),this._angularSpeedGradientsTexture?(t.angle=e.createVertexBuffer("angle",i,1),i+=1):(t.angle=e.createVertexBuffer("angle",i,2),i+=2),this._isAnimationSheetEnabled&&(t.cellIndex=e.createVertexBuffer("cellIndex",i,1),i+=1,this.spriteRandomStartCell&&(t.cellStartOffset=e.createVertexBuffer("cellStartOffset",i,1),i+=1)),this.noiseTexture&&(t.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",i,3),i+=3,t.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",i,3),i+=3);var r=this._engine.recordVertexArrayObject(t,null,this._updateEffect);return this._engine.bindArrayBuffer(null),r},t.prototype._createRenderVAO=function(e,t){var i={};i.position=e.createVertexBuffer("position",0,3,this._attributesStrideSize,!0),i.age=e.createVertexBuffer("age",3,1,this._attributesStrideSize,!0),i.life=e.createVertexBuffer("life",4,1,this._attributesStrideSize,!0),i.size=e.createVertexBuffer("size",9,3,this._attributesStrideSize,!0);var r=12;this._colorGradientsTexture||(i.color=e.createVertexBuffer("color",r,4,this._attributesStrideSize,!0),r+=4),this.billboardMode===Hs.BILLBOARDMODE_STRETCHED&&(i.direction=e.createVertexBuffer("direction",r,3,this._attributesStrideSize,!0)),r+=3,this._isBillboardBased||(i.initialDirection=e.createVertexBuffer("initialDirection",r,3,this._attributesStrideSize,!0),r+=3),i.angle=e.createVertexBuffer("angle",r,1,this._attributesStrideSize,!0),this._angularSpeedGradientsTexture?r++:r+=2,this._isAnimationSheetEnabled&&(i.cellIndex=e.createVertexBuffer("cellIndex",r,1,this._attributesStrideSize,!0),r+=1,this.spriteRandomStartCell&&(i.cellStartOffset=e.createVertexBuffer("cellStartOffset",r,1,this._attributesStrideSize,!0),r+=1)),this.noiseTexture&&(i.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",r,3,this._attributesStrideSize,!0),r+=3,i.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",r,3,this._attributesStrideSize,!0),r+=3),i.offset=t.createVertexBuffer("offset",0,2),i.uv=t.createVertexBuffer("uv",2,2);var n=this._engine.recordVertexArrayObject(i,null,this._renderEffect);return this._engine.bindArrayBuffer(null),n},t.prototype._initialize=function(e){if(void 0===e&&(e=!1),!this._buffer0||e){var t=this._scene.getEngine(),i=new Array;this._attributesStrideSize=21,this._targetIndex=0,this.isBillboardBased||(this._attributesStrideSize+=3),this._colorGradientsTexture&&(this._attributesStrideSize-=4),this._angularSpeedGradientsTexture&&(this._attributesStrideSize-=1),this._isAnimationSheetEnabled&&(this._attributesStrideSize+=1,this.spriteRandomStartCell&&(this._attributesStrideSize+=1)),this.noiseTexture&&(this._attributesStrideSize+=6);for(var r=0;r=this.targetStopDuration&&this.stop()},t.prototype._createFactorGradientTexture=function(e,t){var i=this[t];if(e&&e.length&&!i){for(var r=new Float32Array(this._rawTextureWidth),n=0;n1){var i=0|this._accumulatedCount;this._accumulatedCount-=i,this._currentActiveCount=Math.min(this._activeCount,this._currentActiveCount+i)}if(!this._currentActiveCount)return 0;var r;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){r=this.emitter.getWorldMatrix()}else{var n=this.emitter;r=o.j.Translation(n.x,n.y,n.z)}if(this._updateEffect.setMatrix("emitterWM",r),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(Tn.a.PointListDrawMode,0,this._currentActiveCount),this._engine.endTransformFeedback(),this._engine.setRasterizerState(!0),this._engine.bindTransformFeedbackBuffer(null),!e){this._engine.enableEffect(this._renderEffect);var s=this._scene.getViewMatrix();if(this._renderEffect.setMatrix("view",s),this._renderEffect.setMatrix("projection",this._scene.getProjectionMatrix()),this._renderEffect.setTexture("textureSampler",this.particleTexture),this._renderEffect.setVector2("translationPivot",this.translationPivot),this._colorGradientsTexture?this._renderEffect.setTexture("colorGradientSampler",this._colorGradientsTexture):this._renderEffect.setDirectColor4("colorDead",this.colorDead),this._isAnimationSheetEnabled&&this.particleTexture){var a=this.particleTexture.getBaseSize();this._renderEffect.setFloat3("sheetInfos",this.spriteCellWidth/a.width,this.spriteCellHeight/a.height,a.width/this.spriteCellWidth)}if(this._isBillboardBased){var c=this._scene.activeCamera;this._renderEffect.setVector3("eyePosition",c.globalPosition)}if(this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4){var l=s.clone();l.invert(),this._renderEffect.setMatrix("invView",l),jr.a.BindClipPlane(this._renderEffect,this._scene)}switch(this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._renderEffect),this.blendMode){case Hs.BLENDMODE_ADD:this._engine.setAlphaMode(_.a.ALPHA_ADD);break;case Hs.BLENDMODE_ONEONE:this._engine.setAlphaMode(_.a.ALPHA_ONEONE);break;case Hs.BLENDMODE_STANDARD:this._engine.setAlphaMode(_.a.ALPHA_COMBINE);break;case Hs.BLENDMODE_MULTIPLY:this._engine.setAlphaMode(_.a.ALPHA_MULTIPLY)}this.forceDepthWrite&&this._engine.setDepthWrite(!0),this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex],null),this._engine.drawArraysType(Tn.a.TriangleFanDrawMode,0,4,this._currentActiveCount),this._engine.setAlphaMode(_.a.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,i){var r=new t(e,{capacity:this._capacity,randomTextureSize:this._randomTextureSize},this._scene);return S.a.DeepCopy(this,r),void 0===i&&(i=this.emitter),r.emitter=i,this.particleTexture&&(r.particleTexture=new Ge.a(this.particleTexture.url,this._scene)),r},t.prototype.serialize=function(){var e={};return Hs._Serialize(e,this),e.activeParticleCount=this.activeParticleCount,e},t.Parse=function(e,i,r,n){void 0===n&&(n=!1);var o=new t(e.name,{capacity:e.capacity,randomTextureSize:e.randomTextureSize},i);return e.activeParticleCount&&(o.activeParticleCount=e.activeParticleCount),Hs._Parse(e,o,i,r),e.preventAutoStart&&(o.preventAutoStart=e.preventAutoStart),n||o.preventAutoStart||o.start(),o},t}(Gs),Js=(function(){}(),function(){function e(){this.systems=new Array}return Object.defineProperty(e.prototype,"emitterNode",{get:function(){return this._emitterNode},enumerable:!0,configurable:!0}),e.prototype.setEmitterAsSphere=function(e,t,i){this._emitterNode&&this._emitterNode.dispose(),this._emitterCreationOptions={kind:"Sphere",options:e,renderingGroupId:t};var r=Rr.a.CreateSphere("emitterSphere",{diameter:e.diameter,segments:e.segments},i);r.renderingGroupId=t;var n=new di.a("emitterSphereMaterial",i);n.emissiveColor=e.color,r.material=n;for(var o=0,s=this.systems;o0&&t.set(this._uvs32,gi.b.UVKind),this._colors32.length>0&&t.set(this._colors32,gi.b.ColorKind);var i=new de.a(this.name,this._scene);return t.applyToMesh(i,this._updatable),this.mesh=i,this.mesh.isPickable=this._pickable,this._depthSort||(this._indices=null),this._positions=null,this._normals=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0),i},e.prototype.digest=function(e,t){var i=t&&t.facetNb||1,r=t&&t.number||0,n=t&&t.delta||0,s=e.getVerticesData(gi.b.PositionKind),a=e.getIndices(),c=e.getVerticesData(gi.b.UVKind),l=e.getVerticesData(gi.b.ColorKind),u=e.getVerticesData(gi.b.NormalKind),h=0,d=a.length/3;r?(r=r>d?d:r,i=Math.round(d/r),n=0):i=i>d?d:i;for(var f=[],p=[],_=[],m=[],g=o.x.Zero(),v=i;hd-(i=v+Math.floor((1+n)*Math.random()))&&(i=d-h),f.length=0,p.length=0,_.length=0,m.length=0;for(var y=0,b=3*h;b<3*(h+i);b++){p.push(y);var T=a[b];f.push(s[3*T],s[3*T+1],s[3*T+2]),c&&_.push(c[2*T],c[2*T+1]),l&&m.push(l[4*T],l[4*T+1],l[4*T+2],l[4*T+3]),y++}var E,x,A=this.nbParticles,P=this._posToShape(f),R=this._uvsToShapeUV(_);for(E=0;E65535&&(this._needs32Bits=!0)}if(this._pickable){var C=r.length/3;for(_=0;_=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var O=this.mesh._boundingInfo;O&&(v.copyFrom(O.minimum),y.copyFrom(O.maximum))}var I=(A=this.particles[e]._pos)/3|0;R=4*I,C=2*I;for(var D=e;D<=t;D++){var w=this.particles[D];this.updateParticle(w);var L=w._model._shape,F=w._model._shapeUV,N=w._rotationMatrix,B=w.position,U=w.rotation,V=w.scaling,G=w._globalPosition;if(this._depthSort&&this._depthSortParticles){var k=this.depthSortedParticles[D];k.ind=w._ind,k.indicesLength=w._model._indicesLength,k.sqDistance=o.x.DistanceSquared(w.position,b)}if(!w.alive||w._stillInvisible&&!w.isVisible)A+=3*(M=L.length),R+=4*M,C+=2*M;else{if(w.isVisible){w._stillInvisible=!1;var z=p[12];if(w.pivot.multiplyToRef(V,z),this.billboard&&(U.x=0,U.y=0),(this._computeParticleRotation||this.billboard)&&w.getRotationMatrix(r),null!==w.parentId){var j=this.particles[w.parentId],W=j._rotationMatrix,H=j._globalPosition,X=B.x*W[1]+B.y*W[4]+B.z*W[7],Y=B.x*W[0]+B.y*W[3]+B.z*W[6],K=B.x*W[2]+B.y*W[5]+B.z*W[8];if(G.x=H.x+Y,G.y=H.y+X,G.z=H.z+K,this._computeParticleRotation||this.billboard){var Q=r.m;N[0]=Q[0]*W[0]+Q[1]*W[3]+Q[2]*W[6],N[1]=Q[0]*W[1]+Q[1]*W[4]+Q[2]*W[7],N[2]=Q[0]*W[2]+Q[1]*W[5]+Q[2]*W[8],N[3]=Q[4]*W[0]+Q[5]*W[3]+Q[6]*W[6],N[4]=Q[4]*W[1]+Q[5]*W[4]+Q[6]*W[7],N[5]=Q[4]*W[2]+Q[5]*W[5]+Q[6]*W[8],N[6]=Q[8]*W[0]+Q[9]*W[3]+Q[10]*W[6],N[7]=Q[8]*W[1]+Q[9]*W[4]+Q[10]*W[7],N[8]=Q[8]*W[2]+Q[9]*W[5]+Q[10]*W[8]}}else if(G.x=B.x,G.y=B.y,G.z=B.z,this._computeParticleRotation||this.billboard){Q=r.m;N[0]=Q[0],N[1]=Q[1],N[2]=Q[2],N[3]=Q[4],N[4]=Q[5],N[5]=Q[6],N[6]=Q[8],N[7]=Q[9],N[8]=Q[10]}var q=p[11];for(w.translateFromPivot?q.setAll(0):q.copyFrom(z),M=0;Mi)return null;var u=n===oa.Constant?r:r*(1-l/i);return{force:s.multiplyByFloats(u,u,u),contactPoint:c}},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=Rr.a.CreateSphere("radialExplosionEventSphere",this._sphereOptions,this._scene),this._sphere.isVisible=!1)},e.prototype._intersectsWithSphere=function(e,t,i){var r=e.object;return this._prepareSphere(),this._sphere.position=t,this._sphere.scaling=new o.x(2*i,2*i,2*i),this._sphere._updateBoundingInfo(),this._sphere.computeWorldMatrix(!0),this._sphere.intersectsMesh(r,!0)},e}(),ua=function(){function e(e,t,i,r,n,o){void 0===o&&(o=oa.Constant),this._dataFetched=!1,this._physicsHelper=e,this._scene=t,this._origin=i,this._radius=r,this._strength=n,this._falloff=o,this._tickCallback=this._tick.bind(this)}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._radius,-1*this._strength,this._falloff);else{var e=this._physicsHelper.applyRadialExplosionForce(this._origin,this._radius,-1*this._strength,this._falloff);e&&(this._sphere=e.getData().sphere.clone("radialExplosionEventSphereClone"))}},e}(),ha=function(){function e(e,t,i,r,n,s){this._scene=e,this._origin=t,this._radius=i,this._strength=r,this._height=n,this._updraftMode=s,this._originTop=o.x.Zero(),this._originDirection=o.x.Zero(),this._cylinderPosition=o.x.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._origin.addToRef(new o.x(0,this._height/2,0),this._cylinderPosition),this._origin.addToRef(new o.x(0,this._height,0),this._originTop),this._updraftMode===sa.Perpendicular&&(this._originDirection=this._origin.subtract(this._originTop).normalize()),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),this._cylinder&&(e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0))},e.prototype.getImpostorForceAndContactPoint=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;var t=e.getObjectCenter();if(this._updraftMode===sa.Perpendicular)var i=this._originDirection;else i=t.subtract(this._originTop);var r=-1*this._strength;return{force:i.multiplyByFloats(r,r,r),contactPoint:t}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var i=e.getImpostorForceAndContactPoint(t);i&&t.applyForce(i.force,i.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=Ti.a.CreateCylinder("updraftEventCylinder",{height:this._height,diameter:2*this._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}(),da=function(){function e(e,t,i,r,n){this._scene=e,this._origin=t,this._radius=i,this._strength=r,this._height=n,this._originTop=o.x.Zero(),this._centripetalForceThreshold=.7,this._updraftMultiplier=.02,this._cylinderPosition=o.x.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._origin.addToRef(new o.x(0,this._height/2,0),this._cylinderPosition),this._origin.addToRef(new o.x(0,this._height,0),this._originTop),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0)},e.prototype.getImpostorForceAndContactPoint=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var t=e.getObjectCenter(),i=new o.x(this._origin.x,t.y,this._origin.z),r=t.subtract(i),n=new ti.a(i,r,this._radius).intersectsMesh(e.object),s=n.pickedPoint;if(!s)return null;var a=n.distance/this._radius,c=o.x.Cross(i,t).normalize(),l=s.normalize();if(a>this._centripetalForceThreshold&&(l=l.negate()),a>this._centripetalForceThreshold)var u=l.x*this._strength/8,h=l.y*this._updraftMultiplier,d=l.z*this._strength/8;else u=(c.x+l.x)/2,h=this._originTop.y*this._updraftMultiplier,d=(c.z+l.z)/2;var f=new o.x(u,h,d);return{force:f=f.multiplyByFloats(this._strength,this._strength,this._strength),contactPoint:t}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var i=e.getImpostorForceAndContactPoint(t);i&&t.applyForce(i.force,i.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=Ti.a.CreateCylinder("vortexEventCylinder",{height:this._height,diameter:2*this._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}();!function(e){e[e.Constant=0]="Constant",e[e.Linear=1]="Linear"}(oa||(oa={})),function(e){e[e.Center=0]="Center",e[e.Perpendicular=1]="Perpendicular"}(sa||(sa={}));var fa=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Ammo);var i=this;this._useDeltaForWorldStep=e,this.bjsAMMO={},this.name="AmmoJSPlugin",this._timeStep=1/60,this._fixedTimeStep=1/60,this._maxSteps=5,this._tmpQuaternion=new o.q,this._tmpContactCallbackResult=!1,this._tmpVector=new o.x,this._tmpMatrix=new o.j,"function"==typeof t?t(this.bjsAMMO):this.bjsAMMO=t,this.isSupported()?(this._collisionConfiguration=new this.bjsAMMO.btDefaultCollisionConfiguration,this._dispatcher=new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration),this._overlappingPairCache=new this.bjsAMMO.btDbvtBroadphase,this._solver=new this.bjsAMMO.btSequentialImpulseConstraintSolver,this.world=new this.bjsAMMO.btDiscreteDynamicsWorld(this._dispatcher,this._overlappingPairCache,this._solver,this._collisionConfiguration),this._tmpAmmoConcreteContactResultCallback=new this.bjsAMMO.ConcreteContactResultCallback,this._tmpAmmoConcreteContactResultCallback.addSingleResult=function(){i._tmpContactCallbackResult=!0},this._tmpAmmoTransform=new this.bjsAMMO.btTransform,this._tmpAmmoTransform.setIdentity(),this._tmpAmmoQuaternion=new this.bjsAMMO.btQuaternion(0,0,0,1),this._tmpAmmoVectorA=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorB=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorC=new this.bjsAMMO.btVector3(0,0,0)):p.a.Error("AmmoJS is not available. Please make sure you included the js file.")}return e.prototype.setGravity=function(e){this._tmpAmmoVectorA.setValue(e.x,e.y,e.z),this.world.setGravity(this._tmpAmmoVectorA)},e.prototype.setTimeStep=function(e){this._timeStep=e},e.prototype.setFixedTimeStep=function(e){this._fixedTimeStep=e},e.prototype.setMaxSteps=function(e){this._maxSteps=e},e.prototype.getTimeStep=function(){return this._timeStep},e.prototype._isImpostorInContact=function(e){return this._tmpContactCallbackResult=!1,this.world.contactTest(e.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._isImpostorPairInContact=function(e,t){return this._tmpContactCallbackResult=!1,this.world.contactPairTest(e.physicsBody,t.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._stepSimulation=function(e,t,i){if(void 0===e&&(e=1/60),void 0===t&&(t=10),void 0===i&&(i=1/60),0==t)this.world.stepSimulation(e,0);else for(;t>0&&e>0;)e-i0&&this._isImpostorInContact(s))for(var a=0,c=s._onPhysicsCollideCallbacks;a0){if(e.type!=oo.a.NoImpostor){var l=this._createShape(e,!0);l&&(this._tmpAmmoTransform.getOrigin().setValue(0,0,0),this._tmpAmmoQuaternion.setValue(0,0,0,1),this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion),r.addChildShape(this._tmpAmmoTransform,l))}return r}Ammo.destroy(r),r=null}switch(e.type){case oo.a.SphereImpostor:r=new Ammo.btSphereShape(s.x/2);break;case oo.a.CylinderImpostor:this._tmpAmmoVectorA.setValue(s.x/2,s.y/2,s.z/2),r=new Ammo.btCylinderShape(this._tmpAmmoVectorA);break;case oo.a.PlaneImpostor:case oo.a.BoxImpostor:this._tmpAmmoVectorA.setValue(s.x/2,s.y/2,s.z/2),r=new Ammo.btBoxShape(this._tmpAmmoVectorA);break;case oo.a.MeshImpostor:var u=new Ammo.btTriangleMesh;e._pluginData.toDispose.concat([u]);var h=this._addMeshVerts(u,n,n);r=0==h?new Ammo.btCompoundShape:new Ammo.btBvhTriangleMeshShape(u);break;case oo.a.NoImpostor:r=new Ammo.btSphereShape(s.x/2);break;default:p.a.Warn("The impostor type is not currently supported by the ammo plugin.")}return r},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,i){var r=e.physicsBody.getWorldTransform();if(r.getOrigin().x()!=t.x||r.getOrigin().y()!=t.y||r.getOrigin().z()!=t.z||r.getRotation().x()!=i.x||r.getRotation().y()!=i.y||r.getRotation().z()!=i.z||r.getRotation().w()!=i.w)if(this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),r.setOrigin(this._tmpAmmoVectorA),this._tmpAmmoQuaternion.setValue(i.x,i.y,i.z,i.w),r.setRotation(this._tmpAmmoQuaternion),e.physicsBody.setWorldTransform(r),0==e.mass){var n=e.physicsBody.getMotionState();n&&n.setWorldTransform(r)}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.physicsBody.setLinearVelocity(this._tmpAmmoVectorA)},e.prototype.setAngularVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.physicsBody.setAngularVelocity(this._tmpAmmoVectorA)},e.prototype.getLinearVelocity=function(e){var t=e.physicsBody.getLinearVelocity();return t?new o.x(t.x(),t.y(),t.z()):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.getAngularVelocity();return t?new o.x(t.x(),t.y(),t.z()):null},e.prototype.setBodyMass=function(e,t){e.physicsBody.setMassProps(t),e._pluginData.mass=t},e.prototype.getBodyMass=function(e){return e._pluginData.mass},e.prototype.getBodyFriction=function(e){return e._pluginData.friction},e.prototype.setBodyFriction=function(e,t){e.physicsBody.setFriction(t),e._pluginData.friction=t},e.prototype.getBodyRestitution=function(e){return e._pluginData.restitution},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.setRestitution(t),e._pluginData.restitution=t},e.prototype.sleepBody=function(e){p.a.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,i){p.a.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin")},e.prototype.setMotor=function(e,t,i,r){e.physicsJoint.enableAngularMotor(!0,t,i)},e.prototype.setLimit=function(e,t,i){p.a.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 i=e.getObjectExtendSize();t.x=i.x,t.y=i.y,t.z=i.z},e.prototype.dispose=function(){Ammo.destroy(this.world),Ammo.destroy(this._solver),Ammo.destroy(this._overlappingPairCache),Ammo.destroy(this._dispatcher),Ammo.destroy(this._collisionConfiguration),Ammo.destroy(this._tmpAmmoVectorA),Ammo.destroy(this._tmpAmmoVectorB),Ammo.destroy(this._tmpAmmoVectorC),Ammo.destroy(this._tmpAmmoTransform),Ammo.destroy(this._tmpAmmoQuaternion),Ammo.destroy(this._tmpAmmoConcreteContactResultCallback),this.world=null},e.DISABLE_COLLISION_FLAG=4,e.KINEMATIC_FLAG=2,e.DISABLE_DEACTIVATION_FLAG=4,e}(),pa="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float degree;\nvoid main(void)\n{\nvec3 color=texture2D(textureSampler,vUV).rgb;\nfloat luminance=dot(color,vec3(0.3,0.59,0.11));\nvec3 blackAndWhite=vec3(luminance,luminance,luminance);\ngl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);\n}";Ct.a.ShadersStore.blackAndWhitePixelShader=pa;var _a=function(e){function t(t,i,r,n,o,s){var a=e.call(this,t,"blackAndWhite",["degree"],null,i,r,n,o,s)||this;return a.degree=1,a.onApplyObservable.add(function(e){e.setFloat("degree",a.degree)}),a}return l.d(t,e),t}(Ot),ma=function(){function e(e,t,i,r){this._name=t,this._singleInstance=r||!0,this._getPostProcesses=i,this._cameras={},this._indicesForCamera={},this._postProcesses={}}return Object.defineProperty(e.prototype,"isSupported",{get:function(){for(var e in this._postProcesses)if(this._postProcesses.hasOwnProperty(e))for(var t=this._postProcesses[e],i=0;i-1?"#define MALI 1\n":null},t}(Ot),ja="#include\n\nuniform sampler2D textureSampler;\n\nuniform float intensity;\nuniform float animatedSeed;\n\nvarying vec2 vUV;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec2 seed=vUV*(animatedSeed);\nfloat grain=dither(seed,intensity);\n\nfloat lum=getLuminance(gl_FragColor.rgb);\nfloat grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;\ngl_FragColor.rgb+=grain*grainAmount;\ngl_FragColor.rgb=max(gl_FragColor.rgb,0.0);\n}";Ct.a.ShadersStore.grainPixelShader=ja;var Wa=function(e){function t(t,i,r,n,o,s,a,c){void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"grain",["intensity","animatedSeed"],[],i,r,n,o,s,null,a,void 0,null,c)||this;return l.intensity=30,l.animated=!1,l.onApplyObservable.add(function(e){e.setFloat("intensity",l.intensity),e.setFloat("animatedSeed",l.animated?Math.random()+1:1)}),l}return l.d(t,e),t}(Ot),Ha="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nconst vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvoid main(void)\n{\nvec4 tex=texture2D(textureSampler,vUV);\nvec3 c=tex.rgb;\nfloat luma=dot(c.rgb,RGBLuminanceCoefficients);\n\n\ngl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a);\n}";Ct.a.ShadersStore.highlightsPixelShader=Ha;var Xa=function(e){function t(t,i,r,n,o,s,a){return void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),e.call(this,t,"highlights",null,null,i,r,n,o,s,null,a)||this}return l.d(t,e),t}(Ot);Ct.a.IncludesShadersStore.mrtFragmentDeclaration="#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n";var Ya="#extension GL_EXT_draw_buffers : require\nprecision highp float;\nprecision highp int;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef VELOCITY\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include[RENDER_TARGET_COUNT]\nvoid main() {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\ngl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\n\ngl_FragData[1]=vec4(normalize(vNormalV),1.0);\n\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPosition,1.0);\n#endif\n#ifdef VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=(a-b)*0.5+0.5;\nvelocity*=0.5+0.5;\nvelocity=vec2(pow(velocity.x,3.0),pow(velocity.y,3.0));\ngl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n}";Ct.a.ShadersStore.geometryPixelShader=Ya;var Ka="precision highp float;\nprecision highp int;\n#include\n#include\nattribute vec3 position;\nattribute vec3 normal;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n\nuniform mat4 viewProjection;\nuniform mat4 view;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef VELOCITY\nuniform mat4 previousWorldViewProjection;\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\nvoid main(void)\n{\n#include\n#include\nvec4 pos=vec4(finalWorld*vec4(position,1.0));\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normal,0.0)));\nvViewPos=view*pos;\n#ifdef POSITION\nvPosition=pos.xyz/pos.w;\n#endif\n#ifdef VELOCITY\nvCurrentPosition=viewProjection*finalWorld*vec4(position,1.0);\nvPreviousPosition=previousWorldViewProjection*vec4(position,1.0);\n#endif\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}";Ct.a.ShadersStore.geometryVertexShader=Ka;var Qa=function(){function e(t,i){void 0===i&&(i=1),this._previousTransformationMatrices={},this._enablePosition=!1,this._enableVelocity=!1,this._positionIndex=-1,this._velocityIndex=-1,this._scene=t,this._ratio=i,e._SceneComponentInitialization(this._scene),this._createRenderTargets()}return Object.defineProperty(e.prototype,"renderList",{set:function(e){this._multiRenderTarget.renderList=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._multiRenderTarget.isSupported},enumerable:!0,configurable:!0}),e.prototype.getTextureIndex=function(t){switch(t){case e.POSITION_TEXTURE_TYPE:return this._positionIndex;case e.VELOCITY_TEXTURE_TYPE:return this._velocityIndex;default:return-1}},Object.defineProperty(e.prototype,"enablePosition",{get:function(){return this._enablePosition},set:function(e){this._enablePosition=e,this.dispose(),this._createRenderTargets()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableVelocity",{get:function(){return this._enableVelocity},set:function(e){this._enableVelocity=e,this.dispose(),this._createRenderTargets()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ratio",{get:function(){return this._ratio},enumerable:!0,configurable:!0}),e.prototype.isReady=function(e,t){var i=e.getMaterial();if(i&&i.disableDepthWrite)return!1;var r=[],n=[gi.b.PositionKind,gi.b.NormalKind],o=e.getMesh();i&&i.needAlphaTesting()&&(r.push("#define ALPHATEST"),o.isVerticesDataPresent(gi.b.UVKind)&&(n.push(gi.b.UVKind),r.push("#define UV1")),o.isVerticesDataPresent(gi.b.UV2Kind)&&(n.push(gi.b.UV2Kind),r.push("#define UV2"))),this._enablePosition&&(r.push("#define POSITION"),r.push("#define POSITION_INDEX "+this._positionIndex)),this._enableVelocity&&(r.push("#define VELOCITY"),r.push("#define VELOCITY_INDEX "+this._velocityIndex)),o.useBones&&o.computeBonesUsingShaders?(n.push(gi.b.MatricesIndicesKind),n.push(gi.b.MatricesWeightsKind),o.numBoneInfluencers>4&&(n.push(gi.b.MatricesIndicesExtraKind),n.push(gi.b.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),r.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):r.push("#define NUM_BONE_INFLUENCERS 0"),t&&(r.push("#define INSTANCES"),n.push("world0"),n.push("world1"),n.push("world2"),n.push("world3")),r.push("#define RENDER_TARGET_COUNT "+this._multiRenderTarget.textures.length);var s=r.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._effect=this._scene.getEngine().createEffect("geometry",n,["world","mBones","viewProjection","diffuseMatrix","view","previousWorldViewProjection"],["diffuseSampler"],s,void 0,void 0,void 0,{buffersCount:this._enablePosition?3:2})),this._effect.isReady()},e.prototype.getGBuffer=function(){return this._multiRenderTarget},Object.defineProperty(e.prototype,"samples",{get:function(){return this._multiRenderTarget.samples},set:function(e){this._multiRenderTarget.samples=e},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.getGBuffer().dispose()},e.prototype._createRenderTargets=function(){var e=this,t=this._scene.getEngine(),i=2;if(this._enablePosition&&(this._positionIndex=i,i++),this._enableVelocity&&(this._velocityIndex=i,i++),this._multiRenderTarget=new Go("gBuffer",{width:t.getRenderWidth()*this._ratio,height:t.getRenderHeight()*this._ratio},i,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,defaultType:_.a.TEXTURETYPE_FLOAT}),this.isSupported){this._multiRenderTarget.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null,this._multiRenderTarget.onClearObservable.add(function(e){e.clear(new o.f(0,0,0,1),!0,!0,!0)});var r=function(t){var i=t.getRenderingMesh(),r=e._scene,n=r.getEngine(),s=t.getMaterial();if(s){e._previousTransformationMatrices[i.uniqueId]||(e._previousTransformationMatrices[i.uniqueId]=o.j.Identity()),n.setState(s.backFaceCulling,0,!1,r.useRightHandedSystem);var a=i._getInstancesRenderList(t._id);if(!a.mustReturn){var c=n.getCaps().instancedArrays&&null!==a.visibleInstances[t._id];if(e.isReady(t,c)){if(n.enableEffect(e._effect),i._bind(t,e._effect,Tn.a.TriangleFillMode),e._effect.setMatrix("viewProjection",r.getTransformMatrix()),e._effect.setMatrix("view",r.getViewMatrix()),s&&s.needAlphaTesting()){var l=s.getAlphaTestTexture();l&&(e._effect.setTexture("diffuseSampler",l),e._effect.setMatrix("diffuseMatrix",l.getTextureMatrix()))}i.useBones&&i.computeBonesUsingShaders&&i.skeleton&&e._effect.setMatrices("mBones",i.skeleton.getTransformMatrices(i)),e._effect.setMatrix("previousWorldViewProjection",e._previousTransformationMatrices[i.uniqueId]),i._processRendering(t,e._effect,Tn.a.TriangleFillMode,a,c,function(t,i){return e._effect.setMatrix("world",i)})}e._previousTransformationMatrices[i.uniqueId]=i.getWorldMatrix().multiply(e._scene.getTransformMatrix())}}};this._multiRenderTarget.customRenderFunction=function(e,i,n,o){var s;if(o.length){for(t.setColorWrite(!1),s=0;s=2&&t.length>0){var i=this._renderEffects[t[0]].getPostProcesses();if(i)return i[0].samples=e,!0}return!1},e.prototype.dispose=function(){},l.c([Object(w.c)()],e.prototype,"_name",void 0),e}(),rc=function(e){function t(t,i,r,n,o){void 0===t&&(t=""),void 0===i&&(i=!0),void 0===r&&(r=R.a.LastCreatedScene),void 0===o&&(o=!0);var s=e.call(this,r.getEngine(),t)||this;s._camerasToBeAttached=[],s.SharpenPostProcessId="SharpenPostProcessEffect",s.ImageProcessingPostProcessId="ImageProcessingPostProcessEffect",s.FxaaPostProcessId="FxaaPostProcessEffect",s.ChromaticAberrationPostProcessId="ChromaticAberrationPostProcessEffect",s.GrainPostProcessId="GrainPostProcessEffect",s._glowLayer=null,s.animations=[],s._imageProcessingConfigurationObserver=null,s._sharpenEnabled=!1,s._bloomEnabled=!1,s._depthOfFieldEnabled=!1,s._depthOfFieldBlurLevel=Da.Low,s._fxaaEnabled=!1,s._imageProcessingEnabled=!0,s._bloomScale=.5,s._chromaticAberrationEnabled=!1,s._grainEnabled=!1,s._buildAllowed=!0,s._resizeObserver=null,s._hardwareScaleLevel=1,s._bloomKernel=64,s._bloomWeight=.15,s._bloomThreshold=.9,s._samples=1,s._hasCleared=!1,s._prevPostProcess=null,s._prevPrevPostProcess=null,s._depthOfFieldSceneObserver=null,s._cameras=n||r.cameras,s._cameras=s._cameras.slice(),s._camerasToBeAttached=s._cameras.slice(),s._buildAllowed=o,s._scene=r;var a=s._scene.getEngine().getCaps();s._hdr=i&&(a.textureHalfFloatRender||a.textureFloatRender),s._hdr?a.textureHalfFloatRender?s._defaultPipelineTextureType=_.a.TEXTURETYPE_HALF_FLOAT:a.textureFloatRender&&(s._defaultPipelineTextureType=_.a.TEXTURETYPE_FLOAT):s._defaultPipelineTextureType=_.a.TEXTURETYPE_UNSIGNED_INT,r.postProcessRenderPipelineManager.addPipeline(s);var c=s._scene.getEngine();return s.sharpen=new tc("sharpen",1,null,Ge.a.BILINEAR_SAMPLINGMODE,c,!1,s._defaultPipelineTextureType,!0),s._sharpenEffect=new ma(c,s.SharpenPostProcessId,function(){return s.sharpen},!0),s.depthOfField=new Fa(s._scene,null,s._depthOfFieldBlurLevel,s._defaultPipelineTextureType,!0),s.bloom=new Ta(s._scene,s._bloomScale,s._bloomWeight,s.bloomKernel,s._defaultPipelineTextureType,!0),s.chromaticAberration=new xa("ChromaticAberration",c.getRenderWidth(),c.getRenderHeight(),1,null,Ge.a.BILINEAR_SAMPLINGMODE,c,!1,s._defaultPipelineTextureType,!0),s._chromaticAberrationEffect=new ma(c,s.ChromaticAberrationPostProcessId,function(){return s.chromaticAberration},!0),s.grain=new Wa("Grain",1,null,Ge.a.BILINEAR_SAMPLINGMODE,c,!1,s._defaultPipelineTextureType,!0),s._grainEffect=new ma(c,s.GrainPostProcessId,function(){return s.grain},!0),s._resizeObserver=c.onResizeObservable.add(function(){s._hardwareScaleLevel=c.getHardwareScalingLevel(),s.bloomKernel=s.bloomKernel}),s._imageProcessingConfigurationObserver=s._scene.imageProcessingConfiguration.onUpdateParameters.add(function(){s.bloom._downscale._exposure=s._scene.imageProcessingConfiguration.exposure}),s._buildPipeline(),s}return l.d(t,e),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 Ta(this._scene,this.bloomScale,this._bloomWeight,this.bloomKernel,this._defaultPipelineTextureType,!1),this.bloom.threshold=e.threshold;for(var t=0;t1){for(var i=0,r=this._cameras;i-1&&(e.depthOfField.depthTexture=t.enableDepthRenderer(t.activeCamera).getDepthMap())})}else{this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);var o=this._scene.enableDepthRenderer(this._cameras[0]);this.depthOfField.depthTexture=o.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 _i("imageProcessing",1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this._hdr?(this.addEffect(new ma(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 za("fxaa",1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this.addEffect(new ma(t,this.FxaaPostProcessId,function(){return e.fxaa},!0)),this._setAutoClearAndTextureSharing(this.fxaa,!0)),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),!this._enableMSAAOnFirstPostProcess(this.samples)&&this.samples>1&&p.a.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?i._ssaoCombinePostProcess.width:i._originalColorPostProcess.width),e.setFloat("near",i._scene.activeCamera.minZ),e.setFloat("far",i._scene.activeCamera.maxZ),e.setFloat("radius",i.radius),e.setTexture("depthSampler",i._depthTexture),i._firstUpdate&&e.setArray("samplerOffsets",i._samplerOffsets))},this._blurVPostProcess=new Ot("BlurV","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthSampler"],t,null,Ge.a.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE "+(r?"1":"0")+"\n"),this._blurVPostProcess.onApply=function(e){i._scene.activeCamera&&(e.setFloat("outSize",i._ssaoCombinePostProcess.height>0?i._ssaoCombinePostProcess.height:i._originalColorPostProcess.height),e.setFloat("near",i._scene.activeCamera.minZ),e.setFloat("far",i._scene.activeCamera.maxZ),e.setFloat("radius",i.radius),e.setTexture("depthSampler",i._depthTexture),i._firstUpdate&&(e.setArray("samplerOffsets",i._samplerOffsets),i._firstUpdate=!1))},this._blurHPostProcess.samples=this.textureSamples,this._blurVPostProcess.samples=this.textureSamples},t.prototype._rebuild=function(){this._firstUpdate=!0,e.prototype._rebuild.call(this)},t.prototype._radicalInverse_VdC=function(e){return this._bits[0]=e,this._bits[0]=(this._bits[0]<<16|this._bits[0]>>16)>>>0,this._bits[0]=(1431655765&this._bits[0])<<1|(2863311530&this._bits[0])>>>1>>>0,this._bits[0]=(858993459&this._bits[0])<<2|(3435973836&this._bits[0])>>>2>>>0,this._bits[0]=(252645135&this._bits[0])<<4|(4042322160&this._bits[0])>>>4>>>0,this._bits[0]=(16711935&this._bits[0])<<8|(4278255360&this._bits[0])>>>8>>>0,2.3283064365386963e-10*this._bits[0]},t.prototype._hammersley=function(e,t){return[e/t,this._radicalInverse_VdC(e)]},t.prototype._hemisphereSample_uniform=function(e,t){var i=2*t*Math.PI,r=1-(.85*e+.15),n=Math.sqrt(1-r*r);return new o.x(Math.cos(i)*n,Math.sin(i)*n,r)},t.prototype._generateHemisphere=function(){for(var e,t=this.samples,i=[],r=0;r1&&p.a.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")},t.prototype._createDownSampleX4PostProcess=function(e,t){var i=this,r=new Array(32);this.downSampleX4PostProcess=new Ot("HDRDownSampleX4","standard",["dsOffsets"],[],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DOWN_SAMPLE_X4",_.a.TEXTURETYPE_UNSIGNED_INT),this.downSampleX4PostProcess.onApply=function(e){for(var t=0,n=i.downSampleX4PostProcess.width,o=i.downSampleX4PostProcess.height,s=-2;s<2;s++)for(var a=-2;a<2;a++)r[t]=(s+.5)*(1/n),r[t+1]=(a+.5)*(1/o),t+=2;e.setArray2("dsOffsets",r)},this.addEffect(new ma(e.getEngine(),"HDRDownSampleX4",function(){return i.downSampleX4PostProcess},!0))},t.prototype._createBrightPassPostProcess=function(e,t){var i=this,r=new Array(8);this.brightPassPostProcess=new Ot("HDRBrightPass","standard",["dsOffsets","brightThreshold"],[],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define BRIGHT_PASS",_.a.TEXTURETYPE_UNSIGNED_INT),this.brightPassPostProcess.onApply=function(e){var t=1/i.brightPassPostProcess.width,n=1/i.brightPassPostProcess.height;r[0]=-.5*t,r[1]=.5*n,r[2]=.5*t,r[3]=.5*n,r[4]=-.5*t,r[5]=-.5*n,r[6]=.5*t,r[7]=-.5*n,e.setArray2("dsOffsets",r),e.setFloat("brightThreshold",i.brightThreshold)},this.addEffect(new ma(e.getEngine(),"HDRBrightPass",function(){return i.brightPassPostProcess},!0))},t.prototype._createBlurPostProcesses=function(e,t,i,r){var n=this;void 0===r&&(r="blurWidth");var s=e.getEngine(),a=new Gr("HDRBlurH_"+i,new o.w(1,0),this[r],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,_.a.TEXTURETYPE_UNSIGNED_INT),c=new Gr("HDRBlurV_"+i,new o.w(0,1),this[r],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,_.a.TEXTURETYPE_UNSIGNED_INT);a.onActivateObservable.add(function(){var e=a.width/s.getRenderWidth();a.kernel=n[r]*e}),c.onActivateObservable.add(function(){var e=c.height/s.getRenderHeight();c.kernel=n.horizontalBlur?64*e:n[r]*e}),this.addEffect(new ma(e.getEngine(),"HDRBlurH"+i,function(){return a},!0)),this.addEffect(new ma(e.getEngine(),"HDRBlurV"+i,function(){return c},!0)),this.blurHPostProcesses.push(a),this.blurVPostProcesses.push(c)},t.prototype._createTextureAdderPostProcess=function(e,t){var i=this;this.textureAdderPostProcess=new Ot("HDRTextureAdder","standard",["exposure"],["otherSampler","lensSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define TEXTURE_ADDER",_.a.TEXTURETYPE_UNSIGNED_INT),this.textureAdderPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",i._vlsEnabled?i._currentDepthOfFieldSource:i.originalPostProcess),e.setTexture("lensSampler",i.lensTexture),e.setFloat("exposure",i.exposure),i._currentDepthOfFieldSource=i.textureAdderFinalPostProcess},this.addEffect(new ma(e.getEngine(),"HDRTextureAdder",function(){return i.textureAdderPostProcess},!0))},t.prototype._createVolumetricLightPostProcess=function(e,t){var i=this,r=e.enableGeometryBufferRenderer();r.enablePosition=!0;var n=r.getGBuffer();this.volumetricLightPostProcess=new Ot("HDRVLS","standard",["shadowViewProjection","cameraPosition","sunDirection","sunColor","scatteringCoefficient","scatteringPower","depthValues"],["shadowMapSampler","positionSampler"],t/8,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLS\n#define NB_STEPS "+this._volumetricLightStepsCount.toFixed(1));var s=o.w.Zero();this.volumetricLightPostProcess.onApply=function(e){if(i.sourceLight&&i.sourceLight.getShadowGenerator()&&i._scene.activeCamera){var t=i.sourceLight.getShadowGenerator();e.setTexture("shadowMapSampler",t.getShadowMap()),e.setTexture("positionSampler",n.textures[2]),e.setColor3("sunColor",i.sourceLight.diffuse),e.setVector3("sunDirection",i.sourceLight.getShadowDirection()),e.setVector3("cameraPosition",i._scene.activeCamera.globalPosition),e.setMatrix("shadowViewProjection",t.getTransformMatrix()),e.setFloat("scatteringCoefficient",i.volumetricLightCoefficient),e.setFloat("scatteringPower",i.volumetricLightPower),s.x=i.sourceLight.getDepthMinZ(i._scene.activeCamera),s.y=i.sourceLight.getDepthMaxZ(i._scene.activeCamera),e.setVector2("depthValues",s)}},this.addEffect(new ma(e.getEngine(),"HDRVLS",function(){return i.volumetricLightPostProcess},!0)),this._createBlurPostProcesses(e,t/4,0,"volumetricLightBlurScale"),this.volumetricLightMergePostProces=new Ot("HDRVLSMerge","standard",[],["originalSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLSMERGE"),this.volumetricLightMergePostProces.onApply=function(e){e.setTextureFromPostProcess("originalSampler",i._bloomEnabled?i.textureAdderFinalPostProcess:i.originalPostProcess),i._currentDepthOfFieldSource=i.volumetricLightFinalPostProcess},this.addEffect(new ma(e.getEngine(),"HDRVLSMerge",function(){return i.volumetricLightMergePostProces},!0))},t.prototype._createLuminancePostProcesses=function(e,i){var r=this,n=Math.pow(3,t.LuminanceSteps);this.luminancePostProcess=new Ot("HDRLuminance","standard",["lumOffsets"],[],{width:n,height:n},null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LUMINANCE",i);var s=[];this.luminancePostProcess.onApply=function(e){var t=1/r.luminancePostProcess.width,i=1/r.luminancePostProcess.height;s[0]=-.5*t,s[1]=.5*i,s[2]=.5*t,s[3]=.5*i,s[4]=-.5*t,s[5]=-.5*i,s[6]=.5*t,s[7]=-.5*i,e.setArray2("lumOffsets",s)},this.addEffect(new ma(e.getEngine(),"HDRLuminance",function(){return r.luminancePostProcess},!0));for(var a=t.LuminanceSteps-1;a>=0;a--){n=Math.pow(3,a);var c="#define LUMINANCE_DOWN_SAMPLE\n";0===a&&(c+="#define FINAL_DOWN_SAMPLER");var l=new Ot("HDRLuminanceDownSample"+a,"standard",["dsOffsets","halfDestPixelSize"],[],{width:n,height:n},null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,c,i);this.luminanceDownSamplePostProcesses.push(l)}var u=this.luminancePostProcess;this.luminanceDownSamplePostProcesses.forEach(function(t,i){var n=new Array(18);t.onApply=function(e){if(u){for(var o=0,s=-1;s<2;s++)for(var a=-1;a<2;a++)n[o]=s/u.width,n[o+1]=a/u.height,o+=2;e.setArray2("dsOffsets",n),e.setFloat("halfDestPixelSize",.5/u.width),u=i===r.luminanceDownSamplePostProcesses.length-1?r.luminancePostProcess:t}},i===r.luminanceDownSamplePostProcesses.length-1&&(t.onAfterRender=function(){var t=e.getEngine().readPixels(0,0,1,1),i=new o.y(1/16581375,1/65025,1/255,1);r._hdrCurrentLuminance=(t[0]*i.x+t[1]*i.y+t[2]*i.z+t[3]*i.w)/100}),r.addEffect(new ma(e.getEngine(),"HDRLuminanceDownSample"+i,function(){return t},!0))})},t.prototype._createHdrPostProcess=function(e,t){var i=this;this.hdrPostProcess=new Ot("HDR","standard",["averageLuminance"],["textureAdderSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define HDR",_.a.TEXTURETYPE_UNSIGNED_INT);var r=1,n=0,o=0;this.hdrPostProcess.onApply=function(t){if(t.setTextureFromPostProcess("textureAdderSampler",i._currentDepthOfFieldSource),n+=e.getEngine().getDeltaTime(),r<0)r=i._hdrCurrentLuminance;else{var s=(o-n)/1e3;i._hdrCurrentLuminancer-i.hdrIncreaseRate*s?r-=i.hdrIncreaseRate*s:r=i._hdrCurrentLuminance}r=D.a.Clamp(r,i.hdrMinimumLuminance,1e20),t.setFloat("averageLuminance",r),o=n,i._currentDepthOfFieldSource=i.hdrFinalPostProcess},this.addEffect(new ma(e.getEngine(),"HDR",function(){return i.hdrPostProcess},!0))},t.prototype._createLensFlarePostProcess=function(e,t){var i=this;this.lensFlarePostProcess=new Ot("HDRLensFlare","standard",["strength","ghostDispersal","haloWidth","resolution","distortionStrength"],["lensColorSampler"],t/2,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE",_.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new ma(e.getEngine(),"HDRLensFlare",function(){return i.lensFlarePostProcess},!0)),this._createBlurPostProcesses(e,t/4,2),this.lensFlareComposePostProcess=new Ot("HDRLensFlareCompose","standard",["lensStarMatrix"],["otherSampler","lensDirtSampler","lensStarSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE_COMPOSE",_.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new ma(e.getEngine(),"HDRLensFlareCompose",function(){return i.lensFlareComposePostProcess},!0));var r=new o.w(0,0);this.lensFlarePostProcess.onApply=function(e){e.setTextureFromPostProcess("textureSampler",i._bloomEnabled?i.blurHPostProcesses[0]:i.originalPostProcess),e.setTexture("lensColorSampler",i.lensColorTexture),e.setFloat("strength",i.lensFlareStrength),e.setFloat("ghostDispersal",i.lensFlareGhostDispersal),e.setFloat("haloWidth",i.lensFlareHaloWidth),r.x=i.lensFlarePostProcess.width,r.y=i.lensFlarePostProcess.height,e.setVector2("resolution",r),e.setFloat("distortionStrength",i.lensFlareDistortionStrength)};var n=o.j.FromValues(2,0,-1,0,0,2,-1,0,0,0,1,0,0,0,0,1),s=o.j.FromValues(.5,0,.5,0,0,.5,.5,0,0,0,1,0,0,0,0,1);this.lensFlareComposePostProcess.onApply=function(e){if(i._scene.activeCamera){e.setTextureFromPostProcess("otherSampler",i._currentDepthOfFieldSource),e.setTexture("lensDirtSampler",i.lensFlareDirtTexture),e.setTexture("lensStarSampler",i.lensStarTexture);var t=i._scene.activeCamera.getViewMatrix().getRow(0),r=i._scene.activeCamera.getViewMatrix().getRow(2),a=o.x.Dot(t.toVector3(),new o.x(1,0,0))+o.x.Dot(r.toVector3(),new o.x(0,0,1));a*=4;var c=o.j.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=s.multiply(c).multiply(n);e.setMatrix("lensStarMatrix",l),i._currentDepthOfFieldSource=i.lensFlareFinalPostProcess}}},t.prototype._createDepthOfFieldPostProcess=function(e,t){var i=this;this.depthOfFieldPostProcess=new Ot("HDRDepthOfField","standard",["distance"],["otherSampler","depthSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DEPTH_OF_FIELD",_.a.TEXTURETYPE_UNSIGNED_INT),this.depthOfFieldPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",i._currentDepthOfFieldSource),e.setTexture("depthSampler",i._getDepthTexture()),e.setFloat("distance",i.depthOfFieldDistance)},this.addEffect(new ma(e.getEngine(),"HDRDepthOfField",function(){return i.depthOfFieldPostProcess},!0))},t.prototype._createMotionBlurPostProcess=function(e,t){var i=this;this.motionBlurPostProcess=new Ot("HDRMotionBlur","standard",["inverseViewProjection","prevViewProjection","screenSize","motionScale","motionStrength"],["depthSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+this.motionBlurSamples.toFixed(1),_.a.TEXTURETYPE_UNSIGNED_INT);var r=0,n=o.j.Identity(),s=o.j.Identity(),a=o.j.Identity(),c=o.w.Zero();this.motionBlurPostProcess.onApply=function(t){(a=e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(s),t.setMatrix("inverseViewProjection",s),t.setMatrix("prevViewProjection",n),n=a,c.x=i.motionBlurPostProcess.width,c.y=i.motionBlurPostProcess.height,t.setVector2("screenSize",c),r=e.getEngine().getFps()/60,t.setFloat("motionScale",r),t.setFloat("motionStrength",i.motionStrength),t.setTexture("depthSampler",i._getDepthTexture())},this.addEffect(new ma(e.getEngine(),"HDRMotionBlur",function(){return i.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&&-1!==this.excludedMeshes.indexOf(e)},t.prototype._createPass=function(e,t){var i=this,r=e.getEngine();this._volumetricLightScatteringRTT=new wi("volumetricLightScatteringMap",{width:r.getRenderWidth()*t,height:r.getRenderHeight()*t},e,!1,!0,_.a.TEXTURETYPE_UNSIGNED_INT),this._volumetricLightScatteringRTT.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.renderList=null,this._volumetricLightScatteringRTT.renderParticles=!1,this._volumetricLightScatteringRTT.ignoreCameraViewport=!0;var n=this.getCamera();n?n.customRenderTargets.push(this._volumetricLightScatteringRTT):e.customRenderTargets.push(this._volumetricLightScatteringRTT);var s,a=function(e){var t=e.getRenderingMesh();if(!i._meshExcluded(t)){var r=e.getMaterial();if(r){var n=t.getScene(),o=n.getEngine();o.setState(r.backFaceCulling);var s=t._getInstancesRenderList(e._id);if(!s.mustReturn){var a=o.getCaps().instancedArrays&&null!==s.visibleInstances[e._id];if(i._isReady(e,a)){var c=i._volumetricLightScatteringPass;if(t===i.mesh&&(c=e.effect?e.effect:r.getEffect()),o.enableEffect(c),t._bind(e,c,Tn.a.TriangleFillMode),t===i.mesh)r.bind(t.getWorldMatrix(),t);else{if(i._volumetricLightScatteringPass.setMatrix("viewProjection",n.getTransformMatrix()),r&&r.needAlphaTesting()){var l=r.getAlphaTestTexture();i._volumetricLightScatteringPass.setTexture("diffuseSampler",l),l&&i._volumetricLightScatteringPass.setMatrix("diffuseMatrix",l.getTextureMatrix())}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&i._volumetricLightScatteringPass.setMatrices("mBones",t.skeleton.getTransformMatrices(t))}t._processRendering(e,i._volumetricLightScatteringPass,Tn.a.TriangleFillMode,s,a,function(e,t){return c.setMatrix("world",t)})}}}}},c=new o.f(0,0,0,1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function(){s=e.clearColor,e.clearColor=c}),this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function(){e.clearColor=s}),this._volumetricLightScatteringRTT.customRenderFunction=function(t,i,r,n){var o,s=e.getEngine();if(n.length){for(s.setColorWrite(!1),o=0;ot._alphaIndex?1:e._alphaIndext._distanceToCamera?-1:0}),s.setAlphaMode(_.a.ALPHA_COMBINE),o=0;o4&&(n.push(gi.b.MatricesIndicesExtraKind),n.push(gi.b.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),r.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):r.push("#define NUM_BONE_INFLUENCERS 0"),t&&(r.push("#define INSTANCES"),n.push("world0"),n.push("world1"),n.push("world2"),n.push("world3"));var s=r.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._effect=this._scene.getEngine().createEffect("depth",n,["world","mBones","viewProjection","diffuseMatrix","depthValues"],["diffuseSampler"],s)),this._effect.isReady()},e.prototype.getDepthMap=function(){return this._depthMap},e.prototype.dispose=function(){this._depthMap.dispose()},e._SceneComponentInitialization=function(e){throw ye.a.WarnImport("DepthRendererSceneComponent")},e}();W.a.prototype.enableDepthRenderer=function(e){if(!(e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){var t=0;if(this.getEngine().getCaps().textureHalfFloatRender)t=_.a.TEXTURETYPE_HALF_FLOAT;else{if(!this.getEngine().getCaps().textureFloatRender)throw"Depth renderer does not support int texture type";t=_.a.TEXTURETYPE_FLOAT}this._depthRenderer[e.id]=new Pc(this,t,e)}return this._depthRenderer[e.id]},W.a.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 Rc=function(){function e(e){this.name=Ee.a.NAME_DEPTHRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(Ee.a.STEP_GATHERRENDERTARGETS_DEPTHRENDERER,this,this._gatherRenderTargets),this.scene._gatherActiveCameraRenderTargetsStage.registerStep(Ee.a.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 i=this.scene._depthRenderer[t];i.useOnlyInActiveCamera||e.push(i.getDepthMap())}},e.prototype._gatherActiveCameraRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var i=this.scene._depthRenderer[t];i.useOnlyInActiveCamera&&this.scene.activeCamera.id===t&&e.push(i.getDepthMap())}},e}();Pc._SceneComponentInitialization=function(e){var t=e._getComponent(Ee.a.NAME_DEPTHRENDERER);t||(t=new Rc(e),e._addComponent(t))};var Sc="uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}";Ct.a.ShadersStore.linePixelShader=Sc;var Cc="\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 worldViewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}";Ct.a.ShadersStore.lineVertexShader=Cc;Le.a.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this},Le.a.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new Oc(this,e,t),this},Object.defineProperty(Le.a.prototype,"edgesRenderer",{get:function(){return this._edgesRenderer},enumerable:!0,configurable:!0}),ss.b.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new Ic(this,e,t),this},ss.a.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),ss.b.prototype.enableEdgesRendering.apply(this,arguments),this};var Mc=function(){return function(){this.edges=new Array,this.edgesConnectedCount=0}}(),Oc=function(){function e(e,t,i,r){void 0===t&&(t=.95),void 0===i&&(i=!1),void 0===r&&(r=!0);var n=this;this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this._source=e,this._checkVerticesInsteadOfIndices=i,this._epsilon=t,this._prepareRessources(),r&&this._generateEdgesLines(),this._meshRebuildObserver=this._source.onRebuildObservable.add(function(){n._rebuild()}),this._meshDisposeObserver=this._source.onDisposeObservable.add(function(){n.dispose()})}return e.prototype._prepareRessources=function(){this._lineShader||(this._lineShader=new To.a("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[gi.b.PositionKind];e&&e._rebuild(),(e=this._buffers[gi.b.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[gi.b.PositionKind];e&&(e.dispose(),this._buffers[gi.b.PositionKind]=null),(e=this._buffers[gi.b.NormalKind])&&(e.dispose(),this._buffers[gi.b.NormalKind]=null),this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose()},e.prototype._processEdgeForAdjacencies=function(e,t,i,r,n){return e===i&&t===r||e===r&&t===i?0:e===r&&t===n||e===n&&t===r?1:e===n&&t===i||e===i&&t===n?2:-1},e.prototype._processEdgeForAdjacenciesWithVertices=function(e,t,i,r,n){return e.equalsWithEpsilon(i)&&t.equalsWithEpsilon(r)||e.equalsWithEpsilon(r)&&t.equalsWithEpsilon(i)?0:e.equalsWithEpsilon(r)&&t.equalsWithEpsilon(n)||e.equalsWithEpsilon(n)&&t.equalsWithEpsilon(r)?1:e.equalsWithEpsilon(n)&&t.equalsWithEpsilon(i)||e.equalsWithEpsilon(i)&&t.equalsWithEpsilon(n)?2:-1},e.prototype._checkEdge=function(e,t,i,r,n){var s;void 0===t?s=!0:s=o.x.Dot(i[e],i[t])4&&(r.push(gi.b.MatricesIndicesExtraKind),r.push(gi.b.MatricesWeightsExtraKind)),i.push("#define NUM_BONE_INFLUENCERS "+n.numBoneInfluencers),i.push("#define BonesPerMesh "+(n.skeleton?n.skeleton.bones.length+1:0))):i.push("#define NUM_BONE_INFLUENCERS 0"),t&&(i.push("#define INSTANCES"),r.push("world0"),r.push("world1"),r.push("world2"),r.push("world3"));var s=i.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._effect=this.scene.getEngine().createEffect("outline",r,["world","mBones","viewProjection","diffuseMatrix","offset","color","logarithmicDepthConstant"],["diffuseSampler"],s)),this._effect.isReady()},e.prototype._beforeRenderingMesh=function(e,t,i){this._savedDepthWrite=this._engine.getDepthWrite(),e.renderOutline&&(this._engine.setDepthWrite(!1),this.render(t,i),this._engine.setDepthWrite(this._savedDepthWrite))},e.prototype._afterRenderingMesh=function(e,t,i){if(e.renderOutline&&this._savedDepthWrite&&(this._engine.setDepthWrite(!0),this._engine.setColorWrite(!1),this.render(t,i),this._engine.setColorWrite(!0)),e.renderOverlay){var r=this._engine.getAlphaMode();this._engine.setAlphaMode(_.a.ALPHA_COMBINE),this.render(t,i,!0),this._engine.setAlphaMode(r)}},e}(),Nc=i(104),Bc=function(){function e(e,t){this.name=e,this.color=new o.f(1,1,1,1),this.width=1,this.height=1,this.angle=0,this.cellIndex=0,this.invertU=0,this.invertV=0,this.animations=new Array,this.isPickable=!1,this._animationStarted=!1,this._loopAnimation=!1,this._fromIndex=0,this._toIndex=0,this._delay=0,this._direction=1,this._time=0,this.isVisible=!0,this._manager=t,this._manager.sprites.push(this),this.position=o.x.Zero()}return Object.defineProperty(e.prototype,"size",{get:function(){return this.width},set:function(e){this.width=e,this.height=e},enumerable:!0,configurable:!0}),e.prototype.playAnimation=function(e,t,i,r,n){this._fromIndex=e,this._toIndex=t,this._loopAnimation=i,this._delay=r,this._animationStarted=!0,this._direction=ethis._delay&&(this._time=this._time%this._delay,this.cellIndex+=this._direction,this.cellIndex>this._toIndex&&(this._loopAnimation?this.cellIndex=this._fromIndex:(this.cellIndex=this._toIndex,this._animationStarted=!1,this._onAnimationEnd&&this._onAnimationEnd(),this.disposeWhenFinishedAnimating&&this.dispose()))))},e.prototype.dispose=function(){for(var e=0;e0)for(var o=0;o=n.distance))&&(n=a,i))break}}return n||new Yi.a},W.a.prototype.pickSprite=function(e,t,i,r,n){return this.createPickingRayInCameraSpaceToRef(e,t,this._tempSpritePickingRay,n),this._internalPickSprites(this._tempSpritePickingRay,i,r,n)},W.a.prototype.pickSpriteWithRay=function(e,t,i,r){if(!this._tempSpritePickingRay)return null;if(!r){if(!this.activeCamera)return null;r=this.activeCamera}return ti.a.TransformToRef(e,r.getViewMatrix(),this._tempSpritePickingRay),this._internalPickSprites(this._tempSpritePickingRay,t,i,r)},W.a.prototype.setPointerOverSprite=function(e){this._pointerOverSprite!==e&&(this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(_.a.ACTION_OnPointerOutTrigger,c.a.CreateNewFromSprite(this._pointerOverSprite,this)),this._pointerOverSprite=e,this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(_.a.ACTION_OnPointerOverTrigger,c.a.CreateNewFromSprite(this._pointerOverSprite,this)))},W.a.prototype.getPointerOverSprite=function(){return this._pointerOverSprite};var Uc=function(){function e(e){this.name=Ee.a.NAME_SPRITE,this.scene=e,this.scene.spriteManagers=new Array,this.scene._tempSpritePickingRay=ti.a?ti.a.Zero():null,this.scene.onBeforeSpritesRenderingObservable=new n.c,this.scene.onAfterSpritesRenderingObservable=new n.c,this._spritePredicate=function(e){return!!e.actionManager&&(e.isPickable&&e.actionManager.hasPointerTriggers)}}return e.prototype.register=function(){this.scene._pointerMoveStage.registerStep(Ee.a.STEP_POINTERMOVE_SPRITE,this,this._pointerMove),this.scene._pointerDownStage.registerStep(Ee.a.STEP_POINTERDOWN_SPRITE,this,this._pointerDown),this.scene._pointerUpStage.registerStep(Ee.a.STEP_POINTERUP_SPRITE,this,this._pointerUp)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){this.scene.onBeforeSpritesRenderingObservable.clear(),this.scene.onAfterSpritesRenderingObservable.clear();for(var e=this.scene.spriteManagers;e.length;)e[0].dispose()},e.prototype._pickSpriteButKeepRay=function(e,t,i,r,n){var o=this.scene.pickSprite(t,i,this._spritePredicate,r,n);return o&&(o.ray=e?e.ray:null),o},e.prototype._pointerMove=function(e,t,i,r,n){var o=this.scene;return r?o.setPointerOverSprite(null):(i=this._pickSpriteButKeepRay(i,e,t,!1,o.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite?(o.setPointerOverSprite(i.pickedSprite),o._pointerOverSprite&&o._pointerOverSprite.actionManager&&o._pointerOverSprite.actionManager.hoverCursor?n.style.cursor=o._pointerOverSprite.actionManager.hoverCursor:n.style.cursor=o.hoverCursor):o.setPointerOverSprite(null),i},e.prototype._pointerDown=function(e,t,i,r){var n=this.scene;if(n._pickedDownSprite=null,n.spriteManagers.length>0&&(i=n.pickSprite(e,t,this._spritePredicate,!1,n.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite&&i.pickedSprite.actionManager){switch(n._pickedDownSprite=i.pickedSprite,r.button){case 0:i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnLeftPickTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r));break;case 1:i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnCenterPickTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r));break;case 2:i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnRightPickTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r))}i.pickedSprite.actionManager&&i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnPickDownTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r))}return i},e.prototype._pointerUp=function(e,t,i,r){var n=this.scene;if(n.spriteManagers.length>0){var o=n.pickSprite(e,t,this._spritePredicate,!1,n.cameraToUseForPointers||void 0);o&&(o.hit&&o.pickedSprite&&o.pickedSprite.actionManager&&(o.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnPickUpTrigger,c.a.CreateNewFromSprite(o.pickedSprite,n,r)),o.pickedSprite.actionManager&&(this.scene._isPointerSwiping()||o.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnPickTrigger,c.a.CreateNewFromSprite(o.pickedSprite,n,r)))),n._pickedDownSprite&&n._pickedDownSprite.actionManager&&n._pickedDownSprite!==o.pickedSprite&&n._pickedDownSprite.actionManager.processTrigger(_.a.ACTION_OnPickOutTrigger,c.a.CreateNewFromSprite(n._pickedDownSprite,n,r)))}return i},e}(),Vc="uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest)\n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include\ngl_FragColor=color;\n}";Ct.a.ShadersStore.spritesPixelShader=Vc;var Gc="\nattribute vec4 position;\nattribute vec4 options;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform vec2 textureInfos;\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include\nvoid main(void) {\nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz;\nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=options.zw;\nvec2 uvScale=textureInfos.xy;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0);\n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-cellInfo.x),1.0-abs(offset.y-cellInfo.y));\nvUV=(uvOffset+cellInfo.zw)*uvScale;\n\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n}";Ct.a.ShadersStore.spritesVertexShader=Gc;var kc,zc=function(){function e(e,t,i,r,o,s,a){if(void 0===s&&(s=.01),void 0===a&&(a=Ge.a.TRILINEAR_SAMPLINGMODE),this.name=e,this.sprites=new Array,this.renderingGroupId=0,this.layerMask=268435455,this.fogEnabled=!0,this.isPickable=!1,this.onDisposeObservable=new n.c,this._vertexBuffers={},o._getComponent(Ee.a.NAME_SPRITE)||o._addComponent(new Uc(o)),this._capacity=i,this._spriteTexture=new Ge.a(t,o,!0,!1,a),this._spriteTexture.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._spriteTexture.wrapV=Ge.a.CLAMP_ADDRESSMODE,r.width&&r.height)this.cellWidth=r.width,this.cellHeight=r.height;else{if(void 0===r)return;this.cellWidth=r,this.cellHeight=r}this._epsilon=s,this._scene=o,this._scene.spriteManagers.push(this);for(var c=[],l=0,u=0;u>0;this._vertexData[o+10]=t.cellIndex-s*n,this._vertexData[o+11]=s,this._vertexData[o+12]=t.color.r,this._vertexData[o+13]=t.color.g,this._vertexData[o+14]=t.color.b,this._vertexData[o+15]=t.color.a},e.prototype.intersects=function(e,t,i,r){for(var n=Math.min(this._capacity,this.sprites.length),s=o.x.Zero(),a=o.x.Zero(),c=Number.MAX_VALUE,l=null,u=o.x.Zero(),h=t.getViewMatrix(),d=0;dp&&(c=p,l=f,r))break}}}if(l){var _=new Yi.a;return _.hit=!0,_.pickedSprite=l,_.distance=c,_}return null},e.prototype.render=function(){if(this._effectBase.isReady()&&this._effectFog.isReady()&&this._spriteTexture&&this._spriteTexture.isReady()&&this.sprites.length){for(var e=this._scene.getEngine(),t=this._spriteTexture.getBaseSize(),i=e.getDeltaTime(),r=Math.min(this._capacity,this.sprites.length),n=t.width/this.cellWidth,o=0,s=0;s-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 Yc(this._waitingTasksCount,this._totalTasksCount,e))}catch(e){p.a.Error("Error running progress callbacks."),console.log(e)}if(0===this._waitingTasksCount){try{this.onFinish&&this.onFinish(this._tasks);for(var t=this._tasks.slice(),i=0,r=t;i-1&&this._tasks.splice(n,1)}}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(e){p.a.Error("Error running tasks-done callbacks."),console.log(e)}this._isLoading=!1,this._scene.getEngine().hideLoadingUI()}},e.prototype._runTask=function(e){var t=this,i=function(i,r){e._setErrorObject(i,r),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){i("Error executing task success callbacks",e)}},i)},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;e0&&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,i,r){var n=this,o=e.createReader(),s=e.fullPath.replace(/^\//,"").replace(/(.+?)\/?$/,"$1/");o.readEntries(function(e){i.count+=e.length;for(var o=0,a=e;o0)){for(var i=new Array,r=[],n=e.dataTransfer?e.dataTransfer.items:null,o=0;o0&&p.a.ClearLogCache(),this._engine.stopRenderLoop()),dr.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)})):p.a.Error("Please provide a valid .babylon file.")},e}(),nl=i(102),ol=i(103),sl=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}(),al=function(e){function t(t,i,r){void 0===t&&(t=0),void 0===i&&(i=1024),void 0===r&&(r=.5);var n=e.call(this,t)||this;return n.priority=t,n.maximumSize=i,n.step=r,n}return l.d(t,e),t.prototype.getDescription=function(){return"Reducing render target texture size to "+this.maximumSize},t.prototype.apply=function(e,t){for(var i=!0,r=0;rthis.maximumSize&&(n.scale(this.step),i=!1)}}return i},t}(sl),cl=function(e){function t(t,i,r){void 0===t&&(t=0),void 0===i&&(i=2),void 0===r&&(r=.25);var n=e.call(this,t)||this;return n.priority=t,n.maximumScale=i,n.step=r,n._currentScale=-1,n._directionOffset=1,n}return l.d(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}(sl),ll=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.getDescription=function(){return"Turning shadows on/off"},t.prototype.apply=function(e,t){return e.shadowsEnabled=t.isInImprovementMode,!0},t}(sl),ul=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(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}(sl),hl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(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}(sl),dl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(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}(sl),fl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.getDescription=function(){return"Turning particles on/off"},t.prototype.apply=function(e,t){return e.particlesEnabled=t.isInImprovementMode,!0},t}(sl),pl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.getDescription=function(){return"Turning render targets off"},t.prototype.apply=function(e,t){return e.renderTargetsEnabled=t.isInImprovementMode,!0},t}(sl),_l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._canBeMerged=function(e){if(!(e instanceof de.a))return!1;var t=e;return!t.isDisposed()&&(!(!t.isVisible||!t.isEnabled())&&(!(t.instances.length>0)&&(!t.skeleton&&!t.hasLODLevels)))},t}return l.d(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,i,r){for(var n=e.meshes.slice(0),o=n.length,s=0;s=this._targetFrameRate)return this._isRunning=!1,void this.onSuccessObservable.notifyObservers(this);for(var r=!0,n=!0,o=0;o0)for(o.reflectionProbes=[],i=0;i0&&setTimeout(function(){i.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){i._resolve=e,i._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&&ve.h.Download(e,this._fileName)},e._defaultOptions={mimeType:"video/webm",fps:25,recordChunckSize:3e3},e}(),Al=function(){function e(e){this._pendingActions=new Array,this._workerInfos=e.map(function(e){return{worker:e,active:!1}})}return e.prototype.dispose=function(){for(var e=0,t=this._workerInfos;es&&(l=(u=s)*c);var h=Math.max(0,o-l)/2,d=Math.max(0,s-u)/2,f=e.getRenderingCanvas();a&&f&&a.drawImage(f,h,d,l,u),ve.h.EncodeScreenshotCanvasData(r,n)},e.CreateScreenshotUsingRenderTarget=function(e,t,i,r,n,o,s,a){var c,l;if(void 0===n&&(n="image/png"),void 0===o&&(o=1),void 0===s&&(s=!1),i.precision)c=Math.round(e.getRenderWidth()*i.precision),l=Math.round(c/e.getAspectRatio(t)),i={width:c,height:l};else if(i.width&&i.height)c=i.width,l=i.height;else if(i.width&&!i.height)c=i.width,l=Math.round(c/e.getAspectRatio(t)),i={width:c,height:l};else if(i.height&&!i.width)l=i.height,i={width:c=Math.round(l*e.getAspectRatio(t)),height:l};else{if(isNaN(i))return void p.a.Error("Invalid 'size' parameter !");l=i,c=i}var u=t.getScene(),h=null;u.activeCamera!==t&&(h=u.activeCamera,u.activeCamera=t);var d=e.getRenderingCanvas();if(d){var f={width:d.width,height:d.height};e.setSize(c,l),u.render();var m=new wi("screenShot",i,u,!1,!1,_.a.TEXTURETYPE_UNSIGNED_INT,!1,Ge.a.NEAREST_SAMPLINGMODE);m.renderList=null,m.samples=o,s&&m.addPostProcess(new za("antialiasing",1,u.activeCamera)),m.onAfterRenderObservable.add(function(){ve.h.DumpFramebuffer(c,l,e,r,n,a)}),u.incrementRenderId(),u.resetCachedMaterial(),m.render(!0),m.dispose(),h&&(u.activeCamera=h),e.setSize(f.width,f.height),t.getProjectionMatrix(!0)}else p.a.Error("No rendering canvas found !")},e}();ve.h.CreateScreenshot=Pl.CreateScreenshot,ve.h.CreateScreenshotUsingRenderTarget=Pl.CreateScreenshotUsingRenderTarget,i.d(t,"AbstractScene",function(){return r.a}),i.d(t,"Action",function(){return a}),i.d(t,"ActionEvent",function(){return c.a}),i.d(t,"ActionManager",function(){return C}),i.d(t,"Condition",function(){return u}),i.d(t,"ValueCondition",function(){return h}),i.d(t,"PredicateCondition",function(){return d}),i.d(t,"StateCondition",function(){return f}),i.d(t,"SwitchBooleanAction",function(){return m}),i.d(t,"SetStateAction",function(){return g}),i.d(t,"SetValueAction",function(){return v}),i.d(t,"IncrementValueAction",function(){return y}),i.d(t,"PlayAnimationAction",function(){return b}),i.d(t,"StopAnimationAction",function(){return T}),i.d(t,"DoNothingAction",function(){return E}),i.d(t,"CombineAction",function(){return x}),i.d(t,"ExecuteCodeAction",function(){return A}),i.d(t,"SetParentAction",function(){return P}),i.d(t,"PlaySoundAction",function(){return M}),i.d(t,"StopSoundAction",function(){return O}),i.d(t,"InterpolateValueAction",function(){return B}),i.d(t,"Animatable",function(){return K}),i.d(t,"Animation",function(){return N}),i.d(t,"TargetedAnimation",function(){return Q}),i.d(t,"AnimationGroup",function(){return q}),i.d(t,"AnimationPropertiesOverride",function(){return Z}),i.d(t,"EasingFunction",function(){return J}),i.d(t,"CircleEase",function(){return $}),i.d(t,"BackEase",function(){return ee}),i.d(t,"BounceEase",function(){return te}),i.d(t,"CubicEase",function(){return ie}),i.d(t,"ElasticEase",function(){return re}),i.d(t,"ExponentialEase",function(){return ne}),i.d(t,"PowerEase",function(){return oe}),i.d(t,"QuadraticEase",function(){return se}),i.d(t,"QuarticEase",function(){return ae}),i.d(t,"QuinticEase",function(){return ce}),i.d(t,"SineEase",function(){return le}),i.d(t,"BezierCurveEase",function(){return ue}),i.d(t,"RuntimeAnimation",function(){return j}),i.d(t,"AnimationEvent",function(){return he}),i.d(t,"AnimationKeyInterpolation",function(){return I}),i.d(t,"AnimationRange",function(){return L}),i.d(t,"KeepAssets",function(){return fe}),i.d(t,"AssetContainer",function(){return pe}),i.d(t,"Analyser",function(){return me}),i.d(t,"AudioEngine",function(){return ge}),i.d(t,"AudioSceneComponent",function(){return xe}),i.d(t,"Sound",function(){return be}),i.d(t,"SoundTrack",function(){return Te}),i.d(t,"WeightedSound",function(){return Ae}),i.d(t,"AutoRotationBehavior",function(){return Re}),i.d(t,"BouncingBehavior",function(){return Se}),i.d(t,"FramingBehavior",function(){return Ce}),i.d(t,"AttachToBoxBehavior",function(){return Oe}),i.d(t,"FadeInOutBehavior",function(){return Ie}),i.d(t,"MultiPointerScaleBehavior",function(){return we}),i.d(t,"PointerDragBehavior",function(){return De.a}),i.d(t,"SixDofDragBehavior",function(){return Be}),i.d(t,"Bone",function(){return Y}),i.d(t,"BoneIKController",function(){return Ue}),i.d(t,"BoneLookController",function(){return Ve}),i.d(t,"Skeleton",function(){return ze}),i.d(t,"CameraInputTypes",function(){return je}),i.d(t,"CameraInputsManager",function(){return We}),i.d(t,"Camera",function(){return Fe.a}),i.d(t,"TargetCamera",function(){return ft}),i.d(t,"FreeCamera",function(){return pt}),i.d(t,"FreeCameraInputsManager",function(){return st}),i.d(t,"TouchCamera",function(){return _t}),i.d(t,"ArcRotateCamera",function(){return mt}),i.d(t,"ArcRotateCameraInputsManager",function(){return $e}),i.d(t,"DeviceOrientationCamera",function(){return gt}),i.d(t,"FlyCamera",function(){return yt}),i.d(t,"FlyCameraInputsManager",function(){return vt}),i.d(t,"FollowCamera",function(){return xt}),i.d(t,"ArcFollowCamera",function(){return At}),i.d(t,"GamepadCamera",function(){return Rt}),i.d(t,"UniversalCamera",function(){return Pt}),i.d(t,"VirtualJoysticksCamera",function(){return Yt}),i.d(t,"ArcRotateCameraGamepadInput",function(){return Ke}),i.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return qe}),i.d(t,"ArcRotateCameraMouseWheelInput",function(){return Ze}),i.d(t,"ArcRotateCameraPointersInput",function(){return Je}),i.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return et}),i.d(t,"FlyCameraKeyboardInput",function(){return tt}),i.d(t,"FlyCameraMouseInput",function(){return it}),i.d(t,"FreeCameraDeviceOrientationInput",function(){return at}),i.d(t,"FreeCameraGamepadInput",function(){return ct}),i.d(t,"FreeCameraKeyboardMoveInput",function(){return rt}),i.d(t,"FreeCameraMouseInput",function(){return nt}),i.d(t,"FreeCameraTouchInput",function(){return ot}),i.d(t,"FreeCameraVirtualJoystickInput",function(){return dt}),i.d(t,"AnaglyphArcRotateCamera",function(){return Bt}),i.d(t,"AnaglyphFreeCamera",function(){return Ut}),i.d(t,"AnaglyphGamepadCamera",function(){return Vt}),i.d(t,"AnaglyphUniversalCamera",function(){return Gt}),i.d(t,"StereoscopicArcRotateCamera",function(){return jt}),i.d(t,"StereoscopicFreeCamera",function(){return Wt}),i.d(t,"StereoscopicGamepadCamera",function(){return Ht}),i.d(t,"StereoscopicUniversalCamera",function(){return Xt}),i.d(t,"VRCameraMetrics",function(){return Kt}),i.d(t,"VRDeviceOrientationArcRotateCamera",function(){return Zt}),i.d(t,"VRDeviceOrientationFreeCamera",function(){return Jt}),i.d(t,"VRDeviceOrientationGamepadCamera",function(){return ei}),i.d(t,"VRExperienceHelper",function(){return Ci}),i.d(t,"WebVRFreeCamera",function(){return ci}),i.d(t,"WebXRCamera",function(){return Mi}),i.d(t,"WebXREnterExitUIButton",function(){return Ui}),i.d(t,"WebXREnterExitUIOptions",function(){return Vi}),i.d(t,"WebXREnterExitUI",function(){return Gi}),i.d(t,"WebXRState",function(){return Li}),i.d(t,"WebXRExperienceHelper",function(){return Bi}),i.d(t,"WebXRController",function(){return ki}),i.d(t,"WebXRInput",function(){return zi}),i.d(t,"WebXRManagedOutputCanvas",function(){return ji}),i.d(t,"WebXRSessionManager",function(){return Fi}),i.d(t,"Collider",function(){return Hi}),i.d(t,"DefaultCollisionCoordinator",function(){return Xi}),i.d(t,"PickingInfo",function(){return Yi.a}),i.d(t,"IntersectionInfo",function(){return Ki.a}),i.d(t,"BoundingBox",function(){return Qi.a}),i.d(t,"BoundingInfo",function(){return qi.a}),i.d(t,"BoundingSphere",function(){return Zi.a}),i.d(t,"Ray",function(){return ti.a}),i.d(t,"Octree",function(){return $i}),i.d(t,"OctreeBlock",function(){return Ji}),i.d(t,"OctreeSceneComponent",function(){return er}),i.d(t,"AxesViewer",function(){return tr.AxesViewer}),i.d(t,"BoneAxesViewer",function(){return tr.BoneAxesViewer}),i.d(t,"DebugLayer",function(){return tr.DebugLayer}),i.d(t,"PhysicsViewer",function(){return tr.PhysicsViewer}),i.d(t,"RayHelper",function(){return tr.RayHelper}),i.d(t,"SkeletonViewer",function(){return tr.SkeletonViewer}),i.d(t,"Constants",function(){return _.a}),i.d(t,"InstancingAttributeInfo",function(){return _e.d}),i.d(t,"DepthTextureCreationOptions",function(){return _e.a}),i.d(t,"EngineCapabilities",function(){return _e.c}),i.d(t,"Engine",function(){return _e.b}),i.d(t,"EngineStore",function(){return R.a}),i.d(t,"NullEngineOptions",function(){return rr}),i.d(t,"NullEngine",function(){return nr}),i.d(t,"_OcclusionDataStorage",function(){return sr}),i.d(t,"_forceTransformFeedbackToBundle",function(){return!0}),i.d(t,"KeyboardEventTypes",function(){return Qe.a}),i.d(t,"KeyboardInfo",function(){return Qe.b}),i.d(t,"KeyboardInfoPre",function(){return Qe.c}),i.d(t,"PointerEventTypes",function(){return Pe.a}),i.d(t,"PointerInfoBase",function(){return Pe.c}),i.d(t,"PointerInfoPre",function(){return Pe.d}),i.d(t,"PointerInfo",function(){return Pe.b}),i.d(t,"ClipboardEventTypes",function(){return ar}),i.d(t,"ClipboardInfo",function(){return cr}),i.d(t,"DaydreamController",function(){return fr}),i.d(t,"GearVRController",function(){return pr}),i.d(t,"GenericController",function(){return _r}),i.d(t,"OculusTouchController",function(){return mr}),i.d(t,"PoseEnabledControllerType",function(){return $t}),i.d(t,"PoseEnabledControllerHelper",function(){return ii}),i.d(t,"PoseEnabledController",function(){return ri}),i.d(t,"ViveController",function(){return gr}),i.d(t,"WebVRController",function(){return li}),i.d(t,"WindowsMotionController",function(){return yr}),i.d(t,"StickValues",function(){return He}),i.d(t,"Gamepad",function(){return Xe}),i.d(t,"GenericPad",function(){return Ye}),i.d(t,"GamepadManager",function(){return xi}),i.d(t,"GamepadSystemSceneComponent",function(){return Ai}),i.d(t,"Xbox360Button",function(){return si}),i.d(t,"Xbox360Dpad",function(){return ai}),i.d(t,"Xbox360Pad",function(){return ui}),i.d(t,"AxisDragGizmo",function(){return br.a}),i.d(t,"AxisScaleGizmo",function(){return Pr}),i.d(t,"BoundingBoxGizmo",function(){return Sr}),i.d(t,"Gizmo",function(){return xr.a}),i.d(t,"GizmoManager",function(){return wr}),i.d(t,"PlaneRotationGizmo",function(){return Cr}),i.d(t,"PositionGizmo",function(){return Or}),i.d(t,"RotationGizmo",function(){return Mr}),i.d(t,"ScaleGizmo",function(){return Dr}),i.d(t,"LightGizmo",function(){return Lr}),i.d(t,"EnvironmentHelper",function(){return tn}),i.d(t,"PhotoDome",function(){return nn}),i.d(t,"_forceSceneHelpersToBundle",function(){return!0}),i.d(t,"VideoDome",function(){return vn}),i.d(t,"EngineInstrumentation",function(){return yn}),i.d(t,"SceneInstrumentation",function(){return bn}),i.d(t,"_TimeToken",function(){return or}),i.d(t,"EffectLayer",function(){return An}),i.d(t,"EffectLayerSceneComponent",function(){return Pn}),i.d(t,"GlowLayer",function(){return Cn}),i.d(t,"HighlightLayer",function(){return In}),i.d(t,"Layer",function(){return Fn}),i.d(t,"LayerSceneComponent",function(){return Dn}),i.d(t,"LensFlare",function(){return Nn}),i.d(t,"LensFlareSystem",function(){return Vn}),i.d(t,"LensFlareSystemSceneComponent",function(){return Gn}),i.d(t,"Light",function(){return ni.a}),i.d(t,"ShadowLight",function(){return kn}),i.d(t,"DirectionalLight",function(){return Yn}),i.d(t,"HemisphericLight",function(){return oi}),i.d(t,"PointLight",function(){return Kn}),i.d(t,"SpotLight",function(){return Qn}),i.d(t,"ShadowGenerator",function(){return Hn}),i.d(t,"ShadowGeneratorSceneComponent",function(){return Xn}),i.d(t,"DefaultLoadingScreen",function(){return qn}),i.d(t,"SceneLoaderProgressEvent",function(){return hr}),i.d(t,"SceneLoader",function(){return dr}),i.d(t,"SceneLoaderFlags",function(){return ur.a}),i.d(t,"_BabylonLoaderRegistered",function(){return!0}),i.d(t,"ColorCurves",function(){return mo.a}),i.d(t,"EffectFallbacks",function(){return Ct.c}),i.d(t,"EffectCreationOptions",function(){return Ct.b}),i.d(t,"Effect",function(){return Ct.a}),i.d(t,"FresnelParameters",function(){return go}),i.d(t,"ImageProcessingConfigurationDefines",function(){return hi.b}),i.d(t,"ImageProcessingConfiguration",function(){return hi.a}),i.d(t,"Material",function(){return Tn.a}),i.d(t,"MaterialDefines",function(){return Wr.a}),i.d(t,"MaterialHelper",function(){return jr.a}),i.d(t,"MultiMaterial",function(){return Jn.a}),i.d(t,"PushMaterial",function(){return Hr.a}),i.d(t,"ShaderMaterial",function(){return To.a}),i.d(t,"StandardMaterialDefines",function(){return di.b}),i.d(t,"StandardMaterial",function(){return di.a}),i.d(t,"BaseTexture",function(){return Fr.a}),i.d(t,"CubeTexture",function(){return zr}),i.d(t,"HDRCubeTexture",function(){return io}),i.d(t,"InternalTexture",function(){return Oi.a}),i.d(t,"DummyInternalTextureTracker",function(){return xo.a}),i.d(t,"MirrorTexture",function(){return kr}),i.d(t,"MultiRenderTarget",function(){return Go}),i.d(t,"RenderTargetTexture",function(){return wi}),i.d(t,"Texture",function(){return Ge.a}),i.d(t,"UniformBuffer",function(){return qo.a}),i.d(t,"MaterialFlags",function(){return Xr.a}),i.d(t,"BackgroundMaterial",function(){return $r}),i.d(t,"PBRBaseMaterial",function(){return _n}),i.d(t,"PBRBaseSimpleMaterial",function(){return vo}),i.d(t,"PBRMaterial",function(){return mn}),i.d(t,"PBRMetallicRoughnessMaterial",function(){return yo}),i.d(t,"PBRSpecularGlossinessMaterial",function(){return bo}),i.d(t,"ColorGradingTexture",function(){return Eo}),i.d(t,"DynamicTexture",function(){return fi}),i.d(t,"ProceduralTexture",function(){return jo}),i.d(t,"RawCubeTexture",function(){return Yo}),i.d(t,"RawTexture",function(){return ke}),i.d(t,"RawTexture3D",function(){return Ko}),i.d(t,"RefractionTexture",function(){return Qo}),i.d(t,"VideoTexture",function(){return gn}),i.d(t,"_DDSTextureLoader",function(){return Io}),i.d(t,"_ENVTextureLoader",function(){return Fo}),i.d(t,"_KTXTextureLoader",function(){return Bo}),i.d(t,"_TGATextureLoader",function(){return Vo}),i.d(t,"CustomProceduralTexture",function(){return Wo}),i.d(t,"NoiseProceduralTexture",function(){return Xo}),i.d(t,"ProceduralTextureSceneComponent",function(){return ko}),i.d(t,"Scalar",function(){return D.a}),i.d(t,"ToGammaSpace",function(){return o.u}),i.d(t,"ToLinearSpace",function(){return o.v}),i.d(t,"Epsilon",function(){return o.h}),i.d(t,"Color3",function(){return o.e}),i.d(t,"Color4",function(){return o.f}),i.d(t,"Vector2",function(){return o.w}),i.d(t,"Vector3",function(){return o.x}),i.d(t,"Vector4",function(){return o.y}),i.d(t,"Size",function(){return o.r}),i.d(t,"Quaternion",function(){return o.q}),i.d(t,"Matrix",function(){return o.j}),i.d(t,"Plane",function(){return o.n}),i.d(t,"Viewport",function(){return o.z}),i.d(t,"Frustum",function(){return o.i}),i.d(t,"Space",function(){return o.s}),i.d(t,"Axis",function(){return o.c}),i.d(t,"BezierCurve",function(){return o.d}),i.d(t,"Orientation",function(){return o.k}),i.d(t,"Angle",function(){return o.a}),i.d(t,"Arc2",function(){return o.b}),i.d(t,"Path2",function(){return o.l}),i.d(t,"Path3D",function(){return o.m}),i.d(t,"Curve3",function(){return o.g}),i.d(t,"PositionNormalVertex",function(){return o.p}),i.d(t,"PositionNormalTextureVertex",function(){return o.o}),i.d(t,"Tmp",function(){return o.t}),i.d(t,"SphericalPolynomial",function(){return Ao.b}),i.d(t,"SphericalHarmonics",function(){return Ao.a}),i.d(t,"AbstractMesh",function(){return Le.a}),i.d(t,"Buffer",function(){return gi.a}),i.d(t,"VertexBuffer",function(){return gi.b}),i.d(t,"CSG",function(){return ns}),i.d(t,"Geometry",function(){return Zn.a}),i.d(t,"GroundMesh",function(){return vi}),i.d(t,"InstancedMesh",function(){return os.a}),i.d(t,"LinesMesh",function(){return ss.b}),i.d(t,"InstancedLinesMesh",function(){return ss.a}),i.d(t,"MeshLODLevel",function(){return de.b}),i.d(t,"_CreationDataStorage",function(){return de.c}),i.d(t,"_InstancesBatch",function(){return de.d}),i.d(t,"Mesh",function(){return de.a}),i.d(t,"VertexData",function(){return mi.a}),i.d(t,"MeshBuilder",function(){return Ts}),i.d(t,"SimplificationSettings",function(){return Es}),i.d(t,"SimplificationQueue",function(){return xs}),i.d(t,"SimplificationType",function(){return ys}),i.d(t,"SimplicationQueueSceneComponent",function(){return Ms}),i.d(t,"Polygon",function(){return ds}),i.d(t,"PolygonMeshBuilder",function(){return fs}),i.d(t,"BaseSubMesh",function(){return Jo.a}),i.d(t,"SubMesh",function(){return Jo.b}),i.d(t,"TransformNode",function(){return rn.a}),i.d(t,"BoxBuilder",function(){return Tr.a}),i.d(t,"SphereBuilder",function(){return Rr.a}),i.d(t,"CylinderBuilder",function(){return Ti.a}),i.d(t,"LinesBuilder",function(){return Er.a}),i.d(t,"PlaneBuilder",function(){return en.a}),i.d(t,"DracoCompression",function(){return Zo}),i.d(t,"DiscBuilder",function(){return cs}),i.d(t,"RibbonBuilder",function(){return as}),i.d(t,"TorusBuilder",function(){return bi}),i.d(t,"TorusKnotBuilder",function(){return ls}),i.d(t,"PolygonBuilder",function(){return ps}),i.d(t,"ShapeBuilder",function(){return _s}),i.d(t,"LatheBuilder",function(){return ms}),i.d(t,"GroundBuilder",function(){return yi}),i.d(t,"TubeBuilder",function(){return gs}),i.d(t,"PolyhedronBuilder",function(){return Ir}),i.d(t,"IcoSphereBuilder",function(){return vs}),i.d(t,"DecalBuilder",function(){return bs}),i.d(t,"MorphTarget",function(){return ro}),i.d(t,"MorphTargetManager",function(){return no}),i.d(t,"Node",function(){return F.a}),i.d(t,"Database",function(){return Is}),i.d(t,"BaseParticleSystem",function(){return Gs}),i.d(t,"GPUParticleSystem",function(){return Zs}),i.d(t,"Particle",function(){return ks}),i.d(t,"ParticleHelper",function(){return $s}),i.d(t,"ParticleSystem",function(){return Hs}),i.d(t,"_IDoNeedToBeInTheBuild",function(){return 42}),i.d(t,"ParticleSystemSet",function(){return Js}),i.d(t,"SolidParticle",function(){return ea}),i.d(t,"ModelShape",function(){return ta}),i.d(t,"DepthSortedParticle",function(){return ia}),i.d(t,"SolidParticleSystem",function(){return na}),i.d(t,"SubEmitterType",function(){return Os}),i.d(t,"SubEmitter",function(){return zs}),i.d(t,"BoxParticleEmitter",function(){return Ds}),i.d(t,"ConeParticleEmitter",function(){return ws}),i.d(t,"CylinderParticleEmitter",function(){return Ls}),i.d(t,"CylinderDirectedParticleEmitter",function(){return Fs}),i.d(t,"HemisphericParticleEmitter",function(){return Ns}),i.d(t,"PointParticleEmitter",function(){return Bs}),i.d(t,"SphereParticleEmitter",function(){return Us}),i.d(t,"SphereDirectedParticleEmitter",function(){return Vs}),i.d(t,"PhysicsEngine",function(){return ao}),i.d(t,"PhysicsEngineSceneComponent",function(){return aa}),i.d(t,"PhysicsHelper",function(){return ca}),i.d(t,"PhysicsRadialExplosionEvent",function(){return la}),i.d(t,"PhysicsGravitationalFieldEvent",function(){return ua}),i.d(t,"PhysicsUpdraftEvent",function(){return ha}),i.d(t,"PhysicsVortexEvent",function(){return da}),i.d(t,"PhysicsRadialImpulseFalloff",function(){return oa}),i.d(t,"PhysicsUpdraftMode",function(){return sa}),i.d(t,"PhysicsImpostor",function(){return oo.a}),i.d(t,"PhysicsJoint",function(){return so.e}),i.d(t,"DistanceJoint",function(){return so.a}),i.d(t,"MotorEnabledJoint",function(){return so.d}),i.d(t,"HingeJoint",function(){return so.c}),i.d(t,"Hinge2Joint",function(){return so.b}),i.d(t,"CannonJSPlugin",function(){return co}),i.d(t,"AmmoJSPlugin",function(){return fa}),i.d(t,"OimoJSPlugin",function(){return lo}),i.d(t,"AnaglyphPostProcess",function(){return Nt}),i.d(t,"BlackAndWhitePostProcess",function(){return _a}),i.d(t,"BloomEffect",function(){return Ta}),i.d(t,"BloomMergePostProcess",function(){return ba}),i.d(t,"BlurPostProcess",function(){return Gr}),i.d(t,"ChromaticAberrationPostProcess",function(){return xa}),i.d(t,"CircleOfConfusionPostProcess",function(){return Pa}),i.d(t,"ColorCorrectionPostProcess",function(){return Sa}),i.d(t,"ConvolutionPostProcess",function(){return Ma}),i.d(t,"DepthOfFieldBlurPostProcess",function(){return Oa}),i.d(t,"DepthOfFieldEffectBlurLevel",function(){return Da}),i.d(t,"DepthOfFieldEffect",function(){return Fa}),i.d(t,"DepthOfFieldMergePostProcessOptions",function(){return wa}),i.d(t,"DepthOfFieldMergePostProcess",function(){return La}),i.d(t,"DisplayPassPostProcess",function(){return Ba}),i.d(t,"ExtractHighlightsPostProcess",function(){return va}),i.d(t,"FilterPostProcess",function(){return Va}),i.d(t,"FxaaPostProcess",function(){return za}),i.d(t,"GrainPostProcess",function(){return Wa}),i.d(t,"HighlightsPostProcess",function(){return Xa}),i.d(t,"ImageProcessingPostProcess",function(){return _i}),i.d(t,"MotionBlurPostProcess",function(){return Za}),i.d(t,"PassPostProcess",function(){return wt}),i.d(t,"PassCubePostProcess",function(){return Lt}),i.d(t,"PostProcess",function(){return Ot}),i.d(t,"PostProcessManager",function(){return Ii.a}),i.d(t,"RefractionPostProcess",function(){return $a}),i.d(t,"SharpenPostProcess",function(){return tc}),i.d(t,"StereoscopicInterlacePostProcess",function(){return zt}),i.d(t,"TonemappingOperator",function(){return gc}),i.d(t,"TonemapPostProcess",function(){return vc}),i.d(t,"VolumetricLightScatteringPostProcess",function(){return Ec}),i.d(t,"VRDistortionCorrectionPostProcess",function(){return qt}),i.d(t,"PostProcessRenderEffect",function(){return ma}),i.d(t,"PostProcessRenderPipeline",function(){return ic}),i.d(t,"PostProcessRenderPipelineManager",function(){return pc}),i.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return _c}),i.d(t,"DefaultRenderingPipeline",function(){return rc}),i.d(t,"LensRenderingPipeline",function(){return sc}),i.d(t,"SSAO2RenderingPipeline",function(){return lc}),i.d(t,"SSAORenderingPipeline",function(){return hc}),i.d(t,"StandardRenderingPipeline",function(){return fc}),i.d(t,"ReflectionProbe",function(){return uo}),i.d(t,"BoundingBoxRenderer",function(){return xc}),i.d(t,"DepthRenderer",function(){return Pc}),i.d(t,"DepthRendererSceneComponent",function(){return Rc}),i.d(t,"EdgesRenderer",function(){return Oc}),i.d(t,"LineEdgesRenderer",function(){return Ic}),i.d(t,"GeometryBufferRenderer",function(){return Qa}),i.d(t,"GeometryBufferRendererSceneComponent",function(){return Dc}),i.d(t,"OutlineRenderer",function(){return Fc}),i.d(t,"RenderingGroup",function(){return Nc.a}),i.d(t,"RenderingGroupInfo",function(){return Di.a}),i.d(t,"RenderingManager",function(){return Di.b}),i.d(t,"UtilityLayerRenderer",function(){return Ar.a}),i.d(t,"Scene",function(){return W.a}),i.d(t,"SceneComponentConstants",function(){return Ee.a}),i.d(t,"Stage",function(){return Ee.b}),i.d(t,"Sprite",function(){return Bc}),i.d(t,"SpriteManager",function(){return zc}),i.d(t,"SpriteSceneComponent",function(){return Uc}),i.d(t,"_AlphaState",function(){return jc.a}),i.d(t,"_DepthCullingState",function(){return jc.b}),i.d(t,"_StencilState",function(){return jc.c}),i.d(t,"AndOrNotEvaluator",function(){return Wc.a}),i.d(t,"AssetTaskState",function(){return kc}),i.d(t,"AbstractAssetTask",function(){return Xc}),i.d(t,"AssetsProgressEvent",function(){return Yc}),i.d(t,"MeshAssetTask",function(){return Kc}),i.d(t,"TextFileAssetTask",function(){return Qc}),i.d(t,"BinaryFileAssetTask",function(){return qc}),i.d(t,"ImageAssetTask",function(){return Zc}),i.d(t,"TextureAssetTask",function(){return Jc}),i.d(t,"CubeTextureAssetTask",function(){return $c}),i.d(t,"HDRCubeTextureAssetTask",function(){return el}),i.d(t,"AssetsManager",function(){return tl}),i.d(t,"DDSTools",function(){return Oo}),i.d(t,"expandToProperty",function(){return w.b}),i.d(t,"serialize",function(){return w.c}),i.d(t,"serializeAsTexture",function(){return w.l}),i.d(t,"serializeAsColor3",function(){return w.e}),i.d(t,"serializeAsFresnelParameters",function(){return w.h}),i.d(t,"serializeAsVector2",function(){return w.m}),i.d(t,"serializeAsVector3",function(){return w.n}),i.d(t,"serializeAsMeshReference",function(){return w.j}),i.d(t,"serializeAsColorCurves",function(){return w.g}),i.d(t,"serializeAsColor4",function(){return w.f}),i.d(t,"serializeAsImageProcessingConfiguration",function(){return w.i}),i.d(t,"serializeAsQuaternion",function(){return w.k}),i.d(t,"serializeAsCameraReference",function(){return w.d}),i.d(t,"SerializationHelper",function(){return w.a}),i.d(t,"Deferred",function(){return il}),i.d(t,"EnvironmentTextureTools",function(){return Lo}),i.d(t,"FilesInput",function(){return rl}),i.d(t,"KhronosTextureContainer",function(){return No}),i.d(t,"EventState",function(){return n.a}),i.d(t,"Observer",function(){return n.d}),i.d(t,"MultiObserver",function(){return n.b}),i.d(t,"Observable",function(){return n.c}),i.d(t,"PerformanceMonitor",function(){return nl.a}),i.d(t,"RollingAverage",function(){return nl.b}),i.d(t,"PromisePolyfill",function(){return ol.a}),i.d(t,"SceneOptimization",function(){return sl}),i.d(t,"TextureOptimization",function(){return al}),i.d(t,"HardwareScalingOptimization",function(){return cl}),i.d(t,"ShadowsOptimization",function(){return ll}),i.d(t,"PostProcessesOptimization",function(){return ul}),i.d(t,"LensFlaresOptimization",function(){return hl}),i.d(t,"CustomOptimization",function(){return dl}),i.d(t,"ParticlesOptimization",function(){return fl}),i.d(t,"RenderTargetsOptimization",function(){return pl}),i.d(t,"MergeMeshesOptimization",function(){return _l}),i.d(t,"SceneOptimizerOptions",function(){return ml}),i.d(t,"SceneOptimizer",function(){return gl}),i.d(t,"SceneSerializer",function(){return Tl}),i.d(t,"SmartArray",function(){return St.a}),i.d(t,"SmartArrayNoDuplicate",function(){return St.b}),i.d(t,"StringDictionary",function(){return ut.a}),i.d(t,"Tags",function(){return El.a}),i.d(t,"TextureTools",function(){return on}),i.d(t,"TGATools",function(){return Uo}),i.d(t,"ColorGradient",function(){return ve.c}),i.d(t,"Color3Gradient",function(){return ve.b}),i.d(t,"FactorGradient",function(){return ve.d}),i.d(t,"LoadFileError",function(){return ve.e}),i.d(t,"RetryStrategy",function(){return ve.g}),i.d(t,"Tools",function(){return ve.h}),i.d(t,"PerfCounter",function(){return ve.f}),i.d(t,"className",function(){return ve.i}),i.d(t,"AsyncLoop",function(){return ve.a}),i.d(t,"VideoRecorder",function(){return xl}),i.d(t,"JoystickAxis",function(){return lt}),i.d(t,"VirtualJoystick",function(){return ht}),i.d(t,"WorkerPool",function(){return Al}),i.d(t,"Logger",function(){return p.a}),i.d(t,"_TypeStore",function(){return s.a}),i.d(t,"FilesInputStore",function(){return lr.a}),i.d(t,"DeepCopier",function(){return S.a}),i.d(t,"PivotTools",function(){return Ne.a}),i.d(t,"PrecisionDate",function(){return H.a}),i.d(t,"ScreenshotTools",function(){return Pl}),i.d(t,"CubeMapToSphericalPolynomialTools",function(){return to.a}),i.d(t,"HDRTools",function(){return eo}),i.d(t,"PanoramaToCubeMapTools",function(){return $n})},function(e,t,i){"use strict";i.r(t);var r=i(0),n=i(33),o=i(57),s=function(){function e(t,i,s,a,c,l){if(void 0===i&&(i=1),void 0===s&&(s=2),this._scaleLinesFactor=4,this._instanced=!1,this.scaleLines=1,this.scaleLines=i,!a){var u=new n.a("",t);u.disableLighting=!0,u.emissiveColor=r.e.Red().scale(.5),a=o.a._CreateArrow(t,u)}if(!c){var h=new n.a("",t);h.disableLighting=!0,h.emissiveColor=r.e.Green().scale(.5),c=o.a._CreateArrow(t,h)}if(!l){var d=new n.a("",t);d.disableLighting=!0,d.emissiveColor=r.e.Blue().scale(.5),l=o.a._CreateArrow(t,d)}this._xAxis=a,this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis=c,this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis=l,this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),null!=s&&(e._SetRenderingGroupId(this._xAxis,s),e._SetRenderingGroupId(this._yAxis,s),e._SetRenderingGroupId(this._zAxis,s)),this.scene=t,this.update(new r.x,r.x.Right(),r.x.Up(),r.x.Forward())}return Object.defineProperty(e.prototype,"xAxis",{get:function(){return this._xAxis},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yAxis",{get:function(){return this._yAxis},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zAxis",{get:function(){return this._zAxis},enumerable:!0,configurable:!0}),e.prototype.update=function(e,t,i,r){this._xAxis.position.copyFrom(e),this._xAxis.setDirection(t),this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis.position.copyFrom(e),this._yAxis.setDirection(i),this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis.position.copyFrom(e),this._zAxis.setDirection(r),this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor)},e.prototype.createInstance=function(){var t=o.a._CreateArrowInstance(this.scene,this._xAxis),i=o.a._CreateArrowInstance(this.scene,this._yAxis),r=o.a._CreateArrowInstance(this.scene,this._zAxis),n=new e(this.scene,this.scaleLines,null,t,i,r);return n._instanced=!0,n},e.prototype.dispose=function(){this._xAxis&&(this._xAxis.dispose(!1,!this._instanced),delete this._xAxis),this._yAxis&&(this._yAxis.dispose(!1,!this._instanced),delete this._yAxis),this._zAxis&&(this._zAxis.dispose(!1,!this._instanced),delete this._zAxis),delete this.scene},e._SetRenderingGroupId=function(e,t){e.getChildMeshes().forEach(function(e){e.renderingGroupId=t})},e}(),a=i(1),c=function(e){function t(t,i,n,o){void 0===o&&(o=1);var s=e.call(this,t,o)||this;return s.pos=r.x.Zero(),s.xaxis=r.x.Zero(),s.yaxis=r.x.Zero(),s.zaxis=r.x.Zero(),s.mesh=n,s.bone=i,s}return a.d(t,e),t.prototype.update=function(){if(this.mesh&&this.bone){var t=this.bone;t.getAbsolutePositionToRef(this.mesh,this.pos),t.getDirectionToRef(r.c.X,this.mesh,this.xaxis),t.getDirectionToRef(r.c.Y,this.mesh,this.yaxis),t.getDirectionToRef(r.c.Z,this.mesh,this.zaxis),e.prototype.update.call(this,this.pos,this.xaxis,this.yaxis,this.zaxis)}},t.prototype.dispose=function(){this.mesh&&(this.mesh=null,this.bone=null,e.prototype.dispose.call(this))},t}(s),l=i(9),u=i(7),h=i(16);Object.defineProperty(h.a.prototype,"debugLayer",{get:function(){return this._debugLayer||(this._debugLayer=new d(this)),this._debugLayer},enumerable:!0,configurable:!0});var d=function(){function e(e){var t=this;this.BJSINSPECTOR=this._getGlobalInspector(),this.onPropertyChangedObservable=new u.c,this._scene=e,this._scene.onDisposeObservable.add(function(){t._scene._debugLayer&&t._scene._debugLayer.hide()})}return e.prototype._createInspector=function(e){if(!this.isVisible()){var t=a.a({overlay:!1,showExplorer:!0,showInspector:!0,embedMode:!1,handleResize:!0,enablePopup:!0},e);this.BJSINSPECTOR=this.BJSINSPECTOR||this._getGlobalInspector(),this.BJSINSPECTOR.Inspector.Show(this._scene,t)}},e.prototype._getGlobalInspector=function(){return"undefined"!=typeof INSPECTOR?INSPECTOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.Inspector?BABYLON:void 0},e.prototype.isVisible=function(){return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.IsVisible},e.prototype.hide=function(){this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.Hide()},e.prototype.show=function(t){void 0===this.BJSINSPECTOR?l.h.LoadScript(e.InspectorURL,this._createInspector.bind(this,t)):this._createInspector(t)},e.InspectorURL="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js",e}(),f=i(51),p=i(55),_=i(23),m=i(31),g=i(41),v=function(){function e(e){this._impostors=[],this._meshes=[],this._numMeshes=0,this._scene=e||_.a.LastCreatedScene;var t=this._scene.getPhysicsEngine();t&&(this._physicsEnginePlugin=t.getPhysicsPlugin()),this._utilityLayer=new g.a(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0}return e.prototype._updateDebugMeshes=function(){for(var e=this._physicsEnginePlugin,t=0;t0?(this._meshes[r]=this._meshes[this._numMeshes],this._impostors[r]=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 n.a("",e),this._debugMaterial.wireframe=!0,this._debugMaterial.emissiveColor=r.e.White(),this._debugMaterial.disableLighting=!0),this._debugMaterial},e.prototype._getDebugBoxMesh=function(e){return this._debugBoxMesh||(this._debugBoxMesh=f.a.CreateBox("physicsBodyBoxViewMesh",{size:1},e),this._debugBoxMesh.rotationQuaternion=r.q.Identity(),this._debugBoxMesh.material=this._getDebugMaterial(e)),this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugSphereMesh=function(e){return this._debugSphereMesh||(this._debugSphereMesh=p.a.CreateSphere("physicsBodySphereViewMesh",{diameter:1},e),this._debugSphereMesh.rotationQuaternion=r.q.Identity(),this._debugSphereMesh.material=this._getDebugMaterial(e)),this._debugSphereMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugMesh=function(e){if(!this._utilityLayer)return null;var t=null,i=this._utilityLayer.utilityLayerScene;if(e.type==m.a.BoxImpostor)t=this._getDebugBoxMesh(i),e.getBoxSizeToRef(t.scaling);else if(e.type==m.a.SphereImpostor){t=this._getDebugSphereMesh(i);var r=e.getRadius();t.scaling.x=2*r,t.scaling.y=2*r,t.scaling.z=2*r}return t},e.prototype.dispose=function(){for(var e=0;e=0;s--){var a=e[s],c=a.getParent();if(c){var l=this._debugLines[n];l||(l=[r.x.Zero(),r.x.Zero()],this._debugLines[n]=l),a.getAbsolutePositionToRef(this.mesh,l[0]),c.getAbsolutePositionToRef(this.mesh,l[1]),l[0].subtractInPlace(o),l[1].subtractInPlace(o),n++}}},e.prototype.update=function(){if(this._utilityLayer){this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteTransforms(),void 0===this.skeleton.bones[0].length?this._getLinesForBonesNoLength(this.skeleton.bones,this.mesh.getWorldMatrix()):this._getLinesForBonesWithLength(this.skeleton.bones,this.mesh.getWorldMatrix());var e=this._utilityLayer.utilityLayerScene;this._debugMesh?b.a.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:this._debugMesh},e):(this._debugMesh=b.a.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:null},e),this._debugMesh.renderingGroupId=this.renderingGroupId),this._debugMesh.position.copyFrom(this.mesh.position),this._debugMesh.color=this.color}},e.prototype.dispose=function(){this.isEnabled=!1,this._debugMesh&&(this.isEnabled=!1,this._debugMesh.dispose(),this._debugMesh=null),this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null)},e}();i.d(t,"AxesViewer",function(){return s}),i.d(t,"BoneAxesViewer",function(){return c}),i.d(t,"DebugLayer",function(){return d}),i.d(t,"PhysicsViewer",function(){return v}),i.d(t,"RayHelper",function(){return T}),i.d(t,"SkeletonViewer",function(){return E})},function(e,t,i){"use strict";var r="clipPlaneFragmentDeclaration",n="#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";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="fogFragmentDeclaration",n="#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";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif";i(5).a.IncludesShadersStore.fogFragment=r},function(e,t,i){"use strict";var r="clipPlaneVertexDeclaration",n="#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";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="fogVertexDeclaration",n="#ifdef FOG\nvarying vec3 vFogDistance;\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="morphTargetsVertexGlobalDeclaration",n="#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="morphTargetsVertexDeclaration",n="#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="morphTargetsVertex",n="#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.Eval=function(t,i){return"true"===(t=t.match(/\([^\(\)]*\)/g)?t.replace(/\([^\(\)]*\)/g,function(t){return t=t.slice(1,t.length-1),e._HandleParenthesisContent(t,i)}):e._HandleParenthesisContent(t,i))||"false"!==t&&e.Eval(t,i)},e._HandleParenthesisContent=function(t,i){var r;i=i||function(e){return"true"===e};var n=t.split("||");for(var o in n)if(n.hasOwnProperty(o)){var s=e._SimplifyNegation(n[o].trim()),a=s.split("&&");if(a.length>1)for(var c=0;c=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}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r,n=i(9);!function(e){e[e.Pending=0]="Pending",e[e.Fulfilled=1]="Fulfilled",e[e.Rejected=2]="Rejected"}(r||(r={}));var o=function(){return function(){this.count=0,this.target=0,this.results=[]}}(),s=function(){function e(e){var t=this;if(this._state=r.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,i){var o=this,s=new e;return s._onFulfilled=t,s._onRejected=i,this._children.push(s),s._parent=this,this._state!==r.Pending&&n.h.SetImmediate(function(){if(o._state===r.Fulfilled||o._rejectWasConsumed){var e=s._resolve(o._result);if(null!=e)if(void 0!==e._state){var t=e;s._children.push(t),t._parent=s,s=t}else s._result=e}else s._reject(o._reason)}),s},e.prototype._moveChildren=function(e){var t,i=this;if((t=this._children).push.apply(t,e.splice(0,e.length)),this._children.forEach(function(e){e._parent=i}),this._state===r.Fulfilled)for(var n=0,o=this._children;ni._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,i){void 0===t&&(t=e.getMesh()),void 0===i&&(i=e.getMaterial()),null!=i&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTesting()?(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._edgesRenderer&&t._edgesRenderer.isEnabled&&this._edgesRenderers.push(t._edgesRenderer))},e.prototype.dispatchSprites=function(e){this._spriteManagers.push(e)},e.prototype.dispatchParticles=function(e){this._particleSystems.push(e)},e.prototype._renderParticles=function(e){if(0!==this._particleSystems.length){var t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(var i=0;i\n\n#include\nuniform mat4 viewProjection;\n\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include\n#include\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n}";r.a.ShadersStore[n]=o},function(e,t,i){"use strict";i.r(t),function(e){var r=i(91),n=i(92);i.d(t,"AbstractScene",function(){return r.AbstractScene}),i.d(t,"KeepAssets",function(){return r.KeepAssets}),i.d(t,"AssetContainer",function(){return r.AssetContainer}),i.d(t,"Node",function(){return r.Node}),i.d(t,"Scene",function(){return r.Scene}),i.d(t,"SceneComponentConstants",function(){return r.SceneComponentConstants}),i.d(t,"Stage",function(){return r.Stage}),i.d(t,"Action",function(){return r.Action}),i.d(t,"ActionEvent",function(){return r.ActionEvent}),i.d(t,"ActionManager",function(){return r.ActionManager}),i.d(t,"Condition",function(){return r.Condition}),i.d(t,"ValueCondition",function(){return r.ValueCondition}),i.d(t,"PredicateCondition",function(){return r.PredicateCondition}),i.d(t,"StateCondition",function(){return r.StateCondition}),i.d(t,"SwitchBooleanAction",function(){return r.SwitchBooleanAction}),i.d(t,"SetStateAction",function(){return r.SetStateAction}),i.d(t,"SetValueAction",function(){return r.SetValueAction}),i.d(t,"IncrementValueAction",function(){return r.IncrementValueAction}),i.d(t,"PlayAnimationAction",function(){return r.PlayAnimationAction}),i.d(t,"StopAnimationAction",function(){return r.StopAnimationAction}),i.d(t,"DoNothingAction",function(){return r.DoNothingAction}),i.d(t,"CombineAction",function(){return r.CombineAction}),i.d(t,"ExecuteCodeAction",function(){return r.ExecuteCodeAction}),i.d(t,"SetParentAction",function(){return r.SetParentAction}),i.d(t,"PlaySoundAction",function(){return r.PlaySoundAction}),i.d(t,"StopSoundAction",function(){return r.StopSoundAction}),i.d(t,"InterpolateValueAction",function(){return r.InterpolateValueAction}),i.d(t,"Animatable",function(){return r.Animatable}),i.d(t,"Animation",function(){return r.Animation}),i.d(t,"TargetedAnimation",function(){return r.TargetedAnimation}),i.d(t,"AnimationGroup",function(){return r.AnimationGroup}),i.d(t,"AnimationPropertiesOverride",function(){return r.AnimationPropertiesOverride}),i.d(t,"EasingFunction",function(){return r.EasingFunction}),i.d(t,"CircleEase",function(){return r.CircleEase}),i.d(t,"BackEase",function(){return r.BackEase}),i.d(t,"BounceEase",function(){return r.BounceEase}),i.d(t,"CubicEase",function(){return r.CubicEase}),i.d(t,"ElasticEase",function(){return r.ElasticEase}),i.d(t,"ExponentialEase",function(){return r.ExponentialEase}),i.d(t,"PowerEase",function(){return r.PowerEase}),i.d(t,"QuadraticEase",function(){return r.QuadraticEase}),i.d(t,"QuarticEase",function(){return r.QuarticEase}),i.d(t,"QuinticEase",function(){return r.QuinticEase}),i.d(t,"SineEase",function(){return r.SineEase}),i.d(t,"BezierCurveEase",function(){return r.BezierCurveEase}),i.d(t,"RuntimeAnimation",function(){return r.RuntimeAnimation}),i.d(t,"AnimationEvent",function(){return r.AnimationEvent}),i.d(t,"AnimationKeyInterpolation",function(){return r.AnimationKeyInterpolation}),i.d(t,"AnimationRange",function(){return r.AnimationRange}),i.d(t,"Analyser",function(){return r.Analyser}),i.d(t,"AudioEngine",function(){return r.AudioEngine}),i.d(t,"AudioSceneComponent",function(){return r.AudioSceneComponent}),i.d(t,"Sound",function(){return r.Sound}),i.d(t,"SoundTrack",function(){return r.SoundTrack}),i.d(t,"WeightedSound",function(){return r.WeightedSound}),i.d(t,"Bone",function(){return r.Bone}),i.d(t,"BoneIKController",function(){return r.BoneIKController}),i.d(t,"BoneLookController",function(){return r.BoneLookController}),i.d(t,"Skeleton",function(){return r.Skeleton}),i.d(t,"CameraInputTypes",function(){return r.CameraInputTypes}),i.d(t,"CameraInputsManager",function(){return r.CameraInputsManager}),i.d(t,"Camera",function(){return r.Camera}),i.d(t,"TargetCamera",function(){return r.TargetCamera}),i.d(t,"FreeCamera",function(){return r.FreeCamera}),i.d(t,"FreeCameraInputsManager",function(){return r.FreeCameraInputsManager}),i.d(t,"TouchCamera",function(){return r.TouchCamera}),i.d(t,"ArcRotateCamera",function(){return r.ArcRotateCamera}),i.d(t,"ArcRotateCameraInputsManager",function(){return r.ArcRotateCameraInputsManager}),i.d(t,"DeviceOrientationCamera",function(){return r.DeviceOrientationCamera}),i.d(t,"FlyCamera",function(){return r.FlyCamera}),i.d(t,"FlyCameraInputsManager",function(){return r.FlyCameraInputsManager}),i.d(t,"FollowCamera",function(){return r.FollowCamera}),i.d(t,"ArcFollowCamera",function(){return r.ArcFollowCamera}),i.d(t,"GamepadCamera",function(){return r.GamepadCamera}),i.d(t,"UniversalCamera",function(){return r.UniversalCamera}),i.d(t,"VirtualJoysticksCamera",function(){return r.VirtualJoysticksCamera}),i.d(t,"Collider",function(){return r.Collider}),i.d(t,"DefaultCollisionCoordinator",function(){return r.DefaultCollisionCoordinator}),i.d(t,"PickingInfo",function(){return r.PickingInfo}),i.d(t,"IntersectionInfo",function(){return r.IntersectionInfo}),i.d(t,"BoundingBox",function(){return r.BoundingBox}),i.d(t,"BoundingInfo",function(){return r.BoundingInfo}),i.d(t,"BoundingSphere",function(){return r.BoundingSphere}),i.d(t,"Ray",function(){return r.Ray}),i.d(t,"AxesViewer",function(){return r.AxesViewer}),i.d(t,"BoneAxesViewer",function(){return r.BoneAxesViewer}),i.d(t,"DebugLayer",function(){return r.DebugLayer}),i.d(t,"PhysicsViewer",function(){return r.PhysicsViewer}),i.d(t,"RayHelper",function(){return r.RayHelper}),i.d(t,"SkeletonViewer",function(){return r.SkeletonViewer}),i.d(t,"Constants",function(){return r.Constants}),i.d(t,"InstancingAttributeInfo",function(){return r.InstancingAttributeInfo}),i.d(t,"DepthTextureCreationOptions",function(){return r.DepthTextureCreationOptions}),i.d(t,"EngineCapabilities",function(){return r.EngineCapabilities}),i.d(t,"Engine",function(){return r.Engine}),i.d(t,"EngineStore",function(){return r.EngineStore}),i.d(t,"NullEngineOptions",function(){return r.NullEngineOptions}),i.d(t,"NullEngine",function(){return r.NullEngine}),i.d(t,"KeyboardEventTypes",function(){return r.KeyboardEventTypes}),i.d(t,"KeyboardInfo",function(){return r.KeyboardInfo}),i.d(t,"KeyboardInfoPre",function(){return r.KeyboardInfoPre}),i.d(t,"PointerEventTypes",function(){return r.PointerEventTypes}),i.d(t,"PointerInfoBase",function(){return r.PointerInfoBase}),i.d(t,"PointerInfoPre",function(){return r.PointerInfoPre}),i.d(t,"PointerInfo",function(){return r.PointerInfo}),i.d(t,"ClipboardEventTypes",function(){return r.ClipboardEventTypes}),i.d(t,"ClipboardInfo",function(){return r.ClipboardInfo}),i.d(t,"DaydreamController",function(){return r.DaydreamController}),i.d(t,"GearVRController",function(){return r.GearVRController}),i.d(t,"GenericController",function(){return r.GenericController}),i.d(t,"OculusTouchController",function(){return r.OculusTouchController}),i.d(t,"PoseEnabledControllerType",function(){return r.PoseEnabledControllerType}),i.d(t,"PoseEnabledControllerHelper",function(){return r.PoseEnabledControllerHelper}),i.d(t,"PoseEnabledController",function(){return r.PoseEnabledController}),i.d(t,"ViveController",function(){return r.ViveController}),i.d(t,"WebVRController",function(){return r.WebVRController}),i.d(t,"WindowsMotionController",function(){return r.WindowsMotionController}),i.d(t,"StickValues",function(){return r.StickValues}),i.d(t,"Gamepad",function(){return r.Gamepad}),i.d(t,"GenericPad",function(){return r.GenericPad}),i.d(t,"GamepadManager",function(){return r.GamepadManager}),i.d(t,"GamepadSystemSceneComponent",function(){return r.GamepadSystemSceneComponent}),i.d(t,"Xbox360Button",function(){return r.Xbox360Button}),i.d(t,"Xbox360Dpad",function(){return r.Xbox360Dpad}),i.d(t,"Xbox360Pad",function(){return r.Xbox360Pad}),i.d(t,"AxisDragGizmo",function(){return r.AxisDragGizmo}),i.d(t,"AxisScaleGizmo",function(){return r.AxisScaleGizmo}),i.d(t,"BoundingBoxGizmo",function(){return r.BoundingBoxGizmo}),i.d(t,"Gizmo",function(){return r.Gizmo}),i.d(t,"GizmoManager",function(){return r.GizmoManager}),i.d(t,"PlaneRotationGizmo",function(){return r.PlaneRotationGizmo}),i.d(t,"PositionGizmo",function(){return r.PositionGizmo}),i.d(t,"RotationGizmo",function(){return r.RotationGizmo}),i.d(t,"ScaleGizmo",function(){return r.ScaleGizmo}),i.d(t,"LightGizmo",function(){return r.LightGizmo}),i.d(t,"EnvironmentHelper",function(){return r.EnvironmentHelper}),i.d(t,"PhotoDome",function(){return r.PhotoDome}),i.d(t,"_forceSceneHelpersToBundle",function(){return r._forceSceneHelpersToBundle}),i.d(t,"VideoDome",function(){return r.VideoDome}),i.d(t,"EngineInstrumentation",function(){return r.EngineInstrumentation}),i.d(t,"SceneInstrumentation",function(){return r.SceneInstrumentation}),i.d(t,"_TimeToken",function(){return r._TimeToken}),i.d(t,"EffectLayer",function(){return r.EffectLayer}),i.d(t,"EffectLayerSceneComponent",function(){return r.EffectLayerSceneComponent}),i.d(t,"GlowLayer",function(){return r.GlowLayer}),i.d(t,"HighlightLayer",function(){return r.HighlightLayer}),i.d(t,"Layer",function(){return r.Layer}),i.d(t,"LayerSceneComponent",function(){return r.LayerSceneComponent}),i.d(t,"LensFlare",function(){return r.LensFlare}),i.d(t,"LensFlareSystem",function(){return r.LensFlareSystem}),i.d(t,"LensFlareSystemSceneComponent",function(){return r.LensFlareSystemSceneComponent}),i.d(t,"Light",function(){return r.Light}),i.d(t,"ShadowLight",function(){return r.ShadowLight}),i.d(t,"DirectionalLight",function(){return r.DirectionalLight}),i.d(t,"HemisphericLight",function(){return r.HemisphericLight}),i.d(t,"PointLight",function(){return r.PointLight}),i.d(t,"SpotLight",function(){return r.SpotLight}),i.d(t,"DefaultLoadingScreen",function(){return r.DefaultLoadingScreen}),i.d(t,"SceneLoaderProgressEvent",function(){return r.SceneLoaderProgressEvent}),i.d(t,"SceneLoader",function(){return r.SceneLoader}),i.d(t,"SceneLoaderFlags",function(){return r.SceneLoaderFlags}),i.d(t,"ColorCurves",function(){return r.ColorCurves}),i.d(t,"EffectFallbacks",function(){return r.EffectFallbacks}),i.d(t,"EffectCreationOptions",function(){return r.EffectCreationOptions}),i.d(t,"Effect",function(){return r.Effect}),i.d(t,"FresnelParameters",function(){return r.FresnelParameters}),i.d(t,"ImageProcessingConfigurationDefines",function(){return r.ImageProcessingConfigurationDefines}),i.d(t,"ImageProcessingConfiguration",function(){return r.ImageProcessingConfiguration}),i.d(t,"Material",function(){return r.Material}),i.d(t,"MaterialDefines",function(){return r.MaterialDefines}),i.d(t,"MaterialHelper",function(){return r.MaterialHelper}),i.d(t,"MultiMaterial",function(){return r.MultiMaterial}),i.d(t,"PushMaterial",function(){return r.PushMaterial}),i.d(t,"ShaderMaterial",function(){return r.ShaderMaterial}),i.d(t,"StandardMaterialDefines",function(){return r.StandardMaterialDefines}),i.d(t,"StandardMaterial",function(){return r.StandardMaterial}),i.d(t,"BaseTexture",function(){return r.BaseTexture}),i.d(t,"CubeTexture",function(){return r.CubeTexture}),i.d(t,"HDRCubeTexture",function(){return r.HDRCubeTexture}),i.d(t,"InternalTexture",function(){return r.InternalTexture}),i.d(t,"DummyInternalTextureTracker",function(){return r.DummyInternalTextureTracker}),i.d(t,"MirrorTexture",function(){return r.MirrorTexture}),i.d(t,"MultiRenderTarget",function(){return r.MultiRenderTarget}),i.d(t,"RenderTargetTexture",function(){return r.RenderTargetTexture}),i.d(t,"Texture",function(){return r.Texture}),i.d(t,"UniformBuffer",function(){return r.UniformBuffer}),i.d(t,"MaterialFlags",function(){return r.MaterialFlags}),i.d(t,"Scalar",function(){return r.Scalar}),i.d(t,"ToGammaSpace",function(){return r.ToGammaSpace}),i.d(t,"ToLinearSpace",function(){return r.ToLinearSpace}),i.d(t,"Epsilon",function(){return r.Epsilon}),i.d(t,"Color3",function(){return r.Color3}),i.d(t,"Color4",function(){return r.Color4}),i.d(t,"Vector2",function(){return r.Vector2}),i.d(t,"Vector3",function(){return r.Vector3}),i.d(t,"Vector4",function(){return r.Vector4}),i.d(t,"Size",function(){return r.Size}),i.d(t,"Quaternion",function(){return r.Quaternion}),i.d(t,"Matrix",function(){return r.Matrix}),i.d(t,"Plane",function(){return r.Plane}),i.d(t,"Viewport",function(){return r.Viewport}),i.d(t,"Frustum",function(){return r.Frustum}),i.d(t,"Space",function(){return r.Space}),i.d(t,"Axis",function(){return r.Axis}),i.d(t,"BezierCurve",function(){return r.BezierCurve}),i.d(t,"Orientation",function(){return r.Orientation}),i.d(t,"Angle",function(){return r.Angle}),i.d(t,"Arc2",function(){return r.Arc2}),i.d(t,"Path2",function(){return r.Path2}),i.d(t,"Path3D",function(){return r.Path3D}),i.d(t,"Curve3",function(){return r.Curve3}),i.d(t,"PositionNormalVertex",function(){return r.PositionNormalVertex}),i.d(t,"PositionNormalTextureVertex",function(){return r.PositionNormalTextureVertex}),i.d(t,"Tmp",function(){return r.Tmp}),i.d(t,"SphericalPolynomial",function(){return r.SphericalPolynomial}),i.d(t,"SphericalHarmonics",function(){return r.SphericalHarmonics}),i.d(t,"AbstractMesh",function(){return r.AbstractMesh}),i.d(t,"Buffer",function(){return r.Buffer}),i.d(t,"VertexBuffer",function(){return r.VertexBuffer}),i.d(t,"CSG",function(){return r.CSG}),i.d(t,"Geometry",function(){return r.Geometry}),i.d(t,"GroundMesh",function(){return r.GroundMesh}),i.d(t,"InstancedMesh",function(){return r.InstancedMesh}),i.d(t,"LinesMesh",function(){return r.LinesMesh}),i.d(t,"InstancedLinesMesh",function(){return r.InstancedLinesMesh}),i.d(t,"MeshLODLevel",function(){return r.MeshLODLevel}),i.d(t,"_CreationDataStorage",function(){return r._CreationDataStorage}),i.d(t,"_InstancesBatch",function(){return r._InstancesBatch}),i.d(t,"Mesh",function(){return r.Mesh}),i.d(t,"VertexData",function(){return r.VertexData}),i.d(t,"MeshBuilder",function(){return r.MeshBuilder}),i.d(t,"SimplificationSettings",function(){return r.SimplificationSettings}),i.d(t,"SimplificationQueue",function(){return r.SimplificationQueue}),i.d(t,"SimplificationType",function(){return r.SimplificationType}),i.d(t,"SimplicationQueueSceneComponent",function(){return r.SimplicationQueueSceneComponent}),i.d(t,"Polygon",function(){return r.Polygon}),i.d(t,"PolygonMeshBuilder",function(){return r.PolygonMeshBuilder}),i.d(t,"BaseSubMesh",function(){return r.BaseSubMesh}),i.d(t,"SubMesh",function(){return r.SubMesh}),i.d(t,"TransformNode",function(){return r.TransformNode}),i.d(t,"BoxBuilder",function(){return r.BoxBuilder}),i.d(t,"SphereBuilder",function(){return r.SphereBuilder}),i.d(t,"CylinderBuilder",function(){return r.CylinderBuilder}),i.d(t,"LinesBuilder",function(){return r.LinesBuilder}),i.d(t,"PlaneBuilder",function(){return r.PlaneBuilder}),i.d(t,"MorphTarget",function(){return r.MorphTarget}),i.d(t,"MorphTargetManager",function(){return r.MorphTargetManager}),i.d(t,"Database",function(){return r.Database}),i.d(t,"BaseParticleSystem",function(){return r.BaseParticleSystem}),i.d(t,"GPUParticleSystem",function(){return r.GPUParticleSystem}),i.d(t,"Particle",function(){return r.Particle}),i.d(t,"ParticleHelper",function(){return r.ParticleHelper}),i.d(t,"ParticleSystem",function(){return r.ParticleSystem}),i.d(t,"_IDoNeedToBeInTheBuild",function(){return r._IDoNeedToBeInTheBuild}),i.d(t,"ParticleSystemSet",function(){return r.ParticleSystemSet}),i.d(t,"SolidParticle",function(){return r.SolidParticle}),i.d(t,"ModelShape",function(){return r.ModelShape}),i.d(t,"DepthSortedParticle",function(){return r.DepthSortedParticle}),i.d(t,"SolidParticleSystem",function(){return r.SolidParticleSystem}),i.d(t,"SubEmitterType",function(){return r.SubEmitterType}),i.d(t,"SubEmitter",function(){return r.SubEmitter}),i.d(t,"PhysicsEngine",function(){return r.PhysicsEngine}),i.d(t,"PhysicsEngineSceneComponent",function(){return r.PhysicsEngineSceneComponent}),i.d(t,"PhysicsHelper",function(){return r.PhysicsHelper}),i.d(t,"PhysicsRadialExplosionEvent",function(){return r.PhysicsRadialExplosionEvent}),i.d(t,"PhysicsGravitationalFieldEvent",function(){return r.PhysicsGravitationalFieldEvent}),i.d(t,"PhysicsUpdraftEvent",function(){return r.PhysicsUpdraftEvent}),i.d(t,"PhysicsVortexEvent",function(){return r.PhysicsVortexEvent}),i.d(t,"PhysicsRadialImpulseFalloff",function(){return r.PhysicsRadialImpulseFalloff}),i.d(t,"PhysicsUpdraftMode",function(){return r.PhysicsUpdraftMode}),i.d(t,"PhysicsImpostor",function(){return r.PhysicsImpostor}),i.d(t,"PhysicsJoint",function(){return r.PhysicsJoint}),i.d(t,"DistanceJoint",function(){return r.DistanceJoint}),i.d(t,"MotorEnabledJoint",function(){return r.MotorEnabledJoint}),i.d(t,"HingeJoint",function(){return r.HingeJoint}),i.d(t,"Hinge2Joint",function(){return r.Hinge2Joint}),i.d(t,"AnaglyphPostProcess",function(){return r.AnaglyphPostProcess}),i.d(t,"BlackAndWhitePostProcess",function(){return r.BlackAndWhitePostProcess}),i.d(t,"BloomEffect",function(){return r.BloomEffect}),i.d(t,"BloomMergePostProcess",function(){return r.BloomMergePostProcess}),i.d(t,"BlurPostProcess",function(){return r.BlurPostProcess}),i.d(t,"ChromaticAberrationPostProcess",function(){return r.ChromaticAberrationPostProcess}),i.d(t,"CircleOfConfusionPostProcess",function(){return r.CircleOfConfusionPostProcess}),i.d(t,"ColorCorrectionPostProcess",function(){return r.ColorCorrectionPostProcess}),i.d(t,"ConvolutionPostProcess",function(){return r.ConvolutionPostProcess}),i.d(t,"DepthOfFieldBlurPostProcess",function(){return r.DepthOfFieldBlurPostProcess}),i.d(t,"DepthOfFieldEffectBlurLevel",function(){return r.DepthOfFieldEffectBlurLevel}),i.d(t,"DepthOfFieldEffect",function(){return r.DepthOfFieldEffect}),i.d(t,"DepthOfFieldMergePostProcessOptions",function(){return r.DepthOfFieldMergePostProcessOptions}),i.d(t,"DepthOfFieldMergePostProcess",function(){return r.DepthOfFieldMergePostProcess}),i.d(t,"DisplayPassPostProcess",function(){return r.DisplayPassPostProcess}),i.d(t,"ExtractHighlightsPostProcess",function(){return r.ExtractHighlightsPostProcess}),i.d(t,"FilterPostProcess",function(){return r.FilterPostProcess}),i.d(t,"FxaaPostProcess",function(){return r.FxaaPostProcess}),i.d(t,"GrainPostProcess",function(){return r.GrainPostProcess}),i.d(t,"HighlightsPostProcess",function(){return r.HighlightsPostProcess}),i.d(t,"ImageProcessingPostProcess",function(){return r.ImageProcessingPostProcess}),i.d(t,"MotionBlurPostProcess",function(){return r.MotionBlurPostProcess}),i.d(t,"PassPostProcess",function(){return r.PassPostProcess}),i.d(t,"PassCubePostProcess",function(){return r.PassCubePostProcess}),i.d(t,"PostProcess",function(){return r.PostProcess}),i.d(t,"PostProcessManager",function(){return r.PostProcessManager}),i.d(t,"RefractionPostProcess",function(){return r.RefractionPostProcess}),i.d(t,"SharpenPostProcess",function(){return r.SharpenPostProcess}),i.d(t,"StereoscopicInterlacePostProcess",function(){return r.StereoscopicInterlacePostProcess}),i.d(t,"TonemappingOperator",function(){return r.TonemappingOperator}),i.d(t,"TonemapPostProcess",function(){return r.TonemapPostProcess}),i.d(t,"VolumetricLightScatteringPostProcess",function(){return r.VolumetricLightScatteringPostProcess}),i.d(t,"VRDistortionCorrectionPostProcess",function(){return r.VRDistortionCorrectionPostProcess}),i.d(t,"ReflectionProbe",function(){return r.ReflectionProbe}),i.d(t,"BoundingBoxRenderer",function(){return r.BoundingBoxRenderer}),i.d(t,"DepthRenderer",function(){return r.DepthRenderer}),i.d(t,"DepthRendererSceneComponent",function(){return r.DepthRendererSceneComponent}),i.d(t,"EdgesRenderer",function(){return r.EdgesRenderer}),i.d(t,"LineEdgesRenderer",function(){return r.LineEdgesRenderer}),i.d(t,"GeometryBufferRenderer",function(){return r.GeometryBufferRenderer}),i.d(t,"GeometryBufferRendererSceneComponent",function(){return r.GeometryBufferRendererSceneComponent}),i.d(t,"OutlineRenderer",function(){return r.OutlineRenderer}),i.d(t,"RenderingGroup",function(){return r.RenderingGroup}),i.d(t,"RenderingGroupInfo",function(){return r.RenderingGroupInfo}),i.d(t,"RenderingManager",function(){return r.RenderingManager}),i.d(t,"UtilityLayerRenderer",function(){return r.UtilityLayerRenderer}),i.d(t,"Sprite",function(){return r.Sprite}),i.d(t,"SpriteManager",function(){return r.SpriteManager}),i.d(t,"SpriteSceneComponent",function(){return r.SpriteSceneComponent}),i.d(t,"_AlphaState",function(){return r._AlphaState}),i.d(t,"_DepthCullingState",function(){return r._DepthCullingState}),i.d(t,"_StencilState",function(){return r._StencilState}),i.d(t,"AndOrNotEvaluator",function(){return r.AndOrNotEvaluator}),i.d(t,"AssetTaskState",function(){return r.AssetTaskState}),i.d(t,"AbstractAssetTask",function(){return r.AbstractAssetTask}),i.d(t,"AssetsProgressEvent",function(){return r.AssetsProgressEvent}),i.d(t,"MeshAssetTask",function(){return r.MeshAssetTask}),i.d(t,"TextFileAssetTask",function(){return r.TextFileAssetTask}),i.d(t,"BinaryFileAssetTask",function(){return r.BinaryFileAssetTask}),i.d(t,"ImageAssetTask",function(){return r.ImageAssetTask}),i.d(t,"TextureAssetTask",function(){return r.TextureAssetTask}),i.d(t,"CubeTextureAssetTask",function(){return r.CubeTextureAssetTask}),i.d(t,"HDRCubeTextureAssetTask",function(){return r.HDRCubeTextureAssetTask}),i.d(t,"AssetsManager",function(){return r.AssetsManager}),i.d(t,"DDSTools",function(){return r.DDSTools}),i.d(t,"expandToProperty",function(){return r.expandToProperty}),i.d(t,"serialize",function(){return r.serialize}),i.d(t,"serializeAsTexture",function(){return r.serializeAsTexture}),i.d(t,"serializeAsColor3",function(){return r.serializeAsColor3}),i.d(t,"serializeAsFresnelParameters",function(){return r.serializeAsFresnelParameters}),i.d(t,"serializeAsVector2",function(){return r.serializeAsVector2}),i.d(t,"serializeAsVector3",function(){return r.serializeAsVector3}),i.d(t,"serializeAsMeshReference",function(){return r.serializeAsMeshReference}),i.d(t,"serializeAsColorCurves",function(){return r.serializeAsColorCurves}),i.d(t,"serializeAsColor4",function(){return r.serializeAsColor4}),i.d(t,"serializeAsImageProcessingConfiguration",function(){return r.serializeAsImageProcessingConfiguration}),i.d(t,"serializeAsQuaternion",function(){return r.serializeAsQuaternion}),i.d(t,"serializeAsCameraReference",function(){return r.serializeAsCameraReference}),i.d(t,"SerializationHelper",function(){return r.SerializationHelper}),i.d(t,"Deferred",function(){return r.Deferred}),i.d(t,"EnvironmentTextureTools",function(){return r.EnvironmentTextureTools}),i.d(t,"FilesInput",function(){return r.FilesInput}),i.d(t,"KhronosTextureContainer",function(){return r.KhronosTextureContainer}),i.d(t,"EventState",function(){return r.EventState}),i.d(t,"Observer",function(){return r.Observer}),i.d(t,"MultiObserver",function(){return r.MultiObserver}),i.d(t,"Observable",function(){return r.Observable}),i.d(t,"PerformanceMonitor",function(){return r.PerformanceMonitor}),i.d(t,"RollingAverage",function(){return r.RollingAverage}),i.d(t,"PromisePolyfill",function(){return r.PromisePolyfill}),i.d(t,"SceneOptimization",function(){return r.SceneOptimization}),i.d(t,"TextureOptimization",function(){return r.TextureOptimization}),i.d(t,"HardwareScalingOptimization",function(){return r.HardwareScalingOptimization}),i.d(t,"ShadowsOptimization",function(){return r.ShadowsOptimization}),i.d(t,"PostProcessesOptimization",function(){return r.PostProcessesOptimization}),i.d(t,"LensFlaresOptimization",function(){return r.LensFlaresOptimization}),i.d(t,"CustomOptimization",function(){return r.CustomOptimization}),i.d(t,"ParticlesOptimization",function(){return r.ParticlesOptimization}),i.d(t,"RenderTargetsOptimization",function(){return r.RenderTargetsOptimization}),i.d(t,"MergeMeshesOptimization",function(){return r.MergeMeshesOptimization}),i.d(t,"SceneOptimizerOptions",function(){return r.SceneOptimizerOptions}),i.d(t,"SceneOptimizer",function(){return r.SceneOptimizer}),i.d(t,"SceneSerializer",function(){return r.SceneSerializer}),i.d(t,"SmartArray",function(){return r.SmartArray}),i.d(t,"SmartArrayNoDuplicate",function(){return r.SmartArrayNoDuplicate}),i.d(t,"StringDictionary",function(){return r.StringDictionary}),i.d(t,"Tags",function(){return r.Tags}),i.d(t,"TextureTools",function(){return r.TextureTools}),i.d(t,"TGATools",function(){return r.TGATools}),i.d(t,"ColorGradient",function(){return r.ColorGradient}),i.d(t,"Color3Gradient",function(){return r.Color3Gradient}),i.d(t,"FactorGradient",function(){return r.FactorGradient}),i.d(t,"LoadFileError",function(){return r.LoadFileError}),i.d(t,"RetryStrategy",function(){return r.RetryStrategy}),i.d(t,"Tools",function(){return r.Tools}),i.d(t,"PerfCounter",function(){return r.PerfCounter}),i.d(t,"className",function(){return r.className}),i.d(t,"AsyncLoop",function(){return r.AsyncLoop}),i.d(t,"VideoRecorder",function(){return r.VideoRecorder}),i.d(t,"JoystickAxis",function(){return r.JoystickAxis}),i.d(t,"VirtualJoystick",function(){return r.VirtualJoystick}),i.d(t,"WorkerPool",function(){return r.WorkerPool}),i.d(t,"Logger",function(){return r.Logger}),i.d(t,"_TypeStore",function(){return r._TypeStore}),i.d(t,"FilesInputStore",function(){return r.FilesInputStore}),i.d(t,"DeepCopier",function(){return r.DeepCopier}),i.d(t,"PivotTools",function(){return r.PivotTools}),i.d(t,"PrecisionDate",function(){return r.PrecisionDate}),i.d(t,"ScreenshotTools",function(){return r.ScreenshotTools}),i.d(t,"AutoRotationBehavior",function(){return r.AutoRotationBehavior}),i.d(t,"BouncingBehavior",function(){return r.BouncingBehavior}),i.d(t,"FramingBehavior",function(){return r.FramingBehavior}),i.d(t,"AttachToBoxBehavior",function(){return r.AttachToBoxBehavior}),i.d(t,"FadeInOutBehavior",function(){return r.FadeInOutBehavior}),i.d(t,"MultiPointerScaleBehavior",function(){return r.MultiPointerScaleBehavior}),i.d(t,"PointerDragBehavior",function(){return r.PointerDragBehavior}),i.d(t,"SixDofDragBehavior",function(){return r.SixDofDragBehavior}),i.d(t,"ArcRotateCameraGamepadInput",function(){return r.ArcRotateCameraGamepadInput}),i.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return r.ArcRotateCameraKeyboardMoveInput}),i.d(t,"ArcRotateCameraMouseWheelInput",function(){return r.ArcRotateCameraMouseWheelInput}),i.d(t,"ArcRotateCameraPointersInput",function(){return r.ArcRotateCameraPointersInput}),i.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return r.ArcRotateCameraVRDeviceOrientationInput}),i.d(t,"FlyCameraKeyboardInput",function(){return r.FlyCameraKeyboardInput}),i.d(t,"FlyCameraMouseInput",function(){return r.FlyCameraMouseInput}),i.d(t,"FreeCameraDeviceOrientationInput",function(){return r.FreeCameraDeviceOrientationInput}),i.d(t,"FreeCameraGamepadInput",function(){return r.FreeCameraGamepadInput}),i.d(t,"FreeCameraKeyboardMoveInput",function(){return r.FreeCameraKeyboardMoveInput}),i.d(t,"FreeCameraMouseInput",function(){return r.FreeCameraMouseInput}),i.d(t,"FreeCameraTouchInput",function(){return r.FreeCameraTouchInput}),i.d(t,"FreeCameraVirtualJoystickInput",function(){return r.FreeCameraVirtualJoystickInput}),i.d(t,"AnaglyphArcRotateCamera",function(){return r.AnaglyphArcRotateCamera}),i.d(t,"AnaglyphFreeCamera",function(){return r.AnaglyphFreeCamera}),i.d(t,"AnaglyphGamepadCamera",function(){return r.AnaglyphGamepadCamera}),i.d(t,"AnaglyphUniversalCamera",function(){return r.AnaglyphUniversalCamera}),i.d(t,"StereoscopicArcRotateCamera",function(){return r.StereoscopicArcRotateCamera}),i.d(t,"StereoscopicFreeCamera",function(){return r.StereoscopicFreeCamera}),i.d(t,"StereoscopicGamepadCamera",function(){return r.StereoscopicGamepadCamera}),i.d(t,"StereoscopicUniversalCamera",function(){return r.StereoscopicUniversalCamera}),i.d(t,"VRCameraMetrics",function(){return r.VRCameraMetrics}),i.d(t,"VRDeviceOrientationArcRotateCamera",function(){return r.VRDeviceOrientationArcRotateCamera}),i.d(t,"VRDeviceOrientationFreeCamera",function(){return r.VRDeviceOrientationFreeCamera}),i.d(t,"VRDeviceOrientationGamepadCamera",function(){return r.VRDeviceOrientationGamepadCamera}),i.d(t,"VRExperienceHelper",function(){return r.VRExperienceHelper}),i.d(t,"WebVRFreeCamera",function(){return r.WebVRFreeCamera}),i.d(t,"WebXRCamera",function(){return r.WebXRCamera}),i.d(t,"WebXREnterExitUIButton",function(){return r.WebXREnterExitUIButton}),i.d(t,"WebXREnterExitUIOptions",function(){return r.WebXREnterExitUIOptions}),i.d(t,"WebXREnterExitUI",function(){return r.WebXREnterExitUI}),i.d(t,"WebXRState",function(){return r.WebXRState}),i.d(t,"WebXRExperienceHelper",function(){return r.WebXRExperienceHelper}),i.d(t,"WebXRController",function(){return r.WebXRController}),i.d(t,"WebXRInput",function(){return r.WebXRInput}),i.d(t,"WebXRManagedOutputCanvas",function(){return r.WebXRManagedOutputCanvas}),i.d(t,"WebXRSessionManager",function(){return r.WebXRSessionManager}),i.d(t,"Octree",function(){return r.Octree}),i.d(t,"OctreeBlock",function(){return r.OctreeBlock}),i.d(t,"OctreeSceneComponent",function(){return r.OctreeSceneComponent}),i.d(t,"_OcclusionDataStorage",function(){return r._OcclusionDataStorage}),i.d(t,"_forceTransformFeedbackToBundle",function(){return r._forceTransformFeedbackToBundle}),i.d(t,"ShadowGenerator",function(){return r.ShadowGenerator}),i.d(t,"ShadowGeneratorSceneComponent",function(){return r.ShadowGeneratorSceneComponent}),i.d(t,"_BabylonLoaderRegistered",function(){return r._BabylonLoaderRegistered}),i.d(t,"BackgroundMaterial",function(){return r.BackgroundMaterial}),i.d(t,"PBRBaseMaterial",function(){return r.PBRBaseMaterial}),i.d(t,"PBRBaseSimpleMaterial",function(){return r.PBRBaseSimpleMaterial}),i.d(t,"PBRMaterial",function(){return r.PBRMaterial}),i.d(t,"PBRMetallicRoughnessMaterial",function(){return r.PBRMetallicRoughnessMaterial}),i.d(t,"PBRSpecularGlossinessMaterial",function(){return r.PBRSpecularGlossinessMaterial}),i.d(t,"ColorGradingTexture",function(){return r.ColorGradingTexture}),i.d(t,"DynamicTexture",function(){return r.DynamicTexture}),i.d(t,"ProceduralTexture",function(){return r.ProceduralTexture}),i.d(t,"RawCubeTexture",function(){return r.RawCubeTexture}),i.d(t,"RawTexture",function(){return r.RawTexture}),i.d(t,"RawTexture3D",function(){return r.RawTexture3D}),i.d(t,"RefractionTexture",function(){return r.RefractionTexture}),i.d(t,"VideoTexture",function(){return r.VideoTexture}),i.d(t,"DracoCompression",function(){return r.DracoCompression}),i.d(t,"DiscBuilder",function(){return r.DiscBuilder}),i.d(t,"RibbonBuilder",function(){return r.RibbonBuilder}),i.d(t,"TorusBuilder",function(){return r.TorusBuilder}),i.d(t,"TorusKnotBuilder",function(){return r.TorusKnotBuilder}),i.d(t,"PolygonBuilder",function(){return r.PolygonBuilder}),i.d(t,"ShapeBuilder",function(){return r.ShapeBuilder}),i.d(t,"LatheBuilder",function(){return r.LatheBuilder}),i.d(t,"GroundBuilder",function(){return r.GroundBuilder}),i.d(t,"TubeBuilder",function(){return r.TubeBuilder}),i.d(t,"PolyhedronBuilder",function(){return r.PolyhedronBuilder}),i.d(t,"IcoSphereBuilder",function(){return r.IcoSphereBuilder}),i.d(t,"DecalBuilder",function(){return r.DecalBuilder}),i.d(t,"BoxParticleEmitter",function(){return r.BoxParticleEmitter}),i.d(t,"ConeParticleEmitter",function(){return r.ConeParticleEmitter}),i.d(t,"CylinderParticleEmitter",function(){return r.CylinderParticleEmitter}),i.d(t,"CylinderDirectedParticleEmitter",function(){return r.CylinderDirectedParticleEmitter}),i.d(t,"HemisphericParticleEmitter",function(){return r.HemisphericParticleEmitter}),i.d(t,"PointParticleEmitter",function(){return r.PointParticleEmitter}),i.d(t,"SphereParticleEmitter",function(){return r.SphereParticleEmitter}),i.d(t,"SphereDirectedParticleEmitter",function(){return r.SphereDirectedParticleEmitter}),i.d(t,"CannonJSPlugin",function(){return r.CannonJSPlugin}),i.d(t,"AmmoJSPlugin",function(){return r.AmmoJSPlugin}),i.d(t,"OimoJSPlugin",function(){return r.OimoJSPlugin}),i.d(t,"PostProcessRenderEffect",function(){return r.PostProcessRenderEffect}),i.d(t,"PostProcessRenderPipeline",function(){return r.PostProcessRenderPipeline}),i.d(t,"PostProcessRenderPipelineManager",function(){return r.PostProcessRenderPipelineManager}),i.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return r.PostProcessRenderPipelineManagerSceneComponent}),i.d(t,"CubeMapToSphericalPolynomialTools",function(){return r.CubeMapToSphericalPolynomialTools}),i.d(t,"HDRTools",function(){return r.HDRTools}),i.d(t,"PanoramaToCubeMapTools",function(){return r.PanoramaToCubeMapTools}),i.d(t,"_DDSTextureLoader",function(){return r._DDSTextureLoader}),i.d(t,"_ENVTextureLoader",function(){return r._ENVTextureLoader}),i.d(t,"_KTXTextureLoader",function(){return r._KTXTextureLoader}),i.d(t,"_TGATextureLoader",function(){return r._TGATextureLoader}),i.d(t,"CustomProceduralTexture",function(){return r.CustomProceduralTexture}),i.d(t,"NoiseProceduralTexture",function(){return r.NoiseProceduralTexture}),i.d(t,"ProceduralTextureSceneComponent",function(){return r.ProceduralTextureSceneComponent}),i.d(t,"DefaultRenderingPipeline",function(){return r.DefaultRenderingPipeline}),i.d(t,"LensRenderingPipeline",function(){return r.LensRenderingPipeline}),i.d(t,"SSAO2RenderingPipeline",function(){return r.SSAO2RenderingPipeline}),i.d(t,"SSAORenderingPipeline",function(){return r.SSAORenderingPipeline}),i.d(t,"StandardRenderingPipeline",function(){return r.StandardRenderingPipeline});var o=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==o){o.BABYLON=s,o.BABYLON=o.BABYLON||{};var s=o.BABYLON;s.Debug=s.Debug||{};var a=[];for(var c in n)s.Debug[c]=n[c],a.push(c);for(var c in r)a.indexOf(c)>-1||(s[c]=r[c])}}.call(this,i(122))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i}])}); \ No newline at end of file +var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function n(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var o=function(){return(o=Object.assign||function(e){for(var t,i=1,r=arguments.length;i=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s}function a(e,t,i,r){return new(i||(i=Promise))(function(n,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?n(e.value):new i(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function c(e,t){var i,r,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]this._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,"isMoreFallbacks",{get:function(){return this._currentRank<=this._maxRank},enumerable:!0,configurable:!0}),e.prototype.reduce=function(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0&&this._mesh.material){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;for(var i=this._mesh.getScene(),r=0;r-1?t:e.ShadersRepository+t,this._engine._loadFile(r+".vertex.fx",i)):i(window.atob(t.substr(7)))},e.prototype._loadFragmentShader=function(t,i){var r;if(o.a.IsWindowObjectExist()&&t instanceof HTMLElement)return void i(o.a.GetDOMTextContent(t));"base64:"!==t.substr(0,7)?e.ShadersStore[t+"PixelShader"]?i(e.ShadersStore[t+"PixelShader"]):e.ShadersStore[t+"FragmentShader"]?i(e.ShadersStore[t+"FragmentShader"]):(r="."===t[0]||"/"===t[0]||t.indexOf("http")>-1?t:e.ShadersRepository+t,this._engine._loadFile(r+".fragment.fx",i)):i(window.atob(t.substr(7)))},e.prototype._dumpShadersSource=function(e,t,i){var r=(this._engine.webGLVersion>1?"#version 300 es\n#define WEBGL2 \n":"")+(i?i+"\n":"");t=r+t;var n=2,o=/\n/gm,a="\n1\t"+(e=r+e).replace(o,function(){return"\n"+n+++"\t"});n=2;var c="\n1\t"+t.replace(o,function(){return"\n"+n+++"\t"});this.name.vertexElement?(s.a.Error("Vertex shader: "+this.name.vertexElement+a),s.a.Error("Fragment shader: "+this.name.fragmentElement+c)):this.name.vertex?(s.a.Error("Vertex shader: "+this.name.vertex+a),s.a.Error("Fragment shader: "+this.name.fragment+c)):(s.a.Error("Vertex shader: "+this.name+a),s.a.Error("Fragment shader: "+this.name+c))},e.prototype._processShaderConversion=function(e,t,i){var r=this._processPrecision(e);if(1!=this._engine.webGLVersion)if(-1===r.indexOf("#version 3")){var n=-1!==r.search(/#extension.+GL_EXT_draw_buffers.+require/),o=r.replace(/#extension.+(GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"");o=(o=(o=(o=o.replace(/varying(?![\n\r])\s/g,t?"in ":"out ")).replace(/attribute[ \t]/g,"in ")).replace(/[ \t]attribute/g," in")).replace(/texture2D\s*\(/g,"texture("),t&&(o=(o=(o=(o=(o=(o=(o=o.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(n?"":"out vec4 glFragColor;\n")+"void main(")),i(o)}else i(r.replace("#version 300 es",""));else i(r)},e.prototype._processIncludes=function(t,i){for(var r=this,n=/#include<(.+)>(\((.*)\))*(\[(.*)\])*/g,o=n.exec(t),s=new String(t);null!=o;){var a=o[1];if(-1!==a.indexOf("__decl__")&&(a=a.replace(/__decl__/,""),this._engine.supportsUniformBuffers&&(a=(a=a.replace(/Vertex/,"Ubo")).replace(/Fragment/,"Ubo")),a+="Declaration"),!e.IncludesShadersStore[a]){var c=e.ShadersRepository+"ShadersInclude/"+a+".fx";return void this._engine._loadFile(c,function(t){e.IncludesShadersStore[a]=t,r._processIncludes(s,i)})}var l=e.IncludesShadersStore[a];if(o[2])for(var u=o[3].split(","),h=0;h0},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,i=this._observers;t
";e._AddLogEntry(r)},e._WarnDisabled=function(e){},e._WarnEnabled=function(t){var i=e._FormatMessage(t);console.warn("BJS - "+i);var r="
"+i+"

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

";e._AddLogEntry(r)},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}()},function(e,t,i){"use strict";i.d(t,"c",function(){return m}),i.d(t,"b",function(){return g}),i.d(t,"d",function(){return v}),i.d(t,"e",function(){return y}),i.d(t,"g",function(){return b}),i.d(t,"h",function(){return T}),i.d(t,"f",function(){return E}),i.d(t,"i",function(){return x}),i.d(t,"a",function(){return A});var r,n=i(1),o=i(0),s=i(12),a=i(7),c=i(58),l=i(3),u=i(38),h=i(8),d=i(21),f=i(32),p=i(44),_=i(18),m=function(){function e(){}return e.prototype.getColorToRef=function(e){this.color2?o.f.LerpToRef(this.color1,this.color2,Math.random(),e):e.copyFrom(this.color1)},e}(),g=function(){return function(){}}(),v=function(){function e(){}return e.prototype.getFactor=function(){return void 0===this.factor2?this.factor1:s.a.Lerp(this.factor1,this.factor2,Math.random())},e}(),y=function(e){function t(i,r){var n=e.call(this,i)||this;return n.request=r,n.name="LoadFileError",t._setPrototypeOf(n,t.prototype),n}return n.d(t,e),t._setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t}(Error),b=function(){function e(){}return e.ExponentialBackoff=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=500),function(i,r,n){return 0!==r.status||n>=e||-1!==i.indexOf("file:")?-1:Math.pow(2,n)*t}},e}(),T=function(){function e(){}return e.FetchToRef=function(e,t,i,r,n,o){var s=4*((Math.abs(e)*i%i|0)+(Math.abs(t)*r%r|0)*i);o.r=n[s]/255,o.g=n[s+1]/255,o.b=n[s+2]/255,o.a=n[s+3]/255},e.Mix=function(e,t,i){return e*(1-i)+t*i},e.Instantiate=function(t){if(e.RegisteredExternalClasses&&e.RegisteredExternalClasses[t])return e.RegisteredExternalClasses[t];var i=d.a.GetClass(t);if(i)return i;h.a.Warn(t+" not found, you may have missed an import.");for(var r=t.split("."),n=window||this,o=0,s=r.length;o>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 i=e.CeilingPOT(t),r=e.FloorPOT(t);return i-t>t-r?r:i},e.GetExponentOfTwo=function(t,i,r){var n;switch(void 0===r&&(r=l.a.SCALEMODE_NEAREST),r){case l.a.SCALEMODE_FLOOR:n=e.FloorPOT(t);break;case l.a.SCALEMODE_NEAREST:n=e.NearestPOT(t);break;case l.a.SCALEMODE_CEILING:default:n=e.CeilingPOT(t)}return Math.min(n,i)},e.GetFilename=function(e){var t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)},e.GetFolderPath=function(e,t){void 0===t&&(t=!1);var i=e.lastIndexOf("/");return i<0?t?e:"":e.substring(0,i+1)},e.ToDegrees=function(e){return 180*e/Math.PI},e.ToRadians=function(e){return e*Math.PI/180},e.EncodeArrayBufferTobase64=function(e){for(var t,i,r,n,o,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0,h=new Uint8Array(e);u>2,o=(3&t)<<4|(i=u>4,s=(15&i)<<2|(r=u>6,a=63&r,isNaN(i)?s=a=64:isNaN(r)&&(a=64),l+=c.charAt(n)+c.charAt(o)+c.charAt(s)+c.charAt(a);return"data:image/png;base64,"+l},e.ExtractMinAndMaxIndexed=function(e,t,i,r,n){void 0===n&&(n=null);for(var s=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new o.x(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=i;c=200&&t.status<300||0===t.status&&(!u.a.IsWindowObjectExist()||e.IsFileURL()))return void i(o?t.response:t.responseText,t.responseURL);var r=e.DefaultRetryStrategy;if(r){var f=r(h,t,c);if(-1!==f)return t.removeEventListener("loadend",l),t=new XMLHttpRequest,void(n=setTimeout(function(){return a(c+1)},f))}var _=new y("Error status: "+t.status+" "+t.statusText+" - Unable to load "+h,t);if(!s)throw _;s(t,_)}};t.addEventListener("readystatechange",p),e.UseCustomRequestHeaders&&e.InjectCustomRequestHeaders(t),t.send()};a(0)};if(n&&n.enableSceneOffline){var _=function(e){e&&e.status>400?s&&s(e):d||p()};n.open(function(){d||n&&n.loadFile(t,function(e){d||i(e),f.onCompleteObservable.notifyObservers(f)},r?function(e){d||r(e)}:void 0,_,o)},_)}else p();return f},e.LoadScript=function(e,t,i){if(u.a.IsWindowObjectExist()){var r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(){t&&t()},n.onerror=function(t){i&&i("Unable to load script '"+e+"'",t)},r.appendChild(n)}},e.ReadFileAsDataURL=function(e,t,i){var r=new FileReader,n={onCompleteObservable:new a.c,abort:function(){return r.abort()}};return r.onloadend=function(e){n.onCompleteObservable.notifyObservers(n)},r.onload=function(e){t(e.target.result)},r.onprogress=i,r.readAsDataURL(e),n},e.ReadFile=function(e,t,i,r){var n=new FileReader,o={onCompleteObservable:new a.c,abort:function(){return n.abort()}};return n.onloadend=function(e){return o.onCompleteObservable.notifyObservers(o)},n.onerror=function(i){h.a.Log("Error while reading file: "+e.name),t(JSON.stringify({autoClear:!0,clearColor:[1,0,0],ambientColor:[0,0,0],gravity:[0,-9.807,0],meshes:[],cameras:[],lights:[]}))},n.onload=function(e){t(e.target.result)},i&&(n.onprogress=i),r?n.readAsArrayBuffer(e):n.readAsText(e),o},e.FileAsURL=function(e){var t=new Blob([e]);return(window.URL||window.webkitURL).createObjectURL(t)},e.Format=function(e,t){return void 0===t&&(t=2),e.toFixed(t)},e.CheckExtends=function(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)},e.DeepCopy=function(e,t,i,r){f.a.DeepCopy(e,t,i,r)},e.IsEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},e.RegisterTopRootEvents=function(e){for(var t=0;t=n.gradient&&e<=o.gradient)return void i(n,o,(e-n.gradient)/(o.gradient-n.gradient))}var s=t.length-1;i(t[s],t[s],1)},e.BaseUrl="",e.UseCustomRequestHeaders=!1,e.CustomRequestHeaders={},e.DefaultRetryStrategy=b.ExponentialBackoff(),e.CorsBehavior="anonymous",e.UseFallbackTexture=!0,e.RegisteredExternalClasses={},e.fallbackTexture="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z",e._tmpFloatArray=new Float32Array(1),e.GetDOMTextContent=u.a.GetDOMTextContent,e.PreprocessUrl=function(e){return e},e.NoneLogLevel=h.a.NoneLogLevel,e.MessageLogLevel=h.a.MessageLogLevel,e.WarningLogLevel=h.a.WarningLogLevel,e.ErrorLogLevel=h.a.ErrorLogLevel,e.AllLogLevel=h.a.AllLogLevel,e.IsWindowObjectExist=u.a.IsWindowObjectExist,e.PerformanceNoneLogLevel=0,e.PerformanceUserMarkLogLevel=1,e.PerformanceConsoleLogLevel=2,e.StartPerformanceCounter=e._StartPerformanceCounterDisabled,e.EndPerformanceCounter=e._EndPerformanceCounterDisabled,e}(),E=function(){function e(){this._startMonitoringTime=0,this._min=0,this._max=0,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}return Object.defineProperty(e.prototype,"min",{get:function(){return this._min},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"average",{get:function(){return this._average},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastSecAverage",{get:function(){return this._lastSecAverage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"total",{get:function(){return this._totalAccumulated},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._totalValueCount},enumerable:!0,configurable:!0}),e.prototype.fetchNewFrame=function(){this._totalValueCount++,this._current=0,this._lastSecValueCount++},e.prototype.addCount=function(t,i){e.Enabled&&(this._current+=t,i&&this._fetchResult())},e.prototype.beginMonitoring=function(){e.Enabled&&(this._startMonitoringTime=p.a.Now)},e.prototype.endMonitoring=function(t){if(void 0===t&&(t=!0),e.Enabled){t&&this.fetchNewFrame();var i=p.a.Now;this._current=i-this._startMonitoringTime,t&&this._fetchResult()}},e.prototype._fetchResult=function(){this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current),this._average=this._totalAccumulated/this._totalValueCount;var e=p.a.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)},e.Enabled=!0,e}();function x(e,t){return function(i){i.__bjsclassName__=e,i.__bjsmoduleName__=null!=t?t:null}}var A=function(){function e(e,t,i,r){void 0===r&&(r=0),this.iterations=e,this.index=r-1,this._done=!1,this._fn=t,this._successCallback=i}return e.prototype.executeNext=function(){this._done||(this.index+1=t)break;if(r(s),o&&o()){e.breakLoop();break}}e.executeNext()},s)},n)},e}()},function(e,t,i){"use strict";i.d(t,"b",function(){return A}),i.d(t,"c",function(){return P}),i.d(t,"d",function(){return S}),i.d(t,"a",function(){return C});var r=i(1),n=i(7),o=i(9),s=i(32),a=i(28),c=i(0),l=i(25),u=i(4),h=i(13),d=i(56),f=i(24),p=i(47),_=i(42),m=i(19),g=i(63),v=i(53),y=i(3),b=i(2),T=i(8),E=i(21),x=i(18),A=function(){return function(e,t){this.distance=e,this.mesh=t}}(),P=function(){return function(){}}(),R=function(){return function(){this.visibleInstances={},this.renderIdForInstances=new Array,this.batchCache=new S,this.instancesBufferSize=2048}}(),S=function(){return function(){this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=new Array}}(),C=function(e){function t(i,r,n,o,c,l){void 0===r&&(r=null),void 0===n&&(n=null),void 0===o&&(o=null),void 0===l&&(l=!0);var u=e.call(this,i,r)||this;if(u.delayLoadState=y.a.DELAYLOADSTATE_NONE,u.instances=new Array,u._LODLevels=new Array,u._instanceDataStorage=new R,u._originalBuilderSideOrientation=t.DEFAULTSIDE,u.overrideMaterialSideOrientation=null,u._areNormalsFrozen=!1,u._source=null,u._isMesh=!0,r=u.getScene(),o){if(o._geometry&&o._geometry.applyToMesh(u),s.a.DeepCopy(o,u,["name","material","skeleton","instances","parent","uniqueId","source","metadata","hasLODLevels","geometry","isBlocked","areNormalsFrozen","onBeforeDrawObservable","onBeforeRenderObservable","onAfterRenderObservable","onBeforeDraw","onAfterWorldMatrixUpdateObservable","onCollideObservable","onCollisionPositionChangeObservable","onRebuildObservable","onDisposeObservable"],["_poseMatrix"]),u._source=o,r.useClonedMeshhMap&&(o.meshMap||(o.meshMap={}),o.meshMap[u.uniqueId]=u),u._originalBuilderSideOrientation=o._originalBuilderSideOrientation,u._creationDataStorage=o._creationDataStorage,u._source._ranges){var h=u._source._ranges;for(var i in h)h.hasOwnProperty(i)&&h[i]&&u.createAnimationRange(i,h[i].from,h[i].to)}var d;if(o.metadata&&o.metadata.clone?u.metadata=o.metadata.clone():u.metadata=o.metadata,a.a&&a.a.HasTags(o)&&a.a.AddTagsTo(u,a.a.GetTags(o,!0)),u.parent=o.parent,u.setPivotMatrix(o.getPivotMatrix()),u.id=i+"."+o.id,u.material=o.material,!c)for(var f=o.getDescendants(!0),p=0;p0},enumerable:!0,configurable:!0}),t.prototype.getLODLevels=function(){return this._LODLevels},t.prototype._sortLODLevels=function(){this._LODLevels.sort(function(e,t){return e.distancet.distance?-1:0})},t.prototype.addLODLevel=function(e,t){if(t&&t._masterMesh)return T.a.Warn("You cannot use a mesh as LOD level twice"),this;var i=new A(e,t);return this._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this},t.prototype.getLODLevelAtDistance=function(e){for(var t=0;tr)return this.onLODLevelSelection&&this.onLODLevelSelection(r,this,this._LODLevels[this._LODLevels.length-1].mesh),this;for(var n=0;n0;this.computeWorldMatrix();var s=this.material||n.defaultMaterial;if(s)if(s._storeEffectOnSubMeshes)for(var a=0,c=this.subMeshes;a0){var i=this.getIndices();if(!i)return null;var r=i.length,n=!1;if(e)n=!0;else for(var o=0,s=this.subMeshes;o=r){n=!0;break}if(a.verticesStart+a.verticesCount>=t){n=!0;break}}if(!n)return this.subMeshes[0]}return this.releaseSubMeshes(),new p.b(0,0,t,0,this.getTotalIndices(),this)},t.prototype.subdivide=function(e){if(!(e<1)){for(var t=this.getTotalIndices(),i=t/e|0,r=0;i%3!=0;)i++;this.releaseSubMeshes();for(var n=0;n=t);n++)p.b.CreateFromIndices(0,r,Math.min(i,t-r),this),r+=i;this.synchronizeInstances()}},t.prototype.setVerticesData=function(e,t,i,r){if(void 0===i&&(i=!1),this._geometry)this._geometry.setVerticesData(e,t,i,r);else{var n=new h.a;n.set(t,e);var o=this.getScene();new d.a(d.a.RandomId(),o,n,i,this)}return this},t.prototype.markVerticesDataAsUpdatable=function(e,t){void 0===t&&(t=!0);var i=this.getVertexBuffer(e);i&&i.isUpdatable()!==t&&this.setVerticesData(e,this.getVerticesData(e),t)},t.prototype.setVerticesBuffer=function(e){return this._geometry||(this._geometry=d.a.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e),this},t.prototype.updateVerticesData=function(e,t,i,r){return this._geometry?(r?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this},t.prototype.updateMeshPositions=function(e,t){void 0===t&&(t=!0);var i=this.getVerticesData(u.b.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(u.b.PositionKind,i,!1,!1),t){var r=this.getIndices(),n=this.getVerticesData(u.b.NormalKind);if(!n)return this;h.a.ComputeNormals(i,r,n),this.updateVerticesData(u.b.NormalKind,n,!1,!1)}return this},t.prototype.makeGeometryUnique=function(){if(!this._geometry)return this;var e=this._geometry,t=this._geometry.copy(d.a.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this},t.prototype.setIndices=function(e,t,i){if(void 0===t&&(t=null),void 0===i&&(i=!1),this._geometry)this._geometry.setIndices(e,t,i);else{var r=new h.a;r.indices=e;var n=this.getScene();new d.a(d.a.RandomId(),n,r,i,this)}return this},t.prototype.updateIndices=function(e,t){return this._geometry?(this._geometry.updateIndices(e,t),this):this},t.prototype.toLeftHanded=function(){return this._geometry?(this._geometry.toLeftHanded(),this):this},t.prototype._bind=function(e,t,i){if(!this._geometry)return this;var r,n=this.getScene().getEngine();if(this._unIndexed)r=null;else switch(i){case m.a.PointFillMode:r=null;break;case m.a.WireFrameFillMode:r=e._getLinesIndexBuffer(this.getIndices(),n);break;default:case m.a.TriangleFillMode:r=this._unIndexed?null:this._geometry.getIndexBuffer()}return this._geometry._bind(t,r),this},t.prototype._draw=function(e,t,i,r){if(void 0===r&&(r=!1),!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._onBeforeDrawObservable&&this._onBeforeDrawObservable.notifyObservers(this);var n=this.getScene(),o=n.getEngine();if(this._unIndexed||t==m.a.PointFillMode?o.drawArraysType(t,e.verticesStart,e.verticesCount,i):t==m.a.WireFrameFillMode?o.drawElementsType(t,0,e._linesIndexCount,i):o.drawElementsType(t,e.indexStart,e.indexCount,i),n._isAlternateRenderingEnabled&&!r){var s=e.effect||this._effectiveMaterial.getEffect();if(!s||!n.activeCamera)return this;n._switchToAlternateCameraConfiguration(!0),this._effectiveMaterial.bindView(s),this._effectiveMaterial.bindViewProjection(s),o.setViewport(n.activeCamera._alternateCamera.viewport),this._draw(e,t,i,!0),o.setViewport(n.activeCamera.viewport),n._switchToAlternateCameraConfiguration(!1),this._effectiveMaterial.bindView(s),this._effectiveMaterial.bindViewProjection(s)}return this},t.prototype.registerBeforeRender=function(e){return this.onBeforeRenderObservable.add(e),this},t.prototype.unregisterBeforeRender=function(e){return this.onBeforeRenderObservable.removeCallback(e),this},t.prototype.registerAfterRender=function(e){return this.onAfterRenderObservable.add(e),this},t.prototype.unregisterAfterRender=function(e){return this.onAfterRenderObservable.removeCallback(e),this},t.prototype._getInstancesRenderList=function(e){var t=this.getScene(),i=this._instanceDataStorage.batchCache;if(i.mustReturn=!1,i.renderSelf[e]=this.isEnabled()&&this.isVisible,i.visibleInstances[e]=null,this._instanceDataStorage.visibleInstances){var r=this._instanceDataStorage.visibleInstances,n=t.getRenderId(),o=t._isInIntermediateRendering()?r.intermediateDefaultRenderId:r.defaultRenderId;i.visibleInstances[e]=r[n];var s=this._renderId;!i.visibleInstances[e]&&o&&(i.visibleInstances[e]=r[o],n=Math.max(o,n),s=Math.max(r.selfDefaultRenderId,n));var a=i.visibleInstances[e];if(a&&a.length){if(this._instanceDataStorage.renderIdForInstances[e]===n)return i.mustReturn=!0,i;n!==s&&(i.renderSelf[e]=!1)}this._instanceDataStorage.renderIdForInstances[e]=n}return i},t.prototype._renderWithInstances=function(e,t,i,r,n){var o=i.visibleInstances[e._id];if(!o)return this;for(var s=16*(o.length+1)*4,a=this._instanceDataStorage,c=a.instancesBufferSize,l=a.instancesBuffer;a.instancesBufferSizeh&&r++,0!==_&&f++,d+=_,h=_}if(c[f]++,f>o&&(o=f),0===d)n++;else{var m=1/d,g=0;for(p=0;p.001&&s++}}var v=this.skeleton.bones.length,y=this.getVerticesData(u.b.MatricesIndicesKind),b=this.getVerticesData(u.b.MatricesIndicesExtraKind),T=0;for(l=0;l=v||E<0)&&T++}return{skinned:!0,valid:0===n&&0===s&&0===T,report:"Number of Weights = "+i/4+"\nMaximum influences = "+o+"\nMissing Weights = "+n+"\nNot Sorted = "+r+"\nNot Normalized = "+s+"\nWeightCounts = ["+c+"]\nNumber of bones = "+v+"\nBad Bone Indices = "+T}},t.prototype._checkDelayState=function(){var e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===y.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=y.a.DELAYLOADSTATE_LOADING,this._queueLoad(e)),this},t.prototype._queueLoad=function(e){var t=this;e._addPendingData(this);var i=-1!==this.delayLoadingFile.indexOf(".babylonbinarymeshdata");return o.h.LoadFile(this.delayLoadingFile,function(i){i instanceof ArrayBuffer?t._delayLoadingFunction(i,t):t._delayLoadingFunction(JSON.parse(i),t),t.instances.forEach(function(e){e._syncSubMeshes()}),t.delayLoadState=y.a.DELAYLOADSTATE_LOADED,e._removePendingData(t)},function(){},e.offlineProvider,i),this},t.prototype.isInFrustum=function(t){return this.delayLoadState!==y.a.DELAYLOADSTATE_LOADING&&(!!e.prototype.isInFrustum.call(this,t)&&(this._checkDelayState(),!0))},t.prototype.setMaterialByID=function(e){var t,i=this.getScene().materials;for(t=i.length-1;t>-1;t--)if(i[t].id===e)return this.material=i[t],this;var r=this.getScene().multiMaterials;for(t=r.length-1;t>-1;t--)if(r[t].id===e)return this.material=r[t],this;return this},t.prototype.getAnimatables=function(){var e=new Array;return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e},t.prototype.bakeTransformIntoVertices=function(e){if(!this.isVerticesDataPresent(u.b.PositionKind))return this;var t=this.subMeshes.splice(0);this._resetPointsArrayCache();var i,r=this.getVerticesData(u.b.PositionKind),n=new Array;for(i=0;i-1&&(n.morphTargetManager=i.getMorphTargetManagerById(e.morphTargetManagerId)),e.skeletonId>-1&&(n.skeleton=i.getLastSkeletonByID(e.skeletonId),e.numBoneInfluencers&&(n.numBoneInfluencers=e.numBoneInfluencers)),e.animations){for(var o=0;o4,l=a?this.getVerticesData(u.b.MatricesIndicesExtraKind):null,h=a?this.getVerticesData(u.b.MatricesWeightsExtraKind):null,d=e.getTransformMatrices(this),f=c.x.Zero(),p=new c.j,_=new c.j,m=0,g=0;g0&&(c.j.FromFloat32ArrayToRefScaled(d,Math.floor(16*n[m+s]),v,_),p.addToSelf(_));if(a)for(s=0;s<4;s++)(v=h[m+s])>0&&(c.j.FromFloat32ArrayToRefScaled(d,Math.floor(16*l[m+s]),v,_),p.addToSelf(_));c.x.TransformCoordinatesFromFloatsToRef(this._sourcePositions[g],this._sourcePositions[g+1],this._sourcePositions[g+2],p,f),f.toArray(i,g),c.x.TransformNormalFromFloatsToRef(this._sourceNormals[g],this._sourceNormals[g+1],this._sourceNormals[g+2],p,f),f.toArray(r,g),p.reset()}return this.updateVerticesData(u.b.PositionKind,i),this.updateVerticesData(u.b.NormalKind,r),this},t.MinMax=function(e){var t=null,i=null;return e.forEach(function(e){var r=e.getBoundingInfo().boundingBox;t&&i?(t.minimizeInPlace(r.minimumWorld),i.maximizeInPlace(r.maximumWorld)):(t=r.minimumWorld,i=r.maximumWorld)}),t&&i?{min:t,max:i}:{min:c.x.Zero(),max:c.x.Zero()}},t.Center=function(e){var i=e instanceof Array?t.MinMax(e):e;return c.x.Center(i.min,i.max)},t.MergeMeshes=function(e,i,r,n,o,s){var a;if(void 0===i&&(i=!0),!r){var c=0;for(a=0;a65536)return T.a.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}if(s){var l,u,d=null;o=!1}var f,_=new Array,m=new Array,v=null,y=new Array,b=null;for(a=0;a-1){if(y.capture&&y.captureConstraint){var x=y.capture,A=y.captureConstraint,P=new RegExp(x).exec(d);if(P&&P.length>0)if(parseInt(P[P.length-1])>=A)continue}for(var R=0,S=T;R1&&!this.disableUniformBuffers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needPOTTextures",{get:function(){return this._webGLVersion<2||this.forcePOTTextures},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doNotHandleContextLost",{get:function(){return this._doNotHandleContextLost},set:function(e){this._doNotHandleContextLost=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"performanceMonitor",{get:function(){return this._performanceMonitor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"texturesSupported",{get:function(){return this._texturesSupported},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureFormatInUse",{get:function(){return this._textureFormatInUse},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentViewport",{get:function(){return this._cachedViewport},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture",{get:function(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,e.TEXTUREFORMAT_RGBA,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture3D",{get:function(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,e.TEXTUREFORMAT_RGBA,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture3D},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"emptyCubeTexture",{get:function(){if(!this._emptyCubeTexture){var t=new Uint8Array(4),i=[t,t,t,t,t,t];this._emptyCubeTexture=this.createRawCubeTexture(i,1,e.TEXTUREFORMAT_RGBA,e.TEXTURETYPE_UNSIGNED_INT,!1,!1,e.TEXTURE_NEAREST_SAMPLINGMODE)}return this._emptyCubeTexture},enumerable:!0,configurable:!0}),e.prototype._disableTouchAction=function(){this._renderingCanvas&&(this._renderingCanvas.setAttribute("touch-action","none"),this._renderingCanvas.style.touchAction="none",this._renderingCanvas.style.msTouchAction="none")},e.prototype._rebuildInternalTextures=function(){for(var e=0,t=this._internalTexturesCache.slice();e1||null!==this._gl.getExtension("OES_standard_derivatives"),this._caps.astc=this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),this._caps.s3tc=this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),this._caps.pvrtc=this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this._caps.etc1=this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),this._caps.etc2=this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),this._caps.textureAnisotropicFilterExtension=this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.uintIndices=this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),this._caps.fragmentDepthSupported=this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),this._caps.highPrecisionShaderSupported=!1,this._caps.timerQuery=this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)>0),this._caps.colorBufferFloat=this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float"),this._caps.textureFloat=!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloat=!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._webGLVersion>1&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._caps.textureLOD=!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),this._webGLVersion>1)this._caps.drawBuffersExtension=!0;else{var t=this._gl.getExtension("WEBGL_draw_buffers");if(null!==t){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=t.drawBuffersWEBGL.bind(t),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(var i=0;i<16;i++)this._gl["COLOR_ATTACHMENT"+i+"_WEBGL"]=t["COLOR_ATTACHMENT"+i+"_WEBGL"]}else this._caps.drawBuffersExtension=!1}if(this._caps.parallelShaderCompile=this._gl.getExtension("KHR_parallel_shader_compile"),this._caps.parallelShaderCompile){var r=this._gl.getParameter(this._caps.parallelShaderCompile.MAX_SHADER_COMPILER_THREADS_KHR);this._caps.parallelShaderCompile.maxShaderCompilerThreadsKHR(r)}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._webGLVersion>1)this._caps.vertexArrayObject=!0;else{var o=this._gl.getExtension("OES_vertex_array_object");null!=o?(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=o.createVertexArrayOES.bind(o),this._gl.bindVertexArray=o.bindVertexArrayOES.bind(o),this._gl.deleteVertexArray=o.deleteVertexArrayOES.bind(o)):this._caps.vertexArrayObject=!1}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{var s=this._gl.getExtension("ANGLE_instanced_arrays");null!=s?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=s.drawArraysInstancedANGLE.bind(s),this._gl.drawElementsInstanced=s.drawElementsInstancedANGLE.bind(s),this._gl.vertexAttribDivisor=s.vertexAttribDivisorANGLE.bind(s)):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 a=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),c=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);a&&c&&(this._caps.highPrecisionShaderSupported=0!==a.precision&&0!==c.precision)}this.setDepthBuffer(!0),this.setDepthFunctionToLessOrEqual(),this.setDepthWrite(!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.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=c.h.QueueNewFrame(this.customAnimationFrameRequester.renderFunction||this._bindedRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._vrDisplay&&this._vrDisplay.isPresenting?this._frameHandler=c.h.QueueNewFrame(this._bindedRenderFunction,this._vrDisplay):this._frameHandler=c.h.QueueNewFrame(this._bindedRenderFunction):this._renderingQueueLaunched=!1},e.prototype.runRenderLoop=function(e){-1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._bindedRenderFunction=this._renderLoop.bind(this),this._frameHandler=c.h.QueueNewFrame(this._bindedRenderFunction)))},e.prototype.switchFullscreen=function(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)},e.prototype.enterFullscreen=function(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&c.h.RequestFullscreen(this._renderingCanvas))},e.prototype.exitFullscreen=function(){this.isFullscreen&&c.h.ExitFullscreen()},e.prototype.clear=function(e,t,i,r){void 0===r&&(r=!1),this.applyStates();var n=0;t&&e&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),n|=this._gl.COLOR_BUFFER_BIT),i&&(this._gl.clearDepth(1),n|=this._gl.DEPTH_BUFFER_BIT),r&&(this._gl.clearStencil(0),n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)},e.prototype.scissorClear=function(e,t,i,r,n){this.enableScissor(e,t,i,r),this.clear(n,!0,!0,!0),this.disableScissor()},e.prototype.enableScissor=function(e,t,i,r){var n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(e,t,i,r)},e.prototype.disableScissor=function(){var e=this._gl;e.disable(e.SCISSOR_TEST)},e.prototype._viewport=function(e,t,i,r){e===this._viewportCached.x&&t===this._viewportCached.y&&i===this._viewportCached.z&&r===this._viewportCached.w||(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=r,this._gl.viewport(e,t,i,r))},e.prototype.setViewport=function(e,t,i){var r=t||this.getRenderWidth(),n=i||this.getRenderHeight(),o=e.x||0,s=e.y||0;this._cachedViewport=e,this._viewport(o*r,s*n,r*e.width,n*e.height)},e.prototype.setDirectViewport=function(e,t,i,r){var n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,r),n},e.prototype.beginFrame=function(){this.onBeginFrameObservable.notifyObservers(this),this._measureFps()},e.prototype.endFrame=function(){if(this._badOS&&this.flushFramebuffer(),this._vrDisplay&&this._vrDisplay.isPresenting)try{this._vrDisplay.submitFrame()}catch(e){c.h.Warn("webVR submitFrame has had an unexpected failure: "+e)}this.onEndFrameObservable.notifyObservers(this)},e.prototype.resize=function(){if(!this._vrDisplay||!this._vrDisplay.isPresenting){var e=this._renderingCanvas?this._renderingCanvas.clientWidth:window.innerWidth,t=this._renderingCanvas?this._renderingCanvas.clientHeight:window.innerHeight;this.setSize(e/this._hardwareScalingLevel,t/this._hardwareScalingLevel)}},e.prototype.setSize=function(e,t){if(this._renderingCanvas&&(this._renderingCanvas.width!==e||this._renderingCanvas.height!==t)){this._renderingCanvas.width=e,this._renderingCanvas.height=t;for(var i=0;i1?"COLOR_ATTACHMENT"+o:"COLOR_ATTACHMENT"+o+"_WEBGL"],r.readBuffer(n[o]),r.drawBuffers(n),r.blitFramebuffer(0,0,s.width,s.height,0,0,s.width,s.height,r.COLOR_BUFFER_BIT,r.NEAREST)}for(o=0;o1?"COLOR_ATTACHMENT"+o:"COLOR_ATTACHMENT"+o+"_WEBGL"];r.drawBuffers(n)}for(o=0;o65535){n=!0;break}i=n?new Uint32Array(e):new Uint16Array(e)}else i=new Uint16Array(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),r.references=1,r.is32Bits=n,r},e.prototype.bindArrayBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ARRAY_BUFFER)},e.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e)},e.prototype.bindUniformBufferBase=function(e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e)},e.prototype.bindUniformBlock=function(e,t,i){var r=this._gl.getUniformBlockIndex(e,t);this._gl.uniformBlockBinding(e,r,i)},e.prototype.bindIndexBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)},e.prototype.bindBuffer=function(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e),this._currentBoundBuffer[t]=e)},e.prototype.updateArrayBuffer=function(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)},e.prototype._vertexAttribPointer=function(e,t,i,r,n,o,s){var a=this._currentBufferPointers[t],c=!1;a.active?(a.buffer!==e&&(a.buffer=e,c=!0),a.size!==i&&(a.size=i,c=!0),a.type!==r&&(a.type=r,c=!0),a.normalized!==n&&(a.normalized=n,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=i,a.type=r,a.normalized=n,a.stride=o,a.offset=s,a.buffer=e),(c||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),this._gl.vertexAttribPointer(t,i,r,n,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 i=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var r=0;r=0){var o=e[i[r]];if(!o)continue;this._gl.enableVertexAttribArray(n),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[n]=!0);var s=o.getBuffer();s&&(this._vertexAttribPointer(s,n,o.getSize(),o.type,o.normalized,o.byteStride,o.byteOffset),o.getIsInstanced()&&(this._gl.vertexAttribDivisor(n,o.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(n),this._currentInstanceBuffers.push(s))))}}},e.prototype.recordVertexArrayObject=function(e,t,i){var r=this._gl.createVertexArray();return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(r),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),r},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,i,r,n){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==n){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=n;var o=n.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,i[a],this._gl.FLOAT,!1,r,s)),s+=4*i[a]}}this._bindIndexBufferWithCache(t)},e.prototype._unbindVertexArrayObject=function(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))},e.prototype.bindBuffers=function(e,t,i){this._cachedVertexBuffers===e&&this._cachedEffectForVertexBuffers===i||(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i)),this._bindIndexBufferWithCache(t)},e.prototype.unbindInstanceAttributes=function(){for(var e,t=0,i=this._currentInstanceLocations.length;t1?"#version 300 es\n#define WEBGL2 \n":"",s=this._compileShader(e,"vertex",i,o),a=this._compileShader(t,"fragment",i,o),c=this._createShaderProgram(s,a,r,n);return this.onAfterShaderCompilationObservable.notifyObservers(this),c},e.prototype._createShaderProgram=function(e,t,i,r){void 0===r&&(r=null);var n=i.createProgram();if(!n)throw new Error("Unable to create program");if(i.attachShader(n,e),i.attachShader(n,t),this.webGLVersion>1&&r){var o=this.createTransformFeedback();this.bindTransformFeedback(o),this.setTranformFeedbackVaryings(n,r),n.transformFeedback=o}return i.linkProgram(n),this.webGLVersion>1&&r&&this.bindTransformFeedback(null),n.context=i,n.vertexShader=e,n.fragmentShader=t,this._caps.parallelShaderCompile?n.isParallelCompiled=!0:this._finalizeProgram(n),n},e.prototype._finalizeProgram=function(e){var t,i=e.context,r=e.vertexShader,n=e.fragmentShader;if(!i.getProgramParameter(e,i.LINK_STATUS)&&(t=i.getProgramInfoLog(e)))throw new Error(t);if(this.validateShaderPrograms&&(i.validateProgram(e),!i.getProgramParameter(e,i.VALIDATE_STATUS)&&(t=i.getProgramInfoLog(e))))throw new Error(t);i.deleteShader(r),i.deleteShader(n),e.context=void 0,e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)},e.prototype._isProgramCompiled=function(e){return!e.isParallelCompiled||!!this._gl.getProgramParameter(e,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)&&(this._finalizeProgram(e),!0)},e.prototype._executeWhenProgramIsCompiled=function(e,t){e.isParallelCompiled?e.onCompiled=t:t()},e.prototype.getUniforms=function(e,t){for(var i=new Array,r=0;r-1?m.substring(T).toLowerCase():""),x=null,A=0,P=e._TextureLoaders;Al||t.height>l||null===e._RescalePostProcessFactory)return _._prepareWorkingCanvas(),!(!_._workingCanvas||!_._workingContext)&&(_._workingCanvas.width=i,_._workingCanvas.height=r,_._workingContext.drawImage(t,0,0,t.width,t.height,0,0,i,r),s.texImage2D(s.TEXTURE_2D,0,c,c,s.UNSIGNED_BYTE,_._workingCanvas),b.width=i,b.height=r,!1);var u=new p.a(_,p.a.DATASOURCE_TEMP);return _._bindTextureDirectly(s.TEXTURE_2D,u,!0),s.texImage2D(s.TEXTURE_2D,0,c,c,s.UNSIGNED_BYTE,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),_._rescaleTexture(u,b,n,c,function(){_._releaseTexture(u),_._bindTextureDirectly(s.TEXTURE_2D,b,!0),o()}),!0},o)};!g||y?l instanceof HTMLImageElement?O(l):c.h.LoadImage(m,O,C,n?n.offlineProvider:null):"string"==typeof l||l instanceof ArrayBuffer||l instanceof Blob?c.h.LoadImage(l,O,C,n?n.offlineProvider:null):O(l)}return b},e.prototype._rescaleTexture=function(t,i,r,n,o){var s=this,a=this.createRenderTargetTexture({width:i.width,height:i.height},{generateMipMaps:!1,type:e.TEXTURETYPE_UNSIGNED_INT,samplingMode:e.TEXTURE_BILINEAR_SAMPLINGMODE,generateDepthBuffer:!1,generateStencilBuffer:!1});!this._rescalePostProcess&&e._RescalePostProcessFactory&&(this._rescalePostProcess=e._RescalePostProcessFactory(this)),this._rescalePostProcess.getEffect().executeWhenCompiled(function(){s._rescalePostProcess.onApply=function(e){e._bindTexture("textureSampler",t)};var e=r;e||(e=s.scenes[s.scenes.length-1]),e.postProcessManager.directRender([s._rescalePostProcess],a,!0),s._bindTextureDirectly(s._gl.TEXTURE_2D,i,!0),s._gl.copyTexImage2D(s._gl.TEXTURE_2D,0,n,0,0,i.width,i.height,0),s.unBindFramebuffer(a),s._releaseTexture(a),o&&o()})},e.prototype.updateRawTexture=function(t,i,r,n,o,s){if(void 0===o&&(o=null),void 0===s&&(s=e.TEXTURETYPE_UNSIGNED_INT),t){var a=this._getRGBABufferInternalSizedFormat(s,r),c=this._getInternalFormat(r),l=this._getWebGLTextureType(s);this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(t._bufferView=i,t.format=r,t.type=s,t.invertY=n,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&i?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[o],t.width,t.height,0,i):this._gl.texImage2D(this._gl.TEXTURE_2D,0,a,t.width,t.height,0,c,l,i),t.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),t.isReady=!0}},e.prototype.createRawTexture=function(t,i,r,n,o,s,a,c,l){void 0===c&&(c=null),void 0===l&&(l=e.TEXTURETYPE_UNSIGNED_INT);var u=new p.a(this,p.a.DATASOURCE_RAW);u.baseWidth=i,u.baseHeight=r,u.width=i,u.height=r,u.format=n,u.generateMipMaps=o,u.samplingMode=a,u.invertY=s,u._compression=c,u.type=l,this._doNotHandleContextLost||(u._bufferView=t),this.updateRawTexture(u,t,n,s,c,l),this._bindTextureDirectly(this._gl.TEXTURE_2D,u,!0);var h=this._getSamplingParameters(a,o);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,h.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,h.min),o&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(u),u},e.prototype._unpackFlipY=function(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))},e.prototype._getUnpackAlignement=function(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)},e.prototype.createDynamicTexture=function(e,t,i,r){var n=new p.a(this,p.a.DATASOURCE_DYNAMIC);return n.baseWidth=e,n.baseHeight=t,i&&(e=this.needPOTTextures?c.h.GetExponentOfTwo(e,this._caps.maxTextureSize):e,t=this.needPOTTextures?c.h.GetExponentOfTwo(t,this._caps.maxTextureSize):t),n.width=e,n.height=t,n.isReady=!1,n.generateMipMaps=i,n.samplingMode=r,this.updateTextureSamplingMode(r,n),this._internalTexturesCache.push(n),n},e.prototype.updateTextureSamplingMode=function(e,t){var i=this._getSamplingParameters(e,t.generateMipMaps);t.isCube?(this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_MIN_FILTER,i.min),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):t.is3D?(this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_MIN_FILTER,i.min),this._bindTextureDirectly(this._gl.TEXTURE_3D,null)):(this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,i.mag,t),this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,i.min),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),t.samplingMode=e},e.prototype.updateDynamicTexture=function(e,t,i,r,n,o){if(void 0===r&&(r=!1),void 0===o&&(o=!1),e){this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0,o),this._unpackFlipY(i),r&&this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1);var s=n?this._getInternalFormat(n):this._gl.RGBA;this._gl.texImage2D(this._gl.TEXTURE_2D,0,s,s,this._gl.UNSIGNED_BYTE,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),r&&this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),e.isReady=!0}},e.prototype.updateVideoTexture=function(e,t,i){if(e&&!e._isDisabled){var r=this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0);this._unpackFlipY(!i);try{if(void 0===this._videoTextureSupported&&(this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t),0!==this._gl.getError()?this._videoTextureSupported=!1:this._videoTextureSupported=!0),this._videoTextureSupported)this._gl.texImage2D(this._gl.TEXTURE_2D,0,this._gl.RGBA,this._gl.RGBA,this._gl.UNSIGNED_BYTE,t);else{if(!e._workingCanvas){e._workingCanvas=document.createElement("canvas");var n=e._workingCanvas.getContext("2d");if(!n)throw new Error("Unable to get 2d context");e._workingContext=n,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),r||this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0}catch(t){e._isDisabled=!0}}},e.prototype.updateTextureComparisonFunction=function(t,i){if(1!==this.webGLVersion){var r=this._gl;t.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,t,!0),0===i?(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,e.LEQUAL),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,i),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,t,!0),0===i?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,e.LEQUAL),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,i),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),t._comparisonFunction=i}else v.a.Error("WebGL 1 does not support texture comparison.")},e.prototype._setupDepthStencilTexture=function(t,i,r,n,o){var s=i.width||i,a=i.height||i;t.baseWidth=s,t.baseHeight=a,t.width=s,t.height=a,t.isReady=!0,t.samples=1,t.generateMipMaps=!1,t._generateDepthBuffer=!0,t._generateStencilBuffer=r,t.samplingMode=n?e.TEXTURE_BILINEAR_SAMPLINGMODE:e.TEXTURE_NEAREST_SAMPLINGMODE,t.type=e.TEXTURETYPE_UNSIGNED_INT,t._comparisonFunction=o;var c=this._gl,l=t.isCube?c.TEXTURE_CUBE_MAP:c.TEXTURE_2D,u=this._getSamplingParameters(t.samplingMode,!1);c.texParameteri(l,c.TEXTURE_MAG_FILTER,u.mag),c.texParameteri(l,c.TEXTURE_MIN_FILTER,u.min),c.texParameteri(l,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(l,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),0===o?(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,e.LEQUAL),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.NONE)):(c.texParameteri(l,c.TEXTURE_COMPARE_FUNC,o),c.texParameteri(l,c.TEXTURE_COMPARE_MODE,c.COMPARE_REF_TO_TEXTURE))},e.prototype.createDepthStencilTexture=function(e,t){if(t.isCube){var i=e.width||e;return this._createDepthStencilCubeTexture(i,t)}return this._createDepthStencilTexture(e,t)},e.prototype._createDepthStencilTexture=function(e,t){var i=new p.a(this,p.a.DATASOURCE_DEPTHTEXTURE);if(!this._caps.depthTextureExtension)return v.a.Error("Depth texture is not supported by your browser or hardware."),i;var n=r.a({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),o=this._gl;return this._bindTextureDirectly(o.TEXTURE_2D,i,!0),this._setupDepthStencilTexture(i,e,n.generateStencil,n.bilinearFiltering,n.comparisonFunction),this.webGLVersion>1?n.generateStencil?o.texImage2D(o.TEXTURE_2D,0,o.DEPTH24_STENCIL8,i.width,i.height,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_COMPONENT24,i.width,i.height,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null):n.generateStencil?o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_STENCIL,i.width,i.height,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_2D,0,o.DEPTH_COMPONENT,i.width,i.height,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null),this._bindTextureDirectly(o.TEXTURE_2D,null),i},e.prototype._createDepthStencilCubeTexture=function(e,t){var i=new p.a(this,p.a.DATASOURCE_UNKNOWN);if(i.isCube=!0,1===this.webGLVersion)return v.a.Error("Depth cube texture is not supported by WebGL 1."),i;var n=r.a({bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1},t),o=this._gl;this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,i,!0),this._setupDepthStencilTexture(i,e,n.generateStencil,n.bilinearFiltering,n.comparisonFunction);for(var s=0;s<6;s++)n.generateStencil?o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,o.DEPTH24_STENCIL8,e,e,0,o.DEPTH_STENCIL,o.UNSIGNED_INT_24_8,null):o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,o.DEPTH_COMPONENT24,e,e,0,o.DEPTH_COMPONENT,o.UNSIGNED_INT,null);return this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),i},e.prototype.setFrameBufferDepthStencilTexture=function(e){var t=e.getInternalTexture();if(t&&t._framebuffer&&e.depthStencilTexture){var i=this._gl,r=e.depthStencilTexture;this.bindUnboundFramebuffer(t._framebuffer),r.isCube?r._generateStencilBuffer?i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_CUBE_MAP_POSITIVE_X,r._webGLTexture,0):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_CUBE_MAP_POSITIVE_X,r._webGLTexture,0):r._generateStencilBuffer?i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,r._webGLTexture,0):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,r._webGLTexture,0),this.bindUnboundFramebuffer(null)}},e.prototype.createRenderTargetTexture=function(t,i){var r=new b.a;void 0!==i&&"object"==typeof i?(r.generateMipMaps=i.generateMipMaps,r.generateDepthBuffer=void 0===i.generateDepthBuffer||i.generateDepthBuffer,r.generateStencilBuffer=r.generateDepthBuffer&&i.generateStencilBuffer,r.type=void 0===i.type?e.TEXTURETYPE_UNSIGNED_INT:i.type,r.samplingMode=void 0===i.samplingMode?e.TEXTURE_TRILINEAR_SAMPLINGMODE:i.samplingMode,r.format=void 0===i.format?e.TEXTUREFORMAT_RGBA:i.format):(r.generateMipMaps=i,r.generateDepthBuffer=!0,r.generateStencilBuffer=!1,r.type=e.TEXTURETYPE_UNSIGNED_INT,r.samplingMode=e.TEXTURE_TRILINEAR_SAMPLINGMODE,r.format=e.TEXTUREFORMAT_RGBA),(r.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(r.type!==e.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(r.samplingMode=e.TEXTURE_NEAREST_SAMPLINGMODE);var n=this._gl,o=new p.a(this,p.a.DATASOURCE_RENDERTARGET);this._bindTextureDirectly(n.TEXTURE_2D,o,!0);var s=t.width||t,a=t.height||t,c=this._getSamplingParameters(r.samplingMode,!!r.generateMipMaps);r.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloat||(r.type=e.TEXTURETYPE_UNSIGNED_INT,v.a.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type")),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,c.mag),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,c.min),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texImage2D(n.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(r.type,r.format),s,a,0,this._getInternalFormat(r.format),this._getWebGLTextureType(r.type),null);var l=this._currentFramebuffer,u=n.createFramebuffer();return this.bindUnboundFramebuffer(u),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,o._webGLTexture,0),o._depthStencilBuffer=this._setupFramebufferDepthAttachments(!!r.generateStencilBuffer,r.generateDepthBuffer,s,a),r.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),this.bindUnboundFramebuffer(l),o._framebuffer=u,o.baseWidth=s,o.baseHeight=a,o.width=s,o.height=a,o.isReady=!0,o.samples=1,o.generateMipMaps=!!r.generateMipMaps,o.samplingMode=r.samplingMode,o.type=r.type,o.format=r.format,o._generateDepthBuffer=r.generateDepthBuffer,o._generateStencilBuffer=!!r.generateStencilBuffer,this._internalTexturesCache.push(o),o},e.prototype.createMultipleRenderTarget=function(t,i){var r=!1,n=!0,o=!1,s=!1,a=1,c=e.TEXTURETYPE_UNSIGNED_INT,l=e.TEXTURE_TRILINEAR_SAMPLINGMODE,u=new Array,h=new Array;void 0!==i&&(r=void 0!==i.generateMipMaps&&i.generateMipMaps,n=void 0===i.generateDepthBuffer||i.generateDepthBuffer,o=void 0!==i.generateStencilBuffer&&i.generateStencilBuffer,s=void 0!==i.generateDepthTexture&&i.generateDepthTexture,a=i.textureCount||1,i.types&&(u=i.types),i.samplingModes&&(h=i.samplingModes));var d=this._gl,f=d.createFramebuffer();this.bindUnboundFramebuffer(f);for(var _=t.width||t,m=t.height||t,g=[],y=[],b=this._setupFramebufferDepthAttachments(o,n,_,m),T=0;T1?"COLOR_ATTACHMENT"+T:"COLOR_ATTACHMENT"+T+"_WEBGL"];g.push(P),y.push(R),d.activeTexture(d["TEXTURE"+T]),d.bindTexture(d.TEXTURE_2D,P._webGLTexture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,A.mag),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,A.min),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texImage2D(d.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(x),_,m,0,d.RGBA,this._getWebGLTextureType(x),null),d.framebufferTexture2D(d.DRAW_FRAMEBUFFER,R,d.TEXTURE_2D,P._webGLTexture,0),r&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(d.TEXTURE_2D,null),P._framebuffer=f,P._depthStencilBuffer=b,P.baseWidth=_,P.baseHeight=m,P.width=_,P.height=m,P.isReady=!0,P.samples=1,P.generateMipMaps=r,P.samplingMode=E,P.type=x,P._generateDepthBuffer=n,P._generateStencilBuffer=o,P._attachments=y,this._internalTexturesCache.push(P)}if(s&&this._caps.depthTextureExtension){var S=new p.a(this,p.a.DATASOURCE_MULTIRENDERTARGET);d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,S._webGLTexture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texImage2D(d.TEXTURE_2D,0,this.webGLVersion<2?d.DEPTH_COMPONENT:d.DEPTH_COMPONENT16,_,m,0,d.DEPTH_COMPONENT,d.UNSIGNED_SHORT,null),d.framebufferTexture2D(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.TEXTURE_2D,S._webGLTexture,0),S._framebuffer=f,S.baseWidth=_,S.baseHeight=m,S.width=_,S.height=m,S.isReady=!0,S.samples=1,S.generateMipMaps=r,S.samplingMode=d.NEAREST,S._generateDepthBuffer=n,S._generateStencilBuffer=o,g.push(S),this._internalTexturesCache.push(S)}return d.drawBuffers(y),d.bindRenderbuffer(d.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),this.resetTextureCache(),g},e.prototype._setupFramebufferDepthAttachments=function(e,t,i,r,n){void 0===n&&(n=1);var o=null,s=this._gl;return e?(o=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,o),n>1?s.renderbufferStorageMultisample(s.RENDERBUFFER,n,s.DEPTH24_STENCIL8,i,r):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,r),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,o)):t&&(o=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,o),n>1?s.renderbufferStorageMultisample(s.RENDERBUFFER,n,s.DEPTH_COMPONENT16,i,r):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,i,r),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,o)),o},e.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;var i=this._gl;if(t=Math.min(t,i.getParameter(i.MAX_SAMPLES)),e._depthStencilBuffer&&(i.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(i.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null),e._MSAARenderBuffer&&(i.deleteRenderbuffer(e._MSAARenderBuffer),e._MSAARenderBuffer=null),t>1){var r=i.createFramebuffer();if(!r)throw new Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=r,this.bindUnboundFramebuffer(e._MSAAFramebuffer);var n=i.createRenderbuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");i.bindRenderbuffer(i.RENDERBUFFER,n),i.renderbufferStorageMultisample(i.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(e.type),e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n),e._MSAARenderBuffer=n}else this.bindUnboundFramebuffer(e._framebuffer);return e.samples=t,e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t),i.bindRenderbuffer(i.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),t},e.prototype.updateMultipleRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e||0==e.length)return 1;if(e[0].samples===t)return t;var i=this._gl;t=Math.min(t,i.getParameter(i.MAX_SAMPLES)),e[0]._depthStencilBuffer&&(i.deleteRenderbuffer(e[0]._depthStencilBuffer),e[0]._depthStencilBuffer=null),e[0]._MSAAFramebuffer&&(i.deleteFramebuffer(e[0]._MSAAFramebuffer),e[0]._MSAAFramebuffer=null);for(var r=0;r1){var n=i.createFramebuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");this.bindUnboundFramebuffer(n);var o=this._setupFramebufferDepthAttachments(e[0]._generateStencilBuffer,e[0]._generateDepthBuffer,e[0].width,e[0].height,t),s=[];for(r=0;r1?"COLOR_ATTACHMENT"+r:"COLOR_ATTACHMENT"+r+"_WEBGL"],l=i.createRenderbuffer();if(!l)throw new Error("Unable to create multi sampled framebuffer");i.bindRenderbuffer(i.RENDERBUFFER,l),i.renderbufferStorageMultisample(i.RENDERBUFFER,t,this._getRGBAMultiSampleBufferFormat(a.type),a.width,a.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,c,i.RENDERBUFFER,l),a._MSAAFramebuffer=n,a._MSAARenderBuffer=l,a.samples=t,a._depthStencilBuffer=o,i.bindRenderbuffer(i.RENDERBUFFER,null),s.push(c)}i.drawBuffers(s)}else this.bindUnboundFramebuffer(e[0]._framebuffer);return this.bindUnboundFramebuffer(null),t},e.prototype._uploadCompressedDataToTextureDirectly=function(e,t,i,r,n,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,i,r,0,n)},e.prototype._uploadDataToTextureDirectly=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=this._gl,o=this._getWebGLTextureType(e.type),s=this._getInternalFormat(e.format),a=this._getRGBABufferInternalSizedFormat(e.type,s);this._unpackFlipY(e.invertY);var c=n.TEXTURE_2D;e.isCube&&(c=n.TEXTURE_CUBE_MAP_POSITIVE_X+i);var l=Math.round(u.a.Log2(e.width)),h=Math.round(u.a.Log2(e.height)),d=Math.pow(2,Math.max(l-r,0)),f=Math.pow(2,Math.max(h-r,0));n.texImage2D(c,r,a,d,f,0,s,o,t)},e.prototype._uploadArrayBufferViewToTexture=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=this._gl,o=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,i,r),this._bindTextureDirectly(o,null,!0)},e.prototype._uploadImageToTexture=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=this._gl,o=this._getWebGLTextureType(e.type),s=this._getInternalFormat(e.format),a=this._getRGBABufferInternalSizedFormat(e.type,s),c=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(c,e,!0),this._unpackFlipY(e.invertY);var l=n.TEXTURE_2D;e.isCube&&(l=n.TEXTURE_CUBE_MAP_POSITIVE_X+i),n.texImage2D(l,r,a,s,o,t),this._bindTextureDirectly(c,null,!0)},e.prototype.createRenderTargetCubeTexture=function(t,i){var n=r.a({generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:e.TEXTURETYPE_UNSIGNED_INT,samplingMode:e.TEXTURE_TRILINEAR_SAMPLINGMODE,format:e.TEXTUREFORMAT_RGBA},i);n.generateStencilBuffer=n.generateDepthBuffer&&n.generateStencilBuffer,(n.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(n.type!==e.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(n.samplingMode=e.TEXTURE_NEAREST_SAMPLINGMODE);var o=this._gl,s=new p.a(this,p.a.DATASOURCE_RENDERTARGET);this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,s,!0);var a=this._getSamplingParameters(n.samplingMode,n.generateMipMaps);n.type!==e.TEXTURETYPE_FLOAT||this._caps.textureFloat||(n.type=e.TEXTURETYPE_UNSIGNED_INT,v.a.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MAG_FILTER,a.mag),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_MIN_FILTER,a.min),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_CUBE_MAP,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE);for(var c=0;c<6;c++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,this._getRGBABufferInternalSizedFormat(n.type,n.format),t,t,0,this._getInternalFormat(n.format),this._getWebGLTextureType(n.type),null);var l=o.createFramebuffer();return this.bindUnboundFramebuffer(l),s._depthStencilBuffer=this._setupFramebufferDepthAttachments(n.generateStencilBuffer,n.generateDepthBuffer,t,t),n.generateMipMaps&&o.generateMipmap(o.TEXTURE_CUBE_MAP),this._bindTextureDirectly(o.TEXTURE_CUBE_MAP,null),o.bindRenderbuffer(o.RENDERBUFFER,null),this.bindUnboundFramebuffer(null),s._framebuffer=l,s.width=t,s.height=t,s.isReady=!0,s.isCube=!0,s.samples=1,s.generateMipMaps=n.generateMipMaps,s.samplingMode=n.samplingMode,s.type=n.type,s.format=n.format,s._generateDepthBuffer=n.generateDepthBuffer,s._generateStencilBuffer=n.generateStencilBuffer,this._internalTexturesCache.push(s),s},e.prototype.createCubeTexture=function(t,i,r,n,o,s,a,l,u,h,d,f,_){var m=this;void 0===o&&(o=null),void 0===s&&(s=null),void 0===l&&(l=null),void 0===u&&(u=!1),void 0===h&&(h=0),void 0===d&&(d=0),void 0===f&&(f=null),void 0===_&&(_=[]);var g=this._gl,y=f||new p.a(this,p.a.DATASOURCE_CUBE);y.isCube=!0,y.url=t,y.generateMipMaps=!n,y._lodGenerationScale=h,y._lodGenerationOffset=d,this._doNotHandleContextLost||(y._extension=l,y._files=r);for(var b=t.lastIndexOf("."),T=l||(b>-1?t.substring(b).toLowerCase():""),E=null,x=0,A=e._TextureLoaders;x>v,b=0;b<6;b++){var T=g[v][b];m&&(T=f._convertRGBtoRGBATextureData(T,y,y,o)),p.texImage2D(b,v,h,y,y,0,u,s,T)}f._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null)}else f.updateRawCubeTexture(_,r,n,o,d);_.isReady=!0,i._removePendingData(_),l&&l()}}(e)},void 0,i.offlineProvider,!0,function(e,t){i._removePendingData(_),u&&e&&u(e.status+" "+e.statusText,t)}),_},e.prototype.updateRawTexture3D=function(t,i,r,n,o,s){void 0===o&&(o=null),void 0===s&&(s=e.TEXTURETYPE_UNSIGNED_INT);var a=this._getWebGLTextureType(s),c=this._getInternalFormat(r),l=this._getRGBABufferInternalSizedFormat(s,r);this._bindTextureDirectly(this._gl.TEXTURE_3D,t,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(t._bufferView=i,t.format=r,t.invertY=n,t._compression=o),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),o&&i?this._gl.compressedTexImage3D(this._gl.TEXTURE_3D,0,this.getCaps().s3tc[o],t.width,t.height,t.depth,0,i):this._gl.texImage3D(this._gl.TEXTURE_3D,0,l,t.width,t.height,t.depth,0,c,a,i),t.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_3D),this._bindTextureDirectly(this._gl.TEXTURE_3D,null),t.isReady=!0},e.prototype.createRawTexture3D=function(t,i,r,n,o,s,a,c,l,u){void 0===l&&(l=null),void 0===u&&(u=e.TEXTURETYPE_UNSIGNED_INT);var h=new p.a(this,p.a.DATASOURCE_RAW3D);h.baseWidth=i,h.baseHeight=r,h.baseDepth=n,h.width=i,h.height=r,h.depth=n,h.format=o,h.type=u,h.generateMipMaps=s,h.samplingMode=c,h.is3D=!0,this._doNotHandleContextLost||(h._bufferView=t),this.updateRawTexture3D(h,t,o,a,l,u),this._bindTextureDirectly(this._gl.TEXTURE_3D,h,!0);var d=this._getSamplingParameters(c,s);return this._gl.texParameteri(this._gl.TEXTURE_3D,this._gl.TEXTURE_MAG_FILTER,d.mag),this._gl.texParameteri(this._gl.TEXTURE_3D,this._gl.TEXTURE_MIN_FILTER,d.min),s&&this._gl.generateMipmap(this._gl.TEXTURE_3D),this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._internalTexturesCache.push(h),h},e.prototype._prepareWebGLTextureContinuation=function(e,t,i,r,n){var o=this._gl;if(o){var s=this._getSamplingParameters(n,!i);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,s.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,s.min),i||r||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,i,r,n,o,s,a,l,u){var h=this;void 0===u&&(u=e.TEXTURE_TRILINEAR_SAMPLINGMODE);var d=this.getCaps().maxTextureSize,f=Math.min(d,this.needPOTTextures?c.h.GetExponentOfTwo(r,d):r),p=Math.min(d,this.needPOTTextures?c.h.GetExponentOfTwo(n,d):n),_=this._gl;_&&(t._webGLTexture?(this._bindTextureDirectly(_.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===o||!!o),t.baseWidth=r,t.baseHeight=n,t.width=f,t.height=p,t.isReady=!0,l(f,p,function(){h._prepareWebGLTextureContinuation(t,i,s,a,u)})||this._prepareWebGLTextureContinuation(t,i,s,a,u)):i&&i._removePendingData(t))},e.prototype._convertRGBtoRGBATextureData=function(t,i,r,n){var o;o=n===e.TEXTURETYPE_FLOAT?new Float32Array(i*r*4):new Uint32Array(i*r*4);for(var s=0;s-1?t._designatedSlot:this._nextFreeTextureSlots.length?this._nextFreeTextureSlots[0]:(this._textureCollisions.addCount(1,!1),this._removeDesignatedSlot(this._firstBoundInternalTextureTracker.next));return e},e.prototype._linkTrackers=function(e,t){e.next=t,t.previous=e},e.prototype._removeDesignatedSlot=function(e){var t=e._designatedSlot;return-1===t?-1:(e._designatedSlot=-1,this.disableTextureBindingOptimization?-1:(this._linkTrackers(e.previous,e.next),this._boundTexturesCache[t]=null,this._nextFreeTextureSlots.push(t),t))},e.prototype._activateCurrentTexture=function(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)},e.prototype._bindTextureDirectly=function(e,t,i,r){void 0===i&&(i=!1),void 0===r&&(r=!1);var n=!1;i&&t&&t._designatedSlot>-1&&(this._activeChannel=t._designatedSlot);var o=this._boundTexturesCache[this._activeChannel],s=t&&t._initialSlot>-1;if(o!==t||r){if(o&&this._removeDesignatedSlot(o),this._activateCurrentTexture(),this._gl.bindTexture(e,t?t._webGLTexture:null),this._boundTexturesCache[this._activeChannel]=t,t){if(!this.disableTextureBindingOptimization){var a=this._nextFreeTextureSlots.indexOf(this._activeChannel);a>-1&&this._nextFreeTextureSlots.splice(a,1),this._linkTrackers(this._lastBoundInternalTextureTracker.previous,t),this._linkTrackers(t,this._lastBoundInternalTextureTracker)}t._designatedSlot=this._activeChannel}}else i&&(n=!0,this._activateCurrentTexture());return s&&!i&&this._bindSamplerUniformToChannel(t._initialSlot,this._activeChannel),n},e.prototype._bindTexture=function(e,t){e<0||(t&&(e=this._getCorrectTextureChannel(e,t)),this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,t))},e.prototype.setTextureFromPostProcess=function(e,t){this._bindTexture(e,t?t._textures.data[t._currentRenderTextureInd]:null)},e.prototype.setTextureFromPostProcessOutput=function(e,t){this._bindTexture(e,t?t._outputTexture:null)},e.prototype.unbindAllTextures=function(){for(var e=0;e1&&this._bindTextureDirectly(this._gl.TEXTURE_3D,null)},e.prototype.setTexture=function(e,t,i){e<0||(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))},e.prototype.setDepthStencilTexture=function(e,t,i){e<0||(t&&(this._boundUniforms[e]=t),i&&i.depthStencilTexture?this._setTexture(e,i,!1,!0):this._setTexture(e,null))},e.prototype._bindSamplerUniformToChannel=function(e,t){var i=this._boundUniforms[e];i._currentState!==t&&(this._gl.uniform1i(i,t),i._currentState=t)},e.prototype._getTextureWrapMode=function(t){switch(t){case e.TEXTURE_WRAP_ADDRESSMODE:return this._gl.REPEAT;case e.TEXTURE_CLAMP_ADDRESSMODE:return this._gl.CLAMP_TO_EDGE;case e.TEXTURE_MIRROR_ADDRESSMODE:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT},e.prototype._setTexture=function(t,i,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!1),!i)return null!=this._boundTexturesCache[t]&&(this._activeChannel=t,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&this._bindTextureDirectly(this._gl.TEXTURE_3D,null)),!1;if(i.video)this._activeChannel=t,i.update();else if(i.delayLoadState===e.DELAYLOADSTATE_NOTLOADED)return i.delayLoad(),!1;var o;o=n?i.depthStencilTexture:i.isReady()?i.getInternalTexture():i.isCube?this.emptyCubeTexture:i.is3D?this.emptyTexture3D:this.emptyTexture,r||(t=this._getCorrectTextureChannel(t,o));var s=!0;if(this._boundTexturesCache[t]===o&&(this._moveBoundTextureOnTop(o),r||this._bindSamplerUniformToChannel(o._initialSlot,t),s=!1),this._activeChannel=t,o&&o.is3D)s&&this._bindTextureDirectly(this._gl.TEXTURE_3D,o,r),o&&o._cachedWrapU!==i.wrapU&&(o._cachedWrapU=i.wrapU,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(i.wrapU),o)),o&&o._cachedWrapV!==i.wrapV&&(o._cachedWrapV=i.wrapV,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i.wrapV),o)),o&&o._cachedWrapR!==i.wrapR&&(o._cachedWrapR=i.wrapR,this._setTextureParameterInteger(this._gl.TEXTURE_3D,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(i.wrapR),o)),this._setAnisotropicLevel(this._gl.TEXTURE_3D,i);else if(o&&o.isCube){if(s&&this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,o,r),o._cachedCoordinatesMode!==i.coordinatesMode){o._cachedCoordinatesMode=i.coordinatesMode;var a=i.coordinatesMode!==e.TEXTURE_CUBIC_MODE&&i.coordinatesMode!==e.TEXTURE_SKYBOX_MODE?this._gl.REPEAT:this._gl.CLAMP_TO_EDGE;this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_WRAP_S,a,o),this._setTextureParameterInteger(this._gl.TEXTURE_CUBE_MAP,this._gl.TEXTURE_WRAP_T,a)}this._setAnisotropicLevel(this._gl.TEXTURE_CUBE_MAP,i)}else s&&this._bindTextureDirectly(this._gl.TEXTURE_2D,o,r),o&&o._cachedWrapU!==i.wrapU&&(o._cachedWrapU=i.wrapU,this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(i.wrapU),o)),o&&o._cachedWrapV!==i.wrapV&&(o._cachedWrapV=i.wrapV,this._setTextureParameterInteger(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i.wrapV),o)),this._setAnisotropicLevel(this._gl.TEXTURE_2D,i);return!0},e.prototype.setTextureArray=function(e,t,i){if(!(e<0)&&t){this._textureUnits&&this._textureUnits.length===i.length||(this._textureUnits=new Int32Array(i.length));for(var r=0;r=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||(this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1)}},e.prototype.releaseEffects=function(){for(var e in this._compiledEffects)this._deleteProgram(this._compiledEffects[e]._program);this._compiledEffects={}},e.prototype.dispose=function(){for(this.hideLoadingUI(),this.stopRenderLoop(),this.onNewSceneAddedObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._rescalePostProcess&&this._rescalePostProcess.dispose();this.scenes.length;)this.scenes[0].dispose();1===e.Instances.length&&e.audioEngine&&e.audioEngine.dispose(),this.releaseEffects(),this.unbindAllAttributes(),this._boundUniforms=[],this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.disableVR(),g.a.IsWindowObjectExist()&&(window.removeEventListener("blur",this._onBlur),window.removeEventListener("focus",this._onFocus),window.removeEventListener("vrdisplaypointerrestricted",this._onVRDisplayPointerRestricted),window.removeEventListener("vrdisplaypointerunrestricted",this._onVRDisplayPointerUnrestricted),this._renderingCanvas&&(this._renderingCanvas.removeEventListener("focus",this._onCanvasFocus),this._renderingCanvas.removeEventListener("blur",this._onCanvasBlur),this._renderingCanvas.removeEventListener("pointerout",this._onCanvasPointerOut),this._doNotHandleContextLost||(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored))),document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange),this._onVrDisplayConnect&&(window.removeEventListener("vrdisplayconnect",this._onVrDisplayConnect),this._onVrDisplayDisconnect&&window.removeEventListener("vrdisplaydisconnect",this._onVrDisplayDisconnect),this._onVrDisplayPresentChange&&window.removeEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),this._onVrDisplayConnect=null,this._onVrDisplayDisconnect=null));var t=e.Instances.indexOf(this);t>=0&&e.Instances.splice(t,1),this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers=[],this._renderingCanvas=null,this._currentProgram=null,this._bindedRenderFunction=null,this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear(),h.a.ResetCache();for(var i=0,r=this._activeRequests;i-1?s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+r,e._webGLTexture,n):s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e._webGLTexture,n);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*i)),c=s.UNSIGNED_BYTE;break;default:o||(o=new Float32Array(4*t*i)),c=s.FLOAT}return s.readPixels(0,0,t,i,s.RGBA,c,o),s.bindFramebuffer(s.FRAMEBUFFER,this._currentFramebuffer),o},e.prototype._canRenderToFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(e.TEXTURETYPE_FLOAT)},e.prototype._canRenderToHalfFloatFramebuffer=function(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(e.TEXTURETYPE_HALF_FLOAT)},e.prototype._canRenderToFramebuffer=function(e){for(var t=this._gl;t.getError()!==t.NO_ERROR;);var i=!0,r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),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 n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);var o=t.checkFramebufferStatus(t.FRAMEBUFFER);if((i=(i=i&&o===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){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),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(r),t.deleteFramebuffer(n),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i},e.prototype._getWebGLTextureType=function(t){if(1===this._webGLVersion){switch(t){case e.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case e.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT_OES;case e.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE}return this._gl.UNSIGNED_BYTE}switch(t){case e.TEXTURETYPE_BYTE:return this._gl.BYTE;case e.TEXTURETYPE_UNSIGNED_BYTE:return this._gl.UNSIGNED_BYTE;case e.TEXTURETYPE_SHORT:return this._gl.SHORT;case e.TEXTURETYPE_UNSIGNED_SHORT:return this._gl.UNSIGNED_SHORT;case e.TEXTURETYPE_INT:return this._gl.INT;case e.TEXTURETYPE_UNSIGNED_INTEGER:return this._gl.UNSIGNED_INT;case e.TEXTURETYPE_FLOAT:return this._gl.FLOAT;case e.TEXTURETYPE_HALF_FLOAT:return this._gl.HALF_FLOAT;case e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.UNSIGNED_SHORT_4_4_4_4;case e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.UNSIGNED_SHORT_5_5_5_1;case e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.UNSIGNED_SHORT_5_6_5;case e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case e.TEXTURETYPE_UNSIGNED_INT_24_8:return this._gl.UNSIGNED_INT_24_8;case e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE},e.prototype._getInternalFormat=function(t){var i=this._gl.RGBA;switch(t){case e.TEXTUREFORMAT_ALPHA:i=this._gl.ALPHA;break;case e.TEXTUREFORMAT_LUMINANCE:i=this._gl.LUMINANCE;break;case e.TEXTUREFORMAT_LUMINANCE_ALPHA:i=this._gl.LUMINANCE_ALPHA;break;case e.TEXTUREFORMAT_RED:i=this._gl.RED;break;case e.TEXTUREFORMAT_RG:i=this._gl.RG;break;case e.TEXTUREFORMAT_RGB:i=this._gl.RGB;break;case e.TEXTUREFORMAT_RGBA:i=this._gl.RGBA}if(this._webGLVersion>1)switch(t){case e.TEXTUREFORMAT_RED_INTEGER:i=this._gl.RED_INTEGER;break;case e.TEXTUREFORMAT_RG_INTEGER:i=this._gl.RG_INTEGER;break;case e.TEXTUREFORMAT_RGB_INTEGER:i=this._gl.RGB_INTEGER;break;case e.TEXTUREFORMAT_RGBA_INTEGER:i=this._gl.RGBA_INTEGER}return i},e.prototype._getRGBABufferInternalSizedFormat=function(t,i){if(1===this._webGLVersion){if(void 0!==i)switch(i){case e.TEXTUREFORMAT_ALPHA:return this._gl.ALPHA;case e.TEXTUREFORMAT_LUMINANCE:return this._gl.LUMINANCE;case e.TEXTUREFORMAT_LUMINANCE_ALPHA:return this._gl.LUMINANCE_ALPHA}return this._gl.RGBA}switch(t){case e.TEXTURETYPE_BYTE:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R8_SNORM;case e.TEXTUREFORMAT_RG:return this._gl.RG8_SNORM;case e.TEXTUREFORMAT_RGB:return this._gl.RGB8_SNORM;case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8I;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case e.TEXTURETYPE_UNSIGNED_BYTE:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R8;case e.TEXTUREFORMAT_RG:return this._gl.RG8;case e.TEXTUREFORMAT_RGB:return this._gl.RGB8;case e.TEXTUREFORMAT_RGBA:return this._gl.RGBA8;case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R8UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG8UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB8UI;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGBA8UI;default:return this._gl.RGBA8}case e.TEXTURETYPE_SHORT:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16I;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16I}case e.TEXTURETYPE_UNSIGNED_SHORT:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R16UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG16UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB16UI;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA16UI}case e.TEXTURETYPE_INT:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32I;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32I;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32I;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32I}case e.TEXTURETYPE_UNSIGNED_INTEGER:switch(i){case e.TEXTUREFORMAT_RED_INTEGER:return this._gl.R32UI;case e.TEXTUREFORMAT_RG_INTEGER:return this._gl.RG32UI;case e.TEXTUREFORMAT_RGB_INTEGER:return this._gl.RGB32UI;case e.TEXTUREFORMAT_RGBA_INTEGER:default:return this._gl.RGBA32UI}case e.TEXTURETYPE_FLOAT:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R32F;case e.TEXTUREFORMAT_RG:return this._gl.RG32F;case e.TEXTUREFORMAT_RGB:return this._gl.RGB32F;case e.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA32F}case e.TEXTURETYPE_HALF_FLOAT:switch(i){case e.TEXTUREFORMAT_RED:return this._gl.R16F;case e.TEXTUREFORMAT_RG:return this._gl.RG16F;case e.TEXTUREFORMAT_RGB:return this._gl.RGB16F;case e.TEXTUREFORMAT_RGBA:default:return this._gl.RGBA16F}case e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return this._gl.RGB565;case e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:return this._gl.R11F_G11F_B10F;case e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:return this._gl.RGB9_E5;case e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return this._gl.RGBA4;case e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return this._gl.RGB5_A1;case e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:switch(i){case e.TEXTUREFORMAT_RGBA:return this._gl.RGB10_A2;case e.TEXTUREFORMAT_RGBA_INTEGER:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return this._gl.RGBA8},e.prototype._getRGBAMultiSampleBufferFormat=function(t){return t===e.TEXTURETYPE_FLOAT?this._gl.RGBA32F:t===e.TEXTURETYPE_HALF_FLOAT?this._gl.RGBA16F:this._gl.RGBA8},e.prototype._loadFile=function(e,t,i,r,n,o){var s=this,a=c.h.LoadFile(e,t,i,r,n,o);return this._activeRequests.push(a),a.onCompleteObservable.add(function(e){s._activeRequests.splice(s._activeRequests.indexOf(e),1)}),a},e.prototype._loadFileAsync=function(e,t,i){var r=this;return new Promise(function(n,o){r._loadFile(e,function(e){n(e)},void 0,t,i,function(e,t){o(t)})})},e.prototype._partialLoadFile=function(e,t,i,r,n){void 0===n&&(n=null);this._loadFile(e,function(e){i[t]=e,i._internalCount++,6===i._internalCount&&r(i)},void 0,void 0,!0,function(e,t){n&&e&&n(e.status+" "+e.statusText,t)})},e.prototype._cascadeLoadFiles=function(e,t,i,r){void 0===r&&(r=null);var n=[];n._internalCount=0;for(var o=0;o<6;o++)this._partialLoadFile(i[o],o,n,t,r)},e.isSupported=function(){try{var e=document.createElement("canvas");return null!=(e.getContext("webgl")||e.getContext("experimental-webgl"))&&!!window.WebGLRenderingContext}catch(e){return!1}},e.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Macintosh",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]},{key:"iPhone",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]},{key:"iPad",capture:null,captureConstraint:null,targets:["textureBindingOptimization"]}],e._TextureLoaders=[],e.ALPHA_DISABLE=m.a.ALPHA_DISABLE,e.ALPHA_ADD=m.a.ALPHA_ADD,e.ALPHA_COMBINE=m.a.ALPHA_COMBINE,e.ALPHA_SUBTRACT=m.a.ALPHA_SUBTRACT,e.ALPHA_MULTIPLY=m.a.ALPHA_MULTIPLY,e.ALPHA_MAXIMIZED=m.a.ALPHA_MAXIMIZED,e.ALPHA_ONEONE=m.a.ALPHA_ONEONE,e.ALPHA_PREMULTIPLIED=m.a.ALPHA_PREMULTIPLIED,e.ALPHA_PREMULTIPLIED_PORTERDUFF=m.a.ALPHA_PREMULTIPLIED_PORTERDUFF,e.ALPHA_INTERPOLATE=m.a.ALPHA_INTERPOLATE,e.ALPHA_SCREENMODE=m.a.ALPHA_SCREENMODE,e.DELAYLOADSTATE_NONE=m.a.DELAYLOADSTATE_NONE,e.DELAYLOADSTATE_LOADED=m.a.DELAYLOADSTATE_LOADED,e.DELAYLOADSTATE_LOADING=m.a.DELAYLOADSTATE_LOADING,e.DELAYLOADSTATE_NOTLOADED=m.a.DELAYLOADSTATE_NOTLOADED,e.NEVER=m.a.NEVER,e.ALWAYS=m.a.ALWAYS,e.LESS=m.a.LESS,e.EQUAL=m.a.EQUAL,e.LEQUAL=m.a.LEQUAL,e.GREATER=m.a.GREATER,e.GEQUAL=m.a.GEQUAL,e.NOTEQUAL=m.a.NOTEQUAL,e.KEEP=m.a.KEEP,e.REPLACE=m.a.REPLACE,e.INCR=m.a.INCR,e.DECR=m.a.DECR,e.INVERT=m.a.INVERT,e.INCR_WRAP=m.a.INCR_WRAP,e.DECR_WRAP=m.a.DECR_WRAP,e.TEXTURE_CLAMP_ADDRESSMODE=m.a.TEXTURE_CLAMP_ADDRESSMODE,e.TEXTURE_WRAP_ADDRESSMODE=m.a.TEXTURE_WRAP_ADDRESSMODE,e.TEXTURE_MIRROR_ADDRESSMODE=m.a.TEXTURE_MIRROR_ADDRESSMODE,e.TEXTUREFORMAT_ALPHA=m.a.TEXTUREFORMAT_ALPHA,e.TEXTUREFORMAT_LUMINANCE=m.a.TEXTUREFORMAT_LUMINANCE,e.TEXTUREFORMAT_LUMINANCE_ALPHA=m.a.TEXTUREFORMAT_LUMINANCE_ALPHA,e.TEXTUREFORMAT_RGB=m.a.TEXTUREFORMAT_RGB,e.TEXTUREFORMAT_RGBA=m.a.TEXTUREFORMAT_RGBA,e.TEXTUREFORMAT_RED=m.a.TEXTUREFORMAT_RED,e.TEXTUREFORMAT_R=m.a.TEXTUREFORMAT_R,e.TEXTUREFORMAT_RG=m.a.TEXTUREFORMAT_RG,e.TEXTUREFORMAT_RED_INTEGER=m.a.TEXTUREFORMAT_RED_INTEGER,e.TEXTUREFORMAT_R_INTEGER=m.a.TEXTUREFORMAT_R_INTEGER,e.TEXTUREFORMAT_RG_INTEGER=m.a.TEXTUREFORMAT_RG_INTEGER,e.TEXTUREFORMAT_RGB_INTEGER=m.a.TEXTUREFORMAT_RGB_INTEGER,e.TEXTUREFORMAT_RGBA_INTEGER=m.a.TEXTUREFORMAT_RGBA_INTEGER,e.TEXTURETYPE_UNSIGNED_BYTE=m.a.TEXTURETYPE_UNSIGNED_BYTE,e.TEXTURETYPE_UNSIGNED_INT=m.a.TEXTURETYPE_UNSIGNED_INT,e.TEXTURETYPE_FLOAT=m.a.TEXTURETYPE_FLOAT,e.TEXTURETYPE_HALF_FLOAT=m.a.TEXTURETYPE_HALF_FLOAT,e.TEXTURETYPE_BYTE=m.a.TEXTURETYPE_BYTE,e.TEXTURETYPE_SHORT=m.a.TEXTURETYPE_SHORT,e.TEXTURETYPE_UNSIGNED_SHORT=m.a.TEXTURETYPE_UNSIGNED_SHORT,e.TEXTURETYPE_INT=m.a.TEXTURETYPE_INT,e.TEXTURETYPE_UNSIGNED_INTEGER=m.a.TEXTURETYPE_UNSIGNED_INTEGER,e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4,e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1,e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5,e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=m.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV,e.TEXTURETYPE_UNSIGNED_INT_24_8=m.a.TEXTURETYPE_UNSIGNED_INT_24_8,e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=m.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV,e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=m.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV,e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=m.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV,e.TEXTURE_NEAREST_SAMPLINGMODE=m.a.TEXTURE_NEAREST_SAMPLINGMODE,e.TEXTURE_BILINEAR_SAMPLINGMODE=m.a.TEXTURE_BILINEAR_SAMPLINGMODE,e.TEXTURE_TRILINEAR_SAMPLINGMODE=m.a.TEXTURE_TRILINEAR_SAMPLINGMODE,e.TEXTURE_NEAREST_NEAREST_MIPLINEAR=m.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR,e.TEXTURE_LINEAR_LINEAR_MIPNEAREST=m.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST,e.TEXTURE_LINEAR_LINEAR_MIPLINEAR=m.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR,e.TEXTURE_NEAREST_NEAREST_MIPNEAREST=m.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST,e.TEXTURE_NEAREST_LINEAR_MIPNEAREST=m.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST,e.TEXTURE_NEAREST_LINEAR_MIPLINEAR=m.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR,e.TEXTURE_NEAREST_LINEAR=m.a.TEXTURE_NEAREST_LINEAR,e.TEXTURE_NEAREST_NEAREST=m.a.TEXTURE_NEAREST_NEAREST,e.TEXTURE_LINEAR_NEAREST_MIPNEAREST=m.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST,e.TEXTURE_LINEAR_NEAREST_MIPLINEAR=m.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR,e.TEXTURE_LINEAR_LINEAR=m.a.TEXTURE_LINEAR_LINEAR,e.TEXTURE_LINEAR_NEAREST=m.a.TEXTURE_LINEAR_NEAREST,e.TEXTURE_EXPLICIT_MODE=m.a.TEXTURE_EXPLICIT_MODE,e.TEXTURE_SPHERICAL_MODE=m.a.TEXTURE_SPHERICAL_MODE,e.TEXTURE_PLANAR_MODE=m.a.TEXTURE_PLANAR_MODE,e.TEXTURE_CUBIC_MODE=m.a.TEXTURE_CUBIC_MODE,e.TEXTURE_PROJECTION_MODE=m.a.TEXTURE_PROJECTION_MODE,e.TEXTURE_SKYBOX_MODE=m.a.TEXTURE_SKYBOX_MODE,e.TEXTURE_INVCUBIC_MODE=m.a.TEXTURE_INVCUBIC_MODE,e.TEXTURE_EQUIRECTANGULAR_MODE=m.a.TEXTURE_EQUIRECTANGULAR_MODE,e.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=m.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE,e.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=m.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE,e.SCALEMODE_FLOOR=m.a.SCALEMODE_FLOOR,e.SCALEMODE_NEAREST=m.a.SCALEMODE_NEAREST,e.SCALEMODE_CEILING=m.a.SCALEMODE_CEILING,e.CollisionsEpsilon=.001,e._RescalePostProcessFactory=null,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.WithinEpsilon=function(e,t,i){void 0===i&&(i=1.401298e-45);var r=e-t;return-i<=r&&r<=i},e.ToHex=function(e){var t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},e.Sign=function(e){return 0===(e=+e)||isNaN(e)?e:e>0?1:-1},e.Clamp=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=1),Math.min(i,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,i){return(e-t)/(i-t)},e.Denormalize=function(e,t,i){return e*(i-t)+t},e.DeltaAngle=function(t,i){var r=e.Repeat(i-t,360);return r>180&&(r-=360),r},e.PingPong=function(t,i){var r=e.Repeat(t,2*i);return i-Math.abs(r-i)},e.SmoothStep=function(t,i,r){var n=e.Clamp(r);return i*(n=-2*n*n*n+3*n*n)+t*(1-n)},e.MoveTowards=function(t,i,r){return Math.abs(i-t)<=r?i:t+e.Sign(i-t)*r},e.MoveTowardsAngle=function(t,i,r){var n=e.DeltaAngle(t,i),o=0;return-r180&&(n-=360),t+n*e.Clamp(r)},e.InverseLerp=function(t,i,r){return t!=i?e.Clamp((r-t)/(i-t)):0},e.Hermite=function(e,t,i,r,n){var o=n*n,s=n*o;return e*(2*s-3*o+1)+i*(-2*s+3*o)+t*(s-2*o+n)+r*(s-o)},e.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},e.RangeToPercent=function(e,t,i){return(e-t)/(i-t)},e.PercentToRange=function(e,t,i){return(i-t)*e+t},e.NormalizeRadians=function(t){return t-=e.TwoPi*Math.floor((t+Math.PI)/e.TwoPi)},e.TwoPi=2*Math.PI,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=i(4),o=i(18),s=function(){function e(){}return e.prototype.set=function(e,t){switch(t){case n.b.PositionKind:this.positions=e;break;case n.b.NormalKind:this.normals=e;break;case n.b.TangentKind:this.tangents=e;break;case n.b.UVKind:this.uvs=e;break;case n.b.UV2Kind:this.uvs2=e;break;case n.b.UV3Kind:this.uvs3=e;break;case n.b.UV4Kind:this.uvs4=e;break;case n.b.UV5Kind:this.uvs5=e;break;case n.b.UV6Kind:this.uvs6=e;break;case n.b.ColorKind:this.colors=e;break;case n.b.MatricesIndicesKind:this.matricesIndices=e;break;case n.b.MatricesWeightsKind:this.matricesWeights=e;break;case n.b.MatricesIndicesExtraKind:this.matricesIndicesExtra=e;break;case n.b.MatricesWeightsExtraKind:this.matricesWeightsExtra=e}},e.prototype.applyToMesh=function(e,t){return this._applyTo(e,t),this},e.prototype.applyToGeometry=function(e,t){return this._applyTo(e,t),this},e.prototype.updateMesh=function(e){return this._update(e),this},e.prototype.updateGeometry=function(e){return this._update(e),this},e.prototype._applyTo=function(e,t){return void 0===t&&(t=!1),this.positions&&e.setVerticesData(n.b.PositionKind,this.positions,t),this.normals&&e.setVerticesData(n.b.NormalKind,this.normals,t),this.tangents&&e.setVerticesData(n.b.TangentKind,this.tangents,t),this.uvs&&e.setVerticesData(n.b.UVKind,this.uvs,t),this.uvs2&&e.setVerticesData(n.b.UV2Kind,this.uvs2,t),this.uvs3&&e.setVerticesData(n.b.UV3Kind,this.uvs3,t),this.uvs4&&e.setVerticesData(n.b.UV4Kind,this.uvs4,t),this.uvs5&&e.setVerticesData(n.b.UV5Kind,this.uvs5,t),this.uvs6&&e.setVerticesData(n.b.UV6Kind,this.uvs6,t),this.colors&&e.setVerticesData(n.b.ColorKind,this.colors,t),this.matricesIndices&&e.setVerticesData(n.b.MatricesIndicesKind,this.matricesIndices,t),this.matricesWeights&&e.setVerticesData(n.b.MatricesWeightsKind,this.matricesWeights,t),this.matricesIndicesExtra&&e.setVerticesData(n.b.MatricesIndicesExtraKind,this.matricesIndicesExtra,t),this.matricesWeightsExtra&&e.setVerticesData(n.b.MatricesWeightsExtraKind,this.matricesWeightsExtra,t),this.indices?e.setIndices(this.indices,null,t):e.setIndices([],null),this},e.prototype._update=function(e,t,i){return this.positions&&e.updateVerticesData(n.b.PositionKind,this.positions,t,i),this.normals&&e.updateVerticesData(n.b.NormalKind,this.normals,t,i),this.tangents&&e.updateVerticesData(n.b.TangentKind,this.tangents,t,i),this.uvs&&e.updateVerticesData(n.b.UVKind,this.uvs,t,i),this.uvs2&&e.updateVerticesData(n.b.UV2Kind,this.uvs2,t,i),this.uvs3&&e.updateVerticesData(n.b.UV3Kind,this.uvs3,t,i),this.uvs4&&e.updateVerticesData(n.b.UV4Kind,this.uvs4,t,i),this.uvs5&&e.updateVerticesData(n.b.UV5Kind,this.uvs5,t,i),this.uvs6&&e.updateVerticesData(n.b.UV6Kind,this.uvs6,t,i),this.colors&&e.updateVerticesData(n.b.ColorKind,this.colors,t,i),this.matricesIndices&&e.updateVerticesData(n.b.MatricesIndicesKind,this.matricesIndices,t,i),this.matricesWeights&&e.updateVerticesData(n.b.MatricesWeightsKind,this.matricesWeights,t,i),this.matricesIndicesExtra&&e.updateVerticesData(n.b.MatricesIndicesExtraKind,this.matricesIndicesExtra,t,i),this.matricesWeightsExtra&&e.updateVerticesData(n.b.MatricesWeightsExtraKind,this.matricesWeightsExtra,t,i),this.indices&&e.setIndices(this.indices,null),this},e.prototype.transform=function(e){var t,i=e.m[0]*e.m[5]*e.m[10]<0,n=r.x.Zero();if(this.positions){var o=r.x.Zero();for(t=0;tn.bbSize.y?n.bbSize.x:n.bbSize.y;$=$>n.bbSize.z?$:n.bbSize.z,w=n.subDiv.X*O/n.bbSize.x,L=n.subDiv.Y*O/n.bbSize.y,F=n.subDiv.Z*O/n.bbSize.z,N=n.subDiv.max*n.subDiv.max,n.facetPartitioning.length=0}for(o=0;o0){for(var e=0,t=this._transientComponents;et.LongPressDelay&&!r._isPointerSwiping()&&(r._startingPointerTime=0,n.processTrigger(A.a.ACTION_OnLongPressTrigger,b.a.CreateNew(e.pickedMesh,i)))},t.LongPressDelay)}}else for(var o=0,s=this._pointerDownStage;ot.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>t.DragMovementThreshold},t.prototype.attachControl=function(e,i,r){var o=this;void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===r&&(r=!0),this._initActionManager=function(e,t){if(!o._meshPickProceed){var i=o.pick(o._unTranslatedPointerX,o._unTranslatedPointerY,o.pointerDownPredicate,!1,o.cameraToUseForPointers);o._currentPickResult=i,i&&(e=i.hit&&i.pickedMesh?i.pickedMesh.actionManager:null),o._meshPickProceed=!0}return e},this._delayedSimpleClick=function(e,i,r){(Date.now()-o._previousStartingPointerTime>t.DoubleClickDelay&&!o._doubleClickOccured||e!==o._previousButtonPressed)&&(o._doubleClickOccured=!1,i.singleClick=!0,i.ignore=!1,r(i,o._currentPickResult))},this._initClickEvent=function(e,i,r,n){var s=new O;o._currentPickResult=null;var a=null,c=e.hasSpecificMask(v.a.POINTERPICK)||i.hasSpecificMask(v.a.POINTERPICK)||e.hasSpecificMask(v.a.POINTERTAP)||i.hasSpecificMask(v.a.POINTERTAP)||e.hasSpecificMask(v.a.POINTERDOUBLETAP)||i.hasSpecificMask(v.a.POINTERDOUBLETAP);!c&&C.a&&(a=o._initActionManager(a,s))&&(c=a.hasPickTriggers);var l=!1;if(c){var u=r.button;if(s.hasSwiped=o._isPointerSwiping(),!s.hasSwiped){var h=!t.ExclusiveDoubleClickMode;h||(h=!e.hasSpecificMask(v.a.POINTERDOUBLETAP)&&!i.hasSpecificMask(v.a.POINTERDOUBLETAP))&&!C.a.HasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)&&(a=o._initActionManager(a,s))&&(h=!a.hasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)),h?(Date.now()-o._previousStartingPointerTime>t.DoubleClickDelay||u!==o._previousButtonPressed)&&(s.singleClick=!0,n(s,o._currentPickResult),l=!0):(o._previousDelayedSimpleClickTimeout=o._delayedSimpleClickTimeout,o._delayedSimpleClickTimeout=window.setTimeout(o._delayedSimpleClick.bind(o,u,s,n),t.DoubleClickDelay));var d=e.hasSpecificMask(v.a.POINTERDOUBLETAP)||i.hasSpecificMask(v.a.POINTERDOUBLETAP);!d&&C.a.HasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)&&(a=o._initActionManager(a,s))&&(d=a.hasSpecificTrigger(A.a.ACTION_OnDoublePickTrigger)),d&&(u===o._previousButtonPressed&&Date.now()-o._previousStartingPointerTime0)return!1;for(e=0;e0,n=0,o=this._isReadyForMeshStage;n0)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;if(this._registerTransientComponents(),this.isReady())return this.onReadyObservable.notifyObservers(this),this.onReadyObservable.clear(),void(this._executeWhenReadyTimeoutId=-1);this._executeWhenReadyTimeoutId=setTimeout(function(){e._checkIsReady()},150)},Object.defineProperty(t.prototype,"animatables",{get:function(){return this._activeAnimatables},enumerable:!0,configurable:!0}),t.prototype.resetLastAnimationTimeFrame=function(){this._animationTimeLast=o.a.Now},t.prototype._switchToAlternateCameraConfiguration=function(e){this._useAlternateCameraConfiguration=e},t.prototype.getViewMatrix=function(){return this._useAlternateCameraConfiguration?this._alternateViewMatrix:this._viewMatrix},t.prototype.getProjectionMatrix=function(){return this._useAlternateCameraConfiguration?this._alternateProjectionMatrix:this._projectionMatrix},t.prototype.getTransformMatrix=function(){return this._useAlternateCameraConfiguration?this._alternateTransformMatrix:this._transformMatrix},t.prototype.setTransformMatrix=function(e,t){if(this._viewUpdateFlag!==e.updateFlag||this._projectionUpdateFlag!==t.updateFlag){if(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?u.i.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=u.i.GetPlanes(this._transformMatrix),this.activeCamera&&this.activeCamera._alternateCamera){var i=this.activeCamera._alternateCamera;i.getViewMatrix().multiplyToRef(i.getProjectionMatrix(),u.t.Matrix[0]),u.i.GetRightPlaneToRef(u.t.Matrix[0],this._frustumPlanes[3])}this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.update())}},t.prototype._setAlternateTransformMatrix=function(e,t){this._alternateViewUpdateFlag===e.updateFlag&&this._alternateProjectionUpdateFlag===t.updateFlag||(this._alternateViewUpdateFlag=e.updateFlag,this._alternateProjectionUpdateFlag=t.updateFlag,this._alternateViewMatrix=e,this._alternateProjectionMatrix=t,this._alternateTransformMatrix||(this._alternateTransformMatrix=u.j.Zero()),this._alternateViewMatrix.multiplyToRef(this._alternateProjectionMatrix,this._alternateTransformMatrix),this._alternateSceneUbo||this._createAlternateUbo(),this._alternateSceneUbo.useUbo&&(this._alternateSceneUbo.updateMatrix("viewProjection",this._alternateTransformMatrix),this._alternateSceneUbo.updateMatrix("view",this._alternateViewMatrix),this._alternateSceneUbo.update()))},t.prototype.getSceneUniformBuffer=function(){return this._useAlternateCameraConfiguration?this._alternateSceneUbo:this._sceneUbo},t.prototype.getUniqueId=function(){var e=t._uniqueIdCounter;return t._uniqueIdCounter++,e},t.prototype.addMesh=function(e,t){var i=this;void 0===t&&(t=!1),this.meshes.push(e),e._resyncLightSources(),this.onNewMeshAddedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){i.addMesh(e)})},t.prototype.removeMesh=function(e,t){var i=this;void 0===t&&(t=!1);var r=this.meshes.indexOf(e);return-1!==r&&(this.meshes[r]=this.meshes[this.meshes.length-1],this.meshes.pop()),this.onMeshRemovedObservable.notifyObservers(e),t&&e.getChildMeshes().forEach(function(e){i.removeMesh(e)}),r},t.prototype.addTransformNode=function(e){e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),this.onNewTransformNodeAddedObservable.notifyObservers(e)},t.prototype.removeTransformNode=function(e){var t=e._indexInSceneTransformNodesArray;if(-1!==t){if(t!==this.transformNodes.length-1){var i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t},t.prototype.removeSkeleton=function(e){var t=this.skeletons.indexOf(e);return-1!==t&&this.skeletons.splice(t,1),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 i=0,r=this.meshes;i0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t},t.prototype.removeParticleSystem=function(e){var t=this.particleSystems.indexOf(e);return-1!==t&&this.particleSystems.splice(t,1),t},t.prototype.removeAnimation=function(e){var t=this.animations.indexOf(e);return-1!==t&&this.animations.splice(t,1),t},t.prototype.removeAnimationGroup=function(e){var t=this.animationGroups.indexOf(e);return-1!==t&&this.animationGroups.splice(t,1),t},t.prototype.removeMultiMaterial=function(e){var t=this.multiMaterials.indexOf(e);return-1!==t&&this.multiMaterials.splice(t,1),t},t.prototype.removeMaterial=function(e){var t=e._indexInSceneMaterialArray;if(-1!==t&&t=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 i=this.getTransformNodeByID(e);if(i)return i;var r=this.getLightByID(e);if(r)return r;var n=this.getCameraByID(e);if(n)return n;var o=this.getBoneByID(e);return o||null},t.prototype.getNodeByName=function(e){var t=this.getMeshByName(e);if(t)return t;var i=this.getTransformNodeByName(e);if(i)return i;var r=this.getLightByName(e);if(r)return r;var n=this.getCameraByName(e);if(n)return n;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.getSkeletonById=function(e){for(var t=0;t0&&0!=(o.layerMask&this.activeCamera.layerMask)&&(o.alwaysSelectAsActiveMesh||o.isInFrustum(this._frustumPlanes))&&(this._activeMeshes.push(o),this.activeCamera._activeMeshes.push(o),o._activate(this._renderId),s!==o&&s._activate(this._renderId),this._activeMesh(o,s)))}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(var a=0;a0)for(var n=this.getActiveSubMeshCandidates(t),o=n.length,s=0;s0&&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){n.h.StartPerformanceCounter("Render targets",this._renderTargets.length>0);for(var c=0;c0),this._renderId++}for(var h=0,d=this._cameraDrawRenderTargetStage;h-1&&(r.trigger===A.a.ACTION_OnIntersectionExitTrigger&&r._executeCurrent(b.a.CreateNew(t,void 0,o)),t.actionManager.hasSpecificTrigger(A.a.ACTION_OnIntersectionExitTrigger,function(e){var t=e instanceof h.a?e:e.mesh;return o===t})&&r.trigger!==A.a.ACTION_OnIntersectionExitTrigger||t._intersectionsInProgress.splice(a,1))}}}},t.prototype._advancePhysicsEngineStep=function(e){},t.prototype._animate=function(){},t.prototype.render=function(e){if(void 0===e&&(e=!0),!this.isDisposed){if(this._frameId++,this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(A.a.ACTION_OnEveryFrameTrigger),this._engine.isDeterministicLockStep()){var i=Math.max(t.MinDeltaTime,Math.min(this._engine.getDeltaTime(),t.MaxDeltaTime))+this._timeAccumulator,r=this.getDeterministicFrameTime(),o=0,s=this._engine.getLockstepMaxSteps(),a=Math.floor(i/60);a=Math.min(a,s);do{this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=.06*r,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this._advancePhysicsEngineStep(r),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,o++,i-=r}while(i>0&&o0)for(var u=0;u0),this._intermediateRendering=!0;for(var m=0;m0),this._intermediateRendering=!1,this._renderId++}this.customRenderTargets.length>0&&p.restoreDefaultFramebuffer(),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.activeCamera=_;for(var v=0,y=this._beforeClearStage;v0)for(u=0;u0&&this._engine.clear(null,!1,!0,!0),this._processSubCameras(this.activeCameras[u]);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera)}this._checkIntersections();for(var E=0,x=this._afterRenderStage;E-1&&this._engine.scenes.splice(n,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;e0,t.NUM_MORPH_INFLUENCERS=l.numInfluencers):(t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)}return!0},e.PrepareDefinesForLights=function(e,t,i,r,n,o){if(void 0===n&&(n=4),void 0===o&&(o=!1),!i._areLightsDirty)return i._needNormals;var s=0,a=!1,l=!1,u=!1,h=!1,d=!1;if(e.lightsEnabled&&!o)for(var f=0,p=t._lightSources;f0&&(h=!0,m.prepareDefines(i,s))}}if(_.lightmapMode!=c.a.LIGHTMAP_DEFAULT?(u=!0,i["LIGHTMAPEXCLUDED"+s]=!0,i["LIGHTMAPNOSPECULAR"+s]=_.lightmapMode==c.a.LIGHTMAP_SHADOWSONLY):(i["LIGHTMAPEXCLUDED"+s]=!1,i["LIGHTMAPNOSPECULAR"+s]=!1),++s===n)break}i.SPECULARTERM=d,i.SHADOWS=h;for(var v=s;v0&&(n=r+o,t.addFallback(n,"LIGHT"+o)),e.SHADOWS||(e["SHADOW"+o]&&t.addFallback(r,"SHADOW"+o),e["SHADOWPCF"+o]&&t.addFallback(r,"SHADOWPCF"+o),e["SHADOWPCSS"+o]&&t.addFallback(r,"SHADOWPCSS"+o),e["SHADOWPOISSON"+o]&&t.addFallback(r,"SHADOWPOISSON"+o),e["SHADOWESM"+o]&&t.addFallback(r,"SHADOWESM"+o));return n++},e.PrepareAttributesForMorphTargets=function(e,t,i){var n=i.NUM_MORPH_INFLUENCERS;if(n>0&&s.a.LastCreatedEngine)for(var o=s.a.LastCreatedEngine.getCaps().maxVertexAttribs,c=t.morphTargetManager,l=c&&c.supportsNormals&&i.NORMAL,u=c&&c.supportsTangents&&i.TANGENT,h=0;ho&&r.a.Error("Cannot add more vertex attributes for mesh "+t.name)},e.PrepareAttributesForBones=function(e,t,i,r){i.NUM_BONE_INFLUENCERS>0&&(r.addCPUSkinningFallback(0,t),e.push(a.b.MatricesIndicesKind),e.push(a.b.MatricesWeightsKind),i.NUM_BONE_INFLUENCERS>4&&(e.push(a.b.MatricesIndicesExtraKind),e.push(a.b.MatricesWeightsExtraKind)))},e.PrepareAttributesForInstances=function(e,t){t.INSTANCES&&(e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3"))},e.BindLightShadow=function(e,t,i,r){if(e.shadowEnabled&&t.receiveShadows){var n=e.getShadowGenerator();n&&n.bindShadowLight(i,r)}},e.BindLightProperties=function(e,t,i){e.transferToEffect(t,i+"")},e.BindLights=function(t,i,r,n,s,a){void 0===s&&(s=4),void 0===a&&(a=!1);for(var c=Math.min(i._lightSources.length,s),l=0;l-1){var r=i.getTransformMatrixTexture();t.setTexture("boneSampler",r),t.setFloat("boneTextureWidth",4*(i.bones.length+1))}else{var n=i.getTransformMatrices(e);n&&t.setMatrices("mBones",n)}}},e.BindMorphTargetParameters=function(e,t){var i=e.morphTargetManager;e&&i&&t.setFloatArray("morphTargetInfluences",i.influences)},e.BindLogDepth=function(e,t,i){e.LOGARITHMICDEPTH&&t.setFloat("logarithmicDepthConstant",2/(Math.log(i.activeCamera.maxZ+1)/Math.LN2))},e.BindClipPlane=function(e,t){if(t.clipPlane){var i=t.clipPlane;e.setFloat4("vClipPlane",i.normal.x,i.normal.y,i.normal.z,i.d)}if(t.clipPlane2){i=t.clipPlane2;e.setFloat4("vClipPlane2",i.normal.x,i.normal.y,i.normal.z,i.d)}if(t.clipPlane3){i=t.clipPlane3;e.setFloat4("vClipPlane3",i.normal.x,i.normal.y,i.normal.z,i.d)}if(t.clipPlane4){i=t.clipPlane4;e.setFloat4("vClipPlane4",i.normal.x,i.normal.y,i.normal.z,i.d)}},e._tempFogColor=o.e.Black(),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.WarnImport=function(e){return e+" needs to be imported before as it contains a side-effect required by your code."},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var r=i(1),n=i(2),o=i(9),s=i(7),a=i(0),c=i(23),l=i(47),u=i(68),h=i(3),d=i(8),f=function(){function e(t,i,r){this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.onDisposeObservable=new s.c,this._alphaMode=h.a.ALPHA_COMBINE,this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.forceDepthWrite=!1,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this._wasPreviouslyReady=!1,this._fillMode=e.TriangleFillMode,this._indexInSceneMaterialArray=-1,this.name=t,this.id=t||o.h.RandomId(),this._scene=i||c.a.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.useRightHandedSystem?this.sideOrientation=e.ClockWiseSideOrientation:this.sideOrientation=e.CounterClockWiseSideOrientation,this._uniformBuffer=new u.a(this._scene.getEngine()),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,r||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.c),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.c),this._onUnBindObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alphaMode",{get:function(){return this._alphaMode},set:function(t){this._alphaMode!==t&&(this._alphaMode=t,this.markAsDirty(e.TextureDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needDepthPrePass",{get:function(){return this._needDepthPrePass},set:function(e){this._needDepthPrePass!==e&&(this._needDepthPrePass=e,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fogEnabled",{get:function(){return this._fogEnabled},set:function(t){this._fogEnabled!==t&&(this._fogEnabled=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wireframe",{get:function(){switch(this._fillMode){case e.WireFrameFillMode:case e.LineListDrawMode:case e.LineLoopDrawMode:case e.LineStripDrawMode:return!0}return this._scene.forceWireframe},set:function(t){this.fillMode=t?e.WireFrameFillMode:e.TriangleFillMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pointsCloud",{get:function(){switch(this._fillMode){case e.PointFillMode:case e.PointListDrawMode:return!0}return this._scene.forcePointsCloud},set:function(t){this.fillMode=t?e.PointFillMode:e.TriangleFillMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(t){this._fillMode!==t&&(this._fillMode=t,this.markAsDirty(e.MiscDirtyFlag))},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){return"Name: "+this.name},e.prototype.getClassName=function(){return"Material"},Object.defineProperty(e.prototype,"isFrozen",{get:function(){return this.checkReadyOnlyOnce},enumerable:!0,configurable:!0}),e.prototype.freeze=function(){this.checkReadyOnlyOnce=!0},e.prototype.unfreeze=function(){this.checkReadyOnlyOnce=!1},e.prototype.isReady=function(e,t){return!0},e.prototype.isReadyForSubMesh=function(e,t,i){return!1},e.prototype.getEffect=function(){return this._effect},e.prototype.getScene=function(){return this._scene},e.prototype.needAlphaBlending=function(){return this.alpha<1},e.prototype.needAlphaBlendingForMesh=function(e){return this.needAlphaBlending()||e.visibility<1||e.hasVertexAlpha},e.prototype.needAlphaTesting=function(){return!1},e.prototype.getAlphaTestTexture=function(){return null},e.prototype.markDirty=function(){this._wasPreviouslyReady=!1},e.prototype._preBind=function(t,i){void 0===i&&(i=null);var r=this._scene.getEngine(),n=(null==i?this.sideOrientation:i)===e.ClockWiseSideOrientation;return r.enableEffect(t||this._effect),r.setState(this.backFaceCulling,this.zOffset,!1,n),n},e.prototype.bind=function(e,t){},e.prototype.bindForSubMesh=function(e,t,i){},e.prototype.bindOnlyWorldMatrix=function(e){},e.prototype.bindSceneUniformBuffer=function(e,t){t.bindToEffect(e,"Scene")},e.prototype.bindView=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("view",this.getScene().getViewMatrix())},e.prototype.bindViewProjection=function(e){this._useUBO?this.bindSceneUniformBuffer(e,this.getScene().getSceneUniformBuffer()):e.setMatrix("viewProjection",this.getScene().getTransformMatrix())},e.prototype._shouldTurnAlphaTestOn=function(e){return!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()},e.prototype._afterBind=function(e){if(this._scene._cachedMaterial=this,this._scene._cachedVisibility=e?e.visibility:1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){var t=this._scene.getEngine();this._cachedDepthWriteState=t.getDepthWrite(),t.setDepthWrite(!1)}},e.prototype.unbind=function(){(this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.disableDepthWrite)&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState)},e.prototype.getActiveTextures=function(){return[]},e.prototype.hasTexture=function(e){return!1},e.prototype.clone=function(e){return null},e.prototype.getBindedMeshes=function(){var e=this;if(this.meshMap){var t=new Array;for(var i in this.meshMap){var r=this.meshMap[i];r&&t.push(r)}return t}return this._scene.meshes.filter(function(t){return t.material===e})},e.prototype.forceCompilation=function(e,t,i){var n=this,o=r.a({clipPlane:!1},i),s=new l.a,c=this.getScene(),u=function(){if(n._scene&&n._scene.getEngine()){s._materialDefines&&(s._materialDefines._renderId=-1);var i=c.clipPlane;o.clipPlane&&(c.clipPlane=new a.n(0,0,0,1)),n._storeEffectOnSubMeshes?n.isReadyForSubMesh(e,s)?t&&t(n):setTimeout(u,16):n.isReady()?t&&t(n):setTimeout(u,16),o.clipPlane&&(c.clipPlane=i)}};u()},e.prototype.forceCompilationAsync=function(e,t){var i=this;return new Promise(function(r){i.forceCompilation(e,function(){r()},t)})},e.prototype.markAsDirty=function(t){this.getScene().blockMaterialDirtyMechanism||(e._DirtyCallbackArray.length=0,t&e.TextureDirtyFlag&&e._DirtyCallbackArray.push(e._TextureDirtyCallBack),t&e.LightDirtyFlag&&e._DirtyCallbackArray.push(e._LightsDirtyCallBack),t&e.FresnelDirtyFlag&&e._DirtyCallbackArray.push(e._FresnelDirtyCallBack),t&e.AttributesDirtyFlag&&e._DirtyCallbackArray.push(e._AttributeDirtyCallBack),t&e.MiscDirtyFlag&&e._DirtyCallbackArray.push(e._MiscDirtyCallBack),e._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(e._RunDirtyCallBacks),this.getScene().resetCachedMaterial())},e.prototype._markAllSubMeshesAsDirty=function(e){if(!this.getScene().blockMaterialDirtyMechanism)for(var t=0,i=this.getScene().meshes;t-1?(u.a.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.j.Identity()},t.prototype.getViewMatrix=function(e){return!e&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childRenderId=this._currentRenderId,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._computedViewMatrix)},t.prototype.freezeProjectionMatrix=function(e){this._doNotComputeProjectionMatrix=!0,void 0!==e&&(this._projectionMatrix=e)},t.prototype.unfreezeProjectionMatrix=function(){this._doNotComputeProjectionMatrix=!1},t.prototype.getProjectionMatrix=function(e){if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=this.maxZ,this._refreshFrustumPlanes=!0;var i=this.getEngine(),r=this.getScene();if(this.mode===t.PERSPECTIVE_CAMERA)this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=i.getAspectRatio(this),this.minZ<=0&&(this.minZ=.1),r.useRightHandedSystem?c.j.PerspectiveFovRHToRef(this.fov,i.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED):c.j.PerspectiveFovLHToRef(this.fov,i.getAspectRatio(this),this.minZ,this.maxZ,this._projectionMatrix,this.fovMode===t.FOVMODE_VERTICAL_FIXED);else{var n=i.getRenderWidth()/2,o=i.getRenderHeight()/2;r.useRightHandedSystem?c.j.OrthoOffCenterRHToRef(this.orthoLeft||-n,this.orthoRight||n,this.orthoBottom||-o,this.orthoTop||o,this.minZ,this.maxZ,this._projectionMatrix):c.j.OrthoOffCenterLHToRef(this.orthoLeft||-n,this.orthoRight||n,this.orthoBottom||-o,this.orthoTop||o,this.minZ,this.maxZ,this._projectionMatrix),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.renderWidth=i.getRenderWidth(),this._cache.renderHeight=i.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix},t.prototype.getTransformationMatrix=function(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix},t.prototype._updateFrustumPlanes=function(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?c.i.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=c.i.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)},t.prototype.isInFrustum=function(e){return this._updateFrustumPlanes(),e.isInFrustum(this._frustumPlanes)},t.prototype.isCompletelyInFrustum=function(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)},t.prototype.getForwardRay=function(e,t,i){throw void 0===e&&(e=100),d.a.WarnImport("Ray")},t.prototype.dispose=function(i,r){for(void 0===r&&(r=!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 n=this._rigCameras.pop();n&&n.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,i,r)},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,i){if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){var r=this._rigCameras.pop();r&&r.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=i.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=s.h.ToRadians(this._cameraRigParams.interaxialDistance/.0637),this.cameraRigMode!==t.RIG_MODE_NONE){var n=this.createRigCamera(this.name+"_L",0),o=this.createRigCamera(this.name+"_R",1);n&&o&&(this._rigCameras.push(n),this._rigCameras.push(o))}switch(this.cameraRigMode){case t.RIG_MODE_STEREOSCOPIC_ANAGLYPH:t._setStereoscopicAnaglyphRigMode(this);break;case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case t.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case t.RIG_MODE_STEREOSCOPIC_OVERUNDER:t._setStereoscopicRigMode(this);break;case t.RIG_MODE_VR:t._setVRRigMode(this,i);break;case t.RIG_MODE_WEBVR:t._setWebVRRigMode(this,i)}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.j.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.j.Identity()},t.prototype._getWebVRViewMatrix=function(){return c.j.Identity()},t.prototype.setCameraRigParameter=function(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,"interaxialDistance"===e&&(this._cameraRigParams.stereoHalfAngle=s.h.ToRadians(t/.0637))},t.prototype.createRigCamera=function(e,t){return null},t.prototype._updateRigCameras=function(){for(var e=0;ea.b.CollisionsEpsilon&&n.position.addInPlace(n._diffPositionForCollisions),i&&n.onCollideObservable.notifyObservers(i),n.onCollisionPositionChangeObservable.notifyObservers(n.position)},n.getScene().addMesh(n),n._resyncLightSources(),n}return r.d(t,e),Object.defineProperty(t,"BILLBOARDMODE_NONE",{get:function(){return u.a.BILLBOARDMODE_NONE},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_X",{get:function(){return u.a.BILLBOARDMODE_X},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Y",{get:function(){return u.a.BILLBOARDMODE_Y},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_Z",{get:function(){return u.a.BILLBOARDMODE_Z},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BILLBOARDMODE_ALL",{get:function(){return u.a.BILLBOARDMODE_ALL},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetNb",{get:function(){return this._facetData.facetNb},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningSubdivisions",{get:function(){return this._facetData.partitioningSubdivisions},set:function(e){this._facetData.partitioningSubdivisions=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"partitioningBBoxRatio",{get:function(){return this._facetData.partitioningBBoxRatio},set:function(e){this._facetData.partitioningBBoxRatio=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"mustDepthSortFacets",{get:function(){return this._facetData.facetDepthSort},set:function(e){this._facetData.facetDepthSort=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetDepthSortFrom",{get:function(){return this._facetData.facetDepthSortFrom},set:function(e){this._facetData.facetDepthSortFrom=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFacetDataEnabled",{get:function(){return this._facetData.facetDataEnabled},enumerable:!0,configurable:!0}),t.prototype._updateNonUniformScalingState=function(t){return!!e.prototype._updateNonUniformScalingState.call(this,t)&&(this._markSubMeshesAsMiscDirty(),!0)},Object.defineProperty(t.prototype,"onCollide",{set:function(e){this._onCollideObserver&&this.onCollideObservable.remove(this._onCollideObserver),this._onCollideObserver=this.onCollideObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onCollisionPositionChange",{set:function(e){this._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._onCollisionPositionChangeObserver),this._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._visibility},set:function(e){this._visibility!==e&&(this._visibility=e,this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this._material},set:function(e){this._material!==e&&(this._material&&this._material.meshMap&&(this._material.meshMap[this.uniqueId]=void 0),this._material=e,e&&e.meshMap&&(e.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&this._unBindEffect())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"receiveShadows",{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this._markSubMeshesAsLightDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasVertexAlpha",{get:function(){return this._hasVertexAlpha},set:function(e){this._hasVertexAlpha!==e&&(this._hasVertexAlpha=e,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useVertexColors",{get:function(){return this._useVertexColors},set:function(e){this._useVertexColors!==e&&(this._useVertexColors=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"computeBonesUsingShaders",{get:function(){return this._computeBonesUsingShaders},set:function(e){this._computeBonesUsingShaders!==e&&(this._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numBoneInfluencers",{get:function(){return this._numBoneInfluencers},set:function(e){this._numBoneInfluencers!==e&&(this._numBoneInfluencers=e,this._markSubMeshesAsAttributesDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"applyFog",{get:function(){return this._applyFog},set:function(e){this._applyFog!==e&&(this._applyFog=e,this._markSubMeshesAsMiscDirty())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layerMask",{get:function(){return this._layerMask},set:function(e){e!==this._layerMask&&(this._layerMask=e,this._resyncLightSources())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionMask",{get:function(){return this._collisionMask},set:function(e){this._collisionMask=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collisionGroup",{get:function(){return this._collisionGroup},set:function(e){this._collisionGroup=isNaN(e)?-1:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_positions",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"skeleton",{get:function(){return this._skeleton},set:function(e){this._skeleton&&this._skeleton.needInitialSkinMatrix&&this._skeleton._unregisterMeshWithPoseMatrix(this),e&&e.needInitialSkinMatrix&&e._registerMeshWithPoseMatrix(this),this._skeleton=e,this._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"AbstractMesh"},t.prototype.toString=function(e){var t="Name: "+this.name+", isInstance: "+("InstancedMesh"!==this.getClassName()?"YES":"NO");return t+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0),this._skeleton&&(t+=", skeleton: "+this._skeleton.name),e&&(t+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],t+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingFreezeWorldMatrix?"YES":"NO")),t},t.prototype._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.b.MatricesIndicesExtraKind):null,l=o?this.getVerticesData(c.b.MatricesWeightsExtraKind):null,u=this.skeleton.getTransformMatrices(this),h=s.t.Vector3[0],d=s.t.Matrix[0],f=s.t.Matrix[1],p=0,_=0;_0&&(s.j.FromFloat32ArrayToRefScaled(u,Math.floor(16*i[p+m]),g,f),d.addToSelf(f));if(o)for(m=0;m<4;m++)(g=l[p+m])>0&&(s.j.FromFloat32ArrayToRefScaled(u,Math.floor(16*a[p+m]),g,f),d.addToSelf(f));s.x.TransformCoordinatesFromFloatsToRef(t[_],t[_+1],t[_+2],d,h),h.toArray(t,_)}}return t},t.prototype._updateBoundingInfo=function(){var e=this.skeleton&&this.skeleton.overrideMesh||this;return this._boundingInfo?this._boundingInfo.update(e.worldMatrixFromCache):this._boundingInfo=new d.a(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,i=0;i1||!r.IsGlobal)&&r.updateBoundingInfo(e)}return this},t.prototype._afterComputeWorldMatrix=function(){this._updateBoundingInfo()},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,i){if(void 0===t&&(t=!1),!this._boundingInfo||!e._boundingInfo)return!1;if(this._boundingInfo.intersects(e._boundingInfo,t))return!0;if(i)for(var r=0,n=this.getChildMeshes();r1&&!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.t.Matrix[0],i=s.t.Matrix[1];return s.j.ScalingToRef(1/e._radius.x,1/e._radius.y,1/e._radius.z,t),this.worldMatrixFromCache.multiplyToRef(t,i),this._processCollisionsForSubMeshes(e,i),this},t.prototype._generatePointsArray=function(){return!1},t.prototype.intersects=function(e,t){var i=new h.a,r="InstancedLinesMesh"===this.getClassName()||"LinesMesh"===this.getClassName()?this.intersectionThreshold:0,n=this._boundingInfo;if(!(this.subMeshes&&n&&e.intersectsSphere(n.boundingSphere,r)&&e.intersectsBox(n.boundingBox,r)))return i;if(!this._generatePointsArray())return i;for(var o=null,a=this._scene.getIntersectingSubMeshCandidates(this,e),c=a.length,l=0;l1)||u.canIntersects(e)){var d=u.intersects(e,this._positions,this.getIndices(),t);if(d&&(t||!o||d.distance65535){o=!0;break}e.depthSortedIndices=o?new Uint32Array(i):new Uint16Array(i)}if(e.facetDepthSortFunction=function(e,t){return t.sqDistance-e.sqDistance},!e.facetDepthSortFrom){var u=this.getScene().activeCamera;e.facetDepthSortFrom=u?u.position:s.x.Zero()}e.depthSortedFacets=[];for(var h=0;hs.h?n.maximum.x-n.minimum.x:s.h,e.bbSize.y=n.maximum.y-n.minimum.y>s.h?n.maximum.y-n.minimum.y:s.h,e.bbSize.z=n.maximum.z-n.minimum.z>s.h?n.maximum.z-n.minimum.z:s.h;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=n,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.x.TransformCoordinatesToRef(e.facetDepthSortFrom,e.invertedMatrix,e.facetDepthSortOrigin),e.facetParameters.distanceTo=e.facetDepthSortOrigin),e.facetParameters.depthSortedFacets=e.depthSortedFacets,l.a.ComputeNormals(t,i,r,e.facetParameters),e.facetDepthSort&&e.facetDepthSortEnabled){e.depthSortedFacets.sort(e.facetDepthSortFunction);var p=e.depthSortedIndices.length/3|0;for(h=0;hn.subDiv.max||s<0||s>n.subDiv.max||a<0||a>n.subDiv.max?null:n.facetPartitioning[o+n.subDiv.max*s+n.subDiv.max*n.subDiv.max*a]},t.prototype.getClosestFacetAtCoordinates=function(e,t,i,r,n,o){void 0===n&&(n=!1),void 0===o&&(o=!0);var a=this.getWorldMatrix(),c=s.t.Matrix[5];a.invertToRef(c);var l=s.t.Vector3[8];s.x.TransformCoordinatesFromFloatsToRef(e,t,i,c,l);var u=this.getClosestFacetAtLocalCoordinates(l.x,l.y,l.z,r,n,o);return r&&s.x.TransformCoordinatesFromFloatsToRef(r.x,r.y,r.z,a,r),u},t.prototype.getClosestFacetAtLocalCoordinates=function(e,t,i,r,n,o){void 0===n&&(n=!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,_=this.getFacetLocalPositions(),m=this.getFacetLocalNormals(),g=this.getFacetsAtLocalCoordinates(e,t,i);if(!g)return null;for(var v,y,b,T=Number.MAX_VALUE,E=T,x=0;x=0||n&&!o&&u<=0)&&(u=y.x*b.x+y.y*b.y+y.z*b.z,h=-(y.x*e+y.y*t+y.z*i-u)/(y.x*y.x+y.y*y.y+y.z*y.z),(E=(a=(d=e+y.x*h)-e)*a+(c=(f=t+y.y*h)-t)*c+(l=(p=i+y.z*h)-i)*l)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 r.d(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-1?this._onBeforePhysicsStepCallbacks.splice(t,1):r.a.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):r.a.Warn("Function to remove was not found")},e.prototype.registerOnPhysicsCollide=function(e,t){var i=e instanceof Array?e:[e];this._onPhysicsCollideCallbacks.push({callback:t,otherImpostors:i})},e.prototype.unregisterOnPhysicsCollide=function(e,t){var i=e instanceof Array?e:[e],n=-1;this._onPhysicsCollideCallbacks.some(function(e,r){if(e.callback===t&&e.otherImpostors.length===i.length){var o=e.otherImpostors.every(function(e){return i.indexOf(e)>-1});return o&&(n=r),o}return!1})?this._onPhysicsCollideCallbacks.splice(n,1):r.a.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.q.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,i){var r=new c.e(t,i);return this.addJoint(e,r),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.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.q),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,i,r,n,s){var a=e._tmpVecs[0],c=this.object;if(c.rotationQuaternion)if(s){var l=e._tmpQuat;c.rotationQuaternion.multiplyToRef(s,l),t.setRotationQuaternion(l,o.s.WORLD,i)}else t.setRotationQuaternion(c.rotationQuaternion,o.s.WORLD,i);a.x=0,a.y=0,a.z=0,r&&(a.x=r.x,a.y=r.y,a.z=r.z,t.getDirectionToRef(a,i,a),null==n&&(n=r.length()),a.x*=n,a.y*=n,a.z*=n),t.getParent()?(a.addInPlace(c.getAbsolutePosition()),t.setAbsolutePosition(a,i)):(i.setAbsolutePosition(c.getAbsolutePosition()),i.position.x-=a.x,i.position.y-=a.y,i.position.z-=a.z)},e.prototype.syncImpostorWithBone=function(t,i,r,n,s,a){var c=this.object;if(c.rotationQuaternion)if(s){var l=e._tmpQuat;t.getRotationQuaternionToRef(o.s.WORLD,i,l),l.multiplyToRef(s,c.rotationQuaternion)}else t.getRotationQuaternionToRef(o.s.WORLD,i,c.rotationQuaternion);var u=e._tmpVecs[0],h=e._tmpVecs[1];a||((a=e._tmpVecs[2]).x=0,a.y=1,a.z=0),t.getDirectionToRef(a,i,h),t.getAbsolutePositionToRef(i,u),null==n&&r&&(n=r.length()),null!=n&&(u.x+=h.x*n,u.y+=h.y*n,u.z+=h.z*n),c.setAbsolutePosition(u)},e.DEFAULT_OBJECT_SIZE=new o.x(1,1,1),e.IDENTITY_QUATERNION=o.q.Identity(),e._tmpVecs=n.a.BuildArray(3,o.x.Zero),e._tmpQuat=o.q.Identity(),e.NoImpostor=0,e.SphereImpostor=1,e.BoxImpostor=2,e.PlaneImpostor=3,e.MeshImpostor=4,e.CylinderImpostor=7,e.ParticleImpostor=8,e.HeightmapImpostor=9,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=function(e,t){return e?e.getClassName&&"Mesh"===e.getClassName()?null:e.getClassName&&"SubMesh"===e.getClassName()?e.clone(t):e.clone?e.clone():null:null},n=function(){function e(){}return e.DeepCopy=function(e,t,i,n){for(var o in e)if(("_"!==o[0]||n&&-1!==n.indexOf(o))&&(!i||-1===i.indexOf(o))){var s=e[o],a=typeof s;if("function"!==a)try{if("object"===a)if(s instanceof Array){if(t[o]=[],s.length>0)if("object"==typeof s[0])for(var c=0;c0,o.REFLECTIONOVERALPHA=this._useReflectionOverAlpha,o.INVERTCUBICMAP=this._reflectionTexture.coordinatesMode===p.a.INVCUBIC_MODE,o.REFLECTIONMAP_3D=this._reflectionTexture.isCube,this._reflectionTexture.coordinatesMode){case p.a.EXPLICIT_MODE:o.setReflectionMode("REFLECTIONMAP_EXPLICIT");break;case p.a.PLANAR_MODE:o.setReflectionMode("REFLECTIONMAP_PLANAR");break;case p.a.PROJECTION_MODE:o.setReflectionMode("REFLECTIONMAP_PROJECTION");break;case p.a.SKYBOX_MODE:o.setReflectionMode("REFLECTIONMAP_SKYBOX"),o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!this._reflectionTexture.getReflectionTextureMatrix().isIdentity();break;case p.a.SPHERICAL_MODE:o.setReflectionMode("REFLECTIONMAP_SPHERICAL");break;case p.a.EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR");break;case p.a.FIXED_EQUIRECTANGULAR_MODE:o.setReflectionMode("REFLECTIONMAP_EQUIRECTANGULAR_FIXED");break;case p.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.setReflectionMode("REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED");break;case p.a.CUBIC_MODE:case p.a.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.a.PrepareDefinesForMergedUV(this._emissiveTexture,o,"EMISSIVE")}else o.EMISSIVE=!1;if(this._lightmapTexture&&t.LightmapTextureEnabled){if(!this._lightmapTexture.isReadyOrNotBlocking())return!1;f.a.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.a.PrepareDefinesForMergedUV(this._specularTexture,o,"SPECULAR"),o.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha}else o.SPECULAR=!1;if(n.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&t.BumpTextureEnabled){if(!this._bumpTexture.isReady())return!1;f.a.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===x.a.ALPHA_PREMULTIPLIED||this.alphaMode===x.a.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.a.PrepareDefinesForMisc(e,n,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),f.a.PrepareDefinesForAttributes(e,o,!0,!0,!0),f.a.PrepareDefinesForFrameBoundValues(n,s,o,r),o.isDirty){o.markAsProcessed();var a=new u.c;o.REFLECTION&&a.addFallback(0,"REFLECTION"),o.SPECULAR&&a.addFallback(0,"SPECULAR"),o.BUMP&&a.addFallback(0,"BUMP"),o.PARALLAX&&a.addFallback(1,"PARALLAX"),o.PARALLAXOCCLUSION&&a.addFallback(0,"PARALLAXOCCLUSION"),o.SPECULAROVERALPHA&&a.addFallback(0,"SPECULAROVERALPHA"),o.FOG&&a.addFallback(1,"FOG"),o.POINTSIZE&&a.addFallback(0,"POINTSIZE"),o.LOGARITHMICDEPTH&&a.addFallback(0,"LOGARITHMICDEPTH"),f.a.HandleFallbacksForShadows(o,a,this._maxSimultaneousLights),o.SPECULARTERM&&a.addFallback(0,"SPECULARTERM"),o.DIFFUSEFRESNEL&&a.addFallback(1,"DIFFUSEFRESNEL"),o.OPACITYFRESNEL&&a.addFallback(2,"OPACITYFRESNEL"),o.REFLECTIONFRESNEL&&a.addFallback(3,"REFLECTIONFRESNEL"),o.EMISSIVEFRESNEL&&a.addFallback(4,"EMISSIVEFRESNEL"),o.FRESNEL&&a.addFallback(4,"FRESNEL");var h=[c.b.PositionKind];o.NORMAL&&h.push(c.b.NormalKind),o.UV1&&h.push(c.b.UVKind),o.UV2&&h.push(c.b.UV2Kind),o.VERTEXCOLOR&&h.push(c.b.ColorKind),f.a.PrepareAttributesForBones(h,e,o,a),f.a.PrepareAttributesForInstances(h,o),f.a.PrepareAttributesForMorphTargets(h,e,o);var d="default",_=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","diffuseMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vReflectionPosition","vReflectionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureWidth"],m=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler"],g=["Material","Scene"];l.a&&(l.a.PrepareUniforms(_,o),l.a.PrepareSamplers(m,o)),f.a.PrepareUniformsAndSamplersList({uniformsNames:_,uniformBuffersNames:g,samplers:m,defines:o,maxSimultaneousLights:this._maxSimultaneousLights}),this.customShaderNameResolve&&(d=this.customShaderNameResolve(d,_,g,m,o));var v=o.toString(),y=i.effect,b=n.getEngine().createEffect(d,{attributes:h,uniformsNames:_,uniformBuffersNames:g,samplers:m,defines:v,fallbacks:a,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:o.NUM_MORPH_INFLUENCERS}},s);b&&(this.allowShaderHotSwapping&&y&&!b.isReady()?(b=y,o.markAsUnprocessed()):(n.resetCachedMaterial(),i.setEffect(b,o),this.buildUniformLayout()))}return!(!i.effect||!i.effect.isReady())&&(o._renderId=n.getRenderId(),this._wasPreviouslyReady=!0,!0)},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("diffuseLeftColor",4),this._uniformBuffer.addUniform("diffuseRightColor",4),this._uniformBuffer.addUniform("opacityParts",4),this._uniformBuffer.addUniform("reflectionLeftColor",4),this._uniformBuffer.addUniform("reflectionRightColor",4),this._uniformBuffer.addUniform("refractionLeftColor",4),this._uniformBuffer.addUniform("refractionRightColor",4),this._uniformBuffer.addUniform("emissiveLeftColor",4),this._uniformBuffer.addUniform("emissiveRightColor",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vAmbientInfos",2),this._uniformBuffer.addUniform("vOpacityInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("vReflectionPosition",3),this._uniformBuffer.addUniform("vReflectionSize",3),this._uniformBuffer.addUniform("vEmissiveInfos",2),this._uniformBuffer.addUniform("vLightmapInfos",2),this._uniformBuffer.addUniform("vSpecularInfos",2),this._uniformBuffer.addUniform("vBumpInfos",3),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("ambientMatrix",16),this._uniformBuffer.addUniform("opacityMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("emissiveMatrix",16),this._uniformBuffer.addUniform("lightmapMatrix",16),this._uniformBuffer.addUniform("specularMatrix",16),this._uniformBuffer.addUniform("bumpMatrix",16),this._uniformBuffer.addUniform("vTangentSpaceParams",2),this._uniformBuffer.addUniform("refractionMatrix",16),this._uniformBuffer.addUniform("vRefractionInfos",4),this._uniformBuffer.addUniform("vSpecularColor",4),this._uniformBuffer.addUniform("vEmissiveColor",3),this._uniformBuffer.addUniform("vDiffuseColor",4),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.create()},t.prototype.unbind=function(){if(this._activeEffect){var t=!1;this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&(this._activeEffect.setTexture("reflection2DSampler",null),t=!0),this._refractionTexture&&this._refractionTexture.isRenderTarget&&(this._activeEffect.setTexture("refraction2DSampler",null),t=!0),t&&this._markAllSubMeshesAsTexturesDirty()}e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,i,r){var n=this.getScene(),o=r._materialDefines;if(o){var c=r.effect;if(c){this._activeEffect=c,this.bindOnlyWorldMatrix(e),o.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var l=this._mustRebind(n,c,i.visibility);if(f.a.BindBonesParameters(i,c),l){if(this._uniformBuffer.bindToEffect(c,"Material"),this.bindViewProjection(c),!this._uniformBuffer.useUbo||!this.isFrozen||!this._uniformBuffer.isSync){if(t.FresnelEnabled&&o.FRESNEL&&(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),this._uniformBuffer.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled&&this._uniformBuffer.updateColor4("opacityParts",new a.e(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),this.opacityFresnelParameters.power),this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),this._uniformBuffer.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),this._uniformBuffer.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(this._uniformBuffer.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),this._uniformBuffer.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))),n.texturesEnabled){if(this._diffuseTexture&&t.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),f.a.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse"),this._diffuseTexture.hasAlpha&&c.setFloat("alphaCutOff",this.alphaCutOff)),this._ambientTexture&&t.AmbientTextureEnabled&&(this._uniformBuffer.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),f.a.BindTextureMatrix(this._ambientTexture,this._uniformBuffer,"ambient")),this._opacityTexture&&t.OpacityTextureEnabled&&(this._uniformBuffer.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),f.a.BindTextureMatrix(this._opacityTexture,this._uniformBuffer,"opacity")),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._uniformBuffer.updateFloat2("vReflectionInfos",this._reflectionTexture.level,this.roughness),this._uniformBuffer.updateMatrix("reflectionMatrix",this._reflectionTexture.getReflectionTextureMatrix()),this._reflectionTexture.boundingBoxSize)){var u=this._reflectionTexture;this._uniformBuffer.updateVector3("vReflectionPosition",u.boundingBoxPosition),this._uniformBuffer.updateVector3("vReflectionSize",u.boundingBoxSize)}if(this._emissiveTexture&&t.EmissiveTextureEnabled&&(this._uniformBuffer.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),f.a.BindTextureMatrix(this._emissiveTexture,this._uniformBuffer,"emissive")),this._lightmapTexture&&t.LightmapTextureEnabled&&(this._uniformBuffer.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),f.a.BindTextureMatrix(this._lightmapTexture,this._uniformBuffer,"lightmap")),this._specularTexture&&t.SpecularTextureEnabled&&(this._uniformBuffer.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),f.a.BindTextureMatrix(this._specularTexture,this._uniformBuffer,"specular")),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&(this._uniformBuffer.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),f.a.BindTextureMatrix(this._bumpTexture,this._uniformBuffer,"bump"),n._mirroredCameraPosition?this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&t.RefractionTextureEnabled){var h=1;this._refractionTexture.isCube||(this._uniformBuffer.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(h=this._refractionTexture.depth)),this._uniformBuffer.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,h,this.invertRefractionY?-1:1)}}this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),o.SPECULARTERM&&this._uniformBuffer.updateColor4("vSpecularColor",this.specularColor,this.specularPower),this._uniformBuffer.updateColor3("vEmissiveColor",t.EmissiveTextureEnabled?this.emissiveColor:a.e.BlackReadOnly),this._uniformBuffer.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha*i.visibility)}if(n.texturesEnabled&&(this._diffuseTexture&&t.DiffuseTextureEnabled&&c.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&t.AmbientTextureEnabled&&c.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&t.OpacityTextureEnabled&&c.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&t.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?c.setTexture("reflectionCubeSampler",this._reflectionTexture):c.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&t.EmissiveTextureEnabled&&c.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&t.LightmapTextureEnabled&&c.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&t.SpecularTextureEnabled&&c.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&t.BumpTextureEnabled&&c.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&t.RefractionTextureEnabled)){h=1;this._refractionTexture.isCube?c.setTexture("refractionCubeSampler",this._refractionTexture):c.setTexture("refraction2DSampler",this._refractionTexture)}f.a.BindClipPlane(c,n),n.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),f.a.BindEyePosition(c,n),c.setColor3("vAmbientColor",this._globalAmbientColor)}!l&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&f.a.BindLights(n,i,c,o,this._maxSimultaneousLights),(n.fogEnabled&&i.applyFog&&n.fogMode!==s.a.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture)&&this.bindView(c),f.a.BindFogParameters(n,i,c),o.NUM_MORPH_INFLUENCERS&&f.a.BindMorphTargetParameters(i,c),f.a.BindLogDepth(o,c,n),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(i,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,i){i&&(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,i)},t.prototype.clone=function(e){var i=this,r=n.a.Clone(function(){return new t(e,i.getScene())},this);return r.name=e,r.id=e,r},t.prototype.serialize=function(){return n.a.Serialize(this)},t.Parse=function(e,i,r){return n.a.Parse(function(){return new t(e.name,i)},e,i,r)},Object.defineProperty(t,"DiffuseTextureEnabled",{get:function(){return m.a.DiffuseTextureEnabled},set:function(e){m.a.DiffuseTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"AmbientTextureEnabled",{get:function(){return m.a.AmbientTextureEnabled},set:function(e){m.a.AmbientTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"OpacityTextureEnabled",{get:function(){return m.a.OpacityTextureEnabled},set:function(e){m.a.OpacityTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ReflectionTextureEnabled",{get:function(){return m.a.ReflectionTextureEnabled},set:function(e){m.a.ReflectionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"EmissiveTextureEnabled",{get:function(){return m.a.EmissiveTextureEnabled},set:function(e){m.a.EmissiveTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"SpecularTextureEnabled",{get:function(){return m.a.SpecularTextureEnabled},set:function(e){m.a.SpecularTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"BumpTextureEnabled",{get:function(){return m.a.BumpTextureEnabled},set:function(e){m.a.BumpTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"LightmapTextureEnabled",{get:function(){return m.a.LightmapTextureEnabled},set:function(e){m.a.LightmapTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"RefractionTextureEnabled",{get:function(){return m.a.RefractionTextureEnabled},set:function(e){m.a.RefractionTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"ColorGradingTextureEnabled",{get:function(){return m.a.ColorGradingTextureEnabled},set:function(e){m.a.ColorGradingTextureEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t,"FresnelEnabled",{get:function(){return m.a.FresnelEnabled},set:function(e){m.a.FresnelEnabled=e},enumerable:!0,configurable:!0}),r.c([Object(n.l)("diffuseTexture")],t.prototype,"_diffuseTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"diffuseTexture",void 0),r.c([Object(n.l)("ambientTexture")],t.prototype,"_ambientTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),r.c([Object(n.l)("opacityTexture")],t.prototype,"_opacityTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),r.c([Object(n.l)("reflectionTexture")],t.prototype,"_reflectionTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),r.c([Object(n.l)("emissiveTexture")],t.prototype,"_emissiveTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),r.c([Object(n.l)("specularTexture")],t.prototype,"_specularTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularTexture",void 0),r.c([Object(n.l)("bumpTexture")],t.prototype,"_bumpTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),r.c([Object(n.l)("lightmapTexture")],t.prototype,"_lightmapTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"lightmapTexture",void 0),r.c([Object(n.l)("refractionTexture")],t.prototype,"_refractionTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),r.c([Object(n.e)("ambient")],t.prototype,"ambientColor",void 0),r.c([Object(n.e)("diffuse")],t.prototype,"diffuseColor",void 0),r.c([Object(n.e)("specular")],t.prototype,"specularColor",void 0),r.c([Object(n.e)("emissive")],t.prototype,"emissiveColor",void 0),r.c([Object(n.c)()],t.prototype,"specularPower",void 0),r.c([Object(n.c)("useAlphaFromDiffuseTexture")],t.prototype,"_useAlphaFromDiffuseTexture",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFromDiffuseTexture",void 0),r.c([Object(n.c)("useEmissiveAsIllumination")],t.prototype,"_useEmissiveAsIllumination",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useEmissiveAsIllumination",void 0),r.c([Object(n.c)("linkEmissiveWithDiffuse")],t.prototype,"_linkEmissiveWithDiffuse",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkEmissiveWithDiffuse",void 0),r.c([Object(n.c)("useSpecularOverAlpha")],t.prototype,"_useSpecularOverAlpha",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),r.c([Object(n.c)("useReflectionOverAlpha")],t.prototype,"_useReflectionOverAlpha",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useReflectionOverAlpha",void 0),r.c([Object(n.c)("disableLighting")],t.prototype,"_disableLighting",void 0),r.c([Object(n.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),r.c([Object(n.c)("useObjectSpaceNormalMap")],t.prototype,"_useObjectSpaceNormalMap",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),r.c([Object(n.c)("useParallax")],t.prototype,"_useParallax",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),r.c([Object(n.c)("useParallaxOcclusion")],t.prototype,"_useParallaxOcclusion",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),r.c([Object(n.c)()],t.prototype,"parallaxScaleBias",void 0),r.c([Object(n.c)("roughness")],t.prototype,"_roughness",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),r.c([Object(n.c)()],t.prototype,"indexOfRefraction",void 0),r.c([Object(n.c)()],t.prototype,"invertRefractionY",void 0),r.c([Object(n.c)()],t.prototype,"alphaCutOff",void 0),r.c([Object(n.c)("useLightmapAsShadowmap")],t.prototype,"_useLightmapAsShadowmap",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),r.c([Object(n.h)("diffuseFresnelParameters")],t.prototype,"_diffuseFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"diffuseFresnelParameters",void 0),r.c([Object(n.h)("opacityFresnelParameters")],t.prototype,"_opacityFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelAndMiscDirty")],t.prototype,"opacityFresnelParameters",void 0),r.c([Object(n.h)("reflectionFresnelParameters")],t.prototype,"_reflectionFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"reflectionFresnelParameters",void 0),r.c([Object(n.h)("refractionFresnelParameters")],t.prototype,"_refractionFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"refractionFresnelParameters",void 0),r.c([Object(n.h)("emissiveFresnelParameters")],t.prototype,"_emissiveFresnelParameters",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"emissiveFresnelParameters",void 0),r.c([Object(n.c)("useReflectionFresnelFromSpecular")],t.prototype,"_useReflectionFresnelFromSpecular",void 0),r.c([Object(n.b)("_markAllSubMeshesAsFresnelDirty")],t.prototype,"useReflectionFresnelFromSpecular",void 0),r.c([Object(n.c)("useGlossinessFromSpecularMapAlpha")],t.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useGlossinessFromSpecularMapAlpha",void 0),r.c([Object(n.c)("maxSimultaneousLights")],t.prototype,"_maxSimultaneousLights",void 0),r.c([Object(n.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),r.c([Object(n.c)("invertNormalMapX")],t.prototype,"_invertNormalMapX",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),r.c([Object(n.c)("invertNormalMapY")],t.prototype,"_invertNormalMapY",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),r.c([Object(n.c)("twoSidedLighting")],t.prototype,"_twoSidedLighting",void 0),r.c([Object(n.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),r.c([Object(n.c)()],t.prototype,"useLogarithmicDepth",null),t}(d.a);_.a.RegisteredTypes["BABYLON.StandardMaterial"]=P,s.a.DefaultMaterialFactory=function(e){return new P("default material",e)}},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.BuildArray=function(e,t){for(var i=[],r=0;r0&&(t.push(a-1),t.push(a)),a++}var d=new o.a;return d.indices=t,d.positions=i,n&&(d.colors=s),d},o.a.CreateDashedLines=function(e){var t,i,n=e.dashSize||3,s=e.gapSize||1,a=e.dashNb||200,c=e.points,l=new Array,u=new Array,h=r.x.Zero(),d=0,f=0,p=0,_=0,m=0;for(m=0;m0&&-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,i){void 0===i&&(i=!1),this._shadowGenerator&&(this._shadowGenerator.dispose(),this._shadowGenerator=null),this.getScene().stopAnimation(this);for(var r=0,n=this.getScene().meshes;r0&&(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)})),n.a.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e},t.GetConstructorFromName=function(e,t,i){var r=s.a.Construct("Light_Type_"+e,t,i);return r||null},t.Parse=function(e,i){var r=t.GetConstructorFromName(e.type,e.name,i);if(!r)return null;var o=n.a.Parse(r,e,i);if(e.excludedMeshesIds&&(o._excludedMeshesIds=e.excludedMeshesIds),e.includedOnlyMeshesIds&&(o._includedOnlyMeshesIds=e.includedOnlyMeshesIds),e.parentId&&(o._waitingParentId=e.parentId),e.animations){for(var a=0;al.x)return!1}else if(n=1/this.direction.x,o=(c.x-this.origin.x)*n,(s=(l.x-this.origin.x)*n)===-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(n=1/this.direction.y,o=(c.y-this.origin.y)*n,(s=(l.y-this.origin.y)*n)===-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(n=1/this.direction.z,o=(c.z-this.origin.z)*n,(s=(l.z-this.origin.z)*n)===-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 i=e.center.x-this.origin.x,r=e.center.y-this.origin.y,n=e.center.z-this.origin.z,o=i*i+r*r+n*n,s=e.radius+t,a=s*s;if(o<=a)return!0;var c=i*this.direction.x+r*this.direction.y+n*this.direction.z;return!(c<0)&&o-c*c<=a},e.prototype.intersectsTriangle=function(t,i,r){var o=e.TmpVector3[0],a=e.TmpVector3[1],c=e.TmpVector3[2],l=e.TmpVector3[3],u=e.TmpVector3[4];i.subtractToRef(t,o),r.subtractToRef(t,a),n.x.CrossToRef(this.direction,a,c);var h=n.x.Dot(o,c);if(0===h)return null;var d=1/h;this.origin.subtractToRef(t,l);var f=n.x.Dot(l,c)*d;if(f<0||f>1)return null;n.x.CrossToRef(l,o,u);var p=n.x.Dot(this.direction,u)*d;if(p<0||f+p>1)return null;var _=n.x.Dot(a,u)*d;return _>this.length?null:new s.a(f,p,_)},e.prototype.intersectsPlane=function(e){var t,i=n.x.Dot(e.normal,this.direction);if(Math.abs(i)<9.99999997475243e-7)return null;var r=n.x.Dot(e.normal,this.origin);return(t=(-e.d-r)/i)<0?t<-9.99999997475243e-7?null:0:t},e.prototype.intersectsMesh=function(t,i){var r=n.t.Matrix[0];return t.getWorldMatrix().invertToRef(r),this._tmpRay?e.TransformToRef(this,r,this._tmpRay):this._tmpRay=e.Transform(this,r),t.intersects(this._tmpRay,i)},e.prototype.intersectsMeshes=function(e,t,i){i?i.length=0:i=[];for(var r=0;rt.distance?1:0},e.prototype.intersectionSegment=function(t,i,r){var o=this.origin,s=n.t.Vector3[0],a=n.t.Vector3[1],c=n.t.Vector3[2],l=n.t.Vector3[3];i.subtractToRef(t,s),this.direction.scaleToRef(e.rayl,c),o.addToRef(c,a),t.subtractToRef(o,l);var u,h,d,f,p=n.x.Dot(s,s),_=n.x.Dot(s,c),m=n.x.Dot(c,c),g=n.x.Dot(s,l),v=n.x.Dot(c,l),y=p*m-_*_,b=y,T=y;yb&&(h=b,f=v+_,T=m)),f<0?(f=0,-g<0?h=0:-g>p?h=b:(h=-g,b=p)):f>T&&(f=T,-g+_<0?h=0:-g+_>p?h=b:(h=-g+_,b=p)),u=Math.abs(h)0&&d<=this.length&&A.lengthSquared()=r.distance))&&(r=c,i)))break}return r||new o.a},a.a.prototype._internalMultiPick=function(e,t){if(!o.a)return null;for(var i=new Array,r=0;r0)):!i._pointerCaptures[c.pointerId]&&s.distance>a.distance&&(i.mainSceneTrackerPredicate&&i.mainSceneTrackerPredicate(a.pickedMesh)?(i._notifyObservers(t,a,c),t.skipOnPointerObservable=!0):i._lastPointerEvents[c.pointerId]&&(i.onPointerOutObservable.notifyObservers(c.pointerId),delete i._lastPointerEvents[c.pointerId])),t.type===o.a.POINTERUP&&i._pointerCaptures[c.pointerId]&&(i._pointerCaptures[c.pointerId]=!1))}}}})),this.utilityLayerScene.autoClear=!1,this._afterRenderObserver=this.originalScene.onAfterRenderObservable.add(function(){i.shouldRender&&i.render()}),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add(function(){i.dispose()}),this._updateCamera()}return Object.defineProperty(e,"DefaultUtilityLayer",{get:function(){return null==e._DefaultUtilityLayer&&(e._DefaultUtilityLayer=new e(s.a.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.a.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,i){e.skipOnPointerObservable||(this.utilityLayerScene.onPointerObservable.notifyObservers(new o.b(e.type,e.event,t)),this._lastPointerEvents[i.pointerId]=!0)},e.prototype.render=function(){if(this._updateCamera(),this.utilityLayerScene.activeCamera){var e=this.utilityLayerScene.activeCamera.getScene(),t=this.utilityLayerScene.activeCamera;t._scene=this.utilityLayerScene,t.leftCamera&&(t.leftCamera._scene=this.utilityLayerScene),t.rightCamera&&(t.rightCamera._scene=this.utilityLayerScene),this.utilityLayerScene.render(!1),t._scene=e,t.leftCamera&&(t.leftCamera._scene=e),t.rightCamera&&(t.rightCamera._scene=e)}},e.prototype.dispose=function(){this.onPointerOutObservable.clear(),this._afterRenderObserver&&this.originalScene.onAfterRenderObservable.remove(this._afterRenderObserver),this._sceneDisposeObserver&&this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver),this._originalPointerObserver&&this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver),this.utilityLayerScene.dispose()},e.prototype._updateCamera=function(){this.originalScene.activeCameras.length>1?this.utilityLayerScene.activeCamera=this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:this.utilityLayerScene.activeCamera=this.originalScene.activeCamera},e._DefaultUtilityLayer=null,e._DefaultKeepDepthUtilityLayer=null,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return d});var r=i(34),n=i(0),o=i(3),s=i(73),a=i(76),c={min:0,max:0},l={min:0,max:0},u=function(e,t,i){var r=n.x.Dot(t.centerWorld,e),o=Math.abs(n.x.Dot(t.directions[0],e))*t.extendSize.x+Math.abs(n.x.Dot(t.directions[1],e))*t.extendSize.y+Math.abs(n.x.Dot(t.directions[2],e))*t.extendSize.z;i.min=r-o,i.max=r+o},h=function(e,t,i){return u(e,t,c),u(e,i,l),!(c.min>l.max||l.min>c.max)},d=function(){function e(e,t,i){this._isLocked=!1,this.boundingBox=new s.a(e,t,i),this.boundingSphere=new a.a(e,t,i)}return e.prototype.reConstruct=function(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)},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,i){var r=e.TmpVector3[0].copyFrom(t).subtractInPlace(i),n=e.TmpVector3[1].copyFrom(t).addInPlace(i);return this.boundingBox.reConstruct(r,n,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(r,n,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.a.MESHES_CULLINGSTRATEGY_STANDARD),!(t!==o.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION&&t!==o.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY||!this.boundingSphere.isCenterInFrustum(e))||!!this.boundingSphere.isInFrustum(e)&&(!(t!==o.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY&&t!==o.a.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.a.Intersects(this.boundingSphere,e.boundingSphere))return!1;if(!s.a.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;var i=this.boundingBox,r=e.boundingBox;return!!h(i.directions[0],i,r)&&(!!h(i.directions[1],i,r)&&(!!h(i.directions[2],i,r)&&(!!h(r.directions[0],i,r)&&(!!h(r.directions[1],i,r)&&(!!h(r.directions[2],i,r)&&(!!h(n.x.Cross(i.directions[0],r.directions[0]),i,r)&&(!!h(n.x.Cross(i.directions[0],r.directions[1]),i,r)&&(!!h(n.x.Cross(i.directions[0],r.directions[2]),i,r)&&(!!h(n.x.Cross(i.directions[1],r.directions[0]),i,r)&&(!!h(n.x.Cross(i.directions[1],r.directions[1]),i,r)&&(!!h(n.x.Cross(i.directions[1],r.directions[2]),i,r)&&(!!h(n.x.Cross(i.directions[2],r.directions[0]),i,r)&&(!!h(n.x.Cross(i.directions[2],r.directions[1]),i,r)&&!!h(n.x.Cross(i.directions[2],r.directions[2]),i,r))))))))))))))},e.TmpVector3=r.a.BuildArray(2,n.x.Zero),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(0),n=function(){function e(){}return e._RemoveAndStorePivotPoint=function(t){t&&0===e._PivotCached&&(t.getPivotPointToRef(e._OldPivotPoint),e._OldPivotPoint.equalsToFloats(0,0,0)||(t.setPivotMatrix(r.j.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 r.x,e._PivotTranslation=new r.x,e._PivotTmpVector=new r.x,e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(38),n=function(){function e(){}return Object.defineProperty(e,"Now",{get:function(){return r.a.IsWindowObjectExist()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!0,configurable:!0}),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=i(10),o=i(41),s=function(){function e(e){void 0===e&&(e=o.a.DefaultUtilityLayer);var t=this;this.gizmoLayer=e,this.scaleRatio=1,this._tmpMatrix=new r.j,this._customMeshSet=!1,this.updateGizmoRotationToMatchAttachedMesh=!0,this.updateGizmoPositionToMatchAttachedMesh=!0,this._updateScale=!0,this._interactionsEnabled=!0,this._tempVector=new r.x,this._rootMesh=new n.a("gizmoRootNode",e.utilityLayerScene),this._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function(){t._update()}),this.attachedMesh=null}return Object.defineProperty(e.prototype,"attachedMesh",{get:function(){return this._attachedMesh},set:function(e){this._attachedMesh=e,this._rootMesh.setEnabled(!!e),this._attachedMeshChanged(e)},enumerable:!0,configurable:!0}),e.prototype.setCustomMesh=function(e){if(e.getScene()!=this.gizmoLayer.utilityLayerScene)throw"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";this._rootMesh.getChildMeshes().forEach(function(e){e.dispose()}),e.parent=this._rootMesh,this._customMeshSet=!0},e.prototype._attachedMeshChanged=function(e){},e.prototype._update=function(){if(this.attachedMesh&&(this.updateGizmoRotationToMatchAttachedMesh?(this._rootMesh.rotationQuaternion||(this._rootMesh.rotationQuaternion=r.q.RotationYawPitchRoll(this._rootMesh.rotation.y,this._rootMesh.rotation.x,this._rootMesh.rotation.z)),this._tempVector.copyFrom(this.attachedMesh.scaling),this.attachedMesh.scaling.x<0&&(this.attachedMesh.scaling.x*=-1),this.attachedMesh.scaling.y<0&&(this.attachedMesh.scaling.y*=-1),this.attachedMesh.scaling.z<0&&(this.attachedMesh.scaling.z*=-1),this.attachedMesh.computeWorldMatrix().getRotationMatrixToRef(this._tmpMatrix),this.attachedMesh.scaling.copyFrom(this._tempVector),this.attachedMesh.computeWorldMatrix(),r.q.FromRotationMatrixToRef(this._tmpMatrix,this._rootMesh.rotationQuaternion)):this._rootMesh.rotationQuaternion&&this._rootMesh.rotationQuaternion.set(0,0,0,1),this.updateGizmoPositionToMatchAttachedMesh&&this._rootMesh.position.copyFrom(this.attachedMesh.absolutePosition),this._updateScale&&this.gizmoLayer.utilityLayerScene.activeCamera&&this.attachedMesh)){var e=this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition;this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition&&(e=this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition),this._rootMesh.position.subtractToRef(e,this._tempVector);var t=this._tempVector.length()*this.scaleRatio;this._rootMesh.scaling.set(t,t,t)}},e.prototype.dispose=function(){this._rootMesh.dispose(),this._beforeRenderObserver&&this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return h});var r=i(1),n=i(2),o=i(7),s=i(9),a=i(69),c=i(0),l=i(23),u=i(3),h=function(){function e(t){this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this.getAlphaFromRGB=!1,this.level=1,this.coordinatesIndex=0,this._coordinatesMode=u.a.TEXTURE_EXPLICIT_MODE,this.wrapU=u.a.TEXTURE_WRAP_ADDRESSMODE,this.wrapV=u.a.TEXTURE_WRAP_ADDRESSMODE,this.wrapR=u.a.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.c,this.delayLoadState=u.a.DELAYLOADSTATE_NONE,this._cachedSize=c.r.Zero(),this._scene=t||l.a.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this)),this._uid=null}return Object.defineProperty(e.prototype,"hasAlpha",{get:function(){return this._hasAlpha},set:function(e){this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(u.a.MATERIAL_TextureDirtyFlag|u.a.MATERIAL_MiscDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"coordinatesMode",{get:function(){return this._coordinatesMode},set:function(e){this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(u.a.MATERIAL_TextureDirtyFlag))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCube",{get:function(){return!!this._texture&&this._texture.isCube},set:function(e){this._texture&&(this._texture.isCube=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is3D",{get:function(){return!!this._texture&&this._texture.is3D},set:function(e){this._texture&&(this._texture.is3D=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRGBD",{get:function(){return null!=this._texture&&this._texture._isRGBD},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noMipmap",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lodGenerationOffset",{get:function(){return this._texture?this._texture._lodGenerationOffset:0},set:function(e){this._texture&&(this._texture._lodGenerationOffset=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lodGenerationScale",{get:function(){return this._texture?this._texture._lodGenerationScale:0},set:function(e){this._texture&&(this._texture._lodGenerationScale=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uid",{get:function(){return this._uid||(this._uid=s.h.RandomId()),this._uid},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.name},e.prototype.getClassName=function(){return"BaseTexture"},Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isBlocking",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.getScene=function(){return this._scene},e.prototype.getTextureMatrix=function(){return c.j.IdentityReadOnly},e.prototype.getReflectionTextureMatrix=function(){return c.j.IdentityReadOnly},e.prototype.getInternalTexture=function(){return this._texture},e.prototype.isReadyOrNotBlocking=function(){return!this.isBlocking||this.isReady()},e.prototype.isReady=function(){return this.delayLoadState===u.a.DELAYLOADSTATE_NOTLOADED?(this.delayLoad(),!1):!!this._texture&&this._texture.isReady},e.prototype.getSize=function(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize},e.prototype.getBaseSize=function(){return this.isReady()&&this._texture?this._texture._size?new c.r(this._texture._size,this._texture._size):new c.r(this._texture.baseWidth,this._texture.baseHeight):c.r.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,i){if(!this._scene)return null;for(var r=this._scene.getEngine().getLoadedTexturesCache(),n=0;n=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=n.a.Serialize(this);return n.a.AppendSerializedAnimations(this,e),e},e.WhenAllReady=function(e,t){var i=e.length;if(0!==i)for(var r,n,o=function(){if((r=e[s]).isReady())0==--i&&t();else{n=r.onLoadObservable;var o=function(){n.removeCallback(o),0==--i&&t()};n.add(o)}},s=0;sa&&(a=u)}return new t(e,s,a-s+1,i,r,n,o)},t}(l)},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r=i(1),n=i(2),o=i(7),s=i(0),a=function(e){function t(i,r,n){void 0===r&&(r=null),void 0===n&&(n=!0);var a=e.call(this,i,r)||this;return a._forward=new s.x(0,0,1),a._forwardInverted=new s.x(0,0,-1),a._up=new s.x(0,1,0),a._right=new s.x(1,0,0),a._rightInverted=new s.x(-1,0,0),a._position=s.x.Zero(),a._rotation=s.x.Zero(),a._scaling=s.x.One(),a._isDirty=!1,a.billboardMode=t.BILLBOARDMODE_NONE,a.scalingDeterminant=1,a.infiniteDistance=!1,a.ignoreNonUniformScaling=!1,a._localMatrix=s.j.Zero(),a._absolutePosition=s.x.Zero(),a._pivotMatrix=s.j.Identity(),a._postMultiplyPivotMatrix=!1,a._isWorldMatrixFrozen=!1,a._indexInSceneTransformNodesArray=-1,a.onAfterWorldMatrixUpdateObservable=new o.c,a._nonUniformScaling=!1,n&&a.getScene().addTransformNode(a),a}return r.d(t,e),t.prototype.getClassName=function(){return"TransformNode"},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this._scaling},set:function(e){this._scaling=e,this._isDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._rotationQuaternion},set:function(e){this._rotationQuaternion=e,e&&this.rotation.setAll(0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"forward",{get:function(){return s.x.Normalize(s.x.TransformNormal(this.getScene().useRightHandedSystem?this._forwardInverted:this._forward,this.getWorldMatrix()))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"up",{get:function(){return s.x.Normalize(s.x.TransformNormal(this._up,this.getWorldMatrix()))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return s.x.Normalize(s.x.TransformNormal(this.getScene().useRightHandedSystem?this._rightInverted:this._right,this.getWorldMatrix()))},enumerable:!0,configurable:!0}),t.prototype.updatePoseMatrix=function(e){return this._poseMatrix.copyFrom(e),this},t.prototype.getPoseMatrix=function(){return this._poseMatrix},t.prototype._isSynchronized=function(){return!this._isDirty&&(this.billboardMode===this._cache.billboardMode&&this.billboardMode===t.BILLBOARDMODE_NONE&&(!this._cache.pivotMatrixUpdated&&(!this.infiniteDistance&&(!!this._cache.position.equals(this._position)&&(!(this._rotationQuaternion&&!this._cache.rotationQuaternion.equals(this._rotationQuaternion))&&(!!this._cache.rotation.equals(this._rotation)&&!!this._cache.scaling.equals(this._scaling)))))))},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.localMatrixUpdated=!1,this._cache.position=s.x.Zero(),this._cache.scaling=s.x.Zero(),this._cache.rotation=s.x.Zero(),this._cache.rotationQuaternion=new s.q(0,0,0,0),this._cache.billboardMode=-1,this._cache.infiniteDistance=!1},t.prototype.markAsDirty=function(e){return"rotation"===e&&(this.rotationQuaternion=null),this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this},Object.defineProperty(t.prototype,"absolutePosition",{get:function(){return this._absolutePosition},enumerable:!0,configurable:!0}),t.prototype.setPreTransformMatrix=function(e){return this.setPivotMatrix(e,!1)},t.prototype.setPivotMatrix=function(e,t){return void 0===t&&(t=!0),this._pivotMatrix.copyFrom(e),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=t,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=s.j.Invert(this._pivotMatrix)),this},t.prototype.getPivotMatrix=function(){return this._pivotMatrix},t.prototype.freezeWorldMatrix=function(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this._isWorldMatrixFrozen=!0,this},t.prototype.unfreezeWorldMatrix=function(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this},Object.defineProperty(t.prototype,"isWorldMatrixFrozen",{get:function(){return this._isWorldMatrixFrozen},enumerable:!0,configurable:!0}),t.prototype.getAbsolutePosition=function(){return this.computeWorldMatrix(),this._absolutePosition},t.prototype.setAbsolutePosition=function(e){if(!e)return this;var t,i,r;if(void 0===e.x){if(arguments.length<3)return this;t=arguments[0],i=arguments[1],r=arguments[2]}else t=e.x,i=e.y,r=e.z;if(this.parent){var n=s.t.Matrix[0];this.parent.getWorldMatrix().invertToRef(n),s.x.TransformCoordinatesFromFloatsToRef(t,i,r,n,this.position)}else this.position.x=t,this.position.y=i,this.position.z=r;return this},t.prototype.setPositionWithLocalVector=function(e){return this.computeWorldMatrix(),this.position=s.x.TransformNormal(e,this._localMatrix),this},t.prototype.getPositionExpressedInLocalSpace=function(){this.computeWorldMatrix();var e=s.t.Matrix[0];return this._localMatrix.invertToRef(e),s.x.TransformNormal(this.position,e)},t.prototype.locallyTranslate=function(e){return this.computeWorldMatrix(!0),this.position=s.x.TransformCoordinates(e,this._localMatrix),this},t.prototype.lookAt=function(e,i,r,n,o){void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===o&&(o=s.s.LOCAL);var a=t._lookAtVectorCache,c=o===s.s.LOCAL?this.position:this.getAbsolutePosition();if(e.subtractToRef(c,a),this.setDirection(a,i,r,n),o===s.s.WORLD&&this.parent)if(this.rotationQuaternion){var l=s.t.Matrix[0];this.rotationQuaternion.toRotationMatrix(l);var u=s.t.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(u),u.invert(),l.multiplyToRef(u,l),this.rotationQuaternion.fromRotationMatrix(l)}else{var h=s.t.Quaternion[0];s.q.FromEulerVectorToRef(this.rotation,h);l=s.t.Matrix[0];h.toRotationMatrix(l);u=s.t.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(u),u.invert(),l.multiplyToRef(u,l),h.fromRotationMatrix(l),h.toEulerAnglesToRef(this.rotation)}return this},t.prototype.getDirection=function(e){var t=s.x.Zero();return this.getDirectionToRef(e,t),t},t.prototype.getDirectionToRef=function(e,t){return s.x.TransformNormalToRef(e,this.getWorldMatrix(),t),this},t.prototype.setDirection=function(e,t,i,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=0);var n=-Math.atan2(e.z,e.x)+Math.PI/2,o=Math.sqrt(e.x*e.x+e.z*e.z),a=-Math.atan2(e.y,o);return this.rotationQuaternion?s.q.RotationYawPitchRollToRef(n+t,a+i,r,this.rotationQuaternion):(this.rotation.x=a+i,this.rotation.y=n+t,this.rotation.z=r),this},t.prototype.setPivotPoint=function(e,t){void 0===t&&(t=s.s.LOCAL),0==this.getScene().getRenderId()&&this.computeWorldMatrix(!0);var i=this.getWorldMatrix();if(t==s.s.WORLD){var r=s.t.Matrix[0];i.invertToRef(r),e=s.x.TransformCoordinates(e,r)}return this.setPivotMatrix(s.j.Translation(-e.x,-e.y,-e.z),!0)},t.prototype.getPivotPoint=function(){var e=s.x.Zero();return this.getPivotPointToRef(e),e},t.prototype.getPivotPointToRef=function(e){return e.x=-this._pivotMatrix.m[12],e.y=-this._pivotMatrix.m[13],e.z=-this._pivotMatrix.m[14],this},t.prototype.getAbsolutePivotPoint=function(){var e=s.x.Zero();return this.getAbsolutePivotPointToRef(e),e},t.prototype.getAbsolutePivotPointToRef=function(e){return e.x=this._pivotMatrix.m[12],e.y=this._pivotMatrix.m[13],e.z=this._pivotMatrix.m[14],this.getPivotPointToRef(e),s.x.TransformCoordinatesToRef(e,this.getWorldMatrix(),e),this},t.prototype.setParent=function(e){if(!e&&!this.parent)return this;var t=s.t.Quaternion[0],i=s.t.Vector3[0],r=s.t.Vector3[1];if(e){var n=s.t.Matrix[0],o=s.t.Matrix[1];this.computeWorldMatrix(!0),e.computeWorldMatrix(!0),e.getWorldMatrix().invertToRef(o),this.getWorldMatrix().multiplyToRef(o,n),n.decompose(r,t,i)}else this.parent&&this.parent.computeWorldMatrix&&this.parent.computeWorldMatrix(!0),this.computeWorldMatrix(!0),this.getWorldMatrix().decompose(r,t,i);return this.rotationQuaternion?this.rotationQuaternion.copyFrom(t):t.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(r),this.position.copyFrom(i),this.parent=e,this},Object.defineProperty(t.prototype,"nonUniformScaling",{get:function(){return this._nonUniformScaling},enumerable:!0,configurable:!0}),t.prototype._updateNonUniformScalingState=function(e){return this._nonUniformScaling!==e&&(this._nonUniformScaling=e,!0)},t.prototype.attachToBone=function(e,t){return this._transformToBoneReferal=t,this.parent=e,e.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this},t.prototype.detachFromBone=function(){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,this.parent=null,this):this},t.prototype.rotate=function(e,i,r){var n;if(e.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0)),r&&r!==s.s.LOCAL){if(this.parent){var o=s.t.Matrix[0];this.parent.getWorldMatrix().invertToRef(o),e=s.x.TransformNormal(e,o)}(n=s.q.RotationAxisToRef(e,i,t._rotationAxisCache)).multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}else n=s.q.RotationAxisToRef(e,i,t._rotationAxisCache),this.rotationQuaternion.multiplyToRef(n,this.rotationQuaternion);return this},t.prototype.rotateAround=function(e,t,i){t.normalize(),this.rotationQuaternion||(this.rotationQuaternion=s.q.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));var r=s.t.Vector3[0],n=s.t.Vector3[1],o=s.t.Vector3[2],a=s.t.Quaternion[0],c=s.t.Matrix[0],l=s.t.Matrix[1],u=s.t.Matrix[2],h=s.t.Matrix[3];return e.subtractToRef(this.position,r),s.j.TranslationToRef(r.x,r.y,r.z,c),s.j.TranslationToRef(-r.x,-r.y,-r.z,l),s.j.RotationAxisToRef(t,i,u),l.multiplyToRef(u,h),h.multiplyToRef(c,h),h.decompose(n,a,o),this.position.addInPlace(o),a.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this},t.prototype.translate=function(e,t,i){var r=e.scale(t);if(i&&i!==s.s.LOCAL)this.setAbsolutePosition(this.getAbsolutePosition().add(r));else{var n=this.getPositionExpressedInLocalSpace().add(r);this.setPositionWithLocalVector(n)}return this},t.prototype.addRotation=function(e,t,i){var r;this.rotationQuaternion?r=this.rotationQuaternion:(r=s.t.Quaternion[1],s.q.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,r));var n=s.t.Quaternion[0];return s.q.RotationYawPitchRollToRef(t,e,i,n),r.multiplyInPlace(n),this.rotationQuaternion||r.toEulerAnglesToRef(this.rotation),this},t.prototype.computeWorldMatrix=function(e){if(this._isWorldMatrixFrozen)return this._worldMatrix;if(!e&&this.isSynchronized())return this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix;(this._updateCache(),this._cache.position.copyFrom(this.position),this._cache.scaling.copyFrom(this.scaling),this._cache.pivotMatrixUpdated=!1,this._cache.billboardMode=this.billboardMode,this._cache.infiniteDistance=this.infiniteDistance,this._currentRenderId=this.getScene().getRenderId(),this._childRenderId=this.getScene().getRenderId(),this._isDirty=!1,s.j.ScalingToRef(this.scaling.x*this.scalingDeterminant,this.scaling.y*this.scalingDeterminant,this.scaling.z*this.scalingDeterminant,s.t.Matrix[1]),this.rotationQuaternion)&&(this.rotation.length()&&(this.rotationQuaternion.multiplyInPlace(s.q.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)),this.rotation.copyFromFloats(0,0,0)));this.rotationQuaternion?(this.rotationQuaternion.toRotationMatrix(s.t.Matrix[0]),this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)):(s.j.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,s.t.Matrix[0]),this._cache.rotation.copyFrom(this.rotation));var i=this.getScene().activeCamera;if(this.infiniteDistance&&!this.parent&&i){var r=i.getWorldMatrix(),n=new s.x(r.m[12],r.m[13],r.m[14]);s.j.TranslationToRef(this.position.x+n.x,this.position.y+n.y,this.position.z+n.z,s.t.Matrix[2])}else s.j.TranslationToRef(this.position.x,this.position.y,this.position.z,s.t.Matrix[2]);if(this._pivotMatrix.multiplyToRef(s.t.Matrix[1],s.t.Matrix[4]),s.t.Matrix[4].multiplyToRef(s.t.Matrix[0],s.t.Matrix[5]),this.billboardMode!==t.BILLBOARDMODE_NONE&&i){if((this.billboardMode&t.BILLBOARDMODE_ALL)!==t.BILLBOARDMODE_ALL){var o=s.t.Vector3[3];this.parent&&this.parent.getWorldMatrix?this._transformToBoneReferal?(this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.t.Matrix[6]),s.x.TransformCoordinatesToRef(this.position,s.t.Matrix[6],o)):s.x.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),o):o.copyFrom(this.position),o.subtractInPlace(i.globalPosition);var a=s.t.Vector3[4].copyFromFloats(0,0,0);(this.billboardMode&t.BILLBOARDMODE_X)===t.BILLBOARDMODE_X&&(a.x=Math.atan2(-o.y,o.z)),(this.billboardMode&t.BILLBOARDMODE_Y)===t.BILLBOARDMODE_Y&&(a.y=Math.atan2(o.x,o.z)),(this.billboardMode&t.BILLBOARDMODE_Z)===t.BILLBOARDMODE_Z&&(a.z=Math.atan2(o.y,o.x)),s.j.RotationYawPitchRollToRef(a.y,a.x,a.z,s.t.Matrix[0])}else s.t.Matrix[1].copyFrom(i.getViewMatrix()),s.t.Matrix[1].setTranslationFromFloats(0,0,0),s.t.Matrix[1].invertToRef(s.t.Matrix[0]);s.t.Matrix[1].copyFrom(s.t.Matrix[5]),s.t.Matrix[1].multiplyToRef(s.t.Matrix[0],s.t.Matrix[5])}return this._postMultiplyPivotMatrix&&s.t.Matrix[5].multiplyToRef(this._pivotMatrixInverse,s.t.Matrix[5]),s.t.Matrix[5].multiplyToRef(s.t.Matrix[2],this._localMatrix),this.parent&&this.parent.getWorldMatrix?(this.billboardMode!==t.BILLBOARDMODE_NONE?(this._transformToBoneReferal?(this.parent.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),s.t.Matrix[6]),s.t.Matrix[5].copyFrom(s.t.Matrix[6])):s.t.Matrix[5].copyFrom(this.parent.getWorldMatrix()),this._localMatrix.getTranslationToRef(s.t.Vector3[5]),s.x.TransformCoordinatesToRef(s.t.Vector3[5],s.t.Matrix[5],s.t.Vector3[5]),this._worldMatrix.copyFrom(this._localMatrix),this._worldMatrix.setTranslation(s.t.Vector3[5])):this._transformToBoneReferal?(this._localMatrix.multiplyToRef(this.parent.getWorldMatrix(),s.t.Matrix[6]),s.t.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)):this._localMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()):this._worldMatrix.copyFrom(this._localMatrix),this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this.scaling.isNonUniform?this._updateNonUniformScalingState(!0):this.parent&&this.parent._nonUniformScaling?this._updateNonUniformScalingState(this.parent._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=s.j.Invert(this._worldMatrix)),this._worldMatrixDeterminant=this._worldMatrix.determinant(),this._worldMatrix},t.prototype._afterComputeWorldMatrix=function(){},t.prototype.registerAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.add(e),this},t.prototype.unregisterAfterWorldMatrixUpdate=function(e){return this.onAfterWorldMatrixUpdateObservable.removeCallback(e),this},t.prototype.getPositionInCameraSpace=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),s.x.TransformCoordinates(this.absolutePosition,e.getViewMatrix())},t.prototype.getDistanceToCamera=function(e){return void 0===e&&(e=null),e||(e=this.getScene().activeCamera),this.absolutePosition.subtract(e.position).length()},t.prototype.clone=function(e,i,r){var o=this,s=n.a.Clone(function(){return new t(e,o.getScene())},this);if(s.name=e,s.id=e,i&&(s.parent=i),!r)for(var a=this.getDescendants(!0),c=0;c1)throw"Multiple drag modes specified in dragBehavior options. Only one expected"}return Object.defineProperty(e.prototype,"name",{get:function(){return"PointerDrag"},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t){var i=this;this._scene=t.getScene(),this._attachedNode=t,e._planeScene||(this._debugMode?e._planeScene=this._scene:(e._planeScene=new n.a(this._scene.getEngine()),e._planeScene.detachControl(),this._scene.getEngine().scenes.pop(),this._scene.onDisposeObservable.addOnce(function(){e._planeScene.dispose(),e._planeScene=null}))),this._dragPlane=r.a.CreatePlane("pointerDragPlane",this._debugMode?1:1e4,e._planeScene,!1,r.a.DOUBLESIDE),this.lastDragPosition=new s.x(0,0,0);this._pointerObserver=this._scene.onPointerObservable.add(function(t,r){var n;if(i.enabled)if(t.type==a.a.POINTERDOWN)!i.dragging&&t.pickInfo&&t.pickInfo.hit&&t.pickInfo.pickedMesh&&t.pickInfo.pickedPoint&&t.pickInfo.ray&&(n=t.pickInfo.pickedMesh,i._attachedNode==n||n.isDescendantOf(i._attachedNode))&&i._startDrag(t.event.pointerId,t.pickInfo.ray,t.pickInfo.pickedPoint);else if(t.type==a.a.POINTERUP)i.currentDraggingPointerID==t.event.pointerId&&i.releaseDrag();else if(t.type==a.a.POINTERMOVE){var o=t.event.pointerId;i.currentDraggingPointerID===e._AnyMouseID&&o!==e._AnyMouseID&&"mouse"==t.event.pointerType&&(i._lastPointerRay[i.currentDraggingPointerID]&&(i._lastPointerRay[o]=i._lastPointerRay[i.currentDraggingPointerID],delete i._lastPointerRay[i.currentDraggingPointerID]),i.currentDraggingPointerID=o),i._lastPointerRay[o]||(i._lastPointerRay[o]=new c.a(new s.x,new s.x)),t.pickInfo&&t.pickInfo.ray&&(i._lastPointerRay[o].origin.copyFrom(t.pickInfo.ray.origin),i._lastPointerRay[o].direction.copyFrom(t.pickInfo.ray.direction),i.currentDraggingPointerID==o&&i.dragging&&i._moveDrag(t.pickInfo.ray))}}),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(function(){i._moving&&i.moveAttached&&(l.a._RemoveAndStorePivotPoint(i._attachedNode),i._targetPosition.subtractToRef(i._attachedNode.absolutePosition,i._tmpVector),i._tmpVector.scaleInPlace(i.dragDeltaRatio),i._attachedNode.getAbsolutePosition().addToRef(i._tmpVector,i._tmpVector),i.validateDrag(i._tmpVector)&&i._attachedNode.setAbsolutePosition(i._tmpVector),l.a._RestorePivotPoint(i._attachedNode))})},e.prototype.releaseDrag=function(){this.dragging=!1,this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerID}),this.currentDraggingPointerID=-1,this._moving=!1,this.detachCameraControls&&this._attachedElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera&&this._scene.activeCamera.attachControl(this._attachedElement,!0)},e.prototype.startDrag=function(t,i,r){void 0===t&&(t=e._AnyMouseID),this._startDrag(t,i,r);var n=this._lastPointerRay[t];t===e._AnyMouseID&&(n=this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]),n&&this._moveDrag(n)},e.prototype._startDrag=function(e,t,i){if(this._scene.activeCamera&&!this.dragging&&this._attachedNode){l.a._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,i||this._tmpVector);var r=this._pickWithRayOnDragPlane(this._startDragRay);r&&(this.dragging=!0,this.currentDraggingPointerID=e,this.lastDragPosition.copyFrom(r),this.onDragStartObservable.notifyObservers({dragPlanePoint:r,pointerId:this.currentDraggingPointerID}),this._targetPosition.copyFrom(this._attachedNode.absolutePosition),this.detachCameraControls&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera&&(this._scene.activeCamera.inputs.attachedElement?(this._attachedElement=this._scene.activeCamera.inputs.attachedElement,this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement)):this._attachedElement=null)),l.a._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 i=0;this._options.dragAxis?(s.x.TransformCoordinatesToRef(this._options.dragAxis,this._attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis),t.subtractToRef(this.lastDragPosition,this._tmpVector),i=s.x.Dot(this._tmpVector,this._worldDragAxis),this._worldDragAxis.scaleToRef(i,this._dragDelta)):(i=this._dragDelta.length(),t.subtractToRef(this.lastDragPosition,this._dragDelta)),this._targetPosition.addInPlace(this._dragDelta),this.onDragObservable.notifyObservers({dragDistance:i,delta:this._dragDelta,dragPlanePoint:t,dragPlaneNormal:this._dragPlane.forward,pointerId:this.currentDraggingPointerID}),this.lastDragPosition.copyFrom(t)}},e.prototype._pickWithRayOnDragPlane=function(t){var i=this;if(!t)return null;var r=Math.acos(s.x.Dot(this._dragPlane.forward,t.direction));if(r>Math.PI/2&&(r=Math.PI-r),this.maxDragAngle>0&&r>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.x.Dot(this._alternatePickedPoint,this._tmpVector)),this._tmpVector.addInPlace(this._alternatePickedPoint);var n=s.x.Dot(this._dragPlane.forward,this._tmpVector);return this._dragPlane.forward.scaleToRef(-n,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==i._dragPlane});return o&&o.hit&&o.pickedMesh&&o.pickedPoint?o.pickedPoint:null},e.prototype._updateDragPlanePosition=function(e,t){this._pointA.copyFrom(t),this._options.dragAxis?(this.useObjectOrienationForDragging?s.x.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.x.CrossToRef(this._lineA,this._lineB,this._lookAt),s.x.CrossToRef(this._lineA,this._lookAt,this._lookAt),this._lookAt.normalize(),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._lookAt,this._lookAt),this._dragPlane.lookAt(this._lookAt)):this._options.dragPlaneNormal?(this.useObjectOrienationForDragging?s.x.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)},e._AnyMouseID=-2,e}())},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(3),n=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return e._ForceFullSceneLoadingForIncremental},set:function(t){e._ForceFullSceneLoadingForIncremental=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return e._ShowLoadingScreen},set:function(t){e._ShowLoadingScreen=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return e._loggingLevel},set:function(t){e._loggingLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return e._CleanBoneMatrixWeights},set:function(t){e._CleanBoneMatrixWeights=t},enumerable:!0,configurable:!0}),e._ForceFullSceneLoadingForIncremental=!1,e._ShowLoadingScreen=!0,e._CleanBoneMatrixWeights=!1,e._loggingLevel=r.a.SCENELOADER_NO_LOGGING,e}()},function(e,t,i){"use strict";var r="helperFunctions",n="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);\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.0,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\nvec3 applyEaseInOut(vec3 x){\nreturn x*x*(3.0-2.0*x);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat 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=max(0.0000001,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}";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";i.d(t,"a",function(){return s});var r=i(0),n=i(10),o=i(13);o.a.CreateSphere=function(e){for(var t=e.segments||32,i=e.diameterX||e.diameter||1,n=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.a.DEFAULTSIDE,u=new r.x(i/2,n/2,s/2),h=2+t,d=2*h,f=[],p=[],_=[],m=[],g=0;g<=h;g++){for(var v=g/h,y=v*Math.PI*c,b=0;b<=d;b++){var T=b/d,E=T*Math.PI*2*a,x=r.j.RotationZ(-y),A=r.j.RotationY(E),P=r.x.TransformCoordinates(r.x.Up(),x),R=r.x.TransformCoordinates(P,A),S=R.multiply(u),C=R.divide(u).normalize();p.push(S.x,S.y,S.z),_.push(C.x,C.y,C.z),m.push(T,v)}if(g>0)for(var M=p.length/3,O=M-2*(d+1);O+d+20&&(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,i=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);i.setVerticesData(o.b.PositionKind,u,!1)}if(l.normalsAttrDesc&&l.normalsAttrDesc.count>0){var h=new Float32Array(t,l.normalsAttrDesc.offset,l.normalsAttrDesc.count);i.setVerticesData(o.b.NormalKind,h,!1)}if(l.tangetsAttrDesc&&l.tangetsAttrDesc.count>0){var d=new Float32Array(t,l.tangetsAttrDesc.offset,l.tangetsAttrDesc.count);i.setVerticesData(o.b.TangentKind,d,!1)}if(l.uvsAttrDesc&&l.uvsAttrDesc.count>0){var f=new Float32Array(t,l.uvsAttrDesc.offset,l.uvsAttrDesc.count);i.setVerticesData(o.b.UVKind,f,!1)}if(l.uvs2AttrDesc&&l.uvs2AttrDesc.count>0){var p=new Float32Array(t,l.uvs2AttrDesc.offset,l.uvs2AttrDesc.count);i.setVerticesData(o.b.UV2Kind,p,!1)}if(l.uvs3AttrDesc&&l.uvs3AttrDesc.count>0){var _=new Float32Array(t,l.uvs3AttrDesc.offset,l.uvs3AttrDesc.count);i.setVerticesData(o.b.UV3Kind,_,!1)}if(l.uvs4AttrDesc&&l.uvs4AttrDesc.count>0){var m=new Float32Array(t,l.uvs4AttrDesc.offset,l.uvs4AttrDesc.count);i.setVerticesData(o.b.UV4Kind,m,!1)}if(l.uvs5AttrDesc&&l.uvs5AttrDesc.count>0){var g=new Float32Array(t,l.uvs5AttrDesc.offset,l.uvs5AttrDesc.count);i.setVerticesData(o.b.UV5Kind,g,!1)}if(l.uvs6AttrDesc&&l.uvs6AttrDesc.count>0){var v=new Float32Array(t,l.uvs6AttrDesc.offset,l.uvs6AttrDesc.count);i.setVerticesData(o.b.UV6Kind,v,!1)}if(l.colorsAttrDesc&&l.colorsAttrDesc.count>0){var y=new Float32Array(t,l.colorsAttrDesc.offset,l.colorsAttrDesc.count);i.setVerticesData(o.b.ColorKind,y,!1,l.colorsAttrDesc.stride)}if(l.matricesIndicesAttrDesc&&l.matricesIndicesAttrDesc.count>0){for(var b=new Int32Array(t,l.matricesIndicesAttrDesc.offset,l.matricesIndicesAttrDesc.count),T=[],E=0;E>8),T.push((16711680&x)>>16),T.push(x>>24)}i.setVerticesData(o.b.MatricesIndicesKind,T,!1)}if(l.matricesWeightsAttrDesc&&l.matricesWeightsAttrDesc.count>0){var A=new Float32Array(t,l.matricesWeightsAttrDesc.offset,l.matricesWeightsAttrDesc.count);i.setVerticesData(o.b.MatricesWeightsKind,A,!1)}if(l.indicesAttrDesc&&l.indicesAttrDesc.count>0){var P=new Int32Array(t,l.indicesAttrDesc.offset,l.indicesAttrDesc.count);i.setIndices(P,null)}if(l.subMeshesAttrDesc&&l.subMeshesAttrDesc.count>0){var R=new Int32Array(t,l.subMeshesAttrDesc.offset,5*l.subMeshesAttrDesc.count);i.subMeshes=[];for(E=0;E>8),T.push((16711680&D)>>16),T.push(D>>24)}i.setVerticesData(o.b.MatricesIndicesKind,T,t.matricesIndices._updatable)}if(t.matricesIndicesExtra)if(t.matricesIndicesExtra._isExpanded)delete t.matricesIndices._isExpanded,i.setVerticesData(o.b.MatricesIndicesExtraKind,t.matricesIndicesExtra,t.matricesIndicesExtra._updatable);else{for(T=[],E=0;E>8),T.push((16711680&D)>>16),T.push(D>>24)}i.setVerticesData(o.b.MatricesIndicesExtraKind,T,t.matricesIndicesExtra._updatable)}t.matricesWeights&&(e._CleanMatricesWeights(t,i),i.setVerticesData(o.b.MatricesWeightsKind,t.matricesWeights,t.matricesWeights._updatable)),t.matricesWeightsExtra&&i.setVerticesData(o.b.MatricesWeightsExtraKind,t.matricesWeightsExtra,t.matricesWeights._updatable),i.setIndices(t.indices,null)}if(t.subMeshes){i.subMeshes=[];for(var w=0;w-1){var r=t.getScene().getLastSkeletonByID(e.skeletonId);if(r){i=r.bones.length;for(var n=t.getVerticesData(o.b.MatricesIndicesKind),s=t.getVerticesData(o.b.MatricesIndicesExtraKind),c=e.matricesWeights,l=e.matricesWeightsExtra,u=e.numBoneInfluencer,h=c.length,d=0;du-1)&&(p=u-1),f>.001){var g=1/f;for(_=0;_<4;_++)c[d+_]*=g;if(l)for(_=0;_<4;_++)l[d+_]*=g}else p>=4?(l[d+p-4]=1-f,s[d+p-4]=i):(c[d+p]=1-f,n[d+p]=i)}t.setVerticesData(o.b.MatricesIndicesKind,n),e.matricesWeightsExtra&&t.setVerticesData(o.b.MatricesIndicesExtraKind,s)}}}},e.Parse=function(t,i,s){if(i.getGeometryByID(t.id))return null;var a=new e(t.id,i,void 0,t.updatable);return h.a&&h.a.AddTagsTo(a,t.tags),t.delayLoadingFile?(a.delayLoadState=l.a.DELAYLOADSTATE_NOTLOADED,a.delayLoadingFile=s+t.delayLoadingFile,a._boundingInfo=new c.a(r.x.FromArray(t.boundingBoxMinimum),r.x.FromArray(t.boundingBoxMaximum)),a._delayInfo=[],t.hasUVs&&a._delayInfo.push(o.b.UVKind),t.hasUVs2&&a._delayInfo.push(o.b.UV2Kind),t.hasUVs3&&a._delayInfo.push(o.b.UV3Kind),t.hasUVs4&&a._delayInfo.push(o.b.UV4Kind),t.hasUVs5&&a._delayInfo.push(o.b.UV5Kind),t.hasUVs6&&a._delayInfo.push(o.b.UV6Kind),t.hasColors&&a._delayInfo.push(o.b.ColorKind),t.hasMatricesIndices&&a._delayInfo.push(o.b.MatricesIndicesKind),t.hasMatricesWeights&&a._delayInfo.push(o.b.MatricesWeightsKind),a._delayLoadingFunction=n.a.ImportVertexData):n.a.ImportVertexData(t,a),i.pushGeometry(a,!0),a},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return f});var r=i(1),n=i(7),o=i(0),s=i(48),a=i(62),c=i(35),l=i(52),u=i(45),h=i(41),d=i(33),f=function(e){function t(i,r,s){void 0===r&&(r=o.e.Gray()),void 0===s&&(s=h.a.DefaultUtilityLayer);var a=e.call(this,s)||this;a._pointerObserver=null,a.snapDistance=0,a.onSnapObservable=new n.c;var c=new d.a("",s.utilityLayerScene);c.disableLighting=!0,c.emissiveColor=r;var u=new d.a("",s.utilityLayerScene);u.disableLighting=!0,u.emissiveColor=r.add(new o.e(.3,.3,.3));var f=t._CreateArrow(s.utilityLayerScene,c);f.lookAt(a._rootMesh.position.add(i)),f.scaling.scaleInPlace(1/3),f.parent=a._rootMesh;var p=0,_=new o.x,m={snapDistance:0};a.dragBehavior=new l.a({dragAxis:i}),a.dragBehavior.moveAttached=!1,a._rootMesh.addBehavior(a.dragBehavior);var g=new o.x,v=new o.j;return a.dragBehavior.onDragObservable.add(function(e){if(a.attachedMesh)if(a.attachedMesh.parent?(a.attachedMesh.parent.computeWorldMatrix().invertToRef(v),v.setTranslationFromFloats(0,0,0),o.x.TransformCoordinatesToRef(e.delta,v,g)):g.copyFrom(e.delta),0==a.snapDistance)a.attachedMesh.position.addInPlace(g);else if(p+=e.dragDistance,Math.abs(p)>a.snapDistance){var t=Math.floor(Math.abs(p)/a.snapDistance);p%=a.snapDistance,g.normalizeToRef(_),_.scaleInPlace(a.snapDistance*t),a.attachedMesh.position.addInPlace(_),m.snapDistance=a.snapDistance*t,a.onSnapObservable.notifyObservers(m)}}),a._pointerObserver=s.utilityLayerScene.onPointerObservable.add(function(e){if(!a._customMeshSet){var t=e.pickInfo&&-1!=a._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?u:c;a._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),a}return r.d(t,e),t._CreateArrow=function(e,t){var i=new s.a("arrow",e),r=a.a.CreateCylinder("cylinder",{diameterTop:0,height:1.5,diameterBottom:.75,tessellation:96},e),n=c.a.CreateLines("line",{points:[new o.x(0,0,0),new o.x(0,1.1,0)]},e);return n.color=t.emissiveColor,r.parent=i,n.parent=i,r.scaling.scaleInPlace(.05),r.material=t,r.rotation.x=Math.PI/2,r.position.z+=.3,n.scaling.scaleInPlace(.26),n.rotation.x=Math.PI/2,n.material=t,i},t._CreateArrowInstance=function(e,t){for(var i=new s.a("arrow",e),r=0,n=t.getChildMeshes();r1)?1:e.arc||1,d=0===e.sideOrientation?0:e.sideOrientation||o.a.DEFAULTSIDE,f=e.faceUV||new Array(3),p=e.faceColors,_=2+(1+(1!==h&&u?2:0))*(l?c:1);for(t=0;t<_;t++)p&&void 0===p[t]&&(p[t]=new r.f(1,1,1,1));for(t=0;t<_;t++)f&&void 0===f[t]&&(f[t]=new r.y(0,0,1,1));var m,g,v,y,b,T,E=new Array,x=new Array,A=new Array,P=new Array,R=new Array,S=2*Math.PI*h/a,C=(s-n)/2/i,M=r.x.Zero(),O=r.x.Zero(),I=r.x.Zero(),D=r.x.Zero(),w=r.x.Zero(),L=r.c.Y,F=1,N=1,B=0,U=0;for(y=0;y<=c;y++)for(v=((g=y/c)*(n-s)+s)/2,F=l&&0!==y&&y!==c?2:1,T=0;T=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,i){for(var r=0;r=0&&n.multiMaterials.splice(o,1),e.prototype.dispose.call(this,t,i)}},t.ParseMultiMaterial=function(e,i){var r=new t(e.name,i);r.id=e.id,o.a&&o.a.AddTagsTo(r,e.tags);for(var n=0;n4&&(o.push(s.b.MatricesIndicesExtraKind),o.push(s.b.MatricesWeightsExtraKind));var h=e.skeleton;n.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),a.addCPUSkinningFallback(0,e),h.isUsingTextureForMatrices?(n.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")):(n.push("#define BonesPerMesh "+(h.bones.length+1)),-1===this._options.uniforms.indexOf("mBones")&&this._options.uniforms.push("mBones"))}else n.push("#define NUM_BONE_INFLUENCERS 0");for(var d in this._textures)if(!this._textures[d].isReady())return!1;e&&this._shouldTurnAlphaTestOn(e)&&n.push("#define ALPHATEST");var f=this._effect,p=n.join("\n");return this._effect=r.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},r),!!this._effect.isReady()&&(f!==this._effect&&i.resetCachedMaterial(),this._renderId=i.getRenderId(),!0)},t.prototype.bindOnlyWorldMatrix=function(e){var t=this.getScene();this._effect&&(-1!==this._options.uniforms.indexOf("world")&&this._effect.setMatrix("world",e),-1!==this._options.uniforms.indexOf("worldView")&&(e.multiplyToRef(t.getViewMatrix(),this._cachedWorldViewMatrix),this._effect.setMatrix("worldView",this._cachedWorldViewMatrix)),-1!==this._options.uniforms.indexOf("worldViewProjection")&&this._effect.setMatrix("worldViewProjection",e.multiply(t.getTransformMatrix())))},t.prototype.bind=function(e,t){if(this.bindOnlyWorldMatrix(e),this._effect&&this.getScene().getCachedMaterial()!==this){var i;for(i in-1!==this._options.uniforms.indexOf("view")&&this._effect.setMatrix("view",this.getScene().getViewMatrix()),-1!==this._options.uniforms.indexOf("projection")&&this._effect.setMatrix("projection",this.getScene().getProjectionMatrix()),-1!==this._options.uniforms.indexOf("viewProjection")&&this._effect.setMatrix("viewProjection",this.getScene().getTransformMatrix()),c.a.BindBonesParameters(t,this._effect),this._textures)this._effect.setTexture(i,this._textures[i]);for(i in this._textureArrays)this._effect.setTextureArray(i,this._textureArrays[i]);for(i in this._ints)this._effect.setInt(i,this._ints[i]);for(i in this._floats)this._effect.setFloat(i,this._floats[i]);for(i in this._floatsArrays)this._effect.setArray(i,this._floatsArrays[i]);for(i in this._colors3)this._effect.setColor3(i,this._colors3[i]);for(i in this._colors3Arrays)this._effect.setArray3(i,this._colors3Arrays[i]);for(i in this._colors4){var r=this._colors4[i];this._effect.setFloat4(i,r.r,r.g,r.b,r.a)}for(i in this._vectors2)this._effect.setVector2(i,this._vectors2[i]);for(i in this._vectors3)this._effect.setVector3(i,this._vectors3[i]);for(i in this._vectors4)this._effect.setVector4(i,this._vectors4[i]);for(i in this._matrices)this._effect.setMatrix(i,this._matrices[i]);for(i in this._matrices3x3)this._effect.setMatrix3x3(i,this._matrices3x3[i]);for(i in this._matrices2x2)this._effect.setMatrix2x2(i,this._matrices2x2[i]);for(i in this._vectors2Arrays)this._effect.setArray2(i,this._vectors2Arrays[i]);for(i in this._vectors3Arrays)this._effect.setArray3(i,this._vectors3Arrays[i])}this._afterBind(t)},t.prototype.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);for(var i in this._textures)t.push(this._textures[i]);for(var i in this._textureArrays)for(var r=this._textureArrays[i],n=0;nu-r)&&(!(c-hh-o)&&!(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 i=this.minimumWorld,r=this.maximumWorld,n=i.x,o=i.y,s=i.z,a=r.x,c=r.y,l=r.z,u=e.x,h=e.y,d=e.z,f=t.x,p=t.y,_=t.z;return!(af)&&(!(cp)&&!(l_))},e.Intersects=function(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)},e.IntersectsSphere=function(t,i,r,o){var s=e.TmpVector3[0];return n.x.ClampToRef(r,t,i,s),n.x.DistanceSquared(r,s)<=o*o},e.IsCompletelyInFrustum=function(e,t){for(var i=0;i<6;++i)for(var r=t[i],n=0;n<8;++n)if(r.dotCoordinate(e[n])<0)return!1;return!0},e.IsInFrustum=function(e,t){for(var i=0;i<6;++i){for(var r=!0,n=t[i],o=0;o<8;++o)if(n.dotCoordinate(e[o])>=0){r=!1;break}if(r)return!1}return!0},e.TmpVector3=r.a.BuildArray(3,n.x.Zero),e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return n});var r=i(3),n=function(){function e(){this.hoverCursor="",this.actions=new Array}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 i=parseInt(t);if(i>=r.a.ACTION_OnPickTrigger&&i<=r.a.ACTION_OnPickUpTrigger)return!0}return!1},enumerable:!0,configurable:!0}),e.HasSpecificTrigger=function(t){for(var i in e.Triggers){if(e.Triggers.hasOwnProperty(i))if(parseInt(i)===t)return!0}return!1},e.Triggers={},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(10),n=i(13);n.a.CreatePlane=function(e){var t=[],i=[],r=[],o=[],s=e.width||e.size||1,a=e.height||e.size||1,c=0===e.sideOrientation?0:e.sideOrientation||n.a.DEFAULTSIDE,l=s/2,u=a/2;i.push(-l,-u,0),r.push(0,0,-1),o.push(0,0),i.push(l,-u,0),r.push(0,0,-1),o.push(1,0),i.push(l,u,0),r.push(0,0,-1),o.push(1,1),i.push(-l,u,0),r.push(0,0,-1),o.push(0,1),t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),n.a._ComputeSides(c,i,t,r,o,e.frontUVs,e.backUVs);var h=new n.a;return h.indices=t,h.positions=i,h.normals=r,h.uvs=o,h},r.a.CreatePlane=function(e,t,i,r,n){var s={size:t,width:t,height:t,sideOrientation:n,updatable:r};return o.CreatePlane(e,s,i)};var o=function(){function e(){}return e.CreatePlane=function(e,t,i){var o=new r.a(e,i);return t.sideOrientation=r.a._GetDefaultSideOrientation(t.sideOrientation),o._originalBuilderSideOrientation=t.sideOrientation,n.a.CreatePlane(t).applyToMesh(o,t.updatable),t.sourcePlane&&(o.translate(t.sourcePlane.normal,-t.sourcePlane.d),o.setDirection(t.sourcePlane.normal.scale(-1))),o},e}()},function(e,t,i){"use strict";i.d(t,"a",function(){return o});var r=i(34),n=i(0),o=function(){function e(e,t,i){this.center=n.x.Zero(),this.centerWorld=n.x.Zero(),this.minimum=n.x.Zero(),this.maximum=n.x.Zero(),this.reConstruct(e,t,i)}return e.prototype.reConstruct=function(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);var r=n.x.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=.5*r,this._update(i||n.j.IdentityReadOnly)},e.prototype.scale=function(t){var i=this.radius*t,r=e.TmpVector3,n=r[0].setAll(i),o=this.center.subtractToRef(n,r[1]),s=this.center.addToRef(n,r[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{n.x.TransformCoordinatesToRef(this.center,t,this.centerWorld);var i=e.TmpVector3[0];n.x.TransformNormalFromFloatsToRef(1,1,1,t,i),this.radiusWorld=Math.max(Math.abs(i.x),Math.abs(i.y),Math.abs(i.z))*this.radius}},e.prototype.isInFrustum=function(e){for(var t=this.centerWorld,i=this.radiusWorld,r=0;r<6;r++)if(e[r].dotCoordinate(t)<=-i)return!1;return!0},e.prototype.isCenterInFrustum=function(e){for(var t=this.centerWorld,i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0},e.prototype.intersectsPoint=function(e){var t=n.x.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorldthis.value;case t.IsLesser:return this._effectiveTarget[this._property]-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 i=0;i=t.OnPickTrigger&&i.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&&i.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?(p.a.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 i=this.actions.indexOf(e);return-1!==i&&(this.actions.splice(i,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,i){for(var r=0;r0;if(2===e.type?f.push(n):f.push(i),m){for(var g=new Array,v=0;v0){var p=f.properties[0].value,_=null===f.properties[0].targetType?p:r.getMeshByName(p);_._meshId&&(_.mesh=r.getMeshByID(_._meshId)),d={trigger:t[f.name],parameter:_}}else d=t[f.name];for(var m=0;m=0;o--)this._keys[o].frame>=r&&this._keys[o].frame<=n&&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,i=this._keys.length;t0)return s.clone?s.clone():s;var a=this.getKeys(),c=Math.max(0,Math.min(a.length-1,Math.floor(a.length*(t-a[0].frame)/(a[a.length-1].frame-a[0].frame))-1));if(a[c].frame>=t)for(;c-1>=0&&a[c].frame>=t;)c--;for(var l=c;l=t){var h=a[l],d=this._getKeyValue(h.value);if(h.interpolation===I.STEP)return d;var f=this._getKeyValue(u.value),p=void 0!==h.outTangent&&void 0!==u.inTangent,_=u.frame-h.frame,m=(t-h.frame)/_,g=this.getEasingFunction();switch(null!=g&&(m=g.ease(m)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var v=p?this.floatInterpolateFunctionWithTangents(d,h.outTangent*_,f,u.inTangent*_,m):this.floatInterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return v;case e.ANIMATIONLOOPMODE_RELATIVE:return o*i+v}break;case e.ANIMATIONTYPE_QUATERNION:var y=p?this.quaternionInterpolateFunctionWithTangents(d,h.outTangent.scale(_),f,u.inTangent.scale(_),m):this.quaternionInterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return y;case e.ANIMATIONLOOPMODE_RELATIVE:return y.addInPlace(o.scale(i))}return y;case e.ANIMATIONTYPE_VECTOR3:var b=p?this.vector3InterpolateFunctionWithTangents(d,h.outTangent.scale(_),f,u.inTangent.scale(_),m):this.vector3InterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return b;case e.ANIMATIONLOOPMODE_RELATIVE:return b.add(o.scale(i))}case e.ANIMATIONTYPE_VECTOR2:var T=p?this.vector2InterpolateFunctionWithTangents(d,h.outTangent.scale(_),f,u.inTangent.scale(_),m):this.vector2InterpolateFunction(d,f,m);switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return T;case e.ANIMATIONLOOPMODE_RELATIVE:return T.add(o.scale(i))}case e.ANIMATIONTYPE_SIZE:switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.sizeInterpolateFunction(d,f,m);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(d,f,m).add(o.scale(i))}case e.ANIMATIONTYPE_COLOR3:switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:return this.color3InterpolateFunction(d,f,m);case e.ANIMATIONLOOPMODE_RELATIVE:return this.color3InterpolateFunction(d,f,m).add(o.scale(i))}case e.ANIMATIONTYPE_MATRIX:switch(n){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:if(e.AllowMatricesInterpolation)return this.matrixInterpolateFunction(d,f,m,r);case e.ANIMATIONLOOPMODE_RELATIVE:return d}}break}}return this._getKeyValue(a[a.length-1].value)},e.prototype.matrixInterpolateFunction=function(t,i,r,n){return e.AllowMatrixDecomposeForInterpolation?n?(o.j.DecomposeLerpToRef(t,i,r,n),n):o.j.DecomposeLerp(t,i,r):n?(o.j.LerpToRef(t,i,r,n),n):o.j.Lerp(t,i,r)},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 i in t._ranges={},this._ranges){var r=this._ranges[i];r&&(t._ranges[i]=r.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 i=this.dataType;t.keys=[];for(var r=this.getKeys(),n=0;n=1&&(c=u.values[1]),u.values.length>=2&&(l=u.values[2]);break;case e.ANIMATIONTYPE_QUATERNION:if(i=o.q.FromArray(u.values),u.values.length>=8){var h=o.q.FromArray(u.values.slice(4,8));h.equals(o.q.Zero())||(c=h)}if(u.values.length>=12){var d=o.q.FromArray(u.values.slice(8,12));d.equals(o.q.Zero())||(l=d)}break;case e.ANIMATIONTYPE_MATRIX:i=o.j.FromArray(u.values);break;case e.ANIMATIONTYPE_COLOR3:i=o.e.FromArray(u.values);break;case e.ANIMATIONTYPE_VECTOR3:default:i=o.x.FromArray(u.values)}var f={};f.frame=u.frame,f.value=i,null!=c&&(f.inTangent=c),null!=l&&(f.outTangent=l),a.push(f)}if(n.setKeys(a),t.ranges)for(r=0;r0&&o.forEach(function(e){n._events.push(e._clone())})}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._activeTarget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animation",{get:function(){return this._animation},enumerable:!0,configurable:!0}),e.prototype.reset=function(e){if(void 0===e&&(e=!1),e)if(this._target instanceof Array)for(var t=0,i=0,r=this._target;i-1&&this._animation.runtimeAnimations.splice(e,1)},e.prototype._interpolate=function(e,t,i,r,n){return this._currentFrame=e,this._animation.dataType!==N.ANIMATIONTYPE_MATRIX||this._workValue||(this._workValue=o.j.Zero()),this._animation._interpolate(e,t,this._workValue,i,r,n)},e.prototype.setValue=function(e,t){if(void 0===t&&(t=1),this._target instanceof Array)for(var i=0,r=0,n=this._target;r1){for(var c=e[a[0]],l=1;lt[t.length-1].frame&&(e=t[t.length-1].frame);var i=this._interpolate(e,0,this._getCorrectLoopMode());this.setValue(i,-1)},e.prototype._prepareForSpeedRatioChange=function(e){var t=this._previousDelay*(this._animation.framePerSecond*e)/1e3;this._ratioOffset=this._previousRatio-t},e.prototype.animate=function(e,t,i,r,n,o,s){void 0===o&&(o=-1);var a=this._animation.targetPropertyPath;if(!a||a.length<1)return this._stopped=!0,!1;var c=!0,l=this._animation.getKeys();if(0!==l[0].frame){var u={frame:0,value:l[0].value};l.splice(0,0,u)}else if(1===l.length){u={frame:.001,value:l[0].value};l.push(u)}(tl[l.length-1].frame)&&(t=l[0].frame),(il[l.length-1].frame)&&(i=l[l.length-1].frame),t===i&&(t>l[0].frame?t--:it&&f>=d||t>i&&f<=d)&&!r)c=!1,p=this._animation._getKeyValue(l[l.length-1].value);else if(this._getCorrectLoopMode()!==N.ANIMATIONLOOPMODE_CYCLE){var _=i.toString()+t.toString();if(!this._offsetsCache[_]){var m=this._interpolate(t,0,N.ANIMATIONLOOPMODE_CYCLE),g=this._interpolate(i,0,N.ANIMATIONLOOPMODE_CYCLE);switch(this._animation.dataType){case N.ANIMATIONTYPE_FLOAT:this._offsetsCache[_]=g-m;break;case N.ANIMATIONTYPE_QUATERNION:this._offsetsCache[_]=g.subtract(m);break;case N.ANIMATIONTYPE_VECTOR3:this._offsetsCache[_]=g.subtract(m);case N.ANIMATIONTYPE_VECTOR2:this._offsetsCache[_]=g.subtract(m);case N.ANIMATIONTYPE_SIZE:this._offsetsCache[_]=g.subtract(m);case N.ANIMATIONTYPE_COLOR3:this._offsetsCache[_]=g.subtract(m)}this._highLimitsCache[_]=g}p=this._highLimitsCache[_],h=this._offsetsCache[_]}if(void 0===h)switch(this._animation.dataType){case N.ANIMATIONTYPE_FLOAT:h=0;break;case N.ANIMATIONTYPE_QUATERNION:h=U;break;case N.ANIMATIONTYPE_VECTOR3:h=V;break;case N.ANIMATIONTYPE_VECTOR2:h=G;break;case N.ANIMATIONTYPE_SIZE:h=k;break;case N.ANIMATIONTYPE_COLOR3:h=z}var v=f/d>>0,y=c?t+f%d:i;if(this._host&&this._host.syncRoot){var b=this._host.syncRoot;y=t+(i-t)*((b.masterFrame-b.fromFrame)/(b.toFrame-b.fromFrame))}var T=this._events;if(d>0&&this.currentFrame>y||d<0&&this.currentFrame0&&y>=T[E].frame&&T[E].frame>=t||d<0&&y<=T[E].frame&&T[E].frame<=t){var A=T[E];A.isDone||(A.onlyOnce&&(T.splice(E,1),E--),A.isDone=!0,A.action(y))}return c||(this._stopped=!0),c},e}(),W=i(16),H=i(44),X=i(34),Y=function(e){function t(t,i,r,n,s,a,c){void 0===r&&(r=null),void 0===n&&(n=null),void 0===s&&(s=null),void 0===a&&(a=null),void 0===c&&(c=null);var l=e.call(this,t,i.getScene(),!1)||this;return l.name=t,l.children=new Array,l.animations=new Array,l._index=null,l._absoluteTransform=new o.j,l._invertedAbsoluteTransform=new o.j,l._scalingDeterminant=1,l._worldTransform=new o.j,l._needToDecompose=!0,l._needToCompose=!1,l._linkedTransformNode=null,l._skeleton=i,l._localMatrix=n?n.clone():o.j.Identity(),l._restPose=s||l._localMatrix.clone(),l._baseMatrix=a||l._localMatrix.clone(),l._index=c,i.bones.push(l),l.setParent(r,!1),(a||n)&&l._updateDifferenceMatrix(),l}return l.d(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.getSkeleton=function(){return this._skeleton},t.prototype.getParent=function(){return this._parent},t.prototype.setParent=function(e,t){if(void 0===t&&(t=!0),this._parent!==e){if(this._parent){var i=this._parent.children.indexOf(this);-1!==i&&this._parent.children.splice(i,1)}this._parent=e,this._parent&&this._parent.children.push(this),t&&this._updateDifferenceMatrix(),this.markAsDirty()}},t.prototype.getLocalMatrix=function(){return this._compose(),this._localMatrix},t.prototype.getBaseMatrix=function(){return this._baseMatrix},t.prototype.getRestPose=function(){return this._restPose},t.prototype.getWorldMatrix=function(){return this._worldTransform},t.prototype.returnToRest=function(){this.updateMatrix(this._restPose.clone())},t.prototype.getInvertedAbsoluteTransform=function(){return this._invertedAbsoluteTransform},t.prototype.getAbsoluteTransform=function(){return this._absoluteTransform},t.prototype.linkTransformNode=function(e){this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode--,this._linkedTransformNode=e,this._linkedTransformNode&&this._skeleton._numBonesWithLinkedTransformNode++},Object.defineProperty(t.prototype,"position",{get:function(){return this._decompose(),this._localPosition},set:function(e){this._decompose(),this._localPosition.copyFrom(e),this._markAsDirtyAndCompose()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotation",{get:function(){return this.getRotation()},set:function(e){this.setRotation(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rotationQuaternion",{get:function(){return this._decompose(),this._localRotation},set:function(e){this.setRotationQuaternion(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaling",{get:function(){return this.getScale()},set:function(e){this.setScale(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"animationPropertiesOverride",{get:function(){return this._skeleton.animationPropertiesOverride},enumerable:!0,configurable:!0}),t.prototype._decompose=function(){this._needToDecompose&&(this._needToDecompose=!1,this._localScaling||(this._localScaling=o.x.Zero(),this._localRotation=o.q.Zero(),this._localPosition=o.x.Zero()),this._localMatrix.decompose(this._localScaling,this._localRotation,this._localPosition))},t.prototype._compose=function(){this._needToCompose&&(this._needToCompose=!1,o.j.ComposeToRef(this._localScaling,this._localRotation,this._localPosition,this._localMatrix))},t.prototype.updateMatrix=function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!0),this._baseMatrix.copyFrom(e),t&&this._updateDifferenceMatrix(),i?(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 i=0;i-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 i=0;i-1){for(var r=(o=this._runtimeAnimations).length-1;r>=0;r--){var n=o[r];e&&n.animation.name!=e||(t&&!t(n.target)||(n.dispose(),o.splice(r,1)))}0==o.length&&(this._scene._activeAnimatables.splice(i,1),this._raiseOnAnimationEnd())}}else{if((r=this._scene._activeAnimatables.indexOf(this))>-1){this._scene._activeAnimatables.splice(r,1);var o=this._runtimeAnimations;for(r=0;r0)return;this._animationTimeLast=e}var t=this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale;this._animationTime+=t,this._animationTimeLast=e;for(var i=0;ii&&n>0&&(n*=-1),a&&this.stopAnimation(e,void 0,c),s||(s=new K(this,e,t,i,r,n,o,void 0,l));var u=!c||c(e);if(e.animations&&u&&s.appendAnimations(e,e.animations),e.getAnimatables)for(var h=e.getAnimatables(),d=0;d=l&&s.frame<=u&&(r?(c=s.value.clone(),_?(a=c.getTranslation(),c.setTranslation(a.scaleInPlace(m))):g&&n?(a=c.getTranslation(),c.setTranslation(a.multiplyInPlace(n))):c=s.value):c=s.value,v.push({frame:s.frame+i,value:c}));return this.animations[0].createRange(t,l+i,u+i),!0};var Q=function(){return function(){}}(),q=function(){function e(e,t){void 0===t&&(t=null),this.name=e,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this.onAnimationEndObservable=new n.c,this.onAnimationLoopObservable=new n.c,this.onAnimationGroupEndObservable=new n.c,this.onAnimationGroupPauseObservable=new n.c,this.onAnimationGroupPlayObservable=new n.c,this._scene=t||R.a.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._scene.animationGroups.push(this)}return Object.defineProperty(e.prototype,"from",{get:function(){return this._from},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"to",{get:function(){return this._to},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStarted",{get:function(){return this._isStarted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._isStarted&&!this._isPaused},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"speedRatio",{get:function(){return this._speedRatio},set:function(e){if(this._speedRatio!==e){this._speedRatio=e;for(var t=0;tr[0].frame&&(this._from=r[0].frame),this._toe){var s={frame:e,value:n.value,inTangent:n.inTangent,outTangent:n.outTangent,interpolation:n.interpolation};r.splice(0,0,s)}if(o.framer&&this._speedRatio>0&&(this._speedRatio=-t),this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this},e.prototype.pause=function(){if(!this._isStarted)return this;this._isPaused=!0;for(var e=0;e-1&&this._scene.animationGroups.splice(e,1),this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear()},e.prototype._checkAnimationGroupEnded=function(e){var t=this._animatables.indexOf(e);t>-1&&this._animatables.splice(t,1),0===this._animatables.length&&(this._isStarted=!1,this.onAnimationGroupEndObservable.notifyObservers(this))},e.prototype.clone=function(t,i){for(var r=new e(t||this.name,this._scene),n=0,o=this._targetedAnimations;n=.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}(),$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e=Math.max(0,Math.min(1,e)),1-Math.sqrt(1-e*e)},t}(J),ee=function(e){function t(t){void 0===t&&(t=1);var i=e.call(this)||this;return i.amplitude=t,i}return l.d(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}(J),te=function(e){function t(t,i){void 0===t&&(t=3),void 0===i&&(i=2);var r=e.call(this)||this;return r.bounces=t,r.bounciness=i,r}return l.d(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.bounces),i=this.bounciness;i<=1&&(i=1.001);var r=Math.pow(i,t),n=1-i,o=(1-r)/n+.5*r,s=e*o,a=Math.log(-s*(1-i)+1)/Math.log(i),c=Math.floor(a),l=c+1,u=(1-Math.pow(i,c))/(n*o),h=.5*(u+(1-Math.pow(i,l))/(n*o)),d=e-h,f=h-u;return-Math.pow(1/i,t-c)/(f*f)*(d-f)*(d+f)},t}(J),ie=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e*e},t}(J),re=function(e){function t(t,i){void 0===t&&(t=3),void 0===i&&(i=3);var r=e.call(this)||this;return r.oscillations=t,r.springiness=i,r}return l.d(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.oscillations),i=Math.max(0,this.springiness);return(0==i?e:(Math.exp(i*e)-1)/(Math.exp(i)-1))*Math.sin((6.283185307179586*t+1.5707963267948966)*e)},t}(J),ne=function(e){function t(t){void 0===t&&(t=2);var i=e.call(this)||this;return i.exponent=t,i}return l.d(t,e),t.prototype.easeInCore=function(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)},t}(J),oe=function(e){function t(t){void 0===t&&(t=2);var i=e.call(this)||this;return i.power=t,i}return l.d(t,e),t.prototype.easeInCore=function(e){var t=Math.max(0,this.power);return Math.pow(e,t)},t}(J),se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e},t}(J),ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e*e*e},t}(J),ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return e*e*e*e*e},t}(J),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.easeInCore=function(e){return 1-Math.sin(1.5707963267948966*(1-e))},t}(J),ue=function(e){function t(t,i,r,n){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=1);var o=e.call(this)||this;return o.x1=t,o.y1=i,o.x2=r,o.y2=n,o}return l.d(t,e),t.prototype.easeInCore=function(e){return o.d.Interpolate(e,this.x1,this.y1,this.x2,this.y2)},t}(J),he=function(){function e(e,t,i){this.frame=e,this.action=t,this.onlyOnce=i,this.isDone=!1}return e.prototype._clone=function(){return new e(this.frame,this.action,this.onlyOnce)},e}(),de=i(10),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t}(r.a),pe=function(e){function t(t){var i=e.call(this)||this;return i.scene=t,i.sounds=[],i.effectLayers=[],i.layers=[],i.lensFlareSystems=[],i.proceduralTextures=[],i.reflectionProbes=[],i}return l.d(t,e),t.prototype.addAllToScene=function(){var e=this;this.cameras.forEach(function(t){e.scene.addCamera(t)}),this.lights.forEach(function(t){e.scene.addLight(t)}),this.meshes.forEach(function(t){e.scene.addMesh(t)}),this.skeletons.forEach(function(t){e.scene.addSkeleton(t)}),this.animations.forEach(function(t){e.scene.addAnimation(t)}),this.animationGroups.forEach(function(t){e.scene.addAnimationGroup(t)}),this.multiMaterials.forEach(function(t){e.scene.addMultiMaterial(t)}),this.materials.forEach(function(t){e.scene.addMaterial(t)}),this.morphTargetManagers.forEach(function(t){e.scene.addMorphTargetManager(t)}),this.geometries.forEach(function(t){e.scene.addGeometry(t)}),this.transformNodes.forEach(function(t){e.scene.addTransformNode(t)}),this.actionManagers.forEach(function(t){e.scene.addActionManager(t)}),this.textures.forEach(function(t){e.scene.addTexture(t)}),this.reflectionProbes.forEach(function(t){e.scene.addReflectionProbe(t)});for(var t=0,i=this.scene._serializableComponents;t0&&(h=!0,this._soundLoaded(i));break;case"String":u.push(i);case"Array":0===u.length&&(u=i);for(var d=0;d0&&(this._htmlAudioElement.currentTime=0)):this._streamingSource.disconnect();else if(_e.b.audioEngine.audioContext&&this._soundSource){var t=e?_e.b.audioEngine.audioContext.currentTime+e:_e.b.audioEngine.audioContext.currentTime;this._soundSource.stop(t),this._soundSource.onended=function(){},this.isPaused||(this._startOffset=0)}this.isPlaying=!1}},e.prototype.pause=function(){this.isPlaying&&(this.isPaused=!0,this._streaming?this._htmlAudioElement?this._htmlAudioElement.pause():this._streamingSource.disconnect():_e.b.audioEngine.audioContext&&(this.stop(0),this._startOffset+=_e.b.audioEngine.audioContext.currentTime-this._startTime))},e.prototype.setVolume=function(e,t){_e.b.audioEngine.canUseWebAudio&&this._soundGain&&(t&&_e.b.audioEngine.audioContext?(this._soundGain.gain.cancelScheduledValues(_e.b.audioEngine.audioContext.currentTime),this._soundGain.gain.setValueAtTime(this._soundGain.gain.value,_e.b.audioEngine.audioContext.currentTime),this._soundGain.gain.linearRampToValueAtTime(e,_e.b.audioEngine.audioContext.currentTime+t)):this._soundGain.gain.value=e),this._volume=e},e.prototype.setPlaybackRate=function(e){this._playbackRate=e,this.isPlaying&&(this._streaming&&this._htmlAudioElement?this._htmlAudioElement.playbackRate=this._playbackRate:this._soundSource&&(this._soundSource.playbackRate.value=this._playbackRate))},e.prototype.getVolume=function(){return this._volume},e.prototype.attachToMesh=function(e){var t=this;this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=e,this.spatialSound||(this.spatialSound=!0,this._createSpatialParameters(),this.isPlaying&&this.loop&&(this.stop(),this.play())),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=function(e){return t._onRegisterAfterWorldMatrixUpdate(e)},this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)},e.prototype.detachFromMesh=function(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)},e.prototype._onRegisterAfterWorldMatrixUpdate=function(e){if(e.getBoundingInfo){var t=e;if(this._positionInEmitterSpace)t.worldMatrixFromCache.invertToRef(o.t.Matrix[0]),this.setPosition(o.t.Matrix[0].getTranslation());else{var i=t.getBoundingInfo();this.setPosition(i.boundingSphere.centerWorld)}_e.b.audioEngine.canUseWebAudio&&this._isDirectional&&this.isPlaying&&this._updateDirection()}},e.prototype.clone=function(){var t=this;if(this._streaming)return null;var i=function(){t._isReadyToPlay?(n._audioBuffer=t.getAudioBuffer(),n._isReadyToPlay=!0,n.autoplay&&n.play()):window.setTimeout(i,300)},r={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},n=new e(this.name+"_cloned",new ArrayBuffer(0),this._scene,null,r);return this.useCustomAttenuation&&n.setAttenuationFunction(this._customAttenuationFunction),n.setPosition(this._position),n.setPlaybackRate(this._playbackRate),i(),n},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,i,r,n){var s,a=t.name;s=t.url?r+t.url:r+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(n){var u=function(){n._isReadyToPlay?(c._audioBuffer=n.getAudioBuffer(),c._isReadyToPlay=!0,c.autoplay&&c.play()):window.setTimeout(u,300)};c=new e(a,new ArrayBuffer(0),i,null,l),u()}else c=new e(a,s,i,function(){i._removePendingData(c)},l),i._addPendingData(c);if(t.position){var h=o.x.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.x.FromArray(t.localDirectionToMesh);c.setLocalDirectionToMesh(d)}if(t.connectedMeshId){var f=i.getMeshByID(t.connectedMeshId);f&&c.attachToMesh(f)}return c},e._SceneComponentInitialization=function(e){throw ye.a.WarnImport("AudioSceneComponent")},e}(),Te=function(){function e(e,t){void 0===t&&(t={}),this.id=-1,this._isMainTrack=!1,this._isInitialized=!1,this._scene=e,this.soundCollection=new Array,this._options=t,!this._isMainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1)}return e.prototype._initializeSoundTrackAudioGraph=function(){_e.b.audioEngine.canUseWebAudio&&_e.b.audioEngine.audioContext&&(this._outputAudioNode=_e.b.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(_e.b.audioEngine.masterGain),this._options&&(this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._options.mainTrack&&(this._isMainTrack=this._options.mainTrack)),this._isInitialized=!0)},e.prototype.dispose=function(){if(_e.b.audioEngine&&_e.b.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(),_e.b.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){_e.b.audioEngine.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=e)},e.prototype.switchPanningModelToHRTF=function(){if(_e.b.audioEngine.canUseWebAudio)for(var e=0;e0?e.activeCameras[0]:e.activeCamera)&&i.audioContext){i.audioContext.listener.setPosition(t.position.x,t.position.y,t.position.z),t.rigCameras&&t.rigCameras.length>0&&(t=t.rigCameras[0]);var r,n=o.j.Invert(t.getViewMatrix()),s=o.x.TransformNormal(new o.x(0,0,-1),n);for(s.normalize(),isNaN(s.x)||isNaN(s.y)||isNaN(s.z)||i.audioContext.listener.setOrientation(s.x,s.y,s.z,0,1,0),r=0;r0?1/n:0,c=0;c0},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(e){var t=this;this._attachedCamera=e;var i=this._attachedCamera.getScene();this._onPrePointerObservableObserver=i.onPrePointerObservable.add(function(e){e.type!==Pe.a.POINTERDOWN?e.type===Pe.a.POINTERUP&&(t._isPointerDown=!1):t._isPointerDown=!0}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(function(){var e=H.a.Now,i=0;null!=t._lastFrameTime&&(i=e-t._lastFrameTime),t._lastFrameTime=e,t._applyUserInteraction();var r=e-t._lastInteractionTime-t._idleRotationWaitTime,n=Math.max(Math.min(r/t._idleRotationSpinupTime,1),0);t._cameraRotationSpeed=t._idleRotationSpeed*n,t._attachedCamera&&(t._attachedCamera.alpha-=t._cameraRotationSpeed*(i/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=H.a.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}(),Se=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 i=this._attachedCamera;i&&(e?this._onMeshTargetChangedObserver=i.onMeshTargetChangedObservable.add(function(e){if(e){e.computeWorldMatrix(!0);var i=e.getBoundingInfo().diagonalLength;t.lowerRadiusTransitionRange=.05*i,t.upperRadiusTransitionRange=.05*i}}):this._onMeshTargetChangedObserver&&i.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 i=this;if(this._attachedCamera){this._radiusBounceTransition||(e.EasingFunction.setEasingMode(e.EasingMode),this._radiusBounceTransition=N.CreateAnimation("radius",N.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 r=N.TransitionTo("radius",this._attachedCamera.radius+t,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,function(){return i._clearAnimationLocks()});r&&this._animatables.push(r)}},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 ee(.3),e.EasingMode=J.EASINGMODE_EASEOUT,e}(),Ce=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 i=this;this._attachedCamera=t;var r=this._attachedCamera.getScene();e.EasingFunction.setEasingMode(e.EasingMode),this._onPrePointerObservableObserver=r.onPrePointerObservable.add(function(e){e.type!==Pe.a.POINTERDOWN?e.type===Pe.a.POINTERUP&&(i._isPointerDown=!1):i._isPointerDown=!0}),this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(function(e){e&&i.zoomOnMesh(e)}),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(function(){i._applyUserInteraction(),i._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,i){void 0===t&&(t=!1),void 0===i&&(i=null),e.computeWorldMatrix(!0);var r=e.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(r.minimumWorld,r.maximumWorld,t,i)},e.prototype.zoomOnMeshHierarchy=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null),e.computeWorldMatrix(!0);var r=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(r.min,r.max,t,i)},e.prototype.zoomOnMeshesHierarchy=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=null);for(var r=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new o.x(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),s=0;sl.upperRadiusLimit?l.upperRadiusLimit:c),c):0},e.prototype._maintainCameraAboveGround=function(){var t=this;if(!(this._elevationReturnTime<0)){var i=H.a.Now-this._lastInteractionTime,r=.5*Math.PI-this._defaultElevation,n=.5*Math.PI;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>n&&i>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=N.CreateAnimation("beta",N.ANIMATIONTYPE_FLOAT,60,e.EasingFunction));var o=N.TransitionTo("beta",r,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,function(){t._clearAnimationLocks(),t.stopAllAnimations()});o&&this._animatables.push(o)}}},e.prototype._getFrustumSlope=function(){var e=this._attachedCamera;if(!e)return o.w.Zero();var t=e.getScene().getEngine().getAspectRatio(e),i=Math.tan(e.fov/2),r=i*t;return new o.w(r,i)},e.prototype._clearAnimationLocks=function(){this._betaIsAnimating=!1},e.prototype._applyUserInteraction=function(){this.isUserIsMoving&&(this._lastInteractionTime=H.a.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 ne,e.EasingMode=J.EASINGMODE_EASEINOUT,e.IgnoreBoundsSizeMode=0,e.FitFrustumSidesMode=1,e}(),Me=function(){return function(e,t,i,r){void 0===t&&(t=new o.x),void 0===i&&(i=0),void 0===r&&(r=!1),this.direction=e,this.rotatedDirection=t,this.diff=i,this.ignore=r}}(),Oe=function(){function e(e){this.ui=e,this.name="AttachToBoxBehavior",this.distanceAwayFromFace=.15,this.distanceAwayFromBottomOfFace=.15,this._faceVectors=[new Me(o.x.Up()),new Me(o.x.Down()),new Me(o.x.Left()),new Me(o.x.Right()),new Me(o.x.Forward()),new Me(o.x.Forward().scaleInPlace(-1))],this._tmpMatrix=new o.j,this._tmpVector=new o.x,this._zeroVector=o.x.Zero(),this._lookAtTmpMatrix=new o.j}return e.prototype.init=function(){},e.prototype._closestFace=function(e){var t=this;return this._faceVectors.forEach(function(i){t._target.rotationQuaternion||(t._target.rotationQuaternion=o.q.RotationYawPitchRoll(t._target.rotation.y,t._target.rotation.x,t._target.rotation.z)),t._target.rotationQuaternion.toRotationMatrix(t._tmpMatrix),o.x.TransformCoordinatesToRef(i.direction,t._tmpMatrix,i.rotatedDirection),i.diff=o.x.GetAngleBetweenVectors(i.rotatedDirection,e,o.x.Cross(i.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 i=this;e.visibility=t,e.getChildMeshes().forEach(function(e){i._setAllVisibility(e,t)})},e}(),De=i(52),we=function(){function e(){this._startDistance=0,this._initialScale=new o.x(0,0,0),this._targetScale=new o.x(0,0,0),this._sceneRenderObserver=null,this._dragBehaviorA=new De.a({}),this._dragBehaviorA.moveAttached=!1,this._dragBehaviorB=new De.a({}),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(i){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(i){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 i=t._targetScale.subtract(e.scaling).scaleInPlace(.1);i.length()>.01&&e.scaling.addInPlace(i)}})},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}(),Le=i(24),Fe=i(20),Ne=i(43),Be=function(){function e(){this._sceneRenderObserver=null,this._targetPosition=new o.x(0,0,0),this._moving=!1,this._startingOrientation=new o.q,this.zDragFactor=3,this.rotateDraggedObject=!0,this.dragging=!1,this.dragDeltaRatio=.2,this.currentDraggingPointerID=-1,this.detachCameraControls=!0,this.onDragStartObservable=new n.c,this.onDragEndObservable=new n.c}return Object.defineProperty(e.prototype,"name",{get:function(){return"SixDofDrag"},enumerable:!0,configurable:!0}),e.prototype.init=function(){},e.prototype.attach=function(t){var i=this;this._ownerNode=t,this._scene=this._ownerNode.getScene(),e._virtualScene||(e._virtualScene=new W.a(this._scene.getEngine()),e._virtualScene.detachControl(),this._scene.getEngine().scenes.pop());var r=null,n=new o.x(0,0,0);this._virtualOriginMesh=new Le.a("",e._virtualScene),this._virtualOriginMesh.rotationQuaternion=new o.q,this._virtualDragMesh=new Le.a("",e._virtualScene),this._virtualDragMesh.rotationQuaternion=new o.q;var s=null;this._pointerObserver=this._scene.onPointerObservable.add(function(e,t){if(e.type==Pe.a.POINTERDOWN){if(!i.dragging&&e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh&&e.pickInfo.ray&&(h=e.pickInfo.pickedMesh,i._ownerNode==h||h.isDescendantOf(i._ownerNode))){i._scene.activeCamera&&i._scene.activeCamera.cameraRigMode==Fe.a.RIG_MODE_NONE&&e.pickInfo.ray.origin.copyFrom(i._scene.activeCamera.globalPosition),r=i._ownerNode,Ne.a._RemoveAndStorePivotPoint(r),n.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),i._virtualOriginMesh.removeChild(i._virtualDragMesh),r.computeWorldMatrix(),i._virtualDragMesh.position.copyFrom(r.absolutePosition),r.rotationQuaternion||(r.rotationQuaternion=o.q.RotationYawPitchRoll(r.rotation.y,r.rotation.x,r.rotation.z));var a=r.parent;r.setParent(null),i._virtualDragMesh.rotationQuaternion.copyFrom(r.rotationQuaternion),r.setParent(a),i._virtualOriginMesh.addChild(i._virtualDragMesh),i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition),i.dragging=!0,i.currentDraggingPointerID=e.event.pointerId,i.detachCameraControls&&i._scene.activeCamera&&!i._scene.activeCamera.leftCamera&&(i._scene.activeCamera.inputs.attachedElement?(s=i._scene.activeCamera.inputs.attachedElement,i._scene.activeCamera.detachControl(i._scene.activeCamera.inputs.attachedElement)):s=null),Ne.a._RestorePivotPoint(r),i.onDragStartObservable.notifyObservers({})}}else if(e.type==Pe.a.POINTERUP)i.currentDraggingPointerID==e.event.pointerId&&(i.dragging=!1,i._moving=!1,i.currentDraggingPointerID=-1,r=null,i._virtualOriginMesh.removeChild(i._virtualDragMesh),i.detachCameraControls&&s&&i._scene.activeCamera&&!i._scene.activeCamera.leftCamera&&i._scene.activeCamera.attachControl(s,!0),i.onDragEndObservable.notifyObservers({}));else if(e.type==Pe.a.POINTERMOVE&&i.currentDraggingPointerID==e.event.pointerId&&i.dragging&&e.pickInfo&&e.pickInfo.ray&&r){var c=i.zDragFactor;i._scene.activeCamera&&i._scene.activeCamera.cameraRigMode==Fe.a.RIG_MODE_NONE&&(e.pickInfo.ray.origin.copyFrom(i._scene.activeCamera.globalPosition),c=0);var l=e.pickInfo.ray.origin.subtract(n);n.copyFrom(e.pickInfo.ray.origin);var u=-o.x.Dot(l,e.pickInfo.ray.direction);i._virtualOriginMesh.addChild(i._virtualDragMesh),i._virtualDragMesh.position.z-=i._virtualDragMesh.position.z<1?u*i.zDragFactor:u*c*i._virtualDragMesh.position.z,i._virtualDragMesh.position.z<0&&(i._virtualDragMesh.position.z=0),i._virtualOriginMesh.position.copyFrom(e.pickInfo.ray.origin),i._virtualOriginMesh.lookAt(e.pickInfo.ray.origin.add(e.pickInfo.ray.direction)),i._virtualOriginMesh.removeChild(i._virtualDragMesh),i._targetPosition.copyFrom(i._virtualDragMesh.absolutePosition),r.parent&&o.x.TransformCoordinatesToRef(i._targetPosition,o.j.Invert(r.parent.getWorldMatrix()),i._targetPosition),i._moving||i._startingOrientation.copyFrom(i._virtualDragMesh.rotationQuaternion),i._moving=!0}var h});var a=new o.q;this._sceneRenderObserver=t.getScene().onBeforeRenderObservable.add(function(){if(i.dragging&&i._moving&&r){if(Ne.a._RemoveAndStorePivotPoint(r),r.position.addInPlace(i._targetPosition.subtract(r.position).scale(i.dragDeltaRatio)),i.rotateDraggedObject){a.copyFrom(i._startingOrientation),a.x=-a.x,a.y=-a.y,a.z=-a.z,i._virtualDragMesh.rotationQuaternion.multiplyToRef(a,a),o.q.RotationYawPitchRollToRef(a.toEulerAngles("xyz").y,0,0,a),a.multiplyToRef(i._startingOrientation,a);var e=r.parent;(!e||e.scaling&&!e.scaling.isNonUniformWithinEpsilon(.001))&&(r.setParent(null),o.q.SlerpToRef(r.rotationQuaternion,a,i.dragDeltaRatio,r.rotationQuaternion),r.setParent(e))}Ne.a._RestorePivotPoint(r)}})},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}(),Ue=function(){function e(e,t,i){if(this.targetPosition=o.x.Zero(),this.poleTargetPosition=o.x.Zero(),this.poleTargetLocalOffset=o.x.Zero(),this.poleAngle=0,this.slerpAmount=1,this._bone1Quat=o.q.Identity(),this._bone1Mat=o.j.Identity(),this._bone2Ang=Math.PI,this._maxAngle=Math.PI,this._rightHandedSystem=!1,this._bendAxis=o.x.Right(),this._slerping=!1,this._adjustRoll=0,this._bone2=t,this._bone1=t.getParent(),this._bone1){this.mesh=e;var r=t.getPosition();if(t.getAbsoluteTransform().determinant()>0&&(this._rightHandedSystem=!0,this._bendAxis.x=0,this._bendAxis.y=0,this._bendAxis.z=-1,r.x>r.y&&r.x>r.z&&(this._adjustRoll=.5*Math.PI,this._bendAxis.z=1)),this._bone1.length){var n=this._bone1.getScale(),s=this._bone2.getScale();this._bone1Length=this._bone1.length*n.y*this.mesh.scaling.y,this._bone2Length=this._bone2.length*s.y*this.mesh.scaling.y}else if(this._bone1.children[0]){e.computeWorldMatrix(!0);var a=this._bone2.children[0].getAbsolutePosition(e),c=this._bone2.getAbsolutePosition(e),l=this._bone1.getAbsolutePosition(e);this._bone1Length=o.x.Distance(a,c),this._bone2Length=o.x.Distance(c,l)}this._bone1.getRotationMatrixToRef(o.s.WORLD,e,this._bone1Mat),this.maxAngle=Math.PI,i&&(i.targetMesh&&(this.targetMesh=i.targetMesh,this.targetMesh.computeWorldMatrix(!0)),i.poleTargetMesh?(this.poleTargetMesh=i.poleTargetMesh,this.poleTargetMesh.computeWorldMatrix(!0)):i.poleTargetBone?this.poleTargetBone=i.poleTargetBone:this._bone1.getParent()&&(this.poleTargetBone=this._bone1.getParent()),i.poleTargetLocalOffset&&this.poleTargetLocalOffset.copyFrom(i.poleTargetLocalOffset),i.poleAngle&&(this.poleAngle=i.poleAngle),i.bendAxis&&this._bendAxis.copyFrom(i.bendAxis),i.maxAngle&&(this.maxAngle=i.maxAngle),i.slerpAmount&&(this.slerpAmount=i.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,i=this._bone2Length;this._maxReach=Math.sqrt(t*t+i*i-2*t*i*Math.cos(e))},e.prototype.update=function(){var t=this._bone1;if(t){var i=this.targetPosition,r=this.poleTargetPosition,n=e._tmpMats[0],s=e._tmpMats[1];this.targetMesh&&i.copyFrom(this.targetMesh.getAbsolutePosition()),this.poleTargetBone?this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset,this.mesh,r):this.poleTargetMesh&&o.x.TransformCoordinatesToRef(this.poleTargetLocalOffset,this.poleTargetMesh.getWorldMatrix(),r);var a=e._tmpVecs[0],c=e._tmpVecs[1],l=e._tmpVecs[2],u=e._tmpVecs[3],h=e._tmpVecs[4],d=e._tmpQuat;t.getAbsolutePositionToRef(this.mesh,a),r.subtractToRef(a,h),0==h.x&&0==h.y&&0==h.z?h.y=1:h.normalize(),i.subtractToRef(a,u),u.normalize(),o.x.CrossToRef(u,h,c),c.normalize(),o.x.CrossToRef(u,c,l),l.normalize(),o.j.FromXYZAxesToRef(l,u,c,n);var f=this._bone1Length,p=this._bone2Length,_=o.x.Distance(a,i);this._maxReach>0&&(_=Math.min(this._maxReach,_));var m=(p*p+_*_-f*f)/(2*p*_),g=(_*_+f*f-p*p)/(2*_*f);m>1&&(m=1),g>1&&(g=1),m<-1&&(m=-1),g<-1&&(g=-1);var v=Math.acos(m),y=Math.acos(g),b=-v-y;if(this._rightHandedSystem)o.j.RotationYawPitchRollToRef(0,0,this._adjustRoll,s),s.multiplyToRef(n,n),o.j.RotationAxisToRef(this._bendAxis,y,s),s.multiplyToRef(n,n);else{var T=e._tmpVecs[5];T.copyFrom(this._bendAxis),T.x*=-1,o.j.RotationAxisToRef(T,-y,s),s.multiplyToRef(n,n)}this.poleAngle&&(o.j.RotationAxisToRef(u,this.poleAngle,s),n.multiplyToRef(s,n)),this._bone1&&(this.slerpAmount<1?(this._slerping||o.q.FromRotationMatrixToRef(this._bone1Mat,this._bone1Quat),o.q.FromRotationMatrixToRef(n,d),o.q.SlerpToRef(this._bone1Quat,d,this.slerpAmount,this._bone1Quat),b=this._bone2Ang*(1-this.slerpAmount)+b*this.slerpAmount,this._bone1.setRotationQuaternion(this._bone1Quat,o.s.WORLD,this.mesh),this._slerping=!0):(this._bone1.setRotationMatrix(n,o.s.WORLD,this.mesh),this._bone1Mat.copyFrom(n),this._slerping=!1)),this._bone2.setAxisAngle(this._bendAxis,b,o.s.LOCAL),this._bone2Ang=b}},e._tmpVecs=[o.x.Zero(),o.x.Zero(),o.x.Zero(),o.x.Zero(),o.x.Zero(),o.x.Zero()],e._tmpQuat=o.q.Identity(),e._tmpMats=[o.j.Identity(),o.j.Identity()],e}(),Ve=function(){function e(e,t,i,r){if(this.upAxis=o.x.Up(),this.upAxisSpace=o.s.LOCAL,this.adjustYaw=0,this.adjustPitch=0,this.adjustRoll=0,this.slerpAmount=1,this._boneQuat=o.q.Identity(),this._slerping=!1,this._firstFrameSkipped=!1,this._fowardAxis=o.x.Forward(),this.mesh=e,this.bone=t,this.target=i,r&&(r.adjustYaw&&(this.adjustYaw=r.adjustYaw),r.adjustPitch&&(this.adjustPitch=r.adjustPitch),r.adjustRoll&&(this.adjustRoll=r.adjustRoll),null!=r.maxYaw?this.maxYaw=r.maxYaw:this.maxYaw=Math.PI,null!=r.minYaw?this.minYaw=r.minYaw:this.minYaw=-Math.PI,null!=r.maxPitch?this.maxPitch=r.maxPitch:this.maxPitch=Math.PI,null!=r.minPitch?this.minPitch=r.minPitch:this.minPitch=-Math.PI,null!=r.slerpAmount&&(this.slerpAmount=r.slerpAmount),null!=r.upAxis&&(this.upAxis=r.upAxis),null!=r.upAxisSpace&&(this.upAxisSpace=r.upAxisSpace),null!=r.yawAxis||null!=r.pitchAxis)){var n=o.c.Y,s=o.c.X;null!=r.yawAxis&&(n=r.yawAxis.clone()).normalize(),null!=r.pitchAxis&&(s=r.pitchAxis.clone()).normalize();var a=o.x.Cross(s,n);this._transformYawPitch=o.j.Identity(),o.j.FromXYZAxesToRef(s,n,a,this._transformYawPitch),this._transformYawPitchInv=this._transformYawPitch.clone(),this._transformYawPitch.invert()}t.getParent()||this.upAxisSpace!=o.s.BONE||(this.upAxisSpace=o.s.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,i=e._tmpVecs[0];t.getAbsolutePositionToRef(this.mesh,i);var r=this.target,n=e._tmpMats[0],s=e._tmpMats[1],a=this.mesh,c=t.getParent(),l=e._tmpVecs[1];l.copyFrom(this.upAxis),this.upAxisSpace==o.s.BONE&&c?(this._transformYawPitch&&o.x.TransformCoordinatesToRef(l,this._transformYawPitchInv,l),c.getDirectionToRef(l,this.mesh,l)):this.upAxisSpace==o.s.LOCAL&&(a.getDirectionToRef(l,l),1==a.scaling.x&&1==a.scaling.y&&1==a.scaling.z||l.normalize());var u=!1,h=!1;if(this._maxYaw==Math.PI&&this._minYaw==-Math.PI||(u=!0),this._maxPitch==Math.PI&&this._minPitch==-Math.PI||(h=!0),u||h){var d=e._tmpMats[2],f=e._tmpMats[3];if(this.upAxisSpace==o.s.BONE&&1==l.y&&c)c.getRotationMatrixToRef(o.s.WORLD,this.mesh,d);else if(this.upAxisSpace!=o.s.LOCAL||1!=l.y||c){(_=e._tmpVecs[2]).copyFrom(this._fowardAxis),this._transformYawPitch&&o.x.TransformCoordinatesToRef(_,this._transformYawPitchInv,_),c?c.getDirectionToRef(_,this.mesh,_):a.getDirectionToRef(_,_);var p=o.x.Cross(l,_);p.normalize();var _=o.x.Cross(p,l);o.j.FromXYZAxesToRef(p,l,_,d)}else d.copyFrom(a.getWorldMatrix());d.invertToRef(f);var m=null;if(h){var g=e._tmpVecs[3];r.subtractToRef(i,g),o.x.TransformCoordinatesToRef(g,f,g),m=Math.sqrt(g.x*g.x+g.z*g.z);var v=Math.atan2(g.y,m),y=v;v>this._maxPitch?(g.y=this._maxPitchTan*m,y=this._maxPitch):vthis._maxYaw||bMath.PI?this._isAngleBetween(b,this._maxYaw,this._midYawConstraint)?(g.z=this._maxYawCos*m,g.x=this._maxYawSin*m,T=this._maxYaw):this._isAngleBetween(b,this._midYawConstraint,this._minYaw)&&(g.z=this._minYawCos*m,g.x=this._minYawSin*m,T=this._minYaw):b>this._maxYaw?(g.z=this._maxYawCos*m,g.x=this._maxYawSin*m,T=this._maxYaw):bMath.PI){var E=e._tmpVecs[8];E.copyFrom(o.c.Z),this._transformYawPitch&&o.x.TransformCoordinatesToRef(E,this._transformYawPitchInv,E);var x=e._tmpMats[4];this._boneQuat.toRotationMatrix(x),this.mesh.getWorldMatrix().multiplyToRef(x,x),o.x.TransformCoordinatesToRef(E,x,E),o.x.TransformCoordinatesToRef(E,f,E);var A=Math.atan2(E.x,E.z);if(this._getAngleBetween(A,b)>this._getAngleBetween(A,this._midYawConstraint)){null==m&&(m=Math.sqrt(g.x*g.x+g.z*g.z));var P=this._getAngleBetween(A,this._maxYaw);this._getAngleBetween(A,this._minYaw)Math.PI?i-=2*Math.PI:i<-Math.PI&&(i+=2*Math.PI),i},e.prototype._getAngleBetween=function(e,t){var i=0;return(i=(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&&(i=2*Math.PI-i),i},e.prototype._isAngleBetween=function(e,t,i){if(e=(e%=2*Math.PI)<0?e+2*Math.PI:e,(t=(t%=2*Math.PI)<0?t+2*Math.PI:t)<(i=(i%=2*Math.PI)<0?i+2*Math.PI:i)){if(e>t&&ei&&e0}return Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isUsingTextureForMatrices",{get:function(){return this.useTextureToStoreBoneMatrices&&this._canUseTextureForBones&&!this.needInitialSkinMatrix},enumerable:!0,configurable:!0}),e.prototype.getTransformMatrices=function(e){return this.needInitialSkinMatrix&&e._bonesTransformMatrices?e._bonesTransformMatrices:(this._transformMatrices||this.prepare(),this._transformMatrices)},e.prototype.getTransformMatrixTexture=function(){return this._transformMatrixTexture},e.prototype.getScene=function(){return this._scene},e.prototype.toString=function(e){var t="Name: "+this.name+", nBones: "+this.bones.length;if(t+=", nAnimationRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";var i=!0;for(var r in this._ranges)i&&(t+=", ",i=!1),t+=r;t+="}"}return t},e.prototype.getBoneIndexByName=function(e){for(var t=0,i=this.bones.length;t-1&&this._meshesWithPoseMatrix.splice(t,1)},e.prototype._computeTransformMatrices=function(e,t){this.onBeforeComputeObservable.notifyObservers(this);for(var i=0;i0)for(var e=0,t=this.bones;e0&&(n.animation=i.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,i){var r,n=new e(t.name,t.id,i);for(t.dimensionsAtRest&&(n.dimensionsAtRest=o.x.FromArray(t.dimensionsAtRest)),n.needInitialSkinMatrix=t.needInitialSkinMatrix,r=0;r-1&&(a=n.bones[s.parentBoneIndex]);var c=s.rest?o.j.FromArray(s.rest):null,l=new Y(s.name,n,a,o.j.FromArray(s.matrix),c);void 0!==s.id&&null!==s.id&&(l.id=s.id),s.length&&(l.length=s.length),s.metadata&&(l.metadata=s.metadata),s.animation&&l.animations.push(N.Parse(s.animation))}if(t.ranges)for(r=0;r0&&(e=this._meshesWithPoseMatrix[0].getPoseMatrix()),e},e.prototype.sortBones=function(){for(var e=new Array,t=new Array(this.bones.length),i=0;i=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}(),Ye=function(e){function t(t,i,r){var o=e.call(this,t,i,r)||this;return o.onButtonDownObservable=new n.c,o.onButtonUpObservable=new n.c,o.type=Xe.GENERIC,o._buttons=new Array(r.buttons.length),o}return l.d(t,e),t.prototype.onbuttondown=function(e){this._onbuttondown=e},t.prototype.onbuttonup=function(e){this._onbuttonup=e},t.prototype._setButtonValue=function(e,t,i){return e!==t&&(1===e&&(this._onbuttondown&&this._onbuttondown(i),this.onButtonDownObservable.notifyObservers(i)),0===e&&(this._onbuttonup&&this._onbuttonup(i),this.onButtonUpObservable.notifyObservers(i))),e},t.prototype.update=function(){e.prototype.update.call(this);for(var t=0;t.005&&(e.inertialAlphaOffset+=i)}if(0!=t.y){var r=t.y/this.gamepadRotationSensibility;0!=r&&Math.abs(r)>.005&&(e.inertialBetaOffset+=r)}}var n=this.gamepad.leftStick;if(n&&0!=n.y){var o=n.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"},l.c([Object(w.c)()],e.prototype,"gamepadRotationSensibility",void 0),l.c([Object(w.c)()],e.prototype,"gamepadMoveSensibility",void 0),e}();je.ArcRotateCameraGamepadInput=Ke;var Qe=i(50),qe=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 i=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){i._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(e){var r,n=e.event;n.metaKey||(e.type===Qe.a.KEYDOWN?(i._ctrlPressed=n.ctrlKey,i._altPressed=n.altKey,(-1!==i.keysUp.indexOf(n.keyCode)||-1!==i.keysDown.indexOf(n.keyCode)||-1!==i.keysLeft.indexOf(n.keyCode)||-1!==i.keysRight.indexOf(n.keyCode)||-1!==i.keysReset.indexOf(n.keyCode))&&(-1===(r=i._keys.indexOf(n.keyCode))&&i._keys.push(n.keyCode),n.preventDefault&&(t||n.preventDefault()))):-1===i.keysUp.indexOf(n.keyCode)&&-1===i.keysDown.indexOf(n.keyCode)&&-1===i.keysLeft.indexOf(n.keyCode)&&-1===i.keysRight.indexOf(n.keyCode)&&-1===i.keysReset.indexOf(n.keyCode)||((r=i._keys.indexOf(n.keyCode))>=0&&i._keys.splice(r,1),n.preventDefault&&(t||n.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?a/(1+i.wheelDeltaPercentage):a*(1+i.wheelDeltaPercentage)}else o=s.wheelDelta/(40*i.wheelPrecision);else o=-(n.deltaY||n.detail)/i.wheelPrecision;o&&(i.camera.inertialRadiusOffset+=o),n.preventDefault&&(t||n.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,Pe.a.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"},l.c([Object(w.c)()],e.prototype,"wheelPrecision",void 0),l.c([Object(w.c)()],e.prototype,"wheelDeltaPercentage",void 0),e}();je.ArcRotateCameraMouseWheelInput=Ze;var Je=function(){function e(){this.buttons=[0,1,2],this.angularSensibilityX=1e3,this.angularSensibilityY=1e3,this.pinchPrecision=12,this.pinchDeltaPercentage=0,this.panningSensibility=1e3,this.multiTouchPanning=!0,this.multiTouchPanAndZoom=!0,this.pinchInwards=!0,this._isPanClick=!1}return e.prototype.attachControl=function(e,t){var i,r=this,n=this.camera.getEngine(),o=null,s=null,a=0,c=0,l=0,u={x:0,y:0,isPaning:!1,isPinching:!1};this._pointerInput=function(h,d){var f=h.event,p="touch"===h.event.pointerType;if(!n.isInVRExclusivePointerMode&&(h.type===Pe.a.POINTERMOVE||-1!==r.buttons.indexOf(f.button))){var _=f.srcElement||f.target;if(h.type===Pe.a.POINTERDOWN&&_){try{_.setPointerCapture(f.pointerId)}catch(e){}r._isPanClick=f.button===r.camera._panningMouseButton,i={x:f.clientX,y:f.clientY,pointerId:f.pointerId,type:f.pointerType},null===o?o=i:null===s&&(s=i),t||(f.preventDefault(),e.focus())}else if(h.type===Pe.a.POINTERDOUBLETAP)r.camera.useInputToRestoreState&&r.camera.restoreState();else if(h.type===Pe.a.POINTERUP&&_){try{_.releasePointerCapture(f.pointerId)}catch(e){}i=null,a=0,u.isPaning=!1,u.isPinching=!1,l=0,c=0,p||(s=null),n._badOS?o=s=null:s&&o&&o.pointerId==f.pointerId?(o=s,s=null,i={x:o.x,y:o.y,pointerId:o.pointerId,type:f.pointerType}):o&&s&&s.pointerId==f.pointerId?(s=null,i={x:o.x,y:o.y,pointerId:o.pointerId,type:f.pointerType}):o=s=null,t||f.preventDefault()}else if(h.type===Pe.a.POINTERMOVE)if(t||f.preventDefault(),o&&null===s&&i){if(0!==r.panningSensibility&&(f.ctrlKey&&r.camera._useCtrlForPanning||r._isPanClick))r.camera.inertialPanningX+=-(f.clientX-i.x)/r.panningSensibility,r.camera.inertialPanningY+=(f.clientY-i.y)/r.panningSensibility;else{var m=f.clientX-i.x,g=f.clientY-i.y;r.camera.inertialAlphaOffset-=m/r.angularSensibilityX,r.camera.inertialBetaOffset-=g/r.angularSensibilityY}i.x=f.clientX,i.y=f.clientY}else if(o&&s){var v=o.pointerId===f.pointerId?o:s;v.x=f.clientX,v.y=f.clientY;var y=r.pinchInwards?1:-1,b=o.x-s.x,T=o.y-s.y,E=b*b+T*T,x=Math.sqrt(E);if(0===a)return c=x,a=E,u.x=(o.x+s.x)/2,void(u.y=(o.y+s.y)/2);if(r.multiTouchPanAndZoom){if(r.pinchDeltaPercentage?r.camera.inertialRadiusOffset+=.001*(E-a)*r.camera.radius*r.pinchDeltaPercentage:r.camera.inertialRadiusOffset+=(E-a)/(r.pinchPrecision*((r.angularSensibilityX+r.angularSensibilityY)/2)*y),0!==r.panningSensibility){var A=(o.x+s.x)/2,P=(o.y+s.y)/2,R=A-u.x,S=P-u.y;u.x=A,u.y=P,r.camera.inertialPanningX+=-R/r.panningSensibility,r.camera.inertialPanningY+=S/r.panningSensibility}}else{if(l++,u.isPinching||l<20&&Math.abs(x-c)>r.camera.pinchToPanMaxDistance)r.pinchDeltaPercentage?r.camera.inertialRadiusOffset+=.001*(E-a)*r.camera.radius*r.pinchDeltaPercentage:r.camera.inertialRadiusOffset+=(E-a)/(r.pinchPrecision*((r.angularSensibilityX+r.angularSensibilityY)/2)*y),u.isPaning=!1,u.isPinching=!0;else if(i&&i.pointerId===v.pointerId&&0!==r.panningSensibility&&r.multiTouchPanning){if(!u.isPaning)return u.isPaning=!0,u.isPinching=!1,u.x=v.x,void(u.y=v.y);r.camera.inertialPanningX+=-(v.x-u.x)/r.panningSensibility,r.camera.inertialPanningY+=(v.y-u.y)/r.panningSensibility}i&&i.pointerId===f.pointerId&&(u.x=v.x,u.y=v.y)}a=E}}},this._observer=this.camera.getScene().onPointerObservable.add(this._pointerInput,Pe.a.POINTERDOWN|Pe.a.POINTERUP|Pe.a.POINTERMOVE|Pe.a.POINTERDOUBLETAP),this._onContextMenu=function(e){e.preventDefault()},this.camera._useCtrlForPanning||e.addEventListener("contextmenu",this._onContextMenu,!1),this._onLostFocus=function(){o=s=null,a=0,u.isPaning=!1,u.isPinching=!1,l=0,i=null,c=0},this._onMouseMove=function(e){if(n.isPointerLock){var i=e.movementX||e.mozMovementX||e.webkitMovementX||e.msMovementX||0,o=e.movementY||e.mozMovementY||e.webkitMovementY||e.msMovementY||0;r.camera.inertialAlphaOffset-=i/r.angularSensibilityX,r.camera.inertialBetaOffset-=o/r.angularSensibilityY,t||e.preventDefault()}},this._onGestureStart=function(t){void 0!==window.MSGesture&&(r._MSGestureHandler||(r._MSGestureHandler=new MSGesture,r._MSGestureHandler.target=e),r._MSGestureHandler.addPointer(t.pointerId))},this._onGesture=function(e){r.camera.radius*=e.scale,e.preventDefault&&(t||(e.stopPropagation(),e.preventDefault()))},e.addEventListener("mousemove",this._onMouseMove,!1),e.addEventListener("MSPointerDown",this._onGestureStart,!1),e.addEventListener("MSGestureChange",this._onGesture,!1),ve.h.RegisterTopRootEvents([{name:"blur",handler:this._onLostFocus}])},e.prototype.detachControl=function(e){this._onLostFocus&&ve.h.UnregisterTopRootEvents([{name:"blur",handler:this._onLostFocus}]),e&&this._observer&&(this.camera.getScene().onPointerObservable.remove(this._observer),this._observer=null,this._onContextMenu&&e.removeEventListener("contextmenu",this._onContextMenu),this._onMouseMove&&e.removeEventListener("mousemove",this._onMouseMove),this._onGestureStart&&e.removeEventListener("MSPointerDown",this._onGestureStart),this._onGesture&&e.removeEventListener("MSGestureChange",this._onGesture),this._isPanClick=!1,this.pinchInwards=!0,this._onMouseMove=null,this._onGestureStart=null,this._onGesture=null,this._MSGestureHandler=null,this._onLostFocus=null,this._onContextMenu=null)},e.prototype.getClassName=function(){return"ArcRotateCameraPointersInput"},e.prototype.getSimpleName=function(){return"pointers"},l.c([Object(w.c)()],e.prototype,"buttons",void 0),l.c([Object(w.c)()],e.prototype,"angularSensibilityX",void 0),l.c([Object(w.c)()],e.prototype,"angularSensibilityY",void 0),l.c([Object(w.c)()],e.prototype,"pinchPrecision",void 0),l.c([Object(w.c)()],e.prototype,"pinchDeltaPercentage",void 0),l.c([Object(w.c)()],e.prototype,"panningSensibility",void 0),l.c([Object(w.c)()],e.prototype,"multiTouchPanning",void 0),l.c([Object(w.c)()],e.prototype,"multiTouchPanAndZoom",void 0),e}();je.ArcRotateCameraPointersInput=Je;var $e=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addMouseWheel=function(){return this.add(new Ze),this},t.prototype.addPointers=function(){return this.add(new Je),this},t.prototype.addKeyboard=function(){return this.add(new qe),this},t}(We);$e.prototype.addVRDeviceOrientation=function(){return this.add(new et),this};var et=function(){function e(){this.alphaCorrection=1,this.gammaCorrection=1,this._alpha=0,this._gamma=0,this._dirty=!1,this._deviceOrientationHandler=this._onOrientationEvent.bind(this)}return e.prototype.attachControl=function(e,t){this.camera.attachControl(e,t),window.addEventListener("deviceorientation",this._deviceOrientationHandler)},e.prototype._onOrientationEvent=function(e){null!==e.alpha&&(this._alpha=(0|+e.alpha)*this.alphaCorrection),null!==e.gamma&&(this._gamma=(0|+e.gamma)*this.gammaCorrection),this._dirty=!0},e.prototype.checkInputs=function(){this._dirty&&(this._dirty=!1,this._gamma<0&&(this._gamma=180+this._gamma),this.camera.alpha=-this._alpha/180*Math.PI%Math.PI*2,this.camera.beta=this._gamma/180*Math.PI)},e.prototype.detachControl=function(e){window.removeEventListener("deviceorientation",this._deviceOrientationHandler)},e.prototype.getClassName=function(){return"ArcRotateCameraVRDeviceOrientationInput"},e.prototype.getSimpleName=function(){return"VRDeviceOrientation"},e}();je.ArcRotateCameraVRDeviceOrientationInput=et;var tt=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 i=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){i._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(e){var r,n=e.event;e.type===Qe.a.KEYDOWN?-1===i.keysForward.indexOf(n.keyCode)&&-1===i.keysBackward.indexOf(n.keyCode)&&-1===i.keysUp.indexOf(n.keyCode)&&-1===i.keysDown.indexOf(n.keyCode)&&-1===i.keysLeft.indexOf(n.keyCode)&&-1===i.keysRight.indexOf(n.keyCode)||(-1===(r=i._keys.indexOf(n.keyCode))&&i._keys.push(n.keyCode),t||n.preventDefault()):-1===i.keysForward.indexOf(n.keyCode)&&-1===i.keysBackward.indexOf(n.keyCode)&&-1===i.keysUp.indexOf(n.keyCode)&&-1===i.keysDown.indexOf(n.keyCode)&&-1===i.keysLeft.indexOf(n.keyCode)&&-1===i.keysRight.indexOf(n.keyCode)||((r=i._keys.indexOf(n.keyCode))>=0&&i._keys.splice(r,1),t||n.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&&i._keys.splice(r,1),t||n.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(),i=new o.x(0,0,t*this._offsetY/this.touchMoveSensibility);o.j.RotationYawPitchRollToRef(e.rotation.y,e.rotation.x,0,e._cameraRotationMatrix),e.cameraDirection.addInPlace(o.x.TransformCoordinates(i,e._cameraRotationMatrix))}}},e.prototype.getClassName=function(){return"FreeCameraTouchInput"},e.prototype.getSimpleName=function(){return"touch"},l.c([Object(w.c)()],e.prototype,"touchAngularSensibility",void 0),l.c([Object(w.c)()],e.prototype,"touchMoveSensibility",void 0),e}();je.FreeCameraTouchInput=ot;var st=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addKeyboard=function(){return this.add(new rt),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this.add(new nt(e)),this},t.prototype.addTouch=function(){return this.add(new ot),this},t}(We);st.prototype.addDeviceOrientation=function(){return this.add(new at),this};var at=function(){function e(){var e=this;this._screenOrientationAngle=0,this._screenQuaternion=new o.q,this._alpha=0,this._beta=0,this._gamma=0,this._orientationChanged=function(){e._screenOrientationAngle=void 0!==window.orientation?+window.orientation:window.screen.orientation&&window.screen.orientation.angle?window.screen.orientation.angle:0,e._screenOrientationAngle=-ve.h.ToRadians(e._screenOrientationAngle/2),e._screenQuaternion.copyFromFloats(0,Math.sin(e._screenOrientationAngle),0,Math.cos(e._screenOrientationAngle))},this._deviceOrientation=function(t){e._alpha=null!==t.alpha?t.alpha:0,e._beta=null!==t.beta?t.beta:0,e._gamma=null!==t.gamma?t.gamma:0},this._constantTranform=new o.q(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this._orientationChanged()}return Object.defineProperty(e.prototype,"camera",{get:function(){return this._camera},set:function(e){this._camera=e,null==this._camera||this._camera.rotationQuaternion||(this._camera.rotationQuaternion=new o.q)},enumerable:!0,configurable:!0}),e.prototype.attachControl=function(e,t){window.addEventListener("orientationchange",this._orientationChanged),window.addEventListener("deviceorientation",this._deviceOrientation),this._orientationChanged()},e.prototype.detachControl=function(e){window.removeEventListener("orientationchange",this._orientationChanged),window.removeEventListener("deviceorientation",this._deviceOrientation)},e.prototype.checkInputs=function(){this._alpha&&(o.q.RotationYawPitchRollToRef(ve.h.ToRadians(this._alpha),ve.h.ToRadians(this._beta),-ve.h.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}();je.FreeCameraDeviceOrientationInput=at;var ct=function(){function e(){this.gamepadAngularSensibility=200,this.gamepadMoveSensibility=40,this._cameraTransform=o.j.Identity(),this._deltaTransform=o.x.Zero(),this._vector3=o.x.Zero(),this._vector2=o.w.Zero()}return e.prototype.attachControl=function(e,t){var i=this,r=this.camera.getScene().gamepadManager;this._onGamepadConnectedObserver=r.onGamepadConnectedObservable.add(function(e){e.type!==Xe.POSE_ENABLED&&(i.gamepad&&e.type!==Xe.XBOX||(i.gamepad=e))}),this._onGamepadDisconnectedObserver=r.onGamepadDisconnectedObservable.add(function(e){i.gamepad===e&&(i.gamepad=null)}),this.gamepad=r.getGamepadByType(Xe.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,i=t.x/this.gamepadMoveSensibility,r=t.y/this.gamepadMoveSensibility;t.x=Math.abs(i)>.005?0+i:0,t.y=Math.abs(r)>.005?0+r:0;var n=this.gamepad.rightStick;if(n){var s=n.x/this.gamepadAngularSensibility,a=n.y/this.gamepadAngularSensibility;n.x=Math.abs(s)>.001?0+s:0,n.y=Math.abs(a)>.001?0+a:0}else n={x:0,y:0};e.rotationQuaternion?e.rotationQuaternion.toRotationMatrix(this._cameraTransform):o.j.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),o.x.TransformCoordinatesToRef(this._vector3,this._cameraTransform,this._deltaTransform),e.cameraDirection.addInPlace(this._deltaTransform),this._vector2.copyFromFloats(n.y,n.x),e.cameraRotation.addInPlace(this._vector2)}},e.prototype.getClassName=function(){return"FreeCameraGamepadInput"},e.prototype.getSimpleName=function(){return"gamepad"},l.c([Object(w.c)()],e.prototype,"gamepadAngularSensibility",void 0),l.c([Object(w.c)()],e.prototype,"gamepadMoveSensibility",void 0),e}();je.FreeCameraGamepadInput=ct;var lt,ut=i(59);!function(e){e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(lt||(lt={}));var ht=function(){function e(t){var i=this;if(this._leftJoystick=!!t,e._globalJoystickIndex++,this._axisTargetedByLeftAndRight=lt.X,this._axisTargetedByUpAndDown=lt.Y,this.reverseLeftRight=!1,this.reverseUpDown=!1,this._touches=new ut.a,this.deltaPosition=o.x.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 r=e.Canvas.getContext("2d");if(!r)throw new Error("Unable to create canvas for virtual joystick");e.vjCanvasContext=r,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 o.w(0,0),this._joystickPreviousPointerPos=new o.w(0,0),this._joystickPointerStartPos=new o.w(0,0),this._deltaJoystickVector=new o.w(0,0),this._onPointerDownHandlerRef=function(e){i._onPointerDown(e)},this._onPointerMoveHandlerRef=function(e){i._onPointerMove(e)},this._onPointerUpHandlerRef=function(e){i._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(){i._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 lt.X:this.deltaPosition.x=Math.min(1,Math.max(-1,t));break;case lt.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,t));break;case lt.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,t))}var i=(this.reverseUpDown?1:-1)*this._deltaJoystickVector.y/this._inversedSensibility;switch(this._axisTargetedByUpAndDown){case lt.X:this.deltaPosition.x=Math.min(1,Math.max(-1,i));break;case lt.Y:this.deltaPosition.y=Math.min(1,Math.max(-1,i));break;case lt.Z:this.deltaPosition.z=Math.min(1,Math.max(-1,i))}}else{var r=this._touches.get(e.pointerId.toString());r&&(r.x=e.clientX,r.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 i=this._touches.get(t.pointerId.toString());i&&e.vjCanvasContext.clearRect(i.prevX-44,i.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 lt.X:case lt.Y:case lt.Z:this._axisTargetedByLeftAndRight=e;break;default:this._axisTargetedByLeftAndRight=lt.X}},e.prototype.setAxisForUpDown=function(e){switch(e){case lt.X:case lt.Y:case lt.Z:this._axisTargetedByUpAndDown=e;break;default:this._axisTargetedByUpAndDown=lt.Y}},e.prototype._drawVirtualJoystick=function(){var t=this;this.pressed&&this._touches.forEach(function(i,r){r.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(r.prevX-44,r.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(r.x,r.y,40,0,2*Math.PI,!0),e.vjCanvasContext.stroke(),e.vjCanvasContext.closePath(),r.prevX=r.x,r.prevY=r.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}();st.prototype.addVirtualJoystick=function(){return this.add(new dt),this};var dt=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(),i=o.j.RotationYawPitchRoll(e.rotation.y,e.rotation.x,0),r=o.x.TransformCoordinates(new o.x(this._leftjoystick.deltaPosition.x*t,this._leftjoystick.deltaPosition.y*t,this._leftjoystick.deltaPosition.z*t),i);e.cameraDirection=e.cameraDirection.add(r),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 ht(!0),this._leftjoystick.setAxisForUpDown(lt.Z),this._leftjoystick.setAxisForLeftRight(lt.X),this._leftjoystick.setJoystickSensibility(.15),this._rightjoystick=new ht(!1),this._rightjoystick.setAxisForUpDown(lt.X),this._rightjoystick.setAxisForLeftRight(lt.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}();je.FreeCameraVirtualJoystickInput=dt;var ft=function(e){function t(t,i,r,n){void 0===n&&(n=!0);var s=e.call(this,t,i,r,n)||this;return s.cameraDirection=new o.x(0,0,0),s.cameraRotation=new o.w(0,0),s.updateUpVectorFromRotation=!1,s._tmpQuaternion=new o.q,s.rotation=new o.x(0,0,0),s.speed=2,s.noRotationConstraint=!1,s.lockedTarget=null,s._currentTarget=o.x.Zero(),s._initialFocalDistance=1,s._viewMatrix=o.j.Zero(),s._camMatrix=o.j.Zero(),s._cameraTransformMatrix=o.j.Zero(),s._cameraRotationMatrix=o.j.Zero(),s._referencePoint=new o.x(0,0,1),s._transformedReferencePoint=o.x.Zero(),s._globalCurrentTarget=o.x.Zero(),s._globalCurrentUpVector=o.x.Zero(),s._defaultUp=o.x.Up(),s._cachedRotationZ=0,s._cachedQuaternionRotationZ=0,s}return l.d(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 o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new o.q(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this);var i=this._getLockedTargetPosition();i?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(i):this._cache.lockedTarget=i.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+=o.h),o.j.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&&o.q.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(o.t.Matrix[0]),o.x.TransformNormalToRef(this.cameraDirection,o.t.Matrix[0],o.t.Vector3[0]),void this.position.addInPlace(o.t.Vector3[0]);this.position.addInPlace(this.cameraDirection)},t.prototype._checkInputs=function(){var t=this._decideIfNeedsToMove(),i=Math.abs(this.cameraRotation.x)>0||Math.abs(this.cameraRotation.y)>0;if(t&&this._updatePosition(),i){if(this.rotation.x+=this.cameraRotation.x,this.rotation.y+=this.cameraRotation.y,this.rotationQuaternion)this.rotation.lengthSquared()&&o.q.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this.rotationQuaternion);if(!this.noRotationConstraint){var r=Math.PI/2*.95;this.rotation.x>r&&(this.rotation.x=r),this.rotation.x<-r&&(this.rotation.x=-r)}}t&&(Math.abs(this.cameraDirection.x)_e.b.CollisionsEpsilon&&(s.position.addInPlace(s._diffPosition),s.onCollide&&i&&s.onCollide(i))},s.inputs=new st(s),s.inputs.addKeyboard().addMouse(),s}return l.d(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.x(0,0,0),this.cameraRotation=new o.w(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.x.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 i=e;this.applyGravity&&(i=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,i,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=o.x.Zero(),this._transformedDirection=o.x.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"},l.c([Object(w.n)()],t.prototype,"ellipsoid",void 0),l.c([Object(w.n)()],t.prototype,"ellipsoidOffset",void 0),l.c([Object(w.c)()],t.prototype,"checkCollisions",void 0),l.c([Object(w.c)()],t.prototype,"applyGravity",void 0),t}(ft);F.a.AddNodeConstructor("TouchCamera",function(e,t){return function(){return new _t(e,o.x.Zero(),t)}});var _t=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.inputs.addTouch(),n._setupInputs(),n}return l.d(t,e),Object.defineProperty(t.prototype,"touchAngularSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchAngularSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchAngularSensibility=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touchMoveSensibility",{get:function(){var e=this.inputs.attached.touch;return e?e.touchMoveSensibility:0},set:function(e){var t=this.inputs.attached.touch;t&&(t.touchMoveSensibility=e)},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"TouchCamera"},t.prototype._setupInputs=function(){var e=this.inputs.attached.mouse;e&&(e.touchEnabled=!1)},t}(pt);F.a.AddNodeConstructor("ArcRotateCamera",function(e,t){return function(){return new mt(e,0,0,1,o.x.Zero(),t)}});var mt=function(e){function t(t,i,r,s,a,c,l){void 0===l&&(l=!0);var u=e.call(this,t,o.x.Zero(),c,l)||this;return u.inertialAlphaOffset=0,u.inertialBetaOffset=0,u.inertialRadiusOffset=0,u.lowerAlphaLimit=null,u.upperAlphaLimit=null,u.lowerBetaLimit=.01,u.upperBetaLimit=Math.PI-.01,u.lowerRadiusLimit=null,u.upperRadiusLimit=null,u.inertialPanningX=0,u.inertialPanningY=0,u.pinchToPanMaxDistance=20,u.panningDistanceLimit=null,u.panningOriginTarget=o.x.Zero(),u.panningInertia=.9,u.zoomOnFactor=1,u.targetScreenOffset=o.w.Zero(),u.allowUpsideDown=!0,u.useInputToRestoreState=!0,u._viewMatrix=new o.j,u.panningAxis=new o.x(1,1,0),u.onMeshTargetChangedObservable=new n.c,u.checkCollisions=!1,u.collisionRadius=new o.x(.5,.5,.5),u._previousPosition=o.x.Zero(),u._collisionVelocity=o.x.Zero(),u._newPosition=o.x.Zero(),u._computationVector=o.x.Zero(),u._onCollisionPositionChange=function(e,t,i){void 0===i&&(i=null),i?(u.setPosition(t),u.onCollide&&u.onCollide(i)):u._previousPosition.copyFrom(u.position);var r=Math.cos(u.alpha),n=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*r*s,u.radius*o,u.radius*n*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=o.x.Zero(),a&&u.setTarget(a),u.alpha=i,u.beta=r,u.radius=s,u.getViewMatrix(),u.inputs=new $e(u),u.inputs.addKeyboard().addMouseWheel().addPointers(),u}return l.d(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,"angularSensibilityX",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityX:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityX=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"angularSensibilityY",{get:function(){var e=this.inputs.attached.pointers;return e?e.angularSensibilityY:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.angularSensibilityY=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pinchPrecision",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchPrecision:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchPrecision=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pinchDeltaPercentage",{get:function(){var e=this.inputs.attached.pointers;return e?e.pinchDeltaPercentage:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.pinchDeltaPercentage=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"panningSensibility",{get:function(){var e=this.inputs.attached.pointers;return e?e.panningSensibility:0},set:function(e){var t=this.inputs.attached.pointers;t&&(t.panningSensibility=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysUp",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysUp:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysUp=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysDown",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysDown:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysDown=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysLeft",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysLeft:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysLeft=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keysRight",{get:function(){var e=this.inputs.attached.keyboard;return e?e.keysRight:[]},set:function(e){var t=this.inputs.attached.keyboard;t&&(t.keysRight=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wheelPrecision",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelPrecision:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelPrecision=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wheelDeltaPercentage",{get:function(){var e=this.inputs.attached.mousewheel;return e?e.wheelDeltaPercentage:0},set:function(e){var t=this.inputs.attached.mousewheel;t&&(t.wheelDeltaPercentage=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bouncingBehavior",{get:function(){return this._bouncingBehavior},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useBouncingBehavior",{get:function(){return null!=this._bouncingBehavior},set:function(e){e!==this.useBouncingBehavior&&(e?(this._bouncingBehavior=new Se,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 Ce,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 Re,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 o.x(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=o.w.Zero()},t.prototype._updateCache=function(t){t||e.prototype._updateCache.call(this),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)},t.prototype._getTargetPosition=function(){if(this._targetHost&&this._targetHost.getAbsolutePosition){var e=this._targetHost.absolutePosition;this._targetBoundingCenter?e.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(e)}var t=this._getLockedTargetPosition();return t||this._target},t.prototype.storeState=function(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),e.prototype.storeState.call(this)},t.prototype._restoreStateValues=function(){return!!e.prototype._restoreStateValues.call(this)&&(this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.setTarget(this._storedTarget.clone()),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0)},t.prototype._isSynchronizedViewMatrix=function(){return!!e.prototype._isSynchronizedViewMatrix.call(this)&&(this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset))},t.prototype.attachControl=function(e,t,i,r){var n=this;void 0===i&&(i=!0),void 0===r&&(r=2),this._useCtrlForPanning=i,this._panningMouseButton=r,this.inputs.attachElement(e,t),this._reset=function(){n.inertialAlphaOffset=0,n.inertialBetaOffset=0,n.inertialRadiusOffset=0,n.inertialPanningX=0,n.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),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4),this.alpha=Math.acos(this._computationVector.x/Math.sqrt(Math.pow(this._computationVector.x,2)+Math.pow(this._computationVector.z,2))),this._computationVector.z<0&&(this.alpha=2*Math.PI-this.alpha),this.beta=Math.acos(this._computationVector.y/this.radius),this._checkLimits()},t.prototype.setPosition=function(e){this.position.equals(e)||(this.position.copyFrom(e),this.rebuildAnglesAndRadius())},t.prototype.setTarget=function(e,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=!1),e.getBoundingInfo)this._targetBoundingCenter=t?e.getBoundingInfo().boundingBox.centerWorld.clone():null,this._targetHost=e,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{var r=e,n=this._getTargetPosition();if(n&&!i&&n.equals(r))return;this._targetHost=null,this._target=r,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}this.rebuildAnglesAndRadius()},t.prototype._getViewMatrix=function(){var e=Math.cos(this.alpha),t=Math.sin(this.alpha),i=Math.cos(this.beta),r=Math.sin(this.beta);0===r&&(r=1e-4);var n=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*e*r,this.radius*i,this.radius*t*r),0!==this.upVector.x||1!==this.upVector.y||0!==this.upVector.z){this._tempAxisVector||(this._tempAxisVector=new o.x,this._tempAxisRotationMatrix=new o.j),o.x.CrossToRef(o.x.Up(),this.upVector,this._tempAxisVector),this._tempAxisVector.normalize();var s=Math.acos(o.x.Dot(o.x.UpReadOnly,this.upVector));o.j.RotationAxisToRef(this._tempAxisVector,s,this._tempAxisRotationMatrix),this._tempAxisVector.copyFrom(this._computationVector),o.x.TransformCoordinatesToRef(this._tempAxisVector,this._tempAxisRotationMatrix,this._computationVector)}if(n.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){var a=this.getScene().collisionCoordinator;this._collider||(this._collider=a.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this.position,this._collisionVelocity),this._collisionTriggered=!0,a.getNewPosition(this.position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this.position.copyFrom(this._newPosition);var c=this.upVector;this.allowUpsideDown&&r<0&&(c=(c=c.clone()).negate()),this._computeViewMatrix(this.position,n,c),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget=n,this._viewMatrix},t.prototype.zoomOn=function(e,t){void 0===t&&(t=!1),e=e||this.getScene().meshes;var i=de.a.MinMax(e),r=o.x.Distance(i.min,i.max);this.radius=r*this.zoomOnFactor,this.focusOn({min:i.min,max:i.max,distance:r},t)},t.prototype.focusOn=function(e,t){var i,r;if(void 0===t&&(t=!1),void 0===e.min){var n=e||this.getScene().meshes;i=de.a.MinMax(n),r=o.x.Distance(i.min,i.max)}else{i=e,r=e.distance}this._target=de.a.Center(i),t||(this.maxZ=2*r)},t.prototype.createRigCamera=function(e,i){var r=0;switch(this.cameraRigMode){case Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Fe.a.RIG_MODE_VR:r=this._cameraRigParams.stereoHalfAngle*(0===i?1:-1);break;case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:r=this._cameraRigParams.stereoHalfAngle*(0===i?-1:1)}var n=new t(e,this.alpha+r,this.beta,this.radius,this._target,this.getScene());return n._cameraRigParams={},n},t.prototype._updateRigCameras=function(){var t=this._rigCameras[0],i=this._rigCameras[1];switch(t.beta=i.beta=this.beta,this.cameraRigMode){case Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Fe.a.RIG_MODE_VR:t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,i.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,i.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"},l.c([Object(w.c)()],t.prototype,"alpha",void 0),l.c([Object(w.c)()],t.prototype,"beta",void 0),l.c([Object(w.c)()],t.prototype,"radius",void 0),l.c([Object(w.n)("target")],t.prototype,"_target",void 0),l.c([Object(w.c)()],t.prototype,"inertialAlphaOffset",void 0),l.c([Object(w.c)()],t.prototype,"inertialBetaOffset",void 0),l.c([Object(w.c)()],t.prototype,"inertialRadiusOffset",void 0),l.c([Object(w.c)()],t.prototype,"lowerAlphaLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperAlphaLimit",void 0),l.c([Object(w.c)()],t.prototype,"lowerBetaLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperBetaLimit",void 0),l.c([Object(w.c)()],t.prototype,"lowerRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"inertialPanningX",void 0),l.c([Object(w.c)()],t.prototype,"inertialPanningY",void 0),l.c([Object(w.c)()],t.prototype,"pinchToPanMaxDistance",void 0),l.c([Object(w.c)()],t.prototype,"panningDistanceLimit",void 0),l.c([Object(w.n)()],t.prototype,"panningOriginTarget",void 0),l.c([Object(w.c)()],t.prototype,"panningInertia",void 0),l.c([Object(w.c)()],t.prototype,"zoomOnFactor",void 0),l.c([Object(w.c)()],t.prototype,"targetScreenOffset",void 0),l.c([Object(w.c)()],t.prototype,"allowUpsideDown",void 0),l.c([Object(w.c)()],t.prototype,"useInputToRestoreState",void 0),t}(ft);F.a.AddNodeConstructor("DeviceOrientationCamera",function(e,t){return function(){return new gt(e,o.x.Zero(),t)}});var gt=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n._quaternionCache=new o.q,n.inputs.addDeviceOrientation(),n}return l.d(t,e),t.prototype.getClassName=function(){return"DeviceOrientationCamera"},t.prototype._checkInputs=function(){e.prototype._checkInputs.call(this),this._quaternionCache.copyFrom(this.rotationQuaternion),this._initialQuaternion&&this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)},t.prototype.resetToCurrentRotation=function(e){var t=this;void 0===e&&(e=o.c.Y),this.rotationQuaternion&&(this._initialQuaternion||(this._initialQuaternion=new o.q),this._initialQuaternion.copyFrom(this._quaternionCache||this.rotationQuaternion),["x","y","z"].forEach(function(i){e[i]?t._initialQuaternion[i]*=-1:t._initialQuaternion[i]=0}),this._initialQuaternion.normalize(),this._initialQuaternion.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion))},t}(pt),vt=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addKeyboard=function(){return this.add(new tt),this},t.prototype.addMouse=function(e){return void 0===e&&(e=!0),this.add(new it(e)),this},t}(We),yt=function(e){function t(t,i,r,n){void 0===n&&(n=!0);var s=e.call(this,t,i,r,n)||this;return s.ellipsoid=new o.x(1,1,1),s.ellipsoidOffset=new o.x(0,0,0),s.checkCollisions=!1,s.applyGravity=!1,s.cameraDirection=o.x.Zero(),s._trackRoll=0,s.rollCorrect=100,s.bankedTurn=!1,s.bankedTurnLimit=Math.PI/2,s.bankedTurnMultiplier=1,s._needMoveForGravity=!1,s._oldPosition=o.x.Zero(),s._diffPosition=o.x.Zero(),s._newPosition=o.x.Zero(),s._collisionMask=-1,s._onCollisionPositionChange=function(e,t,i){void 0===i&&(i=null);var r;r=t,s._newPosition.copyFrom(r),s._newPosition.subtractToRef(s._oldPosition,s._diffPosition),s._diffPosition.length()>_e.b.CollisionsEpsilon&&(s.position.addInPlace(s._diffPosition),s.onCollide&&i&&s.onCollide(i))},s.inputs=new vt(s),s.inputs.addKeyboard().addMouse(),s}return l.d(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.x(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.x.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 i=e;this.applyGravity&&(i=e.add(this.getScene().gravity)),t.getNewPosition(this._oldPosition,i,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)},t.prototype._checkInputs=function(){this._localDirection||(this._localDirection=o.x.Zero(),this._transformedDirection=o.x.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,i=t-this.rotation.z;Math.abs(i)>=.001&&(this.rotation.z+=i/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"},l.c([Object(w.n)()],t.prototype,"ellipsoid",void 0),l.c([Object(w.n)()],t.prototype,"ellipsoidOffset",void 0),l.c([Object(w.c)()],t.prototype,"checkCollisions",void 0),l.c([Object(w.c)()],t.prototype,"applyGravity",void 0),t}(ft),bt=function(){function e(){this.keysHeightOffsetIncr=[38],this.keysHeightOffsetDecr=[40],this.keysHeightOffsetModifierAlt=!1,this.keysHeightOffsetModifierCtrl=!1,this.keysHeightOffsetModifierShift=!1,this.keysRotationOffsetIncr=[37],this.keysRotationOffsetDecr=[39],this.keysRotationOffsetModifierAlt=!1,this.keysRotationOffsetModifierCtrl=!1,this.keysRotationOffsetModifierShift=!1,this.keysRadiusIncr=[40],this.keysRadiusDecr=[38],this.keysRadiusModifierAlt=!0,this.keysRadiusModifierCtrl=!1,this.keysRadiusModifierShift=!1,this.heightSensibility=1,this.rotationSensibility=1,this.radiusSensibility=1,this._keys=new Array}return e.prototype.attachControl=function(e,t){var i=this;this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(function(){i._keys=[]}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(function(e){var r,n=e.event;n.metaKey||(e.type===Qe.a.KEYDOWN?(i._ctrlPressed=n.ctrlKey,i._altPressed=n.altKey,i._shiftPressed=n.shiftKey,(-1!==i.keysHeightOffsetIncr.indexOf(n.keyCode)||-1!==i.keysHeightOffsetDecr.indexOf(n.keyCode)||-1!==i.keysRotationOffsetIncr.indexOf(n.keyCode)||-1!==i.keysRotationOffsetDecr.indexOf(n.keyCode)||-1!==i.keysRadiusIncr.indexOf(n.keyCode)||-1!==i.keysRadiusDecr.indexOf(n.keyCode))&&(-1===(r=i._keys.indexOf(n.keyCode))&&i._keys.push(n.keyCode),n.preventDefault&&(t||n.preventDefault()))):-1===i.keysHeightOffsetIncr.indexOf(n.keyCode)&&-1===i.keysHeightOffsetDecr.indexOf(n.keyCode)&&-1===i.keysRotationOffsetIncr.indexOf(n.keyCode)&&-1===i.keysRotationOffsetDecr.indexOf(n.keyCode)&&-1===i.keysRadiusIncr.indexOf(n.keyCode)&&-1===i.keysRadiusDecr.indexOf(n.keyCode)||((r=i._keys.indexOf(n.keyCode))>=0&&i._keys.splice(r,1),n.preventDefault&&(t||n.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},l.c([Object(w.c)()],e.prototype,"keysHeightOffsetIncr",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetDecr",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetModifierAlt",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetModifierCtrl",void 0),l.c([Object(w.c)()],e.prototype,"keysHeightOffsetModifierShift",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetIncr",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetDecr",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetModifierAlt",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetModifierCtrl",void 0),l.c([Object(w.c)()],e.prototype,"keysRotationOffsetModifierShift",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusIncr",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusDecr",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusModifierAlt",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusModifierCtrl",void 0),l.c([Object(w.c)()],e.prototype,"keysRadiusModifierShift",void 0),l.c([Object(w.c)()],e.prototype,"heightSensibility",void 0),l.c([Object(w.c)()],e.prototype,"rotationSensibility",void 0),l.c([Object(w.c)()],e.prototype,"radiusSensibility",void 0),e}();je.FollowCameraKeyboardMoveInput=bt;var Tt=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 i=this;this._wheel=function(e,r){if(e.type===Pe.a.POINTERWHEEL){var n=e.event,o=0,s=Math.max(-1,Math.min(1,n.deltaY||n.wheelDelta||-n.detail));i.wheelDeltaPercentage?(console.assert(i.axisControlRadius+i.axisControlHeight+i.axisControlRotation<=1,"wheelDeltaPercentage only usable when mouse wheel controlls ONE axis. Currently enabled: axisControlRadius: "+i.axisControlRadius+", axisControlHeightOffset: "+i.axisControlHeight+", axisControlRotationOffset: "+i.axisControlRotation),i.axisControlRadius?o=.01*s*i.wheelDeltaPercentage*i.camera.radius:i.axisControlHeight?o=.01*s*i.wheelDeltaPercentage*i.camera.heightOffset:i.axisControlRotation&&(o=.01*s*i.wheelDeltaPercentage*i.camera.rotationOffset)):o=s*i.wheelPrecision,o&&(i.axisControlRadius?i.camera.radius+=o:i.axisControlHeight?i.camera.heightOffset-=o:i.axisControlRotation&&(i.camera.rotationOffset-=o)),n.preventDefault&&(t||n.preventDefault())}},this._observer=this.camera.getScene().onPointerObservable.add(this._wheel,Pe.a.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"},l.c([Object(w.c)()],e.prototype,"axisControlRadius",void 0),l.c([Object(w.c)()],e.prototype,"axisControlHeight",void 0),l.c([Object(w.c)()],e.prototype,"axisControlRotation",void 0),l.c([Object(w.c)()],e.prototype,"wheelPrecision",void 0),l.c([Object(w.c)()],e.prototype,"wheelDeltaPercentage",void 0),e}();je.FollowCameraMouseWheelInput=Tt;var Et=function(e){function t(t){return e.call(this,t)||this}return l.d(t,e),t.prototype.addKeyboard=function(){return this.add(new bt),this},t.prototype.addMouseWheel=function(){return this.add(new Tt),this},t.prototype.addPointers=function(){return console.warn("Pointer support not yet implemented for FollowCamera."),this},t.prototype.addVRDeviceOrientation=function(){return console.warn("DeviceOrientation support not yet implemented for FollowCamera."),this},t}(We);F.a.AddNodeConstructor("FollowCamera",function(e,t){return function(){return new xt(e,o.x.Zero(),t)}}),F.a.AddNodeConstructor("ArcFollowCamera",function(e,t){return function(){return new At(e,0,0,1,null,t)}});var xt=function(e){function t(t,i,r,n){void 0===n&&(n=null);var o=e.call(this,t,i,r)||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=n,o.inputs=new Et(o),o.inputs.addKeyboard().addMouseWheel(),o}return l.d(t,e),t.prototype._follow=function(e){if(e){var t;if(e.rotationQuaternion){var i=new o.j;e.rotationQuaternion.toRotationMatrix(i),t=Math.atan2(i.m[8],i.m[10])}else t=e.rotation.y;var r=ve.h.ToRadians(this.rotationOffset)+t,n=e.getAbsolutePosition(),s=n.x+Math.sin(r)*this.radius,a=n.z+Math.cos(r)*this.radius,c=s-this.position.x,l=n.y+this.heightOffset-this.position.y,u=a-this.position.z,h=c*this.cameraAcceleration*2,d=l*this.cameraAcceleration,f=u*this.cameraAcceleration*2;(h>this.maxCameraSpeed||h<-this.maxCameraSpeed)&&(h=h<1?-this.maxCameraSpeed:this.maxCameraSpeed),(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),this.position=new o.x(this.position.x+h,this.position.y+d,this.position.z+f),this.setTarget(n)}},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"},l.c([Object(w.c)()],t.prototype,"radius",void 0),l.c([Object(w.c)()],t.prototype,"lowerRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperRadiusLimit",void 0),l.c([Object(w.c)()],t.prototype,"rotationOffset",void 0),l.c([Object(w.c)()],t.prototype,"lowerRotationOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperRotationOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"heightOffset",void 0),l.c([Object(w.c)()],t.prototype,"lowerHeightOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"upperHeightOffsetLimit",void 0),l.c([Object(w.c)()],t.prototype,"cameraAcceleration",void 0),l.c([Object(w.c)()],t.prototype,"maxCameraSpeed",void 0),l.c([Object(w.j)("lockedTargetId")],t.prototype,"lockedTarget",void 0),t}(ft),At=function(e){function t(t,i,r,n,s,a){var c=e.call(this,t,o.x.Zero(),a)||this;return c.alpha=i,c.beta=r,c.radius=n,c.target=s,c._cartesianCoordinates=o.x.Zero(),c._follow(),c}return l.d(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}(ft);F.a.AddNodeConstructor("FreeCamera",function(e,t){return function(){return new Pt(e,o.x.Zero(),t)}});var Pt=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.inputs.addGamepad(),n}return l.d(t,e),Object.defineProperty(t.prototype,"gamepadAngularSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadAngularSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadAngularSensibility=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"gamepadMoveSensibility",{get:function(){var e=this.inputs.attached.gamepad;return e?e.gamepadMoveSensibility:0},set:function(e){var t=this.inputs.attached.gamepad;t&&(t.gamepadMoveSensibility=e)},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"UniversalCamera"},t}(_t);Fe.a._createDefaultParsedCamera=function(e,t){return new Pt(e,o.x.Zero(),t)},F.a.AddNodeConstructor("GamepadCamera",function(e,t){return function(){return new Rt(e,o.x.Zero(),t)}});var Rt=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return l.d(t,e),t.prototype.getClassName=function(){return"GamepadCamera"},t}(Pt),St=i(27),Ct=i(5),Mt="\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}";Ct.a.ShadersStore.postprocessVertexShader=Mt;var Ot=function(){function e(e,t,i,r,s,a,c,l,u,h,d,f,p,m){void 0===c&&(c=_.a.TEXTURE_NEAREST_SAMPLINGMODE),void 0===h&&(h=null),void 0===d&&(d=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===f&&(f="postprocess"),void 0===m&&(m=!1),this.name=e,this.width=-1,this.height=-1,this._outputTexture=null,this.autoClear=!0,this.alphaMode=_.a.ALPHA_DISABLE,this.animations=new Array,this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=_.a.SCALEMODE_FLOOR,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this._reusable=!1,this._textures=new St.a(2),this._currentRenderTextureInd=0,this._scaleRatio=new o.w(1,1),this._texelSize=o.w.Zero(),this.onActivateObservable=new n.c,this.onSizeChangedObservable=new n.c,this.onApplyObservable=new n.c,this.onBeforeRenderObservable=new n.c,this.onAfterRenderObservable=new n.c,null!=a?(this._camera=a,this._scene=a.getScene(),a.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.postProcesses.push(this)):l&&(this._engine=l,this._engine.postProcesses.push(this)),this._options=s,this.renderTargetSamplingMode=c||_.a.TEXTURE_NEAREST_SAMPLINGMODE,this._reusable=u||!1,this._textureType=d,this._samplers=r||[],this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=f,this._parameters=i||[],this._parameters.push("scale"),this._indexParameters=p,m||this.updateEffect(h)}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._samples},set:function(e){var t=this;this._samples=e,this._textures.forEach(function(e){e.samples!==t._samples&&t._engine.updateRenderTargetTextureSampleCount(e,t._samples)})},enumerable:!0,configurable:!0}),e.prototype.getEffectName=function(){return this._fragmentUrl},Object.defineProperty(e.prototype,"onActivate",{set:function(e){this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSizeChanged",{set:function(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onApply",{set:function(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputTexture",{get:function(){return this._textures.data[this._currentRenderTextureInd]},set:function(e){this._forcedOutputTexture=e},enumerable:!0,configurable:!0}),e.prototype.getCamera=function(){return this._camera},Object.defineProperty(e.prototype,"texelSize",{get:function(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)},enumerable:!0,configurable:!0}),e.prototype.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 St.a(2)),this._shareOutputWithPostProcess=null},e.prototype.updateEffect=function(e,t,i,r,n,o){void 0===e&&(e=null),void 0===t&&(t=null),void 0===i&&(i=null),this._effect=this._engine.createEffect({vertex:this._vertexUrl,fragment:this._fragmentUrl},["position"],t||this._parameters,i||this._samplers,null!==e?e:"",void 0,n,o,r||this._indexParameters)},e.prototype.isReusable=function(){return this._reusable},e.prototype.markTextureDirty=function(){this.width=-1},e.prototype.activate=function(e,t,i){var r=this;void 0===t&&(t=null);var n=(e=e||this._camera).getScene(),o=n.getEngine(),s=o.getCaps().maxTextureSize,a=(t?t.width:this._engine.getRenderWidth(!0))*this._options|0,c=(t?t.height:this._engine.getRenderHeight(!0))*this._options|0,l=e.parent;!l||l.leftCamera!=e&&l.rightCamera!=e||(a/=2);var u,h=this._options.width||a,d=this._options.height||c;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){var f=o.currentViewport;f&&(h*=f.width,d*=f.height)}if((this.renderTargetSamplingMode===_.a.TEXTURE_TRILINEAR_SAMPLINGMODE||this.alwaysForcePOT)&&(this._options.width||(h=o.needPOTTextures?ve.h.GetExponentOfTwo(h,s,this.scaleMode):h),this._options.height||(d=o.needPOTTextures?ve.h.GetExponentOfTwo(d,s,this.scaleMode):d)),this.width!==h||this.height!==d){if(this._textures.length>0){for(var p=0;p0)for(var e=0;e0){var r=this._camera._getFirstPostProcess();r&&r.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear()}},e}(),It="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}";Ct.a.ShadersStore.passPixelShader=It;var Dt="\nvarying vec2 vUV;\nuniform samplerCube textureSampler;\nvoid main(void)\n{\nvec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}";Ct.a.ShadersStore.passCubePixelShader=Dt;var wt=function(e){function t(t,i,r,n,o,s,a,c){return void 0===r&&(r=null),void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1),e.call(this,t,"pass",null,null,i,r,n,o,s,void 0,a,void 0,null,c)||this}return l.d(t,e),t}(Ot),Lt=function(e){function t(t,i,r,n,o,s,a,c){void 0===r&&(r=null),void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"passCube",null,null,i,r,n,o,s,"#define POSITIVEX",a,void 0,null,c)||this;return l._face=0,l}return l.d(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}(Ot);_e.b._RescalePostProcessFactory=function(e){return new wt("rescale",1,null,_e.b.TEXTURE_BILINEAR_SAMPLINGMODE,e,!1,_e.b.TEXTURETYPE_UNSIGNED_INT)};var Ft="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}";Ct.a.ShadersStore.anaglyphPixelShader=Ft;var Nt=function(e){function t(t,i,r,n,o,s){var a=e.call(this,t,"anaglyph",null,["leftSampler"],i,r[1],n,o,s)||this;return a._passedProcess=r[0]._rigPostProcess,a.onApplyObservable.add(function(e){e.setTextureFromPostProcess("leftSampler",a._passedProcess)}),a}return l.d(t,e),t}(Ot);Fe.a._setStereoscopicAnaglyphRigMode=function(e){e._rigCameras[0]._rigPostProcess=new wt(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new Nt(e.name+"_anaglyph",1,e._rigCameras)},F.a.AddNodeConstructor("AnaglyphArcRotateCamera",function(e,t,i){return function(){return new Bt(e,0,0,1,o.x.Zero(),i.interaxial_distance,t)}});var Bt=function(e){function t(t,i,r,n,o,s,a){var c=e.call(this,t,i,r,n,o,a)||this;return c.interaxialDistance=s,c.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:s}),c}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphArcRotateCamera"},t}(mt);F.a.AddNodeConstructor("AnaglyphFreeCamera",function(e,t,i){return function(){return new Ut(e,o.x.Zero(),i.interaxial_distance,t)}});var Ut=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o.interaxialDistance=r,o.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:r}),o}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphFreeCamera"},t}(pt);F.a.AddNodeConstructor("AnaglyphGamepadCamera",function(e,t,i){return function(){return new Vt(e,o.x.Zero(),i.interaxial_distance,t)}});var Vt=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o.interaxialDistance=r,o.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:r}),o}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphGamepadCamera"},t}(Rt);F.a.AddNodeConstructor("AnaglyphUniversalCamera",function(e,t,i){return function(){return new Gt(e,o.x.Zero(),i.interaxial_distance,t)}});var Gt=function(e){function t(t,i,r,n){var o=e.call(this,t,i,n)||this;return o.interaxialDistance=r,o.setCameraRigMode(Fe.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH,{interaxialDistance:r}),o}return l.d(t,e),t.prototype.getClassName=function(){return"AnaglyphUniversalCamera"},t}(Pt),kt="const vec3 TWO=vec3(2.0,2.0,2.0);\nvarying vec2 vUV;\nuniform sampler2D camASampler;\nuniform sampler2D textureSampler;\nuniform vec2 stepSize;\nvoid main(void)\n{\nbool useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else{\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}";Ct.a.ShadersStore.stereoscopicInterlacePixelShader=kt;var zt=function(e){function t(t,i,r,n,s,a){var c=e.call(this,t,"stereoscopicInterlace",["stepSize"],["camASampler"],1,i[1],n,s,a,r?"#define IS_STEREOSCOPIC_HORIZ 1":void 0)||this;return c._passedProcess=i[0]._rigPostProcess,c._stepSize=new o.w(1/c.width,1/c.height),c.onSizeChangedObservable.add(function(){c._stepSize=new o.w(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 l.d(t,e),t}(Ot);Fe.a._setStereoscopicRigMode=function(e){var t=e.cameraRigMode===Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL||e.cameraRigMode===Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;e._rigCameras[0]._rigPostProcess=new wt(e.name+"_passthru",1,e._rigCameras[0]),e._rigCameras[1]._rigPostProcess=new zt(e.name+"_stereoInterlace",e._rigCameras,t)},F.a.AddNodeConstructor("StereoscopicArcRotateCamera",function(e,t,i){return function(){return new jt(e,0,0,1,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var jt=function(e){function t(t,i,r,n,o,s,a,c){var l=e.call(this,t,i,r,n,o,c)||this;return l.interaxialDistance=s,l.isStereoscopicSideBySide=a,l.setCameraRigMode(a?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:s}),l}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicArcRotateCamera"},t}(mt);F.a.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,i){return function(){return new Wt(e,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var Wt=function(e){function t(t,i,r,n,o){var s=e.call(this,t,i,o)||this;return s.interaxialDistance=r,s.isStereoscopicSideBySide=n,s.setCameraRigMode(n?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:r}),s}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicFreeCamera"},t}(pt);F.a.AddNodeConstructor("StereoscopicGamepadCamera",function(e,t,i){return function(){return new Ht(e,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var Ht=function(e){function t(t,i,r,n,o){var s=e.call(this,t,i,o)||this;return s.interaxialDistance=r,s.isStereoscopicSideBySide=n,s.setCameraRigMode(n?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:r}),s}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicGamepadCamera"},t}(Rt);F.a.AddNodeConstructor("StereoscopicFreeCamera",function(e,t,i){return function(){return new Xt(e,o.x.Zero(),i.interaxial_distance,i.isStereoscopicSideBySide,t)}});var Xt=function(e){function t(t,i,r,n,o){var s=e.call(this,t,i,o)||this;return s.interaxialDistance=r,s.isStereoscopicSideBySide=n,s.setCameraRigMode(n?Fe.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:Fe.a.RIG_MODE_STEREOSCOPIC_OVERUNDER,{interaxialDistance:r}),s}return l.d(t,e),t.prototype.getClassName=function(){return"StereoscopicUniversalCamera"},t}(Pt);F.a.AddNodeConstructor("VirtualJoysticksCamera",function(e,t){return function(){return new Yt(e,o.x.Zero(),t)}});var Yt=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.inputs.addVirtualJoystick(),n}return l.d(t,e),t.prototype.getClassName=function(){return"VirtualJoysticksCamera"},t}(pt),Kt=function(){function e(){this.compensateDistortion=!0}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 o.j.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 o.j.Translation(-e,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftPreViewMatrix",{get:function(){return o.j.Translation(.5*this.interpupillaryDistance,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightPreViewMatrix",{get:function(){return o.j.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}(),Qt="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 LensCenter;\nuniform vec2 Scale;\nuniform vec2 ScaleIn;\nuniform vec4 HmdWarpParam;\nvec2 HmdWarp(vec2 in01) {\nvec2 theta=(in01-LensCenter)*ScaleIn;\nfloat rSq=theta.x*theta.x+theta.y*theta.y;\nvec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);\nreturn LensCenter+Scale*rvector;\n}\nvoid main(void)\n{\nvec2 tc=HmdWarp(vUV);\nif (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\nelse{\ngl_FragColor=texture2D(textureSampler,tc);\n}\n}";Ct.a.ShadersStore.vrDistortionCorrectionPixelShader=Qt;var qt=function(e){function t(t,i,r,n){var s=e.call(this,t,"vrDistortionCorrection",["LensCenter","Scale","ScaleIn","HmdWarpParam"],null,n.postProcessScaleFactor,i,Ge.a.BILINEAR_SAMPLINGMODE)||this;return s._isRightEye=r,s._distortionFactors=n.distortionK,s._postProcessScaleFactor=n.postProcessScaleFactor,s._lensCenterOffset=n.lensCenterOffset,s.adaptScaleToCurrentViewport=!0,s.onSizeChangedObservable.add(function(){s._scaleIn=new o.w(2,2/s.aspectRatio),s._scaleFactor=new o.w(1/s._postProcessScaleFactor*.5,1/s._postProcessScaleFactor*.5*s.aspectRatio),s._lensCenter=new o.w(s._isRightEye?.5-.5*s._lensCenterOffset:.5+.5*s._lensCenterOffset,.5)}),s.onApplyObservable.add(function(e){e.setFloat2("LensCenter",s._lensCenter.x,s._lensCenter.y),e.setFloat2("Scale",s._scaleFactor.x,s._scaleFactor.y),e.setFloat2("ScaleIn",s._scaleIn.x,s._scaleIn.y),e.setFloat4("HmdWarpParam",s._distortionFactors[0],s._distortionFactors[1],s._distortionFactors[2],s._distortionFactors[3])}),s}return l.d(t,e),t}(Ot);Fe.a._setVRRigMode=function(e,t){var i=t.vrCameraMetrics||Kt.GetDefault();e._rigCameras[0]._cameraRigParams.vrMetrics=i,e._rigCameras[0].viewport=new o.z(0,0,.5,1),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new o.j,e._rigCameras[0]._cameraRigParams.vrHMatrix=i.leftHMatrix,e._rigCameras[0]._cameraRigParams.vrPreViewMatrix=i.leftPreViewMatrix,e._rigCameras[0].getProjectionMatrix=e._rigCameras[0]._getVRProjectionMatrix,e._rigCameras[1]._cameraRigParams.vrMetrics=i,e._rigCameras[1].viewport=new o.z(.5,0,.5,1),e._rigCameras[1]._cameraRigParams.vrWorkMatrix=new o.j,e._rigCameras[1]._cameraRigParams.vrHMatrix=i.rightHMatrix,e._rigCameras[1]._cameraRigParams.vrPreViewMatrix=i.rightPreViewMatrix,e._rigCameras[1].getProjectionMatrix=e._rigCameras[1]._getVRProjectionMatrix,i.compensateDistortion&&(e._rigCameras[0]._rigPostProcess=new qt("VR_Distort_Compensation_Left",e._rigCameras[0],!1,i),e._rigCameras[1]._rigPostProcess=new qt("VR_Distort_Compensation_Right",e._rigCameras[1],!0,i))},F.a.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new Zt(e,0,0,1,o.x.Zero(),t)}});var Zt=function(e){function t(t,i,r,n,o,s,a,c){void 0===a&&(a=!0),void 0===c&&(c=Kt.GetDefault());var l=e.call(this,t,i,r,n,o,s)||this;return c.compensateDistortion=a,l.setCameraRigMode(Fe.a.RIG_MODE_VR,{vrCameraMetrics:c}),l.inputs.addVRDeviceOrientation(),l}return l.d(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationArcRotateCamera"},t}(mt);F.a.AddNodeConstructor("VRDeviceOrientationFreeCamera",function(e,t){return function(){return new Jt(e,o.x.Zero(),t)}});var Jt=function(e){function t(t,i,r,n,o){void 0===n&&(n=!0),void 0===o&&(o=Kt.GetDefault());var s=e.call(this,t,i,r)||this;return o.compensateDistortion=n,s.setCameraRigMode(Fe.a.RIG_MODE_VR,{vrCameraMetrics:o}),s}return l.d(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationFreeCamera"},t}(gt);F.a.AddNodeConstructor("VRDeviceOrientationGamepadCamera",function(e,t){return function(){return new ei(e,o.x.Zero(),t)}});var $t,ei=function(e){function t(t,i,r,n,o){void 0===n&&(n=!0),void 0===o&&(o=Kt.GetDefault());var s=e.call(this,t,i,r,n,o)||this;return s.inputs.addGamepad(),s}return l.d(t,e),t.prototype.getClassName=function(){return"VRDeviceOrientationGamepadCamera"},t}(Jt),ti=i(40);!function(e){e[e.VIVE=0]="VIVE",e[e.OCULUS=1]="OCULUS",e[e.WINDOWS=2]="WINDOWS",e[e.GEAR_VR=3]="GEAR_VR",e[e.DAYDREAM=4]="DAYDREAM",e[e.GENERIC=5]="GENERIC"}($t||($t={}));var ii=function(){function e(){}return e.InitiateController=function(e){for(var t=0,i=this._ControllerFactories;tthis._maxRotationDistFromHeadset){var r=i-(i<0?-this._maxRotationDistFromHeadset:this._maxRotationDistFromHeadset);this._draggedRoomRotation+=r;var n=Math.sin(-r),s=Math.cos(-r);this._calculatedPosition.x=this._calculatedPosition.x*s-this._calculatedPosition.z*n,this._calculatedPosition.z=this._calculatedPosition.x*n+this._calculatedPosition.z*s}}o.x.TransformCoordinatesToRef(this._calculatedPosition,this._deviceToWorld,this.devicePosition),this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix),o.q.FromRotationMatrixToRef(this._workingMatrix,this.deviceRotationQuaternion),this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation),this._mesh&&(this._mesh.position.copyFrom(this.devicePosition),this._mesh.rotationQuaternion&&this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion))},t.prototype.updateFromDevice=function(e){if(e){this.rawPose=e,e.position&&(this._deviceRoomPosition.copyFromFloats(e.position[0],e.position[1],-e.position[2]),this._mesh&&this._mesh.getScene().useRightHandedSystem&&(this._deviceRoomPosition.z*=-1),this._trackPosition&&this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor,this._calculatedPosition),this._calculatedPosition.addInPlace(this.position));var t=this.rawPose;e.orientation&&t.orientation&&(this._deviceRoomRotationQuaternion.copyFromFloats(t.orientation[0],t.orientation[1],-t.orientation[2],-t.orientation[3]),this._mesh&&(this._mesh.getScene().useRightHandedSystem?(this._deviceRoomRotationQuaternion.z*=-1,this._deviceRoomRotationQuaternion.w*=-1):this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion,this._deviceRoomRotationQuaternion)),this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion,this._calculatedRotation))}},t.prototype.attachToMesh=function(e){if(this._mesh&&(this._mesh.parent=null),this._mesh=e,this._poseControlledCamera&&(this._mesh.parent=this._poseControlledCamera),this._mesh.rotationQuaternion||(this._mesh.rotationQuaternion=new o.q),this._updatePoseAndMesh(),this._pointingPoseNode){for(var t=[],i=this._pointingPoseNode;i.parent;)t.push(i.parent),i=i.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 ti.a(o.x.Zero(),new o.x(0,0,1),e);var t=this._pointingPoseNode?this._pointingPoseNode.getWorldMatrix():this.mesh.getWorldMatrix(),i=t.getTranslation(),r=new o.x(0,0,-1),n=o.x.TransformNormal(r,t),s=o.x.Normalize(n);return new ti.a(i,s,e)},t.POINTING_POSE="POINTING_POSE",t}(Xe),ni=i(39);F.a.AddNodeConstructor("Light_Type_3",function(e,t){return function(){return new oi(e,o.x.Zero(),t)}});var oi=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n.groundColor=new o.e(0,0,0),n.direction=i||o.x.Up(),n}return l.d(t,e),t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.getClassName=function(){return"HemisphericLight"},t.prototype.setDirectionToTarget=function(e){return this.direction=o.x.Normalize(e.subtract(o.x.Zero())),this.direction},t.prototype.getShadowGenerator=function(){return null},t.prototype.transferToEffect=function(e,t){var i=o.x.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",i.x,i.y,i.z,0,t),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),t),this},t.prototype.computeWorldMatrix=function(){return this._worldMatrix||(this._worldMatrix=o.j.Identity()),this._worldMatrix},t.prototype.getTypeID=function(){return ni.a.LIGHTTYPEID_HEMISPHERICLIGHT},t.prototype.prepareLightSpecificDefines=function(e,t){e["HEMILIGHT"+t]=!0},l.c([Object(w.e)()],t.prototype,"groundColor",void 0),l.c([Object(w.n)()],t.prototype,"direction",void 0),t}(ni.a);Fe.a._setWebVRRigMode=function(e,t){if(t.vrDisplay){var i=t.vrDisplay.getEyeParameters("left"),r=t.vrDisplay.getEyeParameters("right");e._rigCameras[0].viewport=new o.z(0,0,.5,1),e._rigCameras[0].setCameraRigParameter("left",!0),e._rigCameras[0].setCameraRigParameter("specs",t.specs),e._rigCameras[0].setCameraRigParameter("eyeParameters",i),e._rigCameras[0].setCameraRigParameter("frameData",t.frameData),e._rigCameras[0].setCameraRigParameter("parentCamera",t.parentCamera),e._rigCameras[0]._cameraRigParams.vrWorkMatrix=new o.j,e._rigCameras[0].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[0].parent=e,e._rigCameras[0]._getViewMatrix=e._getWebVRViewMatrix,e._rigCameras[1].viewport=new o.z(.5,0,.5,1),e._rigCameras[1].setCameraRigParameter("eyeParameters",r),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 o.j,e._rigCameras[1].getProjectionMatrix=e._getWebVRProjectionMatrix,e._rigCameras[1].parent=e,e._rigCameras[1]._getViewMatrix=e._getWebVRViewMatrix,Fe.a.UseAlternateWebVRRendering&&(e._rigCameras[1]._skipRendering=!0,e._rigCameras[0]._alternateCamera=e._rigCameras[1])}},F.a.AddNodeConstructor("WebVRFreeCamera",function(e,t){return function(){return new ci(e,o.x.Zero(),t)}}),F.a.AddNodeConstructor("WebVRGamepadCamera",function(e,t){return function(){return new ci(e,o.x.Zero(),t)}});var si,ai,ci=function(e){function t(t,i,r,s){void 0===s&&(s={});var a=e.call(this,t,i,r)||this;a.webVROptions=s,a._vrDevice=null,a.rawPose=null,a._specsVersion="1.1",a._attached=!1,a._descendants=[],a._deviceRoomPosition=o.x.Zero(),a._deviceRoomRotationQuaternion=o.q.Identity(),a._standingMatrix=null,a.devicePosition=o.x.Zero(),a.deviceRotationQuaternion=o.q.Identity(),a.deviceScaleFactor=1,a._deviceToWorld=o.j.Identity(),a._worldToDevice=o.j.Identity(),a.controllers=[],a.onControllersAttachedObservable=new n.c,a.onControllerMeshLoadedObservable=new n.c,a.onPoseUpdatedFromDeviceObservable=new n.c,a._poseSet=!1,a.rigParenting=!0,a._defaultHeight=void 0,a._htmlElementAttached=null,a._detachIfAttached=function(){var e=a.getEngine().getVRDevice();e&&!e.isPresenting&&a._htmlElementAttached&&a.detachControl(a._htmlElementAttached)},a._workingVector=o.x.Zero(),a._oneVector=o.x.One(),a._workingMatrix=o.j.Identity(),a._tmpMatrix=new o.j,a._cache.position=o.x.Zero(),s.defaultHeight&&(a._defaultHeight=s.defaultHeight,a.position.y=a._defaultHeight),a.minZ=.1,5===arguments.length&&(a.webVROptions=arguments[4]),null==a.webVROptions.trackPosition&&(a.webVROptions.trackPosition=!0),null==a.webVROptions.controllerMeshes&&(a.webVROptions.controllerMeshes=!0),null==a.webVROptions.defaultLightingOnControllers&&(a.webVROptions.defaultLightingOnControllers=!0),a.rotationQuaternion=new o.q,a.webVROptions&&a.webVROptions.positionScale&&(a.deviceScaleFactor=a.webVROptions.positionScale);var c=a.getEngine();return a._onVREnabled=function(e){e&&a.initControllers()},c.onVRRequestPresentComplete.add(a._onVREnabled),c.initWebVR().add(function(e){e.vrDisplay&&a._vrDevice!==e.vrDisplay&&(a._vrDevice=e.vrDisplay,a.setCameraRigMode(Fe.a.RIG_MODE_WEBVR,{parentCamera:a,vrDisplay:a._vrDevice,frameData:a._frameData,specs:a._specsVersion}),a._attached&&a.getEngine().enableVR())}),"undefined"!=typeof VRFrameData&&(a._frameData=new VRFrameData),r.onBeforeCameraRenderObservable.add(function(e){e.parent===a&&a.rigParenting&&(a._descendants=a.getDescendants(!0,function(e){var t=a.controllers.some(function(t){return t._mesh===e}),i=-1!==a._rigCameras.indexOf(e);return!t&&!i}),a._descendants.forEach(function(t){t.parent=e}))}),r.onAfterCameraRenderObservable.add(function(e){e.parent===a&&a.rigParenting&&a._descendants.forEach(function(e){e.parent=a})}),a}return l.d(t,e),t.prototype.deviceDistanceToRoomGround=function(){return this._standingMatrix?(this._standingMatrix.getTranslationToRef(this._workingVector),this._deviceRoomPosition.y+this._workingVector.y):this._defaultHeight||0},t.prototype.useStandingMatrix=function(e){var t=this;void 0===e&&(e=function(e){}),this.getEngine().initWebVRAsync().then(function(i){i.vrDisplay&&i.vrDisplay.stageParameters&&i.vrDisplay.stageParameters.sittingToStandingTransform&&t.webVROptions.trackPosition?(t._standingMatrix=new o.j,o.j.FromFloat32ArrayToRefScaled(i.vrDisplay.stageParameters.sittingToStandingTransform,0,1,t._standingMatrix),t.getScene().useRightHandedSystem||t._standingMatrix&&t._standingMatrix.toggleModelMatrixHandInPlace(),e(!0)):e(!1)})},t.prototype.useStandingMatrixAsync=function(){var e=this;return new Promise(function(t){e.useStandingMatrix(function(e){t(e)})})},t.prototype.dispose=function(){this._detachIfAttached(),this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled),this._updateCacheWhenTrackingDisabledObserver&&this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver),e.prototype.dispose.call(this)},t.prototype.getControllerByName=function(e){for(var t=0,i=this.controllers;t=2&&e.onControllersAttachedObservable.notifyObservers(e.controllers)}}})},t}(pt),li=function(e){function t(t){var i=e.call(this,t)||this;return i.onTriggerStateChangedObservable=new n.c,i.onMainButtonStateChangedObservable=new n.c,i.onSecondaryButtonStateChangedObservable=new n.c,i.onPadStateChangedObservable=new n.c,i.onPadValuesChangedObservable=new n.c,i.pad={x:0,y:0},i._changes={pressChanged:!1,touchChanged:!1,valueChanged:!1,changed:!1},i._buttons=new Array(t.buttons.length),i.hand=t.hand,i}return l.d(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\n#include\n#include\nvoid main(void)\n{\nvec4 result=texture2D(textureSampler,vUV);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\n\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;\n}");Ct.a.ShadersStore.imageProcessingPixelShader=pi;var _i=function(e){function t(t,i,r,n,o,s,a,c){void 0===r&&(r=null),void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT);var l=e.call(this,t,"imageProcessing",[],[],i,r,n,o,s,null,a,"postprocess",null,!0)||this;return l._fromLinearSpace=!0,l._defines={IMAGEPROCESSING:!1,VIGNETTE:!1,VIGNETTEBLENDMODEMULTIPLY:!1,VIGNETTEBLENDMODEOPAQUE:!1,TONEMAPPING:!1,TONEMAPPING_ACES:!1,CONTRAST:!1,COLORCURVES:!1,COLORGRADING:!1,COLORGRADING3D:!1,FROMLINEARSPACE:!1,SAMPLER3DGREENDEPTH:!1,SAMPLER3DBGRMAP:!1,IMAGEPROCESSINGPOSTPROCESS:!1,EXPOSURE:!1},c?(c.applyByPostProcess=!0,l._attachImageProcessingConfiguration(c,!0),l.fromLinearSpace=!1):(l._attachImageProcessingConfiguration(null,!0),l.imageProcessingConfiguration.applyByPostProcess=!0),l.onApply=function(e){l.imageProcessingConfiguration.bind(e,l.aspectRatio)},l}return l.d(t,e),Object.defineProperty(t.prototype,"imageProcessingConfiguration",{get:function(){return this._imageProcessingConfiguration},set:function(e){this._attachImageProcessingConfiguration(e)},enumerable:!0,configurable:!0}),t.prototype._attachImageProcessingConfiguration=function(e,t){var i=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 r=null,n=this.getEngine(),o=this.getCamera();if(o)r=o.getScene();else if(n&&n.scenes){var s=n.scenes;r=s[s.length-1]}else r=R.a.LastCreatedScene;this._imageProcessingConfiguration=r.imageProcessingConfiguration}this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(function(){i._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,"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 i=["textureSampler"],r=["scale"];hi.a&&(hi.a.PrepareSamplers(i,this._defines),hi.a.PrepareUniforms(r,this._defines)),this.updateEffect(e,r,i)},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)},l.c([Object(w.c)()],t.prototype,"_fromLinearSpace",void 0),t}(Ot),mi=i(13),gi=i(4);de.a._GroundMeshParser=function(e,t){return vi.Parse(e,t)};var vi=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.generateOctree=!1,r}return l.d(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 i=this.getWorldMatrix(),r=o.t.Matrix[5];i.invertToRef(r);var n=o.t.Vector3[8];if(o.x.TransformCoordinatesFromFloatsToRef(e,0,t,r,n),e=n.x,t=n.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 o.x.TransformCoordinatesFromFloatsToRef(0,a,0,i,n),n.y},t.prototype.getNormalAtCoordinates=function(e,t){var i=new o.x(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i},t.prototype.getNormalAtCoordinatesToRef=function(e,t,i){var r=this.getWorldMatrix(),n=o.t.Matrix[5];r.invertToRef(n);var s=o.t.Vector3[8];if(o.x.TransformCoordinatesFromFloatsToRef(e,0,t,n,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 o.x.TransformNormalFromFloatsToRef(a.x,a.y,a.z,r,i),this},t.prototype.updateCoordinateHeights=function(){return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this},t.prototype._getFacetAt=function(e,t){var i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),r=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),n=this._heightQuads[r*this._subdivisionsX+i];return t=l?e.minHeight+(e.maxHeight-e.minHeight)*m:e.minHeight-o.h,n.push(u.x,u.y,u.z),s.push(0,0,0),a.push(i/e.subdivisions,1-t/e.subdivisions)}for(t=0;t=e.minHeight,E=n[3*v+1]>=e.minHeight,x=n[3*y+1]>=e.minHeight;T&&E&&x&&(r.push(g),r.push(v),r.push(y)),n[3*b+1]>=e.minHeight&&T&&x&&(r.push(b),r.push(g),r.push(y))}mi.a.ComputeNormals(n,r,s);var A=new mi.a;return A.indices=r,A.positions=n,A.normals=s,A.uvs=a,A},de.a.CreateGround=function(e,t,i,r,n,o){var s={width:t,height:i,subdivisions:r,updatable:o};return yi.CreateGround(e,s,n)},de.a.CreateTiledGround=function(e,t,i,r,n,o,s,a,c){var l={xmin:t,zmin:i,xmax:r,zmax:n,subdivisions:o,precision:s,updatable:c};return yi.CreateTiledGround(e,l,a)},de.a.CreateGroundFromHeightMap=function(e,t,i,r,n,o,s,a,c,l,u){var h={width:i,height:r,subdivisions:n,minHeight:o,maxHeight:s,updatable:c,onReady:l,alphaFilter:u};return yi.CreateGroundFromHeightMap(e,t,h,a)};var yi=function(){function e(){}return e.CreateGround=function(e,t,i){var r=new vi(e,i);return r._setReady(!1),r._subdivisionsX=t.subdivisionsX||t.subdivisions||1,r._subdivisionsY=t.subdivisionsY||t.subdivisions||1,r._width=t.width||1,r._height=t.height||1,r._maxX=r._width/2,r._maxZ=r._height/2,r._minX=-r._maxX,r._minZ=-r._maxZ,mi.a.CreateGround(t).applyToMesh(r,t.updatable),r._setReady(!0),r},e.CreateTiledGround=function(e,t,i){var r=new de.a(e,i);return mi.a.CreateTiledGround(t).applyToMesh(r,t.updatable),r},e.CreateGroundFromHeightMap=function(e,t,i,r){var n=i.width||10,s=i.height||10,a=i.subdivisions||1,c=i.minHeight||0,l=i.maxHeight||1,u=i.colorFilter||new o.e(.3,.59,.11),h=i.alphaFilter||0,d=i.updatable,f=i.onReady,p=new vi(e,r);p._subdivisionsX=a,p._subdivisionsY=a,p._width=n,p._height=s,p._maxX=p._width/2,p._maxZ=p._height/2,p._minX=-p._maxX,p._minZ=-p._maxZ,p._setReady(!1);return ve.h.LoadImage(t,function(e){var t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("Unable to get 2d context for CreateGroundFromHeightMap");if(!r.isDisposed){var o=e.width,_=e.height;t.width=o,t.height=_,i.drawImage(e,0,0);var m=i.getImageData(0,0,o,_).data;mi.a.CreateGroundFromHeightMap({width:n,height:s,subdivisions:a,minHeight:c,maxHeight:l,colorFilter:u,buffer:m,bufferWidth:o,bufferHeight:_,alphaFilter:h}).applyToMesh(p,d),f&&f(p),p._setReady(!0)}},function(){},r.offlineProvider),p},e}();mi.a.CreateTorus=function(e){for(var t=[],i=[],r=[],n=[],s=e.diameter||1,a=e.thickness||.5,c=e.tessellation||16,l=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE,u=c+1,h=0;h<=c;h++)for(var d=h/c,f=h*Math.PI*2/c-Math.PI/2,p=o.j.Translation(s/2,0,0).multiply(o.j.RotationY(f)),_=0;_<=c;_++){var m=1-_/c,g=_*Math.PI*2/c+Math.PI,v=Math.cos(g),y=Math.sin(g),b=new o.x(v,y,0),T=b.scale(a/2),E=new o.w(d,m);T=o.x.TransformCoordinates(T,p),b=o.x.TransformNormal(b,p),i.push(T.x,T.y,T.z),r.push(b.x,b.y,b.z),n.push(E.x,E.y);var x=(h+1)%u,A=(_+1)%u;t.push(h*u+_),t.push(h*u+A),t.push(x*u+_),t.push(h*u+A),t.push(x*u+A),t.push(x*u+_)}mi.a._ComputeSides(l,i,t,r,n,e.frontUVs,e.backUVs);var P=new mi.a;return P.indices=t,P.positions=i,P.normals=r,P.uvs=n,P},de.a.CreateTorus=function(e,t,i,r,n,o,s){var a={diameter:t,thickness:i,tessellation:r,sideOrientation:s,updatable:o};return bi.CreateTorus(e,a,n)};var bi=function(){function e(){}return e.CreateTorus=function(e,t,i){var r=new de.a(e,i);return t.sideOrientation=de.a._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,mi.a.CreateTorus(t).applyToMesh(r,t.updatable),r},e}(),Ti=i(62),Ei=i(38),xi=function(){function e(e){var t=this;this._scene=e,this._babylonGamepads=[],this._oneGamepadConnected=!1,this._isMonitoring=!1,this.onGamepadDisconnectedObservable=new n.c,Ei.a.IsWindowObjectExist()?(this._gamepadEventSupported="GamepadEvent"in window,this._gamepadSupport=navigator.getGamepads||navigator.webkitGetGamepads||navigator.msGetGamepads||navigator.webkitGamepads):this._gamepadEventSupported=!1,this.onGamepadConnectedObservable=new n.c(function(e){for(var i in t._babylonGamepads){var r=t._babylonGamepads[i];r&&r._isConnected&&t.onGamepadConnectedObservable.notifyObserver(e,r)}}),this._onGamepadConnectedEvent=function(e){var i,r=e.gamepad;r.index in t._babylonGamepads&&t._babylonGamepads[r.index].isConnected||(t._babylonGamepads[r.index]?((i=t._babylonGamepads[r.index]).browserGamepad=r,i._isConnected=!0):i=t._addNewGamepad(r),t.onGamepadConnectedObservable.notifyObservers(i),t._startMonitoringGamepads())},this._onGamepadDisconnectedEvent=function(e){var i=e.gamepad;for(var r in t._babylonGamepads)if(t._babylonGamepads[r].index===i.index){var n=t._babylonGamepads[r];n._isConnected=!1,t.onGamepadDisconnectedObservable.notifyObservers(n);break}},this._gamepadSupport&&(this._updateGamepadObjects(),this._babylonGamepads.length&&this._startMonitoringGamepads(),this._gamepadEventSupported?(window.addEventListener("gamepadconnected",this._onGamepadConnectedEvent,!1),window.addEventListener("gamepaddisconnected",this._onGamepadDisconnectedEvent,!1)):this._startMonitoringGamepads())}return Object.defineProperty(e.prototype,"gamepads",{get:function(){return this._babylonGamepads},enumerable:!0,configurable:!0}),e.prototype.getGamepadByType=function(e){void 0===e&&(e=Xe.XBOX);for(var t=0,i=this._babylonGamepads;t=0){r=i[n],this.webVRController._pointingPoseNode=r;break}this._laserPointer.parent=r},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}(Pi),Si=function(e){function t(t,i){var r=e.call(this,i)||this;return r.getCamera=t,r}return l.d(t,e),t.prototype._getForwardRay=function(e){var t=this.getCamera();return t?t.getForwardRay(e):new ti.a(o.x.Zero(),o.x.Forward())},t}(Pi),Ci=function(){function e(e,t){void 0===t&&(t={});var i=this;if(this.webVROptions=t,this._webVRsupported=!1,this._webVRready=!1,this._webVRrequesting=!1,this._webVRpresenting=!1,this._fullscreenVRpresenting=!1,this.onEnteringVRObservable=new n.c,this.onExitingVRObservable=new n.c,this.onControllerMeshLoadedObservable=new n.c,this._useCustomVRButton=!1,this._teleportationRequested=!1,this._teleportActive=!1,this._floorMeshesCollection=[],this._rotationAllowed=!0,this._teleportBackwardsVector=new o.x(0,-1,-1),this._isDefaultTeleportationTarget=!0,this._teleportationFillColor="#444444",this._teleportationBorderColor="#FFFFFF",this._rotationAngle=0,this._haloCenter=new o.x(0,0,0),this._padSensibilityUp=.65,this._padSensibilityDown=.35,this._leftController=null,this._rightController=null,this.onNewMeshSelected=new n.c,this.onNewMeshPicked=new n.c,this.onBeforeCameraTeleport=new n.c,this.onAfterCameraTeleport=new n.c,this.onSelectedMeshUnselected=new n.c,this.teleportationEnabled=!0,this._teleportationInitialized=!1,this._interactionsEnabled=!1,this._interactionsRequested=!1,this._displayGaze=!0,this._displayLaserPointer=!0,this.updateGazeTrackerScale=!0,this.updateGazeTrackerColor=!0,this.requestPointerLockOnFullScreen=!0,this._onResize=function(){i.moveButtonToBottomRight(),i._fullscreenVRpresenting&&i._webVRready&&i.exitVR()},this._onFullscreenChange=function(){void 0!==document.fullscreen?i._fullscreenVRpresenting=document.fullscreen:void 0!==document.mozFullScreen?i._fullscreenVRpresenting=document.mozFullScreen:void 0!==document.webkitIsFullScreen?i._fullscreenVRpresenting=document.webkitIsFullScreen:void 0!==document.msIsFullScreen?i._fullscreenVRpresenting=document.msIsFullScreen:void 0!==document.msFullscreenElement&&(i._fullscreenVRpresenting=document.msFullscreenElement),!i._fullscreenVRpresenting&&i._canvas&&(i.exitVR(),i._useCustomVRButton||(i._btnVR.style.top=i._canvas.offsetTop+i._canvas.offsetHeight-70+"px",i._btnVR.style.left=i._canvas.offsetLeft+i._canvas.offsetWidth-100+"px"))},this._cachedAngularSensibility={angularSensibilityX:null,angularSensibilityY:null,angularSensibility:null},this.beforeRender=function(){i._leftController&&i._leftController._activePointer&&i._castRayAndSelectObject(i._leftController),i._rightController&&i._rightController._activePointer&&i._castRayAndSelectObject(i._rightController),i._noControllerIsActive?i._castRayAndSelectObject(i._cameraGazer):i._cameraGazer._gazeTracker.isVisible=!1},this._onNewGamepadConnected=function(e){if(e.type!==Xe.POSE_ENABLED)e.leftStick&&e.onleftstickchanged(function(e){i._teleportationInitialized&&i.teleportationEnabled&&(!i._leftController&&!i._rightController||i._leftController&&!i._leftController._activePointer&&i._rightController&&!i._rightController._activePointer)&&(i._checkTeleportWithRay(e,i._cameraGazer),i._checkTeleportBackwards(e,i._cameraGazer))}),e.rightStick&&e.onrightstickchanged(function(e){i._teleportationInitialized&&i._checkRotate(e,i._cameraGazer)}),e.type===Xe.XBOX&&(e.onbuttondown(function(e){i._interactionsEnabled&&e===si.A&&i._cameraGazer._selectionPointerDown()}),e.onbuttonup(function(e){i._interactionsEnabled&&e===si.A&&i._cameraGazer._selectionPointerUp()}));else{var t=e,r=new Ri(t,i._scene,i._cameraGazer._gazeTracker);"right"===t.hand||i._leftController&&i._leftController.webVRController!=t?i._rightController=r:i._leftController=r,i._tryEnableInteractionOnController(r)}},this._tryEnableInteractionOnController=function(e){i._interactionsRequested&&!e._interactionsEnabled&&i._enableInteractionOnController(e),i._teleportationRequested&&!e._teleportationEnabled&&i._enableTeleportationOnController(e)},this._onNewGamepadDisconnected=function(e){e instanceof li&&("left"===e.hand&&null!=i._leftController&&(i._leftController.dispose(),i._leftController=null),"right"===e.hand&&null!=i._rightController&&(i._rightController.dispose(),i._rightController=null))},this._workingVector=o.x.Zero(),this._workingQuaternion=o.q.Identity(),this._workingMatrix=o.j.Identity(),this._scene=e,this._canvas=e.getEngine().getRenderingCanvas(),void 0===t.createFallbackVRDeviceOrientationFreeCamera&&(t.createFallbackVRDeviceOrientationFreeCamera=!0),void 0===t.createDeviceOrientationCamera&&(t.createDeviceOrientationCamera=!0),void 0===t.laserToggle&&(t.laserToggle=!0),void 0===t.defaultHeight&&(t.defaultHeight=1.7),t.useCustomVRButton&&(this._useCustomVRButton=!0,t.customVRButton&&(this._btnVR=t.customVRButton)),t.rayLength&&(this._rayLength=t.rayLength),this._defaultHeight=t.defaultHeight,t.positionScale&&(this._rayLength*=t.positionScale,this._defaultHeight*=t.positionScale),this._hasEnteredVR=!1,this._scene.activeCamera?this._position=this._scene.activeCamera.position.clone():this._position=new o.x(0,this._defaultHeight,0),t.createDeviceOrientationCamera||!this._scene.activeCamera){if(this._deviceOrientationCamera=new gt("deviceOrientationVRHelper",this._position.clone(),e),this._scene.activeCamera&&(this._deviceOrientationCamera.minZ=this._scene.activeCamera.minZ,this._deviceOrientationCamera.maxZ=this._scene.activeCamera.maxZ,this._scene.activeCamera instanceof ft&&this._scene.activeCamera.rotation)){var r=this._scene.activeCamera;r.rotationQuaternion?this._deviceOrientationCamera.rotationQuaternion.copyFrom(r.rotationQuaternion):this._deviceOrientationCamera.rotationQuaternion.copyFrom(o.q.RotationYawPitchRoll(r.rotation.y,r.rotation.x,r.rotation.z)),this._deviceOrientationCamera.rotation=r.rotation.clone()}this._scene.activeCamera=this._deviceOrientationCamera,this._canvas&&this._scene.activeCamera.attachControl(this._canvas)}else this._existingCamera=this._scene.activeCamera;if(t.createFallbackVRDeviceOrientationFreeCamera&&(this._vrDeviceOrientationCamera=new Jt("VRDeviceOrientationVRHelper",this._position,this._scene,!0,t.vrDeviceOrientationCameraMetrics),this._vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._webVRCamera=new ci("WebVRHelper",this._position,this._scene,t),this._webVRCamera.useStandingMatrix(),this._cameraGazer=new Si(function(){return i.currentVRCamera},e),!this._useCustomVRButton){this._btnVR=document.createElement("BUTTON"),this._btnVR.className="babylonVRicon",this._btnVR.id="babylonVRiconbtn",this._btnVR.title="Click to switch to VR";".babylonVRicon.vrdisplaypresenting { display: none; }";var s=document.createElement("style");s.appendChild(document.createTextNode(".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }.babylonVRicon.vrdisplaypresenting { display: none; }")),document.getElementsByTagName("head")[0].appendChild(s),this.moveButtonToBottomRight()}this._btnVR&&this._btnVR.addEventListener("click",function(){i.isInVRMode?i.exitVR():i.enterVR()}),window.addEventListener("resize",this._onResize),document.addEventListener("fullscreenchange",this._onFullscreenChange,!1),document.addEventListener("mozfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",this._onFullscreenChange,!1),document.addEventListener("msfullscreenchange",this._onFullscreenChange,!1),document.onmsfullscreenchange=this._onFullscreenChange,t.createFallbackVRDeviceOrientationFreeCamera?this.displayVRButton():this._scene.getEngine().onVRDisplayChangedObservable.add(function(e){e.vrDisplay&&i.displayVRButton()}),this._onKeyDown=function(e){27===e.keyCode&&i.isInVRMode&&i.exitVR()},document.addEventListener("keydown",this._onKeyDown),this._scene.onPrePointerObservable.add(function(){i.isInVRMode&&(i.exitVR(),i._fullscreenVRpresenting&&i._scene.getEngine().exitFullscreen())},Pe.a.POINTERDOUBLETAP,!1),this._onVRDisplayChanged=function(e){return i.onVRDisplayChanged(e)},this._onVrDisplayPresentChange=function(){return i.onVrDisplayPresentChange()},this._onVRRequestPresentStart=function(){i._webVRrequesting=!0,i.updateButtonVisibility()},this._onVRRequestPresentComplete=function(){i._webVRrequesting=!1,i.updateButtonVisibility()},e.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged),e.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart),e.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete),window.addEventListener("vrdisplaypresentchange",this._onVrDisplayPresentChange),e.onDisposeObservable.add(function(){i.dispose()}),this._webVRCamera.onControllerMeshLoadedObservable.add(function(e){return i._onDefaultMeshLoaded(e)}),this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected),this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected),this.updateButtonVisibility(),this._circleEase=new $,this._circleEase.setEasingMode(J.EASINGMODE_EASEINOUT),this.webVROptions.floorMeshes&&this.enableTeleportation({floorMeshes:this.webVROptions.floorMeshes})}return Object.defineProperty(e.prototype,"onEnteringVR",{get:function(){return this.onEnteringVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onExitingVR",{get:function(){return this.onExitingVRObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onControllerMeshLoaded",{get:function(){return this.onControllerMeshLoadedObservable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"teleportationTarget",{get:function(){return this._teleportationTarget},set:function(e){e&&(e.name="teleportationTarget",this._isDefaultTeleportationTarget=!1,this._teleportationTarget=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gazeTrackerMesh",{get:function(){return this._cameraGazer._gazeTracker},set:function(e){e&&(this._cameraGazer._gazeTracker&&this._cameraGazer._gazeTracker.dispose(),this._leftController&&this._leftController._gazeTracker&&this._leftController._gazeTracker.dispose(),this._rightController&&this._rightController._gazeTracker&&this._rightController._gazeTracker.dispose(),this._cameraGazer._gazeTracker=e,this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(),this._cameraGazer._gazeTracker.isPickable=!1,this._cameraGazer._gazeTracker.isVisible=!1,this._cameraGazer._gazeTracker.name="gazeTracker",this._leftController&&(this._leftController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")),this._rightController&&(this._rightController._gazeTracker=this._cameraGazer._gazeTracker.clone("gazeTracker")))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leftControllerGazeTrackerMesh",{get:function(){return this._leftController?this._leftController._gazeTracker:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rightControllerGazeTrackerMesh",{get:function(){return this._rightController?this._rightController._gazeTracker:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayGaze",{get:function(){return this._displayGaze},set:function(e){this._displayGaze=e,e||(this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayLaserPointer",{get:function(){return this._displayLaserPointer},set:function(e){this._displayLaserPointer=e,e?(this._rightController&&this._rightController._activatePointer(),this._leftController&&this._leftController._activatePointer()):(this._rightController&&(this._rightController._deactivatePointer(),this._rightController._gazeTracker.isVisible=!1),this._leftController&&(this._leftController._deactivatePointer(),this._leftController._gazeTracker.isVisible=!1))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deviceOrientationCamera",{get:function(){return this._deviceOrientationCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentVRCamera",{get:function(){return this._webVRready?this._webVRCamera:this._scene.activeCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"webVRCamera",{get:function(){return this._webVRCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"vrDeviceOrientationCamera",{get:function(){return this._vrDeviceOrientationCamera},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_teleportationRequestInitiated",{get:function(){return this._cameraGazer._teleportationRequestInitiated||null!==this._leftController&&this._leftController._teleportationRequestInitiated||null!==this._rightController&&this._rightController._teleportationRequestInitiated},enumerable:!0,configurable:!0}),e.prototype._onDefaultMeshLoaded=function(e){this._leftController&&this._leftController.webVRController==e&&e.mesh&&this._leftController._setLaserPointerParent(e.mesh),this._rightController&&this._rightController.webVRController==e&&e.mesh&&this._rightController._setLaserPointerParent(e.mesh);try{this.onControllerMeshLoadedObservable.notifyObservers(e)}catch(e){p.a.Warn("Error in your custom logic onControllerMeshLoaded: "+e)}},Object.defineProperty(e.prototype,"isInVRMode",{get:function(){return this._webVRpresenting||this._fullscreenVRpresenting},enumerable:!0,configurable:!0}),e.prototype.onVrDisplayPresentChange=function(){var e=this._scene.getEngine().getVRDevice();if(e){var t=this._webVRpresenting;this._webVRpresenting=e.isPresenting,t&&!this._webVRpresenting&&this.exitVR()}else p.a.Warn("Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?");this.updateButtonVisibility()},e.prototype.onVRDisplayChanged=function(e){this._webVRsupported=e.vrSupported,this._webVRready=!!e.vrDisplay,this._webVRpresenting=e.vrDisplay&&e.vrDisplay.isPresenting,this.updateButtonVisibility()},e.prototype.moveButtonToBottomRight=function(){this._canvas&&!this._useCustomVRButton&&(this._btnVR.style.top=this._canvas.offsetTop+this._canvas.offsetHeight-70+"px",this._btnVR.style.left=this._canvas.offsetLeft+this._canvas.offsetWidth-100+"px")},e.prototype.displayVRButton=function(){this._useCustomVRButton||this._btnVRDisplayed||(document.body.appendChild(this._btnVR),this._btnVRDisplayed=!0)},e.prototype.updateButtonVisibility=function(){this._btnVR&&!this._useCustomVRButton&&(this._btnVR.className="babylonVRicon",this.isInVRMode?this._btnVR.className+=" vrdisplaypresenting":(this._webVRready&&(this._btnVR.className+=" vrdisplayready"),this._webVRsupported&&(this._btnVR.className+=" vrdisplaysupported"),this._webVRrequesting&&(this._btnVR.className+=" vrdisplayrequesting")))},e.prototype.enterVR=function(){if(this.onEnteringVRObservable)try{this.onEnteringVRObservable.notifyObservers(this)}catch(e){p.a.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=o.q.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(),this.vrDeviceOrientationCamera.angularSensibility=2e3),this.webVRCamera){var e=this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y,t=o.q.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y-e,i=this.webVRCamera.rotationQuaternion.toEulerAngles().y;this.webVRCamera.rotationQuaternion=o.q.FromEulerAngles(0,i+t,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._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._scene.activeCamera&&this._canvas&&this._scene.activeCamera.attachControl(this._canvas),this._interactionsEnabled&&this._scene.registerBeforeRender(this.beforeRender),this._displayLaserPointer&&[this._leftController,this._rightController].forEach(function(e){e&&e._activatePointer()}),this._hasEnteredVR=!0)},e.prototype.exitVR=function(){if(this._hasEnteredVR){if(this.onExitingVRObservable)try{this.onExitingVRObservable.notifyObservers(this)}catch(e){p.a.Warn("Error in your custom logic onExitingVR: "+e)}this._webVRpresenting&&this._scene.getEngine().disableVR(),this._scene.activeCamera&&(this._position=this._scene.activeCamera.position.clone()),this.vrDeviceOrientationCamera&&(this.vrDeviceOrientationCamera.angularSensibility=Number.MAX_VALUE),this._deviceOrientationCamera?(this._deviceOrientationCamera.position=this._position,this._scene.activeCamera=this._deviceOrientationCamera,this._canvas&&this._scene.activeCamera.attachControl(this._canvas),this._cachedAngularSensibility.angularSensibilityX&&(this._deviceOrientationCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._deviceOrientationCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._deviceOrientationCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)):this._existingCamera&&(this._existingCamera.position=this._position,this._scene.activeCamera=this._existingCamera,this._cachedAngularSensibility.angularSensibilityX&&(this._existingCamera.angularSensibilityX=this._cachedAngularSensibility.angularSensibilityX,this._cachedAngularSensibility.angularSensibilityX=null),this._cachedAngularSensibility.angularSensibilityY&&(this._existingCamera.angularSensibilityY=this._cachedAngularSensibility.angularSensibilityY,this._cachedAngularSensibility.angularSensibilityY=null),this._cachedAngularSensibility.angularSensibility&&(this._existingCamera.angularSensibility=this._cachedAngularSensibility.angularSensibility,this._cachedAngularSensibility.angularSensibility=null)),this.updateButtonVisibility(),this._interactionsEnabled&&(this._scene.unregisterBeforeRender(this.beforeRender),this._cameraGazer._gazeTracker.isVisible=!1,this._leftController&&(this._leftController._gazeTracker.isVisible=!1),this._rightController&&(this._rightController._gazeTracker.isVisible=!1)),this._scene.getEngine().resize(),[this._leftController,this._rightController].forEach(function(e){e&&e._deactivatePointer()}),this._hasEnteredVR=!1}},Object.defineProperty(e.prototype,"position",{get:function(){return this._position},set:function(e){this._position=e,this._scene.activeCamera&&(this._scene.activeCamera.position=e)},enumerable:!0,configurable:!0}),e.prototype.enableInteractions=function(){var e=this;this._interactionsEnabled||(this._interactionsRequested=!0,this._leftController&&this._enableInteractionOnController(this._leftController),this._rightController&&this._enableInteractionOnController(this._rightController),this.raySelectionPredicate=function(t){return t.isVisible&&(t.isPickable||t.name===e._floorMeshName)},this.meshSelectionPredicate=function(){return!0},this._raySelectionPredicate=function(t){return!!(e._isTeleportationFloor(t)||-1===t.name.indexOf("gazeTracker")&&-1===t.name.indexOf("teleportationTarget")&&-1===t.name.indexOf("torusTeleportation"))&&e.raySelectionPredicate(t)},this._interactionsEnabled=!0)},Object.defineProperty(e.prototype,"_noControllerIsActive",{get:function(){return!(this._leftController&&this._leftController._activePointer||this._rightController&&this._rightController._activePointer)},enumerable:!0,configurable:!0}),e.prototype._isTeleportationFloor=function(e){for(var t=0;t-1||this._floorMeshesCollection.push(e))},e.prototype.removeFloorMesh=function(e){if(this._floorMeshesCollection){var t=this._floorMeshesCollection.indexOf(e);-1!==t&&this._floorMeshesCollection.splice(t,1)}},e.prototype.enableTeleportation=function(e){if(void 0===e&&(e={}),!this._teleportationInitialized){this._teleportationRequested=!0,this.enableInteractions(),e.floorMeshName&&(this._floorMeshName=e.floorMeshName),e.floorMeshes&&(this._floorMeshesCollection=e.floorMeshes),null!=this._leftController&&this._enableTeleportationOnController(this._leftController),null!=this._rightController&&this._enableTeleportationOnController(this._rightController);var t=new hi.a;t.vignetteColor=new o.f(0,0,0,0),t.vignetteEnabled=!0,this._postProcessMove=new _i("postProcessMove",1,this._webVRCamera,void 0,void 0,void 0,void 0,t),this._webVRCamera.detachPostProcess(this._postProcessMove),this._teleportationInitialized=!0,this._isDefaultTeleportationTarget&&(this._createTeleportationCircles(),this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor))}},e.prototype._enableInteractionOnController=function(e){var t=this;e.webVRController.mesh&&(e._interactionsEnabled=!0,this.isInVRMode&&this._displayLaserPointer&&e._activatePointer(),this.webVROptions.laserToggle&&e.webVRController.onMainButtonStateChangedObservable.add(function(i){t._displayLaserPointer&&1===i.value&&(e._activePointer?e._deactivatePointer():e._activatePointer(),t.displayGaze&&(e._gazeTracker.isVisible=e._activePointer))}),e.webVRController.onTriggerStateChangedObservable.add(function(i){var r=e;t._noControllerIsActive&&(r=t._cameraGazer),r._pointerDownOnMeshAsked?i.valuet._padSensibilityUp&&r._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 i=o.q.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()),r=this.currentVRCamera.position;this.currentVRCamera.devicePosition&&this.currentVRCamera.deviceRotationQuaternion&&(i=this.currentVRCamera.deviceRotationQuaternion,r=this.currentVRCamera.devicePosition),i.toEulerAnglesToRef(this._workingVector),this._workingVector.z=0,this._workingVector.x=0,o.q.RotationYawPitchRollToRef(this._workingVector.y,this._workingVector.x,this._workingVector.z,this._workingQuaternion),this._workingQuaternion.toRotationMatrix(this._workingMatrix),o.x.TransformCoordinatesToRef(this._teleportBackwardsVector,this._workingMatrix,this._workingVector);var n=new ti.a(r,this._workingVector),s=this._scene.pickWithRay(n,this._raySelectionPredicate);s&&s.pickedPoint&&s.pickedMesh&&this._isTeleportationFloor(s.pickedMesh)&&s.distance<5&&this.teleportCamera(s.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===$t.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(i){t.teleportationEnabled&&(t._checkTeleportBackwards(i,e),t._checkTeleportWithRay(i,e)),t._checkRotate(i,e)}))},e.prototype._createTeleportationCircles=function(){this._teleportationTarget=de.a.CreateGround("teleportationTarget",2,2,2,this._scene),this._teleportationTarget.isPickable=!1;var e=new fi("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 i=new di.a("TextPlaneMaterial",this._scene);i.diffuseTexture=e,this._teleportationTarget.material=i;var r=de.a.CreateTorus("torusTeleportation",.75,.1,25,this._scene,!1);r.isPickable=!1,r.parent=this._teleportationTarget;var n=new N("animationInnerCircle","position.y",30,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CYCLE),o=[];o.push({frame:0,value:0}),o.push({frame:30,value:.4}),o.push({frame:60,value:0}),n.setKeys(o);var s=new le;s.setEasingMode(J.EASINGMODE_EASEINOUT),n.setEasingFunction(s),r.animations=[],r.animations.push(n),this._scene.beginAnimation(r,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 pt){e?this._rotationAngle++:this._rotationAngle--,this.currentVRCamera.animations=[];var i=o.q.FromRotationMatrix(o.j.RotationY(Math.PI/4*this._rotationAngle)),r=new N("animationRotation","rotationQuaternion",90,N.ANIMATIONTYPE_QUATERNION,N.ANIMATIONLOOPMODE_CONSTANT),n=[];n.push({frame:0,value:this.currentVRCamera.rotationQuaternion}),n.push({frame:6,value:i}),r.setKeys(n),r.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(r),this._postProcessMove.animations=[];var s=new N("animationPP","vignetteWeight",90,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CONSTANT),a=[];a.push({frame:0,value:0}),a.push({frame:3,value:4}),a.push({frame:6,value:0}),s.setKeys(a),s.setEasingFunction(this._circleEase),this._postProcessMove.animations.push(s);var c=new N("animationPP2","vignetteStretch",90,N.ANIMATIONTYPE_FLOAT,N.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,i){if(e.pickedPoint){t._teleportationRequestInitiated&&(this._displayTeleportationTarget(),this._haloCenter.copyFrom(e.pickedPoint),this._teleportationTarget.position.copyFrom(e.pickedPoint));var r=this._convertNormalToDirectionOfRay(e.getNormal(!0,!1),i);if(r){var n=o.x.Cross(o.c.Y,r),s=o.x.Cross(r,n);o.x.RotationFromAxisToRef(s,r,n,this._teleportationTarget.rotation)}this._teleportationTarget.position.y+=.1}},e.prototype.teleportCamera=function(e){var t=this;if(this.currentVRCamera instanceof pt){this.webVRCamera.leftCamera?(this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition),this._workingVector.subtractInPlace(this.webVRCamera.position),e.subtractToRef(this._workingVector,this._workingVector)):this._workingVector.copyFrom(e),this.isInVRMode?this._workingVector.y+=this.webVRCamera.deviceDistanceToRoomGround()*this._webVRCamera.deviceScaleFactor:this._workingVector.y+=this._defaultHeight,this.onBeforeCameraTeleport.notifyObservers(this._workingVector),this.currentVRCamera.animations=[];var i=new N("animationCameraTeleportation","position",90,N.ANIMATIONTYPE_VECTOR3,N.ANIMATIONLOOPMODE_CONSTANT),r=[{frame:0,value:this.currentVRCamera.position},{frame:11,value:this._workingVector}];i.setKeys(r),i.setEasingFunction(this._circleEase),this.currentVRCamera.animations.push(i),this._postProcessMove.animations=[];var n=new N("animationPP","vignetteWeight",90,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CONSTANT),o=[];o.push({frame:0,value:0}),o.push({frame:5,value:8}),o.push({frame:11,value:0}),n.setKeys(o),this._postProcessMove.animations.push(n);var s=new N("animationPP2","vignetteStretch",90,N.ANIMATIONTYPE_FLOAT,N.ANIMATIONLOOPMODE_CONSTANT),a=[];a.push({frame:0,value:0}),a.push({frame:5,value:10}),a.push({frame:11,value:0}),s.setKeys(a),this._postProcessMove.animations.push(s),this._postProcessMove.imageProcessingConfiguration.vignetteWeight=0,this._postProcessMove.imageProcessingConfiguration.vignetteStretch=0,this._webVRCamera.attachPostProcess(this._postProcessMove),this._scene.beginAnimation(this._postProcessMove,0,11,!1,1,function(){t._webVRCamera.detachPostProcess(t._postProcessMove)}),this._scene.beginAnimation(this.currentVRCamera,0,11,!1,1,function(){t.onAfterCameraTeleport.notifyObservers(t._workingVector)}),this._hideTeleportationTarget()}},e.prototype._convertNormalToDirectionOfRay=function(e,t){e&&(Math.acos(o.x.Dot(e,t.direction))e;){var i=this.rigCameras.pop();i&&i.dispose()}},t.prototype._updateForDualEyeDebugging=function(e){void 0===e&&(e=.01),this._updateNumberOfRigCameras(2),this.rigCameras[0].viewport=new o.z(0,0,.5,1),this.rigCameras[0].position.x=-e/2,this.rigCameras[0].outputRenderTarget=null,this.rigCameras[1].viewport=new o.z(.5,0,.5,1),this.rigCameras[1].position.x=e/2,this.rigCameras[1].outputRenderTarget=null},t.prototype.updateFromXRSessionManager=function(e){var i=this;if(!e._currentXRFrame||!e._currentXRFrame.getDevicePose)return!1;var r=e._currentXRFrame.getDevicePose(e._frameOfReference);return!(!r||!r.poseModelMatrix)&&(o.j.FromFloat32ArrayToRefScaled(r.poseModelMatrix,0,1,t._TmpMatrix),this._scene.useRightHandedSystem||t._TmpMatrix.toggleModelMatrixHandInPlace(),t._TmpMatrix.getTranslationToRef(this.position),t._TmpMatrix.getRotationMatrixToRef(t._TmpMatrix),o.q.FromRotationMatrixToRef(t._TmpMatrix,this.rotationQuaternion),this.computeWorldMatrix(),this._updateNumberOfRigCameras(e._currentXRFrame.views.length),e._currentXRFrame.views.forEach(function(t,n){o.j.FromFloat32ArrayToRefScaled(r.getViewMatrix(t),0,1,i.rigCameras[n]._computedViewMatrix),o.j.FromFloat32ArrayToRefScaled(t.projectionMatrix,0,1,i.rigCameras[n]._projectionMatrix),i._scene.useRightHandedSystem||(i.rigCameras[n]._computedViewMatrix.toggleModelMatrixHandInPlace(),i.rigCameras[n]._projectionMatrix.toggleProjectionMatrixHandInPlace());var s=e._xrSession.baseLayer.getViewport(t),a=e._xrSession.baseLayer.framebufferWidth,c=e._xrSession.baseLayer.framebufferHeight;i.rigCameras[n].viewport.width=s.width/a,i.rigCameras[n].viewport.height=s.height/c,i.rigCameras[n].viewport.x=s.x/a,i.rigCameras[n].viewport.y=s.y/c,i.rigCameras[n].outputRenderTarget=e._sessionRenderTargetTexture}),!0)},t._TmpMatrix=new o.j,t}(pt),Oi=i(26),Ii=i(77),Di=i(84),wi=function(e){function t(t,i,r,s,a,c,l,u,h,d,f,p,m){void 0===a&&(a=!0),void 0===c&&(c=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===l&&(l=!1),void 0===u&&(u=Ge.a.TRILINEAR_SAMPLINGMODE),void 0===h&&(h=!0),void 0===d&&(d=!1),void 0===f&&(f=!1),void 0===p&&(p=_.a.TEXTUREFORMAT_RGBA),void 0===m&&(m=!1);var g=e.call(this,null,r,!s)||this;return g.isCube=l,g.renderParticles=!0,g.renderSprites=!1,g.coordinatesMode=Ge.a.PROJECTION_MODE,g.ignoreCameraViewport=!1,g.onBeforeBindObservable=new n.c,g.onAfterUnbindObservable=new n.c,g.onBeforeRenderObservable=new n.c,g.onAfterRenderObservable=new n.c,g.onClearObservable=new n.c,g._currentRefreshId=-1,g._refreshRate=1,g._samples=1,g.boundingBoxPosition=o.x.Zero(),(r=g.getScene())?(g.renderList=new Array,g._engine=r.getEngine(),g.name=t,g.isRenderTarget=!0,g._initialSizeParameter=i,g._processSizeParameter(i),g._resizeObserver=g.getScene().getEngine().onResizeObservable.add(function(){}),g._generateMipMaps=!!s,g._doNotChangeAspectRatio=a,g._renderingManager=new Di.b(r),g._renderingManager._useSceneAutoClearSetup=!0,f?g:(g._renderTargetOptions={generateMipMaps:s,type:c,format:p,samplingMode:u,generateDepthBuffer:h,generateStencilBuffer:d},u===Ge.a.NEAREST_SAMPLINGMODE&&(g.wrapU=Ge.a.CLAMP_ADDRESSMODE,g.wrapV=Ge.a.CLAMP_ADDRESSMODE),m||(l?(g._texture=r.getEngine().createRenderTargetCubeTexture(g.getRenderSize(),g._renderTargetOptions),g.coordinatesMode=Ge.a.INVCUBIC_MODE,g._textureMatrix=o.j.Identity()):g._texture=r.getEngine().createRenderTargetTexture(g._size,g._renderTargetOptions)),g)):g}return l.d(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,i=e.push;e.push=function(){for(var r=[],n=0;n0&&(this._postProcesses[0].autoClear=!1))}},t.prototype._shouldRender=function(){return-1===this._currentRefreshId?(this._currentRefreshId=1,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)},t.prototype.getRenderSize=function(){return this.getRenderWidth()},t.prototype.getRenderWidth=function(){return this._size.width?this._size.width:this._size},t.prototype.getRenderHeight=function(){return this._size.width?this._size.height:this._size},Object.defineProperty(t.prototype,"canRescale",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.scale=function(e){var t=this.getRenderSize()*e;this.resize(t)},t.prototype.getReflectionTextureMatrix=function(){return this.isCube?this._textureMatrix:e.prototype.getReflectionTextureMatrix.call(this)},t.prototype.resize=function(e){this.releaseInternalTexture();var t=this.getScene();t&&(this._processSizeParameter(e),this.isCube?this._texture=t.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._texture=t.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions))},t.prototype.render=function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=!1),a=this.getScene()){var i,r=a.getEngine();if(void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses),this._waitingRenderList){this.renderList=[];for(var n=0;n=0&&this._renderingManager.dispatchParticles(v))}if(this.isCube)for(var b=0;b<6;b++)this.renderToTarget(b,u,e,t),a.incrementRenderId(),a.resetCachedMaterial();else this.renderToTarget(0,u,e,t);this.onAfterUnbindObservable.notifyObservers(this),a.activeCamera&&(this.activeCamera&&this.activeCamera!==a.activeCamera&&a.setTransformMatrix(a.activeCamera.getViewMatrix(),a.activeCamera.getProjectionMatrix(!0)),r.setViewport(a.activeCamera.viewport)),a.resetCachedMaterial()}},t.prototype._bestReflectionRenderTargetDimension=function(e,t){var i=e*t,r=ve.h.NearestPOT(i+16384/(128+i));return Math.min(ve.h.FloorPOT(e),r)},t.prototype.unbindFrameBuffer=function(e,t){var i=this;this._texture&&e.unBindFramebuffer(this._texture,this.isCube,function(){i.onAfterRenderObservable.notifyObservers(t)})},t.prototype.renderToTarget=function(e,t,i,r){var n=this.getScene();if(n){var o=n.getEngine();if(this._texture){this._postProcessManager?this._postProcessManager._prepareFrame(this._texture,this._postProcesses):i&&n.postProcessManager._prepareFrame(this._texture)||this._texture&&o.bindFramebuffer(this._texture,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,this.depthStencilTexture?this.depthStencilTexture:void 0),this.onBeforeRenderObservable.notifyObservers(e),this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(o):o.clear(this.clearColor||n.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||n.updateTransformMatrix(!0);for(var s=0,a=n._beforeRenderTargetDrawStage;s=0&&t.customRenderTargets.splice(i,1);for(var r=0,n=t.cameras;r=0&&o.customRenderTargets.splice(i,1)}e.prototype.dispose.call(this)}},t.prototype._rebuild=function(){this.refreshRate===t.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=t.REFRESHRATE_RENDER_ONCE),this._postProcessManager&&this._postProcessManager._rebuild()},t.prototype.freeRenderingGroups=function(){this._renderingManager&&this._renderingManager.freeRenderingGroups()},t.REFRESHRATE_RENDER_ONCE=0,t.REFRESHRATE_RENDER_ONEVERYFRAME=1,t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2,t}(Ge.a);Ge.a._CreateRenderTargetTexture=function(e,t,i,r){return new wi(e,t,i,r)};var Li,Fi=function(){function e(e){this.scene=e,this.onXRFrameObservable=new n.c,this.onXRSessionEnded=new n.c,this._sessionRenderTargetTexture=null,this._tmpMatrix=new o.j}return e.prototype.initializeAsync=function(){var e=this;return p.a.Warn("The WebXR APIs are still under development and are subject to change in the future."),this._xrNavigator=navigator,this._xrNavigator.xr?this._xrNavigator.xr.requestDevice().then(function(t){return e._xrDevice=t,e.scene.getEngine()._gl.setCompatibleXRDevice(e._xrDevice)}):Promise.reject("webXR not supported by this browser")},e.prototype.enterXRAsync=function(t,i){var r=this;return this._xrDevice.requestSession(t).then(function(e){return r._xrSession=e,r._xrSession.addEventListener("end",function(){r._sessionRenderTargetTexture=null,r.scene.getEngine().restoreDefaultFramebuffer(),r.scene.getEngine().customAnimationFrameRequester=null,r.onXRSessionEnded.notifyObservers(null),r.scene.getEngine()._renderLoop()},{once:!0}),r._xrSession.baseLayer=new XRWebGLLayer(r._xrSession,r.scene.getEngine()._gl),r._xrSession.requestFrameOfReference(i)}).then(function(t){r._frameOfReference=t,r.scene.getEngine().customAnimationFrameRequester={requestAnimationFrame:r._xrSession.requestAnimationFrame.bind(r._xrSession),renderFunction:function(e,t){r._currentXRFrame=t,r.onXRFrameObservable.notifyObservers(null),r.scene.getEngine()._renderLoop()}},r._sessionRenderTargetTexture=e._CreateRenderTargetTextureFromSession(r._xrSession,r.scene),window.cancelAnimationFrame(r.scene.getEngine()._frameHandler),r.scene.getEngine()._renderLoop()})},e.prototype.exitXRAsync=function(){return this._xrSession.end()},e.prototype.environmentPointHitTestAsync=function(e){var t=this;return new Promise(function(i){var r=new Float32Array([e.origin.x,e.origin.y,e.origin.z]),n=new Float32Array([e.direction.x,e.direction.y,e.direction.z]);t.scene.useRightHandedSystem||(r[2]*=-1,n[2]*=-1),t._xrSession.requestHitTest(r,n,t._frameOfReference).then(function(e){if(e.length>0){o.j.FromFloat32ArrayToRefScaled(e[0].hitMatrix,0,1,t._tmpMatrix);var r=t._tmpMatrix.getTranslation();t.scene.useRightHandedSystem||(r.z*=-1),i(r)}else i(null)}).catch(function(){i(null)})})},e.prototype.supportsSessionAsync=function(e){return this._xrDevice.supportsSession(e).then(function(){return!0}).catch(function(){return!1})},e._CreateRenderTargetTextureFromSession=function(e,t){var i=new Oi.a(t.getEngine(),Oi.a.DATASOURCE_UNKNOWN,!0);i.width=e.baseLayer.framebufferWidth,i.height=e.baseLayer.framebufferHeight,i._framebuffer=e.baseLayer.framebuffer;var r=new wi("XR renderTargetTexture",{width:i.width,height:i.height},t,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,!0);return r._texture=i,r},e.prototype.dispose=function(){this.onXRFrameObservable.clear(),this.onXRSessionEnded.clear()},e}();!function(e){e[e.ENTERING_XR=0]="ENTERING_XR",e[e.EXITING_XR=1]="EXITING_XR",e[e.IN_XR=2]="IN_XR",e[e.NOT_IN_XR=3]="NOT_IN_XR"}(Li||(Li={}));var Ni,Bi=function(){function e(e){this.scene=e,this.state=Li.NOT_IN_XR,this.onStateChangedObservable=new n.c,this._nonVRCamera=null,this._originalSceneAutoClear=!0,this._supported=!1,this.camera=new Mi("",e),this._sessionManager=new Fi(e),this.container=new Le.a("",e),this.camera.parent=this.container}return e.prototype._setState=function(e){this.state=e,this.onStateChangedObservable.notifyObservers(this.state)},e.CreateAsync=function(t){var i=new e(t);return i._sessionManager.initializeAsync().then(function(){return i._supported=!0,i}).catch(function(){return i})},e.prototype.exitXRAsync=function(){return this._setState(Li.EXITING_XR),this._sessionManager.exitXRAsync()},e.prototype.enterXRAsync=function(e,t){var i=this;if(!this._supported)throw"XR session not supported by this browser";return this._setState(Li.ENTERING_XR),this._sessionManager.enterXRAsync(e,t).then(function(){i._originalSceneAutoClear=i.scene.autoClear,i._nonVRCamera=i.scene.activeCamera,i.scene.autoClear=!1,i.scene.activeCamera=i.camera,i._sessionManager.onXRFrameObservable.add(function(){i.camera.updateFromXRSessionManager(i._sessionManager)}),i._sessionManager.onXRSessionEnded.addOnce(function(){i.camera.rigCameras.forEach(function(e){e.outputRenderTarget=null}),i.scene.autoClear=i._originalSceneAutoClear,i.scene.activeCamera=i._nonVRCamera,i._sessionManager.onXRFrameObservable.clear(),i._setState(Li.NOT_IN_XR)}),i._setState(Li.IN_XR)})},e.prototype.environmentPointHitTestAsync=function(e){return this._sessionManager.environmentPointHitTestAsync(e)},e.prototype.setPositionOfCameraUsingContainer=function(t){this.camera.globalPosition.subtractToRef(t,e._TmpVector),this.container.position.subtractInPlace(e._TmpVector)},e.prototype.rotateCameraByQuaternionUsingContainer=function(e){this.container.rotationQuaternion||(this.container.rotationQuaternion=o.q.FromEulerVector(this.container.rotation)),this.container.rotationQuaternion.multiplyInPlace(e),this.container.position.rotateByQuaternionAroundPointToRef(e,this.camera.globalPosition,this.container.position)},e.prototype.supportsSessionAsync=function(e){return this._supported?this._sessionManager.supportsSessionAsync(e):Promise.resolve(!1)},e.prototype.dispose=function(){this.camera.dispose(),this.container.dispose(),this.onStateChangedObservable.clear(),this._sessionManager.dispose()},e._TmpVector=new o.x,e}(),Ui=function(){function e(e,t){this.element=e,this.initializationOptions=t}return e.prototype.update=function(e){},e}(),Vi=function(){return function(){}}(),Gi=function(){function e(e,t){var i=this;if(this.scene=e,this._buttons=[],this._activeButton=null,this.activeButtonChangedObservable=new n.c,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 r=document.createElement("button");r.style.cssText="color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-repeat:no-repeat; background-position: center; outline: none;",r.innerText="HMD",this._buttons.push(new Ui(r,{immersive:!0,outputContext:t.outputCanvasContext})),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",this.element.innerText=e===this?"EXIT":"HMD"};var o=document.createElement("button");o.style.cssText=r.style.cssText,o.innerText="Window",this._buttons.push(new Ui(o,{immersive:!1,environmentIntegration:!0,outputContext:t.outputCanvasContext})),this._buttons[this._buttons.length-1].update=function(e){this.element.style.display=null===e||e===this?"":"none",this.element.innerText=e===this?"EXIT":"Window"},this._updateButtons(null)}var s=e.getEngine().getRenderingCanvas();s&&s.parentNode&&(s.parentNode.appendChild(this._overlay),e.onDisposeObservable.addOnce(function(){i.dispose()}))}return e.CreateAsync=function(t,i,r){var n=this,o=new e(t,r),s=o._buttons.map(function(e){return i.supportsSessionAsync(e.initializationOptions)});return i.onStateChangedObservable.add(function(e){e==Li.NOT_IN_XR&&o._updateButtons(null)}),Promise.all(s).then(function(e){return e.forEach(function(e,t){e&&(o._overlay.appendChild(o._buttons[t].element),o._buttons[t].element.onclick=function(){return l.b(n,void 0,void 0,function(){return l.e(this,function(e){switch(e.label){case 0:return i.state!=Li.IN_XR?[3,2]:(o._updateButtons(null),[4,i.exitXRAsync()]);case 1:return e.sent(),[2];case 2:return i.state!=Li.NOT_IN_XR?[3,4]:(o._updateButtons(o._buttons[t]),[4,i.enterXRAsync(o._buttons[t].initializationOptions,"eye-level")]);case 3:e.sent(),e.label=4;case 4:return[2]}})})})}),o})},e.prototype._updateButtons=function(e){var t=this;this._activeButton=e,this._buttons.forEach(function(e){e.update(t._activeButton)}),this.activeButtonChangedObservable.notifyObservers(this._activeButton)},e.prototype.dispose=function(){var e=this.scene.getEngine().getRenderingCanvas();e&&e.parentNode&&e.parentNode.contains(this._overlay)&&e.parentNode.removeChild(this._overlay),this.activeButtonChangedObservable.clear()},e}(),ki=function(){function e(e){this.pointer=new Le.a("controllerPointer",e)}return e.prototype.dispose=function(){this.grip&&this.grip.dispose(),this.pointer.dispose()},e}(),zi=function(){function e(e){var t=this;this.helper=e,this.controllers=[],this._tmpMatrix=new o.j,this._frameObserver=e._sessionManager.onXRFrameObservable.add(function(){if(e._sessionManager._currentXRFrame&&e._sessionManager._currentXRFrame.getDevicePose){var i=e._sessionManager._currentXRFrame;e._sessionManager._xrSession.getInputSources().forEach(function(r,n){var s=i.getInputPose(r,e._sessionManager._frameOfReference);if(s){t.controllers.length<=n&&t.controllers.push(new ki(e.container.getScene()));var a=t.controllers[n];s.gripMatrix&&(a.grip||(a.grip=new Le.a("controllerGrip",e.container.getScene())),o.j.FromFloat32ArrayToRefScaled(s.gripMatrix,0,1,t._tmpMatrix),a.grip.getScene().useRightHandedSystem||t._tmpMatrix.toggleModelMatrixHandInPlace(),a.grip.rotationQuaternion||(a.grip.rotationQuaternion=new o.q),t._tmpMatrix.decompose(a.grip.scaling,a.grip.rotationQuaternion,a.grip.position)),o.j.FromFloat32ArrayToRefScaled(s.targetRay.transformMatrix,0,1,t._tmpMatrix),a.pointer.getScene().useRightHandedSystem||t._tmpMatrix.toggleModelMatrixHandInPlace(),a.pointer.rotationQuaternion||(a.pointer.rotationQuaternion=new o.q),t._tmpMatrix.decompose(a.pointer.scaling,a.pointer.rotationQuaternion,a.pointer.position)}})}})}return e.prototype.dispose=function(){this.controllers.forEach(function(e){e.dispose()}),this.helper._sessionManager.onXRFrameObservable.remove(this._frameObserver)},e}(),ji=function(){function e(e,t){var i=this;this._canvas=null,this.canvasContext=null,t||((t=document.createElement("canvas")).style.cssText="position:absolute; bottom:0px;right:0px;z-index:10;width:100%;height:100%;background-color: #000000;"),this._setManagedOutputCanvas(t),e.onStateChangedObservable.add(function(t){t==Li.ENTERING_XR?i._addCanvas():e.state==Li.NOT_IN_XR&&i._removeCanvas()})}return e.prototype.dispose=function(){this._removeCanvas(),this._setManagedOutputCanvas(null)},e.prototype._setManagedOutputCanvas=function(e){this._removeCanvas(),e?(this._canvas=e,this.canvasContext=this._canvas.getContext("xrpresent")):(this._canvas=null,this.canvasContext=null)},e.prototype._addCanvas=function(){this._canvas&&document.body.appendChild(this._canvas)},e.prototype._removeCanvas=function(){this._canvas&&document.body.contains(this._canvas)&&document.body.removeChild(this._canvas)},e}(),Wi=(Ni={root:0,found:!1},function(e,t,i,r){Ni.root=0,Ni.found=!1;var n=t*t-4*e*i;if(n<0)return Ni;var o=Math.sqrt(n),s=(-t-o)/(2*e),a=(-t+o)/(2*e);if(s>a){var c=a;a=s,s=c}return s>0&&s0&&a=0))},e.prototype._canDoCollision=function(e,t,i,r){var n=o.x.Distance(this._basePointWorld,e),s=Math.max(this._radius.x,this._radius.y,this._radius.z);return!(n>this._velocityWorldLength+s+t)&&!!function(e,t,i,r){return!(e.x>i.x+r||i.x-r>t.x||e.y>i.y+r||i.y-r>t.y||e.z>i.z+r||i.z-r>t.z)}(i,r,this._basePointWorld,this._velocityWorldLength+s)},e.prototype._testTriangle=function(e,t,i,r,n,s){var a,c=!1;t||(t=[]),t[e]||(t[e]=new o.n(0,0,0,0),t[e].copyFromPoints(i,r,n));var l=t[e];if(s||l.isFrontFacingTo(this._normalizedVelocity,0)){var u=l.signedDistanceTo(this._basePoint),h=o.x.Dot(l.normal,this._velocity);if(0==h){if(Math.abs(u)>=1)return;c=!0,a=0}else{var d=(1-u)/h;if((a=(-1-u)/h)>d){var f=d;d=a,a=f}if(a>1||d<0)return;a<0&&(a=0),a>1&&(a=1)}this._collisionPoint.copyFromFloats(0,0,0);var p=!1,_=1;if(c||(this._basePoint.subtractToRef(l.normal,this._planeIntersectionPoint),this._velocity.scaleToRef(a,this._tempVector),this._planeIntersectionPoint.addInPlace(this._tempVector),this._checkPointInTriangle(this._planeIntersectionPoint,i,r,n,l.normal)&&(p=!0,_=a,this._collisionPoint.copyFrom(this._planeIntersectionPoint))),!p){var m=this._velocity.lengthSquared(),g=m;this._basePoint.subtractToRef(i,this._tempVector);var v=2*o.x.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,b=Wi(g,v,y,_);b.found&&(_=b.root,p=!0,this._collisionPoint.copyFrom(i)),this._basePoint.subtractToRef(r,this._tempVector),v=2*o.x.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(b=Wi(g,v,y,_)).found&&(_=b.root,p=!0,this._collisionPoint.copyFrom(r)),this._basePoint.subtractToRef(n,this._tempVector),v=2*o.x.Dot(this._velocity,this._tempVector),y=this._tempVector.lengthSquared()-1,(b=Wi(g,v,y,_)).found&&(_=b.root,p=!0,this._collisionPoint.copyFrom(n)),r.subtractToRef(i,this._edge),i.subtractToRef(this._basePoint,this._baseToVertex);var T=this._edge.lengthSquared(),E=o.x.Dot(this._edge,this._velocity),x=o.x.Dot(this._edge,this._baseToVertex);if(g=T*-m+E*E,v=T*(2*o.x.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=Wi(g,v,y,_)).found){var A=(E*b.root-x)/T;A>=0&&A<=1&&(_=b.root,p=!0,this._edge.scaleInPlace(A),i.addToRef(this._edge,this._collisionPoint))}n.subtractToRef(r,this._edge),r.subtractToRef(this._basePoint,this._baseToVertex),T=this._edge.lengthSquared(),E=o.x.Dot(this._edge,this._velocity),x=o.x.Dot(this._edge,this._baseToVertex),g=T*-m+E*E,v=T*(2*o.x.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=Wi(g,v,y,_)).found&&(A=(E*b.root-x)/T)>=0&&A<=1&&(_=b.root,p=!0,this._edge.scaleInPlace(A),r.addToRef(this._edge,this._collisionPoint)),i.subtractToRef(n,this._edge),n.subtractToRef(this._basePoint,this._baseToVertex),T=this._edge.lengthSquared(),E=o.x.Dot(this._edge,this._velocity),x=o.x.Dot(this._edge,this._baseToVertex),g=T*-m+E*E,v=T*(2*o.x.Dot(this._velocity,this._baseToVertex))-2*E*x,y=T*(1-this._baseToVertex.lengthSquared())+x*x,(b=Wi(g,v,y,_)).found&&(A=(E*b.root-x)/T)>=0&&A<=1&&(_=b.root,p=!0,this._edge.scaleInPlace(A),n.addToRef(this._edge,this._collisionPoint))}if(p){var P=_*this._velocity.length();(!this.collisionFound||P=r)n.copyFrom(e);else{var a=o?o.collisionMask:i.collisionMask;i._initialize(e,t,s);for(var c=0;cthis.capacity&&this._depth-1&&this.entries.splice(i,1)}},e.prototype.addEntries=function(e){for(var t=0;te.occlusionRetryCount))return!1;e.isOcclusionQueryInProgress=!1,e.occlusionInternalRetryCounter=0,e.isOccluded=e.occlusionType!==Le.a.OCCLUSION_TYPE_OPTIMISTIC&&e.isOccluded}var r=this.getScene();if(r.getBoundingBoxRenderer){var n=r.getBoundingBoxRenderer();this._occlusionQuery||(this._occlusionQuery=t.createQuery()),t.beginOcclusionQuery(e.occlusionQueryAlgorithmType,this._occlusionQuery),n.renderOcclusionBoundingBox(this),t.endOcclusionQuery(e.occlusionQueryAlgorithmType),this._occlusionDataStorage.isOcclusionQueryInProgress=!0}return e.isOccluded};_e.b.prototype.createTransformFeedback=function(){return this._gl.createTransformFeedback()},_e.b.prototype.deleteTransformFeedback=function(e){this._gl.deleteTransformFeedback(e)},_e.b.prototype.bindTransformFeedback=function(e){this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK,e)},_e.b.prototype.beginTransformFeedback=function(e){void 0===e&&(e=!0),this._gl.beginTransformFeedback(e?this._gl.POINTS:this._gl.TRIANGLES)},_e.b.prototype.endTransformFeedback=function(){this._gl.endTransformFeedback()},_e.b.prototype.setTranformFeedbackVaryings=function(e,t){this._gl.transformFeedbackVaryings(e,t,this._gl.INTERLEAVED_ATTRIBS)},_e.b.prototype.bindTransformFeedbackBuffer=function(e){this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER,0,e)};var ar=function(){function e(){}return e.COPY=1,e.CUT=2,e.PASTE=3,e}(),cr=function(){function e(e,t){this.type=e,this.event=t}return e.GetTypeFromCharacter=function(e){switch(e){case 67:return ar.COPY;case 86:return ar.PASTE;case 88:return ar.CUT;default:return-1}},e}(),lr=i(58),ur=i(53),hr=function(){function e(e,t,i){this.lengthComputable=e,this.loaded=t,this.total=i}return e.FromProgressEvent=function(t){return new e(t.lengthComputable,t.loaded,t.total)},e}(),dr=function(){function e(){}return Object.defineProperty(e,"ForceFullSceneLoadingForIncremental",{get:function(){return ur.a.ForceFullSceneLoadingForIncremental},set:function(e){ur.a.ForceFullSceneLoadingForIncremental=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ShowLoadingScreen",{get:function(){return ur.a.ShowLoadingScreen},set:function(e){ur.a.ShowLoadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"loggingLevel",{get:function(){return ur.a.loggingLevel},set:function(e){ur.a.loggingLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CleanBoneMatrixWeights",{get:function(){return ur.a.CleanBoneMatrixWeights},set:function(e){ur.a.CleanBoneMatrixWeights=e},enumerable:!0,configurable:!0}),e._getDefaultPlugin=function(){return e._registeredPlugins[".babylon"]},e._getPluginForExtension=function(t){var i=e._registeredPlugins[t];return i||(p.a.Warn("Unable to find a plugin to load "+t+" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: http://doc.babylonjs.com/how_to/load_from_any_file_type"),e._getDefaultPlugin())},e._getPluginForDirectLoad=function(t){for(var i in e._registeredPlugins){var r=e._registeredPlugins[i].plugin;if(r.canDirectLoad&&r.canDirectLoad(t))return e._registeredPlugins[i]}return e._getDefaultPlugin()},e._getPluginForFilename=function(t){var i=t.indexOf("?");-1!==i&&(t=t.substring(0,i));var r=t.lastIndexOf("."),n=t.substring(r,t.length).toLowerCase();return e._getPluginForExtension(n)},e._getDirectLoad=function(e){return"data:"===e.substr(0,5)?e.substr(5):null},e._loadData=function(t,i,r,n,o,s,a){var c,l=e._getDirectLoad(t.name),u=a?e._getPluginForExtension(a):l?e._getPluginForDirectLoad(t.name):e._getPluginForFilename(t.name);if(!(c=u.plugin.createPlugin?u.plugin.createPlugin():u.plugin))throw"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.";var h,d=u.isBinary;e.OnPluginActivatedObservable.notifyObservers(c);var f=function(e,t){i.isDisposed?o("Scene has been disposed"):(i.offlineProvider=h,r(c,e,t))},p=null,_=!1,m=c.onDisposeObservable;m&&m.add(function(){_=!0,p&&(p.abort(),p=null),s()});var g=function(){_||(p=ve.h.LoadFile(t.url,f,n?function(e){n(hr.FromProgressEvent(e))}:void 0,h,d,function(e,t){o("Failed to load scene."+(t?" "+t.message:""),t)}))};if(l)return f(l),c;var v=t.file||lr.a.FilesToLoad[t.name.toLowerCase()];if(-1===t.rootUrl.indexOf("file:")||-1!==t.rootUrl.indexOf("file:")&&!v){var y=i.getEngine(),b=y.enableOfflineSupport;if(b){for(var T=!1,E=0,x=i.disableOfflineSupportExceptionRules;Es.snapDistance?(r=Math.floor(Math.abs(h)/s.snapDistance),h<0&&(r*=-1),h%=s.snapDistance,d.scaleToRef(s.snapDistance*r,d),i=!0):d.scaleInPlace(0)),s.attachedMesh.scaling.addInPlace(d),i&&(f.snapDistance=s.snapDistance*r,s.onSnapObservable.notifyObservers(f))}}),s._pointerObserver=r.utilityLayerScene.onPointerObservable.add(function(e){if(!s._customMeshSet){var t=e.pickInfo&&-1!=s._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?a:s._coloredMaterial;s._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),s}return l.d(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this)},t.prototype.setCustomMesh=function(t,i){var r=this;void 0===i&&(i=!1),e.prototype.setCustomMesh.call(this,t),i&&(this._rootMesh.getChildMeshes().forEach(function(e){e.material=r._coloredMaterial,e.color&&(e.color=r._coloredMaterial.emissiveColor)}),this._customMeshSet=!1)},t}(xr.a),Rr=i(55),Sr=function(e){function t(t,i){void 0===t&&(t=o.e.Gray()),void 0===i&&(i=Ar.a.DefaultKeepDepthUtilityLayer);var r=e.call(this,i)||this;r._boundingDimensions=new o.x(1,1,1),r._renderObserver=null,r._pointerObserver=null,r._scaleDragSpeed=.2,r._tmpQuaternion=new o.q,r._tmpVector=new o.x(0,0,0),r._tmpRotationMatrix=new o.j,r.ignoreChildren=!1,r.includeChildPredicate=null,r.rotationSphereSize=.1,r.scaleBoxSize=.1,r.fixedDragMeshScreenSize=!1,r.fixedDragMeshScreenSizeDistanceFactor=10,r.onDragStartObservable=new n.c,r.onScaleBoxDragObservable=new n.c,r.onScaleBoxDragEndObservable=new n.c,r.onRotationSphereDragObservable=new n.c,r.onRotationSphereDragEndObservable=new n.c,r.scalePivot=null,r._existingMeshScale=new o.x,r._dragMesh=null,r.pointerDragBehavior=new De.a,r._updateScale=!1,r._anchorMesh=new Le.a("anchor",i.utilityLayerScene);var s=new di.a("",i.utilityLayerScene);s.disableLighting=!0,s.emissiveColor=t;var a=new di.a("",i.utilityLayerScene);a.disableLighting=!0,a.emissiveColor=t.clone().add(new o.e(.3,.3,.3)),r._lineBoundingBox=new Le.a("",i.utilityLayerScene),r._lineBoundingBox.rotationQuaternion=new o.q;var c=[];c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,0),new o.x(r._boundingDimensions.x,0,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,0),new o.x(0,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,0),new o.x(0,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,0,0),new o.x(r._boundingDimensions.x,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,0,0),new o.x(r._boundingDimensions.x,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,r._boundingDimensions.y,0),new o.x(r._boundingDimensions.x,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,r._boundingDimensions.y,0),new o.x(0,r._boundingDimensions.y,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,r._boundingDimensions.z),new o.x(r._boundingDimensions.x,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(0,0,r._boundingDimensions.z),new o.x(0,r._boundingDimensions.y,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,r._boundingDimensions.y,r._boundingDimensions.z),new o.x(0,r._boundingDimensions.y,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,r._boundingDimensions.y,r._boundingDimensions.z),new o.x(r._boundingDimensions.x,0,r._boundingDimensions.z)]},i.utilityLayerScene)),c.push(Er.a.CreateLines("lines",{points:[new o.x(r._boundingDimensions.x,r._boundingDimensions.y,r._boundingDimensions.z),new o.x(r._boundingDimensions.x,r._boundingDimensions.y,0)]},i.utilityLayerScene)),c.forEach(function(e){e.color=t,e.position.addInPlace(new o.x(-r._boundingDimensions.x/2,-r._boundingDimensions.y/2,-r._boundingDimensions.z/2)),e.isPickable=!1,r._lineBoundingBox.addChild(e)}),r._rootMesh.addChild(r._lineBoundingBox),r._rotateSpheresParent=new Le.a("",i.utilityLayerScene),r._rotateSpheresParent.rotationQuaternion=new o.q;for(var l=function(e){var t=Rr.a.CreateSphere("",{diameter:1},i.utilityLayerScene);t.rotationQuaternion=new o.q,t.material=s,(_=new De.a({})).moveAttached=!1,_.updateDragPlane=!1,t.addBehavior(_);var n=new o.x(1,0,0),a=0;_.onDragStartObservable.add(function(){n.copyFrom(t.forward),a=0}),_.onDragObservable.add(function(t){if(r.onRotationSphereDragObservable.notifyObservers({}),r.attachedMesh){var i=r.attachedMesh.parent;if(i&&i.scaling&&i.scaling.isNonUniformWithinEpsilon(.001))return void p.a.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");Ne.a._RemoveAndStorePivotPoint(r.attachedMesh);var s=n,c=t.dragPlaneNormal.scale(o.x.Dot(t.dragPlaneNormal,s)),l=s.subtract(c).normalizeToNew(),u=o.x.Dot(l,t.delta)<0?Math.abs(t.delta.length()):-Math.abs(t.delta.length());u=u/r._boundingDimensions.length()*r._anchorMesh.scaling.length(),r.attachedMesh.rotationQuaternion||(r.attachedMesh.rotationQuaternion=o.q.RotationYawPitchRoll(r.attachedMesh.rotation.y,r.attachedMesh.rotation.x,r.attachedMesh.rotation.z)),r._anchorMesh.rotationQuaternion||(r._anchorMesh.rotationQuaternion=o.q.RotationYawPitchRoll(r._anchorMesh.rotation.y,r._anchorMesh.rotation.x,r._anchorMesh.rotation.z)),a+=u,Math.abs(a)<=2*Math.PI&&(e>=8?o.q.RotationYawPitchRollToRef(0,0,u,r._tmpQuaternion):e>=4?o.q.RotationYawPitchRollToRef(u,0,0,r._tmpQuaternion):o.q.RotationYawPitchRollToRef(0,u,0,r._tmpQuaternion),r._anchorMesh.addChild(r.attachedMesh),r._anchorMesh.rotationQuaternion.multiplyToRef(r._tmpQuaternion,r._anchorMesh.rotationQuaternion),r._anchorMesh.removeChild(r.attachedMesh),r.attachedMesh.setParent(i)),r.updateBoundingBox(),Ne.a._RestorePivotPoint(r.attachedMesh)}r._updateDummy()}),_.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({}),r._selectNode(t)}),_.onDragEndObservable.add(function(){r.onRotationSphereDragEndObservable.notifyObservers({}),r._selectNode(null),r._updateDummy()}),u._rotateSpheresParent.addChild(t)},u=this,h=0;h<12;h++)l(h);r._rootMesh.addChild(r._rotateSpheresParent),r._scaleBoxesParent=new Le.a("",i.utilityLayerScene),r._scaleBoxesParent.rotationQuaternion=new o.q;for(var d=0;d<2;d++)for(var f=0;f<2;f++)for(var _,m=function(){var e=Tr.a.CreateBox("",{size:1},i.utilityLayerScene);e.material=s;var t=new o.x(0==d?-1:1,0==f?-1:1,0==v?-1:1);(_=new De.a({dragAxis:t})).moveAttached=!1,e.addBehavior(_),_.onDragObservable.add(function(t){if(r.onScaleBoxDragObservable.notifyObservers({}),r.attachedMesh){var i=r.attachedMesh.parent;if(i&&i.scaling&&i.scaling.isNonUniformWithinEpsilon(.001))return void p.a.Warn("BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling");Ne.a._RemoveAndStorePivotPoint(r.attachedMesh);var n=t.dragDistance/r._boundingDimensions.length()*r._anchorMesh.scaling.length(),s=new o.x(n,n,n);s.scaleInPlace(r._scaleDragSpeed),r.updateBoundingBox(),r.scalePivot?(r.attachedMesh.getWorldMatrix().getRotationMatrixToRef(r._tmpRotationMatrix),r._boundingDimensions.scaleToRef(.5,r._tmpVector),o.x.TransformCoordinatesToRef(r._tmpVector,r._tmpRotationMatrix,r._tmpVector),r._anchorMesh.position.subtractInPlace(r._tmpVector),r._boundingDimensions.multiplyToRef(r.scalePivot,r._tmpVector),o.x.TransformCoordinatesToRef(r._tmpVector,r._tmpRotationMatrix,r._tmpVector),r._anchorMesh.position.addInPlace(r._tmpVector)):(e.absolutePosition.subtractToRef(r._anchorMesh.position,r._tmpVector),r._anchorMesh.position.subtractInPlace(r._tmpVector)),r._anchorMesh.addChild(r.attachedMesh),r._anchorMesh.scaling.addInPlace(s),(r._anchorMesh.scaling.x<0||r._anchorMesh.scaling.y<0||r._anchorMesh.scaling.z<0)&&r._anchorMesh.scaling.subtractInPlace(s),r._anchorMesh.removeChild(r.attachedMesh),r.attachedMesh.setParent(i),Ne.a._RestorePivotPoint(r.attachedMesh)}r._updateDummy()}),_.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({}),r._selectNode(e)}),_.onDragEndObservable.add(function(){r.onScaleBoxDragEndObservable.notifyObservers({}),r._selectNode(null),r._updateDummy()}),g._scaleBoxesParent.addChild(e)},g=this,v=0;v<2;v++)m();r._rootMesh.addChild(r._scaleBoxesParent);var y=new Array;return r._pointerObserver=i.utilityLayerScene.onPointerObservable.add(function(e){y[e.event.pointerId]?e.pickInfo&&e.pickInfo.pickedMesh!=y[e.event.pointerId]&&(y[e.event.pointerId].material=s,delete y[e.event.pointerId]):r._rotateSpheresParent.getChildMeshes().concat(r._scaleBoxesParent.getChildMeshes()).forEach(function(t){e.pickInfo&&e.pickInfo.pickedMesh==t&&(y[e.event.pointerId]=t,t.material=a)})}),r._renderObserver=r.gizmoLayer.originalScene.onBeforeRenderObservable.add(function(){r.attachedMesh&&!r._existingMeshScale.equals(r.attachedMesh.scaling)?r.updateBoundingBox():r.fixedDragMeshScreenSize&&(r._updateRotationSpheres(),r._updateScaleBoxes()),r._dragMesh&&r.attachedMesh&&r.pointerDragBehavior.dragging&&(r._lineBoundingBox.position.rotateByQuaternionToRef(r._rootMesh.rotationQuaternion,r._tmpVector),r.attachedMesh.setAbsolutePosition(r._dragMesh.position.add(r._tmpVector.scale(-1))))}),r.updateBoundingBox(),r}return l.d(t,e),t.prototype._attachedMeshChanged=function(e){var t=this;if(e){Ne.a._RemoveAndStorePivotPoint(e);var i=e.parent;this._anchorMesh.addChild(e),this._anchorMesh.removeChild(e),e.setParent(i),Ne.a._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){Ne.a._RemoveAndStorePivotPoint(this.attachedMesh);var e=this.attachedMesh.parent;this.attachedMesh.setParent(null),this._update(),this.attachedMesh.rotationQuaternion||(this.attachedMesh.rotationQuaternion=o.q.RotationYawPitchRoll(this.attachedMesh.rotation.y,this.attachedMesh.rotation.x,this.attachedMesh.rotation.z)),this._anchorMesh.rotationQuaternion||(this._anchorMesh.rotationQuaternion=o.q.RotationYawPitchRoll(this._anchorMesh.rotation.y,this._anchorMesh.rotation.x,this._anchorMesh.rotation.z)),this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion),this._tmpVector.copyFrom(this.attachedMesh.position),this.attachedMesh.rotationQuaternion.set(0,0,0,1),this.attachedMesh.position.set(0,0,0);var t=this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren,this.includeChildPredicate);t.max.subtractToRef(t.min,this._boundingDimensions),this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions),this._lineBoundingBox.position.set((t.max.x+t.min.x)/2,(t.max.y+t.min.y)/2,(t.max.z+t.min.z)/2),this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position),this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position),this._lineBoundingBox.computeWorldMatrix(),this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition),this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion),this.attachedMesh.position.copyFrom(this._tmpVector),this.attachedMesh.setParent(e)}this._updateRotationSpheres(),this._updateScaleBoxes(),this.attachedMesh&&(this._existingMeshScale.copyFrom(this.attachedMesh.scaling),Ne.a._RestorePivotPoint(this.attachedMesh))},t.prototype._updateRotationSpheres=function(){for(var e=this._rotateSpheresParent.getChildMeshes(),t=0;t<3;t++)for(var i=0;i<2;i++)for(var r=0;r<2;r++){var n=4*t+2*i+r;if(0==t&&(e[n].position.set(this._boundingDimensions.x/2,this._boundingDimensions.y*i,this._boundingDimensions.z*r),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[n].lookAt(o.x.Cross(e[n].position.normalizeToNew(),o.x.Right()).normalizeToNew().add(e[n].position))),1==t&&(e[n].position.set(this._boundingDimensions.x*i,this._boundingDimensions.y/2,this._boundingDimensions.z*r),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[n].lookAt(o.x.Cross(e[n].position.normalizeToNew(),o.x.Up()).normalizeToNew().add(e[n].position))),2==t&&(e[n].position.set(this._boundingDimensions.x*i,this._boundingDimensions.y*r,this._boundingDimensions.z/2),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),e[n].lookAt(o.x.Cross(e[n].position.normalizeToNew(),o.x.Forward()).normalizeToNew().add(e[n].position))),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[n].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var s=this.rotationSphereSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[n].scaling.set(s,s,s)}else e[n].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 i=0;i<2;i++)for(var r=0;r<2;r++){var n=4*t+2*i+r;if(e[n])if(e[n].position.set(this._boundingDimensions.x*t,this._boundingDimensions.y*i,this._boundingDimensions.z*r),e[n].position.addInPlace(new o.x(-this._boundingDimensions.x/2,-this._boundingDimensions.y/2,-this._boundingDimensions.z/2)),this.fixedDragMeshScreenSize&&this.gizmoLayer.utilityLayerScene.activeCamera){e[n].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position,this._tmpVector);var s=this.scaleBoxSize*this._tmpVector.length()/this.fixedDragMeshScreenSizeDistanceFactor;e[n].scaling.set(s,s,s)}else e[n].scaling.set(this.scaleBoxSize,this.scaleBoxSize,this.scaleBoxSize)}},t.prototype.setEnabledRotationAxis=function(e){this._rotateSpheresParent.getChildMeshes().forEach(function(t,i){i<4?t.setEnabled(-1!=e.indexOf("x")):i<8?t.setEnabled(-1!=e.indexOf("y")):t.setEnabled(-1!=e.indexOf("z"))})},t.prototype.setEnabledScaling=function(e){this._scaleBoxesParent.getChildMeshes().forEach(function(t,i){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=de.a.CreateBox("dummy",1,this.gizmoLayer.utilityLayerScene),this._dragMesh.visibility=0,this._dragMesh.rotationQuaternion=new o.q,this.pointerDragBehavior.useObjectOrienationForDragging=!1,this._dragMesh.addBehavior(this.pointerDragBehavior)},t.prototype.dispose=function(){this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver),this._lineBoundingBox.dispose(),this._rotateSpheresParent.dispose(),this._scaleBoxesParent.dispose(),this._dragMesh&&this._dragMesh.dispose(),e.prototype.dispose.call(this)},t.MakeNotPickableAndWrapInBoundingBox=function(e){var t=function(e){e.isPickable=!1,e.getChildMeshes().forEach(function(e){t(e)})};t(e),e.rotationQuaternion||(e.rotationQuaternion=o.q.RotationYawPitchRoll(e.rotation.y,e.rotation.x,e.rotation.z));var i=e.position.clone(),r=e.rotationQuaternion.clone();e.rotationQuaternion.set(0,0,0,1),e.position.set(0,0,0);var n=Tr.a.CreateBox("box",{size:1},e.getScene()),s=e.getHierarchyBoundingVectors();return s.max.subtractToRef(s.min,n.scaling),0===n.scaling.y&&(n.scaling.y=o.h),0===n.scaling.x&&(n.scaling.x=o.h),0===n.scaling.z&&(n.scaling.z=o.h),n.position.set((s.max.x+s.min.x)/2,(s.max.y+s.min.y)/2,(s.max.z+s.min.z)/2),e.addChild(n),e.rotationQuaternion.copyFrom(r),e.position.copyFrom(i),e.removeChild(n),n.addChild(e),n.visibility=0,n},t.prototype.setCustomMesh=function(e){p.a.Error("Custom meshes are not supported on this gizmo")},t}(xr.a),Cr=function(e){function t(t,i,r,s){void 0===i&&(i=o.e.Gray()),void 0===r&&(r=Ar.a.DefaultUtilityLayer),void 0===s&&(s=32);var a=e.call(this,r)||this;a._pointerObserver=null,a.snapDistance=0,a.onSnapObservable=new n.c;var c=new di.a("",r.utilityLayerScene);c.disableLighting=!0,c.emissiveColor=i;var l=new di.a("",r.utilityLayerScene);l.disableLighting=!0,l.emissiveColor=i.add(new o.e(.3,.3,.3));for(var u=new Le.a("",r.utilityLayerScene),h=new Array,d=0;d0&&(g.scaleInPlace(-1),v.scaleInPlace(-1))}o.x.Dot(v,s)>0&&(l=-l);var h=!1;if(0!=a.snapDistance)if(b+=l,Math.abs(b)>a.snapDistance){var d=Math.floor(Math.abs(b)/a.snapDistance);b<0&&(d*=-1),b%=a.snapDistance,l=a.snapDistance*d,h=!0}else l=0;T.reset(),a.attachedMesh.parent&&(a.attachedMesh.parent.computeWorldMatrix().invertToRef(T),T.getRotationMatrixToRef(T),o.x.TransformCoordinatesToRef(g,T,g));var f=Math.sin(l/2);x.set(g.x*f,g.y*f,g.z*f,Math.cos(l/2)),T.determinant()>0&&(x.toEulerAnglesToRef(E),o.q.RotationYawPitchRollToRef(E.y,-E.x,-E.z,x)),a.updateGizmoRotationToMatchAttachedMesh?a.attachedMesh.rotationQuaternion.multiplyToRef(x,a.attachedMesh.rotationQuaternion):x.multiplyToRef(a.attachedMesh.rotationQuaternion,a.attachedMesh.rotationQuaternion),_.copyFrom(e.dragPlanePoint),h&&(y.snapDistance=l,a.onSnapObservable.notifyObservers(y))}}),a._pointerObserver=r.utilityLayerScene.onPointerObservable.add(function(e){if(!a._customMeshSet){var t=e.pickInfo&&-1!=a._rootMesh.getChildMeshes().indexOf(e.pickInfo.pickedMesh)?l:c;a._rootMesh.getChildMeshes().forEach(function(e){e.material=t,e.color&&(e.color=t.emissiveColor)})}}),a}return l.d(t,e),t.prototype._attachedMeshChanged=function(e){this.dragBehavior&&(this.dragBehavior.enabled=!!e)},t.prototype.dispose=function(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),e.prototype.dispose.call(this)},t}(xr.a),Mr=function(e){function t(t,i){void 0===t&&(t=Ar.a.DefaultUtilityLayer),void 0===i&&(i=32);var r=e.call(this,t)||this;return r.onDragStartObservable=new n.c,r.onDragEndObservable=new n.c,r.xGizmo=new Cr(new o.x(1,0,0),o.e.Red().scale(.5),t,i),r.yGizmo=new Cr(new o.x(0,1,0),o.e.Green().scale(.5),t,i),r.zGizmo=new Cr(new o.x(0,0,1),o.e.Blue().scale(.5),t,i),[r.xGizmo,r.yGizmo,r.zGizmo].forEach(function(e){e.dragBehavior.onDragStartObservable.add(function(){r.onDragStartObservable.notifyObservers({})}),e.dragBehavior.onDragEndObservable.add(function(){r.onDragEndObservable.notifyObservers({})})}),r.attachedMesh=null,r}return l.d(t,e),Object.defineProperty(t.prototype,"attachedMesh",{set:function(e){this.xGizmo&&(this.xGizmo.attachedMesh=e,this.yGizmo.attachedMesh=e,this.zGizmo.attachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this.xGizmo.updateGizmoRotationToMatchAttachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this.xGizmo.snapDistance},set:function(e){this.xGizmo&&(this.xGizmo.snapDistance=e,this.yGizmo.snapDistance=e,this.zGizmo.snapDistance=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this.xGizmo.scaleRatio},set:function(e){this.xGizmo&&(this.xGizmo.scaleRatio=e,this.yGizmo.scaleRatio=e,this.zGizmo.scaleRatio=e)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){p.a.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}(xr.a),Or=function(e){function t(t){void 0===t&&(t=Ar.a.DefaultUtilityLayer);var i=e.call(this,t)||this;return i.onDragStartObservable=new n.c,i.onDragEndObservable=new n.c,i.xGizmo=new br.a(new o.x(1,0,0),o.e.Red().scale(.5),t),i.yGizmo=new br.a(new o.x(0,1,0),o.e.Green().scale(.5),t),i.zGizmo=new br.a(new o.x(0,0,1),o.e.Blue().scale(.5),t),[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 l.d(t,e),Object.defineProperty(t.prototype,"attachedMesh",{set:function(e){this.xGizmo&&(this.xGizmo.attachedMesh=e,this.yGizmo.attachedMesh=e,this.zGizmo.attachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"updateGizmoRotationToMatchAttachedMesh",{get:function(){return this.xGizmo.updateGizmoRotationToMatchAttachedMesh},set:function(e){this.xGizmo&&(this.xGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.yGizmo.updateGizmoRotationToMatchAttachedMesh=e,this.zGizmo.updateGizmoRotationToMatchAttachedMesh=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapDistance",{get:function(){return this.xGizmo.snapDistance},set:function(e){this.xGizmo&&(this.xGizmo.snapDistance=e,this.yGizmo.snapDistance=e,this.zGizmo.snapDistance=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleRatio",{get:function(){return this.xGizmo.scaleRatio},set:function(e){this.xGizmo&&(this.xGizmo.scaleRatio=e,this.yGizmo.scaleRatio=e,this.zGizmo.scaleRatio=e)},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.xGizmo.dispose(),this.yGizmo.dispose(),this.zGizmo.dispose(),this.onDragStartObservable.clear(),this.onDragEndObservable.clear()},t.prototype.setCustomMesh=function(e){p.a.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}(xr.a);mi.a.CreatePolyhedron=function(e){var t=[];t[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},t[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},t[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},t[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},t[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},t[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},t[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},t[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},t[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},t[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},t[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},t[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},t[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},t[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},t[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};var i,r,n,s,a,c,l=e.type&&(e.type<0||e.type>=t.length)?0:e.type||0,u=e.size,h=e.sizeX||u||1,d=e.sizeY||u||1,f=e.sizeZ||u||1,p=e.custom||t[l],_=p.face.length,m=e.faceUV||new Array(_),g=e.faceColors,v=void 0===e.flat||e.flat,y=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE,b=new Array,T=new Array,E=new Array,x=new Array,A=new Array,P=0,R=0,S=new Array,C=0,M=0;if(v)for(M=0;M<_;M++)g&&void 0===g[M]&&(g[M]=new o.f(1,1,1,1)),m&&void 0===m[M]&&(m[M]=new o.y(0,0,1,1));if(v)for(M=0;M<_;M++){var O=p.face[M].length;for(n=2*Math.PI/O,s=.5*Math.tan(n/2),a=.5,C=0;C0)return Math.max(n,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}(Ot),kr=function(e){function t(t,i,r,n,s,a,c){void 0===s&&(s=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===a&&(a=Ge.a.BILINEAR_SAMPLINGMODE),void 0===c&&(c=!0);var l=e.call(this,t,i,r,n,!0,s,!1,a,c)||this;return l.scene=r,l.mirrorPlane=new o.n(0,1,0,1),l._transformMatrix=o.j.Zero(),l._mirrorMatrix=o.j.Zero(),l._adaptiveBlurKernel=0,l._blurKernelX=0,l._blurKernelY=0,l._blurRatio=1,l.ignoreCameraViewport=!0,l._updateGammaSpace(),l._imageProcessingConfigChangeObserver=r.imageProcessingConfiguration.onUpdateParameters.add(function(){l._updateGammaSpace}),l.onBeforeRenderObservable.add(function(){o.j.ReflectionToRef(l.mirrorPlane,l._mirrorMatrix),l._savedViewMatrix=r.getViewMatrix(),l._mirrorMatrix.multiplyToRef(l._savedViewMatrix,l._transformMatrix),r.setTransformMatrix(l._transformMatrix,r.getProjectionMatrix()),r.clipPlane=l.mirrorPlane,r.getEngine().cullBackFaces=!1,r._mirroredCameraPosition=o.x.TransformCoordinates(r.activeCamera.globalPosition,l._mirrorMatrix)}),l.onAfterRenderObservable.add(function(){r.setTransformMatrix(l._savedViewMatrix,r.getProjectionMatrix()),r.getEngine().cullBackFaces=!0,r._mirroredCameraPosition=null,delete r.clipPlane}),l}return l.d(t,e),Object.defineProperty(t.prototype,"blurRatio",{get:function(){return this._blurRatio},set:function(e){this._blurRatio!==e&&(this._blurRatio=e,this._preparePostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"adaptiveBlurKernel",{set:function(e){this._adaptiveBlurKernel=e,this._autoComputeBlurKernel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernel",{set:function(e){this.blurKernelX=e,this.blurKernelY=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelX",{get:function(){return this._blurKernelX},set:function(e){this._blurKernelX!==e&&(this._blurKernelX=e,this._preparePostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blurKernelY",{get:function(){return this._blurKernelY},set:function(e){this._blurKernelY!==e&&(this._blurKernelY=e,this._preparePostProcesses())},enumerable:!0,configurable:!0}),t.prototype._autoComputeBlurKernel=function(){var e=this.getScene().getEngine(),t=this.getRenderWidth()/e.getRenderWidth(),i=this.getRenderHeight()/e.getRenderHeight();this.blurKernelX=this._adaptiveBlurKernel*t,this.blurKernelY=this._adaptiveBlurKernel*i},t.prototype._onRatioRescale=function(){this._sizeRatio&&(this.resize(this._initialSizeParameter),this._adaptiveBlurKernel||this._preparePostProcesses()),this._adaptiveBlurKernel&&this._autoComputeBlurKernel()},t.prototype._updateGammaSpace=function(){this.gammaSpace=!this.scene.imageProcessingConfiguration.isEnabled||!this.scene.imageProcessingConfiguration.applyByPostProcess},t.prototype._preparePostProcesses=function(){if(this.clearPostProcesses(!0),this._blurKernelX&&this._blurKernelY){var e=this.getScene().getEngine(),t=e.getCaps().textureFloatRender?_.a.TEXTURETYPE_FLOAT:_.a.TEXTURETYPE_HALF_FLOAT;this._blurX=new Gr("horizontal blur",new o.w(1,0),this._blurKernelX,this._blurRatio,null,Ge.a.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurX.autoClear=!1,1===this._blurRatio&&this.samples<2&&this._texture?this._blurX.inputTexture=this._texture:this._blurX.alwaysForcePOT=!0,this._blurY=new Gr("vertical blur",new o.w(0,1),this._blurKernelY,this._blurRatio,null,Ge.a.BILINEAR_SAMPLINGMODE,e,!1,t),this._blurY.autoClear=!1,this._blurY.alwaysForcePOT=1!==this._blurRatio,this.addPostProcess(this._blurX),this.addPostProcess(this._blurY)}else this._blurY&&(this.removePostProcess(this._blurY),this._blurY.dispose(),this._blurY=null),this._blurX&&(this.removePostProcess(this._blurX),this._blurX.dispose(),this._blurX=null)},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=this.getSize(),r=new t(this.name,i.width,e,this._renderTargetOptions.generateMipMaps,this._renderTargetOptions.type,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer);return r.hasAlpha=this.hasAlpha,r.level=this.level,r.mirrorPlane=this.mirrorPlane.clone(),this.renderList&&(r.renderList=this.renderList.slice(0)),r},t.prototype.serialize=function(){if(!this.name)return null;var t=e.prototype.serialize.call(this);return t.mirrorPlane=this.mirrorPlane.asArray(),t},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver)},t}(wi);Ge.a._CreateMirror=function(e,t,i,r){return new kr(e,t,i,r)};var zr=function(e){function t(t,i,r,n,s,a,c,l,u,h,d,f,p){void 0===r&&(r=null),void 0===n&&(n=!1),void 0===s&&(s=null),void 0===a&&(a=null),void 0===c&&(c=null),void 0===l&&(l=_.a.TEXTUREFORMAT_RGBA),void 0===u&&(u=!1),void 0===h&&(h=null),void 0===d&&(d=!1),void 0===f&&(f=.8),void 0===p&&(p=0);var m=e.call(this,i)||this;if(m.boundingBoxPosition=o.x.Zero(),m._rotationY=0,m._prefiltered=!1,m.name=t,m.url=t,m._noMipmap=n,m.hasAlpha=!1,m._format=l,m.isCube=!0,m._textureMatrix=o.j.Identity(),m._createPolynomials=d,m.coordinatesMode=Ge.a.CUBIC_MODE,!t&&!s)return m;var g=t.lastIndexOf("."),v=h||(g>-1?t.substring(g).toLowerCase():""),y=".dds"===v,b=".env"===v;if(b?(m.gammaSpace=!1,m._prefiltered=!1):(m._prefiltered=u,u&&(m.gammaSpace=!1)),m._texture=m._getFromCache(t,n),!s&&(b||y||r||(r=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),s=[],r))for(var T=0;T0,o.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!a.invertZ:a.invertZ,o.LODINREFLECTIONALPHA=a.lodLevelInAlpha,o.EQUIRECTANGULAR_RELFECTION_FOV=this.useEquirectangularFOV,o.REFLECTIONBGR=this.switchToBGR,a.coordinatesMode===Ge.a.INVCUBIC_MODE&&(o.INVERTCUBICMAP=!0),o.REFLECTIONMAP_3D=a.isCube,a.coordinatesMode){case Ge.a.EXPLICIT_MODE:o.REFLECTIONMAP_EXPLICIT=!0;break;case Ge.a.PLANAR_MODE:o.REFLECTIONMAP_PLANAR=!0;break;case Ge.a.PROJECTION_MODE:o.REFLECTIONMAP_PROJECTION=!0;break;case Ge.a.SKYBOX_MODE:o.REFLECTIONMAP_SKYBOX=!0,o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!a.getReflectionTextureMatrix().isIdentity();break;case Ge.a.SPHERICAL_MODE:o.REFLECTIONMAP_SPHERICAL=!0;break;case Ge.a.EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MODE:o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case Ge.a.CUBIC_MODE:case Ge.a.INVCUBIC_MODE:default:o.REFLECTIONMAP_CUBIC=!0}this.reflectionFresnel?(o.REFLECTIONFRESNEL=!0,o.REFLECTIONFALLOFF=this.reflectionFalloffDistance>0,this._reflectionControls.x=this.reflectionAmount,this._reflectionControls.y=this.reflectionReflectance0,this._reflectionControls.z=this.reflectionReflectance90,this._reflectionControls.w=1/this.reflectionFalloffDistance):(o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1)}else o.REFLECTION=!1,o.REFLECTIONFRESNEL=!1,o.REFLECTIONFALLOFF=!1,o.REFLECTIONBLUR=!1,o.REFLECTIONMAP_3D=!1,o.REFLECTIONMAP_SPHERICAL=!1,o.REFLECTIONMAP_PLANAR=!1,o.REFLECTIONMAP_CUBIC=!1,o.REFLECTIONMAP_PROJECTION=!1,o.REFLECTIONMAP_SKYBOX=!1,o.REFLECTIONMAP_SKYBOX_TRANSFORMED=!1,o.REFLECTIONMAP_EXPLICIT=!1,o.REFLECTIONMAP_EQUIRECTANGULAR=!1,o.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,o.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,o.INVERTCUBICMAP=!1,o.REFLECTIONMAP_OPPOSITEZ=!1,o.LODINREFLECTIONALPHA=!1,o.GAMMAREFLECTION=!1,o.RGBDREFLECTION=!1}o.PREMULTIPLYALPHA=this.alphaMode===_.a.ALPHA_PREMULTIPLIED||this.alphaMode===_.a.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(jr.a.PrepareDefinesForMisc(e,n,!1,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e),o),jr.a.PrepareDefinesForFrameBoundValues(n,s,o,i),jr.a.PrepareDefinesForAttributes(e,o,!1,!0,!1)&&e&&(n.getEngine().getCaps().standardDerivatives||e.isVerticesDataPresent(gi.b.NormalKind)||(e.createNormals(!0),p.a.Warn("BackgroundMaterial: Normals have been created for the mesh: "+e.name))),o.isDirty){o.markAsProcessed(),n.resetCachedMaterial();var c=new Ct.c;o.FOG&&c.addFallback(0,"FOG"),o.POINTSIZE&&c.addFallback(1,"POINTSIZE"),jr.a.HandleFallbacksForShadows(o,c,this._maxSimultaneousLights),o.NUM_BONE_INFLUENCERS>0&&c.addCPUSkinningFallback(0,e);var l=[gi.b.PositionKind];o.NORMAL&&l.push(gi.b.NormalKind),o.UV1&&l.push(gi.b.UVKind),o.UV2&&l.push(gi.b.UV2Kind),jr.a.PrepareAttributesForBones(l,e,o,c),jr.a.PrepareAttributesForInstances(l,o);var u=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","mBones","vPrimaryColor","vPrimaryColorShadow","vReflectionInfos","reflectionMatrix","vReflectionMicrosurfaceInfos","fFovMultiplier","shadowLevel","alpha","vBackgroundCenter","vReflectionControl","vDiffuseInfos","diffuseMatrix"],h=["diffuseSampler","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh"],d=["Material","Scene"];hi.a&&(hi.a.PrepareUniforms(u,o),hi.a.PrepareSamplers(h,o)),jr.a.PrepareUniformsAndSamplersList({uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:o,maxSimultaneousLights:this._maxSimultaneousLights});var f=o.toString();t.setEffect(n.getEngine().createEffect("background",{attributes:l,uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:f,fallbacks:c,onCompiled:function(e){r.onCompiled&&r.onCompiled(e),r.bindSceneUniformBuffer(e,n.getSceneUniformBuffer())},onError:this.onError,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights}},s),o),this.buildUniformLayout()}return!(!t.effect||!t.effect.isReady())&&(o._renderId=n.getRenderId(),this._wasPreviouslyReady=!0,!0)},t.prototype._computePrimaryColorFromPerceptualColor=function(){this.__perceptualColor&&(this._primaryColor.copyFrom(this.__perceptualColor),this._primaryColor.toLinearSpaceToRef(this._primaryColor),this._imageProcessingConfiguration&&this._primaryColor.scaleToRef(1/this._imageProcessingConfiguration.exposure,this._primaryColor),this._computePrimaryColors())},t.prototype._computePrimaryColors=function(){0===this._primaryColorShadowLevel&&0===this._primaryColorHighlightLevel||(this._primaryColor.scaleToRef(this._primaryColorShadowLevel,this._primaryShadowColor),this._primaryColor.subtractToRef(this._primaryShadowColor,this._primaryShadowColor),this._white.subtractToRef(this._primaryColor,this._primaryHighlightColor),this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel,this._primaryHighlightColor),this._primaryColor.addToRef(this._primaryHighlightColor,this._primaryHighlightColor))},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vPrimaryColor",4),this._uniformBuffer.addUniform("vPrimaryColorShadow",4),this._uniformBuffer.addUniform("vDiffuseInfos",2),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("diffuseMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("fFovMultiplier",1),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.addUniform("shadowLevel",1),this._uniformBuffer.addUniform("alpha",1),this._uniformBuffer.addUniform("vBackgroundCenter",3),this._uniformBuffer.addUniform("vReflectionControl",4),this._uniformBuffer.create()},t.prototype.unbind=function(){this._diffuseTexture&&this._diffuseTexture.isRenderTarget&&this._uniformBuffer.setTexture("diffuseSampler",null),this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindOnlyWorldMatrix=function(e){this._activeEffect.setMatrix("world",e)},t.prototype.bindForSubMesh=function(e,t,i){var r=this.getScene(),n=i._materialDefines;if(n){var o=i.effect;if(o){this._activeEffect=o,this.bindOnlyWorldMatrix(e),jr.a.BindBonesParameters(t,this._activeEffect);var s=this._mustRebind(r,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||(r.texturesEnabled&&(this._diffuseTexture&&Xr.a.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),jr.a.BindTextureMatrix(this._diffuseTexture,this._uniformBuffer,"diffuse")),a&&Xr.a.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),n.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),r.texturesEnabled&&(this._diffuseTexture&&Xr.a.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("diffuseSampler",this._diffuseTexture),a&&Xr.a.ReflectionTextureEnabled&&(n.REFLECTIONBLUR&&n.TEXTURELODSUPPORT?this._uniformBuffer.setTexture("reflectionSampler",a):n.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),n.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)))),jr.a.BindClipPlane(this._activeEffect,r),jr.a.BindEyePosition(o,r)}!s&&this.isFrozen||(r.lightsEnabled&&jr.a.BindLights(r,t,this._activeEffect,n,this._maxSimultaneousLights,!1),this.bindView(o),jr.a.BindFogParameters(r,t,this._activeEffect,!0),this._imageProcessingConfiguration&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._uniformBuffer.update(),this._afterBind(t,this._activeEffect)}}},t.prototype.dispose=function(t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),i&&(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 i=this;return w.a.Clone(function(){return new t(e,i.getScene())},this)},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.BackgroundMaterial",e},t.prototype.getClassName=function(){return"BackgroundMaterial"},t.Parse=function(e,i,r){return w.a.Parse(function(){return new t(e.name,i)},e,i,r)},t.StandardReflectance0=.05,t.StandardReflectance90=.5,l.c([Object(w.e)()],t.prototype,"_primaryColor",void 0),l.c([Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColor",void 0),l.c([Object(w.e)()],t.prototype,"__perceptualColor",void 0),l.c([Object(w.c)()],t.prototype,"_primaryColorShadowLevel",void 0),l.c([Object(w.c)()],t.prototype,"_primaryColorHighlightLevel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"primaryColorHighlightLevel",null),l.c([Object(w.l)()],t.prototype,"_reflectionTexture",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionBlur",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionBlur",void 0),l.c([Object(w.l)()],t.prototype,"_diffuseTexture",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"diffuseTexture",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLights",void 0),l.c([Object(w.c)()],t.prototype,"_shadowLevel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"shadowLevel",void 0),l.c([Object(w.n)()],t.prototype,"_sceneCenter",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"sceneCenter",void 0),l.c([Object(w.c)()],t.prototype,"_opacityFresnel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"opacityFresnel",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionFresnel",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFresnel",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionFalloffDistance",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionFalloffDistance",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionAmount",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionAmount",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionReflectance0",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance0",void 0),l.c([Object(w.c)()],t.prototype,"_reflectionReflectance90",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionReflectance90",void 0),l.c([Object(w.c)()],t.prototype,"_useRGBColor",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRGBColor",void 0),l.c([Object(w.c)()],t.prototype,"_enableNoise",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableNoise",void 0),l.c([Object(w.c)()],t.prototype,"_maxSimultaneousLights",void 0),l.c([Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"maxSimultaneousLights",void 0),l.c([Object(w.i)()],t.prototype,"_imageProcessingConfiguration",void 0),t}(Hr.a);s.a.RegisteredTypes["BABYLON.BackgroundMaterial"]=$r;var en=i(75),tn=function(){function e(t,i){var r=this;this._errorHandler=function(e,t){r.onErrorObservable.notifyObservers({message:e,exception:t})},this._options=l.a({},e._getDefaultOptions(),t),this._scene=i,this.onErrorObservable=new n.c,this._setupBackground(),this._setupImageProcessing()}return e._getDefaultOptions=function(){return{createGround:!0,groundSize:15,groundTexture:this._groundTextureCDNUrl,groundColor:new o.e(.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:_.a.TEXTURETYPE_UNSIGNED_INT,groundYBias:1e-5,createSkybox:!0,skyboxSize:20,skyboxTexture:this._skyboxTextureCDNUrl,skyboxColor:new o.e(.2,.2,.3).toLinearSpace().scale(3),backgroundYRotation:0,sizeAuto:!0,rootPosition:o.x.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=l.a({},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 o.f(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 Fr.a)this._scene.environmentTexture=this._options.environmentTexture;else{var e=zr.CreateFromPrefilteredData(this._options.environmentTexture,this._scene);this._scene.environmentTexture=e}},e.prototype._setupBackground=function(){this._rootMesh||(this._rootMesh=new de.a("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,i=this._options.skyboxSize,r=this._options.rootPosition;if(!this._scene.meshes||1===this._scene.meshes.length)return{groundSize:t,skyboxSize:i,rootPosition:r};var n=this._scene.getWorldExtends(function(t){return t!==e._ground&&t!==e._rootMesh&&t!==e._skybox}),o=n.max.subtract(n.min);if(this._options.sizeAuto){this._scene.activeCamera instanceof mt&&this._scene.activeCamera.upperRadiusLimit&&(i=t=2*this._scene.activeCamera.upperRadiusLimit);var s=o.length();s>t&&(i=t=2*s),t*=1.1,i*=1.5,(r=n.min.add(o.scale(.5))).y=n.min.y-this._options.groundYBias}return{groundSize:t,skyboxSize:i,rootPosition:r}},e.prototype._setupGround=function(e){var t=this;this._ground&&!this._ground.isDisposed()||(this._ground=de.a.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 $r("BackgroundPlaneMaterial",this._scene)),this._groundMaterial.alpha=this._options.groundOpacity,this._groundMaterial.alphaMode=_.a.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 Fr.a)this._groundMaterial.diffuseTexture=this._options.groundTexture;else{var e=new Ge.a(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=Ge.a.CLAMP_ADDRESSMODE;if(!this._groundMirror&&(this._groundMirror=new kr("BackgroundPlaneMirrorTexture",{ratio:this._options.groundMirrorSizeRatio},this._scene,!1,this._options.groundMirrorTextureType,Ge.a.BILINEAR_SAMPLINGMODE,!0),this._groundMirror.mirrorPlane=new o.n(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 i=0;i0&&a.addCPUSkinningFallback(c++,e),t.MORPHTARGETS&&a.addFallback(c++,"MORPHTARGETS");var l=[gi.b.PositionKind];t.NORMAL&&l.push(gi.b.NormalKind),t.TANGENT&&l.push(gi.b.TangentKind),t.UV1&&l.push(gi.b.UVKind),t.UV2&&l.push(gi.b.UV2Kind),t.VERTEXCOLOR&&l.push(gi.b.ColorKind),jr.a.PrepareAttributesForBones(l,e,t,a),jr.a.PrepareAttributesForInstances(l,t),jr.a.PrepareAttributesForMorphTargets(l,e,t);var u=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","vReflectivityColor","vEmissiveColor","vReflectionColor","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vAmbientInfos","vOpacityInfos","vReflectionInfos","vReflectionPosition","vReflectionSize","vEmissiveInfos","vReflectivityInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","vClipPlane","vClipPlane2","vClipPlane3","vClipPlane4","albedoMatrix","ambientMatrix","opacityMatrix","reflectionMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","refractionMatrix","vLightingIntensity","logarithmicDepthConstant","vSphericalX","vSphericalY","vSphericalZ","vSphericalXX","vSphericalYY","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vReflectionMicrosurfaceInfos","vRefractionMicrosurfaceInfos","vTangentSpaceParams","boneTextureWidth"],h=["albedoSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh","reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","microSurfaceSampler","environmentBrdfSampler","boneSampler"],d=["Material","Scene"];hi.a&&(hi.a.PrepareUniforms(u,t),hi.a.PrepareSamplers(h,t)),jr.a.PrepareUniformsAndSamplersList({uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:t,maxSimultaneousLights:this._maxSimultaneousLights});var f=t.toString();return s.createEffect("pbr",{attributes:l,uniformsNames:u,uniformBuffersNames:d,samplers:h,defines:f,fallbacks:a,onCompiled:i,onError:r,indexParameters:{maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:t.NUM_MORPH_INFLUENCERS}},s)},t.prototype._prepareDefines=function(e,i,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o=this.getScene(),s=o.getEngine();if(jr.a.PrepareDefinesForLights(o,e,i,!0,this._maxSimultaneousLights,this._disableLighting),i._needNormals=!0,i.METALLICWORKFLOW=this.isMetallicWorkflow(),i._areTexturesDirty){if(i._needUVs=!1,o.texturesEnabled){o.getEngine().getCaps().textureLOD&&(i.LODBASEDMICROSFURACE=!0),this._albedoTexture&&Xr.a.DiffuseTextureEnabled?jr.a.PrepareDefinesForMergedUV(this._albedoTexture,i,"ALBEDO"):i.ALBEDO=!1,this._ambientTexture&&Xr.a.AmbientTextureEnabled?(jr.a.PrepareDefinesForMergedUV(this._ambientTexture,i,"AMBIENT"),i.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):i.AMBIENT=!1,this._opacityTexture&&Xr.a.OpacityTextureEnabled?(jr.a.PrepareDefinesForMergedUV(this._opacityTexture,i,"OPACITY"),i.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):i.OPACITY=!1;var a=this._getReflectionTexture();if(a&&Xr.a.ReflectionTextureEnabled){switch(i.REFLECTION=!0,i.GAMMAREFLECTION=a.gammaSpace,i.RGBDREFLECTION=a.isRGBD,i.REFLECTIONMAP_OPPOSITEZ=this.getScene().useRightHandedSystem?!a.invertZ:a.invertZ,i.LODINREFLECTIONALPHA=a.lodLevelInAlpha,a.coordinatesMode===Ge.a.INVCUBIC_MODE&&(i.INVERTCUBICMAP=!0),i.REFLECTIONMAP_3D=a.isCube,i.REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_SKYBOX_TRANSFORMED=!1,a.coordinatesMode){case Ge.a.EXPLICIT_MODE:i.REFLECTIONMAP_EXPLICIT=!0;break;case Ge.a.PLANAR_MODE:i.REFLECTIONMAP_PLANAR=!0;break;case Ge.a.PROJECTION_MODE:i.REFLECTIONMAP_PROJECTION=!0;break;case Ge.a.SKYBOX_MODE:i.REFLECTIONMAP_SKYBOX=!0;break;case Ge.a.SPHERICAL_MODE:i.REFLECTIONMAP_SPHERICAL=!0;break;case Ge.a.EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MODE:i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case Ge.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case Ge.a.CUBIC_MODE:case Ge.a.INVCUBIC_MODE:default:i.REFLECTIONMAP_CUBIC=!0,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!!a.boundingBoxSize}a.coordinatesMode!==Ge.a.SKYBOX_MODE?a.sphericalPolynomial&&(i.USESPHERICALFROMREFLECTIONMAP=!0,this._forceIrradianceInFragment||o.getEngine().getCaps().maxVaryingVectors<=8?i.USESPHERICALINVERTEX=!1:i.USESPHERICALINVERTEX=!0):i.REFLECTIONMAP_SKYBOX_TRANSFORMED=!a.getReflectionTextureMatrix().isIdentity()}else i.REFLECTION=!1,i.REFLECTIONMAP_3D=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_CUBIC=!1,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_SKYBOX_TRANSFORMED=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,i.INVERTCUBICMAP=!1,i.USESPHERICALFROMREFLECTIONMAP=!1,i.USESPHERICALINVERTEX=!1,i.REFLECTIONMAP_OPPOSITEZ=!1,i.LODINREFLECTIONALPHA=!1,i.GAMMAREFLECTION=!1,i.RGBDREFLECTION=!1;this._lightmapTexture&&Xr.a.LightmapTextureEnabled?(jr.a.PrepareDefinesForMergedUV(this._lightmapTexture,i,"LIGHTMAP"),i.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,i.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace):i.LIGHTMAP=!1,this._emissiveTexture&&Xr.a.EmissiveTextureEnabled?jr.a.PrepareDefinesForMergedUV(this._emissiveTexture,i,"EMISSIVE"):i.EMISSIVE=!1,Xr.a.SpecularTextureEnabled?(this._metallicTexture?(jr.a.PrepareDefinesForMergedUV(this._metallicTexture,i,"REFLECTIVITY"),i.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,i.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,i.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,i.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed):this._reflectivityTexture?(jr.a.PrepareDefinesForMergedUV(this._reflectivityTexture,i,"REFLECTIVITY"),i.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,i.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap):i.REFLECTIVITY=!1,this._microSurfaceTexture?jr.a.PrepareDefinesForMergedUV(this._microSurfaceTexture,i,"MICROSURFACEMAP"):i.MICROSURFACEMAP=!1):(i.REFLECTIVITY=!1,i.MICROSURFACEMAP=!1),o.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&Xr.a.BumpTextureEnabled&&!this._disableBumpMap?(jr.a.PrepareDefinesForMergedUV(this._bumpTexture,i,"BUMP"),this._useParallax&&this._albedoTexture&&Xr.a.DiffuseTextureEnabled?(i.PARALLAX=!0,i.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):i.PARALLAX=!1,i.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):i.BUMP=!1;var c=this._getRefractionTexture();c&&Xr.a.RefractionTextureEnabled?(i.REFRACTION=!0,i.REFRACTIONMAP_3D=c.isCube,i.GAMMAREFRACTION=c.gammaSpace,i.RGBDREFRACTION=c.isRGBD,i.REFRACTIONMAP_OPPOSITEZ=c.invertZ,i.LODINREFRACTIONALPHA=c.lodLevelInAlpha,this._linkRefractionWithTransparency&&(i.LINKREFRACTIONTOTRANSPARENCY=!0)):i.REFRACTION=!1,this._environmentBRDFTexture&&Xr.a.ReflectionTextureEnabled?i.ENVIRONMENTBRDF=!0:i.ENVIRONMENTBRDF=!1,this._shouldUseAlphaFromAlbedoTexture()?i.ALPHAFROMALBEDO=!0:i.ALPHAFROMALBEDO=!1}i.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===t.LIGHTFALLOFF_STANDARD?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===t.LIGHTFALLOFF_GLTF?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!0):(i.USEPHYSICALLIGHTFALLOFF=!0,i.USEGLTFLIGHTFALLOFF=!1),i.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?i.TWOSIDEDLIGHTING=!0:i.TWOSIDEDLIGHTING=!1,i.ALPHATESTVALUE=this._alphaCutOff+(this._alphaCutOff%1==0?".":""),i.PREMULTIPLYALPHA=this.alphaMode===_.a.ALPHA_PREMULTIPLIED||this.alphaMode===_.a.ALPHA_PREMULTIPLIED_PORTERDUFF,i.ALPHABLEND=this.needAlphaBlendingForMesh(e),i.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,i.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel,i.SPECULARAA=o.getEngine().getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}i._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(i),i.FORCENORMALFORWARD=this._forceNormalForward,i.RADIANCEOCCLUSION=this._useRadianceOcclusion,i.HORIZONOCCLUSION=this._useHorizonOcclusion,i._areMiscDirty&&(jr.a.PrepareDefinesForMisc(e,o,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this._shouldTurnAlphaTestOn(e)||this._forceAlphaTest,i),i.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent(gi.b.NormalKind)),jr.a.PrepareDefinesForFrameBoundValues(o,s,i,!!r,n),jr.a.PrepareDefinesForAttributes(e,i,!0,!0,!0,this._transparencyMode!==t.PBRMATERIAL_OPAQUE)},t.prototype.forceCompilation=function(e,t,i){var r=this,n=l.a({clipPlane:!1},i),o=new pn,s=this._prepareEffect(e,o,void 0,void 0,void 0,n.clipPlane);s.isReady()?t&&t(this):s.onCompileObservable.add(function(){t&&t(r)})},t.prototype.buildUniformLayout=function(){this._uniformBuffer.addUniform("vAlbedoInfos",2),this._uniformBuffer.addUniform("vAmbientInfos",4),this._uniformBuffer.addUniform("vOpacityInfos",2),this._uniformBuffer.addUniform("vEmissiveInfos",2),this._uniformBuffer.addUniform("vLightmapInfos",2),this._uniformBuffer.addUniform("vReflectivityInfos",3),this._uniformBuffer.addUniform("vMicroSurfaceSamplerInfos",2),this._uniformBuffer.addUniform("vRefractionInfos",4),this._uniformBuffer.addUniform("vReflectionInfos",2),this._uniformBuffer.addUniform("vReflectionPosition",3),this._uniformBuffer.addUniform("vReflectionSize",3),this._uniformBuffer.addUniform("vBumpInfos",3),this._uniformBuffer.addUniform("albedoMatrix",16),this._uniformBuffer.addUniform("ambientMatrix",16),this._uniformBuffer.addUniform("opacityMatrix",16),this._uniformBuffer.addUniform("emissiveMatrix",16),this._uniformBuffer.addUniform("lightmapMatrix",16),this._uniformBuffer.addUniform("reflectivityMatrix",16),this._uniformBuffer.addUniform("microSurfaceSamplerMatrix",16),this._uniformBuffer.addUniform("bumpMatrix",16),this._uniformBuffer.addUniform("vTangentSpaceParams",2),this._uniformBuffer.addUniform("refractionMatrix",16),this._uniformBuffer.addUniform("reflectionMatrix",16),this._uniformBuffer.addUniform("vReflectionColor",3),this._uniformBuffer.addUniform("vAlbedoColor",4),this._uniformBuffer.addUniform("vLightingIntensity",4),this._uniformBuffer.addUniform("vRefractionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("vReflectionMicrosurfaceInfos",3),this._uniformBuffer.addUniform("vReflectivityColor",4),this._uniformBuffer.addUniform("vEmissiveColor",3),this._uniformBuffer.addUniform("pointSize",1),this._uniformBuffer.create()},t.prototype.unbind=function(){this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._uniformBuffer.setTexture("reflectionSampler",null),this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._uniformBuffer.setTexture("refractionSampler",null),e.prototype.unbind.call(this)},t.prototype.bindForSubMesh=function(e,i,r){var n=this.getScene(),s=r._materialDefines;if(s){var a=r.effect;if(a){this._activeEffect=a,this.bindOnlyWorldMatrix(e),s.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));var c=this._mustRebind(n,a,i.visibility);jr.a.BindBonesParameters(i,this._activeEffect);var l=null;if(c){this._uniformBuffer.bindToEffect(a,"Material"),this.bindViewProjection(a),l=this._getReflectionTexture();var u=this._getRefractionTexture();if(!this._uniformBuffer.useUbo||!this.isFrozen||!this._uniformBuffer.isSync){if(n.texturesEnabled){if(this._albedoTexture&&Xr.a.DiffuseTextureEnabled&&(this._uniformBuffer.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),jr.a.BindTextureMatrix(this._albedoTexture,this._uniformBuffer,"albedo")),this._ambientTexture&&Xr.a.AmbientTextureEnabled&&(this._uniformBuffer.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),jr.a.BindTextureMatrix(this._ambientTexture,this._uniformBuffer,"ambient")),this._opacityTexture&&Xr.a.OpacityTextureEnabled&&(this._uniformBuffer.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),jr.a.BindTextureMatrix(this._opacityTexture,this._uniformBuffer,"opacity")),l&&Xr.a.ReflectionTextureEnabled){if(this._uniformBuffer.updateMatrix("reflectionMatrix",l.getReflectionTextureMatrix()),this._uniformBuffer.updateFloat2("vReflectionInfos",l.level,0),l.boundingBoxSize){var h=l;this._uniformBuffer.updateVector3("vReflectionPosition",h.boundingBoxPosition),this._uniformBuffer.updateVector3("vReflectionSize",h.boundingBoxSize)}var d=l.sphericalPolynomial;s.USESPHERICALFROMREFLECTIONMAP&&d&&(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)),this._uniformBuffer.updateFloat3("vReflectionMicrosurfaceInfos",l.getSize().width,l.lodGenerationScale,l.lodGenerationOffset)}if(this._emissiveTexture&&Xr.a.EmissiveTextureEnabled&&(this._uniformBuffer.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),jr.a.BindTextureMatrix(this._emissiveTexture,this._uniformBuffer,"emissive")),this._lightmapTexture&&Xr.a.LightmapTextureEnabled&&(this._uniformBuffer.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),jr.a.BindTextureMatrix(this._lightmapTexture,this._uniformBuffer,"lightmap")),Xr.a.SpecularTextureEnabled&&(this._metallicTexture?(this._uniformBuffer.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),jr.a.BindTextureMatrix(this._metallicTexture,this._uniformBuffer,"reflectivity")):this._reflectivityTexture&&(this._uniformBuffer.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),jr.a.BindTextureMatrix(this._reflectivityTexture,this._uniformBuffer,"reflectivity")),this._microSurfaceTexture&&(this._uniformBuffer.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),jr.a.BindTextureMatrix(this._microSurfaceTexture,this._uniformBuffer,"microSurfaceSampler"))),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&Xr.a.BumpTextureEnabled&&!this._disableBumpMap&&(this._uniformBuffer.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),jr.a.BindTextureMatrix(this._bumpTexture,this._uniformBuffer,"bump"),n._mirroredCameraPosition?this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):this._uniformBuffer.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),u&&Xr.a.RefractionTextureEnabled){this._uniformBuffer.updateMatrix("refractionMatrix",u.getReflectionTextureMatrix());var f=1;u.isCube||u.depth&&(f=u.depth),this._uniformBuffer.updateFloat4("vRefractionInfos",u.level,this._indexOfRefraction,f,this._invertRefractionY?-1:1),this._uniformBuffer.updateFloat3("vRefractionMicrosurfaceInfos",u.getSize().width,u.lodGenerationScale,u.lodGenerationOffset)}}this.pointsCloud&&this._uniformBuffer.updateFloat("pointSize",this.pointSize),s.METALLICWORKFLOW?(o.t.Color3[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,o.t.Color3[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness,this._uniformBuffer.updateColor4("vReflectivityColor",o.t.Color3[0],0)):this._uniformBuffer.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface),this._uniformBuffer.updateColor3("vEmissiveColor",Xr.a.EmissiveTextureEnabled?this._emissiveColor:o.e.BlackReadOnly),this._uniformBuffer.updateColor3("vReflectionColor",this._reflectionColor),this._uniformBuffer.updateColor4("vAlbedoColor",this._albedoColor,this.alpha*i.visibility),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity,this._lightingInfos.w=this._specularIntensity,this._uniformBuffer.updateVector4("vLightingIntensity",this._lightingInfos)}n.texturesEnabled&&(this._albedoTexture&&Xr.a.DiffuseTextureEnabled&&this._uniformBuffer.setTexture("albedoSampler",this._albedoTexture),this._ambientTexture&&Xr.a.AmbientTextureEnabled&&this._uniformBuffer.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&Xr.a.OpacityTextureEnabled&&this._uniformBuffer.setTexture("opacitySampler",this._opacityTexture),l&&Xr.a.ReflectionTextureEnabled&&(s.LODBASEDMICROSFURACE?this._uniformBuffer.setTexture("reflectionSampler",l):(this._uniformBuffer.setTexture("reflectionSampler",l._lodTextureMid||l),this._uniformBuffer.setTexture("reflectionSamplerLow",l._lodTextureLow||l),this._uniformBuffer.setTexture("reflectionSamplerHigh",l._lodTextureHigh||l))),s.ENVIRONMENTBRDF&&this._uniformBuffer.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),u&&Xr.a.RefractionTextureEnabled&&(s.LODBASEDMICROSFURACE?this._uniformBuffer.setTexture("refractionSampler",u):(this._uniformBuffer.setTexture("refractionSampler",u._lodTextureMid||u),this._uniformBuffer.setTexture("refractionSamplerLow",u._lodTextureLow||u),this._uniformBuffer.setTexture("refractionSamplerHigh",u._lodTextureHigh||u))),this._emissiveTexture&&Xr.a.EmissiveTextureEnabled&&this._uniformBuffer.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&Xr.a.LightmapTextureEnabled&&this._uniformBuffer.setTexture("lightmapSampler",this._lightmapTexture),Xr.a.SpecularTextureEnabled&&(this._metallicTexture?this._uniformBuffer.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&this._uniformBuffer.setTexture("reflectivitySampler",this._reflectivityTexture),this._microSurfaceTexture&&this._uniformBuffer.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&n.getEngine().getCaps().standardDerivatives&&Xr.a.BumpTextureEnabled&&!this._disableBumpMap&&this._uniformBuffer.setTexture("bumpSampler",this._bumpTexture)),jr.a.BindClipPlane(this._activeEffect,n),n.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor);var p=n._forcedViewPosition?n._forcedViewPosition:n._mirroredCameraPosition?n._mirroredCameraPosition:n.activeCamera.globalPosition,_=n.useRightHandedSystem===(null!=n._mirroredCameraPosition);a.setFloat4("vEyePosition",p.x,p.y,p.z,_?-1:1),a.setColor3("vAmbientColor",this._globalAmbientColor)}!c&&this.isFrozen||(n.lightsEnabled&&!this._disableLighting&&jr.a.BindLights(n,i,this._activeEffect,s,this._maxSimultaneousLights,this._lightFalloff!==t.LIGHTFALLOFF_STANDARD),(n.fogEnabled&&i.applyFog&&n.fogMode!==W.a.FOGMODE_NONE||l)&&this.bindView(a),jr.a.BindFogParameters(n,i,this._activeEffect,!0),s.NUM_MORPH_INFLUENCERS&&jr.a.BindMorphTargetParameters(i,this._activeEffect),this._imageProcessingConfiguration.bind(this._activeEffect),jr.a.BindLogDepth(s,this._activeEffect,n)),this._uniformBuffer.update(),this._afterBind(i,this._activeEffect)}}},t.prototype.getAnimatables=function(){var e=[];return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),e},t.prototype._getReflectionTexture=function(){return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture},t.prototype._getRefractionTexture=function(){return this._refractionTexture?this._refractionTexture:this._linkRefractionWithTransparency?this.getScene().environmentTexture:null},t.prototype.dispose=function(t,i){i&&(this._albedoTexture&&this._albedoTexture.dispose(),this._ambientTexture&&this._ambientTexture.dispose(),this._opacityTexture&&this._opacityTexture.dispose(),this._reflectionTexture&&this._reflectionTexture.dispose(),this._environmentBRDFTexture&&this.getScene()._environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._emissiveTexture&&this._emissiveTexture.dispose(),this._metallicTexture&&this._metallicTexture.dispose(),this._reflectivityTexture&&this._reflectivityTexture.dispose(),this._bumpTexture&&this._bumpTexture.dispose(),this._lightmapTexture&&this._lightmapTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),e.prototype.dispose.call(this,t,i)},t.PBRMATERIAL_OPAQUE=0,t.PBRMATERIAL_ALPHATEST=1,t.PBRMATERIAL_ALPHABLEND=2,t.PBRMATERIAL_ALPHATESTANDBLEND=3,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=1,t.LIGHTFALLOFF_PHYSICAL=0,t.LIGHTFALLOFF_GLTF=1,t.LIGHTFALLOFF_STANDARD=2,l.c([Object(w.i)()],t.prototype,"_imageProcessingConfiguration",void 0),l.c([Object(w.c)()],t.prototype,"useLogarithmicDepth",null),l.c([Object(w.c)()],t.prototype,"transparencyMode",null),t}(Hr.a),mn=function(e){function t(i,r){var n=e.call(this,i,r)||this;return n.directIntensity=1,n.emissiveIntensity=1,n.environmentIntensity=1,n.specularIntensity=1,n.disableBumpMap=!1,n.ambientTextureStrength=1,n.ambientTextureImpactOnAnalyticalLights=t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,n.ambientColor=new o.e(0,0,0),n.albedoColor=new o.e(1,1,1),n.reflectivityColor=new o.e(1,1,1),n.reflectionColor=new o.e(1,1,1),n.emissiveColor=new o.e(0,0,0),n.microSurface=1,n.indexOfRefraction=.66,n.invertRefractionY=!1,n.linkRefractionWithTransparency=!1,n.useLightmapAsShadowmap=!1,n.useAlphaFromAlbedoTexture=!1,n.forceAlphaTest=!1,n.alphaCutOff=.4,n.useSpecularOverAlpha=!0,n.useMicroSurfaceFromReflectivityMapAlpha=!1,n.useRoughnessFromMetallicTextureAlpha=!0,n.useRoughnessFromMetallicTextureGreen=!1,n.useMetallnessFromMetallicTextureBlue=!1,n.useAmbientOcclusionFromMetallicTextureRed=!1,n.useAmbientInGrayScale=!1,n.useAutoMicroSurfaceFromReflectivityMap=!1,n.useRadianceOverAlpha=!0,n.useObjectSpaceNormalMap=!1,n.useParallax=!1,n.useParallaxOcclusion=!1,n.parallaxScaleBias=.05,n.disableLighting=!1,n.forceIrradianceInFragment=!1,n.maxSimultaneousLights=4,n.invertNormalMapX=!1,n.invertNormalMapY=!1,n.twoSidedLighting=!1,n.useAlphaFresnel=!1,n.useLinearAlphaFresnel=!1,n.environmentBRDFTexture=null,n.forceNormalForward=!1,n.enableSpecularAntiAliasing=!1,n.useHorizonOcclusion=!0,n.useRadianceOcclusion=!0,n.unlit=!1,n._environmentBRDFTexture=on.GetEnvironmentBRDFTexture(r),n}return l.d(t,e),Object.defineProperty(t.prototype,"usePhysicalLightFalloff",{get:function(){return this._lightFalloff===_n.LIGHTFALLOFF_PHYSICAL},set:function(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?_n.LIGHTFALLOFF_PHYSICAL:_n.LIGHTFALLOFF_STANDARD)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useGLTFLightFalloff",{get:function(){return this._lightFalloff===_n.LIGHTFALLOFF_GLTF},set:function(e){e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),this._lightFalloff=e?_n.LIGHTFALLOFF_GLTF:_n.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.getActiveTextures=function(){var t=e.prototype.getActiveTextures.call(this);return this._albedoTexture&&t.push(this._albedoTexture),this._ambientTexture&&t.push(this._ambientTexture),this._opacityTexture&&t.push(this._opacityTexture),this._reflectionTexture&&t.push(this._reflectionTexture),this._emissiveTexture&&t.push(this._emissiveTexture),this._reflectivityTexture&&t.push(this._reflectivityTexture),this._metallicTexture&&t.push(this._metallicTexture),this._microSurfaceTexture&&t.push(this._microSurfaceTexture),this._bumpTexture&&t.push(this._bumpTexture),this._lightmapTexture&&t.push(this._lightmapTexture),this._refractionTexture&&t.push(this._refractionTexture),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._refractionTexture===t)))))))))},t.prototype.clone=function(e){var i=this,r=w.a.Clone(function(){return new t(e,i.getScene())},this);return r.id=e,r.name=e,r},t.prototype.serialize=function(){var e=w.a.Serialize(this);return e.customType="BABYLON.PBRMaterial",e},t.Parse=function(e,i,r){return w.a.Parse(function(){return new t(e.name,i)},e,i,r)},t.PBRMATERIAL_OPAQUE=_n.PBRMATERIAL_OPAQUE,t.PBRMATERIAL_ALPHATEST=_n.PBRMATERIAL_ALPHATEST,t.PBRMATERIAL_ALPHABLEND=_n.PBRMATERIAL_ALPHABLEND,t.PBRMATERIAL_ALPHATESTANDBLEND=_n.PBRMATERIAL_ALPHATESTANDBLEND,t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=_n.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"directIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"specularIntensity",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"disableBumpMap",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureStrength",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"opacityTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallicTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"metallic",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"roughness",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurfaceTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"bumpTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty",null)],t.prototype,"lightmapTexture",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"refractionTexture",void 0),l.c([Object(w.e)("ambient"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"ambientColor",void 0),l.c([Object(w.e)("albedo"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"albedoColor",void 0),l.c([Object(w.e)("reflectivity"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectivityColor",void 0),l.c([Object(w.e)("reflection"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"reflectionColor",void 0),l.c([Object(w.e)("emissive"),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"emissiveColor",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"microSurface",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"indexOfRefraction",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertRefractionY",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"linkRefractionWithTransparency",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLightmapAsShadowmap",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"useAlphaFromAlbedoTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"forceAlphaTest",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesAndMiscDirty")],t.prototype,"alphaCutOff",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useSpecularOverAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRoughnessFromMetallicTextureGreen",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useMetallnessFromMetallicTextureBlue",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAmbientInGrayScale",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),l.c([Object(w.c)()],t.prototype,"usePhysicalLightFalloff",null),l.c([Object(w.c)()],t.prototype,"useGLTFLightFalloff",null),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOverAlpha",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useObjectSpaceNormalMap",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallax",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useParallaxOcclusion",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"parallaxScaleBias",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"disableLighting",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceIrradianceInFragment",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsLightsDirty")],t.prototype,"maxSimultaneousLights",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapX",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"invertNormalMapY",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"twoSidedLighting",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useAlphaFresnel",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useLinearAlphaFresnel",void 0),l.c([Object(w.l)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"environmentBRDFTexture",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"forceNormalForward",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"enableSpecularAntiAliasing",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useHorizonOcclusion",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsTexturesDirty")],t.prototype,"useRadianceOcclusion",void 0),l.c([Object(w.c)(),Object(w.b)("_markAllSubMeshesAsMiscDirty")],t.prototype,"unlit",void 0),t}(_n);s.a.RegisteredTypes["BABYLON.PBRMaterial"]=mn;W.a.prototype.createDefaultLight=function(e){if(void 0===e&&(e=!1),e&&this.lights)for(var t=0;t=c.video.HAVE_CURRENT_DATA;return!a.poster||a.autoPlay&&l?l&&c._createInternalTexture():(c._texture=c._engine.createTexture(a.poster,!1,!0,r),c._displayingPosterTexture=!0),c}return l.d(t,e),Object.defineProperty(t.prototype,"onUserActionRequestedObservable",{get:function(){return this._onUserActionRequestedObservable||(this._onUserActionRequestedObservable=new n.c),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 ve.h.SetCorsBehavior(e.currentSrc,e),e;var t=document.createElement("video");return"string"==typeof e?(ve.h.SetCorsBehavior(e,t),t.src=e):(ve.h.SetCorsBehavior(e[0],t),e.forEach(function(e){var i=document.createElement("source");i.src=e,t.appendChild(i)})),t},t.prototype._rebuild=function(){this.update()},t.prototype.update=function(){this.autoUpdateTexture&&this.updateTexture(!0)},t.prototype.updateTexture=function(e){e&&(this.video.paused&&this._stillImageCaptured||(this._stillImageCaptured=!0,this._updateInternalTexture()))},t.prototype.updateURL=function(e){this.video.src=e},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._onUserActionRequestedObservable&&(this._onUserActionRequestedObservable.clear(),this._onUserActionRequestedObservable=null),this.video.removeEventListener(this._createInternalTextureOnEvent,this._createInternalTexture),this.video.removeEventListener("paused",this._updateInternalTexture),this.video.removeEventListener("seeked",this._updateInternalTexture),this.video.removeEventListener("emptied",this.reset),this.video.pause()},t.CreateFromWebCam=function(e,i,r){var n,o=document.createElement("video");o.setAttribute("autoplay",""),o.setAttribute("muted",""),o.setAttribute("playsinline",""),r&&r.deviceId&&(n={exact:r.deviceId}),window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,navigator.mediaDevices?navigator.mediaDevices.getUserMedia({video:r}).then(function(r){void 0!==o.mozSrcObject?o.mozSrcObject=r:o.srcObject=r;var n=function(){i&&i(new t("video",o,e,!0,!0)),o.removeEventListener("playing",n)};o.addEventListener("playing",n),o.play()}).catch(function(e){p.a.Error(e.name)}):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getUserMedia&&navigator.getUserMedia({video:{deviceId:n,width:{min:r&&r.minWidth||256,max:r&&r.maxWidth||640},height:{min:r&&r.minHeight||256,max:r&&r.maxHeight||480}}},function(r){void 0!==o.mozSrcObject?o.mozSrcObject=r:o.src=window.URL&&window.URL.createObjectURL(r)||r,o.play(),i&&i(new t("video",o,e,!0,!0))},function(e){p.a.Error(e.name)}))},t}(Ge.a),vn=function(e){function t(t,i,r,n){var o=e.call(this,t,n)||this;o._useDirectMapping=!1,t=t||"videoDome",r.resolution=0|Math.abs(r.resolution)||32,r.clickToPlay=Boolean(r.clickToPlay),r.autoPlay=void 0===r.autoPlay||Boolean(r.autoPlay),r.loop=void 0===r.loop||Boolean(r.loop),r.size=Math.abs(r.size)||(n.activeCamera?.48*n.activeCamera.maxZ:1e3),void 0===r.useDirectMapping?o._useDirectMapping=!0:o._useDirectMapping=r.useDirectMapping,o._setReady(!1);var s={loop:r.loop,autoPlay:r.autoPlay,autoUpdateTexture:!0,poster:r.poster},a=o._material=new $r(t+"_material",n),c=o._videoTexture=new gn(t+"_texture",i,n,!1,o._useDirectMapping,Ge.a.TRILINEAR_SAMPLINGMODE,s);return o._mesh=de.a.CreateSphere(t+"_mesh",r.resolution,r.size,n,!1,de.a.BACKSIDE),c.onLoadObservable.addOnce(function(){o._setReady(!0)}),a.useEquirectangularFOV=!0,a.fovMultiplier=1,a.opacityFresnel=!1,o._useDirectMapping?(c.wrapU=Ge.a.CLAMP_ADDRESSMODE,c.wrapV=Ge.a.CLAMP_ADDRESSMODE,a.diffuseTexture=c):(c.coordinatesMode=Ge.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE,c.wrapV=Ge.a.CLAMP_ADDRESSMODE,a.reflectionTexture=c),o._mesh.material=a,o._mesh.parent=o,r.clickToPlay&&(n.onPointerUp=function(){o._videoTexture.video.play()}),o}return l.d(t,e),Object.defineProperty(t.prototype,"videoTexture",{get:function(){return this._videoTexture},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fovMultiplier",{get:function(){return this._material.fovMultiplier},set:function(e){this._material.fovMultiplier=e},enumerable:!0,configurable:!0}),t.prototype.dispose=function(t,i){void 0===i&&(i=!1),this._videoTexture.dispose(),this._mesh.dispose(),this._material.dispose(),e.prototype.dispose.call(this,t,i)},t}(rn.a),yn=function(){function e(e){this.engine=e,this._captureGPUFrameTime=!1,this._gpuFrameTime=new ve.f,this._captureShaderCompilationTime=!1,this._shaderCompilationTime=new ve.f,this._onBeginFrameObserver=null,this._onEndFrameObserver=null,this._onBeforeShaderCompilationObserver=null,this._onAfterShaderCompilationObserver=null}return Object.defineProperty(e.prototype,"gpuFrameTimeCounter",{get:function(){return this._gpuFrameTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"captureGPUFrameTime",{get:function(){return this._captureGPUFrameTime},set:function(e){var t=this;e!==this._captureGPUFrameTime&&(this._captureGPUFrameTime=e,e?(this._onBeginFrameObserver=this.engine.onBeginFrameObservable.add(function(){t._gpuFrameTimeToken||(t._gpuFrameTimeToken=t.engine.startTimeQuery())}),this._onEndFrameObserver=this.engine.onEndFrameObservable.add(function(){if(t._gpuFrameTimeToken){var e=t.engine.endTimeQuery(t._gpuFrameTimeToken);e>-1&&(t._gpuFrameTimeToken=null,t._gpuFrameTime.fetchNewFrame(),t._gpuFrameTime.addCount(e,!0))}})):(this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shaderCompilationTimeCounter",{get:function(){return this._shaderCompilationTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"captureShaderCompilationTime",{get:function(){return this._captureShaderCompilationTime},set:function(e){var t=this;e!==this._captureShaderCompilationTime&&(this._captureShaderCompilationTime=e,e?(this._onBeforeShaderCompilationObserver=this.engine.onBeforeShaderCompilationObservable.add(function(){t._shaderCompilationTime.fetchNewFrame(),t._shaderCompilationTime.beginMonitoring()}),this._onAfterShaderCompilationObserver=this.engine.onAfterShaderCompilationObservable.add(function(){t._shaderCompilationTime.endMonitoring()})):(this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver),this._onBeginFrameObserver=null,this.engine.onEndFrameObservable.remove(this._onEndFrameObserver),this._onEndFrameObserver=null,this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver),this._onBeforeShaderCompilationObserver=null,this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver),this._onAfterShaderCompilationObserver=null,this.engine=null},e}(),bn=function(){function e(e){var t=this;this.scene=e,this._captureActiveMeshesEvaluationTime=!1,this._activeMeshesEvaluationTime=new ve.f,this._captureRenderTargetsRenderTime=!1,this._renderTargetsRenderTime=new ve.f,this._captureFrameTime=!1,this._frameTime=new ve.f,this._captureRenderTime=!1,this._renderTime=new ve.f,this._captureInterFrameTime=!1,this._interFrameTime=new ve.f,this._captureParticlesRenderTime=!1,this._particlesRenderTime=new ve.f,this._captureSpritesRenderTime=!1,this._spritesRenderTime=new ve.f,this._capturePhysicsTime=!1,this._physicsTime=new ve.f,this._captureAnimationsTime=!1,this._animationsTime=new ve.f,this._captureCameraRenderTime=!1,this._cameraRenderTime=new ve.f,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&&(ve.h.StartPerformanceCounter("Scene rendering"),t._frameTime.beginMonitoring()),t._captureInterFrameTime&&t._interFrameTime.endMonitoring(),t._captureParticlesRenderTime&&t._particlesRenderTime.fetchNewFrame(),t._captureSpritesRenderTime&&t._spritesRenderTime.fetchNewFrame(),t._captureAnimationsTime&&t._animationsTime.beginMonitoring(),t.scene.getEngine()._drawCalls.fetchNewFrame(),t.scene.getEngine()._textureCollisions.fetchNewFrame()}),this._onAfterRenderObserver=e.onAfterRenderObservable.add(function(){t._captureFrameTime&&(ve.h.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(){ve.h.StartPerformanceCounter("Active meshes evaluation"),t._activeMeshesEvaluationTime.beginMonitoring()}),this._onAfterActiveMeshesEvaluationObserver=this.scene.onAfterActiveMeshesEvaluationObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Render targets rendering"),t._renderTargetsRenderTime.beginMonitoring()}),this._onAfterRenderTargetsRenderObserver=this.scene.onAfterRenderTargetsRenderObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Particles"),t._particlesRenderTime.beginMonitoring()}),this._onAfterParticlesRenderingObserver=this.scene.onAfterParticlesRenderingObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Sprites"),t._spritesRenderTime.beginMonitoring()}),this._onAfterSpritesRenderingObserver=this.scene.onAfterSpritesRenderingObservable.add(function(){ve.h.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(){ve.h.StartPerformanceCounter("Physics"),t._physicsTime.beginMonitoring()}),this._onAfterPhysicsObserver=this.scene.onAfterPhysicsObservable.add(function(){ve.h.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(),ve.h.StartPerformanceCounter("Main render")}),this._onAfterDrawPhaseObserver=this.scene.onAfterDrawPhaseObservable.add(function(){t._renderTime.endMonitoring(!1),ve.h.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(),ve.h.StartPerformanceCounter("Rendering camera "+e.name)}),this._onAfterCameraRenderObserver=this.scene.onAfterCameraRenderObservable.add(function(e){t._cameraRenderTime.endMonitoring(!1),ve.h.EndPerformanceCounter("Rendering camera "+e.name)})):(this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawCallsCounter",{get:function(){return this.scene.getEngine()._drawCalls},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textureCollisionsCounter",{get:function(){return this.scene.getEngine()._textureCollisions},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=null,this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver),this._onBeforeActiveMeshesEvaluationObserver=null,this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver),this._onAfterActiveMeshesEvaluationObserver=null,this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver),this._onBeforeRenderTargetsRenderObserver=null,this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver),this._onAfterRenderTargetsRenderObserver=null,this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver),this._onBeforeAnimationsObserver=null,this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver),this._onBeforeParticlesRenderingObserver=null,this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver),this._onAfterParticlesRenderingObserver=null,this._onBeforeSpritesRenderingObserver&&(this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver),this._onBeforeSpritesRenderingObserver=null),this._onAfterSpritesRenderingObserver&&(this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver),this._onAfterSpritesRenderingObserver=null),this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver),this._onBeforeDrawPhaseObserver=null,this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver),this._onAfterDrawPhaseObserver=null,this._onBeforePhysicsObserver&&(this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver),this._onBeforePhysicsObserver=null),this._onAfterPhysicsObserver&&(this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver),this._onAfterPhysicsObserver=null),this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver),this._onAfterAnimationsObserver=null,this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=null,this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=null,this.scene=null},e}(),Tn=i(19),En="#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform sampler2D opacitySampler;\nuniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\nuniform vec4 color;\nvoid main(void)\n{\nvec4 finalColor=color;\n\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a4&&(o.push(gi.b.MatricesIndicesExtraKind),o.push(gi.b.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 f=s.morphTargetManager,p=0;f&&f.numInfluencers>0&&(n.push("#define MORPHTARGETS"),p=f.numInfluencers,n.push("#define NUM_MORPH_INFLUENCERS "+p),jr.a.PrepareAttributesForMorphTargets(o,s,{NUM_MORPH_INFLUENCERS:p})),t&&(n.push("#define INSTANCES"),o.push("world0"),o.push("world1"),o.push("world2"),o.push("world3")),this._addCustomEffectDefines(n);var _=n.join("\n");return this._cachedDefines!==_&&(this._cachedDefines=_,this._effectLayerMapGenerationEffect=this._scene.getEngine().createEffect("glowMapGeneration",o,["world","mBones","viewProjection","color","morphTargetInfluences","diffuseMatrix","emissiveMatrix","opacityMatrix","opacityIntensity"],["diffuseSampler","emissiveSampler","opacitySampler"],_,void 0,void 0,void 0,{maxSimultaneousMorphTargets:p})),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.onAfterComposeObservable.clear(),this.onSizeChangedObservable.clear()},e.prototype.getClassName=function(){return"EffectLayer"},e.Parse=function(e,t,i){return ve.h.Instantiate(e.customType).Parse(e,t,i)},e._SceneComponentInitialization=function(e){throw ye.a.WarnImport("EffectLayerSceneComponent")},l.c([Object(w.c)()],e.prototype,"name",void 0),l.c([Object(w.f)()],e.prototype,"neutralColor",void 0),l.c([Object(w.c)()],e.prototype,"isEnabled",void 0),l.c([Object(w.d)()],e.prototype,"camera",null),l.c([Object(w.c)()],e.prototype,"renderingGroupId",null),e}();r.a.AddParser(Ee.a.NAME_EFFECTLAYER,function(e,t,i,r){if(e.effectLayers){i.effectLayers||(i.effectLayers=new Array);for(var n=0;n0){this._previousStencilState=this._engine.getStencilBuffer();for(var i=0,r=t;i-1)){this._renderEffects=!0,this._needStencil=this._needStencil||n.needStencil();var o=n._mainTexture;o._shouldRender()&&(this.scene.incrementRenderId(),o.render(!1,!1))}}this.scene.incrementRenderId()}},e.prototype._setStencil=function(){this._needStencil&&this._engine.setStencilBuffer(!0)},e.prototype._setStencilBack=function(){this._needStencil&&this._engine.setStencilBuffer(this._previousStencilState)},e.prototype._draw=function(e){if(this._renderEffects){this._engine.setDepthBuffer(!1);for(var t=this.scene.effectLayers,i=0;i0&&e.isBackground===t&&e.renderTargetTextures.indexOf(r)>-1&&0!=(e.layerMask&i)},e.prototype._drawRenderTargetBackground=function(e){var t=this;this._draw(function(i){return t._drawRenderTargetPredicate(i,!0,t.scene.activeCamera.layerMask,e)})},e.prototype._drawRenderTargetForeground=function(e){var t=this;this._draw(function(i){return t._drawRenderTargetPredicate(i,!1,t.scene.activeCamera.layerMask,e)})},e}(),wn="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}";Ct.a.ShadersStore.layerPixelShader=wn;var Ln="\nattribute vec2 position;\n\nuniform vec2 scale;\nuniform vec2 offset;\nuniform mat4 textureMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvec2 shiftedPosition=position*scale+offset;\nvUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));\ngl_Position=vec4(shiftedPosition,0.0,1.0);\n}";Ct.a.ShadersStore.layerVertexShader=Ln;var Fn=function(){function e(e,t,i,r,s){this.name=e,this.scale=new o.w(1,1),this.offset=new o.w(0,0),this.alphaBlendingMode=_.a.ALPHA_COMBINE,this.layerMask=268435455,this.renderTargetTextures=[],this.renderOnlyInRenderTargetTextures=!1,this._vertexBuffers={},this.onDisposeObservable=new n.c,this.onBeforeRenderObservable=new n.c,this.onAfterRenderObservable=new n.c,this.texture=t?new Ge.a(t,i,!0):null,this.isBackground=void 0===r||r,this.color=void 0===s?new o.f(1,1,1,1):s,this._scene=i||R.a.LastCreatedScene;var a=this._scene._getComponent(Ee.a.NAME_LAYER);a||(a=new Dn(this._scene),this._scene._addComponent(a)),this._scene.layers.push(this);var c=this._scene.getEngine(),l=[];l.push(1,1),l.push(-1,1),l.push(-1,-1),l.push(1,-1);var u=new gi.b(c,l,gi.b.PositionKind,!1,!1,2);this._vertexBuffers[gi.b.PositionKind]=u,this._createIndexBuffer(),this._effect=c.createEffect("layer",[gi.b.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],""),this._alphaTestEffect=c.createEffect("layer",[gi.b.PositionKind],["textureMatrix","color","scale","offset"],["textureSampler"],"#define ALPHATEST")}return Object.defineProperty(e.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onBeforeRender",{set:function(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onAfterRender",{set:function(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)},enumerable:!0,configurable:!0}),e.prototype._createIndexBuffer=function(){var e=this._scene.getEngine(),t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},e.prototype._rebuild=function(){var e=this._vertexBuffers[gi.b.PositionKind];e&&e._rebuild(),this._createIndexBuffer()},e.prototype.render=function(){var e=this.alphaTest?this._alphaTestEffect:this._effect;if(e.isReady()&&this.texture&&this.texture.isReady()){var t=this._scene.getEngine();this.onBeforeRenderObservable.notifyObservers(this),t.enableEffect(e),t.setState(!1),e.setTexture("textureSampler",this.texture),e.setMatrix("textureMatrix",this.texture.getTextureMatrix()),e.setFloat4("color",this.color.r,this.color.g,this.color.b,this.color.a),e.setVector2("offset",this.offset),e.setVector2("scale",this.scale),t.bindBuffers(this._vertexBuffers,this._indexBuffer,e),this.alphaTest?t.drawElementsType(Tn.a.TriangleFillMode,0,6):(t.setAlphaMode(this.alphaBlendingMode),t.drawElementsType(Tn.a.TriangleFillMode,0,6),t.setAlphaMode(_.a.ALPHA_DISABLE)),this.onAfterRenderObservable.notifyObservers(this)}},e.prototype.dispose=function(){var e=this._vertexBuffers[gi.b.PositionKind];e&&(e.dispose(),this._vertexBuffers[gi.b.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null),this.texture&&(this.texture.dispose(),this.texture=null),this.renderTargetTextures=[];var t=this._scene.layers.indexOf(this);this._scene.layers.splice(t,1),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderObservable.clear()},e}(),Nn=function(){function e(e,t,i,r,n){this.size=e,this.position=t,this.alphaMode=_.a.ALPHA_ONEONE,this.color=i||new o.e(1,1,1),this.texture=r?new Ge.a(r,n.getScene(),!0):null,this._system=n,n.lensFlares.push(this)}return e.AddFlare=function(t,i,r,n,o){return new e(t,i,r,n,o)},e.prototype.dispose=function(){this.texture&&this.texture.dispose();var e=this._system.lensFlares.indexOf(this);this._system.lensFlares.splice(e,1)},e}(),Bn="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\ngl_FragColor=baseColor*color;\n}";Ct.a.ShadersStore.lensFlarePixelShader=Bn;var Un="\nattribute vec2 position;\n\nuniform mat4 viewportMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=viewportMatrix*vec4(position,0.0,1.0);\n}";Ct.a.ShadersStore.lensFlareVertexShader=Un;var Vn=function(){function e(t,i,r){this.name=t,this.lensFlares=new Array,this.borderLimit=300,this.viewportBorder=0,this.layerMask=268435455,this._vertexBuffers={},this._isEnabled=!0,this._scene=r||R.a.LastCreatedScene,e._SceneComponentInitialization(this._scene),this._emitter=i,this.id=t,r.lensFlareSystems.push(this),this.meshesSelectionPredicate=function(e){return r.activeCamera&&e.material&&e.isVisible&&e.isEnabled()&&e.isBlocker&&0!=(e.layerMask&r.activeCamera.layerMask)};var n=r.getEngine(),o=[];o.push(1,1),o.push(-1,1),o.push(-1,-1),o.push(1,-1),this._vertexBuffers[gi.b.PositionKind]=new gi.b(n,o,gi.b.PositionKind,!1,!1,2);var s=[];s.push(0),s.push(1),s.push(2),s.push(0),s.push(2),s.push(3),this._indexBuffer=n.createIndexBuffer(s),this._effect=n.createEffect("lensFlare",[gi.b.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=o.x.Project(t,o.j.Identity(),this._scene.getTransformMatrix(),e),this._positionX=t.x,this._positionY=t.y,t=o.x.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 i=new ti.a(this._scene.activeCamera.globalPosition,e),r=this._scene.pickWithRay(i,this.meshesSelectionPredicate,!0);return!r||!r.hit||r.distance>t},e.prototype.render=function(){if(!this._effect.isReady()||!this._scene.activeCamera)return!1;var e,t,i=this._scene.getEngine(),r=this._scene.activeCamera.viewport.toGlobal(i.getRenderWidth(!0),i.getRenderHeight(!0));if(!this.computeEffectivePosition(r))return!1;if(!this._isVisible())return!1;var n=(e=this._positionXr.x+r.width-this.borderLimit?this._positionX-r.x-r.width+this.borderLimit:0)>(t=this._positionYr.y+r.height-this.borderLimit?this._positionY-r.y-r.height+this.borderLimit:0)?e:t;(n-=this.viewportBorder)>this.borderLimit&&(n=this.borderLimit);var s=1-D.a.Clamp(n/this.borderLimit,0,1);if(s<0)return!1;s>1&&(s=1),this.viewportBorder>0&&(r.x+=this.viewportBorder,r.y+=this.viewportBorder,r.width-=2*this.viewportBorder,r.height-=2*this.viewportBorder,this._positionX-=this.viewportBorder,this._positionY-=this.viewportBorder);var a=r.x+r.width/2,c=r.y+r.height/2,l=a-this._positionX,u=c-this._positionY;i.enableEffect(this._effect),i.setState(!1),i.setDepthBuffer(!1),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect);for(var h=0;h0);for(var i=0,r=t;i0)}},e}();Vn._SceneComponentInitialization=function(e){var t=e._getComponent(Ee.a.NAME_LENSFLARESYSTEM);t||(t=new Gn(e),e._addComponent(t))};var kn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._needProjectionMatrixCompute=!0,t}return l.d(t,e),t.prototype._setPosition=function(e){this._position=e},Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(e){this._setPosition(e)},enumerable:!0,configurable:!0}),t.prototype._setDirection=function(e){this._direction=e},Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){this._setDirection(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowMinZ",{get:function(){return this._shadowMinZ},set:function(e){this._shadowMinZ=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowMaxZ",{get:function(){return this._shadowMaxZ},set:function(e){this._shadowMaxZ=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),t.prototype.computeTransformedInformation=function(){return!(!this.parent||!this.parent.getWorldMatrix)&&(this.transformedPosition||(this.transformedPosition=o.x.Zero()),o.x.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this.transformedPosition),this.direction&&(this.transformedDirection||(this.transformedDirection=o.x.Zero()),o.x.TransformNormalToRef(this.direction,this.parent.getWorldMatrix(),this.transformedDirection)),!0)},t.prototype.getDepthScale=function(){return 50},t.prototype.getShadowDirection=function(e){return this.transformedDirection?this.transformedDirection:this.direction},t.prototype.getAbsolutePosition=function(){return this.transformedPosition?this.transformedPosition:this.position},t.prototype.setDirectionToTarget=function(e){return this.direction=o.x.Normalize(e.subtract(this.position)),this.direction},t.prototype.getRotation=function(){this.direction.normalize();var e=o.x.Cross(this.direction,o.c.Y),t=o.x.Cross(e,this.direction);return o.x.RotationFromAxis(e,t,this.direction)},t.prototype.needCube=function(){return!1},t.prototype.needProjectionMatrixCompute=function(){return this._needProjectionMatrixCompute},t.prototype.forceProjectionMatrixCompute=function(){this._needProjectionMatrixCompute=!0},t.prototype._initCache=function(){e.prototype._initCache.call(this),this._cache.position=o.x.Zero()},t.prototype._isSynchronized=function(){return!!this._cache.position.equals(this.position)},t.prototype.computeWorldMatrix=function(e){return!e&&this.isSynchronized()?(this._currentRenderId=this.getScene().getRenderId(),this._worldMatrix):(this._updateCache(),this._cache.position.copyFrom(this.position),this._worldMatrix||(this._worldMatrix=o.j.Identity()),o.j.TranslationToRef(this.position.x,this.position.y,this.position.z,this._worldMatrix),this.parent&&this.parent.getWorldMatrix&&(this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(),this._worldMatrix),this._markSyncedWithParent()),this._worldMatrixDeterminant=this._worldMatrix.determinant(),this._worldMatrix)},t.prototype.getDepthMinZ=function(e){return void 0!==this.shadowMinZ?this.shadowMinZ:e.minZ},t.prototype.getDepthMaxZ=function(e){return void 0!==this.shadowMaxZ?this.shadowMaxZ:e.maxZ},t.prototype.setShadowProjectionMatrix=function(e,t,i){return this.customProjectionMatrixBuilder?this.customProjectionMatrixBuilder(t,i,e):this._setDefaultShadowProjectionMatrix(e,t,i),this},l.c([Object(w.n)()],t.prototype,"position",null),l.c([Object(w.n)()],t.prototype,"direction",null),l.c([Object(w.c)()],t.prototype,"shadowMinZ",null),l.c([Object(w.c)()],t.prototype,"shadowMaxZ",null),t}(ni.a),zn="#ifndef FLOAT\nvec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\n#endif\nvarying float vDepthMetric;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nfloat depth=vDepthMetric;\n#ifdef ESM\ndepth=clamp(exp(-min(87.,biasAndScale.z*depth)),0.,1.);\n#endif\n#ifdef FLOAT\ngl_FragColor=vec4(depth,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depth);\n#endif\n}";Ct.a.ShadersStore.shadowMapPixelShader=zn;var jn="\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\nuniform vec3 lightData;\n#endif\n#include\n#include\n#include[0..maxSimultaneousMorphTargets]\n\n#include\n#include\nuniform mat4 viewProjection;\nuniform vec3 biasAndScale;\nuniform vec2 depthValues;\nvarying float vDepthMetric;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#include[0..maxSimultaneousMorphTargets]\n#include\n#include\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvec3 worldNor=normalize(normalWorld*normal);\n#ifdef DIRECTIONINLIGHTDATA\nvec3 worldLightDir=normalize(-lightData.xyz);\n#else\nvec3 directionToLight=lightData.xyz-worldPos.xyz;\nvec3 worldLightDir=normalize(directionToLight);\n#endif\nfloat ndl=dot(worldNor,worldLightDir);\nfloat sinNL=sqrt(1.0-ndl*ndl);\nfloat normalBias=biasAndScale.y*sinNL;\nworldPos.xyz-=worldNor*normalBias;\n#endif\n\ngl_Position=viewProjection*worldPos;\n#ifdef DEPTHTEXTURE\n\ngl_Position.z+=biasAndScale.x*gl_Position.w;\n#endif\n\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y))+biasAndScale.x;\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}";Ct.a.ShadersStore.shadowMapVertexShader=jn;var Wn="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}";Ct.a.ShadersStore.depthBoxBlurPixelShader=Wn;var Hn=function(){function e(t,i,r){this.onBeforeShadowMapRenderObservable=new n.c,this._bias=5e-5,this._normalBias=0,this._blurBoxOffset=1,this._blurScale=2,this._blurKernel=1,this._useKernelBlur=!1,this._filter=e.FILTER_NONE,this._filteringQuality=e.QUALITY_HIGH,this._contactHardeningLightSizeUVRatio=.1,this._darkness=0,this._transparencyShadow=!1,this.frustumEdgeFalloff=0,this.forceBackFacesOnly=!1,this._lightDirection=o.x.Zero(),this._viewMatrix=o.j.Zero(),this._projectionMatrix=o.j.Zero(),this._transformMatrix=o.j.Zero(),this._cachedPosition=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cachedDirection=new o.x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._currentFaceIndex=0,this._currentFaceIndexCache=0,this._defaultTextureMatrix=o.j.Identity(),this._mapSize=t,this._light=i,this._scene=i.getScene(),i._shadowGenerator=this,e._SceneComponentInitialization(this._scene);var s=this._scene.getEngine().getCaps();r?s.textureFloatRender&&s.textureFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_FLOAT:s.textureHalfFloatRender&&s.textureHalfFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_HALF_FLOAT:this._textureType=_.a.TEXTURETYPE_UNSIGNED_INT:s.textureHalfFloatRender&&s.textureHalfFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_HALF_FLOAT:s.textureFloatRender&&s.textureFloatLinearFiltering?this._textureType=_.a.TEXTURETYPE_FLOAT:this._textureType=_.a.TEXTURETYPE_UNSIGNED_INT,this._initializeGenerator(),this._applyFilterValues()}return Object.defineProperty(e.prototype,"bias",{get:function(){return this._bias},set:function(e){this._bias=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normalBias",{get:function(){return this._normalBias},set:function(e){this._normalBias=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurBoxOffset",{get:function(){return this._blurBoxOffset},set:function(e){this._blurBoxOffset!==e&&(this._blurBoxOffset=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurScale",{get:function(){return this._blurScale},set:function(e){this._blurScale!==e&&(this._blurScale=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurKernel",{get:function(){return this._blurKernel},set:function(e){this._blurKernel!==e&&(this._blurKernel=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useKernelBlur",{get:function(){return this._useKernelBlur},set:function(e){this._useKernelBlur!==e&&(this._useKernelBlur=e,this._disposeBlurPostProcesses())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"depthScale",{get:function(){return void 0!==this._depthScale?this._depthScale:this._light.getDepthScale()},set:function(e){this._depthScale=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter},set:function(t){if(this._light.needCube()){if(t===e.FILTER_BLUREXPONENTIALSHADOWMAP)return void(this.useExponentialShadowMap=!0);if(t===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)return void(this.useCloseExponentialShadowMap=!0);if(t===e.FILTER_PCF||t===e.FILTER_PCSS)return void(this.usePoissonSampling=!0)}t!==e.FILTER_PCF&&t!==e.FILTER_PCSS||1!==this._scene.getEngine().webGLVersion?this._filter!==t&&(this._filter=t,this._disposeBlurPostProcesses(),this._applyFilterValues(),this._light._markMeshesAsLightDirty()):this.usePoissonSampling=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usePoissonSampling",{get:function(){return this.filter===e.FILTER_POISSONSAMPLING},set:function(t){(t||this.filter===e.FILTER_POISSONSAMPLING)&&(this.filter=t?e.FILTER_POISSONSAMPLING:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useExponentialShadowMap",{get:function(){return this.filter===e.FILTER_EXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_EXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_EXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useBlurExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_BLUREXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_BLUREXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_CLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_CLOSEEXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useBlurCloseExponentialShadowMap",{get:function(){return this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP},set:function(t){(t||this.filter===e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&(this.filter=t?e.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usePercentageCloserFiltering",{get:function(){return this.filter===e.FILTER_PCF},set:function(t){(t||this.filter===e.FILTER_PCF)&&(this.filter=t?e.FILTER_PCF:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filteringQuality",{get:function(){return this._filteringQuality},set:function(e){this._filteringQuality=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useContactHardeningShadow",{get:function(){return this.filter===e.FILTER_PCSS},set:function(t){(t||this.filter===e.FILTER_PCSS)&&(this.filter=t?e.FILTER_PCSS:e.FILTER_NONE)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contactHardeningLightSizeUVRatio",{get:function(){return this._contactHardeningLightSizeUVRatio},set:function(e){this._contactHardeningLightSizeUVRatio=e},enumerable:!0,configurable:!0}),e.prototype.getDarkness=function(){return this._darkness},e.prototype.setDarkness=function(e){return this._darkness=e>=1?1:e<=0?0:e,this},e.prototype.setTransparencyShadow=function(e){return this._transparencyShadow=e,this},e.prototype.getShadowMap=function(){return this._shadowMap},e.prototype.getShadowMapForRendering=function(){return this._shadowMap2?this._shadowMap2:this._shadowMap},e.prototype.addShadowCaster=function(e,t){var i;return void 0===t&&(t=!0),this._shadowMap?(this._shadowMap.renderList||(this._shadowMap.renderList=[]),this._shadowMap.renderList.push(e),t&&(i=this._shadowMap.renderList).push.apply(i,e.getChildMeshes()),this):this},e.prototype.removeShadowCaster=function(e,t){if(void 0===t&&(t=!0),!this._shadowMap||!this._shadowMap.renderList)return this;var i=this._shadowMap.renderList.indexOf(e);if(-1!==i&&this._shadowMap.renderList.splice(i,1),t)for(var r=0,n=e.getChildren();r1?(this._shadowMap=new wi(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube(),void 0,!1,!1),this._shadowMap.createDepthStencilTexture(_.a.LESS,!0)):this._shadowMap=new wi(this._light.name+"_shadowMap",this._mapSize,this._scene,!1,!0,this._textureType,this._light.needCube()),this._shadowMap.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap.anisotropicFilteringLevel=1,this._shadowMap.updateSamplingMode(Ge.a.BILINEAR_SAMPLINGMODE),this._shadowMap.renderParticles=!1,this._shadowMap.ignoreCameraViewport=!0,this._shadowMap.onBeforeRenderObservable.add(function(r){t._currentFaceIndex=r,t._filter===e.FILTER_PCF&&i.setColorWrite(!1)}),this._shadowMap.customRenderFunction=this._renderForShadowMap.bind(this),this._shadowMap.onAfterUnbindObservable.add(function(){if(t._filter===e.FILTER_PCF&&i.setColorWrite(!0),t.useBlurExponentialShadowMap||t.useBlurCloseExponentialShadowMap){var r=t.getShadowMapForRendering();r&&t._scene.postProcessManager.directRender(t._blurPostProcesses,r.getInternalTexture(),!0)}});var r=new o.f(0,0,0,0),n=new o.f(1,1,1,1);this._shadowMap.onClearObservable.add(function(i){t._filter===e.FILTER_PCF?i.clear(n,!1,!0,!1):t.useExponentialShadowMap||t.useBlurExponentialShadowMap?i.clear(r,!0,!0,!1):i.clear(n,!0,!0,!1)})},e.prototype._initializeBlurRTTAndPostProcesses=function(){var e=this,t=this._scene.getEngine(),i=this._mapSize/this.blurScale;this.useKernelBlur&&1===this.blurScale||(this._shadowMap2=new wi(this._light.name+"_shadowMap2",i,this._scene,!1,!0,this._textureType),this._shadowMap2.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap2.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._shadowMap2.updateSamplingMode(Ge.a.BILINEAR_SAMPLINGMODE)),this.useKernelBlur?(this._kernelBlurXPostprocess=new Gr(this._light.name+"KernelBlurX",new o.w(1,0),this.blurKernel,1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.width=i,this._kernelBlurXPostprocess.height=i,this._kernelBlurXPostprocess.onApplyObservable.add(function(t){t.setTexture("textureSampler",e._shadowMap)}),this._kernelBlurYPostprocess=new Gr(this._light.name+"KernelBlurY",new o.w(0,1),this.blurKernel,1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._textureType),this._kernelBlurXPostprocess.autoClear=!1,this._kernelBlurYPostprocess.autoClear=!1,this._textureType===_.a.TEXTURETYPE_UNSIGNED_INT&&(this._kernelBlurXPostprocess.packedFloat=!0,this._kernelBlurYPostprocess.packedFloat=!0),this._blurPostProcesses=[this._kernelBlurXPostprocess,this._kernelBlurYPostprocess]):(this._boxBlurPostprocess=new Ot(this._light.name+"DepthBoxBlur","depthBoxBlur",["screenSize","boxOffset"],[],1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,"#define OFFSET "+this._blurBoxOffset,this._textureType),this._boxBlurPostprocess.onApplyObservable.add(function(t){t.setFloat2("screenSize",i,i),t.setTexture("textureSampler",e._shadowMap)}),this._boxBlurPostprocess.autoClear=!1,this._blurPostProcesses=[this._boxBlurPostprocess])},e.prototype._renderForShadowMap=function(e,t,i,r){var n,o=this._scene.getEngine();if(r.length){for(o.setColorWrite(!1),n=0;n=s.length)return void(e&&e(i));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(i){t.forceCompilation(function(){i()},e)})},e.prototype.isReady=function(e,t){var i=[];this._textureType!==_.a.TEXTURETYPE_UNSIGNED_INT&&i.push("#define FLOAT"),this.useExponentialShadowMap||this.useBlurExponentialShadowMap?i.push("#define ESM"):(this.usePercentageCloserFiltering||this.useContactHardeningShadow)&&i.push("#define DEPTHTEXTURE");var r=[gi.b.PositionKind],n=e.getMesh(),o=e.getMaterial();if(this.normalBias&&n.isVerticesDataPresent(gi.b.NormalKind)&&(r.push(gi.b.NormalKind),i.push("#define NORMAL"),n.nonUniformScaling&&i.push("#define NONUNIFORMSCALING"),this.getLight().getTypeID()===ni.a.LIGHTTYPEID_DIRECTIONALLIGHT&&i.push("#define DIRECTIONINLIGHTDATA")),o&&o.needAlphaTesting()){var s=o.getAlphaTestTexture();s&&(i.push("#define ALPHATEST"),n.isVerticesDataPresent(gi.b.UVKind)&&(r.push(gi.b.UVKind),i.push("#define UV1")),n.isVerticesDataPresent(gi.b.UV2Kind)&&1===s.coordinatesIndex&&(r.push(gi.b.UV2Kind),i.push("#define UV2")))}if(n.useBones&&n.computeBonesUsingShaders&&n.skeleton){r.push(gi.b.MatricesIndicesKind),r.push(gi.b.MatricesWeightsKind),n.numBoneInfluencers>4&&(r.push(gi.b.MatricesIndicesExtraKind),r.push(gi.b.MatricesWeightsExtraKind));var a=n.skeleton;i.push("#define NUM_BONE_INFLUENCERS "+n.numBoneInfluencers),a.isUsingTextureForMatrices?i.push("#define BONETEXTURE"):i.push("#define BonesPerMesh "+(a.bones.length+1))}else i.push("#define NUM_BONE_INFLUENCERS 0");var c=n.morphTargetManager,l=0;if(c&&c.numInfluencers>0&&(i.push("#define MORPHTARGETS"),l=c.numInfluencers,i.push("#define NUM_MORPH_INFLUENCERS "+l),jr.a.PrepareAttributesForMorphTargets(r,n,{NUM_MORPH_INFLUENCERS:l})),t&&(i.push("#define INSTANCES"),r.push("world0"),r.push("world1"),r.push("world2"),r.push("world3")),this.customShaderOptions&&this.customShaderOptions.defines)for(var u=0,h=this.customShaderOptions.defines;u0?this._setDefaultFixedFrustumShadowProjectionMatrix(e):this._setDefaultAutoExtendShadowProjectionMatrix(e,t,i)},t.prototype._setDefaultFixedFrustumShadowProjectionMatrix=function(e){var t=this.getScene().activeCamera;t&&o.j.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,i){var r=this.getScene().activeCamera;if(r){if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){var n=o.x.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=Number.MIN_VALUE,this._orthoTop=Number.MIN_VALUE,this._orthoBottom=Number.MAX_VALUE;for(var s=0;sthis._orthoRight&&(this._orthoRight=n.x),n.y>this._orthoTop&&(this._orthoTop=n.y)}}var u=this._orthoRight-this._orthoLeft,h=this._orthoTop-this._orthoBottom;o.j.OrthoOffCenterLHToRef(this._orthoLeft-u*this.shadowOrthoScale,this._orthoRight+u*this.shadowOrthoScale,this._orthoBottom-h*this.shadowOrthoScale,this._orthoTop+h*this.shadowOrthoScale,void 0!==this.shadowMinZ?this.shadowMinZ:r.minZ,void 0!==this.shadowMaxZ?this.shadowMaxZ:r.maxZ,e)}},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,t),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,t),this)},t.prototype.getDepthMinZ=function(e){return 1},t.prototype.getDepthMaxZ=function(e){return 1},t.prototype.prepareLightSpecificDefines=function(e,t){e["DIRLIGHT"+t]=!0},l.c([Object(w.c)()],t.prototype,"shadowFrustumSize",null),l.c([Object(w.c)()],t.prototype,"shadowOrthoScale",null),l.c([Object(w.c)()],t.prototype,"autoUpdateExtends",void 0),t}(kn);F.a.AddNodeConstructor("Light_Type_0",function(e,t){return function(){return new Kn(e,o.x.Zero(),t)}});var Kn=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n._shadowAngle=Math.PI/2,n.position=i,n}return l.d(t,e),Object.defineProperty(t.prototype,"shadowAngle",{get:function(){return this._shadowAngle},set:function(e){this._shadowAngle=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},set:function(e){var t=this.needCube();this._direction=e,this.needCube()!==t&&this._shadowGenerator&&this._shadowGenerator.recreateShadowMap()},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"PointLight"},t.prototype.getTypeID=function(){return ni.a.LIGHTTYPEID_POINTLIGHT},t.prototype.needCube=function(){return!this.direction},t.prototype.getShadowDirection=function(t){if(this.direction)return e.prototype.getShadowDirection.call(this,t);switch(t){case 0:return new o.x(1,0,0);case 1:return new o.x(-1,0,0);case 2:return new o.x(0,-1,0);case 3:return new o.x(0,1,0);case 4:return new o.x(0,0,1);case 5:return new o.x(0,0,-1)}return o.x.Zero()},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,i){var r=this.getScene().activeCamera;r&&o.j.PerspectiveFovLHToRef(this.shadowAngle,1,this.getDepthMinZ(r),this.getDepthMaxZ(r),e)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype.transferToEffect=function(e,t){return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,0,t):this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,0,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,t),this},t.prototype.prepareLightSpecificDefines=function(e,t){e["POINTLIGHT"+t]=!0},l.c([Object(w.c)()],t.prototype,"shadowAngle",null),t}(kn);F.a.AddNodeConstructor("Light_Type_2",function(e,t){return function(){return new Qn(e,o.x.Zero(),o.x.Zero(),0,0,t)}});var Qn=function(e){function t(t,i,r,n,s,a){var c=e.call(this,t,a)||this;return c._innerAngle=0,c._projectionTextureMatrix=o.j.Zero(),c._projectionTextureLightNear=1e-6,c._projectionTextureLightFar=1e3,c._projectionTextureUpDirection=o.x.Up(),c._projectionTextureViewLightDirty=!0,c._projectionTextureProjectionLightDirty=!0,c._projectionTextureDirty=!0,c._projectionTextureViewTargetVector=o.x.Zero(),c._projectionTextureViewLightMatrix=o.j.Zero(),c._projectionTextureProjectionLightMatrix=o.j.Zero(),c._projectionTextureScalingMatrix=o.j.FromValues(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),c.position=i,c.direction=r,c.angle=n,c.exponent=s,c}return l.d(t,e),Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._cosHalfAngle=Math.cos(.5*e),this._projectionTextureProjectionLightDirty=!0,this.forceProjectionMatrixCompute(),this._computeAngleValues()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"innerAngle",{get:function(){return this._innerAngle},set:function(e){this._innerAngle=e,this._computeAngleValues()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shadowAngleScale",{get:function(){return this._shadowAngleScale},set:function(e){this._shadowAngleScale=e,this.forceProjectionMatrixCompute()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureMatrix",{get:function(){return this._projectionTextureMatrix},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightNear",{get:function(){return this._projectionTextureLightNear},set:function(e){this._projectionTextureLightNear=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureLightFar",{get:function(){return this._projectionTextureLightFar},set:function(e){this._projectionTextureLightFar=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTextureUpDirection",{get:function(){return this._projectionTextureUpDirection},set:function(e){this._projectionTextureUpDirection=e,this._projectionTextureProjectionLightDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"projectionTexture",{get:function(){return this._projectionTexture},set:function(e){this._projectionTexture=e,this._projectionTextureDirty=!0},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"SpotLight"},t.prototype.getTypeID=function(){return ni.a.LIGHTTYPEID_SPOTLIGHT},t.prototype._setDirection=function(t){e.prototype._setDirection.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setPosition=function(t){e.prototype._setPosition.call(this,t),this._projectionTextureViewLightDirty=!0},t.prototype._setDefaultShadowProjectionMatrix=function(e,t,i){var r=this.getScene().activeCamera;if(r){this._shadowAngleScale=this._shadowAngleScale||1;var n=this._shadowAngleScale*this._angle;o.j.PerspectiveFovLHToRef(n,1,this.getDepthMinZ(r),this.getDepthMaxZ(r),e)}},t.prototype._computeProjectionTextureViewLightMatrix=function(){this._projectionTextureViewLightDirty=!1,this._projectionTextureDirty=!0,this.position.addToRef(this.direction,this._projectionTextureViewTargetVector),o.j.LookAtLHToRef(this.position,this._projectionTextureViewTargetVector,this._projectionTextureUpDirection,this._projectionTextureViewLightMatrix)},t.prototype._computeProjectionTextureProjectionLightMatrix=function(){this._projectionTextureProjectionLightDirty=!1,this._projectionTextureDirty=!0;var e=this.projectionTextureLightFar,t=this.projectionTextureLightNear,i=e/(e-t),r=-i*t,n=1/Math.tan(this._angle/2);o.j.FromValuesToRef(n/1,0,0,0,0,n,0,0,0,0,i,1,0,0,r,0,this._projectionTextureProjectionLightMatrix)},t.prototype._computeProjectionTextureMatrix=function(){this._projectionTextureDirty=!1,this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix,this._projectionTextureMatrix),this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix,this._projectionTextureMatrix)},t.prototype._buildUniformLayout=function(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",3),this._uniformBuffer.addUniform("vLightDirection",3),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()},t.prototype._computeAngleValues=function(){this._lightAngleScale=1/Math.max(.001,Math.cos(.5*this._innerAngle)-this._cosHalfAngle),this._lightAngleOffset=-this._cosHalfAngle*this._lightAngleScale},t.prototype.transferToEffect=function(e,t){var i;return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x,this.transformedPosition.y,this.transformedPosition.z,this.exponent,t),i=o.x.Normalize(this.transformedDirection)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x,this.position.y,this.position.z,this.exponent,t),i=o.x.Normalize(this.direction)),this._uniformBuffer.updateFloat4("vLightDirection",i.x,i.y,i.z,this._cosHalfAngle,t),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,this._lightAngleScale,this._lightAngleOffset,t),this.projectionTexture&&this.projectionTexture.isReady()&&(this._projectionTextureViewLightDirty&&this._computeProjectionTextureViewLightMatrix(),this._projectionTextureProjectionLightDirty&&this._computeProjectionTextureProjectionLightMatrix(),this._projectionTextureDirty&&this._computeProjectionTextureMatrix(),e.setMatrix("textureProjectionMatrix"+t,this._projectionTextureMatrix),e.setTexture("projectionLightSampler"+t,this.projectionTexture)),this},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._projectionTexture&&this._projectionTexture.dispose()},t.prototype.prepareLightSpecificDefines=function(e,t){e["SPOTLIGHT"+t]=!0,e["PROJECTEDLIGHTTEXTURE"+t]=!!this.projectionTexture},l.c([Object(w.c)()],t.prototype,"angle",null),l.c([Object(w.c)()],t.prototype,"innerAngle",null),l.c([Object(w.c)()],t.prototype,"shadowAngleScale",null),l.c([Object(w.c)()],t.prototype,"exponent",void 0),l.c([Object(w.c)()],t.prototype,"projectionTextureLightNear",null),l.c([Object(w.c)()],t.prototype,"projectionTextureLightFar",null),l.c([Object(w.c)()],t.prototype,"projectionTextureUpDirection",null),l.c([Object(w.l)("projectedLightTexture")],t.prototype,"_projectionTexture",void 0),t}(kn),qn=function(){function e(e,t,i){void 0===t&&(t=""),void 0===i&&(i="black");var r=this;this._renderingCanvas=e,this._loadingText=t,this._loadingDivBackgroundColor=i,this._resizeLoadingUI=function(){var e=r._renderingCanvas.getBoundingClientRect(),t=window.getComputedStyle(r._renderingCanvas).position;r._loadingDiv&&(r._loadingDiv.style.position="fixed"===t?"fixed":"absolute",r._loadingDiv.style.left=e.left+"px",r._loadingDiv.style.top=e.top+"px",r._loadingDiv.style.width=e.width+"px",r._loadingDiv.style.height=e.height+"px")}}return e.prototype.displayLoadingUI=function(){if(!this._loadingDiv){this._loadingDiv=document.createElement("div"),this._loadingDiv.id="babylonjsLoadingDiv",this._loadingDiv.style.opacity="0",this._loadingDiv.style.transition="opacity 1.5s ease",this._loadingDiv.style.pointerEvents="none",this._loadingTextDiv=document.createElement("div"),this._loadingTextDiv.style.position="absolute",this._loadingTextDiv.style.left="0",this._loadingTextDiv.style.top="50%",this._loadingTextDiv.style.marginTop="80px",this._loadingTextDiv.style.width="100%",this._loadingTextDiv.style.height="20px",this._loadingTextDiv.style.fontFamily="Arial",this._loadingTextDiv.style.fontSize="14px",this._loadingTextDiv.style.color="white",this._loadingTextDiv.style.textAlign="center",this._loadingTextDiv.innerHTML="Loading",this._loadingDiv.appendChild(this._loadingTextDiv),this._loadingTextDiv.innerHTML=this._loadingText;var e=document.createElement("style");e.type="text/css";e.innerHTML="@-webkit-keyframes spin1 { 0% { -webkit-transform: rotate(0deg);}\n 100% { -webkit-transform: rotate(360deg);}\n } @keyframes spin1 { 0% { transform: rotate(0deg);}\n 100% { transform: rotate(360deg);}\n }",document.getElementsByTagName("head")[0].appendChild(e);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mCC",t.style.position="absolute",t.style.left="50%",t.style.top="50%",t.style.marginLeft="-60px",t.style.marginTop="-60px",t.style.animation="spin1 2s infinite ease-in-out",t.style.webkitAnimation="spin1 2s infinite ease-in-out",t.style.transformOrigin="50% 50%",t.style.webkitTransformOrigin="50% 50%",this._loadingDiv.appendChild(t),this._resizeLoadingUI(),window.addEventListener("resize",this._resizeLoadingUI),this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor,document.body.appendChild(this._loadingDiv),this._loadingDiv.style.opacity="1"}},e.prototype.hideLoadingUI=function(){var e=this;if(this._loadingDiv){this._loadingDiv.style.opacity="0",this._loadingDiv.addEventListener("transitionend",function(){e._loadingDiv&&(e._loadingDiv.parentElement&&e._loadingDiv.parentElement.removeChild(e._loadingDiv),window.removeEventListener("resize",e._resizeLoadingUI),e._loadingDiv=null)})}},Object.defineProperty(e.prototype,"loadingUIText",{get:function(){return this._loadingText},set:function(e){this._loadingText=e,this._loadingTextDiv&&(this._loadingTextDiv.innerHTML=this._loadingText)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadingUIBackgroundColor",{get:function(){return this._loadingDivBackgroundColor},set:function(e){this._loadingDivBackgroundColor=e,this._loadingDiv&&(this._loadingDiv.style.backgroundColor=this._loadingDivBackgroundColor)},enumerable:!0,configurable:!0}),e}();_e.b.DefaultLoadingScreenFactory=function(e){return new qn(e)};var Zn=i(56),Jn=i(63),$n=function(){function e(){}return e.ConvertPanoramaToCubemap=function(e,t,i,r){if(!e)throw"ConvertPanoramaToCubemap: input cannot be null";if(e.length!=t*i*3)throw"ConvertPanoramaToCubemap: input size is wrong";return{front:this.CreateCubemapTexture(r,this.FACE_FRONT,e,t,i),back:this.CreateCubemapTexture(r,this.FACE_BACK,e,t,i),left:this.CreateCubemapTexture(r,this.FACE_LEFT,e,t,i),right:this.CreateCubemapTexture(r,this.FACE_RIGHT,e,t,i),up:this.CreateCubemapTexture(r,this.FACE_UP,e,t,i),down:this.CreateCubemapTexture(r,this.FACE_DOWN,e,t,i),size:r,type:_.a.TEXTURETYPE_FLOAT,format:_.a.TEXTUREFORMAT_RGB,gammaSpace:!1}},e.CreateCubemapTexture=function(e,t,i,r,n){for(var o=new ArrayBuffer(e*e*4*3),s=new Float32Array(o),a=t[1].subtract(t[0]).scale(1/e),c=t[3].subtract(t[2]).scale(1/e),l=1/e,u=0,h=0;hMath.PI;)n-=2*Math.PI;var s=n/Math.PI,a=o/Math.PI;s=.5*s+.5;var c=Math.round(s*i);c<0?c=0:c>=i&&(c=i-1);var l=Math.round(a*r);l<0?l=0:l>=r&&(l=r-1);var u=r-l-1;return{r:t[u*i*3+3*c+0],g:t[u*i*3+3*c+1],b:t[u*i*3+3*c+2]}},e.FACE_FRONT=[new o.x(-1,-1,-1),new o.x(1,-1,-1),new o.x(-1,1,-1),new o.x(1,1,-1)],e.FACE_BACK=[new o.x(1,-1,1),new o.x(-1,-1,1),new o.x(1,1,1),new o.x(-1,1,1)],e.FACE_RIGHT=[new o.x(1,-1,-1),new o.x(1,-1,1),new o.x(1,1,-1),new o.x(1,1,1)],e.FACE_LEFT=[new o.x(-1,-1,1),new o.x(-1,-1,-1),new o.x(-1,1,1),new o.x(-1,1,-1)],e.FACE_DOWN=[new o.x(-1,1,-1),new o.x(1,1,-1),new o.x(-1,1,1),new o.x(1,1,1)],e.FACE_UP=[new o.x(-1,-1,1),new o.x(1,-1,1),new o.x(-1,-1,-1),new o.x(1,-1,-1)],e}(),eo=function(){function e(){}return e.Ldexp=function(e,t){return t>1023?e*Math.pow(2,1023)*Math.pow(2,t-1023):t<-1074?e*Math.pow(2,-1074)*Math.pow(2,t+1074):e*Math.pow(2,t)},e.Rgbe2float=function(e,t,i,r,n,o){n>0?(n=this.Ldexp(1,n-136),e[o+0]=t*n,e[o+1]=i*n,e[o+2]=r*n):(e[o+0]=0,e[o+1]=0,e[o+2]=0)},e.readStringLine=function(e,t){for(var i="",r="",n=t;n32767)throw"HDR Bad header format, unsupported size";return{height:t,width:i,dataPosition:s+=r.length+1}},e.GetCubeMapTextureData=function(e,t){var i=new Uint8Array(e),r=this.RGBE_ReadHeader(i),n=this.RGBE_ReadPixels_RLE(i,r);return $n.ConvertPanoramaToCubemap(n,r.width,r.height,t)},e.RGBE_ReadPixels=function(e,t){return this.RGBE_ReadPixels_RLE(e,t)},e.RGBE_ReadPixels_RLE=function(e,t){for(var i,r,n,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),_=new ArrayBuffer(t.width*t.height*4*3),m=new Float32Array(_);a>0;){if(i=e[l++],r=e[l++],n=e[l++],o=e[l++],2!=i||2!=r||128&n)throw"HDR Bad header format, not RLE";if((n<<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=i-128)||s>h-u)throw"HDR Bad Format, bad scanline data (run)";for(;s-- >0;)p[u++]=r}else{if(0==(s=i)||s>h-u)throw"HDR Bad Format, bad scanline data (non-run)";if(p[u++]=r,--s>0)for(var g=0;g255){var g=255/m;f*=g,p*=g,_*=g}c[3*d+0]=f,c[3*d+1]=p,c[3*d+2]=_}c?a.push(c):a.push(h)}return a},null,this._onLoad,this._onError))},t.prototype.clone=function(){var e=this.getScene();if(!e)return this;var i=new t(this.url,e,this._size,this._noMipmap,this._generateHarmonics,this.gammaSpace);return i.level=this.level,i.wrapU=this.wrapU,i.wrapV=this.wrapV,i.coordinatesIndex=this.coordinatesIndex,i.coordinatesMode=this.coordinatesMode,i},t.prototype.delayLoad=function(){this.delayLoadState===_e.b.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=_e.b.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.MATERIAL_TextureDirtyFlag,function(e){return-1!==e.getActiveTextures().indexOf(t)})},t.Parse=function(e,i,r){var n=null;return e.name&&!e.isRenderTarget&&((n=new t(r+e.name,i,e.size,e.noMipmap,e.generateHarmonics,e.useInGammaSpace)).name=e.name,n.hasAlpha=e.hasAlpha,n.level=e.level,n.coordinatesMode=e.coordinatesMode,n.isBlocking=e.isBlocking),n&&(e.boundingBoxPosition&&(n.boundingBoxPosition=o.x.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(n.boundingBoxSize=o.x.FromArray(e.boundingBoxSize)),e.rotationY&&(n.rotationY=e.rotationY)),n},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}(Fr.a);s.a.RegisteredTypes["BABYLON.HDRCubeTexture"]=io;var ro=function(){function e(e,t,i){void 0===t&&(t=0),void 0===i&&(i=null),this.name=e,this.animations=new Array,this._positions=null,this._normals=null,this._tangents=null,this.onInfluenceChanged=new n.c,this._onDataLayoutChanged=new n.c,this._animationPropertiesOverride=null,this._scene=i||R.a.LastCreatedScene,this.influence=t}return Object.defineProperty(e.prototype,"influence",{get:function(){return this._influence},set:function(e){if(this._influence!==e){var t=this._influence;this._influence=e,this.onInfluenceChanged.hasObservers&&this.onInfluenceChanged.notifyObservers(0===t||0===e)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animationPropertiesOverride",{get:function(){return!this._animationPropertiesOverride&&this._scene?this._scene.animationPropertiesOverride:this._animationPropertiesOverride},set:function(e){this._animationPropertiesOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasPositions",{get:function(){return!!this._positions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasNormals",{get:function(){return!!this._normals},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTangents",{get:function(){return!!this._tangents},enumerable:!0,configurable:!0}),e.prototype.setPositions=function(e){var t=this.hasPositions;this._positions=e,t!==this.hasPositions&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getPositions=function(){return this._positions},e.prototype.setNormals=function(e){var t=this.hasNormals;this._normals=e,t!==this.hasNormals&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getNormals=function(){return this._normals},e.prototype.setTangents=function(e){var t=this.hasTangents;this._tangents=e,t!==this.hasTangents&&this._onDataLayoutChanged.notifyObservers(void 0)},e.prototype.getTangents=function(){return this._tangents},e.prototype.serialize=function(){var e={};return e.name=this.name,e.influence=this.influence,e.positions=Array.prototype.slice.call(this.getPositions()),null!=this.id&&(e.id=this.id),this.hasNormals&&(e.normals=Array.prototype.slice.call(this.getNormals())),this.hasTangents&&(e.tangents=Array.prototype.slice.call(this.getTangents())),w.a.AppendSerializedAnimations(this,e),e},e.prototype.getClassName=function(){return"MorphTarget"},e.Parse=function(t){var i=new e(t.name,t.influence);if(i.setPositions(t.positions),null!=t.id&&(i.id=t.id),t.normals&&i.setNormals(t.normals),t.tangents&&i.setTangents(t.tangents),t.animations)for(var r=0;r=0&&(this._targets.splice(t,1),e.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(t,1)[0]),e._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(t,1)[0]),this._syncActiveTargets(!0))},e.prototype.serialize=function(){var e={};e.id=this.uniqueId,e.targets=[];for(var t=0,i=this._targets;t-1){var i=this._impostors.splice(t,1);i.length&&(i[0].physicsBody=null)}},e.prototype.addJoint=function(e,t,i){var r={mainImpostor:e,connectedImpostor:t,joint:i};i.physicsPlugin=this._physicsPlugin,this._joints.push(r),this._physicsPlugin.generateJoint(r)},e.prototype.removeJoint=function(e,t,i){var r=this._joints.filter(function(r){return r.connectedImpostor===t&&r.joint===i&&r.mainImpostor===e});r.length&&this._physicsPlugin.removeJoint(r[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;t1e3*i));a++);this.time+=r;for(var c=this.time%i/i,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}();ao.DefaultPluginFactory=function(){return new co};var lo=function(){function e(e,t){void 0===t&&(t=OIMO),this.name="OimoJSPlugin",this._tmpImpostorsArray=[],this._tmpPositionVector=o.x.Zero(),this.BJSOIMO=t,this.world=new this.BJSOIMO.World({iterations:e}),this.world.clear()}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 i=this;t.forEach(function(e){e.beforeStep()}),this.world.step(),t.forEach(function(e){e.afterStep(),i._tmpImpostorsArray[e.uniqueId]=e});for(var r=this.world.contacts;null!==r;)if(!r.touching||r.body1.sleeping||r.body2.sleeping){var n=this._tmpImpostorsArray[+r.body1.name],o=this._tmpImpostorsArray[+r.body2.name];n&&o?(n.onCollide({body:o.physicsBody}),o.onCollide({body:n.physicsBody}),r=r.next):r=r.next}else r=r.next},e.prototype.applyImpulse=function(e,t,i){var r=e.physicsBody.mass;e.physicsBody.applyImpulse(i.scale(this.world.invScale),t.scale(this.world.invScale*r))},e.prototype.applyForce=function(e,t,i){p.a.Warn("Oimo doesn't support applying force. Using impule instead."),this.applyImpulse(e,t,i)},e.prototype.generatePhysicsBody=function(e){var t=this;if(e.parent)e.physicsBody&&(this.removePhysicsBody(e),e.forceUpdate());else{if(e.isBodyInitRequired()){var i={name:e.uniqueId,config:[e.getParam("mass")||1,e.getParam("friction"),e.getParam("restitution")],size:[],type:[],pos:[],posShape:[],rot:[],rotShape:[],move:0!==e.getParam("mass"),density:e.getParam("mass"),friction:e.getParam("friction"),restitution:e.getParam("restitution"),world:this.world},r=[e];(a=e.object).getChildMeshes&&a.getChildMeshes().forEach(function(e){e.physicsImpostor&&r.push(e.physicsImpostor)});var n=function(e){return Math.max(e,ao.Epsilon)},s=new o.q;r.forEach(function(r){if(r.object.rotationQuaternion){var o=r.object.rotationQuaternion;s=o.clone();var a=o.toEulerAngles(),c=r.getObjectExtendSize();if(r===e){var l=e.getObjectCenter();e.object.getAbsolutePivotPoint().subtractToRef(l,t._tmpPositionVector),t._tmpPositionVector.divideInPlace(e.object.scaling),i.pos.push(l.x),i.pos.push(l.y),i.pos.push(l.z),i.posShape.push(0,0,0),i.rotShape.push(0,0,0)}else{var u=r.object.getAbsolutePosition().subtract(e.object.getAbsolutePosition());i.posShape.push(u.x),i.posShape.push(u.y),i.posShape.push(u.z),i.pos.push(0,0,0),i.rotShape.push(57.29577951308232*a.x),i.rotShape.push(57.29577951308232*a.y),i.rotShape.push(57.29577951308232*a.z)}switch(r.type){case oo.a.ParticleImpostor:p.a.Warn("No Particle support in OIMO.js. using SphereImpostor instead");case oo.a.SphereImpostor:var h=c.x,d=c.y,f=c.z,_=Math.max(n(h),n(d),n(f))/2;i.type.push("sphere"),i.size.push(_),i.size.push(_),i.size.push(_);break;case oo.a.CylinderImpostor:var m=n(c.x)/2,g=n(c.y);i.type.push("cylinder"),i.size.push(m),i.size.push(g),i.size.push(g);break;case oo.a.PlaneImpostor:case oo.a.BoxImpostor:default:m=n(c.x),g=n(c.y);var v=n(c.z);i.type.push("box"),i.size.push(m),i.size.push(g),i.size.push(v)}r.object.rotationQuaternion=o}}),e.physicsBody=this.world.add(i),e.physicsBody.resetQuaternion(s),e.physicsBody.updatePosition(0)}else this._tmpPositionVector.copyFromFloats(0,0,0);var a;e.setDeltaPosition(this._tmpPositionVector)}},e.prototype.removePhysicsBody=function(e){this.world.removeRigidBody(e.physicsBody)},e.prototype.generateJoint=function(e){var t=e.mainImpostor.physicsBody,i=e.connectedImpostor.physicsBody;if(t&&i){var r,n=e.joint.jointData,o=n.nativeParams||{},s={body1:t,body2:i,axe1:o.axe1||(n.mainAxis?n.mainAxis.asArray():null),axe2:o.axe2||(n.connectedAxis?n.connectedAxis.asArray():null),pos1:o.pos1||(n.mainPivot?n.mainPivot.asArray():null),pos2:o.pos2||(n.connectedPivot?n.connectedPivot.asArray():null),min:o.min,max:o.max,collision:o.collision||n.collision,spring:o.spring,world:this.world};switch(e.joint.type){case so.e.BallAndSocketJoint:r="jointBall";break;case so.e.SpringJoint:p.a.Warn("OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead");var a=n;s.min=a.length||s.min,s.max=Math.max(s.min,s.max);case so.e.DistanceJoint:r="jointDistance",s.max=n.maxDistance;break;case so.e.PrismaticJoint:r="jointPrisme";break;case so.e.SliderJoint:r="jointSlide";break;case so.e.WheelJoint:r="jointWheel";break;case so.e.HingeJoint:default:r="jointHinge"}s.type=r,e.joint.physicsJoint=this.world.add(s)}},e.prototype.removeJoint=function(e){try{this.world.removeJoint(e.joint.physicsJoint)}catch(e){p.a.Warn(e)}},e.prototype.isSupported=function(){return void 0!==this.BJSOIMO},e.prototype.setTransformationFromPhysicsBody=function(e){e.physicsBody.sleeping||(e.object.position.copyFrom(e.physicsBody.getPosition()),e.object.rotationQuaternion&&e.object.rotationQuaternion.copyFrom(e.physicsBody.getQuaternion()))},e.prototype.setPhysicsBodyTransformation=function(e,t,i){var r=e.physicsBody;r.position.copy(t),r.orientation.copy(i),r.syncShapes(),r.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 o.x(t.x,t.y,t.z):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.angularVelocity;return t?new o.x(t.x,t.y,t.z):null},e.prototype.setBodyMass=function(e,t){var i=0===t;e.physicsBody.shapes.density=i?1:t,e.physicsBody.setupMass(i?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,i){e.physicsJoint.limitMotor.upperLimit=t,void 0!==i&&(e.physicsJoint.limitMotor.lowerLimit=i)},e.prototype.setMotor=function(e,t,i,r){void 0!==i?p.a.Warn("OimoJS plugin currently has unexpected behavior when using setMotor with force parameter"):i=1e6,t*=-1;var n=r?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;n&&n.setMotor(t,i)},e.prototype.setLimit=function(e,t,i,r){var n=r?e.physicsJoint.rotationalLimitMotor2:e.physicsJoint.rotationalLimitMotor1||e.physicsJoint.rotationalLimitMotor||e.physicsJoint.limitMotor;n&&n.setLimit(t,void 0===i?-t:i)},e.prototype.syncMeshWithImpostor=function(e,t){var i=t.physicsBody;e.position.x=i.position.x,e.position.y=i.position.y,e.position.z=i.position.z,e.rotationQuaternion&&(e.rotationQuaternion.x=i.orientation.x,e.rotationQuaternion.y=i.orientation.y,e.rotationQuaternion.z=i.orientation.z,e.rotationQuaternion.w=i.orientation.s)},e.prototype.getRadius=function(e){return e.physicsBody.shapes.radius},e.prototype.getBoxSizeToRef=function(e,t){var i=e.physicsBody.shapes;t.x=2*i.halfWidth,t.y=2*i.halfHeight,t.z=2*i.halfDepth},e.prototype.dispose=function(){this.world.clear()},e}();r.a.prototype.removeReflectionProbe=function(e){if(!this.reflectionProbes)return-1;var t=this.reflectionProbes.indexOf(e);return-1!==t&&this.reflectionProbes.splice(t,1),t},r.a.prototype.addReflectionProbe=function(e){this.reflectionProbes||(this.reflectionProbes=[]),this.reflectionProbes.push(e)};var uo=function(){function e(e,t,i,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var s=this;this.name=e,this._viewMatrix=o.j.Identity(),this._target=o.x.Zero(),this._add=o.x.Zero(),this._invertYAxis=!1,this.position=o.x.Zero(),this._scene=i,this._scene.reflectionProbes||(this._scene.reflectionProbes=new Array),this._scene.reflectionProbes.push(this),this._renderTargetTexture=new wi(e,t,i,r,!0,n?_.a.TEXTURETYPE_FLOAT:_.a.TEXTURETYPE_UNSIGNED_INT,!0),this._renderTargetTexture.onBeforeRenderObservable.add(function(e){switch(e){case 0:s._add.copyFromFloats(1,0,0);break;case 1:s._add.copyFromFloats(-1,0,0);break;case 2:s._add.copyFromFloats(0,s._invertYAxis?1:-1,0);break;case 3:s._add.copyFromFloats(0,s._invertYAxis?-1:1,0);break;case 4:s._add.copyFromFloats(0,0,1);break;case 5:s._add.copyFromFloats(0,0,-1)}s._attachedMesh&&s.position.copyFrom(s._attachedMesh.getAbsolutePosition()),s.position.addToRef(s._add,s._target),o.j.LookAtLHToRef(s.position,s._target,o.x.Up(),s._viewMatrix),i.activeCamera&&(s._projectionMatrix=o.j.PerspectiveFovLH(Math.PI/2,1,i.activeCamera.minZ,i.activeCamera.maxZ),i.setTransformMatrix(s._viewMatrix,s._projectionMatrix)),i._forcedViewPosition=s.position}),this._renderTargetTexture.onAfterUnbindObservable.add(function(){i._forcedViewPosition=null,i.updateTransformMatrix(!0)})}return Object.defineProperty(e.prototype,"samples",{get:function(){return this._renderTargetTexture.samples},set:function(e){this._renderTargetTexture.samples=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"refreshRate",{get:function(){return this._renderTargetTexture.refreshRate},set:function(e){this._renderTargetTexture.refreshRate=e},enumerable:!0,configurable:!0}),e.prototype.getScene=function(){return this._scene},Object.defineProperty(e.prototype,"cubeTexture",{get:function(){return this._renderTargetTexture},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderList",{get:function(){return this._renderTargetTexture.renderList},enumerable:!0,configurable:!0}),e.prototype.attachToMesh=function(e){this._attachedMesh=e},e.prototype.setRenderingAutoClearDepthStencil=function(e,t){this._renderTargetTexture.setRenderingAutoClearDepthStencil(e,t)},e.prototype.dispose=function(){var e=this._scene.reflectionProbes.indexOf(this);-1!==e&&this._scene.reflectionProbes.splice(e,1),this._renderTargetTexture&&(this._renderTargetTexture.dispose(),this._renderTargetTexture=null)},e.prototype.toString=function(e){var t="Name: "+this.name;return e&&(t+=", position: "+this.position.toString(),this._attachedMesh&&(t+=", attached mesh: "+this._attachedMesh.name)),t},e.prototype.getClassName=function(){return"ReflectionProbe"},e.prototype.serialize=function(){var e=w.a.Serialize(this,this._renderTargetTexture.serialize());return e.isReflectionProbe=!0,e},e.Parse=function(t,i,r){var n=null;if(i.reflectionProbes)for(var o=0;o0){for(var Y=0;Y0){for(var Q=0;Q-1&&void 0!==u.skeletons&&null!==u.skeletons)if(!1===g.indexOf(y.skeletonId)>-1)for(var O=0,I=u.skeletons.length;O1,r.wrapU=_.a.TEXTURE_CLAMP_ADDRESSMODE,r.wrapV=_.a.TEXTURE_CLAMP_ADDRESSMODE,r.wrapR=_.a.TEXTURE_CLAMP_ADDRESSMODE,r.anisotropicFilteringLevel=1,r._texture=r._getFromCache(t,!0),r._texture||(i.useDelayedTextureLoading?r.delayLoadState=_.a.DELAYLOADSTATE_NOTLOADED:r.loadTexture()),r):r}return l.d(t,e),t.prototype.getTextureMatrix=function(){return this._textureMatrix},t.prototype.load3dlTexture=function(){var e,i=this._engine;e=1===i.webGLVersion?i.createRawTexture(null,1,1,_.a.TEXTUREFORMAT_RGBA,!1,!1,_.a.TEXTURE_BILINEAR_SAMPLINGMODE):i.createRawTexture3D(null,1,1,1,_.a.TEXTUREFORMAT_RGBA,!1,!1,_.a.TEXTURE_BILINEAR_SAMPLINGMODE),this._texture=e;var r=function(r){if("string"==typeof r){for(var n,o=null,s=null,a=r.split("\n"),c=0,l=0,u=0,h=0,d=0,f=0;f0&&(f+1)%4==0)o[f]=255;else{var b=s[f];o[f]=b/d*255}e.is3D?(e.updateSize(c,c,c),i.updateRawTexture3D(e,o,_.a.TEXTUREFORMAT_RGBA,!1)):(e.updateSize(c*c,c),i.updateRawTexture(e,o,_.a.TEXTUREFORMAT_RGBA,!1))}},n=this.getScene();return n?n._loadFile(this.url,r):this._engine._loadFile(this.url,r),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===_.a.DELAYLOADSTATE_NOTLOADED&&(this.delayLoadState=_.a.DELAYLOADSTATE_LOADED,this._texture=this._getFromCache(this.url,!0),this._texture||this.loadTexture())},t.Parse=function(e,i){var r=null;return e.name&&!e.isRenderTarget&&((r=new t(e.name,i)).name=e.name,r.level=e.level),r},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}(Fr.a);s.a.RegisteredTypes["BABYLON.ColorGradingTexture"]=Eo;var xo=i(90),Ao=i(60);function Po(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var Ro=Po("DXT1"),So=Po("DXT3"),Co=Po("DXT5"),Mo=Po("DX10"),Oo=function(){function e(){}return e.GetDDSInfo=function(e){var t=new Int32Array(e,0,31),i=new Int32Array(e,0,35),r=1;131072&t[2]&&(r=Math.max(1,t[7]));var n=t[21],o=n===Mo?i[32]:0,s=_.a.TEXTURETYPE_UNSIGNED_INT;switch(n){case 113:s=_.a.TEXTURETYPE_HALF_FLOAT;break;case 116:s=_.a.TEXTURETYPE_FLOAT;break;case Mo:if(10===o){s=_.a.TEXTURETYPE_HALF_FLOAT;break}}return{width:t[4],height:t[3],mipmapCount:r,isFourCC:4==(4&t[20]),isRGB:64==(64&t[20]),isLuminance:131072==(131072&t[20]),isCube:512==(512&t[28]),isCompressed:n===Ro||n===So||n===Co,dxgiFormat:o,textureType:s}},e._ToHalfFloat=function(t){e._FloatView||(e._FloatView=new Float32Array(1),e._Int32View=new Int32Array(e._FloatView.buffer)),e._FloatView[0]=t;var i=e._Int32View[0],r=i>>16&32768,n=i>>12&2047,o=i>>23&255;return o<103?r:o>142?(r|=31744,r|=(255==o?0:1)&&8388607&i):o<113?r|=((n|=2048)>>114-o)+(n>>113-o&1):(r|=o-112<<10|n>>1,r+=1&n)},e._FromHalfFloat=function(e){var t=(32768&e)>>15,i=(31744&e)>>10,r=1023&e;return 0===i?(t?-1:1)*Math.pow(2,-14)*(r/Math.pow(2,10)):31==i?r?NaN:1/0*(t?-1:1):(t?-1:1)*Math.pow(2,i-15)*(1+r/Math.pow(2,10))},e._GetHalfFloatAsFloatRGBAArrayBuffer=function(t,i,r,n,o,s){for(var a=new Float32Array(n),c=new Uint16Array(o,r),l=0,u=0;u>8)},e._GetRGBArrayBuffer=function(e,t,i,r,n,o,s,a){for(var c=new Uint8Array(r),l=new Uint8Array(n,i),u=0,h=0;h>8&255,P>>16&255,P>>24&255)))}var C=e._ExtractLongWordOrder(b[23]),M=e._ExtractLongWordOrder(b[24]),O=e._ExtractLongWordOrder(b[25]),I=e._ExtractLongWordOrder(b[26]);R&&(E=t._getRGBABufferInternalSizedFormat(n.textureType)),g=1,131072&b[2]&&!1!==o&&(g=Math.max(1,b[7]));for(var D=0;D0?n.sphericalPolynomial=to.a.ConvertCubeMapToSphericalPolynomial({size:b[4],right:l[0],left:l[1],up:l[2],down:l[3],front:l[4],back:l[5],format:_.a.TEXTUREFORMAT_RGBA,type:_.a.TEXTURETYPE_FLOAT,gammaSpace:!1}):n.sphericalPolynomial=void 0}else p.a.Error("Compressed textures are not supported on this platform.");else p.a.Error("Unsupported format, must contain a FourCC, RGB or LUMINANCE code");else p.a.Error("Invalid magic number in DDS header")},e.StoreLODInAlphaChannel=!1,e}();_e.b.prototype.createPrefilteredCubeTexture=function(e,t,i,r,n,o,s,a,c){var l=this;void 0===n&&(n=null),void 0===o&&(o=null),void 0===a&&(a=null),void 0===c&&(c=!0);return this.createCubeTexture(e,t,null,!1,function(e){if(e){var o=e.texture;if(c?e.info.sphericalPolynomial&&(o._sphericalPolynomial=e.info.sphericalPolynomial):o._sphericalPolynomial=new Ao.b,o._dataSource=Oi.a.DATASOURCE_CUBEPREFILTERED,l.getCaps().textureLOD)n&&n(o);else{var s=l._gl,a=e.width;if(a){for(var u=[],h=0;h<3;h++){var d=1-h/2,f=r,_=D.a.Log2(a)*i+r,m=f+(_-f)*d,g=Math.round(Math.min(Math.max(m,0),_)),v=new Oi.a(l,Oi.a.DATASOURCE_TEMP);if(v.type=o.type,v.format=o.format,v.width=Math.pow(2,Math.max(D.a.Log2(a)-g,0)),v.height=v.width,v.isCube=!0,l._bindTextureDirectly(s.TEXTURE_CUBE_MAP,v,!0),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),e.isDDS){var y=e.info,b=e.data;l._unpackFlipY(y.isCompressed),Oo.UploadDDSLevels(l,v,b,y,!0,6,g)}else p.a.Warn("DDS is the only prefiltered cube map supported so far.");l._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null);var T=new Fr.a(t);T.isCube=!0,T._texture=v,v.isReady=!0,u.push(T)}o._lodTextureHigh=u[2],o._lodTextureMid=u[1],o._lodTextureLow=u[0],n&&n(o)}}}else n&&n(null)},o,s,a,c,i,r)};var Io=function(){function e(){this.supportCascades=!0}return e.prototype.canLoad=function(e,t,i,r,n){return 0===e.indexOf(".dds")},e.prototype.transformUrl=function(e,t){return e},e.prototype.getFallbackTextureUrl=function(e,t){return null},e.prototype.loadCubeData=function(e,t,i,r,n){var o,s=t.getEngine(),a=!1;if(Array.isArray(e))for(var c=0;c1)&&t.generateMipMaps,s._unpackFlipY(o.isCompressed),Oo.UploadDDSLevels(s,t,l,o,a,6,-1,c),o.isFourCC||1!==o.mipmapCount||s.generateMipMapsForCubemap(t)}else{var u=e;o=Oo.GetDDSInfo(u),t.width=o.width,t.height=o.height,i&&(o.sphericalPolynomial=new Ao.b),a=(o.isRGB||o.isLuminance||o.mipmapCount>1)&&t.generateMipMaps,s._unpackFlipY(o.isCompressed),Oo.UploadDDSLevels(s,t,u,o,a,6),o.isFourCC||1!==o.mipmapCount||s.generateMipMapsForCubemap(t)}s._setCubeMapTextureParams(a),t.isReady=!0,r&&r({isDDS:!0,width:t.width,info:o,data:e,texture:t})},e.prototype.loadData=function(e,t,i){var r=Oo.GetDDSInfo(e),n=(r.isRGB||r.isLuminance||r.mipmapCount>1)&&t.generateMipMaps&&r.width>>r.mipmapCount-1==1;i(r.width,r.height,n,r.isFourCC,function(){Oo.UploadDDSLevels(t.getEngine(),t,e,r,n,1)})},e}();_e.b._TextureLoaders.push(new Io);var Do="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include\nvoid main(void)\n{\ngl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);\n}";Ct.a.ShadersStore.rgbdEncodePixelShader=Do;var wo="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include\nvoid main(void)\n{\ngl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);\n}";Ct.a.ShadersStore.rgbdDecodePixelShader=wo;var Lo=function(){function e(){}return e.GetEnvInfo=function(t){for(var i=new DataView(t),r=0,n=0;n-1?e.substring(0,i):e)+t},e.prototype.getFallbackTextureUrl=function(e,t){var i=new RegExp(t+"$");return e.replace(i,"")},e.prototype.loadCubeData=function(e,t,i,r,n){if(!Array.isArray(e)){t._invertVScale=!t.invertY;var o=t.getEngine(),s=new No(e,6),a=s.numberOfMipmapLevels>1&&t.generateMipMaps;o._unpackFlipY(!0),s.uploadLevels(t,t.generateMipMaps),t.width=s.pixelWidth,t.height=s.pixelHeight,o._setCubeMapTextureParams(a),t.isReady=!0}},e.prototype.loadData=function(e,t,i){t._invertVScale=!t.invertY;var r=new No(e,1);i(r.pixelWidth,r.pixelHeight,!1,!0,function(){r.uploadLevels(t,t.generateMipMaps)},r.isInvalid)},e}();_e.b._TextureLoaders.unshift(new Bo);var Uo=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,i){if(i.length<19)p.a.Error("Unable to load TGA file - Not enough data to contain header");else{var r=18,n=e.GetTGAHeader(i);if(n.id_length+r>i.length)p.a.Error("Unable to load TGA file - Not enough data");else{r+=n.id_length;var o,s=!1,a=!1,c=!1;switch(n.image_type){case e._TYPE_RLE_INDEXED:s=!0;case e._TYPE_INDEXED:a=!0;break;case e._TYPE_RLE_RGB:s=!0;case e._TYPE_RGB:break;case e._TYPE_RLE_GREY:s=!0;case e._TYPE_GREY:c=!0}var l,u,h,d,f,_,m,g=n.pixel_size>>3,v=n.width*n.height*g;if(a&&(l=i.subarray(r,r+=n.colormap_length*(n.colormap_size>>3))),s){var y,b,T;o=new Uint8Array(v);for(var E=0,x=new Uint8Array(g);r>e._ORIGIN_SHIFT){default:case e._ORIGIN_UL:u=0,d=1,m=n.width,h=0,f=1,_=n.height;break;case e._ORIGIN_BL:u=0,d=1,m=n.width,h=n.height-1,f=-1,_=-1;break;case e._ORIGIN_UR:u=n.width-1,d=-1,m=-1,h=0,f=1,_=n.height;break;case e._ORIGIN_BR:u=n.width-1,d=-1,m=-1,h=n.height-1,f=-1,_=-1}var A=e["_getImageData"+(c?"Grey":"")+n.pixel_size+"bits"](n,l,o,h,f,_,u,d,m);t.getEngine()._uploadDataToTextureDirectly(t,A)}}},e._getImageData8bits=function(e,t,i,r,n,o,s,a,c){var l,u,h,d=i,f=t,p=e.width,_=e.height,m=0,g=new Uint8Array(p*_*4);for(h=r;h!==o;h+=n)for(u=s;u!==c;u+=a,m++)l=d[m],g[4*(u+p*h)+3]=255,g[4*(u+p*h)+2]=f[3*l+0],g[4*(u+p*h)+1]=f[3*l+1],g[4*(u+p*h)+0]=f[3*l+2];return g},e._getImageData16bits=function(e,t,i,r,n,o,s,a,c){var l,u,h,d=i,f=e.width,p=e.height,_=0,m=new Uint8Array(f*p*4);for(h=r;h!==o;h+=n)for(u=s;u!==c;u+=a,_+=2){var g=255*((31744&(l=d[_+0]+(d[_+1]<<8)))>>10)/31|0,v=255*((992&l)>>5)/31|0,y=255*(31&l)/31|0;m[4*(u+f*h)+0]=g,m[4*(u+f*h)+1]=v,m[4*(u+f*h)+2]=y,m[4*(u+f*h)+3]=32768&l?0:255}return m},e._getImageData24bits=function(e,t,i,r,n,o,s,a,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=r;u!==o;u+=n)for(l=s;l!==c;l+=a,p+=3)_[4*(l+d*u)+3]=255,_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+1]=h[p+1],_[4*(l+d*u)+0]=h[p+2];return _},e._getImageData32bits=function(e,t,i,r,n,o,s,a,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=r;u!==o;u+=n)for(l=s;l!==c;l+=a,p+=4)_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+1]=h[p+1],_[4*(l+d*u)+0]=h[p+2],_[4*(l+d*u)+3]=h[p+3];return _},e._getImageDataGrey8bits=function(e,t,i,r,n,o,s,a,c){var l,u,h,d=i,f=e.width,p=e.height,_=0,m=new Uint8Array(f*p*4);for(h=r;h!==o;h+=n)for(u=s;u!==c;u+=a,_++)l=d[_],m[4*(u+f*h)+0]=l,m[4*(u+f*h)+1]=l,m[4*(u+f*h)+2]=l,m[4*(u+f*h)+3]=255;return m},e._getImageDataGrey16bits=function(e,t,i,r,n,o,s,a,c){var l,u,h=i,d=e.width,f=e.height,p=0,_=new Uint8Array(d*f*4);for(u=r;u!==o;u+=n)for(l=s;l!==c;l+=a,p+=2)_[4*(l+d*u)+0]=h[p+0],_[4*(l+d*u)+1]=h[p+0],_[4*(l+d*u)+2]=h[p+0],_[4*(l+d*u)+3]=h[p+1];return _},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}(),Vo=function(){function e(){this.supportCascades=!1}return e.prototype.canLoad=function(e,t,i,r,n){return 0===e.indexOf(".tga")},e.prototype.transformUrl=function(e,t){return e},e.prototype.getFallbackTextureUrl=function(e,t){return null},e.prototype.loadCubeData=function(e,t,i,r,n){throw".env not supported in Cube."},e.prototype.loadData=function(e,t,i){var r=new Uint8Array(e),n=Uo.GetTGAHeader(r);i(n.width,n.height,t.generateMipMaps,!1,function(){Uo.UploadContent(t,r)})},e}();_e.b._TextureLoaders.push(new Vo);var Go=function(e){function t(t,i,r,n,o){var s=this,a=!(!o||!o.generateMipMaps)&&o.generateMipMaps,c=!(!o||!o.generateDepthTexture)&&o.generateDepthTexture,l=!o||void 0===o.doNotChangeAspectRatio||o.doNotChangeAspectRatio;if((s=e.call(this,t,i,n,a,l)||this)._engine=n.getEngine(),s.isSupported){for(var u=[],h=[],d=0;d1||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}(wi),ko=function(){function e(e){this.name=Ee.a.NAME_PROCEDURALTEXTURE,this.scene=e,this.scene.proceduralTextures=new Array,e.layers=new Array}return e.prototype.register=function(){this.scene._beforeClearStage.registerStep(Ee.a.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){},e.prototype._beforeClear=function(){if(this.scene.proceduralTexturesEnabled){ve.h.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(var e=0;e0)}},e}(),zo="\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}";Ct.a.ShadersStore.proceduralVertexShader=zo;var jo=function(e){function t(t,i,r,o,s,a,c){void 0===s&&(s=null),void 0===a&&(a=!0),void 0===c&&(c=!1);var l=e.call(this,null,o,!a)||this;l.isCube=c,l.isEnabled=!0,l.autoClear=!0,l.onGeneratedObservable=new n.c,l._textures={},l._currentRefreshId=-1,l._refreshRate=1,l._vertexBuffers={},l._uniforms=new Array,l._samplers=new Array,l._floats={},l._ints={},l._floatsArrays={},l._colors3={},l._colors4={},l._vectors2={},l._vectors3={},l._matrices={},l._fallbackTextureUsed=!1,l._cachedDefines="",l._contentUpdateId=-1;var u=(o=l.getScene())._getComponent(Ee.a.NAME_PROCEDURALTEXTURE);u||(u=new ko(o),o._addComponent(u)),o.proceduralTextures.push(l),l._engine=o.getEngine(),l.name=t,l.isRenderTarget=!0,l._size=i,l._generateMipMaps=a,l.setFragment(r),l._fallbackTexture=s,c?(l._texture=l._engine.createRenderTargetCubeTexture(i,{generateMipMaps:a,generateDepthBuffer:!1,generateStencilBuffer:!1}),l.setFloat("face",0)):l._texture=l._engine.createRenderTargetTexture(i,{generateMipMaps:a,generateDepthBuffer:!1,generateStencilBuffer:!1});var h=[];return h.push(1,1),h.push(-1,1),h.push(-1,-1),h.push(1,-1),l._vertexBuffers[gi.b.PositionKind]=new gi.b(l._engine,h,gi.b.PositionKind,!1,!1,2),l._createIndexBuffer(),l}return l.d(t,e),t.prototype.getEffect=function(){return this._effect},t.prototype.getContent=function(){return this._contentData&&this._currentRefreshId==this._contentUpdateId?this._contentData:(this._contentData=this.readPixels(0,0,this._contentData),this._contentUpdateId=this._currentRefreshId,this._contentData)},t.prototype._createIndexBuffer=function(){var e=this._engine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)},t.prototype._rebuild=function(){var e=this._vertexBuffers[gi.b.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===wi.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=wi.REFRESHRATE_RENDER_ONCE)},t.prototype.reset=function(){void 0!==this._effect&&this._engine._releaseEffect(this._effect)},t.prototype._getDefines=function(){return""},t.prototype.isReady=function(){var e,t=this,i=this._engine;if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;var r=this._getDefines();return!(!this._effect||r!==this._cachedDefines||!this._effect.isReady())||(e=void 0!==this._fragment.fragmentElement?{vertex:"procedural",fragmentElement:this._fragment.fragmentElement}:{vertex:"procedural",fragment:this._fragment},this._cachedDefines=r,this._effect=i.createEffect(e,[gi.b.PositionKind],this._uniforms,this._samplers,r,void 0,void 0,function(){t.releaseInternalTexture(),t._fallbackTexture&&(t._texture=t._fallbackTexture._texture,t._texture&&t._texture.incrementReferences()),t._fallbackTextureUsed=!0}),this._effect.isReady())},t.prototype.resetRefreshCounter=function(){this._currentRefreshId=-1},t.prototype.setFragment=function(e){this._fragment=e},Object.defineProperty(t.prototype,"refreshRate",{get:function(){return this._refreshRate},set:function(e){this._refreshRate=e,this.resetRefreshCounter()},enumerable:!0,configurable:!0}),t.prototype._shouldRender=function(){return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId?(this._currentRefreshId=1,!0):this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1)):(this._texture&&(this._texture.isReady=!1),!1)},t.prototype.getRenderSize=function(){return this._size},t.prototype.resize=function(e,t){this._fallbackTextureUsed||(this.releaseInternalTexture(),this._texture=this._engine.createRenderTargetTexture(e,t),this._size=e,this._generateMipMaps=t)},t.prototype._checkUniform=function(e){-1===this._uniforms.indexOf(e)&&this._uniforms.push(e)},t.prototype.setTexture=function(e,t){return-1===this._samplers.indexOf(e)&&this._samplers.push(e),this._textures[e]=t,this},t.prototype.setFloat=function(e,t){return this._checkUniform(e),this._floats[e]=t,this},t.prototype.setInt=function(e,t){return this._checkUniform(e),this._ints[e]=t,this},t.prototype.setFloats=function(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this},t.prototype.setColor3=function(e,t){return this._checkUniform(e),this._colors3[e]=t,this},t.prototype.setColor4=function(e,t){return this._checkUniform(e),this._colors4[e]=t,this},t.prototype.setVector2=function(e,t){return this._checkUniform(e),this._vectors2[e]=t,this},t.prototype.setVector3=function(e,t){return this._checkUniform(e),this._vectors3[e]=t,this},t.prototype.setMatrix=function(e,t){return this._checkUniform(e),this._matrices[e]=t,this},t.prototype.render=function(e){var t=this.getScene();if(t){var i=this._engine;for(var r in i.enableEffect(this._effect),i.setState(!1),this._textures)this._effect.setTexture(r,this._textures[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._colors4){var n=this._colors4[r];this._effect.setFloat4(r,n.r,n.g,n.b,n.a)}for(r in this._vectors2)this._effect.setVector2(r,this._vectors2[r]);for(r in this._vectors3)this._effect.setVector3(r,this._vectors3[r]);for(r in this._matrices)this._effect.setMatrix(r,this._matrices[r]);if(this._texture){if(this.isCube)for(var o=0;o<6;o++)i.bindFramebuffer(this._texture,o,void 0,void 0,!0),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this._effect.setFloat("face",o),this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(Tn.a.TriangleFillMode,0,6),5===o&&i.generateMipMapsForCubemap(this._texture);else i.bindFramebuffer(this._texture,0,void 0,void 0,!0),i.bindBuffers(this._vertexBuffers,this._indexBuffer,this._effect),this.autoClear&&i.clear(t.clearColor,!0,!1,!1),i.drawElementsType(Tn.a.TriangleFillMode,0,6);i.unBindFramebuffer(this._texture,this.isCube),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}}},t.prototype.clone=function(){var e=this.getSize(),i=new t(this.name,e.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return i.hasAlpha=this.hasAlpha,i.level=this.level,i.coordinatesMode=this.coordinatesMode,i},t.prototype.dispose=function(){var t=this.getScene();if(t){var i=t.proceduralTextures.indexOf(this);i>=0&&t.proceduralTextures.splice(i,1);var r=this._vertexBuffers[gi.b.PositionKind];r&&(r.dispose(),this._vertexBuffers[gi.b.PositionKind]=null),this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),e.prototype.dispose.call(this)}},l.c([Object(w.c)()],t.prototype,"isEnabled",void 0),l.c([Object(w.c)()],t.prototype,"autoClear",void 0),l.c([Object(w.c)()],t.prototype,"_generateMipMaps",void 0),l.c([Object(w.c)()],t.prototype,"_size",void 0),l.c([Object(w.c)()],t.prototype,"refreshRate",null),t}(Ge.a),Wo=function(e){function t(t,i,r,n,o,s){var a=e.call(this,t,r,null,n,o,s)||this;return a._animate=!0,a._time=0,a._texturePath=i,a._loadJson(i),a.refreshRate=1,a}return l.d(t,e),t.prototype._loadJson=function(e){var t=this,i=function(){p.a.Log("No config file found in "+e+" trying to use ShadersStore or DOM element");try{t.setFragment(t._texturePath)}catch(e){p.a.Error("No json or ShaderStore or DOM element found for CustomProceduralTexture")}},r=e+"/config.json",n=new XMLHttpRequest;n.open("GET",r,!0),n.addEventListener("load",function(){if(200===n.status||n.responseText&&n.responseText.length>0)try{t._config=JSON.parse(n.response),t.updateShaderUniforms(),t.updateTextures(),t.setFragment(t._texturePath+"/custom"),t._animate=t._config.animate,t.refreshRate=t._config.refreshrate}catch(e){i()}else i()},!1),n.addEventListener("error",function(){i()},!1);try{ve.h.UseCustomRequestHeaders&&ve.h.InjectCustomRequestHeaders(n),n.send()}catch(e){p.a.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 i=this.getScene();this._animate&&i&&(this._time+=.03*i.getAnimationRatio(),this.updateShaderUniforms()),e.prototype.render.call(this,t)},t.prototype.updateTextures=function(){for(var e=0;ee.EPSILON?1:0;l|=h,u.push(h)}switch(l){case 0:(o.x.Dot(this.normal,t.plane.normal)>0?i:r).push(t);break;case 1:n.push(t);break;case 2:s.push(t);break;case 3:var d,f=[],p=[];for(a=0;a=3&&(d=new is(f,t.shared)).plane&&n.push(d),p.length>=3&&(d=new is(p,t.shared)).plane&&s.push(d)}},e.EPSILON=1e-5,e}(),is=function(){function e(e,t){this.vertices=e,this.shared=t,this.plane=ts.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}(),rs=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;eo?o:Math.floor(s);var a,c,l,u,h=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE,d=e.uvs,f=e.colors,p=[],_=[],m=[],g=[],v=[],y=[],b=[],T=[],E=[],x=[];if(t.length<2){var A=[],P=[];for(l=0;l0&&(C=R[u].subtract(R[u-1]).length()+b[c],v[c].push(C),b[c]=C),u++;r&&(u--,p.push(R[0].x,R[0].y,R[0].z),C=R[u].subtract(R[0]).length()+b[c],v[c].push(C),b[c]=C),E[c]=S+D,x[c]=I,I+=S+D}var w,L,F=null,N=null;for(l=0;l1)?1:e.arc||1,c=0===e.sideOrientation?0:e.sideOrientation||mi.a.DEFAULTSIDE;t.push(0,0,0),n.push(.5,.5);for(var l=2*Math.PI*a,u=l/s,h=0;ht.x&&(t.x=i.x),i.yt.y&&(t.y=i.y)}),{min:e,max:t,width:t.x-e.x,height:t.y-e.y}},e}(),ds=function(){function e(){}return e.Rectangle=function(e,t,i,r){return[new o.w(e,t),new o.w(i,t),new o.w(i,r),new o.w(e,r)]},e.Circle=function(e,t,i,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=32);for(var n=new Array,s=0,a=2*Math.PI/r,c=0;c0){var h=o.length/3;this._points.elements.forEach(function(e){n.push(0,-1,0),o.push(e.x,-t,e.y),s.push(1-(e.x-a.min.x)/a.width,1-(e.y-a.min.y)/a.height)});var d=c.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.x(f.x,0,f.y),_=new o.x(d.x,0,d.y).subtract(p),m=new o.x(0,1,0),g=o.x.Cross(_,m);g=g.normalize(),i.push(u/n.width,0),i.push(u/n.width,1),u+=_.length(),i.push(u/n.width,0),i.push(u/n.width,1),c?(t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),t.push(g.x,g.y,g.z),r.push(l),r.push(l+2),r.push(l+1),r.push(l+1),r.push(l+2),r.push(l+3)):(t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),t.push(-g.x,-g.y,-g.z),r.push(l),r.push(l+1),r.push(l+2),r.push(l+1),r.push(l+3),r.push(l+2)),l+=4}},e}();mi.a.CreatePolygon=function(e,t,i,r,n,s){for(var a=i||new Array(3),c=r,l=[],u=0;u<3;u++)void 0===a[u]&&(a[u]=new o.y(0,0,1,1)),c&&void 0===c[u]&&(c[u]=new o.f(1,1,1,1));for(var h=e.getVerticesData(gi.b.PositionKind),d=e.getVerticesData(gi.b.NormalKind),f=e.getVerticesData(gi.b.UVKind),p=e.getIndices(),_=0,m=0,g=0;g3?0:u,h);var x=as.CreateRibbon(e,{pathArray:b,closeArray:c,closePath:l,updatable:f,sideOrientation:p,invertUV:m,frontUVs:g||void 0,backUVs:v||void 0},d);return x._creationDataStorage.pathArray=b,x._creationDataStorage.path3D=y,x._creationDataStorage.cap=u,x},e}();de.a.CreateLathe=function(e,t,i,r,n,o,s){var a={shape:t,radius:i,tessellation:r,sideOrientation:s,updatable:o};return ms.CreateLathe(e,a,n)};var ms=function(){function e(){}return e.CreateLathe=function(e,t,i){var r,n=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,s=void 0===t.closed||t.closed,a=t.shape,c=t.radius||1,l=t.tessellation||64,u=t.clip||0,h=t.updatable,d=de.a._GetDefaultSideOrientation(t.sideOrientation),f=t.cap||de.a.NO_CAP,p=2*Math.PI,_=new Array,m=t.invertUV||!1,g=0,v=0,y=p/l*n,b=new Array;for(g=0;g<=l-u;g++){b=[];for(f!=de.a.CAP_START&&f!=de.a.CAP_ALL||(b.push(new o.x(0,a[0].y,0)),b.push(new o.x(Math.cos(g*y)*a[0].x*c,a[0].y,Math.sin(g*y)*a[0].x*c))),v=0;v1)?1:t.arc||1;var f,p,_=function(e,t,i,r,n,s,a,c){for(var l,u,h,d,f=t.getTangents(),p=t.getNormals(),_=t.getDistances(),m=2*Math.PI/n*c,g=s||function(){return r},v=o.t.Matrix[0],y=a===de.a.NO_CAP||a===de.a.CAP_END?0:2,b=0;b3?0:l,t.arc);var v=as.CreateRibbon(e,{pathArray:p,closePath:!0,closeArray:!1,updatable:h,sideOrientation:d,invertUV:u,frontUVs:t.frontUVs,backUVs:t.backUVs},i);return v._creationDataStorage.pathArray=p,v._creationDataStorage.path3D=f,v._creationDataStorage.tessellation=a,v._creationDataStorage.cap=l,v._creationDataStorage.arc=t.arc,v._creationDataStorage.radius=s,v},e}();mi.a.CreateIcoSphere=function(e){var t,i=e.sideOrientation||mi.a.DEFAULTSIDE,r=e.radius||1,n=void 0===e.flat||e.flat,s=e.subdivisions||4,a=e.radiusX||r,c=e.radiusY||r,l=e.radiusZ||r,u=(1+Math.sqrt(5))/2,h=[-1,u,-0,1,u,0,-1,-u,0,1,-u,0,0,-1,-u,0,1,-u,0,-1,u,0,1,u,u,0,1,u,0,-1,-u,0,1,-u,0,-1],d=[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],f=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],p=[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],_=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],m=new Array,g=new Array,v=new Array,y=new Array,b=0,T=new Array(3),E=new Array(3);for(t=0;t<3;t++)T[t]=o.x.Zero(),E[t]=o.w.Zero();for(var x=0;x<20;x++){for(t=0;t<3;t++){var A=d[3*x+t];T[t].copyFromFloats(h[3*f[A]],h[3*f[A]+1],h[3*f[A]+2]),T[t].normalize().scaleInPlace(r),E[t].copyFromFloats(p[2*A]*(138/1024)+60/1024+_[x]*(-40/1024),p[2*A+1]*(239/1024)+26/1024+_[x]*(20/1024))}for(var P=function(e,t,i,r){var u,h=o.x.Lerp(T[0],T[2],t/s),d=o.x.Lerp(T[1],T[2],t/s),f=s===t?T[2]:o.x.Lerp(h,d,e/(s-t));if(f.normalize(),n){var p=o.x.Lerp(T[0],T[2],r/s),_=o.x.Lerp(T[1],T[2],r/s);u=o.x.Lerp(p,_,i/(s-r))}else u=new o.x(f.x,f.y,f.z);u.x/=a,u.y/=c,u.z/=l,u.normalize();var x=o.w.Lerp(E[0],E[2],t/s),A=o.w.Lerp(E[1],E[2],t/s),P=s===t?E[2]:o.w.Lerp(x,A,e/(s-t));g.push(f.x*a,f.y*c,f.z*l),v.push(u.x,u.y,u.z),y.push(P.x,P.y),m.push(b),b++},R=0;R0)?1:0)+((c=o.x.Dot(e[s+1].position,t)-i>0)?1:0)+((u=o.x.Dot(e[s+2].position,t)-i>0)?1:0)){case 0:n.push(e[s]),n.push(e[s+1]),n.push(e[s+2]);break;case 1:if(a&&(h=e[s+1],d=e[s+2],f=r(e[s],h),p=r(e[s],d)),c){h=e[s],d=e[s+2],f=r(e[s+1],h),p=r(e[s+1],d),n.push(f),n.push(d.clone()),n.push(h.clone()),n.push(d.clone()),n.push(f.clone()),n.push(p);break}u&&(h=e[s],d=e[s+1],f=r(e[s+2],h),p=r(e[s+2],d)),h&&d&&f&&p&&(n.push(h.clone()),n.push(d.clone()),n.push(f),n.push(p),n.push(f.clone()),n.push(d.clone()));break;case 2:a||(d=r(h=e[s].clone(),e[s+1]),f=r(h,e[s+2]),n.push(h),n.push(d),n.push(f)),c||(d=r(h=e[s+1].clone(),e[s+2]),f=r(h,e[s]),n.push(h),n.push(d),n.push(f)),u||(d=r(h=e[s+2].clone(),e[s]),f=r(h,e[s+1]),n.push(h),n.push(d),n.push(f))}}return n},A=0;Ac||i.deleted||i.isDirty))for(var n=0;n<3;++n)if(i.error[n]>0,function(e){if(n){var t=e+a.verticesStart,s=o.x.FromArray(n,3*t),l=function(e){if(i)for(var t=0;t0&&this._reconstructedMesh.setVerticesData(gi.b.UVKind,a),c.length>0&&this._reconstructedMesh.setVerticesData(gi.b.ColorKind,c);var y=this._mesh.subMeshes[e];e>0&&(this._reconstructedMesh.subMeshes=[],m.forEach(function(e){Jo.b.AddToMesh(e.materialIndex,e.verticesStart,e.verticesCount,e.indexStart,e.indexCount,e.getMesh())}),Jo.b.AddToMesh(y.materialIndex,_,d,p,3*n.length,this._reconstructedMesh))},e.prototype.initDecimatedMesh=function(){this._reconstructedMesh=new de.a(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,i,r,n){for(var s=0;s.999)return!0;var f=o.x.Cross(h,d).normalize();if(r[s]=!1,o.x.Dot(f,a.normal)<.2)return!0}else r[s]=!0,n.push(a)}}return!1},e.prototype.updateTriangles=function(e,t,i,r){for(var n=r,o=0;o=400&&o?o(l):i()},!1),l.addEventListener("error",function(){p.a.Error("error on XHR request."),i()},!1),ve.h.UseCustomRequestHeaders&&ve.h.InjectCustomRequestHeaders(l),l.send()}else p.a.Error("Error: IndexedDB not supported by your browser or Babylon.js Database is not open."),i()},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 i=Uo.GetTGAHeader(e.response);if(i.width&&i.height&&i.width>0&&i.height>0)return!0;if(2===t)return!1}if(4&t){var r=new Uint8Array(e.response,0,3);return 68===r[0]&&68===r[1]&&83===r[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("#")),i=e.substring(t.lastIndexOf("/")+1,e.length);return e.substring(0,e.indexOf(i,0))},e._ReturnFullUrlLocation=function(t){return-1===t.indexOf("http:/")&&-1===t.indexOf("https:/")?e._ParseURL(window.location.href)+t:t},e}(),Ds=function(){function e(){this.direction1=new o.x(0,1,0),this.direction2=new o.x(0,1,0),this.minEmitBox=new o.x(-.5,-.5,-.5),this.maxEmitBox=new o.x(.5,.5,.5)}return e.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=D.a.RandomRange(this.minEmitBox.x,this.maxEmitBox.x),n=D.a.RandomRange(this.minEmitBox.y,this.maxEmitBox.y),s=D.a.RandomRange(this.minEmitBox.z,this.maxEmitBox.z);o.x.TransformCoordinatesFromFloatsToRef(r,n,s,e,t)},e.prototype.clone=function(){var t=new e;return S.a.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){o.x.FromArrayToRef(e.direction1,0,this.direction1),o.x.FromArrayToRef(e.direction2,0,this.direction2),o.x.FromArrayToRef(e.minEmitBox,0,this.minEmitBox),o.x.FromArrayToRef(e.maxEmitBox,0,this.maxEmitBox)},e}(),ws=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=Math.PI),void 0===i&&(i=0),this.directionRandomizer=i,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,i){if(1===Math.abs(Math.cos(this._angle)))o.x.TransformNormalFromFloatsToRef(0,1,0,e,t);else{var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(0,this.directionRandomizer),s=D.a.RandomRange(0,this.directionRandomizer),a=D.a.RandomRange(0,this.directionRandomizer);r.x+=n,r.y+=s,r.z+=a,r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)}},e.prototype.startPositionFunction=function(e,t,i){var r,n=D.a.RandomRange(0,2*Math.PI);r=this.emitFromSpawnPointOnly?1e-4:1-(r=D.a.RandomRange(0,this.heightRange))*r;var s=this._radius-D.a.RandomRange(0,this._radius*this.radiusRange),a=(s*=r)*Math.sin(n),c=s*Math.cos(n),l=r*this._height;o.x.TransformCoordinatesFromFloatsToRef(a,l,c,e,t)},e.prototype.clone=function(){var t=new e(this._radius,this._angle,this.directionRandomizer);return S.a.DeepCopy(this,t),t},e.prototype.applyToShader=function(e){e.setFloat2("radius",this._radius,this.radiusRange),e.setFloat("coneAngle",this._angle),e.setFloat2("height",this._height,this.heightRange),e.setFloat("directionRandomizer",this.directionRandomizer)},e.prototype.getEffectDefines=function(){var e="#define CONEEMITTER";return this.emitFromSpawnPointOnly&&(e+="\n#define CONEEMITTERSPAWNPOINT"),e},e.prototype.getClassName=function(){return"ConeParticleEmitter"},e.prototype.serialize=function(){var e={};return e.type=this.getClassName(),e.radius=this._radius,e.angle=this._angle,e.directionRandomizer=this.directionRandomizer,e},e.prototype.parse=function(e){this.radius=e.radius,this.angle=e.angle,this.directionRandomizer=e.directionRandomizer},e}(),Ls=function(){function e(e,t,i,r){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=1),void 0===r&&(r=0),this.radius=e,this.height=t,this.radiusRange=i,this.directionRandomizer=r}return e.prototype.startDirectionFunction=function(e,t,i){var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(-this.directionRandomizer/2,this.directionRandomizer/2),s=Math.atan2(r.x,r.z);s+=D.a.RandomRange(-Math.PI/2,Math.PI/2)*this.directionRandomizer,r.y=n,r.x=Math.sin(s),r.z=Math.cos(s),r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=D.a.RandomRange(-this.height/2,this.height/2),n=D.a.RandomRange(0,2*Math.PI),s=D.a.RandomRange((1-this.radiusRange)*(1-this.radiusRange),1),a=Math.sqrt(s)*this.radius,c=a*Math.cos(n),l=a*Math.sin(n);o.x.TransformCoordinatesFromFloatsToRef(c,r,l,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return S.a.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}(),Fs=function(e){function t(t,i,r,n,s){void 0===t&&(t=1),void 0===i&&(i=1),void 0===r&&(r=1),void 0===n&&(n=new o.x(0,1,0)),void 0===s&&(s=new o.x(0,1,0));var a=e.call(this,t,i,r)||this;return a.direction1=n,a.direction2=s,a}return l.d(t,e),t.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.height,this.radiusRange,this.direction1,this.direction2);return S.a.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}(Ls),Ns=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=i}return e.prototype.startDirectionFunction=function(e,t,i){var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(0,this.directionRandomizer),s=D.a.RandomRange(0,this.directionRandomizer),a=D.a.RandomRange(0,this.directionRandomizer);r.x+=n,r.y+=s,r.z+=a,r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=this.radius-D.a.RandomRange(0,this.radius*this.radiusRange),n=D.a.RandomRange(0,1),s=D.a.RandomRange(0,2*Math.PI),a=Math.acos(2*n-1),c=r*Math.cos(s)*Math.sin(a),l=r*Math.cos(a),u=r*Math.sin(s)*Math.sin(a);o.x.TransformCoordinatesFromFloatsToRef(c,Math.abs(l),u,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return S.a.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}(),Bs=function(){function e(){this.direction1=new o.x(0,1,0),this.direction2=new o.x(0,1,0)}return e.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},e.prototype.startPositionFunction=function(e,t,i){o.x.TransformCoordinatesFromFloatsToRef(0,0,0,e,t)},e.prototype.clone=function(){var t=new e;return S.a.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){o.x.FromArrayToRef(e.direction1,0,this.direction1),o.x.FromArrayToRef(e.direction2,0,this.direction2)},e}(),Us=function(){function e(e,t,i){void 0===e&&(e=1),void 0===t&&(t=1),void 0===i&&(i=0),this.radius=e,this.radiusRange=t,this.directionRandomizer=i}return e.prototype.startDirectionFunction=function(e,t,i){var r=i.position.subtract(e.getTranslation()).normalize(),n=D.a.RandomRange(0,this.directionRandomizer),s=D.a.RandomRange(0,this.directionRandomizer),a=D.a.RandomRange(0,this.directionRandomizer);r.x+=n,r.y+=s,r.z+=a,r.normalize(),o.x.TransformNormalFromFloatsToRef(r.x,r.y,r.z,e,t)},e.prototype.startPositionFunction=function(e,t,i){var r=this.radius-D.a.RandomRange(0,this.radius*this.radiusRange),n=D.a.RandomRange(0,1),s=D.a.RandomRange(0,2*Math.PI),a=Math.acos(2*n-1),c=r*Math.cos(s)*Math.sin(a),l=r*Math.cos(a),u=r*Math.sin(s)*Math.sin(a);o.x.TransformCoordinatesFromFloatsToRef(c,l,u,e,t)},e.prototype.clone=function(){var t=new e(this.radius,this.directionRandomizer);return S.a.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}(),Vs=function(e){function t(t,i,r){void 0===t&&(t=1),void 0===i&&(i=new o.x(0,1,0)),void 0===r&&(r=new o.x(0,1,0));var n=e.call(this,t)||this;return n.direction1=i,n.direction2=r,n}return l.d(t,e),t.prototype.startDirectionFunction=function(e,t,i){var r=D.a.RandomRange(this.direction1.x,this.direction2.x),n=D.a.RandomRange(this.direction1.y,this.direction2.y),s=D.a.RandomRange(this.direction1.z,this.direction2.z);o.x.TransformNormalFromFloatsToRef(r,n,s,e,t)},t.prototype.clone=function(){var e=new t(this.radius,this.direction1,this.direction2);return S.a.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}(Us),Gs=function(){function e(t){this.animations=[],this.renderingGroupId=0,this.emitter=null,this.emitRate=10,this.manualEmitCount=-1,this.updateSpeed=.01,this.targetStopDuration=0,this.disposeOnStop=!1,this.minEmitPower=1,this.maxEmitPower=1,this.minLifeTime=1,this.maxLifeTime=1,this.minSize=1,this.maxSize=1,this.minScaleX=1,this.maxScaleX=1,this.minScaleY=1,this.maxScaleY=1,this.minInitialRotation=0,this.maxInitialRotation=0,this.minAngularSpeed=0,this.maxAngularSpeed=0,this.layerMask=268435455,this.customShader=null,this.preventAutoStart=!1,this.noiseStrength=new o.x(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 o.w(0,0),this.beginAnimationOnStart=!1,this.beginAnimationFrom=0,this.beginAnimationTo=60,this.beginAnimationLoop=!1,this.gravity=o.x.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 o.f(1,1,1,1),this.color2=new o.f(1,1,1,1),this.colorDead=new o.f(0,0,0,1),this.textureMask=new o.f(1,1,1,1),this._isSubEmitter=!1,this.billboardMode=_.a.PARTICLES_BILLBOARDMODE_ALL,this._isBillboardBased=!0,this._imageProcessingConfigurationDefines=new hi.b,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:o.x.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:o.x.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:o.x.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:o.x.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,i){if(!t)return this;for(var r=0,n=0,o=t;n0&&this._attachedSubEmitters.forEach(function(t){e._inheritParticleInfoToSubEmitter(t)})},e.prototype._reset=function(){this.age=0,this._currentColorGradient=null,this._currentSizeGradient=null,this._currentAngularSpeedGradient=null,this._currentVelocityGradient=null,this._currentLimitVelocityGradient=null,this._currentDragGradient=null,this.cellIndex=this.particleSystem.startSpriteCellID,this._randomCellOffset=void 0},e.prototype.copyTo=function(e){e.position.copyFrom(this.position),this._initialDirection?e._initialDirection?e._initialDirection.copyFrom(this._initialDirection):e._initialDirection=this._initialDirection.clone():e._initialDirection=null,e.direction.copyFrom(this.direction),e.color.copyFrom(this.color),e.colorStep.copyFrom(this.colorStep),e.lifeTime=this.lifeTime,e.age=this.age,e._randomCellOffset=this._randomCellOffset,e.size=this.size,e.scale.copyFrom(this.scale),e.angle=this.angle,e.angularSpeed=this.angularSpeed,e.particleSystem=this.particleSystem,e.cellIndex=this.cellIndex,e.id=this.id,e._attachedSubEmitters=this._attachedSubEmitters,this._currentColorGradient&&(e._currentColorGradient=this._currentColorGradient,e._currentColor1.copyFrom(this._currentColor1),e._currentColor2.copyFrom(this._currentColor2)),this._currentSizeGradient&&(e._currentSizeGradient=this._currentSizeGradient,e._currentSize1=this._currentSize1,e._currentSize2=this._currentSize2),this._currentAngularSpeedGradient&&(e._currentAngularSpeedGradient=this._currentAngularSpeedGradient,e._currentAngularSpeed1=this._currentAngularSpeed1,e._currentAngularSpeed2=this._currentAngularSpeed2),this._currentVelocityGradient&&(e._currentVelocityGradient=this._currentVelocityGradient,e._currentVelocity1=this._currentVelocity1,e._currentVelocity2=this._currentVelocity2),this._currentLimitVelocityGradient&&(e._currentLimitVelocityGradient=this._currentLimitVelocityGradient,e._currentLimitVelocity1=this._currentLimitVelocity1,e._currentLimitVelocity2=this._currentLimitVelocity2),this._currentDragGradient&&(e._currentDragGradient=this._currentDragGradient,e._currentDrag1=this._currentDrag1,e._currentDrag2=this._currentDrag2),this.particleSystem.isAnimationSheetEnabled&&(e._initialStartSpriteCellID=this._initialStartSpriteCellID,e._initialEndSpriteCellID=this._initialEndSpriteCellID),this.particleSystem.useRampGradients&&e.remapData.copyFrom(this.remapData),this._randomNoiseCoordinates1&&(e._randomNoiseCoordinates1?(e._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1),e._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)):(e._randomNoiseCoordinates1=this._randomNoiseCoordinates1.clone(),e._randomNoiseCoordinates2=this._randomNoiseCoordinates2.clone()))},e._Count=0,e}();!function(e){e[e.ATTACHED=0]="ATTACHED",e[e.END=1]="END"}(Os||(Os={}));var zs=function(){function e(e){this.particleSystem=e,this.type=Os.END,this.inheritDirection=!1,this.inheritedVelocityAmount=0,e.emitter&&e.emitter.dispose||(e.emitter=new Le.a("SubemitterSystemEmitter",e.getScene())),e.onDisposeObservable.add(function(){e.emitter&&e.emitter.dispose&&e.emitter.dispose()})}return e.prototype.clone=function(){var t=this.particleSystem.emitter;t?t instanceof o.x?t=t.clone():t instanceof Le.a&&((t=new de.a("",t.getScene())).isVisible=!1):t=new o.x;var i=new e(this.particleSystem.clone("",t));return i.type=this.type,i.inheritDirection=this.inheritDirection,i.inheritedVelocityAmount=this.inheritedVelocityAmount,i.particleSystem._disposeEmitterOnDispose=!0,i.particleSystem.disposeOnStop=!0,i},e.prototype.serialize=function(){var e={};return e.type=this.type,e.inheritDirection=this.inheritDirection,e.inheritedVelocityAmount=this.inheritedVelocityAmount,e.particleSystem=this.particleSystem.serialize(),e},e._ParseParticleSystem=function(e,t,i){throw ye.a.WarnImport("ParseParticle")},e.Parse=function(t,i,r){var n=t.particleSystem,o=new e(e._ParseParticleSystem(n,i,r));return o.type=t.type,o.inheritDirection=t.inheritDirection,o.inheritedVelocityAmount=t.inheritedVelocityAmount,o.particleSystem._isSubEmitter=!0,o},e.prototype.dispose=function(){this.particleSystem.dispose()},e}(),js="\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#include\n#include\n#include\n#include\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\nuniform sampler2D rampSampler;\n#endif\nvoid main(void) {\n#include\nvec4 textureColor=texture2D(diffuseSampler,vUV);\nvec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;\nfloat remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);\nvec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));\nbaseColor.rgb*=rampColor.rgb;\n\nfloat finalAlpha=baseColor.a;\nbaseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;\nbaseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\nbaseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n}";Ct.a.ShadersStore.particlesPixelShader=js;var Ws="\nattribute vec3 position;\nattribute vec4 color;\nattribute float angle;\nattribute vec2 size;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD\nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;\n\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n#ifdef ANIMATESHEET\nuniform vec3 particlesInfos;\n#endif\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nuniform mat4 invView;\n#endif\n#include\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#endif\nvoid main(void) {\nvec2 cornerPos;\ncornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n#ifdef BILLBOARD\n\nvec3 rotatedCorner;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvec3 worldPos=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition;\nvec3 worldPos=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(worldPos,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\n\ngl_Position=projection*vec4(viewPos,1.0);\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=normalize(direction);\nvec3 worldPos=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(worldPos,1.0);\n#endif\nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/particlesInfos.z);\nfloat columnOffset=cellIndex-rowOffset*particlesInfos.z;\nvec2 uvScale=particlesInfos.xy;\nvec2 uvOffset=vec2(offset.x ,1.0-offset.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4)\nvec4 worldPos=invView*vec4(viewPos,1.0);\n#endif\n#include\n}";Ct.a.ShadersStore.particlesVertexShader=Ws;var Hs=function(e){function t(t,i,r,s,a,c){void 0===s&&(s=null),void 0===a&&(a=!1),void 0===c&&(c=.01);var l=e.call(this,t)||this;return l._inheritedVelocityOffset=new o.x,l.onDisposeObservable=new n.c,l._particles=new Array,l._stockParticles=new Array,l._newPartsExcess=0,l._vertexBuffers={},l._scaledColorStep=new o.f(0,0,0,0),l._colorDiff=new o.f(0,0,0,0),l._scaledDirection=o.x.Zero(),l._scaledGravity=o.x.Zero(),l._currentRenderId=-1,l._useInstancing=!1,l._started=!1,l._stopped=!1,l._actualFrame=0,l._currentEmitRate1=0,l._currentEmitRate2=0,l._currentStartSize1=0,l._currentStartSize2=0,l._rawTextureWidth=256,l._useRampGradients=!1,l._disposeEmitterOnDispose=!1,l.recycleParticle=function(e){var t=l._particles.pop();t!==e&&t.copyTo(e),l._stockParticles.push(t)},l._createParticle=function(){var e;if(0!==l._stockParticles.length?(e=l._stockParticles.pop())._reset():e=new ks(l),l._subEmitters&&l._subEmitters.length>0){var t=l._subEmitters[Math.floor(Math.random()*l._subEmitters.length)];e._attachedSubEmitters=[],t.forEach(function(t){if(t.type===Os.ATTACHED){var i=t.clone();e._attachedSubEmitters.push(i),i.particleSystem.start()}})}return e},l._emitFromParticle=function(e){if(l._subEmitters&&0!==l._subEmitters.length){var t=Math.floor(Math.random()*l._subEmitters.length);l._subEmitters[t].forEach(function(t){if(t.type===Os.END){var i=t.clone();e._inheritParticleInfoToSubEmitter(i),i.particleSystem._rootParticleSystem=l,l.activeSubSystems.push(i.particleSystem),i.particleSystem.start()}})}},l._capacity=i,l._epsilon=c,l._isAnimationSheetEnabled=a,l._scene=r||R.a.LastCreatedScene,l._attachImageProcessingConfiguration(null),l._customEffect=s,l._scene.particleSystems.push(l),l._useInstancing=l._scene.getEngine().getCaps().instancedArrays,l._createIndexBuffer(),l._createVertexBuffers(),l.particleEmitterType=new Ds,l.updateFunction=function(e){var t=null,i=null;l.noiseTexture&&(t=l.noiseTexture.getSize(),i=l.noiseTexture.getContent());for(var r,n=function(){r=e[s];var n=l._scaledUpdateSpeed,a=r.age;if(r.age+=n,r.age>r.lifeTime){var c=r.age-a;n=(r.lifeTime-a)*n/c,r.age=r.lifeTime}var u=r.age/r.lifeTime;l._colorGradients&&l._colorGradients.length>0?ve.h.GetCurrentGradient(u,l._colorGradients,function(e,t,i){e!==r._currentColorGradient&&(r._currentColor1.copyFrom(r._currentColor2),t.getColorToRef(r._currentColor2),r._currentColorGradient=e),o.f.LerpToRef(r._currentColor1,r._currentColor2,i,r.color)}):(r.colorStep.scaleToRef(n,l._scaledColorStep),r.color.addInPlace(l._scaledColorStep),r.color.a<0&&(r.color.a=0)),l._angularSpeedGradients&&l._angularSpeedGradients.length>0&&ve.h.GetCurrentGradient(u,l._angularSpeedGradients,function(e,t,i){e!==r._currentAngularSpeedGradient&&(r._currentAngularSpeed1=r._currentAngularSpeed2,r._currentAngularSpeed2=t.getFactor(),r._currentAngularSpeedGradient=e),r.angularSpeed=D.a.Lerp(r._currentAngularSpeed1,r._currentAngularSpeed2,i)}),r.angle+=r.angularSpeed*n;var h=n;if(l._velocityGradients&&l._velocityGradients.length>0&&ve.h.GetCurrentGradient(u,l._velocityGradients,function(e,t,i){e!==r._currentVelocityGradient&&(r._currentVelocity1=r._currentVelocity2,r._currentVelocity2=t.getFactor(),r._currentVelocityGradient=e),h*=D.a.Lerp(r._currentVelocity1,r._currentVelocity2,i)}),r.direction.scaleToRef(h,l._scaledDirection),l._limitVelocityGradients&&l._limitVelocityGradients.length>0&&ve.h.GetCurrentGradient(u,l._limitVelocityGradients,function(e,t,i){e!==r._currentLimitVelocityGradient&&(r._currentLimitVelocity1=r._currentLimitVelocity2,r._currentLimitVelocity2=t.getFactor(),r._currentLimitVelocityGradient=e);var n=D.a.Lerp(r._currentLimitVelocity1,r._currentLimitVelocity2,i);r.direction.length()>n&&r.direction.scaleInPlace(l.limitVelocityDamping)}),l._dragGradients&&l._dragGradients.length>0&&ve.h.GetCurrentGradient(u,l._dragGradients,function(e,t,i){e!==r._currentDragGradient&&(r._currentDrag1=r._currentDrag2,r._currentDrag2=t.getFactor(),r._currentDragGradient=e);var n=D.a.Lerp(r._currentDrag1,r._currentDrag2,i);l._scaledDirection.scaleInPlace(1-n)}),r.position.addInPlace(l._scaledDirection),i&&t&&r._randomNoiseCoordinates1){var d=l._fetchR(r._randomNoiseCoordinates1.x,r._randomNoiseCoordinates1.y,t.width,t.height,i),f=l._fetchR(r._randomNoiseCoordinates1.z,r._randomNoiseCoordinates2.x,t.width,t.height,i),p=l._fetchR(r._randomNoiseCoordinates2.y,r._randomNoiseCoordinates2.z,t.width,t.height,i),_=o.t.Vector3[0],m=o.t.Vector3[1];_.copyFromFloats((2*d-1)*l.noiseStrength.x,(2*f-1)*l.noiseStrength.y,(2*p-1)*l.noiseStrength.z),_.scaleToRef(n,m),r.direction.addInPlace(m)}if(l.gravity.scaleToRef(n,l._scaledGravity),r.direction.addInPlace(l._scaledGravity),l._sizeGradients&&l._sizeGradients.length>0&&ve.h.GetCurrentGradient(u,l._sizeGradients,function(e,t,i){e!==r._currentSizeGradient&&(r._currentSize1=r._currentSize2,r._currentSize2=t.getFactor(),r._currentSizeGradient=e),r.size=D.a.Lerp(r._currentSize1,r._currentSize2,i)}),l._useRampGradients&&(l._colorRemapGradients&&l._colorRemapGradients.length>0&&ve.h.GetCurrentGradient(u,l._colorRemapGradients,function(e,t,i){var n=D.a.Lerp(e.factor1,t.factor1,i),o=D.a.Lerp(e.factor2,t.factor2,i);r.remapData.x=n,r.remapData.y=o-n}),l._alphaRemapGradients&&l._alphaRemapGradients.length>0&&ve.h.GetCurrentGradient(u,l._alphaRemapGradients,function(e,t,i){var n=D.a.Lerp(e.factor1,t.factor1,i),o=D.a.Lerp(e.factor2,t.factor2,i);r.remapData.z=n,r.remapData.w=o-n})),l._isAnimationSheetEnabled&&r.updateCellIndex(),r._inheritParticleInfoToSubEmitters(),r.age>=r.lifeTime)return l._emitFromParticle(r),r._attachedSubEmitters&&(r._attachedSubEmitters.forEach(function(e){e.particleSystem.disposeOnStop=!0,e.particleSystem.stop()}),r._attachedSubEmitters=null),l.recycleParticle(r),s--,"continue"},s=0;st.gradient?1:0})},t.prototype._removeFactorGradient=function(e,t){if(e)for(var i=0,r=0,n=e;rt.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,i){this._colorGradients||(this._colorGradients=[]);var r=new ve.c;return r.gradient=e,r.color1=t,r.color2=i,this._colorGradients.push(r),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,i=0,r=this._colorGradients;i0&&(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 Le.a&&this.emitter.computeWorldMatrix(!0);var i=this.noiseTexture;if(i&&i.onGeneratedObservable)i.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,i,r,n){var o=e*this._vertexBufferSize;this._vertexData[o++]=i.position.x,this._vertexData[o++]=i.position.y,this._vertexData[o++]=i.position.z,this._vertexData[o++]=i.color.r,this._vertexData[o++]=i.color.g,this._vertexData[o++]=i.color.b,this._vertexData[o++]=i.color.a,this._vertexData[o++]=i.angle,this._vertexData[o++]=i.scale.x*i.size,this._vertexData[o++]=i.scale.y*i.size,this._isAnimationSheetEnabled&&(this._vertexData[o++]=i.cellIndex),this._isBillboardBased?this.billboardMode===t.BILLBOARDMODE_STRETCHED&&(this._vertexData[o++]=i.direction.x,this._vertexData[o++]=i.direction.y,this._vertexData[o++]=i.direction.z):i._initialDirection?(this._vertexData[o++]=i._initialDirection.x,this._vertexData[o++]=i._initialDirection.y,this._vertexData[o++]=i._initialDirection.z):(this._vertexData[o++]=i.direction.x,this._vertexData[o++]=i.direction.y,this._vertexData[o++]=i.direction.z),this._useRampGradients&&(this._vertexData[o++]=i.remapData.x,this._vertexData[o++]=i.remapData.y,this._vertexData[o++]=i.remapData.z,this._vertexData[o++]=i.remapData.w),this._useInstancing||(this._isAnimationSheetEnabled&&(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++]=r,this._vertexData[o++]=n)},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,i=this;if(this._alive=this._particles.length>0,this.emitter.position){var r=this.emitter;this._emitterWorldMatrix=r.getWorldMatrix()}else{var n=this.emitter;this._emitterWorldMatrix=o.j.Translation(n.x,n.y,n.z)}this.updateFunction(this._particles);for(var s,a=function(){if(c._particles.length===c._capacity)return"break";t=c._createParticle(),c._particles.push(t);var e=D.a.RandomRange(c.minEmitPower,c.maxEmitPower);if(c.startPositionFunction?c.startPositionFunction(c._emitterWorldMatrix,t.position,t):c.particleEmitterType.startPositionFunction(c._emitterWorldMatrix,t.position,t),c.startDirectionFunction?c.startDirectionFunction(c._emitterWorldMatrix,t.direction,t):c.particleEmitterType.startDirectionFunction(c._emitterWorldMatrix,t.direction,t),0===e?t._initialDirection?t._initialDirection.copyFrom(t.direction):t._initialDirection=t.direction.clone():t._initialDirection=null,t.direction.scaleInPlace(e),c.targetStopDuration&&c._lifeTimeGradients&&c._lifeTimeGradients.length>0){var r=D.a.Clamp(c._actualFrame/c.targetStopDuration);ve.h.GetCurrentGradient(r,c._lifeTimeGradients,function(e,i){var n=e,o=i,s=n.getFactor(),a=o.getFactor(),c=(r-n.gradient)/(o.gradient-n.gradient);t.lifeTime=D.a.Lerp(s,a,c)})}else t.lifeTime=D.a.RandomRange(c.minLifeTime,c.maxLifeTime);if(c._sizeGradients&&0!==c._sizeGradients.length?(t._currentSizeGradient=c._sizeGradients[0],t._currentSize1=t._currentSizeGradient.getFactor(),t.size=t._currentSize1,c._sizeGradients.length>1?t._currentSize2=c._sizeGradients[1].getFactor():t._currentSize2=t._currentSize1):t.size=D.a.RandomRange(c.minSize,c.maxSize),t.scale.copyFromFloats(D.a.RandomRange(c.minScaleX,c.maxScaleX),D.a.RandomRange(c.minScaleY,c.maxScaleY)),c._startSizeGradients&&c._startSizeGradients[0]&&c.targetStopDuration){var n=c._actualFrame/c.targetStopDuration;ve.h.GetCurrentGradient(n,c._startSizeGradients,function(e,r,n){e!==i._currentStartSizeGradient&&(i._currentStartSize1=i._currentStartSize2,i._currentStartSize2=r.getFactor(),i._currentStartSizeGradient=e);var o=D.a.Lerp(i._currentStartSize1,i._currentStartSize2,n);t.scale.scaleInPlace(o)})}c._angularSpeedGradients&&0!==c._angularSpeedGradients.length?(t._currentAngularSpeedGradient=c._angularSpeedGradients[0],t.angularSpeed=t._currentAngularSpeedGradient.getFactor(),t._currentAngularSpeed1=t.angularSpeed,c._angularSpeedGradients.length>1?t._currentAngularSpeed2=c._angularSpeedGradients[1].getFactor():t._currentAngularSpeed2=t._currentAngularSpeed1):t.angularSpeed=D.a.RandomRange(c.minAngularSpeed,c.maxAngularSpeed),t.angle=D.a.RandomRange(c.minInitialRotation,c.maxInitialRotation),c._velocityGradients&&c._velocityGradients.length>0&&(t._currentVelocityGradient=c._velocityGradients[0],t._currentVelocity1=t._currentVelocityGradient.getFactor(),c._velocityGradients.length>1?t._currentVelocity2=c._velocityGradients[1].getFactor():t._currentVelocity2=t._currentVelocity1),c._limitVelocityGradients&&c._limitVelocityGradients.length>0&&(t._currentLimitVelocityGradient=c._limitVelocityGradients[0],t._currentLimitVelocity1=t._currentLimitVelocityGradient.getFactor(),c._limitVelocityGradients.length>1?t._currentLimitVelocity2=c._limitVelocityGradients[1].getFactor():t._currentLimitVelocity2=t._currentLimitVelocity1),c._dragGradients&&c._dragGradients.length>0&&(t._currentDragGradient=c._dragGradients[0],t._currentDrag1=t._currentDragGradient.getFactor(),c._dragGradients.length>1?t._currentDrag2=c._dragGradients[1].getFactor():t._currentDrag2=t._currentDrag1),c._colorGradients&&0!==c._colorGradients.length?(t._currentColorGradient=c._colorGradients[0],t._currentColorGradient.getColorToRef(t.color),t._currentColor1.copyFrom(t.color),c._colorGradients.length>1?c._colorGradients[1].getColorToRef(t._currentColor2):t._currentColor2.copyFrom(t.color)):(s=D.a.RandomRange(0,1),o.f.LerpToRef(c.color1,c.color2,s,t.color),c.colorDead.subtractToRef(t.color,c._colorDiff),c._colorDiff.scaleToRef(1/t.lifeTime,t.colorStep)),c._isAnimationSheetEnabled&&(t._initialStartSpriteCellID=c.startSpriteCellID,t._initialEndSpriteCellID=c.endSpriteCellID),t.direction.addInPlace(c._inheritedVelocityOffset),c._useRampGradients&&(t.remapData=new o.y(0,1,0,1)),c.noiseTexture&&(t._randomNoiseCoordinates1?(t._randomNoiseCoordinates1.copyFromFloats(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2.copyFromFloats(Math.random(),Math.random(),Math.random())):(t._randomNoiseCoordinates1=new o.x(Math.random(),Math.random(),Math.random()),t._randomNoiseCoordinates2=new o.x(Math.random(),Math.random(),Math.random()))),t._inheritParticleInfoToSubEmitters()},c=this,l=0;l-1)i=this.manualEmitCount,this._newPartsExcess=0,this.manualEmitCount=0;else{var r=this.emitRate;if(this._emitRateGradients&&this._emitRateGradients.length>0&&this.targetStopDuration){var n=this._actualFrame/this.targetStopDuration;ve.h.GetCurrentGradient(n,this._emitRateGradients,function(e,i,n){e!==t._currentEmitRateGradient&&(t._currentEmitRate1=t._currentEmitRate2,t._currentEmitRate2=i.getFactor(),t._currentEmitRateGradient=e),r=D.a.Lerp(t._currentEmitRate1,t._currentEmitRate2,n)})}i=r*this._scaledUpdateSpeed>>0,this._newPartsExcess+=r*this._scaledUpdateSpeed-i}if(this._newPartsExcess>1&&(i+=this._newPartsExcess>>0,this._newPartsExcess-=this._newPartsExcess>>0),this._alive=!1,this._stopped?i=0:(this._actualFrame+=this._scaledUpdateSpeed,this.targetStopDuration&&this._actualFrame>=this.targetStopDuration&&this.stop()),this._update(i),this._stopped&&(this._alive||(this._started=!1,this.onAnimationEnd&&this.onAnimationEnd(),this.disposeOnStop&&this._scene._toBeDisposed.push(this))),!e){for(var o=0,s=0;s-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,i){var r=null,n=null;if(null!=this.customShader){var o=(n=this.customShader).shaderOptions.defines.length>0?n.shaderOptions.defines.join("\n"):"";r=this._scene.getEngine().createEffectForParticles(n.shaderPath.fragmentElement,n.shaderOptions.uniforms,n.shaderOptions.samplers,o)}else this._customEffect&&(r=this._customEffect);var s=new t(e,this._capacity,this._scene,r);return s.customShader=n,S.a.DeepCopy(this,s,["particles","customShader","noiseTexture"]),void 0===i&&(i=this.emitter),s.noiseTexture=this.noiseTexture,s.emitter=i,this.particleTexture&&(s.particleTexture=new Ge.a(this.particleTexture.url,this._scene)),this._colorGradients&&this._colorGradients.forEach(function(e){s.addColorGradient(e.gradient,e.color1,e.color2)}),this._dragGradients&&this._dragGradients.forEach(function(e){s.addDragGradient(e.gradient,e.factor1,e.factor2)}),this._angularSpeedGradients&&this._angularSpeedGradients.forEach(function(e){s.addAngularSpeedGradient(e.gradient,e.factor1,e.factor2)}),this._emitRateGradients&&this._emitRateGradients.forEach(function(e){s.addEmitRateGradient(e.gradient,e.factor1,e.factor2)}),this._lifeTimeGradients&&this._lifeTimeGradients.forEach(function(e){s.addLifeTimeGradient(e.gradient,e.factor1,e.factor2)}),this._limitVelocityGradients&&this._limitVelocityGradients.forEach(function(e){s.addLimitVelocityGradient(e.gradient,e.factor1,e.factor2)}),this._sizeGradients&&this._sizeGradients.forEach(function(e){s.addSizeGradient(e.gradient,e.factor1,e.factor2)}),this._startSizeGradients&&this._startSizeGradients.forEach(function(e){s.addStartSizeGradient(e.gradient,e.factor1,e.factor2)}),this._velocityGradients&&this._velocityGradients.forEach(function(e){s.addVelocityGradient(e.gradient,e.factor1,e.factor2)}),this._rampGradients&&this._rampGradients.forEach(function(e){s.addRampGradient(e.gradient,e.color)}),this._colorRemapGradients&&this._colorRemapGradients.forEach(function(e){s.addColorRemapGradient(e.gradient,e.factor1,e.factor2)}),this._alphaRemapGradients&&this._alphaRemapGradients.forEach(function(e){s.addAlphaRemapGradient(e.gradient,e.factor1,e.factor2)}),this.preventAutoStart||s.start(),s},t.prototype.serialize=function(){var e={};if(t._Serialize(e,this),e.textureMask=this.textureMask.asArray(),e.customShader=this.customShader,e.preventAutoStart=this.preventAutoStart,this.subEmitters){e.subEmitters=[],this._subEmitters||this._prepareSubEmitterInternalArray();for(var i=0,r=this._subEmitters;i0?c.shaderOptions.defines.join("\n"):"";a=i.getEngine().createEffectForParticles(c.shaderPath.fragmentElement,c.shaderOptions.uniforms,c.shaderOptions.samplers,l)}var u=new t(s,e.capacity,i,a,e.isAnimationSheetEnabled);if(u.customShader=c,e.id&&(u.id=e.id),e.subEmitters){u.subEmitters=[];for(var h=0,d=e.subEmitters;h1},enumerable:!0,configurable:!0}),t.prototype.getCapacity=function(){return this._capacity},Object.defineProperty(t.prototype,"activeParticleCount",{get:function(){return this._activeCount},set:function(e){this._activeCount=Math.min(e,this._capacity)},enumerable:!0,configurable:!0}),t.prototype.isReady=function(){return this._updateEffect?!!(this.emitter&&this._updateEffect.isReady()&&this._imageProcessingConfiguration.isReady()&&this._renderEffect.isReady()&&this.particleTexture&&this.particleTexture.isReady()):(this._recreateUpdateEffect(),this._recreateRenderEffect(),!1)},t.prototype.isStarted=function(){return this._started},t.prototype.start=function(e){var t=this;if(void 0===e&&(e=this.startDelay),!this.targetStopDuration&&this._hasTargetStopDurationDependantGradient())throw"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set";e?setTimeout(function(){t.start(0)},e):(this._started=!0,this._stopped=!1,this._preWarmDone=!1,this.beginAnimationOnStart&&this.animations&&this.animations.length>0&&this.getScene().beginAnimation(this,this.beginAnimationFrom,this.beginAnimationTo,this.beginAnimationLoop))},t.prototype.stop=function(){this._stopped=!0},t.prototype.reset=function(){this._releaseBuffers(),this._releaseVAOs(),this._currentActiveCount=0,this._targetIndex=0},t.prototype.getClassName=function(){return"GPUParticleSystem"},t.prototype._removeGradientAndTexture=function(t,i,r){return e.prototype._removeGradientAndTexture.call(this,t,i,r),this._releaseBuffers(),this},t.prototype.addColorGradient=function(e,t,i){this._colorGradients||(this._colorGradients=[]);var r=new ve.c;return r.gradient=e,r.color1=t,this._colorGradients.push(r),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,i){var r=new ve.d;r.gradient=t,r.factor1=i,e.push(r),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,i){return this},t.prototype.removeEmitRateGradient=function(e){return this},t.prototype.addStartSizeGradient=function(e,t,i){return this},t.prototype.removeStartSizeGradient=function(e){return this},t.prototype.addColorRemapGradient=function(e,t,i){return this},t.prototype.removeColorRemapGradient=function(){return this},t.prototype.addAlphaRemapGradient=function(e,t,i){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,i){return this},t.prototype.removeLifeTimeGradient=function(e){return this},t.prototype._reset=function(){this._releaseBuffers()},t.prototype._createUpdateVAO=function(e){var t={};t.position=e.createVertexBuffer("position",0,3),t.age=e.createVertexBuffer("age",3,1),t.life=e.createVertexBuffer("life",4,1),t.seed=e.createVertexBuffer("seed",5,4),t.size=e.createVertexBuffer("size",9,3);var i=12;this._colorGradientsTexture||(t.color=e.createVertexBuffer("color",i,4),i+=4),t.direction=e.createVertexBuffer("direction",i,3),i+=3,this._isBillboardBased||(t.initialDirection=e.createVertexBuffer("initialDirection",i,3),i+=3),this._angularSpeedGradientsTexture?(t.angle=e.createVertexBuffer("angle",i,1),i+=1):(t.angle=e.createVertexBuffer("angle",i,2),i+=2),this._isAnimationSheetEnabled&&(t.cellIndex=e.createVertexBuffer("cellIndex",i,1),i+=1,this.spriteRandomStartCell&&(t.cellStartOffset=e.createVertexBuffer("cellStartOffset",i,1),i+=1)),this.noiseTexture&&(t.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",i,3),i+=3,t.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",i,3),i+=3);var r=this._engine.recordVertexArrayObject(t,null,this._updateEffect);return this._engine.bindArrayBuffer(null),r},t.prototype._createRenderVAO=function(e,t){var i={};i.position=e.createVertexBuffer("position",0,3,this._attributesStrideSize,!0),i.age=e.createVertexBuffer("age",3,1,this._attributesStrideSize,!0),i.life=e.createVertexBuffer("life",4,1,this._attributesStrideSize,!0),i.size=e.createVertexBuffer("size",9,3,this._attributesStrideSize,!0);var r=12;this._colorGradientsTexture||(i.color=e.createVertexBuffer("color",r,4,this._attributesStrideSize,!0),r+=4),this.billboardMode===Hs.BILLBOARDMODE_STRETCHED&&(i.direction=e.createVertexBuffer("direction",r,3,this._attributesStrideSize,!0)),r+=3,this._isBillboardBased||(i.initialDirection=e.createVertexBuffer("initialDirection",r,3,this._attributesStrideSize,!0),r+=3),i.angle=e.createVertexBuffer("angle",r,1,this._attributesStrideSize,!0),this._angularSpeedGradientsTexture?r++:r+=2,this._isAnimationSheetEnabled&&(i.cellIndex=e.createVertexBuffer("cellIndex",r,1,this._attributesStrideSize,!0),r+=1,this.spriteRandomStartCell&&(i.cellStartOffset=e.createVertexBuffer("cellStartOffset",r,1,this._attributesStrideSize,!0),r+=1)),this.noiseTexture&&(i.noiseCoordinates1=e.createVertexBuffer("noiseCoordinates1",r,3,this._attributesStrideSize,!0),r+=3,i.noiseCoordinates2=e.createVertexBuffer("noiseCoordinates2",r,3,this._attributesStrideSize,!0),r+=3),i.offset=t.createVertexBuffer("offset",0,2),i.uv=t.createVertexBuffer("uv",2,2);var n=this._engine.recordVertexArrayObject(i,null,this._renderEffect);return this._engine.bindArrayBuffer(null),n},t.prototype._initialize=function(e){if(void 0===e&&(e=!1),!this._buffer0||e){var t=this._scene.getEngine(),i=new Array;this._attributesStrideSize=21,this._targetIndex=0,this.isBillboardBased||(this._attributesStrideSize+=3),this._colorGradientsTexture&&(this._attributesStrideSize-=4),this._angularSpeedGradientsTexture&&(this._attributesStrideSize-=1),this._isAnimationSheetEnabled&&(this._attributesStrideSize+=1,this.spriteRandomStartCell&&(this._attributesStrideSize+=1)),this.noiseTexture&&(this._attributesStrideSize+=6);for(var r=0;r=this.targetStopDuration&&this.stop()},t.prototype._createFactorGradientTexture=function(e,t){var i=this[t];if(e&&e.length&&!i){for(var r=new Float32Array(this._rawTextureWidth),n=0;n1){var i=0|this._accumulatedCount;this._accumulatedCount-=i,this._currentActiveCount=Math.min(this._activeCount,this._currentActiveCount+i)}if(!this._currentActiveCount)return 0;var r;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){r=this.emitter.getWorldMatrix()}else{var n=this.emitter;r=o.j.Translation(n.x,n.y,n.z)}if(this._updateEffect.setMatrix("emitterWM",r),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(Tn.a.PointListDrawMode,0,this._currentActiveCount),this._engine.endTransformFeedback(),this._engine.setRasterizerState(!0),this._engine.bindTransformFeedbackBuffer(null),!e){this._engine.enableEffect(this._renderEffect);var s=this._scene.getViewMatrix();if(this._renderEffect.setMatrix("view",s),this._renderEffect.setMatrix("projection",this._scene.getProjectionMatrix()),this._renderEffect.setTexture("textureSampler",this.particleTexture),this._renderEffect.setVector2("translationPivot",this.translationPivot),this._colorGradientsTexture?this._renderEffect.setTexture("colorGradientSampler",this._colorGradientsTexture):this._renderEffect.setDirectColor4("colorDead",this.colorDead),this._isAnimationSheetEnabled&&this.particleTexture){var a=this.particleTexture.getBaseSize();this._renderEffect.setFloat3("sheetInfos",this.spriteCellWidth/a.width,this.spriteCellHeight/a.height,a.width/this.spriteCellWidth)}if(this._isBillboardBased){var c=this._scene.activeCamera;this._renderEffect.setVector3("eyePosition",c.globalPosition)}if(this._scene.clipPlane||this._scene.clipPlane2||this._scene.clipPlane3||this._scene.clipPlane4){var l=s.clone();l.invert(),this._renderEffect.setMatrix("invView",l),jr.a.BindClipPlane(this._renderEffect,this._scene)}switch(this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._renderEffect),this.blendMode){case Hs.BLENDMODE_ADD:this._engine.setAlphaMode(_.a.ALPHA_ADD);break;case Hs.BLENDMODE_ONEONE:this._engine.setAlphaMode(_.a.ALPHA_ONEONE);break;case Hs.BLENDMODE_STANDARD:this._engine.setAlphaMode(_.a.ALPHA_COMBINE);break;case Hs.BLENDMODE_MULTIPLY:this._engine.setAlphaMode(_.a.ALPHA_MULTIPLY)}this.forceDepthWrite&&this._engine.setDepthWrite(!0),this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex],null),this._engine.drawArraysType(Tn.a.TriangleFanDrawMode,0,4,this._currentActiveCount),this._engine.setAlphaMode(_.a.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,i){var r=new t(e,{capacity:this._capacity,randomTextureSize:this._randomTextureSize},this._scene);return S.a.DeepCopy(this,r),void 0===i&&(i=this.emitter),r.emitter=i,this.particleTexture&&(r.particleTexture=new Ge.a(this.particleTexture.url,this._scene)),r},t.prototype.serialize=function(){var e={};return Hs._Serialize(e,this),e.activeParticleCount=this.activeParticleCount,e},t.Parse=function(e,i,r,n){void 0===n&&(n=!1);var o=new t(e.name,{capacity:e.capacity,randomTextureSize:e.randomTextureSize},i);return e.activeParticleCount&&(o.activeParticleCount=e.activeParticleCount),Hs._Parse(e,o,i,r),e.preventAutoStart&&(o.preventAutoStart=e.preventAutoStart),n||o.preventAutoStart||o.start(),o},t}(Gs),Js=(function(){}(),function(){function e(){this.systems=new Array}return Object.defineProperty(e.prototype,"emitterNode",{get:function(){return this._emitterNode},enumerable:!0,configurable:!0}),e.prototype.setEmitterAsSphere=function(e,t,i){this._emitterNode&&this._emitterNode.dispose(),this._emitterCreationOptions={kind:"Sphere",options:e,renderingGroupId:t};var r=Rr.a.CreateSphere("emitterSphere",{diameter:e.diameter,segments:e.segments},i);r.renderingGroupId=t;var n=new di.a("emitterSphereMaterial",i);n.emissiveColor=e.color,r.material=n;for(var o=0,s=this.systems;o0&&t.set(this._uvs32,gi.b.UVKind),this._colors32.length>0&&t.set(this._colors32,gi.b.ColorKind);var i=new de.a(this.name,this._scene);return t.applyToMesh(i,this._updatable),this.mesh=i,this.mesh.isPickable=this._pickable,this._depthSort||(this._indices=null),this._positions=null,this._normals=null,this._uvs=null,this._colors=null,this._updatable||(this.particles.length=0),i},e.prototype.digest=function(e,t){var i=t&&t.facetNb||1,r=t&&t.number||0,n=t&&t.delta||0,s=e.getVerticesData(gi.b.PositionKind),a=e.getIndices(),c=e.getVerticesData(gi.b.UVKind),l=e.getVerticesData(gi.b.ColorKind),u=e.getVerticesData(gi.b.NormalKind),h=0,d=a.length/3;r?(r=r>d?d:r,i=Math.round(d/r),n=0):i=i>d?d:i;for(var f=[],p=[],_=[],m=[],g=o.x.Zero(),v=i;hd-(i=v+Math.floor((1+n)*Math.random()))&&(i=d-h),f.length=0,p.length=0,_.length=0,m.length=0;for(var y=0,b=3*h;b<3*(h+i);b++){p.push(y);var T=a[b];f.push(s[3*T],s[3*T+1],s[3*T+2]),c&&_.push(c[2*T],c[2*T+1]),l&&m.push(l[4*T],l[4*T+1],l[4*T+2],l[4*T+3]),y++}var E,x,A=this.nbParticles,P=this._posToShape(f),R=this._uvsToShapeUV(_);for(E=0;E65535&&(this._needs32Bits=!0)}if(this._pickable){var C=r.length/3;for(_=0;_=this.nbParticles?this.nbParticles-1:t,this._computeBoundingBox&&(0!=e||t!=this.nbParticles-1)){var O=this.mesh._boundingInfo;O&&(v.copyFrom(O.minimum),y.copyFrom(O.maximum))}var I=(A=this.particles[e]._pos)/3|0;R=4*I,C=2*I;for(var D=e;D<=t;D++){var w=this.particles[D];this.updateParticle(w);var L=w._model._shape,F=w._model._shapeUV,N=w._rotationMatrix,B=w.position,U=w.rotation,V=w.scaling,G=w._globalPosition;if(this._depthSort&&this._depthSortParticles){var k=this.depthSortedParticles[D];k.ind=w._ind,k.indicesLength=w._model._indicesLength,k.sqDistance=o.x.DistanceSquared(w.position,b)}if(!w.alive||w._stillInvisible&&!w.isVisible)A+=3*(M=L.length),R+=4*M,C+=2*M;else{if(w.isVisible){w._stillInvisible=!1;var z=p[12];if(w.pivot.multiplyToRef(V,z),this.billboard&&(U.x=0,U.y=0),(this._computeParticleRotation||this.billboard)&&w.getRotationMatrix(r),null!==w.parentId){var j=this.particles[w.parentId],W=j._rotationMatrix,H=j._globalPosition,X=B.x*W[1]+B.y*W[4]+B.z*W[7],Y=B.x*W[0]+B.y*W[3]+B.z*W[6],K=B.x*W[2]+B.y*W[5]+B.z*W[8];if(G.x=H.x+Y,G.y=H.y+X,G.z=H.z+K,this._computeParticleRotation||this.billboard){var Q=r.m;N[0]=Q[0]*W[0]+Q[1]*W[3]+Q[2]*W[6],N[1]=Q[0]*W[1]+Q[1]*W[4]+Q[2]*W[7],N[2]=Q[0]*W[2]+Q[1]*W[5]+Q[2]*W[8],N[3]=Q[4]*W[0]+Q[5]*W[3]+Q[6]*W[6],N[4]=Q[4]*W[1]+Q[5]*W[4]+Q[6]*W[7],N[5]=Q[4]*W[2]+Q[5]*W[5]+Q[6]*W[8],N[6]=Q[8]*W[0]+Q[9]*W[3]+Q[10]*W[6],N[7]=Q[8]*W[1]+Q[9]*W[4]+Q[10]*W[7],N[8]=Q[8]*W[2]+Q[9]*W[5]+Q[10]*W[8]}}else if(G.x=B.x,G.y=B.y,G.z=B.z,this._computeParticleRotation||this.billboard){Q=r.m;N[0]=Q[0],N[1]=Q[1],N[2]=Q[2],N[3]=Q[4],N[4]=Q[5],N[5]=Q[6],N[6]=Q[8],N[7]=Q[9],N[8]=Q[10]}var q=p[11];for(w.translateFromPivot?q.setAll(0):q.copyFrom(z),M=0;Mi)return null;var u=n===oa.Constant?r:r*(1-l/i);return{force:s.multiplyByFloats(u,u,u),contactPoint:c}},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=Rr.a.CreateSphere("radialExplosionEventSphere",this._sphereOptions,this._scene),this._sphere.isVisible=!1)},e.prototype._intersectsWithSphere=function(e,t,i){var r=e.object;return this._prepareSphere(),this._sphere.position=t,this._sphere.scaling=new o.x(2*i,2*i,2*i),this._sphere._updateBoundingInfo(),this._sphere.computeWorldMatrix(!0),this._sphere.intersectsMesh(r,!0)},e}(),ua=function(){function e(e,t,i,r,n,o){void 0===o&&(o=oa.Constant),this._dataFetched=!1,this._physicsHelper=e,this._scene=t,this._origin=i,this._radius=r,this._strength=n,this._falloff=o,this._tickCallback=this._tick.bind(this)}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._radius,-1*this._strength,this._falloff);else{var e=this._physicsHelper.applyRadialExplosionForce(this._origin,this._radius,-1*this._strength,this._falloff);e&&(this._sphere=e.getData().sphere.clone("radialExplosionEventSphereClone"))}},e}(),ha=function(){function e(e,t,i,r,n,s){this._scene=e,this._origin=t,this._radius=i,this._strength=r,this._height=n,this._updraftMode=s,this._originTop=o.x.Zero(),this._originDirection=o.x.Zero(),this._cylinderPosition=o.x.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._origin.addToRef(new o.x(0,this._height/2,0),this._cylinderPosition),this._origin.addToRef(new o.x(0,this._height,0),this._originTop),this._updraftMode===sa.Perpendicular&&(this._originDirection=this._origin.subtract(this._originTop).normalize()),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),this._cylinder&&(e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0))},e.prototype.getImpostorForceAndContactPoint=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;var t=e.getObjectCenter();if(this._updraftMode===sa.Perpendicular)var i=this._originDirection;else i=t.subtract(this._originTop);var r=-1*this._strength;return{force:i.multiplyByFloats(r,r,r),contactPoint:t}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var i=e.getImpostorForceAndContactPoint(t);i&&t.applyForce(i.force,i.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=Ti.a.CreateCylinder("updraftEventCylinder",{height:this._height,diameter:2*this._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}(),da=function(){function e(e,t,i,r,n){this._scene=e,this._origin=t,this._radius=i,this._strength=r,this._height=n,this._originTop=o.x.Zero(),this._centripetalForceThreshold=.7,this._updraftMultiplier=.02,this._cylinderPosition=o.x.Zero(),this._dataFetched=!1,this._physicsEngine=this._scene.getPhysicsEngine(),this._origin.addToRef(new o.x(0,this._height/2,0),this._cylinderPosition),this._origin.addToRef(new o.x(0,this._height,0),this._originTop),this._tickCallback=this._tick.bind(this),this._prepareCylinder()}return e.prototype.getData=function(){return this._dataFetched=!0,{cylinder:this._cylinder}},e.prototype.enable=function(){this._tickCallback.call(this),this._scene.registerBeforeRender(this._tickCallback)},e.prototype.disable=function(){this._scene.unregisterBeforeRender(this._tickCallback)},e.prototype.dispose=function(e){var t=this;void 0===e&&(e=!0),e?this._cylinder.dispose():setTimeout(function(){t._dataFetched||t._cylinder.dispose()},0)},e.prototype.getImpostorForceAndContactPoint=function(e){if(0===e.mass)return null;if(!this._intersectsWithCylinder(e))return null;if("Mesh"!==e.object.getClassName()&&"InstancedMesh"!==e.object.getClassName())return null;var t=e.getObjectCenter(),i=new o.x(this._origin.x,t.y,this._origin.z),r=t.subtract(i),n=new ti.a(i,r,this._radius).intersectsMesh(e.object),s=n.pickedPoint;if(!s)return null;var a=n.distance/this._radius,c=o.x.Cross(i,t).normalize(),l=s.normalize();if(a>this._centripetalForceThreshold&&(l=l.negate()),a>this._centripetalForceThreshold)var u=l.x*this._strength/8,h=l.y*this._updraftMultiplier,d=l.z*this._strength/8;else u=(c.x+l.x)/2,h=this._originTop.y*this._updraftMultiplier,d=(c.z+l.z)/2;var f=new o.x(u,h,d);return{force:f=f.multiplyByFloats(this._strength,this._strength,this._strength),contactPoint:t}},e.prototype._tick=function(){var e=this;this._physicsEngine.getImpostors().forEach(function(t){var i=e.getImpostorForceAndContactPoint(t);i&&t.applyForce(i.force,i.contactPoint)})},e.prototype._prepareCylinder=function(){this._cylinder||(this._cylinder=Ti.a.CreateCylinder("vortexEventCylinder",{height:this._height,diameter:2*this._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}();!function(e){e[e.Constant=0]="Constant",e[e.Linear=1]="Linear"}(oa||(oa={})),function(e){e[e.Center=0]="Center",e[e.Perpendicular=1]="Perpendicular"}(sa||(sa={}));var fa=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Ammo);var i=this;this._useDeltaForWorldStep=e,this.bjsAMMO={},this.name="AmmoJSPlugin",this._timeStep=1/60,this._fixedTimeStep=1/60,this._maxSteps=5,this._tmpQuaternion=new o.q,this._tmpContactCallbackResult=!1,this._tmpVector=new o.x,this._tmpMatrix=new o.j,"function"==typeof t?t(this.bjsAMMO):this.bjsAMMO=t,this.isSupported()?(this._collisionConfiguration=new this.bjsAMMO.btDefaultCollisionConfiguration,this._dispatcher=new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration),this._overlappingPairCache=new this.bjsAMMO.btDbvtBroadphase,this._solver=new this.bjsAMMO.btSequentialImpulseConstraintSolver,this.world=new this.bjsAMMO.btDiscreteDynamicsWorld(this._dispatcher,this._overlappingPairCache,this._solver,this._collisionConfiguration),this._tmpAmmoConcreteContactResultCallback=new this.bjsAMMO.ConcreteContactResultCallback,this._tmpAmmoConcreteContactResultCallback.addSingleResult=function(){i._tmpContactCallbackResult=!0},this._tmpAmmoTransform=new this.bjsAMMO.btTransform,this._tmpAmmoTransform.setIdentity(),this._tmpAmmoQuaternion=new this.bjsAMMO.btQuaternion(0,0,0,1),this._tmpAmmoVectorA=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorB=new this.bjsAMMO.btVector3(0,0,0),this._tmpAmmoVectorC=new this.bjsAMMO.btVector3(0,0,0)):p.a.Error("AmmoJS is not available. Please make sure you included the js file.")}return e.prototype.setGravity=function(e){this._tmpAmmoVectorA.setValue(e.x,e.y,e.z),this.world.setGravity(this._tmpAmmoVectorA)},e.prototype.setTimeStep=function(e){this._timeStep=e},e.prototype.setFixedTimeStep=function(e){this._fixedTimeStep=e},e.prototype.setMaxSteps=function(e){this._maxSteps=e},e.prototype.getTimeStep=function(){return this._timeStep},e.prototype._isImpostorInContact=function(e){return this._tmpContactCallbackResult=!1,this.world.contactTest(e.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._isImpostorPairInContact=function(e,t){return this._tmpContactCallbackResult=!1,this.world.contactPairTest(e.physicsBody,t.physicsBody,this._tmpAmmoConcreteContactResultCallback),this._tmpContactCallbackResult},e.prototype._stepSimulation=function(e,t,i){if(void 0===e&&(e=1/60),void 0===t&&(t=10),void 0===i&&(i=1/60),0==t)this.world.stepSimulation(e,0);else for(;t>0&&e>0;)e-i0&&this._isImpostorInContact(s))for(var a=0,c=s._onPhysicsCollideCallbacks;a0){if(e.type!=oo.a.NoImpostor){var l=this._createShape(e,!0);l&&(this._tmpAmmoTransform.getOrigin().setValue(0,0,0),this._tmpAmmoQuaternion.setValue(0,0,0,1),this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion),r.addChildShape(this._tmpAmmoTransform,l))}return r}Ammo.destroy(r),r=null}switch(e.type){case oo.a.SphereImpostor:r=new Ammo.btSphereShape(s.x/2);break;case oo.a.CylinderImpostor:this._tmpAmmoVectorA.setValue(s.x/2,s.y/2,s.z/2),r=new Ammo.btCylinderShape(this._tmpAmmoVectorA);break;case oo.a.PlaneImpostor:case oo.a.BoxImpostor:this._tmpAmmoVectorA.setValue(s.x/2,s.y/2,s.z/2),r=new Ammo.btBoxShape(this._tmpAmmoVectorA);break;case oo.a.MeshImpostor:var u=new Ammo.btTriangleMesh;e._pluginData.toDispose.concat([u]);var h=this._addMeshVerts(u,n,n);r=0==h?new Ammo.btCompoundShape:new Ammo.btBvhTriangleMeshShape(u);break;case oo.a.NoImpostor:r=new Ammo.btSphereShape(s.x/2);break;default:p.a.Warn("The impostor type is not currently supported by the ammo plugin.")}return r},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,i){var r=e.physicsBody.getWorldTransform();if(r.getOrigin().x()!=t.x||r.getOrigin().y()!=t.y||r.getOrigin().z()!=t.z||r.getRotation().x()!=i.x||r.getRotation().y()!=i.y||r.getRotation().z()!=i.z||r.getRotation().w()!=i.w)if(this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),r.setOrigin(this._tmpAmmoVectorA),this._tmpAmmoQuaternion.setValue(i.x,i.y,i.z,i.w),r.setRotation(this._tmpAmmoQuaternion),e.physicsBody.setWorldTransform(r),0==e.mass){var n=e.physicsBody.getMotionState();n&&n.setWorldTransform(r)}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.physicsBody.setLinearVelocity(this._tmpAmmoVectorA)},e.prototype.setAngularVelocity=function(e,t){this._tmpAmmoVectorA.setValue(t.x,t.y,t.z),e.physicsBody.setAngularVelocity(this._tmpAmmoVectorA)},e.prototype.getLinearVelocity=function(e){var t=e.physicsBody.getLinearVelocity();return t?new o.x(t.x(),t.y(),t.z()):null},e.prototype.getAngularVelocity=function(e){var t=e.physicsBody.getAngularVelocity();return t?new o.x(t.x(),t.y(),t.z()):null},e.prototype.setBodyMass=function(e,t){e.physicsBody.setMassProps(t),e._pluginData.mass=t},e.prototype.getBodyMass=function(e){return e._pluginData.mass},e.prototype.getBodyFriction=function(e){return e._pluginData.friction},e.prototype.setBodyFriction=function(e,t){e.physicsBody.setFriction(t),e._pluginData.friction=t},e.prototype.getBodyRestitution=function(e){return e._pluginData.restitution},e.prototype.setBodyRestitution=function(e,t){e.physicsBody.setRestitution(t),e._pluginData.restitution=t},e.prototype.sleepBody=function(e){p.a.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,i){p.a.Warn("updateDistanceJoint is not currently supported by the Ammo physics plugin")},e.prototype.setMotor=function(e,t,i,r){e.physicsJoint.enableAngularMotor(!0,t,i)},e.prototype.setLimit=function(e,t,i){p.a.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 i=e.getObjectExtendSize();t.x=i.x,t.y=i.y,t.z=i.z},e.prototype.dispose=function(){Ammo.destroy(this.world),Ammo.destroy(this._solver),Ammo.destroy(this._overlappingPairCache),Ammo.destroy(this._dispatcher),Ammo.destroy(this._collisionConfiguration),Ammo.destroy(this._tmpAmmoVectorA),Ammo.destroy(this._tmpAmmoVectorB),Ammo.destroy(this._tmpAmmoVectorC),Ammo.destroy(this._tmpAmmoTransform),Ammo.destroy(this._tmpAmmoQuaternion),Ammo.destroy(this._tmpAmmoConcreteContactResultCallback),this.world=null},e.DISABLE_COLLISION_FLAG=4,e.KINEMATIC_FLAG=2,e.DISABLE_DEACTIVATION_FLAG=4,e}(),pa="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float degree;\nvoid main(void)\n{\nvec3 color=texture2D(textureSampler,vUV).rgb;\nfloat luminance=dot(color,vec3(0.3,0.59,0.11));\nvec3 blackAndWhite=vec3(luminance,luminance,luminance);\ngl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);\n}";Ct.a.ShadersStore.blackAndWhitePixelShader=pa;var _a=function(e){function t(t,i,r,n,o,s){var a=e.call(this,t,"blackAndWhite",["degree"],null,i,r,n,o,s)||this;return a.degree=1,a.onApplyObservable.add(function(e){e.setFloat("degree",a.degree)}),a}return l.d(t,e),t}(Ot),ma=function(){function e(e,t,i,r){this._name=t,this._singleInstance=r||!0,this._getPostProcesses=i,this._cameras={},this._indicesForCamera={},this._postProcesses={}}return Object.defineProperty(e.prototype,"isSupported",{get:function(){for(var e in this._postProcesses)if(this._postProcesses.hasOwnProperty(e))for(var t=this._postProcesses[e],i=0;i-1?"#define MALI 1\n":null},t}(Ot),ja="#include\n\nuniform sampler2D textureSampler;\n\nuniform float intensity;\nuniform float animatedSeed;\n\nvarying vec2 vUV;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec2 seed=vUV*(animatedSeed);\nfloat grain=dither(seed,intensity);\n\nfloat lum=getLuminance(gl_FragColor.rgb);\nfloat grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;\ngl_FragColor.rgb+=grain*grainAmount;\ngl_FragColor.rgb=max(gl_FragColor.rgb,0.0);\n}";Ct.a.ShadersStore.grainPixelShader=ja;var Wa=function(e){function t(t,i,r,n,o,s,a,c){void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),void 0===c&&(c=!1);var l=e.call(this,t,"grain",["intensity","animatedSeed"],[],i,r,n,o,s,null,a,void 0,null,c)||this;return l.intensity=30,l.animated=!1,l.onApplyObservable.add(function(e){e.setFloat("intensity",l.intensity),e.setFloat("animatedSeed",l.animated?Math.random()+1:1)}),l}return l.d(t,e),t}(Ot),Ha="\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nconst vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvoid main(void)\n{\nvec4 tex=texture2D(textureSampler,vUV);\nvec3 c=tex.rgb;\nfloat luma=dot(c.rgb,RGBLuminanceCoefficients);\n\n\ngl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a);\n}";Ct.a.ShadersStore.highlightsPixelShader=Ha;var Xa=function(e){function t(t,i,r,n,o,s,a){return void 0===a&&(a=_.a.TEXTURETYPE_UNSIGNED_INT),e.call(this,t,"highlights",null,null,i,r,n,o,s,null,a)||this}return l.d(t,e),t}(Ot);Ct.a.IncludesShadersStore.mrtFragmentDeclaration="#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n";var Ya="#extension GL_EXT_draw_buffers : require\nprecision highp float;\nprecision highp int;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef VELOCITY\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include[RENDER_TARGET_COUNT]\nvoid main() {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\ngl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\n\ngl_FragData[1]=vec4(normalize(vNormalV),1.0);\n\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPosition,1.0);\n#endif\n#ifdef VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=(a-b)*0.5+0.5;\nvelocity*=0.5+0.5;\nvelocity=vec2(pow(velocity.x,3.0),pow(velocity.y,3.0));\ngl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n}";Ct.a.ShadersStore.geometryPixelShader=Ya;var Ka="precision highp float;\nprecision highp int;\n#include\n#include\nattribute vec3 position;\nattribute vec3 normal;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n\nuniform mat4 viewProjection;\nuniform mat4 view;\nvarying vec3 vNormalV;\nvarying vec4 vViewPos;\n#ifdef POSITION\nvarying vec3 vPosition;\n#endif\n#ifdef VELOCITY\nuniform mat4 previousWorldViewProjection;\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\nvoid main(void)\n{\n#include\n#include\nvec4 pos=vec4(finalWorld*vec4(position,1.0));\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normal,0.0)));\nvViewPos=view*pos;\n#ifdef POSITION\nvPosition=pos.xyz/pos.w;\n#endif\n#ifdef VELOCITY\nvCurrentPosition=viewProjection*finalWorld*vec4(position,1.0);\nvPreviousPosition=previousWorldViewProjection*vec4(position,1.0);\n#endif\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}";Ct.a.ShadersStore.geometryVertexShader=Ka;var Qa=function(){function e(t,i){void 0===i&&(i=1),this._previousTransformationMatrices={},this._enablePosition=!1,this._enableVelocity=!1,this._positionIndex=-1,this._velocityIndex=-1,this._scene=t,this._ratio=i,e._SceneComponentInitialization(this._scene),this._createRenderTargets()}return Object.defineProperty(e.prototype,"renderList",{set:function(e){this._multiRenderTarget.renderList=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSupported",{get:function(){return this._multiRenderTarget.isSupported},enumerable:!0,configurable:!0}),e.prototype.getTextureIndex=function(t){switch(t){case e.POSITION_TEXTURE_TYPE:return this._positionIndex;case e.VELOCITY_TEXTURE_TYPE:return this._velocityIndex;default:return-1}},Object.defineProperty(e.prototype,"enablePosition",{get:function(){return this._enablePosition},set:function(e){this._enablePosition=e,this.dispose(),this._createRenderTargets()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableVelocity",{get:function(){return this._enableVelocity},set:function(e){this._enableVelocity=e,this.dispose(),this._createRenderTargets()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ratio",{get:function(){return this._ratio},enumerable:!0,configurable:!0}),e.prototype.isReady=function(e,t){var i=e.getMaterial();if(i&&i.disableDepthWrite)return!1;var r=[],n=[gi.b.PositionKind,gi.b.NormalKind],o=e.getMesh();i&&i.needAlphaTesting()&&(r.push("#define ALPHATEST"),o.isVerticesDataPresent(gi.b.UVKind)&&(n.push(gi.b.UVKind),r.push("#define UV1")),o.isVerticesDataPresent(gi.b.UV2Kind)&&(n.push(gi.b.UV2Kind),r.push("#define UV2"))),this._enablePosition&&(r.push("#define POSITION"),r.push("#define POSITION_INDEX "+this._positionIndex)),this._enableVelocity&&(r.push("#define VELOCITY"),r.push("#define VELOCITY_INDEX "+this._velocityIndex)),o.useBones&&o.computeBonesUsingShaders?(n.push(gi.b.MatricesIndicesKind),n.push(gi.b.MatricesWeightsKind),o.numBoneInfluencers>4&&(n.push(gi.b.MatricesIndicesExtraKind),n.push(gi.b.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),r.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):r.push("#define NUM_BONE_INFLUENCERS 0"),t&&(r.push("#define INSTANCES"),n.push("world0"),n.push("world1"),n.push("world2"),n.push("world3")),r.push("#define RENDER_TARGET_COUNT "+this._multiRenderTarget.textures.length);var s=r.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._effect=this._scene.getEngine().createEffect("geometry",n,["world","mBones","viewProjection","diffuseMatrix","view","previousWorldViewProjection"],["diffuseSampler"],s,void 0,void 0,void 0,{buffersCount:this._enablePosition?3:2})),this._effect.isReady()},e.prototype.getGBuffer=function(){return this._multiRenderTarget},Object.defineProperty(e.prototype,"samples",{get:function(){return this._multiRenderTarget.samples},set:function(e){this._multiRenderTarget.samples=e},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.getGBuffer().dispose()},e.prototype._createRenderTargets=function(){var e=this,t=this._scene.getEngine(),i=2;if(this._enablePosition&&(this._positionIndex=i,i++),this._enableVelocity&&(this._velocityIndex=i,i++),this._multiRenderTarget=new Go("gBuffer",{width:t.getRenderWidth()*this._ratio,height:t.getRenderHeight()*this._ratio},i,this._scene,{generateMipMaps:!1,generateDepthTexture:!0,defaultType:_.a.TEXTURETYPE_FLOAT}),this.isSupported){this._multiRenderTarget.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._multiRenderTarget.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._multiRenderTarget.refreshRate=1,this._multiRenderTarget.renderParticles=!1,this._multiRenderTarget.renderList=null,this._multiRenderTarget.onClearObservable.add(function(e){e.clear(new o.f(0,0,0,1),!0,!0,!0)});var r=function(t){var i=t.getRenderingMesh(),r=e._scene,n=r.getEngine(),s=t.getMaterial();if(s){e._previousTransformationMatrices[i.uniqueId]||(e._previousTransformationMatrices[i.uniqueId]=o.j.Identity()),n.setState(s.backFaceCulling,0,!1,r.useRightHandedSystem);var a=i._getInstancesRenderList(t._id);if(!a.mustReturn){var c=n.getCaps().instancedArrays&&null!==a.visibleInstances[t._id];if(e.isReady(t,c)){if(n.enableEffect(e._effect),i._bind(t,e._effect,Tn.a.TriangleFillMode),e._effect.setMatrix("viewProjection",r.getTransformMatrix()),e._effect.setMatrix("view",r.getViewMatrix()),s&&s.needAlphaTesting()){var l=s.getAlphaTestTexture();l&&(e._effect.setTexture("diffuseSampler",l),e._effect.setMatrix("diffuseMatrix",l.getTextureMatrix()))}i.useBones&&i.computeBonesUsingShaders&&i.skeleton&&e._effect.setMatrices("mBones",i.skeleton.getTransformMatrices(i)),e._effect.setMatrix("previousWorldViewProjection",e._previousTransformationMatrices[i.uniqueId]),i._processRendering(t,e._effect,Tn.a.TriangleFillMode,a,c,function(t,i){return e._effect.setMatrix("world",i)})}e._previousTransformationMatrices[i.uniqueId]=i.getWorldMatrix().multiply(e._scene.getTransformMatrix())}}};this._multiRenderTarget.customRenderFunction=function(e,i,n,o){var s;if(o.length){for(t.setColorWrite(!1),s=0;s=2&&t.length>0){var i=this._renderEffects[t[0]].getPostProcesses();if(i)return i[0].samples=e,!0}return!1},e.prototype.dispose=function(){},l.c([Object(w.c)()],e.prototype,"_name",void 0),e}(),rc=function(e){function t(t,i,r,n,o){void 0===t&&(t=""),void 0===i&&(i=!0),void 0===r&&(r=R.a.LastCreatedScene),void 0===o&&(o=!0);var s=e.call(this,r.getEngine(),t)||this;s._camerasToBeAttached=[],s.SharpenPostProcessId="SharpenPostProcessEffect",s.ImageProcessingPostProcessId="ImageProcessingPostProcessEffect",s.FxaaPostProcessId="FxaaPostProcessEffect",s.ChromaticAberrationPostProcessId="ChromaticAberrationPostProcessEffect",s.GrainPostProcessId="GrainPostProcessEffect",s._glowLayer=null,s.animations=[],s._imageProcessingConfigurationObserver=null,s._sharpenEnabled=!1,s._bloomEnabled=!1,s._depthOfFieldEnabled=!1,s._depthOfFieldBlurLevel=Da.Low,s._fxaaEnabled=!1,s._imageProcessingEnabled=!0,s._bloomScale=.5,s._chromaticAberrationEnabled=!1,s._grainEnabled=!1,s._buildAllowed=!0,s._resizeObserver=null,s._hardwareScaleLevel=1,s._bloomKernel=64,s._bloomWeight=.15,s._bloomThreshold=.9,s._samples=1,s._hasCleared=!1,s._prevPostProcess=null,s._prevPrevPostProcess=null,s._depthOfFieldSceneObserver=null,s._cameras=n||r.cameras,s._cameras=s._cameras.slice(),s._camerasToBeAttached=s._cameras.slice(),s._buildAllowed=o,s._scene=r;var a=s._scene.getEngine().getCaps();s._hdr=i&&(a.textureHalfFloatRender||a.textureFloatRender),s._hdr?a.textureHalfFloatRender?s._defaultPipelineTextureType=_.a.TEXTURETYPE_HALF_FLOAT:a.textureFloatRender&&(s._defaultPipelineTextureType=_.a.TEXTURETYPE_FLOAT):s._defaultPipelineTextureType=_.a.TEXTURETYPE_UNSIGNED_INT,r.postProcessRenderPipelineManager.addPipeline(s);var c=s._scene.getEngine();return s.sharpen=new tc("sharpen",1,null,Ge.a.BILINEAR_SAMPLINGMODE,c,!1,s._defaultPipelineTextureType,!0),s._sharpenEffect=new ma(c,s.SharpenPostProcessId,function(){return s.sharpen},!0),s.depthOfField=new Fa(s._scene,null,s._depthOfFieldBlurLevel,s._defaultPipelineTextureType,!0),s.bloom=new Ta(s._scene,s._bloomScale,s._bloomWeight,s.bloomKernel,s._defaultPipelineTextureType,!0),s.chromaticAberration=new xa("ChromaticAberration",c.getRenderWidth(),c.getRenderHeight(),1,null,Ge.a.BILINEAR_SAMPLINGMODE,c,!1,s._defaultPipelineTextureType,!0),s._chromaticAberrationEffect=new ma(c,s.ChromaticAberrationPostProcessId,function(){return s.chromaticAberration},!0),s.grain=new Wa("Grain",1,null,Ge.a.BILINEAR_SAMPLINGMODE,c,!1,s._defaultPipelineTextureType,!0),s._grainEffect=new ma(c,s.GrainPostProcessId,function(){return s.grain},!0),s._resizeObserver=c.onResizeObservable.add(function(){s._hardwareScaleLevel=c.getHardwareScalingLevel(),s.bloomKernel=s.bloomKernel}),s._imageProcessingConfigurationObserver=s._scene.imageProcessingConfiguration.onUpdateParameters.add(function(){s.bloom._downscale._exposure=s._scene.imageProcessingConfiguration.exposure}),s._buildPipeline(),s}return l.d(t,e),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 Ta(this._scene,this.bloomScale,this._bloomWeight,this.bloomKernel,this._defaultPipelineTextureType,!1),this.bloom.threshold=e.threshold;for(var t=0;t1){for(var i=0,r=this._cameras;i-1&&(e.depthOfField.depthTexture=t.enableDepthRenderer(t.activeCamera).getDepthMap())})}else{this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);var o=this._scene.enableDepthRenderer(this._cameras[0]);this.depthOfField.depthTexture=o.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 _i("imageProcessing",1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this._hdr?(this.addEffect(new ma(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 za("fxaa",1,null,Ge.a.BILINEAR_SAMPLINGMODE,t,!1,this._defaultPipelineTextureType),this.addEffect(new ma(t,this.FxaaPostProcessId,function(){return e.fxaa},!0)),this._setAutoClearAndTextureSharing(this.fxaa,!0)),null!==this._cameras&&this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name,this._cameras),!this._enableMSAAOnFirstPostProcess(this.samples)&&this.samples>1&&p.a.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?i._ssaoCombinePostProcess.width:i._originalColorPostProcess.width),e.setFloat("near",i._scene.activeCamera.minZ),e.setFloat("far",i._scene.activeCamera.maxZ),e.setFloat("radius",i.radius),e.setTexture("depthSampler",i._depthTexture),i._firstUpdate&&e.setArray("samplerOffsets",i._samplerOffsets))},this._blurVPostProcess=new Ot("BlurV","ssao2",["outSize","samplerOffsets","near","far","radius"],["depthSampler"],t,null,Ge.a.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,"#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE "+(r?"1":"0")+"\n"),this._blurVPostProcess.onApply=function(e){i._scene.activeCamera&&(e.setFloat("outSize",i._ssaoCombinePostProcess.height>0?i._ssaoCombinePostProcess.height:i._originalColorPostProcess.height),e.setFloat("near",i._scene.activeCamera.minZ),e.setFloat("far",i._scene.activeCamera.maxZ),e.setFloat("radius",i.radius),e.setTexture("depthSampler",i._depthTexture),i._firstUpdate&&(e.setArray("samplerOffsets",i._samplerOffsets),i._firstUpdate=!1))},this._blurHPostProcess.samples=this.textureSamples,this._blurVPostProcess.samples=this.textureSamples},t.prototype._rebuild=function(){this._firstUpdate=!0,e.prototype._rebuild.call(this)},t.prototype._radicalInverse_VdC=function(e){return this._bits[0]=e,this._bits[0]=(this._bits[0]<<16|this._bits[0]>>16)>>>0,this._bits[0]=(1431655765&this._bits[0])<<1|(2863311530&this._bits[0])>>>1>>>0,this._bits[0]=(858993459&this._bits[0])<<2|(3435973836&this._bits[0])>>>2>>>0,this._bits[0]=(252645135&this._bits[0])<<4|(4042322160&this._bits[0])>>>4>>>0,this._bits[0]=(16711935&this._bits[0])<<8|(4278255360&this._bits[0])>>>8>>>0,2.3283064365386963e-10*this._bits[0]},t.prototype._hammersley=function(e,t){return[e/t,this._radicalInverse_VdC(e)]},t.prototype._hemisphereSample_uniform=function(e,t){var i=2*t*Math.PI,r=1-(.85*e+.15),n=Math.sqrt(1-r*r);return new o.x(Math.cos(i)*n,Math.sin(i)*n,r)},t.prototype._generateHemisphere=function(){for(var e,t=this.samples,i=[],r=0;r1&&p.a.Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0")},t.prototype._createDownSampleX4PostProcess=function(e,t){var i=this,r=new Array(32);this.downSampleX4PostProcess=new Ot("HDRDownSampleX4","standard",["dsOffsets"],[],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DOWN_SAMPLE_X4",_.a.TEXTURETYPE_UNSIGNED_INT),this.downSampleX4PostProcess.onApply=function(e){for(var t=0,n=i.downSampleX4PostProcess.width,o=i.downSampleX4PostProcess.height,s=-2;s<2;s++)for(var a=-2;a<2;a++)r[t]=(s+.5)*(1/n),r[t+1]=(a+.5)*(1/o),t+=2;e.setArray2("dsOffsets",r)},this.addEffect(new ma(e.getEngine(),"HDRDownSampleX4",function(){return i.downSampleX4PostProcess},!0))},t.prototype._createBrightPassPostProcess=function(e,t){var i=this,r=new Array(8);this.brightPassPostProcess=new Ot("HDRBrightPass","standard",["dsOffsets","brightThreshold"],[],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define BRIGHT_PASS",_.a.TEXTURETYPE_UNSIGNED_INT),this.brightPassPostProcess.onApply=function(e){var t=1/i.brightPassPostProcess.width,n=1/i.brightPassPostProcess.height;r[0]=-.5*t,r[1]=.5*n,r[2]=.5*t,r[3]=.5*n,r[4]=-.5*t,r[5]=-.5*n,r[6]=.5*t,r[7]=-.5*n,e.setArray2("dsOffsets",r),e.setFloat("brightThreshold",i.brightThreshold)},this.addEffect(new ma(e.getEngine(),"HDRBrightPass",function(){return i.brightPassPostProcess},!0))},t.prototype._createBlurPostProcesses=function(e,t,i,r){var n=this;void 0===r&&(r="blurWidth");var s=e.getEngine(),a=new Gr("HDRBlurH_"+i,new o.w(1,0),this[r],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,_.a.TEXTURETYPE_UNSIGNED_INT),c=new Gr("HDRBlurV_"+i,new o.w(0,1),this[r],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,_.a.TEXTURETYPE_UNSIGNED_INT);a.onActivateObservable.add(function(){var e=a.width/s.getRenderWidth();a.kernel=n[r]*e}),c.onActivateObservable.add(function(){var e=c.height/s.getRenderHeight();c.kernel=n.horizontalBlur?64*e:n[r]*e}),this.addEffect(new ma(e.getEngine(),"HDRBlurH"+i,function(){return a},!0)),this.addEffect(new ma(e.getEngine(),"HDRBlurV"+i,function(){return c},!0)),this.blurHPostProcesses.push(a),this.blurVPostProcesses.push(c)},t.prototype._createTextureAdderPostProcess=function(e,t){var i=this;this.textureAdderPostProcess=new Ot("HDRTextureAdder","standard",["exposure"],["otherSampler","lensSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define TEXTURE_ADDER",_.a.TEXTURETYPE_UNSIGNED_INT),this.textureAdderPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",i._vlsEnabled?i._currentDepthOfFieldSource:i.originalPostProcess),e.setTexture("lensSampler",i.lensTexture),e.setFloat("exposure",i.exposure),i._currentDepthOfFieldSource=i.textureAdderFinalPostProcess},this.addEffect(new ma(e.getEngine(),"HDRTextureAdder",function(){return i.textureAdderPostProcess},!0))},t.prototype._createVolumetricLightPostProcess=function(e,t){var i=this,r=e.enableGeometryBufferRenderer();r.enablePosition=!0;var n=r.getGBuffer();this.volumetricLightPostProcess=new Ot("HDRVLS","standard",["shadowViewProjection","cameraPosition","sunDirection","sunColor","scatteringCoefficient","scatteringPower","depthValues"],["shadowMapSampler","positionSampler"],t/8,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLS\n#define NB_STEPS "+this._volumetricLightStepsCount.toFixed(1));var s=o.w.Zero();this.volumetricLightPostProcess.onApply=function(e){if(i.sourceLight&&i.sourceLight.getShadowGenerator()&&i._scene.activeCamera){var t=i.sourceLight.getShadowGenerator();e.setTexture("shadowMapSampler",t.getShadowMap()),e.setTexture("positionSampler",n.textures[2]),e.setColor3("sunColor",i.sourceLight.diffuse),e.setVector3("sunDirection",i.sourceLight.getShadowDirection()),e.setVector3("cameraPosition",i._scene.activeCamera.globalPosition),e.setMatrix("shadowViewProjection",t.getTransformMatrix()),e.setFloat("scatteringCoefficient",i.volumetricLightCoefficient),e.setFloat("scatteringPower",i.volumetricLightPower),s.x=i.sourceLight.getDepthMinZ(i._scene.activeCamera),s.y=i.sourceLight.getDepthMaxZ(i._scene.activeCamera),e.setVector2("depthValues",s)}},this.addEffect(new ma(e.getEngine(),"HDRVLS",function(){return i.volumetricLightPostProcess},!0)),this._createBlurPostProcesses(e,t/4,0,"volumetricLightBlurScale"),this.volumetricLightMergePostProces=new Ot("HDRVLSMerge","standard",[],["originalSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define VLSMERGE"),this.volumetricLightMergePostProces.onApply=function(e){e.setTextureFromPostProcess("originalSampler",i._bloomEnabled?i.textureAdderFinalPostProcess:i.originalPostProcess),i._currentDepthOfFieldSource=i.volumetricLightFinalPostProcess},this.addEffect(new ma(e.getEngine(),"HDRVLSMerge",function(){return i.volumetricLightMergePostProces},!0))},t.prototype._createLuminancePostProcesses=function(e,i){var r=this,n=Math.pow(3,t.LuminanceSteps);this.luminancePostProcess=new Ot("HDRLuminance","standard",["lumOffsets"],[],{width:n,height:n},null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LUMINANCE",i);var s=[];this.luminancePostProcess.onApply=function(e){var t=1/r.luminancePostProcess.width,i=1/r.luminancePostProcess.height;s[0]=-.5*t,s[1]=.5*i,s[2]=.5*t,s[3]=.5*i,s[4]=-.5*t,s[5]=-.5*i,s[6]=.5*t,s[7]=-.5*i,e.setArray2("lumOffsets",s)},this.addEffect(new ma(e.getEngine(),"HDRLuminance",function(){return r.luminancePostProcess},!0));for(var a=t.LuminanceSteps-1;a>=0;a--){n=Math.pow(3,a);var c="#define LUMINANCE_DOWN_SAMPLE\n";0===a&&(c+="#define FINAL_DOWN_SAMPLER");var l=new Ot("HDRLuminanceDownSample"+a,"standard",["dsOffsets","halfDestPixelSize"],[],{width:n,height:n},null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,c,i);this.luminanceDownSamplePostProcesses.push(l)}var u=this.luminancePostProcess;this.luminanceDownSamplePostProcesses.forEach(function(t,i){var n=new Array(18);t.onApply=function(e){if(u){for(var o=0,s=-1;s<2;s++)for(var a=-1;a<2;a++)n[o]=s/u.width,n[o+1]=a/u.height,o+=2;e.setArray2("dsOffsets",n),e.setFloat("halfDestPixelSize",.5/u.width),u=i===r.luminanceDownSamplePostProcesses.length-1?r.luminancePostProcess:t}},i===r.luminanceDownSamplePostProcesses.length-1&&(t.onAfterRender=function(){var t=e.getEngine().readPixels(0,0,1,1),i=new o.y(1/16581375,1/65025,1/255,1);r._hdrCurrentLuminance=(t[0]*i.x+t[1]*i.y+t[2]*i.z+t[3]*i.w)/100}),r.addEffect(new ma(e.getEngine(),"HDRLuminanceDownSample"+i,function(){return t},!0))})},t.prototype._createHdrPostProcess=function(e,t){var i=this;this.hdrPostProcess=new Ot("HDR","standard",["averageLuminance"],["textureAdderSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define HDR",_.a.TEXTURETYPE_UNSIGNED_INT);var r=1,n=0,o=0;this.hdrPostProcess.onApply=function(t){if(t.setTextureFromPostProcess("textureAdderSampler",i._currentDepthOfFieldSource),n+=e.getEngine().getDeltaTime(),r<0)r=i._hdrCurrentLuminance;else{var s=(o-n)/1e3;i._hdrCurrentLuminancer-i.hdrIncreaseRate*s?r-=i.hdrIncreaseRate*s:r=i._hdrCurrentLuminance}r=D.a.Clamp(r,i.hdrMinimumLuminance,1e20),t.setFloat("averageLuminance",r),o=n,i._currentDepthOfFieldSource=i.hdrFinalPostProcess},this.addEffect(new ma(e.getEngine(),"HDR",function(){return i.hdrPostProcess},!0))},t.prototype._createLensFlarePostProcess=function(e,t){var i=this;this.lensFlarePostProcess=new Ot("HDRLensFlare","standard",["strength","ghostDispersal","haloWidth","resolution","distortionStrength"],["lensColorSampler"],t/2,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE",_.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new ma(e.getEngine(),"HDRLensFlare",function(){return i.lensFlarePostProcess},!0)),this._createBlurPostProcesses(e,t/4,2),this.lensFlareComposePostProcess=new Ot("HDRLensFlareCompose","standard",["lensStarMatrix"],["otherSampler","lensDirtSampler","lensStarSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define LENS_FLARE_COMPOSE",_.a.TEXTURETYPE_UNSIGNED_INT),this.addEffect(new ma(e.getEngine(),"HDRLensFlareCompose",function(){return i.lensFlareComposePostProcess},!0));var r=new o.w(0,0);this.lensFlarePostProcess.onApply=function(e){e.setTextureFromPostProcess("textureSampler",i._bloomEnabled?i.blurHPostProcesses[0]:i.originalPostProcess),e.setTexture("lensColorSampler",i.lensColorTexture),e.setFloat("strength",i.lensFlareStrength),e.setFloat("ghostDispersal",i.lensFlareGhostDispersal),e.setFloat("haloWidth",i.lensFlareHaloWidth),r.x=i.lensFlarePostProcess.width,r.y=i.lensFlarePostProcess.height,e.setVector2("resolution",r),e.setFloat("distortionStrength",i.lensFlareDistortionStrength)};var n=o.j.FromValues(2,0,-1,0,0,2,-1,0,0,0,1,0,0,0,0,1),s=o.j.FromValues(.5,0,.5,0,0,.5,.5,0,0,0,1,0,0,0,0,1);this.lensFlareComposePostProcess.onApply=function(e){if(i._scene.activeCamera){e.setTextureFromPostProcess("otherSampler",i._currentDepthOfFieldSource),e.setTexture("lensDirtSampler",i.lensFlareDirtTexture),e.setTexture("lensStarSampler",i.lensStarTexture);var t=i._scene.activeCamera.getViewMatrix().getRow(0),r=i._scene.activeCamera.getViewMatrix().getRow(2),a=o.x.Dot(t.toVector3(),new o.x(1,0,0))+o.x.Dot(r.toVector3(),new o.x(0,0,1));a*=4;var c=o.j.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=s.multiply(c).multiply(n);e.setMatrix("lensStarMatrix",l),i._currentDepthOfFieldSource=i.lensFlareFinalPostProcess}}},t.prototype._createDepthOfFieldPostProcess=function(e,t){var i=this;this.depthOfFieldPostProcess=new Ot("HDRDepthOfField","standard",["distance"],["otherSampler","depthSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define DEPTH_OF_FIELD",_.a.TEXTURETYPE_UNSIGNED_INT),this.depthOfFieldPostProcess.onApply=function(e){e.setTextureFromPostProcess("otherSampler",i._currentDepthOfFieldSource),e.setTexture("depthSampler",i._getDepthTexture()),e.setFloat("distance",i.depthOfFieldDistance)},this.addEffect(new ma(e.getEngine(),"HDRDepthOfField",function(){return i.depthOfFieldPostProcess},!0))},t.prototype._createMotionBlurPostProcess=function(e,t){var i=this;this.motionBlurPostProcess=new Ot("HDRMotionBlur","standard",["inverseViewProjection","prevViewProjection","screenSize","motionScale","motionStrength"],["depthSampler"],t,null,Ge.a.BILINEAR_SAMPLINGMODE,e.getEngine(),!1,"#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES "+this.motionBlurSamples.toFixed(1),_.a.TEXTURETYPE_UNSIGNED_INT);var r=0,n=o.j.Identity(),s=o.j.Identity(),a=o.j.Identity(),c=o.w.Zero();this.motionBlurPostProcess.onApply=function(t){(a=e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(s),t.setMatrix("inverseViewProjection",s),t.setMatrix("prevViewProjection",n),n=a,c.x=i.motionBlurPostProcess.width,c.y=i.motionBlurPostProcess.height,t.setVector2("screenSize",c),r=e.getEngine().getFps()/60,t.setFloat("motionScale",r),t.setFloat("motionStrength",i.motionStrength),t.setTexture("depthSampler",i._getDepthTexture())},this.addEffect(new ma(e.getEngine(),"HDRMotionBlur",function(){return i.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&&-1!==this.excludedMeshes.indexOf(e)},t.prototype._createPass=function(e,t){var i=this,r=e.getEngine();this._volumetricLightScatteringRTT=new wi("volumetricLightScatteringMap",{width:r.getRenderWidth()*t,height:r.getRenderHeight()*t},e,!1,!0,_.a.TEXTURETYPE_UNSIGNED_INT),this._volumetricLightScatteringRTT.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.wrapV=Ge.a.CLAMP_ADDRESSMODE,this._volumetricLightScatteringRTT.renderList=null,this._volumetricLightScatteringRTT.renderParticles=!1,this._volumetricLightScatteringRTT.ignoreCameraViewport=!0;var n=this.getCamera();n?n.customRenderTargets.push(this._volumetricLightScatteringRTT):e.customRenderTargets.push(this._volumetricLightScatteringRTT);var s,a=function(e){var t=e.getRenderingMesh();if(!i._meshExcluded(t)){var r=e.getMaterial();if(r){var n=t.getScene(),o=n.getEngine();o.setState(r.backFaceCulling);var s=t._getInstancesRenderList(e._id);if(!s.mustReturn){var a=o.getCaps().instancedArrays&&null!==s.visibleInstances[e._id];if(i._isReady(e,a)){var c=i._volumetricLightScatteringPass;if(t===i.mesh&&(c=e.effect?e.effect:r.getEffect()),o.enableEffect(c),t._bind(e,c,Tn.a.TriangleFillMode),t===i.mesh)r.bind(t.getWorldMatrix(),t);else{if(i._volumetricLightScatteringPass.setMatrix("viewProjection",n.getTransformMatrix()),r&&r.needAlphaTesting()){var l=r.getAlphaTestTexture();i._volumetricLightScatteringPass.setTexture("diffuseSampler",l),l&&i._volumetricLightScatteringPass.setMatrix("diffuseMatrix",l.getTextureMatrix())}t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&i._volumetricLightScatteringPass.setMatrices("mBones",t.skeleton.getTransformMatrices(t))}t._processRendering(e,i._volumetricLightScatteringPass,Tn.a.TriangleFillMode,s,a,function(e,t){return c.setMatrix("world",t)})}}}}},c=new o.f(0,0,0,1);this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function(){s=e.clearColor,e.clearColor=c}),this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function(){e.clearColor=s}),this._volumetricLightScatteringRTT.customRenderFunction=function(t,i,r,n){var o,s=e.getEngine();if(n.length){for(s.setColorWrite(!1),o=0;ot._alphaIndex?1:e._alphaIndext._distanceToCamera?-1:0}),s.setAlphaMode(_.a.ALPHA_COMBINE),o=0;o4&&(n.push(gi.b.MatricesIndicesExtraKind),n.push(gi.b.MatricesWeightsExtraKind)),r.push("#define NUM_BONE_INFLUENCERS "+o.numBoneInfluencers),r.push("#define BonesPerMesh "+(o.skeleton?o.skeleton.bones.length+1:0))):r.push("#define NUM_BONE_INFLUENCERS 0"),t&&(r.push("#define INSTANCES"),n.push("world0"),n.push("world1"),n.push("world2"),n.push("world3"));var s=r.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._effect=this._scene.getEngine().createEffect("depth",n,["world","mBones","viewProjection","diffuseMatrix","depthValues"],["diffuseSampler"],s)),this._effect.isReady()},e.prototype.getDepthMap=function(){return this._depthMap},e.prototype.dispose=function(){this._depthMap.dispose()},e._SceneComponentInitialization=function(e){throw ye.a.WarnImport("DepthRendererSceneComponent")},e}();W.a.prototype.enableDepthRenderer=function(e){if(!(e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){var t=0;if(this.getEngine().getCaps().textureHalfFloatRender)t=_.a.TEXTURETYPE_HALF_FLOAT;else{if(!this.getEngine().getCaps().textureFloatRender)throw"Depth renderer does not support int texture type";t=_.a.TEXTURETYPE_FLOAT}this._depthRenderer[e.id]=new Pc(this,t,e)}return this._depthRenderer[e.id]},W.a.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 Rc=function(){function e(e){this.name=Ee.a.NAME_DEPTHRENDERER,this.scene=e}return e.prototype.register=function(){this.scene._gatherRenderTargetsStage.registerStep(Ee.a.STEP_GATHERRENDERTARGETS_DEPTHRENDERER,this,this._gatherRenderTargets),this.scene._gatherActiveCameraRenderTargetsStage.registerStep(Ee.a.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 i=this.scene._depthRenderer[t];i.useOnlyInActiveCamera||e.push(i.getDepthMap())}},e.prototype._gatherActiveCameraRenderTargets=function(e){if(this.scene._depthRenderer)for(var t in this.scene._depthRenderer){var i=this.scene._depthRenderer[t];i.useOnlyInActiveCamera&&this.scene.activeCamera.id===t&&e.push(i.getDepthMap())}},e}();Pc._SceneComponentInitialization=function(e){var t=e._getComponent(Ee.a.NAME_DEPTHRENDERER);t||(t=new Rc(e),e._addComponent(t))};var Sc="uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}";Ct.a.ShadersStore.linePixelShader=Sc;var Cc="\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 worldViewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}";Ct.a.ShadersStore.lineVertexShader=Cc;Le.a.prototype.disableEdgesRendering=function(){return this._edgesRenderer&&(this._edgesRenderer.dispose(),this._edgesRenderer=null),this},Le.a.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new Oc(this,e,t),this},Object.defineProperty(Le.a.prototype,"edgesRenderer",{get:function(){return this._edgesRenderer},enumerable:!0,configurable:!0}),ss.b.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),this.disableEdgesRendering(),this._edgesRenderer=new Ic(this,e,t),this},ss.a.prototype.enableEdgesRendering=function(e,t){return void 0===e&&(e=.95),void 0===t&&(t=!1),ss.b.prototype.enableEdgesRendering.apply(this,arguments),this};var Mc=function(){return function(){this.edges=new Array,this.edgesConnectedCount=0}}(),Oc=function(){function e(e,t,i,r){void 0===t&&(t=.95),void 0===i&&(i=!1),void 0===r&&(r=!0);var n=this;this.edgesWidthScalerForOrthographic=1e3,this.edgesWidthScalerForPerspective=50,this._linesPositions=new Array,this._linesNormals=new Array,this._linesIndices=new Array,this._buffers={},this._checkVerticesInsteadOfIndices=!1,this.isEnabled=!0,this._source=e,this._checkVerticesInsteadOfIndices=i,this._epsilon=t,this._prepareRessources(),r&&this._generateEdgesLines(),this._meshRebuildObserver=this._source.onRebuildObservable.add(function(){n._rebuild()}),this._meshDisposeObserver=this._source.onDisposeObservable.add(function(){n.dispose()})}return e.prototype._prepareRessources=function(){this._lineShader||(this._lineShader=new To.a("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[gi.b.PositionKind];e&&e._rebuild(),(e=this._buffers[gi.b.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[gi.b.PositionKind];e&&(e.dispose(),this._buffers[gi.b.PositionKind]=null),(e=this._buffers[gi.b.NormalKind])&&(e.dispose(),this._buffers[gi.b.NormalKind]=null),this._source.getScene().getEngine()._releaseBuffer(this._ib),this._lineShader.dispose()},e.prototype._processEdgeForAdjacencies=function(e,t,i,r,n){return e===i&&t===r||e===r&&t===i?0:e===r&&t===n||e===n&&t===r?1:e===n&&t===i||e===i&&t===n?2:-1},e.prototype._processEdgeForAdjacenciesWithVertices=function(e,t,i,r,n){return e.equalsWithEpsilon(i)&&t.equalsWithEpsilon(r)||e.equalsWithEpsilon(r)&&t.equalsWithEpsilon(i)?0:e.equalsWithEpsilon(r)&&t.equalsWithEpsilon(n)||e.equalsWithEpsilon(n)&&t.equalsWithEpsilon(r)?1:e.equalsWithEpsilon(n)&&t.equalsWithEpsilon(i)||e.equalsWithEpsilon(i)&&t.equalsWithEpsilon(n)?2:-1},e.prototype._checkEdge=function(e,t,i,r,n){var s;void 0===t?s=!0:s=o.x.Dot(i[e],i[t])4&&(r.push(gi.b.MatricesIndicesExtraKind),r.push(gi.b.MatricesWeightsExtraKind)),i.push("#define NUM_BONE_INFLUENCERS "+n.numBoneInfluencers),i.push("#define BonesPerMesh "+(n.skeleton?n.skeleton.bones.length+1:0))):i.push("#define NUM_BONE_INFLUENCERS 0"),t&&(i.push("#define INSTANCES"),r.push("world0"),r.push("world1"),r.push("world2"),r.push("world3"));var s=i.join("\n");return this._cachedDefines!==s&&(this._cachedDefines=s,this._effect=this.scene.getEngine().createEffect("outline",r,["world","mBones","viewProjection","diffuseMatrix","offset","color","logarithmicDepthConstant"],["diffuseSampler"],s)),this._effect.isReady()},e.prototype._beforeRenderingMesh=function(e,t,i){this._savedDepthWrite=this._engine.getDepthWrite(),e.renderOutline&&(this._engine.setDepthWrite(!1),this.render(t,i),this._engine.setDepthWrite(this._savedDepthWrite))},e.prototype._afterRenderingMesh=function(e,t,i){if(e.renderOutline&&this._savedDepthWrite&&(this._engine.setDepthWrite(!0),this._engine.setColorWrite(!1),this.render(t,i),this._engine.setColorWrite(!0)),e.renderOverlay){var r=this._engine.getAlphaMode();this._engine.setAlphaMode(_.a.ALPHA_COMBINE),this.render(t,i,!0),this._engine.setAlphaMode(r)}},e}(),Nc=i(104),Bc=function(){function e(e,t){this.name=e,this.color=new o.f(1,1,1,1),this.width=1,this.height=1,this.angle=0,this.cellIndex=0,this.invertU=0,this.invertV=0,this.animations=new Array,this.isPickable=!1,this._animationStarted=!1,this._loopAnimation=!1,this._fromIndex=0,this._toIndex=0,this._delay=0,this._direction=1,this._time=0,this.isVisible=!0,this._manager=t,this._manager.sprites.push(this),this.position=o.x.Zero()}return Object.defineProperty(e.prototype,"size",{get:function(){return this.width},set:function(e){this.width=e,this.height=e},enumerable:!0,configurable:!0}),e.prototype.playAnimation=function(e,t,i,r,n){this._fromIndex=e,this._toIndex=t,this._loopAnimation=i,this._delay=r,this._animationStarted=!0,this._direction=ethis._delay&&(this._time=this._time%this._delay,this.cellIndex+=this._direction,this.cellIndex>this._toIndex&&(this._loopAnimation?this.cellIndex=this._fromIndex:(this.cellIndex=this._toIndex,this._animationStarted=!1,this._onAnimationEnd&&this._onAnimationEnd(),this.disposeWhenFinishedAnimating&&this.dispose()))))},e.prototype.dispose=function(){for(var e=0;e0)for(var o=0;o=n.distance))&&(n=a,i))break}}return n||new Yi.a},W.a.prototype.pickSprite=function(e,t,i,r,n){return this.createPickingRayInCameraSpaceToRef(e,t,this._tempSpritePickingRay,n),this._internalPickSprites(this._tempSpritePickingRay,i,r,n)},W.a.prototype.pickSpriteWithRay=function(e,t,i,r){if(!this._tempSpritePickingRay)return null;if(!r){if(!this.activeCamera)return null;r=this.activeCamera}return ti.a.TransformToRef(e,r.getViewMatrix(),this._tempSpritePickingRay),this._internalPickSprites(this._tempSpritePickingRay,t,i,r)},W.a.prototype.setPointerOverSprite=function(e){this._pointerOverSprite!==e&&(this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(_.a.ACTION_OnPointerOutTrigger,c.a.CreateNewFromSprite(this._pointerOverSprite,this)),this._pointerOverSprite=e,this._pointerOverSprite&&this._pointerOverSprite.actionManager&&this._pointerOverSprite.actionManager.processTrigger(_.a.ACTION_OnPointerOverTrigger,c.a.CreateNewFromSprite(this._pointerOverSprite,this)))},W.a.prototype.getPointerOverSprite=function(){return this._pointerOverSprite};var Uc=function(){function e(e){this.name=Ee.a.NAME_SPRITE,this.scene=e,this.scene.spriteManagers=new Array,this.scene._tempSpritePickingRay=ti.a?ti.a.Zero():null,this.scene.onBeforeSpritesRenderingObservable=new n.c,this.scene.onAfterSpritesRenderingObservable=new n.c,this._spritePredicate=function(e){return!!e.actionManager&&(e.isPickable&&e.actionManager.hasPointerTriggers)}}return e.prototype.register=function(){this.scene._pointerMoveStage.registerStep(Ee.a.STEP_POINTERMOVE_SPRITE,this,this._pointerMove),this.scene._pointerDownStage.registerStep(Ee.a.STEP_POINTERDOWN_SPRITE,this,this._pointerDown),this.scene._pointerUpStage.registerStep(Ee.a.STEP_POINTERUP_SPRITE,this,this._pointerUp)},e.prototype.rebuild=function(){},e.prototype.dispose=function(){this.scene.onBeforeSpritesRenderingObservable.clear(),this.scene.onAfterSpritesRenderingObservable.clear();for(var e=this.scene.spriteManagers;e.length;)e[0].dispose()},e.prototype._pickSpriteButKeepRay=function(e,t,i,r,n){var o=this.scene.pickSprite(t,i,this._spritePredicate,r,n);return o&&(o.ray=e?e.ray:null),o},e.prototype._pointerMove=function(e,t,i,r,n){var o=this.scene;return r?o.setPointerOverSprite(null):(i=this._pickSpriteButKeepRay(i,e,t,!1,o.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite?(o.setPointerOverSprite(i.pickedSprite),o._pointerOverSprite&&o._pointerOverSprite.actionManager&&o._pointerOverSprite.actionManager.hoverCursor?n.style.cursor=o._pointerOverSprite.actionManager.hoverCursor:n.style.cursor=o.hoverCursor):o.setPointerOverSprite(null),i},e.prototype._pointerDown=function(e,t,i,r){var n=this.scene;if(n._pickedDownSprite=null,n.spriteManagers.length>0&&(i=n.pickSprite(e,t,this._spritePredicate,!1,n.cameraToUseForPointers||void 0))&&i.hit&&i.pickedSprite&&i.pickedSprite.actionManager){switch(n._pickedDownSprite=i.pickedSprite,r.button){case 0:i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnLeftPickTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r));break;case 1:i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnCenterPickTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r));break;case 2:i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnRightPickTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r))}i.pickedSprite.actionManager&&i.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnPickDownTrigger,c.a.CreateNewFromSprite(i.pickedSprite,n,r))}return i},e.prototype._pointerUp=function(e,t,i,r){var n=this.scene;if(n.spriteManagers.length>0){var o=n.pickSprite(e,t,this._spritePredicate,!1,n.cameraToUseForPointers||void 0);o&&(o.hit&&o.pickedSprite&&o.pickedSprite.actionManager&&(o.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnPickUpTrigger,c.a.CreateNewFromSprite(o.pickedSprite,n,r)),o.pickedSprite.actionManager&&(this.scene._isPointerSwiping()||o.pickedSprite.actionManager.processTrigger(_.a.ACTION_OnPickTrigger,c.a.CreateNewFromSprite(o.pickedSprite,n,r)))),n._pickedDownSprite&&n._pickedDownSprite.actionManager&&n._pickedDownSprite!==o.pickedSprite&&n._pickedDownSprite.actionManager.processTrigger(_.a.ACTION_OnPickOutTrigger,c.a.CreateNewFromSprite(n._pickedDownSprite,n,r)))}return i},e}(),Vc="uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest)\n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include\ngl_FragColor=color;\n}";Ct.a.ShadersStore.spritesPixelShader=Vc;var Gc="\nattribute vec4 position;\nattribute vec4 options;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform vec2 textureInfos;\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include\nvoid main(void) {\nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz;\nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=options.zw;\nvec2 uvScale=textureInfos.xy;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0);\n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-cellInfo.x),1.0-abs(offset.y-cellInfo.y));\nvUV=(uvOffset+cellInfo.zw)*uvScale;\n\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n}";Ct.a.ShadersStore.spritesVertexShader=Gc;var kc,zc=function(){function e(e,t,i,r,o,s,a){if(void 0===s&&(s=.01),void 0===a&&(a=Ge.a.TRILINEAR_SAMPLINGMODE),this.name=e,this.sprites=new Array,this.renderingGroupId=0,this.layerMask=268435455,this.fogEnabled=!0,this.isPickable=!1,this.onDisposeObservable=new n.c,this._vertexBuffers={},o._getComponent(Ee.a.NAME_SPRITE)||o._addComponent(new Uc(o)),this._capacity=i,this._spriteTexture=new Ge.a(t,o,!0,!1,a),this._spriteTexture.wrapU=Ge.a.CLAMP_ADDRESSMODE,this._spriteTexture.wrapV=Ge.a.CLAMP_ADDRESSMODE,r.width&&r.height)this.cellWidth=r.width,this.cellHeight=r.height;else{if(void 0===r)return;this.cellWidth=r,this.cellHeight=r}this._epsilon=s,this._scene=o,this._scene.spriteManagers.push(this);for(var c=[],l=0,u=0;u>0;this._vertexData[o+10]=t.cellIndex-s*n,this._vertexData[o+11]=s,this._vertexData[o+12]=t.color.r,this._vertexData[o+13]=t.color.g,this._vertexData[o+14]=t.color.b,this._vertexData[o+15]=t.color.a},e.prototype.intersects=function(e,t,i,r){for(var n=Math.min(this._capacity,this.sprites.length),s=o.x.Zero(),a=o.x.Zero(),c=Number.MAX_VALUE,l=null,u=o.x.Zero(),h=t.getViewMatrix(),d=0;dp&&(c=p,l=f,r))break}}}if(l){var _=new Yi.a;return _.hit=!0,_.pickedSprite=l,_.distance=c,_}return null},e.prototype.render=function(){if(this._effectBase.isReady()&&this._effectFog.isReady()&&this._spriteTexture&&this._spriteTexture.isReady()&&this.sprites.length){for(var e=this._scene.getEngine(),t=this._spriteTexture.getBaseSize(),i=e.getDeltaTime(),r=Math.min(this._capacity,this.sprites.length),n=t.width/this.cellWidth,o=0,s=0;s-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 Yc(this._waitingTasksCount,this._totalTasksCount,e))}catch(e){p.a.Error("Error running progress callbacks."),console.log(e)}if(0===this._waitingTasksCount){try{this.onFinish&&this.onFinish(this._tasks);for(var t=this._tasks.slice(),i=0,r=t;i-1&&this._tasks.splice(n,1)}}this.onTasksDoneObservable.notifyObservers(this._tasks)}catch(e){p.a.Error("Error running tasks-done callbacks."),console.log(e)}this._isLoading=!1,this._scene.getEngine().hideLoadingUI()}},e.prototype._runTask=function(e){var t=this,i=function(i,r){e._setErrorObject(i,r),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){i("Error executing task success callbacks",e)}},i)},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;e0&&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,i,r){var n=this,o=e.createReader(),s=e.fullPath.replace(/^\//,"").replace(/(.+?)\/?$/,"$1/");o.readEntries(function(e){i.count+=e.length;for(var o=0,a=e;o0)){for(var i=new Array,r=[],n=e.dataTransfer?e.dataTransfer.items:null,o=0;o0&&p.a.ClearLogCache(),this._engine.stopRenderLoop()),dr.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)})):p.a.Error("Please provide a valid .babylon file.")},e}(),nl=i(102),ol=i(103),sl=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}(),al=function(e){function t(t,i,r){void 0===t&&(t=0),void 0===i&&(i=1024),void 0===r&&(r=.5);var n=e.call(this,t)||this;return n.priority=t,n.maximumSize=i,n.step=r,n}return l.d(t,e),t.prototype.getDescription=function(){return"Reducing render target texture size to "+this.maximumSize},t.prototype.apply=function(e,t){for(var i=!0,r=0;rthis.maximumSize&&(n.scale(this.step),i=!1)}}return i},t}(sl),cl=function(e){function t(t,i,r){void 0===t&&(t=0),void 0===i&&(i=2),void 0===r&&(r=.25);var n=e.call(this,t)||this;return n.priority=t,n.maximumScale=i,n.step=r,n._currentScale=-1,n._directionOffset=1,n}return l.d(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}(sl),ll=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.getDescription=function(){return"Turning shadows on/off"},t.prototype.apply=function(e,t){return e.shadowsEnabled=t.isInImprovementMode,!0},t}(sl),ul=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(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}(sl),hl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(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}(sl),dl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(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}(sl),fl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.getDescription=function(){return"Turning particles on/off"},t.prototype.apply=function(e,t){return e.particlesEnabled=t.isInImprovementMode,!0},t}(sl),pl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l.d(t,e),t.prototype.getDescription=function(){return"Turning render targets off"},t.prototype.apply=function(e,t){return e.renderTargetsEnabled=t.isInImprovementMode,!0},t}(sl),_l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._canBeMerged=function(e){if(!(e instanceof de.a))return!1;var t=e;return!t.isDisposed()&&(!(!t.isVisible||!t.isEnabled())&&(!(t.instances.length>0)&&(!t.skeleton&&!t.hasLODLevels)))},t}return l.d(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,i,r){for(var n=e.meshes.slice(0),o=n.length,s=0;s=this._targetFrameRate)return this._isRunning=!1,void this.onSuccessObservable.notifyObservers(this);for(var r=!0,n=!0,o=0;o0)for(o.reflectionProbes=[],i=0;i0&&setTimeout(function(){i.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){i._resolve=e,i._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&&ve.h.Download(e,this._fileName)},e._defaultOptions={mimeType:"video/webm",fps:25,recordChunckSize:3e3},e}(),Al=function(){function e(e){this._pendingActions=new Array,this._workerInfos=e.map(function(e){return{worker:e,active:!1}})}return e.prototype.dispose=function(){for(var e=0,t=this._workerInfos;es&&(l=(u=s)*c);var h=Math.max(0,o-l)/2,d=Math.max(0,s-u)/2,f=e.getRenderingCanvas();a&&f&&a.drawImage(f,h,d,l,u),ve.h.EncodeScreenshotCanvasData(r,n)},e.CreateScreenshotUsingRenderTarget=function(e,t,i,r,n,o,s,a){var c,l;if(void 0===n&&(n="image/png"),void 0===o&&(o=1),void 0===s&&(s=!1),i.precision)c=Math.round(e.getRenderWidth()*i.precision),l=Math.round(c/e.getAspectRatio(t)),i={width:c,height:l};else if(i.width&&i.height)c=i.width,l=i.height;else if(i.width&&!i.height)c=i.width,l=Math.round(c/e.getAspectRatio(t)),i={width:c,height:l};else if(i.height&&!i.width)l=i.height,i={width:c=Math.round(l*e.getAspectRatio(t)),height:l};else{if(isNaN(i))return void p.a.Error("Invalid 'size' parameter !");l=i,c=i}var u=t.getScene(),h=null;u.activeCamera!==t&&(h=u.activeCamera,u.activeCamera=t);var d=e.getRenderingCanvas();if(d){var f={width:d.width,height:d.height};e.setSize(c,l),u.render();var m=new wi("screenShot",i,u,!1,!1,_.a.TEXTURETYPE_UNSIGNED_INT,!1,Ge.a.NEAREST_SAMPLINGMODE);m.renderList=null,m.samples=o,s&&m.addPostProcess(new za("antialiasing",1,u.activeCamera)),m.onAfterRenderObservable.add(function(){ve.h.DumpFramebuffer(c,l,e,r,n,a)}),u.incrementRenderId(),u.resetCachedMaterial(),m.render(!0),m.dispose(),h&&(u.activeCamera=h),e.setSize(f.width,f.height),t.getProjectionMatrix(!0)}else p.a.Error("No rendering canvas found !")},e}();ve.h.CreateScreenshot=Pl.CreateScreenshot,ve.h.CreateScreenshotUsingRenderTarget=Pl.CreateScreenshotUsingRenderTarget,i.d(t,"AbstractScene",function(){return r.a}),i.d(t,"Action",function(){return a}),i.d(t,"ActionEvent",function(){return c.a}),i.d(t,"ActionManager",function(){return C}),i.d(t,"Condition",function(){return u}),i.d(t,"ValueCondition",function(){return h}),i.d(t,"PredicateCondition",function(){return d}),i.d(t,"StateCondition",function(){return f}),i.d(t,"SwitchBooleanAction",function(){return m}),i.d(t,"SetStateAction",function(){return g}),i.d(t,"SetValueAction",function(){return v}),i.d(t,"IncrementValueAction",function(){return y}),i.d(t,"PlayAnimationAction",function(){return b}),i.d(t,"StopAnimationAction",function(){return T}),i.d(t,"DoNothingAction",function(){return E}),i.d(t,"CombineAction",function(){return x}),i.d(t,"ExecuteCodeAction",function(){return A}),i.d(t,"SetParentAction",function(){return P}),i.d(t,"PlaySoundAction",function(){return M}),i.d(t,"StopSoundAction",function(){return O}),i.d(t,"InterpolateValueAction",function(){return B}),i.d(t,"Animatable",function(){return K}),i.d(t,"Animation",function(){return N}),i.d(t,"TargetedAnimation",function(){return Q}),i.d(t,"AnimationGroup",function(){return q}),i.d(t,"AnimationPropertiesOverride",function(){return Z}),i.d(t,"EasingFunction",function(){return J}),i.d(t,"CircleEase",function(){return $}),i.d(t,"BackEase",function(){return ee}),i.d(t,"BounceEase",function(){return te}),i.d(t,"CubicEase",function(){return ie}),i.d(t,"ElasticEase",function(){return re}),i.d(t,"ExponentialEase",function(){return ne}),i.d(t,"PowerEase",function(){return oe}),i.d(t,"QuadraticEase",function(){return se}),i.d(t,"QuarticEase",function(){return ae}),i.d(t,"QuinticEase",function(){return ce}),i.d(t,"SineEase",function(){return le}),i.d(t,"BezierCurveEase",function(){return ue}),i.d(t,"RuntimeAnimation",function(){return j}),i.d(t,"AnimationEvent",function(){return he}),i.d(t,"AnimationKeyInterpolation",function(){return I}),i.d(t,"AnimationRange",function(){return L}),i.d(t,"KeepAssets",function(){return fe}),i.d(t,"AssetContainer",function(){return pe}),i.d(t,"Analyser",function(){return me}),i.d(t,"AudioEngine",function(){return ge}),i.d(t,"AudioSceneComponent",function(){return xe}),i.d(t,"Sound",function(){return be}),i.d(t,"SoundTrack",function(){return Te}),i.d(t,"WeightedSound",function(){return Ae}),i.d(t,"AutoRotationBehavior",function(){return Re}),i.d(t,"BouncingBehavior",function(){return Se}),i.d(t,"FramingBehavior",function(){return Ce}),i.d(t,"PointerDragBehavior",function(){return De.a}),i.d(t,"AttachToBoxBehavior",function(){return Oe}),i.d(t,"FadeInOutBehavior",function(){return Ie}),i.d(t,"MultiPointerScaleBehavior",function(){return we}),i.d(t,"SixDofDragBehavior",function(){return Be}),i.d(t,"Bone",function(){return Y}),i.d(t,"BoneIKController",function(){return Ue}),i.d(t,"BoneLookController",function(){return Ve}),i.d(t,"Skeleton",function(){return ze}),i.d(t,"CameraInputTypes",function(){return je}),i.d(t,"CameraInputsManager",function(){return We}),i.d(t,"Camera",function(){return Fe.a}),i.d(t,"TargetCamera",function(){return ft}),i.d(t,"FreeCamera",function(){return pt}),i.d(t,"FreeCameraInputsManager",function(){return st}),i.d(t,"TouchCamera",function(){return _t}),i.d(t,"ArcRotateCamera",function(){return mt}),i.d(t,"ArcRotateCameraInputsManager",function(){return $e}),i.d(t,"DeviceOrientationCamera",function(){return gt}),i.d(t,"FlyCamera",function(){return yt}),i.d(t,"FlyCameraInputsManager",function(){return vt}),i.d(t,"FollowCamera",function(){return xt}),i.d(t,"ArcFollowCamera",function(){return At}),i.d(t,"GamepadCamera",function(){return Rt}),i.d(t,"UniversalCamera",function(){return Pt}),i.d(t,"VirtualJoysticksCamera",function(){return Yt}),i.d(t,"ArcRotateCameraGamepadInput",function(){return Ke}),i.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return qe}),i.d(t,"ArcRotateCameraMouseWheelInput",function(){return Ze}),i.d(t,"ArcRotateCameraPointersInput",function(){return Je}),i.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return et}),i.d(t,"FlyCameraKeyboardInput",function(){return tt}),i.d(t,"FlyCameraMouseInput",function(){return it}),i.d(t,"FreeCameraDeviceOrientationInput",function(){return at}),i.d(t,"FreeCameraGamepadInput",function(){return ct}),i.d(t,"FreeCameraKeyboardMoveInput",function(){return rt}),i.d(t,"FreeCameraMouseInput",function(){return nt}),i.d(t,"FreeCameraTouchInput",function(){return ot}),i.d(t,"FreeCameraVirtualJoystickInput",function(){return dt}),i.d(t,"AnaglyphArcRotateCamera",function(){return Bt}),i.d(t,"AnaglyphFreeCamera",function(){return Ut}),i.d(t,"AnaglyphGamepadCamera",function(){return Vt}),i.d(t,"AnaglyphUniversalCamera",function(){return Gt}),i.d(t,"StereoscopicArcRotateCamera",function(){return jt}),i.d(t,"StereoscopicFreeCamera",function(){return Wt}),i.d(t,"StereoscopicGamepadCamera",function(){return Ht}),i.d(t,"StereoscopicUniversalCamera",function(){return Xt}),i.d(t,"VRCameraMetrics",function(){return Kt}),i.d(t,"VRDeviceOrientationArcRotateCamera",function(){return Zt}),i.d(t,"VRDeviceOrientationFreeCamera",function(){return Jt}),i.d(t,"VRDeviceOrientationGamepadCamera",function(){return ei}),i.d(t,"VRExperienceHelper",function(){return Ci}),i.d(t,"WebVRFreeCamera",function(){return ci}),i.d(t,"WebXRCamera",function(){return Mi}),i.d(t,"WebXREnterExitUIButton",function(){return Ui}),i.d(t,"WebXREnterExitUIOptions",function(){return Vi}),i.d(t,"WebXREnterExitUI",function(){return Gi}),i.d(t,"WebXRState",function(){return Li}),i.d(t,"WebXRExperienceHelper",function(){return Bi}),i.d(t,"WebXRController",function(){return ki}),i.d(t,"WebXRInput",function(){return zi}),i.d(t,"WebXRManagedOutputCanvas",function(){return ji}),i.d(t,"WebXRSessionManager",function(){return Fi}),i.d(t,"Collider",function(){return Hi}),i.d(t,"DefaultCollisionCoordinator",function(){return Xi}),i.d(t,"PickingInfo",function(){return Yi.a}),i.d(t,"IntersectionInfo",function(){return Ki.a}),i.d(t,"BoundingBox",function(){return Qi.a}),i.d(t,"BoundingInfo",function(){return qi.a}),i.d(t,"BoundingSphere",function(){return Zi.a}),i.d(t,"Ray",function(){return ti.a}),i.d(t,"Octree",function(){return $i}),i.d(t,"OctreeBlock",function(){return Ji}),i.d(t,"OctreeSceneComponent",function(){return er}),i.d(t,"AxesViewer",function(){return tr.AxesViewer}),i.d(t,"BoneAxesViewer",function(){return tr.BoneAxesViewer}),i.d(t,"DebugLayer",function(){return tr.DebugLayer}),i.d(t,"PhysicsViewer",function(){return tr.PhysicsViewer}),i.d(t,"RayHelper",function(){return tr.RayHelper}),i.d(t,"SkeletonViewer",function(){return tr.SkeletonViewer}),i.d(t,"Constants",function(){return _.a}),i.d(t,"InstancingAttributeInfo",function(){return _e.d}),i.d(t,"DepthTextureCreationOptions",function(){return _e.a}),i.d(t,"EngineCapabilities",function(){return _e.c}),i.d(t,"Engine",function(){return _e.b}),i.d(t,"EngineStore",function(){return R.a}),i.d(t,"NullEngineOptions",function(){return rr}),i.d(t,"NullEngine",function(){return nr}),i.d(t,"_OcclusionDataStorage",function(){return sr}),i.d(t,"_forceTransformFeedbackToBundle",function(){return!0}),i.d(t,"KeyboardEventTypes",function(){return Qe.a}),i.d(t,"KeyboardInfo",function(){return Qe.b}),i.d(t,"KeyboardInfoPre",function(){return Qe.c}),i.d(t,"PointerEventTypes",function(){return Pe.a}),i.d(t,"PointerInfoBase",function(){return Pe.c}),i.d(t,"PointerInfoPre",function(){return Pe.d}),i.d(t,"PointerInfo",function(){return Pe.b}),i.d(t,"ClipboardEventTypes",function(){return ar}),i.d(t,"ClipboardInfo",function(){return cr}),i.d(t,"DaydreamController",function(){return fr}),i.d(t,"GearVRController",function(){return pr}),i.d(t,"GenericController",function(){return _r}),i.d(t,"OculusTouchController",function(){return mr}),i.d(t,"PoseEnabledControllerType",function(){return $t}),i.d(t,"PoseEnabledControllerHelper",function(){return ii}),i.d(t,"PoseEnabledController",function(){return ri}),i.d(t,"ViveController",function(){return gr}),i.d(t,"WebVRController",function(){return li}),i.d(t,"WindowsMotionController",function(){return yr}),i.d(t,"StickValues",function(){return He}),i.d(t,"Gamepad",function(){return Xe}),i.d(t,"GenericPad",function(){return Ye}),i.d(t,"GamepadManager",function(){return xi}),i.d(t,"GamepadSystemSceneComponent",function(){return Ai}),i.d(t,"Xbox360Button",function(){return si}),i.d(t,"Xbox360Dpad",function(){return ai}),i.d(t,"Xbox360Pad",function(){return ui}),i.d(t,"AxisDragGizmo",function(){return br.a}),i.d(t,"AxisScaleGizmo",function(){return Pr}),i.d(t,"BoundingBoxGizmo",function(){return Sr}),i.d(t,"Gizmo",function(){return xr.a}),i.d(t,"GizmoManager",function(){return wr}),i.d(t,"PlaneRotationGizmo",function(){return Cr}),i.d(t,"PositionGizmo",function(){return Or}),i.d(t,"RotationGizmo",function(){return Mr}),i.d(t,"ScaleGizmo",function(){return Dr}),i.d(t,"LightGizmo",function(){return Lr}),i.d(t,"EnvironmentHelper",function(){return tn}),i.d(t,"PhotoDome",function(){return nn}),i.d(t,"_forceSceneHelpersToBundle",function(){return!0}),i.d(t,"VideoDome",function(){return vn}),i.d(t,"EngineInstrumentation",function(){return yn}),i.d(t,"SceneInstrumentation",function(){return bn}),i.d(t,"_TimeToken",function(){return or}),i.d(t,"EffectLayer",function(){return An}),i.d(t,"EffectLayerSceneComponent",function(){return Pn}),i.d(t,"GlowLayer",function(){return Cn}),i.d(t,"HighlightLayer",function(){return In}),i.d(t,"Layer",function(){return Fn}),i.d(t,"LayerSceneComponent",function(){return Dn}),i.d(t,"LensFlare",function(){return Nn}),i.d(t,"LensFlareSystem",function(){return Vn}),i.d(t,"LensFlareSystemSceneComponent",function(){return Gn}),i.d(t,"Light",function(){return ni.a}),i.d(t,"ShadowLight",function(){return kn}),i.d(t,"DirectionalLight",function(){return Yn}),i.d(t,"HemisphericLight",function(){return oi}),i.d(t,"PointLight",function(){return Kn}),i.d(t,"SpotLight",function(){return Qn}),i.d(t,"ShadowGenerator",function(){return Hn}),i.d(t,"ShadowGeneratorSceneComponent",function(){return Xn}),i.d(t,"DefaultLoadingScreen",function(){return qn}),i.d(t,"SceneLoaderProgressEvent",function(){return hr}),i.d(t,"SceneLoader",function(){return dr}),i.d(t,"SceneLoaderFlags",function(){return ur.a}),i.d(t,"_BabylonLoaderRegistered",function(){return!0}),i.d(t,"ColorCurves",function(){return mo.a}),i.d(t,"EffectFallbacks",function(){return Ct.c}),i.d(t,"EffectCreationOptions",function(){return Ct.b}),i.d(t,"Effect",function(){return Ct.a}),i.d(t,"FresnelParameters",function(){return go}),i.d(t,"ImageProcessingConfigurationDefines",function(){return hi.b}),i.d(t,"ImageProcessingConfiguration",function(){return hi.a}),i.d(t,"Material",function(){return Tn.a}),i.d(t,"MaterialDefines",function(){return Wr.a}),i.d(t,"MaterialHelper",function(){return jr.a}),i.d(t,"MultiMaterial",function(){return Jn.a}),i.d(t,"PushMaterial",function(){return Hr.a}),i.d(t,"ShaderMaterial",function(){return To.a}),i.d(t,"StandardMaterialDefines",function(){return di.b}),i.d(t,"StandardMaterial",function(){return di.a}),i.d(t,"BaseTexture",function(){return Fr.a}),i.d(t,"CubeTexture",function(){return zr}),i.d(t,"HDRCubeTexture",function(){return io}),i.d(t,"InternalTexture",function(){return Oi.a}),i.d(t,"DummyInternalTextureTracker",function(){return xo.a}),i.d(t,"MirrorTexture",function(){return kr}),i.d(t,"RawTexture",function(){return ke}),i.d(t,"RenderTargetTexture",function(){return wi}),i.d(t,"Texture",function(){return Ge.a}),i.d(t,"UniformBuffer",function(){return qo.a}),i.d(t,"MaterialFlags",function(){return Xr.a}),i.d(t,"BackgroundMaterial",function(){return $r}),i.d(t,"PBRBaseMaterial",function(){return _n}),i.d(t,"PBRBaseSimpleMaterial",function(){return vo}),i.d(t,"PBRMaterial",function(){return mn}),i.d(t,"PBRMetallicRoughnessMaterial",function(){return yo}),i.d(t,"PBRSpecularGlossinessMaterial",function(){return bo}),i.d(t,"ColorGradingTexture",function(){return Eo}),i.d(t,"DynamicTexture",function(){return fi}),i.d(t,"MultiRenderTarget",function(){return Go}),i.d(t,"ProceduralTexture",function(){return jo}),i.d(t,"ProceduralTextureSceneComponent",function(){return ko}),i.d(t,"RawCubeTexture",function(){return Yo}),i.d(t,"RawTexture3D",function(){return Ko}),i.d(t,"RefractionTexture",function(){return Qo}),i.d(t,"VideoTexture",function(){return gn}),i.d(t,"_DDSTextureLoader",function(){return Io}),i.d(t,"_ENVTextureLoader",function(){return Fo}),i.d(t,"_KTXTextureLoader",function(){return Bo}),i.d(t,"_TGATextureLoader",function(){return Vo}),i.d(t,"CustomProceduralTexture",function(){return Wo}),i.d(t,"NoiseProceduralTexture",function(){return Xo}),i.d(t,"Scalar",function(){return D.a}),i.d(t,"ToGammaSpace",function(){return o.u}),i.d(t,"ToLinearSpace",function(){return o.v}),i.d(t,"Epsilon",function(){return o.h}),i.d(t,"Color3",function(){return o.e}),i.d(t,"Color4",function(){return o.f}),i.d(t,"Vector2",function(){return o.w}),i.d(t,"Vector3",function(){return o.x}),i.d(t,"Vector4",function(){return o.y}),i.d(t,"Size",function(){return o.r}),i.d(t,"Quaternion",function(){return o.q}),i.d(t,"Matrix",function(){return o.j}),i.d(t,"Plane",function(){return o.n}),i.d(t,"Viewport",function(){return o.z}),i.d(t,"Frustum",function(){return o.i}),i.d(t,"Space",function(){return o.s}),i.d(t,"Axis",function(){return o.c}),i.d(t,"BezierCurve",function(){return o.d}),i.d(t,"Orientation",function(){return o.k}),i.d(t,"Angle",function(){return o.a}),i.d(t,"Arc2",function(){return o.b}),i.d(t,"Path2",function(){return o.l}),i.d(t,"Path3D",function(){return o.m}),i.d(t,"Curve3",function(){return o.g}),i.d(t,"PositionNormalVertex",function(){return o.p}),i.d(t,"PositionNormalTextureVertex",function(){return o.o}),i.d(t,"Tmp",function(){return o.t}),i.d(t,"SphericalPolynomial",function(){return Ao.b}),i.d(t,"SphericalHarmonics",function(){return Ao.a}),i.d(t,"AbstractMesh",function(){return Le.a}),i.d(t,"Buffer",function(){return gi.a}),i.d(t,"VertexBuffer",function(){return gi.b}),i.d(t,"CSG",function(){return ns}),i.d(t,"Geometry",function(){return Zn.a}),i.d(t,"GroundMesh",function(){return vi}),i.d(t,"InstancedMesh",function(){return os.a}),i.d(t,"LinesMesh",function(){return ss.b}),i.d(t,"InstancedLinesMesh",function(){return ss.a}),i.d(t,"MeshLODLevel",function(){return de.b}),i.d(t,"_CreationDataStorage",function(){return de.c}),i.d(t,"_InstancesBatch",function(){return de.d}),i.d(t,"Mesh",function(){return de.a}),i.d(t,"VertexData",function(){return mi.a}),i.d(t,"MeshBuilder",function(){return Ts}),i.d(t,"SimplificationSettings",function(){return Es}),i.d(t,"SimplificationQueue",function(){return xs}),i.d(t,"SimplificationType",function(){return ys}),i.d(t,"SimplicationQueueSceneComponent",function(){return Ms}),i.d(t,"Polygon",function(){return ds}),i.d(t,"PolygonMeshBuilder",function(){return fs}),i.d(t,"BaseSubMesh",function(){return Jo.a}),i.d(t,"SubMesh",function(){return Jo.b}),i.d(t,"TransformNode",function(){return rn.a}),i.d(t,"BoxBuilder",function(){return Tr.a}),i.d(t,"DiscBuilder",function(){return cs}),i.d(t,"SphereBuilder",function(){return Rr.a}),i.d(t,"CylinderBuilder",function(){return Ti.a}),i.d(t,"LinesBuilder",function(){return Er.a}),i.d(t,"PlaneBuilder",function(){return en.a}),i.d(t,"DracoCompression",function(){return Zo}),i.d(t,"RibbonBuilder",function(){return as}),i.d(t,"TorusBuilder",function(){return bi}),i.d(t,"TorusKnotBuilder",function(){return ls}),i.d(t,"PolygonBuilder",function(){return ps}),i.d(t,"ShapeBuilder",function(){return _s}),i.d(t,"LatheBuilder",function(){return ms}),i.d(t,"GroundBuilder",function(){return yi}),i.d(t,"TubeBuilder",function(){return gs}),i.d(t,"PolyhedronBuilder",function(){return Ir}),i.d(t,"IcoSphereBuilder",function(){return vs}),i.d(t,"DecalBuilder",function(){return bs}),i.d(t,"MorphTarget",function(){return ro}),i.d(t,"MorphTargetManager",function(){return no}),i.d(t,"Node",function(){return F.a}),i.d(t,"Database",function(){return Is}),i.d(t,"BaseParticleSystem",function(){return Gs}),i.d(t,"GPUParticleSystem",function(){return Zs}),i.d(t,"Particle",function(){return ks}),i.d(t,"ParticleHelper",function(){return $s}),i.d(t,"ParticleSystem",function(){return Hs}),i.d(t,"_IDoNeedToBeInTheBuild",function(){return 42}),i.d(t,"ParticleSystemSet",function(){return Js}),i.d(t,"SolidParticle",function(){return ea}),i.d(t,"ModelShape",function(){return ta}),i.d(t,"DepthSortedParticle",function(){return ia}),i.d(t,"SolidParticleSystem",function(){return na}),i.d(t,"SubEmitterType",function(){return Os}),i.d(t,"SubEmitter",function(){return zs}),i.d(t,"BoxParticleEmitter",function(){return Ds}),i.d(t,"ConeParticleEmitter",function(){return ws}),i.d(t,"CylinderParticleEmitter",function(){return Ls}),i.d(t,"CylinderDirectedParticleEmitter",function(){return Fs}),i.d(t,"HemisphericParticleEmitter",function(){return Ns}),i.d(t,"PointParticleEmitter",function(){return Bs}),i.d(t,"SphereParticleEmitter",function(){return Us}),i.d(t,"SphereDirectedParticleEmitter",function(){return Vs}),i.d(t,"PhysicsEngine",function(){return ao}),i.d(t,"PhysicsEngineSceneComponent",function(){return aa}),i.d(t,"PhysicsHelper",function(){return ca}),i.d(t,"PhysicsRadialExplosionEvent",function(){return la}),i.d(t,"PhysicsGravitationalFieldEvent",function(){return ua}),i.d(t,"PhysicsUpdraftEvent",function(){return ha}),i.d(t,"PhysicsVortexEvent",function(){return da}),i.d(t,"PhysicsRadialImpulseFalloff",function(){return oa}),i.d(t,"PhysicsUpdraftMode",function(){return sa}),i.d(t,"PhysicsImpostor",function(){return oo.a}),i.d(t,"PhysicsJoint",function(){return so.e}),i.d(t,"DistanceJoint",function(){return so.a}),i.d(t,"MotorEnabledJoint",function(){return so.d}),i.d(t,"HingeJoint",function(){return so.c}),i.d(t,"Hinge2Joint",function(){return so.b}),i.d(t,"CannonJSPlugin",function(){return co}),i.d(t,"AmmoJSPlugin",function(){return fa}),i.d(t,"OimoJSPlugin",function(){return lo}),i.d(t,"AnaglyphPostProcess",function(){return Nt}),i.d(t,"BlackAndWhitePostProcess",function(){return _a}),i.d(t,"BloomEffect",function(){return Ta}),i.d(t,"BloomMergePostProcess",function(){return ba}),i.d(t,"BlurPostProcess",function(){return Gr}),i.d(t,"ChromaticAberrationPostProcess",function(){return xa}),i.d(t,"CircleOfConfusionPostProcess",function(){return Pa}),i.d(t,"ColorCorrectionPostProcess",function(){return Sa}),i.d(t,"ConvolutionPostProcess",function(){return Ma}),i.d(t,"DepthOfFieldBlurPostProcess",function(){return Oa}),i.d(t,"DepthOfFieldEffectBlurLevel",function(){return Da}),i.d(t,"DepthOfFieldEffect",function(){return Fa}),i.d(t,"DepthOfFieldMergePostProcessOptions",function(){return wa}),i.d(t,"DepthOfFieldMergePostProcess",function(){return La}),i.d(t,"DisplayPassPostProcess",function(){return Ba}),i.d(t,"ExtractHighlightsPostProcess",function(){return va}),i.d(t,"FilterPostProcess",function(){return Va}),i.d(t,"FxaaPostProcess",function(){return za}),i.d(t,"GrainPostProcess",function(){return Wa}),i.d(t,"HighlightsPostProcess",function(){return Xa}),i.d(t,"ImageProcessingPostProcess",function(){return _i}),i.d(t,"MotionBlurPostProcess",function(){return Za}),i.d(t,"PassPostProcess",function(){return wt}),i.d(t,"PassCubePostProcess",function(){return Lt}),i.d(t,"PostProcess",function(){return Ot}),i.d(t,"PostProcessManager",function(){return Ii.a}),i.d(t,"RefractionPostProcess",function(){return $a}),i.d(t,"SharpenPostProcess",function(){return tc}),i.d(t,"StereoscopicInterlacePostProcess",function(){return zt}),i.d(t,"TonemappingOperator",function(){return gc}),i.d(t,"TonemapPostProcess",function(){return vc}),i.d(t,"VolumetricLightScatteringPostProcess",function(){return Ec}),i.d(t,"VRDistortionCorrectionPostProcess",function(){return qt}),i.d(t,"PostProcessRenderEffect",function(){return ma}),i.d(t,"PostProcessRenderPipeline",function(){return ic}),i.d(t,"PostProcessRenderPipelineManager",function(){return pc}),i.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return _c}),i.d(t,"DefaultRenderingPipeline",function(){return rc}),i.d(t,"LensRenderingPipeline",function(){return sc}),i.d(t,"SSAO2RenderingPipeline",function(){return lc}),i.d(t,"SSAORenderingPipeline",function(){return hc}),i.d(t,"StandardRenderingPipeline",function(){return fc}),i.d(t,"ReflectionProbe",function(){return uo}),i.d(t,"BoundingBoxRenderer",function(){return xc}),i.d(t,"DepthRenderer",function(){return Pc}),i.d(t,"DepthRendererSceneComponent",function(){return Rc}),i.d(t,"EdgesRenderer",function(){return Oc}),i.d(t,"LineEdgesRenderer",function(){return Ic}),i.d(t,"GeometryBufferRenderer",function(){return Qa}),i.d(t,"GeometryBufferRendererSceneComponent",function(){return Dc}),i.d(t,"OutlineRenderer",function(){return Fc}),i.d(t,"RenderingGroup",function(){return Nc.a}),i.d(t,"RenderingGroupInfo",function(){return Di.a}),i.d(t,"RenderingManager",function(){return Di.b}),i.d(t,"UtilityLayerRenderer",function(){return Ar.a}),i.d(t,"Scene",function(){return W.a}),i.d(t,"SceneComponentConstants",function(){return Ee.a}),i.d(t,"Stage",function(){return Ee.b}),i.d(t,"Sprite",function(){return Bc}),i.d(t,"SpriteManager",function(){return zc}),i.d(t,"SpriteSceneComponent",function(){return Uc}),i.d(t,"_AlphaState",function(){return jc.a}),i.d(t,"_DepthCullingState",function(){return jc.b}),i.d(t,"_StencilState",function(){return jc.c}),i.d(t,"AndOrNotEvaluator",function(){return Wc.a}),i.d(t,"AssetTaskState",function(){return kc}),i.d(t,"AbstractAssetTask",function(){return Xc}),i.d(t,"AssetsProgressEvent",function(){return Yc}),i.d(t,"MeshAssetTask",function(){return Kc}),i.d(t,"TextFileAssetTask",function(){return Qc}),i.d(t,"BinaryFileAssetTask",function(){return qc}),i.d(t,"ImageAssetTask",function(){return Zc}),i.d(t,"TextureAssetTask",function(){return Jc}),i.d(t,"CubeTextureAssetTask",function(){return $c}),i.d(t,"HDRCubeTextureAssetTask",function(){return el}),i.d(t,"AssetsManager",function(){return tl}),i.d(t,"DDSTools",function(){return Oo}),i.d(t,"expandToProperty",function(){return w.b}),i.d(t,"serialize",function(){return w.c}),i.d(t,"serializeAsTexture",function(){return w.l}),i.d(t,"serializeAsColor3",function(){return w.e}),i.d(t,"serializeAsFresnelParameters",function(){return w.h}),i.d(t,"serializeAsVector2",function(){return w.m}),i.d(t,"serializeAsVector3",function(){return w.n}),i.d(t,"serializeAsMeshReference",function(){return w.j}),i.d(t,"serializeAsColorCurves",function(){return w.g}),i.d(t,"serializeAsColor4",function(){return w.f}),i.d(t,"serializeAsImageProcessingConfiguration",function(){return w.i}),i.d(t,"serializeAsQuaternion",function(){return w.k}),i.d(t,"serializeAsCameraReference",function(){return w.d}),i.d(t,"SerializationHelper",function(){return w.a}),i.d(t,"Deferred",function(){return il}),i.d(t,"EnvironmentTextureTools",function(){return Lo}),i.d(t,"FilesInput",function(){return rl}),i.d(t,"KhronosTextureContainer",function(){return No}),i.d(t,"EventState",function(){return n.a}),i.d(t,"Observer",function(){return n.d}),i.d(t,"MultiObserver",function(){return n.b}),i.d(t,"Observable",function(){return n.c}),i.d(t,"PerformanceMonitor",function(){return nl.a}),i.d(t,"RollingAverage",function(){return nl.b}),i.d(t,"PromisePolyfill",function(){return ol.a}),i.d(t,"SceneOptimization",function(){return sl}),i.d(t,"TextureOptimization",function(){return al}),i.d(t,"HardwareScalingOptimization",function(){return cl}),i.d(t,"ShadowsOptimization",function(){return ll}),i.d(t,"PostProcessesOptimization",function(){return ul}),i.d(t,"LensFlaresOptimization",function(){return hl}),i.d(t,"CustomOptimization",function(){return dl}),i.d(t,"ParticlesOptimization",function(){return fl}),i.d(t,"RenderTargetsOptimization",function(){return pl}),i.d(t,"MergeMeshesOptimization",function(){return _l}),i.d(t,"SceneOptimizerOptions",function(){return ml}),i.d(t,"SceneOptimizer",function(){return gl}),i.d(t,"SceneSerializer",function(){return Tl}),i.d(t,"SmartArray",function(){return St.a}),i.d(t,"SmartArrayNoDuplicate",function(){return St.b}),i.d(t,"StringDictionary",function(){return ut.a}),i.d(t,"Tags",function(){return El.a}),i.d(t,"TextureTools",function(){return on}),i.d(t,"TGATools",function(){return Uo}),i.d(t,"ColorGradient",function(){return ve.c}),i.d(t,"Color3Gradient",function(){return ve.b}),i.d(t,"FactorGradient",function(){return ve.d}),i.d(t,"LoadFileError",function(){return ve.e}),i.d(t,"RetryStrategy",function(){return ve.g}),i.d(t,"Tools",function(){return ve.h}),i.d(t,"PerfCounter",function(){return ve.f}),i.d(t,"className",function(){return ve.i}),i.d(t,"AsyncLoop",function(){return ve.a}),i.d(t,"VideoRecorder",function(){return xl}),i.d(t,"JoystickAxis",function(){return lt}),i.d(t,"VirtualJoystick",function(){return ht}),i.d(t,"WorkerPool",function(){return Al}),i.d(t,"Logger",function(){return p.a}),i.d(t,"_TypeStore",function(){return s.a}),i.d(t,"FilesInputStore",function(){return lr.a}),i.d(t,"DeepCopier",function(){return S.a}),i.d(t,"PivotTools",function(){return Ne.a}),i.d(t,"PrecisionDate",function(){return H.a}),i.d(t,"ScreenshotTools",function(){return Pl}),i.d(t,"CubeMapToSphericalPolynomialTools",function(){return to.a}),i.d(t,"HDRTools",function(){return eo}),i.d(t,"PanoramaToCubeMapTools",function(){return $n})},function(e,t,i){"use strict";i.r(t);var r=i(0),n=i(33),o=i(57),s=function(){function e(t,i,s,a,c,l){if(void 0===i&&(i=1),void 0===s&&(s=2),this._scaleLinesFactor=4,this._instanced=!1,this.scaleLines=1,this.scaleLines=i,!a){var u=new n.a("",t);u.disableLighting=!0,u.emissiveColor=r.e.Red().scale(.5),a=o.a._CreateArrow(t,u)}if(!c){var h=new n.a("",t);h.disableLighting=!0,h.emissiveColor=r.e.Green().scale(.5),c=o.a._CreateArrow(t,h)}if(!l){var d=new n.a("",t);d.disableLighting=!0,d.emissiveColor=r.e.Blue().scale(.5),l=o.a._CreateArrow(t,d)}this._xAxis=a,this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis=c,this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis=l,this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),null!=s&&(e._SetRenderingGroupId(this._xAxis,s),e._SetRenderingGroupId(this._yAxis,s),e._SetRenderingGroupId(this._zAxis,s)),this.scene=t,this.update(new r.x,r.x.Right(),r.x.Up(),r.x.Forward())}return Object.defineProperty(e.prototype,"xAxis",{get:function(){return this._xAxis},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yAxis",{get:function(){return this._yAxis},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zAxis",{get:function(){return this._zAxis},enumerable:!0,configurable:!0}),e.prototype.update=function(e,t,i,r){this._xAxis.position.copyFrom(e),this._xAxis.setDirection(t),this._xAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._yAxis.position.copyFrom(e),this._yAxis.setDirection(i),this._yAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor),this._zAxis.position.copyFrom(e),this._zAxis.setDirection(r),this._zAxis.scaling.setAll(this.scaleLines*this._scaleLinesFactor)},e.prototype.createInstance=function(){var t=o.a._CreateArrowInstance(this.scene,this._xAxis),i=o.a._CreateArrowInstance(this.scene,this._yAxis),r=o.a._CreateArrowInstance(this.scene,this._zAxis),n=new e(this.scene,this.scaleLines,null,t,i,r);return n._instanced=!0,n},e.prototype.dispose=function(){this._xAxis&&(this._xAxis.dispose(!1,!this._instanced),delete this._xAxis),this._yAxis&&(this._yAxis.dispose(!1,!this._instanced),delete this._yAxis),this._zAxis&&(this._zAxis.dispose(!1,!this._instanced),delete this._zAxis),delete this.scene},e._SetRenderingGroupId=function(e,t){e.getChildMeshes().forEach(function(e){e.renderingGroupId=t})},e}(),a=i(1),c=function(e){function t(t,i,n,o){void 0===o&&(o=1);var s=e.call(this,t,o)||this;return s.pos=r.x.Zero(),s.xaxis=r.x.Zero(),s.yaxis=r.x.Zero(),s.zaxis=r.x.Zero(),s.mesh=n,s.bone=i,s}return a.d(t,e),t.prototype.update=function(){if(this.mesh&&this.bone){var t=this.bone;t.getAbsolutePositionToRef(this.mesh,this.pos),t.getDirectionToRef(r.c.X,this.mesh,this.xaxis),t.getDirectionToRef(r.c.Y,this.mesh,this.yaxis),t.getDirectionToRef(r.c.Z,this.mesh,this.zaxis),e.prototype.update.call(this,this.pos,this.xaxis,this.yaxis,this.zaxis)}},t.prototype.dispose=function(){this.mesh&&(this.mesh=null,this.bone=null,e.prototype.dispose.call(this))},t}(s),l=i(9),u=i(7),h=i(16);Object.defineProperty(h.a.prototype,"debugLayer",{get:function(){return this._debugLayer||(this._debugLayer=new d(this)),this._debugLayer},enumerable:!0,configurable:!0});var d=function(){function e(e){var t=this;this.BJSINSPECTOR=this._getGlobalInspector(),this.onPropertyChangedObservable=new u.c,this._scene=e,this._scene.onDisposeObservable.add(function(){t._scene._debugLayer&&t._scene._debugLayer.hide()})}return e.prototype._createInspector=function(e){if(!this.isVisible()){var t=a.a({overlay:!1,showExplorer:!0,showInspector:!0,embedMode:!1,handleResize:!0,enablePopup:!0},e);this.BJSINSPECTOR=this.BJSINSPECTOR||this._getGlobalInspector(),this.BJSINSPECTOR.Inspector.Show(this._scene,t)}},e.prototype._getGlobalInspector=function(){return"undefined"!=typeof INSPECTOR?INSPECTOR:"undefined"!=typeof BABYLON&&void 0!==BABYLON.Inspector?BABYLON:void 0},e.prototype.isVisible=function(){return this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.IsVisible},e.prototype.hide=function(){this.BJSINSPECTOR&&this.BJSINSPECTOR.Inspector.Hide()},e.prototype.show=function(t){void 0===this.BJSINSPECTOR?l.h.LoadScript(e.InspectorURL,this._createInspector.bind(this,t)):this._createInspector(t)},e.InspectorURL="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js",e}(),f=i(51),p=i(55),_=i(23),m=i(31),g=i(41),v=function(){function e(e){this._impostors=[],this._meshes=[],this._numMeshes=0,this._scene=e||_.a.LastCreatedScene;var t=this._scene.getPhysicsEngine();t&&(this._physicsEnginePlugin=t.getPhysicsPlugin()),this._utilityLayer=new g.a(this._scene,!1),this._utilityLayer.pickUtilitySceneFirst=!1,this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil=!0}return e.prototype._updateDebugMeshes=function(){for(var e=this._physicsEnginePlugin,t=0;t0?(this._meshes[r]=this._meshes[this._numMeshes],this._impostors[r]=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 n.a("",e),this._debugMaterial.wireframe=!0,this._debugMaterial.emissiveColor=r.e.White(),this._debugMaterial.disableLighting=!0),this._debugMaterial},e.prototype._getDebugBoxMesh=function(e){return this._debugBoxMesh||(this._debugBoxMesh=f.a.CreateBox("physicsBodyBoxViewMesh",{size:1},e),this._debugBoxMesh.rotationQuaternion=r.q.Identity(),this._debugBoxMesh.material=this._getDebugMaterial(e)),this._debugBoxMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugSphereMesh=function(e){return this._debugSphereMesh||(this._debugSphereMesh=p.a.CreateSphere("physicsBodySphereViewMesh",{diameter:1},e),this._debugSphereMesh.rotationQuaternion=r.q.Identity(),this._debugSphereMesh.material=this._getDebugMaterial(e)),this._debugSphereMesh.createInstance("physicsBodyBoxViewInstance")},e.prototype._getDebugMesh=function(e){if(!this._utilityLayer)return null;var t=null,i=this._utilityLayer.utilityLayerScene;if(e.type==m.a.BoxImpostor)t=this._getDebugBoxMesh(i),e.getBoxSizeToRef(t.scaling);else if(e.type==m.a.SphereImpostor){t=this._getDebugSphereMesh(i);var r=e.getRadius();t.scaling.x=2*r,t.scaling.y=2*r,t.scaling.z=2*r}return t},e.prototype.dispose=function(){for(var e=0;e=0;s--){var a=e[s],c=a.getParent();if(c){var l=this._debugLines[n];l||(l=[r.x.Zero(),r.x.Zero()],this._debugLines[n]=l),a.getAbsolutePositionToRef(this.mesh,l[0]),c.getAbsolutePositionToRef(this.mesh,l[1]),l[0].subtractInPlace(o),l[1].subtractInPlace(o),n++}}},e.prototype.update=function(){if(this._utilityLayer){this.autoUpdateBonesMatrices&&this.skeleton.computeAbsoluteTransforms(),void 0===this.skeleton.bones[0].length?this._getLinesForBonesNoLength(this.skeleton.bones,this.mesh.getWorldMatrix()):this._getLinesForBonesWithLength(this.skeleton.bones,this.mesh.getWorldMatrix());var e=this._utilityLayer.utilityLayerScene;this._debugMesh?b.a.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:this._debugMesh},e):(this._debugMesh=b.a.CreateLineSystem("",{lines:this._debugLines,updatable:!0,instance:null},e),this._debugMesh.renderingGroupId=this.renderingGroupId),this._debugMesh.position.copyFrom(this.mesh.position),this._debugMesh.color=this.color}},e.prototype.dispose=function(){this.isEnabled=!1,this._debugMesh&&(this.isEnabled=!1,this._debugMesh.dispose(),this._debugMesh=null),this._utilityLayer&&(this._utilityLayer.dispose(),this._utilityLayer=null)},e}();i.d(t,"AxesViewer",function(){return s}),i.d(t,"BoneAxesViewer",function(){return c}),i.d(t,"DebugLayer",function(){return d}),i.d(t,"PhysicsViewer",function(){return v}),i.d(t,"RayHelper",function(){return T}),i.d(t,"SkeletonViewer",function(){return E})},function(e,t,i){"use strict";var r="clipPlaneFragmentDeclaration",n="#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";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="fogFragmentDeclaration",n="#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";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif";i(5).a.IncludesShadersStore.fogFragment=r},function(e,t,i){"use strict";var r="clipPlaneVertexDeclaration",n="#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";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="fogVertexDeclaration",n="#ifdef FOG\nvarying vec3 vFogDistance;\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="morphTargetsVertexGlobalDeclaration",n="#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="morphTargetsVertexDeclaration",n="#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";var r="morphTargetsVertex",n="#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#endif";i(5).a.IncludesShadersStore[r]=n},function(e,t,i){"use strict";i.d(t,"a",function(){return r});var r=function(){function e(){}return e.Eval=function(t,i){return"true"===(t=t.match(/\([^\(\)]*\)/g)?t.replace(/\([^\(\)]*\)/g,function(t){return t=t.slice(1,t.length-1),e._HandleParenthesisContent(t,i)}):e._HandleParenthesisContent(t,i))||"false"!==t&&e.Eval(t,i)},e._HandleParenthesisContent=function(t,i){var r;i=i||function(e){return"true"===e};var n=t.split("||");for(var o in n)if(n.hasOwnProperty(o)){var s=e._SimplifyNegation(n[o].trim()),a=s.split("&&");if(a.length>1)for(var c=0;c=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}()},function(e,t,i){"use strict";i.d(t,"a",function(){return a});var r,n=i(9);!function(e){e[e.Pending=0]="Pending",e[e.Fulfilled=1]="Fulfilled",e[e.Rejected=2]="Rejected"}(r||(r={}));var o=function(){return function(){this.count=0,this.target=0,this.results=[]}}(),s=function(){function e(e){var t=this;if(this._state=r.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,i){var o=this,s=new e;return s._onFulfilled=t,s._onRejected=i,this._children.push(s),s._parent=this,this._state!==r.Pending&&n.h.SetImmediate(function(){if(o._state===r.Fulfilled||o._rejectWasConsumed){var e=s._resolve(o._result);if(null!=e)if(void 0!==e._state){var t=e;s._children.push(t),t._parent=s,s=t}else s._result=e}else s._reject(o._reason)}),s},e.prototype._moveChildren=function(e){var t,i=this;if((t=this._children).push.apply(t,e.splice(0,e.length)),this._children.forEach(function(e){e._parent=i}),this._state===r.Fulfilled)for(var n=0,o=this._children;ni._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,i){void 0===t&&(t=e.getMesh()),void 0===i&&(i=e.getMaterial()),null!=i&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTesting()?(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._edgesRenderer&&t._edgesRenderer.isEnabled&&this._edgesRenderers.push(t._edgesRenderer))},e.prototype.dispatchSprites=function(e){this._spriteManagers.push(e)},e.prototype.dispatchParticles=function(e){this._particleSystems.push(e)},e.prototype._renderParticles=function(e){if(0!==this._particleSystems.length){var t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(var i=0;i\n\n#include\nuniform mat4 viewProjection;\n\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include\n#include\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n}";r.a.ShadersStore[n]=o},function(e,t,i){"use strict";i.r(t),function(e){var r=i(91),n=i(92);i.d(t,"AbstractScene",function(){return r.AbstractScene}),i.d(t,"KeepAssets",function(){return r.KeepAssets}),i.d(t,"AssetContainer",function(){return r.AssetContainer}),i.d(t,"Node",function(){return r.Node}),i.d(t,"Scene",function(){return r.Scene}),i.d(t,"SceneComponentConstants",function(){return r.SceneComponentConstants}),i.d(t,"Stage",function(){return r.Stage}),i.d(t,"Action",function(){return r.Action}),i.d(t,"ActionEvent",function(){return r.ActionEvent}),i.d(t,"ActionManager",function(){return r.ActionManager}),i.d(t,"Condition",function(){return r.Condition}),i.d(t,"ValueCondition",function(){return r.ValueCondition}),i.d(t,"PredicateCondition",function(){return r.PredicateCondition}),i.d(t,"StateCondition",function(){return r.StateCondition}),i.d(t,"SwitchBooleanAction",function(){return r.SwitchBooleanAction}),i.d(t,"SetStateAction",function(){return r.SetStateAction}),i.d(t,"SetValueAction",function(){return r.SetValueAction}),i.d(t,"IncrementValueAction",function(){return r.IncrementValueAction}),i.d(t,"PlayAnimationAction",function(){return r.PlayAnimationAction}),i.d(t,"StopAnimationAction",function(){return r.StopAnimationAction}),i.d(t,"DoNothingAction",function(){return r.DoNothingAction}),i.d(t,"CombineAction",function(){return r.CombineAction}),i.d(t,"ExecuteCodeAction",function(){return r.ExecuteCodeAction}),i.d(t,"SetParentAction",function(){return r.SetParentAction}),i.d(t,"PlaySoundAction",function(){return r.PlaySoundAction}),i.d(t,"StopSoundAction",function(){return r.StopSoundAction}),i.d(t,"InterpolateValueAction",function(){return r.InterpolateValueAction}),i.d(t,"Animatable",function(){return r.Animatable}),i.d(t,"Animation",function(){return r.Animation}),i.d(t,"TargetedAnimation",function(){return r.TargetedAnimation}),i.d(t,"AnimationGroup",function(){return r.AnimationGroup}),i.d(t,"AnimationPropertiesOverride",function(){return r.AnimationPropertiesOverride}),i.d(t,"EasingFunction",function(){return r.EasingFunction}),i.d(t,"CircleEase",function(){return r.CircleEase}),i.d(t,"BackEase",function(){return r.BackEase}),i.d(t,"BounceEase",function(){return r.BounceEase}),i.d(t,"CubicEase",function(){return r.CubicEase}),i.d(t,"ElasticEase",function(){return r.ElasticEase}),i.d(t,"ExponentialEase",function(){return r.ExponentialEase}),i.d(t,"PowerEase",function(){return r.PowerEase}),i.d(t,"QuadraticEase",function(){return r.QuadraticEase}),i.d(t,"QuarticEase",function(){return r.QuarticEase}),i.d(t,"QuinticEase",function(){return r.QuinticEase}),i.d(t,"SineEase",function(){return r.SineEase}),i.d(t,"BezierCurveEase",function(){return r.BezierCurveEase}),i.d(t,"RuntimeAnimation",function(){return r.RuntimeAnimation}),i.d(t,"AnimationEvent",function(){return r.AnimationEvent}),i.d(t,"AnimationKeyInterpolation",function(){return r.AnimationKeyInterpolation}),i.d(t,"AnimationRange",function(){return r.AnimationRange}),i.d(t,"Analyser",function(){return r.Analyser}),i.d(t,"AudioEngine",function(){return r.AudioEngine}),i.d(t,"AudioSceneComponent",function(){return r.AudioSceneComponent}),i.d(t,"Sound",function(){return r.Sound}),i.d(t,"SoundTrack",function(){return r.SoundTrack}),i.d(t,"WeightedSound",function(){return r.WeightedSound}),i.d(t,"AutoRotationBehavior",function(){return r.AutoRotationBehavior}),i.d(t,"BouncingBehavior",function(){return r.BouncingBehavior}),i.d(t,"FramingBehavior",function(){return r.FramingBehavior}),i.d(t,"PointerDragBehavior",function(){return r.PointerDragBehavior}),i.d(t,"Bone",function(){return r.Bone}),i.d(t,"BoneIKController",function(){return r.BoneIKController}),i.d(t,"BoneLookController",function(){return r.BoneLookController}),i.d(t,"Skeleton",function(){return r.Skeleton}),i.d(t,"CameraInputTypes",function(){return r.CameraInputTypes}),i.d(t,"CameraInputsManager",function(){return r.CameraInputsManager}),i.d(t,"Camera",function(){return r.Camera}),i.d(t,"TargetCamera",function(){return r.TargetCamera}),i.d(t,"FreeCamera",function(){return r.FreeCamera}),i.d(t,"FreeCameraInputsManager",function(){return r.FreeCameraInputsManager}),i.d(t,"TouchCamera",function(){return r.TouchCamera}),i.d(t,"ArcRotateCamera",function(){return r.ArcRotateCamera}),i.d(t,"ArcRotateCameraInputsManager",function(){return r.ArcRotateCameraInputsManager}),i.d(t,"DeviceOrientationCamera",function(){return r.DeviceOrientationCamera}),i.d(t,"FlyCamera",function(){return r.FlyCamera}),i.d(t,"FlyCameraInputsManager",function(){return r.FlyCameraInputsManager}),i.d(t,"FollowCamera",function(){return r.FollowCamera}),i.d(t,"ArcFollowCamera",function(){return r.ArcFollowCamera}),i.d(t,"GamepadCamera",function(){return r.GamepadCamera}),i.d(t,"UniversalCamera",function(){return r.UniversalCamera}),i.d(t,"VirtualJoysticksCamera",function(){return r.VirtualJoysticksCamera}),i.d(t,"Collider",function(){return r.Collider}),i.d(t,"DefaultCollisionCoordinator",function(){return r.DefaultCollisionCoordinator}),i.d(t,"PickingInfo",function(){return r.PickingInfo}),i.d(t,"IntersectionInfo",function(){return r.IntersectionInfo}),i.d(t,"BoundingBox",function(){return r.BoundingBox}),i.d(t,"BoundingInfo",function(){return r.BoundingInfo}),i.d(t,"BoundingSphere",function(){return r.BoundingSphere}),i.d(t,"Ray",function(){return r.Ray}),i.d(t,"AxesViewer",function(){return r.AxesViewer}),i.d(t,"BoneAxesViewer",function(){return r.BoneAxesViewer}),i.d(t,"DebugLayer",function(){return r.DebugLayer}),i.d(t,"PhysicsViewer",function(){return r.PhysicsViewer}),i.d(t,"RayHelper",function(){return r.RayHelper}),i.d(t,"SkeletonViewer",function(){return r.SkeletonViewer}),i.d(t,"Constants",function(){return r.Constants}),i.d(t,"InstancingAttributeInfo",function(){return r.InstancingAttributeInfo}),i.d(t,"DepthTextureCreationOptions",function(){return r.DepthTextureCreationOptions}),i.d(t,"EngineCapabilities",function(){return r.EngineCapabilities}),i.d(t,"Engine",function(){return r.Engine}),i.d(t,"EngineStore",function(){return r.EngineStore}),i.d(t,"NullEngineOptions",function(){return r.NullEngineOptions}),i.d(t,"NullEngine",function(){return r.NullEngine}),i.d(t,"KeyboardEventTypes",function(){return r.KeyboardEventTypes}),i.d(t,"KeyboardInfo",function(){return r.KeyboardInfo}),i.d(t,"KeyboardInfoPre",function(){return r.KeyboardInfoPre}),i.d(t,"PointerEventTypes",function(){return r.PointerEventTypes}),i.d(t,"PointerInfoBase",function(){return r.PointerInfoBase}),i.d(t,"PointerInfoPre",function(){return r.PointerInfoPre}),i.d(t,"PointerInfo",function(){return r.PointerInfo}),i.d(t,"ClipboardEventTypes",function(){return r.ClipboardEventTypes}),i.d(t,"ClipboardInfo",function(){return r.ClipboardInfo}),i.d(t,"DaydreamController",function(){return r.DaydreamController}),i.d(t,"GearVRController",function(){return r.GearVRController}),i.d(t,"GenericController",function(){return r.GenericController}),i.d(t,"OculusTouchController",function(){return r.OculusTouchController}),i.d(t,"PoseEnabledControllerType",function(){return r.PoseEnabledControllerType}),i.d(t,"PoseEnabledControllerHelper",function(){return r.PoseEnabledControllerHelper}),i.d(t,"PoseEnabledController",function(){return r.PoseEnabledController}),i.d(t,"ViveController",function(){return r.ViveController}),i.d(t,"WebVRController",function(){return r.WebVRController}),i.d(t,"WindowsMotionController",function(){return r.WindowsMotionController}),i.d(t,"StickValues",function(){return r.StickValues}),i.d(t,"Gamepad",function(){return r.Gamepad}),i.d(t,"GenericPad",function(){return r.GenericPad}),i.d(t,"GamepadManager",function(){return r.GamepadManager}),i.d(t,"GamepadSystemSceneComponent",function(){return r.GamepadSystemSceneComponent}),i.d(t,"Xbox360Button",function(){return r.Xbox360Button}),i.d(t,"Xbox360Dpad",function(){return r.Xbox360Dpad}),i.d(t,"Xbox360Pad",function(){return r.Xbox360Pad}),i.d(t,"AxisDragGizmo",function(){return r.AxisDragGizmo}),i.d(t,"AxisScaleGizmo",function(){return r.AxisScaleGizmo}),i.d(t,"BoundingBoxGizmo",function(){return r.BoundingBoxGizmo}),i.d(t,"Gizmo",function(){return r.Gizmo}),i.d(t,"GizmoManager",function(){return r.GizmoManager}),i.d(t,"PlaneRotationGizmo",function(){return r.PlaneRotationGizmo}),i.d(t,"PositionGizmo",function(){return r.PositionGizmo}),i.d(t,"RotationGizmo",function(){return r.RotationGizmo}),i.d(t,"ScaleGizmo",function(){return r.ScaleGizmo}),i.d(t,"LightGizmo",function(){return r.LightGizmo}),i.d(t,"EnvironmentHelper",function(){return r.EnvironmentHelper}),i.d(t,"PhotoDome",function(){return r.PhotoDome}),i.d(t,"_forceSceneHelpersToBundle",function(){return r._forceSceneHelpersToBundle}),i.d(t,"VideoDome",function(){return r.VideoDome}),i.d(t,"EngineInstrumentation",function(){return r.EngineInstrumentation}),i.d(t,"SceneInstrumentation",function(){return r.SceneInstrumentation}),i.d(t,"_TimeToken",function(){return r._TimeToken}),i.d(t,"EffectLayer",function(){return r.EffectLayer}),i.d(t,"EffectLayerSceneComponent",function(){return r.EffectLayerSceneComponent}),i.d(t,"GlowLayer",function(){return r.GlowLayer}),i.d(t,"HighlightLayer",function(){return r.HighlightLayer}),i.d(t,"Layer",function(){return r.Layer}),i.d(t,"LayerSceneComponent",function(){return r.LayerSceneComponent}),i.d(t,"LensFlare",function(){return r.LensFlare}),i.d(t,"LensFlareSystem",function(){return r.LensFlareSystem}),i.d(t,"LensFlareSystemSceneComponent",function(){return r.LensFlareSystemSceneComponent}),i.d(t,"Light",function(){return r.Light}),i.d(t,"ShadowLight",function(){return r.ShadowLight}),i.d(t,"DirectionalLight",function(){return r.DirectionalLight}),i.d(t,"HemisphericLight",function(){return r.HemisphericLight}),i.d(t,"PointLight",function(){return r.PointLight}),i.d(t,"SpotLight",function(){return r.SpotLight}),i.d(t,"DefaultLoadingScreen",function(){return r.DefaultLoadingScreen}),i.d(t,"SceneLoaderProgressEvent",function(){return r.SceneLoaderProgressEvent}),i.d(t,"SceneLoader",function(){return r.SceneLoader}),i.d(t,"SceneLoaderFlags",function(){return r.SceneLoaderFlags}),i.d(t,"ColorCurves",function(){return r.ColorCurves}),i.d(t,"EffectFallbacks",function(){return r.EffectFallbacks}),i.d(t,"EffectCreationOptions",function(){return r.EffectCreationOptions}),i.d(t,"Effect",function(){return r.Effect}),i.d(t,"FresnelParameters",function(){return r.FresnelParameters}),i.d(t,"ImageProcessingConfigurationDefines",function(){return r.ImageProcessingConfigurationDefines}),i.d(t,"ImageProcessingConfiguration",function(){return r.ImageProcessingConfiguration}),i.d(t,"Material",function(){return r.Material}),i.d(t,"MaterialDefines",function(){return r.MaterialDefines}),i.d(t,"MaterialHelper",function(){return r.MaterialHelper}),i.d(t,"MultiMaterial",function(){return r.MultiMaterial}),i.d(t,"PushMaterial",function(){return r.PushMaterial}),i.d(t,"ShaderMaterial",function(){return r.ShaderMaterial}),i.d(t,"StandardMaterialDefines",function(){return r.StandardMaterialDefines}),i.d(t,"StandardMaterial",function(){return r.StandardMaterial}),i.d(t,"BaseTexture",function(){return r.BaseTexture}),i.d(t,"CubeTexture",function(){return r.CubeTexture}),i.d(t,"HDRCubeTexture",function(){return r.HDRCubeTexture}),i.d(t,"InternalTexture",function(){return r.InternalTexture}),i.d(t,"DummyInternalTextureTracker",function(){return r.DummyInternalTextureTracker}),i.d(t,"MirrorTexture",function(){return r.MirrorTexture}),i.d(t,"RawTexture",function(){return r.RawTexture}),i.d(t,"RenderTargetTexture",function(){return r.RenderTargetTexture}),i.d(t,"Texture",function(){return r.Texture}),i.d(t,"UniformBuffer",function(){return r.UniformBuffer}),i.d(t,"MaterialFlags",function(){return r.MaterialFlags}),i.d(t,"Scalar",function(){return r.Scalar}),i.d(t,"ToGammaSpace",function(){return r.ToGammaSpace}),i.d(t,"ToLinearSpace",function(){return r.ToLinearSpace}),i.d(t,"Epsilon",function(){return r.Epsilon}),i.d(t,"Color3",function(){return r.Color3}),i.d(t,"Color4",function(){return r.Color4}),i.d(t,"Vector2",function(){return r.Vector2}),i.d(t,"Vector3",function(){return r.Vector3}),i.d(t,"Vector4",function(){return r.Vector4}),i.d(t,"Size",function(){return r.Size}),i.d(t,"Quaternion",function(){return r.Quaternion}),i.d(t,"Matrix",function(){return r.Matrix}),i.d(t,"Plane",function(){return r.Plane}),i.d(t,"Viewport",function(){return r.Viewport}),i.d(t,"Frustum",function(){return r.Frustum}),i.d(t,"Space",function(){return r.Space}),i.d(t,"Axis",function(){return r.Axis}),i.d(t,"BezierCurve",function(){return r.BezierCurve}),i.d(t,"Orientation",function(){return r.Orientation}),i.d(t,"Angle",function(){return r.Angle}),i.d(t,"Arc2",function(){return r.Arc2}),i.d(t,"Path2",function(){return r.Path2}),i.d(t,"Path3D",function(){return r.Path3D}),i.d(t,"Curve3",function(){return r.Curve3}),i.d(t,"PositionNormalVertex",function(){return r.PositionNormalVertex}),i.d(t,"PositionNormalTextureVertex",function(){return r.PositionNormalTextureVertex}),i.d(t,"Tmp",function(){return r.Tmp}),i.d(t,"SphericalPolynomial",function(){return r.SphericalPolynomial}),i.d(t,"SphericalHarmonics",function(){return r.SphericalHarmonics}),i.d(t,"AbstractMesh",function(){return r.AbstractMesh}),i.d(t,"Buffer",function(){return r.Buffer}),i.d(t,"VertexBuffer",function(){return r.VertexBuffer}),i.d(t,"CSG",function(){return r.CSG}),i.d(t,"Geometry",function(){return r.Geometry}),i.d(t,"GroundMesh",function(){return r.GroundMesh}),i.d(t,"InstancedMesh",function(){return r.InstancedMesh}),i.d(t,"LinesMesh",function(){return r.LinesMesh}),i.d(t,"InstancedLinesMesh",function(){return r.InstancedLinesMesh}),i.d(t,"MeshLODLevel",function(){return r.MeshLODLevel}),i.d(t,"_CreationDataStorage",function(){return r._CreationDataStorage}),i.d(t,"_InstancesBatch",function(){return r._InstancesBatch}),i.d(t,"Mesh",function(){return r.Mesh}),i.d(t,"VertexData",function(){return r.VertexData}),i.d(t,"MeshBuilder",function(){return r.MeshBuilder}),i.d(t,"SimplificationSettings",function(){return r.SimplificationSettings}),i.d(t,"SimplificationQueue",function(){return r.SimplificationQueue}),i.d(t,"SimplificationType",function(){return r.SimplificationType}),i.d(t,"SimplicationQueueSceneComponent",function(){return r.SimplicationQueueSceneComponent}),i.d(t,"Polygon",function(){return r.Polygon}),i.d(t,"PolygonMeshBuilder",function(){return r.PolygonMeshBuilder}),i.d(t,"BaseSubMesh",function(){return r.BaseSubMesh}),i.d(t,"SubMesh",function(){return r.SubMesh}),i.d(t,"TransformNode",function(){return r.TransformNode}),i.d(t,"BoxBuilder",function(){return r.BoxBuilder}),i.d(t,"DiscBuilder",function(){return r.DiscBuilder}),i.d(t,"SphereBuilder",function(){return r.SphereBuilder}),i.d(t,"CylinderBuilder",function(){return r.CylinderBuilder}),i.d(t,"LinesBuilder",function(){return r.LinesBuilder}),i.d(t,"PlaneBuilder",function(){return r.PlaneBuilder}),i.d(t,"MorphTarget",function(){return r.MorphTarget}),i.d(t,"MorphTargetManager",function(){return r.MorphTargetManager}),i.d(t,"Database",function(){return r.Database}),i.d(t,"BaseParticleSystem",function(){return r.BaseParticleSystem}),i.d(t,"GPUParticleSystem",function(){return r.GPUParticleSystem}),i.d(t,"Particle",function(){return r.Particle}),i.d(t,"ParticleHelper",function(){return r.ParticleHelper}),i.d(t,"ParticleSystem",function(){return r.ParticleSystem}),i.d(t,"_IDoNeedToBeInTheBuild",function(){return r._IDoNeedToBeInTheBuild}),i.d(t,"ParticleSystemSet",function(){return r.ParticleSystemSet}),i.d(t,"SolidParticle",function(){return r.SolidParticle}),i.d(t,"ModelShape",function(){return r.ModelShape}),i.d(t,"DepthSortedParticle",function(){return r.DepthSortedParticle}),i.d(t,"SolidParticleSystem",function(){return r.SolidParticleSystem}),i.d(t,"SubEmitterType",function(){return r.SubEmitterType}),i.d(t,"SubEmitter",function(){return r.SubEmitter}),i.d(t,"PhysicsEngine",function(){return r.PhysicsEngine}),i.d(t,"PhysicsEngineSceneComponent",function(){return r.PhysicsEngineSceneComponent}),i.d(t,"PhysicsHelper",function(){return r.PhysicsHelper}),i.d(t,"PhysicsRadialExplosionEvent",function(){return r.PhysicsRadialExplosionEvent}),i.d(t,"PhysicsGravitationalFieldEvent",function(){return r.PhysicsGravitationalFieldEvent}),i.d(t,"PhysicsUpdraftEvent",function(){return r.PhysicsUpdraftEvent}),i.d(t,"PhysicsVortexEvent",function(){return r.PhysicsVortexEvent}),i.d(t,"PhysicsRadialImpulseFalloff",function(){return r.PhysicsRadialImpulseFalloff}),i.d(t,"PhysicsUpdraftMode",function(){return r.PhysicsUpdraftMode}),i.d(t,"PhysicsImpostor",function(){return r.PhysicsImpostor}),i.d(t,"PhysicsJoint",function(){return r.PhysicsJoint}),i.d(t,"DistanceJoint",function(){return r.DistanceJoint}),i.d(t,"MotorEnabledJoint",function(){return r.MotorEnabledJoint}),i.d(t,"HingeJoint",function(){return r.HingeJoint}),i.d(t,"Hinge2Joint",function(){return r.Hinge2Joint}),i.d(t,"AnaglyphPostProcess",function(){return r.AnaglyphPostProcess}),i.d(t,"BlackAndWhitePostProcess",function(){return r.BlackAndWhitePostProcess}),i.d(t,"BloomEffect",function(){return r.BloomEffect}),i.d(t,"BloomMergePostProcess",function(){return r.BloomMergePostProcess}),i.d(t,"BlurPostProcess",function(){return r.BlurPostProcess}),i.d(t,"ChromaticAberrationPostProcess",function(){return r.ChromaticAberrationPostProcess}),i.d(t,"CircleOfConfusionPostProcess",function(){return r.CircleOfConfusionPostProcess}),i.d(t,"ColorCorrectionPostProcess",function(){return r.ColorCorrectionPostProcess}),i.d(t,"ConvolutionPostProcess",function(){return r.ConvolutionPostProcess}),i.d(t,"DepthOfFieldBlurPostProcess",function(){return r.DepthOfFieldBlurPostProcess}),i.d(t,"DepthOfFieldEffectBlurLevel",function(){return r.DepthOfFieldEffectBlurLevel}),i.d(t,"DepthOfFieldEffect",function(){return r.DepthOfFieldEffect}),i.d(t,"DepthOfFieldMergePostProcessOptions",function(){return r.DepthOfFieldMergePostProcessOptions}),i.d(t,"DepthOfFieldMergePostProcess",function(){return r.DepthOfFieldMergePostProcess}),i.d(t,"DisplayPassPostProcess",function(){return r.DisplayPassPostProcess}),i.d(t,"ExtractHighlightsPostProcess",function(){return r.ExtractHighlightsPostProcess}),i.d(t,"FilterPostProcess",function(){return r.FilterPostProcess}),i.d(t,"FxaaPostProcess",function(){return r.FxaaPostProcess}),i.d(t,"GrainPostProcess",function(){return r.GrainPostProcess}),i.d(t,"HighlightsPostProcess",function(){return r.HighlightsPostProcess}),i.d(t,"ImageProcessingPostProcess",function(){return r.ImageProcessingPostProcess}),i.d(t,"MotionBlurPostProcess",function(){return r.MotionBlurPostProcess}),i.d(t,"PassPostProcess",function(){return r.PassPostProcess}),i.d(t,"PassCubePostProcess",function(){return r.PassCubePostProcess}),i.d(t,"PostProcess",function(){return r.PostProcess}),i.d(t,"PostProcessManager",function(){return r.PostProcessManager}),i.d(t,"RefractionPostProcess",function(){return r.RefractionPostProcess}),i.d(t,"SharpenPostProcess",function(){return r.SharpenPostProcess}),i.d(t,"StereoscopicInterlacePostProcess",function(){return r.StereoscopicInterlacePostProcess}),i.d(t,"TonemappingOperator",function(){return r.TonemappingOperator}),i.d(t,"TonemapPostProcess",function(){return r.TonemapPostProcess}),i.d(t,"VolumetricLightScatteringPostProcess",function(){return r.VolumetricLightScatteringPostProcess}),i.d(t,"VRDistortionCorrectionPostProcess",function(){return r.VRDistortionCorrectionPostProcess}),i.d(t,"ReflectionProbe",function(){return r.ReflectionProbe}),i.d(t,"BoundingBoxRenderer",function(){return r.BoundingBoxRenderer}),i.d(t,"DepthRenderer",function(){return r.DepthRenderer}),i.d(t,"DepthRendererSceneComponent",function(){return r.DepthRendererSceneComponent}),i.d(t,"EdgesRenderer",function(){return r.EdgesRenderer}),i.d(t,"LineEdgesRenderer",function(){return r.LineEdgesRenderer}),i.d(t,"GeometryBufferRenderer",function(){return r.GeometryBufferRenderer}),i.d(t,"GeometryBufferRendererSceneComponent",function(){return r.GeometryBufferRendererSceneComponent}),i.d(t,"OutlineRenderer",function(){return r.OutlineRenderer}),i.d(t,"RenderingGroup",function(){return r.RenderingGroup}),i.d(t,"RenderingGroupInfo",function(){return r.RenderingGroupInfo}),i.d(t,"RenderingManager",function(){return r.RenderingManager}),i.d(t,"UtilityLayerRenderer",function(){return r.UtilityLayerRenderer}),i.d(t,"Sprite",function(){return r.Sprite}),i.d(t,"SpriteManager",function(){return r.SpriteManager}),i.d(t,"SpriteSceneComponent",function(){return r.SpriteSceneComponent}),i.d(t,"_AlphaState",function(){return r._AlphaState}),i.d(t,"_DepthCullingState",function(){return r._DepthCullingState}),i.d(t,"_StencilState",function(){return r._StencilState}),i.d(t,"AndOrNotEvaluator",function(){return r.AndOrNotEvaluator}),i.d(t,"AssetTaskState",function(){return r.AssetTaskState}),i.d(t,"AbstractAssetTask",function(){return r.AbstractAssetTask}),i.d(t,"AssetsProgressEvent",function(){return r.AssetsProgressEvent}),i.d(t,"MeshAssetTask",function(){return r.MeshAssetTask}),i.d(t,"TextFileAssetTask",function(){return r.TextFileAssetTask}),i.d(t,"BinaryFileAssetTask",function(){return r.BinaryFileAssetTask}),i.d(t,"ImageAssetTask",function(){return r.ImageAssetTask}),i.d(t,"TextureAssetTask",function(){return r.TextureAssetTask}),i.d(t,"CubeTextureAssetTask",function(){return r.CubeTextureAssetTask}),i.d(t,"HDRCubeTextureAssetTask",function(){return r.HDRCubeTextureAssetTask}),i.d(t,"AssetsManager",function(){return r.AssetsManager}),i.d(t,"DDSTools",function(){return r.DDSTools}),i.d(t,"expandToProperty",function(){return r.expandToProperty}),i.d(t,"serialize",function(){return r.serialize}),i.d(t,"serializeAsTexture",function(){return r.serializeAsTexture}),i.d(t,"serializeAsColor3",function(){return r.serializeAsColor3}),i.d(t,"serializeAsFresnelParameters",function(){return r.serializeAsFresnelParameters}),i.d(t,"serializeAsVector2",function(){return r.serializeAsVector2}),i.d(t,"serializeAsVector3",function(){return r.serializeAsVector3}),i.d(t,"serializeAsMeshReference",function(){return r.serializeAsMeshReference}),i.d(t,"serializeAsColorCurves",function(){return r.serializeAsColorCurves}),i.d(t,"serializeAsColor4",function(){return r.serializeAsColor4}),i.d(t,"serializeAsImageProcessingConfiguration",function(){return r.serializeAsImageProcessingConfiguration}),i.d(t,"serializeAsQuaternion",function(){return r.serializeAsQuaternion}),i.d(t,"serializeAsCameraReference",function(){return r.serializeAsCameraReference}),i.d(t,"SerializationHelper",function(){return r.SerializationHelper}),i.d(t,"Deferred",function(){return r.Deferred}),i.d(t,"EnvironmentTextureTools",function(){return r.EnvironmentTextureTools}),i.d(t,"FilesInput",function(){return r.FilesInput}),i.d(t,"KhronosTextureContainer",function(){return r.KhronosTextureContainer}),i.d(t,"EventState",function(){return r.EventState}),i.d(t,"Observer",function(){return r.Observer}),i.d(t,"MultiObserver",function(){return r.MultiObserver}),i.d(t,"Observable",function(){return r.Observable}),i.d(t,"PerformanceMonitor",function(){return r.PerformanceMonitor}),i.d(t,"RollingAverage",function(){return r.RollingAverage}),i.d(t,"PromisePolyfill",function(){return r.PromisePolyfill}),i.d(t,"SceneOptimization",function(){return r.SceneOptimization}),i.d(t,"TextureOptimization",function(){return r.TextureOptimization}),i.d(t,"HardwareScalingOptimization",function(){return r.HardwareScalingOptimization}),i.d(t,"ShadowsOptimization",function(){return r.ShadowsOptimization}),i.d(t,"PostProcessesOptimization",function(){return r.PostProcessesOptimization}),i.d(t,"LensFlaresOptimization",function(){return r.LensFlaresOptimization}),i.d(t,"CustomOptimization",function(){return r.CustomOptimization}),i.d(t,"ParticlesOptimization",function(){return r.ParticlesOptimization}),i.d(t,"RenderTargetsOptimization",function(){return r.RenderTargetsOptimization}),i.d(t,"MergeMeshesOptimization",function(){return r.MergeMeshesOptimization}),i.d(t,"SceneOptimizerOptions",function(){return r.SceneOptimizerOptions}),i.d(t,"SceneOptimizer",function(){return r.SceneOptimizer}),i.d(t,"SceneSerializer",function(){return r.SceneSerializer}),i.d(t,"SmartArray",function(){return r.SmartArray}),i.d(t,"SmartArrayNoDuplicate",function(){return r.SmartArrayNoDuplicate}),i.d(t,"StringDictionary",function(){return r.StringDictionary}),i.d(t,"Tags",function(){return r.Tags}),i.d(t,"TextureTools",function(){return r.TextureTools}),i.d(t,"TGATools",function(){return r.TGATools}),i.d(t,"ColorGradient",function(){return r.ColorGradient}),i.d(t,"Color3Gradient",function(){return r.Color3Gradient}),i.d(t,"FactorGradient",function(){return r.FactorGradient}),i.d(t,"LoadFileError",function(){return r.LoadFileError}),i.d(t,"RetryStrategy",function(){return r.RetryStrategy}),i.d(t,"Tools",function(){return r.Tools}),i.d(t,"PerfCounter",function(){return r.PerfCounter}),i.d(t,"className",function(){return r.className}),i.d(t,"AsyncLoop",function(){return r.AsyncLoop}),i.d(t,"VideoRecorder",function(){return r.VideoRecorder}),i.d(t,"JoystickAxis",function(){return r.JoystickAxis}),i.d(t,"VirtualJoystick",function(){return r.VirtualJoystick}),i.d(t,"WorkerPool",function(){return r.WorkerPool}),i.d(t,"Logger",function(){return r.Logger}),i.d(t,"_TypeStore",function(){return r._TypeStore}),i.d(t,"FilesInputStore",function(){return r.FilesInputStore}),i.d(t,"DeepCopier",function(){return r.DeepCopier}),i.d(t,"PivotTools",function(){return r.PivotTools}),i.d(t,"PrecisionDate",function(){return r.PrecisionDate}),i.d(t,"ScreenshotTools",function(){return r.ScreenshotTools}),i.d(t,"AttachToBoxBehavior",function(){return r.AttachToBoxBehavior}),i.d(t,"FadeInOutBehavior",function(){return r.FadeInOutBehavior}),i.d(t,"MultiPointerScaleBehavior",function(){return r.MultiPointerScaleBehavior}),i.d(t,"SixDofDragBehavior",function(){return r.SixDofDragBehavior}),i.d(t,"ArcRotateCameraGamepadInput",function(){return r.ArcRotateCameraGamepadInput}),i.d(t,"ArcRotateCameraKeyboardMoveInput",function(){return r.ArcRotateCameraKeyboardMoveInput}),i.d(t,"ArcRotateCameraMouseWheelInput",function(){return r.ArcRotateCameraMouseWheelInput}),i.d(t,"ArcRotateCameraPointersInput",function(){return r.ArcRotateCameraPointersInput}),i.d(t,"ArcRotateCameraVRDeviceOrientationInput",function(){return r.ArcRotateCameraVRDeviceOrientationInput}),i.d(t,"FlyCameraKeyboardInput",function(){return r.FlyCameraKeyboardInput}),i.d(t,"FlyCameraMouseInput",function(){return r.FlyCameraMouseInput}),i.d(t,"FreeCameraDeviceOrientationInput",function(){return r.FreeCameraDeviceOrientationInput}),i.d(t,"FreeCameraGamepadInput",function(){return r.FreeCameraGamepadInput}),i.d(t,"FreeCameraKeyboardMoveInput",function(){return r.FreeCameraKeyboardMoveInput}),i.d(t,"FreeCameraMouseInput",function(){return r.FreeCameraMouseInput}),i.d(t,"FreeCameraTouchInput",function(){return r.FreeCameraTouchInput}),i.d(t,"FreeCameraVirtualJoystickInput",function(){return r.FreeCameraVirtualJoystickInput}),i.d(t,"AnaglyphArcRotateCamera",function(){return r.AnaglyphArcRotateCamera}),i.d(t,"AnaglyphFreeCamera",function(){return r.AnaglyphFreeCamera}),i.d(t,"AnaglyphGamepadCamera",function(){return r.AnaglyphGamepadCamera}),i.d(t,"AnaglyphUniversalCamera",function(){return r.AnaglyphUniversalCamera}),i.d(t,"StereoscopicArcRotateCamera",function(){return r.StereoscopicArcRotateCamera}),i.d(t,"StereoscopicFreeCamera",function(){return r.StereoscopicFreeCamera}),i.d(t,"StereoscopicGamepadCamera",function(){return r.StereoscopicGamepadCamera}),i.d(t,"StereoscopicUniversalCamera",function(){return r.StereoscopicUniversalCamera}),i.d(t,"VRCameraMetrics",function(){return r.VRCameraMetrics}),i.d(t,"VRDeviceOrientationArcRotateCamera",function(){return r.VRDeviceOrientationArcRotateCamera}),i.d(t,"VRDeviceOrientationFreeCamera",function(){return r.VRDeviceOrientationFreeCamera}),i.d(t,"VRDeviceOrientationGamepadCamera",function(){return r.VRDeviceOrientationGamepadCamera}),i.d(t,"VRExperienceHelper",function(){return r.VRExperienceHelper}),i.d(t,"WebVRFreeCamera",function(){return r.WebVRFreeCamera}),i.d(t,"WebXRCamera",function(){return r.WebXRCamera}),i.d(t,"WebXREnterExitUIButton",function(){return r.WebXREnterExitUIButton}),i.d(t,"WebXREnterExitUIOptions",function(){return r.WebXREnterExitUIOptions}),i.d(t,"WebXREnterExitUI",function(){return r.WebXREnterExitUI}),i.d(t,"WebXRState",function(){return r.WebXRState}),i.d(t,"WebXRExperienceHelper",function(){return r.WebXRExperienceHelper}),i.d(t,"WebXRController",function(){return r.WebXRController}),i.d(t,"WebXRInput",function(){return r.WebXRInput}),i.d(t,"WebXRManagedOutputCanvas",function(){return r.WebXRManagedOutputCanvas}),i.d(t,"WebXRSessionManager",function(){return r.WebXRSessionManager}),i.d(t,"Octree",function(){return r.Octree}),i.d(t,"OctreeBlock",function(){return r.OctreeBlock}),i.d(t,"OctreeSceneComponent",function(){return r.OctreeSceneComponent}),i.d(t,"_OcclusionDataStorage",function(){return r._OcclusionDataStorage}),i.d(t,"_forceTransformFeedbackToBundle",function(){return r._forceTransformFeedbackToBundle}),i.d(t,"ShadowGenerator",function(){return r.ShadowGenerator}),i.d(t,"ShadowGeneratorSceneComponent",function(){return r.ShadowGeneratorSceneComponent}),i.d(t,"_BabylonLoaderRegistered",function(){return r._BabylonLoaderRegistered}),i.d(t,"BackgroundMaterial",function(){return r.BackgroundMaterial}),i.d(t,"PBRBaseMaterial",function(){return r.PBRBaseMaterial}),i.d(t,"PBRBaseSimpleMaterial",function(){return r.PBRBaseSimpleMaterial}),i.d(t,"PBRMaterial",function(){return r.PBRMaterial}),i.d(t,"PBRMetallicRoughnessMaterial",function(){return r.PBRMetallicRoughnessMaterial}),i.d(t,"PBRSpecularGlossinessMaterial",function(){return r.PBRSpecularGlossinessMaterial}),i.d(t,"ColorGradingTexture",function(){return r.ColorGradingTexture}),i.d(t,"DynamicTexture",function(){return r.DynamicTexture}),i.d(t,"MultiRenderTarget",function(){return r.MultiRenderTarget}),i.d(t,"ProceduralTexture",function(){return r.ProceduralTexture}),i.d(t,"ProceduralTextureSceneComponent",function(){return r.ProceduralTextureSceneComponent}),i.d(t,"RawCubeTexture",function(){return r.RawCubeTexture}),i.d(t,"RawTexture3D",function(){return r.RawTexture3D}),i.d(t,"RefractionTexture",function(){return r.RefractionTexture}),i.d(t,"VideoTexture",function(){return r.VideoTexture}),i.d(t,"DracoCompression",function(){return r.DracoCompression}),i.d(t,"RibbonBuilder",function(){return r.RibbonBuilder}),i.d(t,"TorusBuilder",function(){return r.TorusBuilder}),i.d(t,"TorusKnotBuilder",function(){return r.TorusKnotBuilder}),i.d(t,"PolygonBuilder",function(){return r.PolygonBuilder}),i.d(t,"ShapeBuilder",function(){return r.ShapeBuilder}),i.d(t,"LatheBuilder",function(){return r.LatheBuilder}),i.d(t,"GroundBuilder",function(){return r.GroundBuilder}),i.d(t,"TubeBuilder",function(){return r.TubeBuilder}),i.d(t,"PolyhedronBuilder",function(){return r.PolyhedronBuilder}),i.d(t,"IcoSphereBuilder",function(){return r.IcoSphereBuilder}),i.d(t,"DecalBuilder",function(){return r.DecalBuilder}),i.d(t,"BoxParticleEmitter",function(){return r.BoxParticleEmitter}),i.d(t,"ConeParticleEmitter",function(){return r.ConeParticleEmitter}),i.d(t,"CylinderParticleEmitter",function(){return r.CylinderParticleEmitter}),i.d(t,"CylinderDirectedParticleEmitter",function(){return r.CylinderDirectedParticleEmitter}),i.d(t,"HemisphericParticleEmitter",function(){return r.HemisphericParticleEmitter}),i.d(t,"PointParticleEmitter",function(){return r.PointParticleEmitter}),i.d(t,"SphereParticleEmitter",function(){return r.SphereParticleEmitter}),i.d(t,"SphereDirectedParticleEmitter",function(){return r.SphereDirectedParticleEmitter}),i.d(t,"CannonJSPlugin",function(){return r.CannonJSPlugin}),i.d(t,"AmmoJSPlugin",function(){return r.AmmoJSPlugin}),i.d(t,"OimoJSPlugin",function(){return r.OimoJSPlugin}),i.d(t,"PostProcessRenderEffect",function(){return r.PostProcessRenderEffect}),i.d(t,"PostProcessRenderPipeline",function(){return r.PostProcessRenderPipeline}),i.d(t,"PostProcessRenderPipelineManager",function(){return r.PostProcessRenderPipelineManager}),i.d(t,"PostProcessRenderPipelineManagerSceneComponent",function(){return r.PostProcessRenderPipelineManagerSceneComponent}),i.d(t,"CubeMapToSphericalPolynomialTools",function(){return r.CubeMapToSphericalPolynomialTools}),i.d(t,"HDRTools",function(){return r.HDRTools}),i.d(t,"PanoramaToCubeMapTools",function(){return r.PanoramaToCubeMapTools}),i.d(t,"_DDSTextureLoader",function(){return r._DDSTextureLoader}),i.d(t,"_ENVTextureLoader",function(){return r._ENVTextureLoader}),i.d(t,"_KTXTextureLoader",function(){return r._KTXTextureLoader}),i.d(t,"_TGATextureLoader",function(){return r._TGATextureLoader}),i.d(t,"CustomProceduralTexture",function(){return r.CustomProceduralTexture}),i.d(t,"NoiseProceduralTexture",function(){return r.NoiseProceduralTexture}),i.d(t,"DefaultRenderingPipeline",function(){return r.DefaultRenderingPipeline}),i.d(t,"LensRenderingPipeline",function(){return r.LensRenderingPipeline}),i.d(t,"SSAO2RenderingPipeline",function(){return r.SSAO2RenderingPipeline}),i.d(t,"SSAORenderingPipeline",function(){return r.SSAORenderingPipeline}),i.d(t,"StandardRenderingPipeline",function(){return r.StandardRenderingPipeline});var o=void 0!==e?e:"undefined"!=typeof window?window:void 0;if(void 0!==o){o.BABYLON=s,o.BABYLON=o.BABYLON||{};var s=o.BABYLON;s.Debug=s.Debug||{};var a=[];for(var c in n)s.Debug[c]=n[c],a.push(c);for(var c in r)a.indexOf(c)>-1||(s[c]=r[c])}}.call(this,i(122))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i}])}); \ No newline at end of file diff --git a/dist/preview release/babylon.max.js b/dist/preview release/babylon.max.js index f8e1a2ea02a..d3d54a8c022 100644 --- a/dist/preview release/babylon.max.js +++ b/dist/preview release/babylon.max.js @@ -9318,7 +9318,7 @@ var FadeInOutBehavior = /** @class */ (function () { /*!***********************************!*\ !*** ./Behaviors/Meshes/index.ts ***! \***********************************/ -/*! exports provided: AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior */ +/*! exports provided: PointerDragBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, SixDofDragBehavior */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -10127,7 +10127,7 @@ var SixDofDragBehavior = /** @class */ (function () { /*!****************************!*\ !*** ./Behaviors/index.ts ***! \****************************/ -/*! exports provided: AutoRotationBehavior, BouncingBehavior, FramingBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior */ +/*! exports provided: AutoRotationBehavior, BouncingBehavior, FramingBehavior, PointerDragBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, SixDofDragBehavior */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -10140,14 +10140,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FramingBehavior", function() { return _Cameras_index__WEBPACK_IMPORTED_MODULE_0__["FramingBehavior"]; }); /* harmony import */ var _Meshes_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Meshes/index */ "./Behaviors/Meshes/index.ts"); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PointerDragBehavior", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_1__["PointerDragBehavior"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AttachToBoxBehavior", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_1__["AttachToBoxBehavior"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FadeInOutBehavior", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_1__["FadeInOutBehavior"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiPointerScaleBehavior", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_1__["MultiPointerScaleBehavior"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PointerDragBehavior", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_1__["PointerDragBehavior"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SixDofDragBehavior", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_1__["SixDofDragBehavior"]; }); @@ -45199,7 +45199,7 @@ var LayerSceneComponent = /** @class */ (function () { /*!**************************!*\ !*** ./Legacy/legacy.ts ***! \**************************/ -/*! exports provided: AbstractScene, KeepAssets, AssetContainer, Node, Scene, SceneComponentConstants, Stage, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction, Animatable, Animation, TargetedAnimation, AnimationGroup, AnimationPropertiesOverride, EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase, RuntimeAnimation, AnimationEvent, AnimationKeyInterpolation, AnimationRange, Analyser, AudioEngine, AudioSceneComponent, Sound, SoundTrack, WeightedSound, Bone, BoneIKController, BoneLookController, Skeleton, CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, BoundingBox, BoundingInfo, BoundingSphere, Ray, AxesViewer, BoneAxesViewer, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer, Constants, InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine, EngineStore, NullEngineOptions, NullEngine, KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome, EngineInstrumentation, SceneInstrumentation, _TimeToken, EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent, LensFlare, LensFlareSystem, LensFlareSystemSceneComponent, Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoader, SceneLoaderFlags, ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RawTexture, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, Scalar, ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp, SphericalPolynomial, SphericalHarmonics, AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, DiscBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, MorphTarget, MorphTargetManager, Database, BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, SubEmitterType, SubEmitter, PhysicsEngine, PhysicsEngineSceneComponent, PhysicsHelper, PhysicsRadialExplosionEvent, PhysicsGravitationalFieldEvent, PhysicsUpdraftEvent, PhysicsVortexEvent, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode, PhysicsImpostor, PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint, AnaglyphPostProcess, BlackAndWhitePostProcess, BloomEffect, BloomMergePostProcess, BlurPostProcess, ChromaticAberrationPostProcess, CircleOfConfusionPostProcess, ColorCorrectionPostProcess, ConvolutionPostProcess, DepthOfFieldBlurPostProcess, DepthOfFieldEffectBlurLevel, DepthOfFieldEffect, DepthOfFieldMergePostProcessOptions, DepthOfFieldMergePostProcess, DisplayPassPostProcess, ExtractHighlightsPostProcess, FilterPostProcess, FxaaPostProcess, GrainPostProcess, HighlightsPostProcess, ImageProcessingPostProcess, MotionBlurPostProcess, PassPostProcess, PassCubePostProcess, PostProcess, PostProcessManager, RefractionPostProcess, SharpenPostProcess, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, ReflectionProbe, BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer, Sprite, SpriteManager, SpriteSceneComponent, _AlphaState, _DepthCullingState, _StencilState, AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, AssetsManager, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, 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, ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, AutoRotationBehavior, BouncingBehavior, FramingBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior, ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, VRExperienceHelper, WebVRFreeCamera, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager, Octree, OctreeBlock, OctreeSceneComponent, _OcclusionDataStorage, _forceTransformFeedbackToBundle, ShadowGenerator, ShadowGeneratorSceneComponent, _BabylonLoaderRegistered, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, ProceduralTexture, ProceduralTextureSceneComponent, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, DracoCompression, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, CubeMapToSphericalPolynomialTools, HDRTools, PanoramaToCubeMapTools, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */ +/*! exports provided: AbstractScene, KeepAssets, AssetContainer, Node, Scene, SceneComponentConstants, Stage, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction, Animatable, Animation, TargetedAnimation, AnimationGroup, AnimationPropertiesOverride, EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase, RuntimeAnimation, AnimationEvent, AnimationKeyInterpolation, AnimationRange, Analyser, AudioEngine, AudioSceneComponent, Sound, SoundTrack, WeightedSound, AutoRotationBehavior, BouncingBehavior, FramingBehavior, PointerDragBehavior, Bone, BoneIKController, BoneLookController, Skeleton, CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, BoundingBox, BoundingInfo, BoundingSphere, Ray, AxesViewer, BoneAxesViewer, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer, Constants, InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine, EngineStore, NullEngineOptions, NullEngine, KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome, EngineInstrumentation, SceneInstrumentation, _TimeToken, EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent, LensFlare, LensFlareSystem, LensFlareSystemSceneComponent, Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoader, SceneLoaderFlags, ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, Scalar, ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp, SphericalPolynomial, SphericalHarmonics, AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, MorphTarget, MorphTargetManager, Database, BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, SubEmitterType, SubEmitter, PhysicsEngine, PhysicsEngineSceneComponent, PhysicsHelper, PhysicsRadialExplosionEvent, PhysicsGravitationalFieldEvent, PhysicsUpdraftEvent, PhysicsVortexEvent, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode, PhysicsImpostor, PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint, AnaglyphPostProcess, BlackAndWhitePostProcess, BloomEffect, BloomMergePostProcess, BlurPostProcess, ChromaticAberrationPostProcess, CircleOfConfusionPostProcess, ColorCorrectionPostProcess, ConvolutionPostProcess, DepthOfFieldBlurPostProcess, DepthOfFieldEffectBlurLevel, DepthOfFieldEffect, DepthOfFieldMergePostProcessOptions, DepthOfFieldMergePostProcess, DisplayPassPostProcess, ExtractHighlightsPostProcess, FilterPostProcess, FxaaPostProcess, GrainPostProcess, HighlightsPostProcess, ImageProcessingPostProcess, MotionBlurPostProcess, PassPostProcess, PassCubePostProcess, PostProcess, PostProcessManager, RefractionPostProcess, SharpenPostProcess, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, ReflectionProbe, BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer, Sprite, SpriteManager, SpriteSceneComponent, _AlphaState, _DepthCullingState, _StencilState, AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, AssetsManager, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, 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, ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, SixDofDragBehavior, ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, VRExperienceHelper, WebVRFreeCamera, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager, Octree, OctreeBlock, OctreeSceneComponent, _OcclusionDataStorage, _forceTransformFeedbackToBundle, ShadowGenerator, ShadowGeneratorSceneComponent, _BabylonLoaderRegistered, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, ProceduralTexture, RawCubeTexture, RawTexture, RawTexture3D, RefractionTexture, VideoTexture, DracoCompression, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, CubeMapToSphericalPolynomialTools, HDRTools, PanoramaToCubeMapTools, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTextureSceneComponent, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -45316,6 +45316,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WeightedSound", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["WeightedSound"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoRotationBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["AutoRotationBehavior"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BouncingBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["BouncingBehavior"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FramingBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FramingBehavior"]; }); + +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PointerDragBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["PointerDragBehavior"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Bone", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["Bone"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoneIKController", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["BoneIKController"]; }); @@ -45572,8 +45580,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiRenderTarget", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["MultiRenderTarget"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RawTexture"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RenderTargetTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RenderTargetTexture"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Texture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["Texture"]; }); @@ -45690,8 +45696,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxBuilder", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["BoxBuilder"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiscBuilder", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["DiscBuilder"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SphereBuilder", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["SphereBuilder"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CylinderBuilder", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["CylinderBuilder"]; }); @@ -46020,20 +46024,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ScreenshotTools", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ScreenshotTools"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AutoRotationBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["AutoRotationBehavior"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BouncingBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["BouncingBehavior"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FramingBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FramingBehavior"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AttachToBoxBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["AttachToBoxBehavior"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FadeInOutBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["FadeInOutBehavior"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiPointerScaleBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["MultiPointerScaleBehavior"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PointerDragBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["PointerDragBehavior"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SixDofDragBehavior", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["SixDofDragBehavior"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArcRotateCameraGamepadInput", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ArcRotateCameraGamepadInput"]; }); @@ -46144,10 +46140,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ProceduralTexture"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ProceduralTextureSceneComponent"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawCubeTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RawCubeTexture"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RawTexture"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture3D", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RawTexture3D"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RefractionTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RefractionTexture"]; }); @@ -46156,6 +46152,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DracoCompression", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiscBuilder", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["DiscBuilder"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RibbonBuilder", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["RibbonBuilder"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TorusBuilder", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TorusBuilder"]; }); @@ -46226,6 +46224,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoiseProceduralTexture", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["NoiseProceduralTexture"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["ProceduralTextureSceneComponent"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultRenderingPipeline", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["DefaultRenderingPipeline"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LensRenderingPipeline", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["LensRenderingPipeline"]; }); @@ -56832,7 +56832,7 @@ var CustomProceduralTexture = /** @class */ (function (_super) { /*!*************************************************!*\ !*** ./Materials/Textures/Procedurals/index.ts ***! \*************************************************/ -/*! exports provided: ProceduralTexture, ProceduralTextureSceneComponent, CustomProceduralTexture, NoiseProceduralTexture */ +/*! exports provided: ProceduralTexture, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTextureSceneComponent */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -59473,7 +59473,7 @@ _Misc_typeStore__WEBPACK_IMPORTED_MODULE_8__["_TypeStore"].RegisteredTypes["BABY /*!*************************************!*\ !*** ./Materials/Textures/index.ts ***! \*************************************/ -/*! exports provided: BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RawTexture, RenderTargetTexture, Texture, ColorGradingTexture, DynamicTexture, ProceduralTexture, ProceduralTextureSceneComponent, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture */ +/*! exports provided: BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RenderTargetTexture, Texture, ColorGradingTexture, DynamicTexture, ProceduralTexture, RawCubeTexture, RawTexture, RawTexture3D, RefractionTexture, VideoTexture, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTextureSceneComponent */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -59517,12 +59517,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Procedurals_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Procedurals/index */ "./Materials/Textures/Procedurals/index.ts"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTexture", function() { return _Procedurals_index__WEBPACK_IMPORTED_MODULE_10__["ProceduralTexture"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _Procedurals_index__WEBPACK_IMPORTED_MODULE_10__["ProceduralTextureSceneComponent"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CustomProceduralTexture", function() { return _Procedurals_index__WEBPACK_IMPORTED_MODULE_10__["CustomProceduralTexture"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoiseProceduralTexture", function() { return _Procedurals_index__WEBPACK_IMPORTED_MODULE_10__["NoiseProceduralTexture"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _Procedurals_index__WEBPACK_IMPORTED_MODULE_10__["ProceduralTextureSceneComponent"]; }); + /* harmony import */ var _rawCubeTexture__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./rawCubeTexture */ "./Materials/Textures/rawCubeTexture.ts"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawCubeTexture", function() { return _rawCubeTexture__WEBPACK_IMPORTED_MODULE_11__["RawCubeTexture"]; }); @@ -65375,7 +65375,7 @@ _Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"]._ImageProce /*!****************************!*\ !*** ./Materials/index.ts ***! \****************************/ -/*! exports provided: ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RawTexture, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, ProceduralTexture, ProceduralTextureSceneComponent, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture */ +/*! exports provided: ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, ProceduralTexture, RawCubeTexture, RawTexture, RawTexture3D, RefractionTexture, VideoTexture, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTextureSceneComponent */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -65450,8 +65450,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiRenderTarget", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["MultiRenderTarget"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["RawTexture"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RenderTargetTexture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["RenderTargetTexture"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Texture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["Texture"]; }); @@ -65462,10 +65460,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTexture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["ProceduralTexture"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["ProceduralTextureSceneComponent"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawCubeTexture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["RawCubeTexture"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["RawTexture"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture3D", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["RawTexture3D"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RefractionTexture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["RefractionTexture"]; }); @@ -65484,6 +65482,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoiseProceduralTexture", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["NoiseProceduralTexture"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _Textures_index__WEBPACK_IMPORTED_MODULE_13__["ProceduralTextureSceneComponent"]; }); + /* harmony import */ var _uniformBuffer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./uniformBuffer */ "./Materials/uniformBuffer.ts"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UniformBuffer", function() { return _uniformBuffer__WEBPACK_IMPORTED_MODULE_14__["UniformBuffer"]; }); @@ -79771,7 +79771,7 @@ var IcoSphereBuilder = /** @class */ (function () { /*!**********************************!*\ !*** ./Meshes/Builders/index.ts ***! \**********************************/ -/*! exports provided: BoxBuilder, DiscBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder */ +/*! exports provided: BoxBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -86851,7 +86851,7 @@ var GroundMesh = /** @class */ (function (_super) { /*!*************************!*\ !*** ./Meshes/index.ts ***! \*************************/ -/*! exports provided: AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, DiscBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, DracoCompression, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder */ +/*! exports provided: AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, DracoCompression, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -86925,8 +86925,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Builders_index__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Builders/index */ "./Meshes/Builders/index.ts"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["BoxBuilder"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiscBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["DiscBuilder"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SphereBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["SphereBuilder"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CylinderBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["CylinderBuilder"]; }); @@ -86935,6 +86933,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PlaneBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["PlaneBuilder"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiscBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["DiscBuilder"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RibbonBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["RibbonBuilder"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TorusBuilder", function() { return _Builders_index__WEBPACK_IMPORTED_MODULE_16__["TorusBuilder"]; }); @@ -132881,7 +132881,7 @@ var AssetContainer = /** @class */ (function (_super) { /*!******************!*\ !*** ./index.ts ***! \******************/ -/*! exports provided: AbstractScene, KeepAssets, AssetContainer, Node, Scene, SceneComponentConstants, Stage, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction, Animatable, Animation, TargetedAnimation, AnimationGroup, AnimationPropertiesOverride, EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase, RuntimeAnimation, AnimationEvent, AnimationKeyInterpolation, AnimationRange, Analyser, AudioEngine, AudioSceneComponent, Sound, SoundTrack, WeightedSound, Bone, BoneIKController, BoneLookController, Skeleton, CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, BoundingBox, BoundingInfo, BoundingSphere, Ray, AxesViewer, BoneAxesViewer, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer, Constants, InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine, EngineStore, NullEngineOptions, NullEngine, KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome, EngineInstrumentation, SceneInstrumentation, _TimeToken, EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent, LensFlare, LensFlareSystem, LensFlareSystemSceneComponent, Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoader, SceneLoaderFlags, ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RawTexture, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, Scalar, ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp, SphericalPolynomial, SphericalHarmonics, AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, DiscBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, MorphTarget, MorphTargetManager, Database, BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, SubEmitterType, SubEmitter, PhysicsEngine, PhysicsEngineSceneComponent, PhysicsHelper, PhysicsRadialExplosionEvent, PhysicsGravitationalFieldEvent, PhysicsUpdraftEvent, PhysicsVortexEvent, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode, PhysicsImpostor, PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint, AnaglyphPostProcess, BlackAndWhitePostProcess, BloomEffect, BloomMergePostProcess, BlurPostProcess, ChromaticAberrationPostProcess, CircleOfConfusionPostProcess, ColorCorrectionPostProcess, ConvolutionPostProcess, DepthOfFieldBlurPostProcess, DepthOfFieldEffectBlurLevel, DepthOfFieldEffect, DepthOfFieldMergePostProcessOptions, DepthOfFieldMergePostProcess, DisplayPassPostProcess, ExtractHighlightsPostProcess, FilterPostProcess, FxaaPostProcess, GrainPostProcess, HighlightsPostProcess, ImageProcessingPostProcess, MotionBlurPostProcess, PassPostProcess, PassCubePostProcess, PostProcess, PostProcessManager, RefractionPostProcess, SharpenPostProcess, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, ReflectionProbe, BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer, Sprite, SpriteManager, SpriteSceneComponent, _AlphaState, _DepthCullingState, _StencilState, AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, AssetsManager, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, 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, ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, AutoRotationBehavior, BouncingBehavior, FramingBehavior, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, PointerDragBehavior, SixDofDragBehavior, ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, VRExperienceHelper, WebVRFreeCamera, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager, Octree, OctreeBlock, OctreeSceneComponent, _OcclusionDataStorage, _forceTransformFeedbackToBundle, ShadowGenerator, ShadowGeneratorSceneComponent, _BabylonLoaderRegistered, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, ProceduralTexture, ProceduralTextureSceneComponent, RawCubeTexture, RawTexture3D, RefractionTexture, VideoTexture, DracoCompression, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, CubeMapToSphericalPolynomialTools, HDRTools, PanoramaToCubeMapTools, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */ +/*! exports provided: AbstractScene, KeepAssets, AssetContainer, Node, Scene, SceneComponentConstants, Stage, Action, ActionEvent, ActionManager, Condition, ValueCondition, PredicateCondition, StateCondition, SwitchBooleanAction, SetStateAction, SetValueAction, IncrementValueAction, PlayAnimationAction, StopAnimationAction, DoNothingAction, CombineAction, ExecuteCodeAction, SetParentAction, PlaySoundAction, StopSoundAction, InterpolateValueAction, Animatable, Animation, TargetedAnimation, AnimationGroup, AnimationPropertiesOverride, EasingFunction, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase, BezierCurveEase, RuntimeAnimation, AnimationEvent, AnimationKeyInterpolation, AnimationRange, Analyser, AudioEngine, AudioSceneComponent, Sound, SoundTrack, WeightedSound, AutoRotationBehavior, BouncingBehavior, FramingBehavior, PointerDragBehavior, Bone, BoneIKController, BoneLookController, Skeleton, CameraInputTypes, CameraInputsManager, Camera, TargetCamera, FreeCamera, FreeCameraInputsManager, TouchCamera, ArcRotateCamera, ArcRotateCameraInputsManager, DeviceOrientationCamera, FlyCamera, FlyCameraInputsManager, FollowCamera, ArcFollowCamera, GamepadCamera, UniversalCamera, VirtualJoysticksCamera, Collider, DefaultCollisionCoordinator, PickingInfo, IntersectionInfo, BoundingBox, BoundingInfo, BoundingSphere, Ray, AxesViewer, BoneAxesViewer, DebugLayer, PhysicsViewer, RayHelper, SkeletonViewer, Constants, InstancingAttributeInfo, DepthTextureCreationOptions, EngineCapabilities, Engine, EngineStore, NullEngineOptions, NullEngine, KeyboardEventTypes, KeyboardInfo, KeyboardInfoPre, PointerEventTypes, PointerInfoBase, PointerInfoPre, PointerInfo, ClipboardEventTypes, ClipboardInfo, DaydreamController, GearVRController, GenericController, OculusTouchController, PoseEnabledControllerType, PoseEnabledControllerHelper, PoseEnabledController, ViveController, WebVRController, WindowsMotionController, StickValues, Gamepad, GenericPad, GamepadManager, GamepadSystemSceneComponent, Xbox360Button, Xbox360Dpad, Xbox360Pad, AxisDragGizmo, AxisScaleGizmo, BoundingBoxGizmo, Gizmo, GizmoManager, PlaneRotationGizmo, PositionGizmo, RotationGizmo, ScaleGizmo, LightGizmo, EnvironmentHelper, PhotoDome, _forceSceneHelpersToBundle, VideoDome, EngineInstrumentation, SceneInstrumentation, _TimeToken, EffectLayer, EffectLayerSceneComponent, GlowLayer, HighlightLayer, Layer, LayerSceneComponent, LensFlare, LensFlareSystem, LensFlareSystemSceneComponent, Light, ShadowLight, DirectionalLight, HemisphericLight, PointLight, SpotLight, DefaultLoadingScreen, SceneLoaderProgressEvent, SceneLoader, SceneLoaderFlags, ColorCurves, EffectFallbacks, EffectCreationOptions, Effect, FresnelParameters, ImageProcessingConfigurationDefines, ImageProcessingConfiguration, Material, MaterialDefines, MaterialHelper, MultiMaterial, PushMaterial, ShaderMaterial, StandardMaterialDefines, StandardMaterial, BaseTexture, CubeTexture, HDRCubeTexture, InternalTexture, DummyInternalTextureTracker, MirrorTexture, MultiRenderTarget, RenderTargetTexture, Texture, UniformBuffer, MaterialFlags, Scalar, ToGammaSpace, ToLinearSpace, Epsilon, Color3, Color4, Vector2, Vector3, Vector4, Size, Quaternion, Matrix, Plane, Viewport, Frustum, Space, Axis, BezierCurve, Orientation, Angle, Arc2, Path2, Path3D, Curve3, PositionNormalVertex, PositionNormalTextureVertex, Tmp, SphericalPolynomial, SphericalHarmonics, AbstractMesh, Buffer, VertexBuffer, CSG, Geometry, GroundMesh, InstancedMesh, LinesMesh, InstancedLinesMesh, MeshLODLevel, _CreationDataStorage, _InstancesBatch, Mesh, VertexData, MeshBuilder, SimplificationSettings, SimplificationQueue, SimplificationType, SimplicationQueueSceneComponent, Polygon, PolygonMeshBuilder, BaseSubMesh, SubMesh, TransformNode, BoxBuilder, SphereBuilder, CylinderBuilder, LinesBuilder, PlaneBuilder, MorphTarget, MorphTargetManager, Database, BaseParticleSystem, GPUParticleSystem, Particle, ParticleHelper, ParticleSystem, _IDoNeedToBeInTheBuild, ParticleSystemSet, SolidParticle, ModelShape, DepthSortedParticle, SolidParticleSystem, SubEmitterType, SubEmitter, PhysicsEngine, PhysicsEngineSceneComponent, PhysicsHelper, PhysicsRadialExplosionEvent, PhysicsGravitationalFieldEvent, PhysicsUpdraftEvent, PhysicsVortexEvent, PhysicsRadialImpulseFalloff, PhysicsUpdraftMode, PhysicsImpostor, PhysicsJoint, DistanceJoint, MotorEnabledJoint, HingeJoint, Hinge2Joint, AnaglyphPostProcess, BlackAndWhitePostProcess, BloomEffect, BloomMergePostProcess, BlurPostProcess, ChromaticAberrationPostProcess, CircleOfConfusionPostProcess, ColorCorrectionPostProcess, ConvolutionPostProcess, DepthOfFieldBlurPostProcess, DepthOfFieldEffectBlurLevel, DepthOfFieldEffect, DepthOfFieldMergePostProcessOptions, DepthOfFieldMergePostProcess, DisplayPassPostProcess, ExtractHighlightsPostProcess, FilterPostProcess, FxaaPostProcess, GrainPostProcess, HighlightsPostProcess, ImageProcessingPostProcess, MotionBlurPostProcess, PassPostProcess, PassCubePostProcess, PostProcess, PostProcessManager, RefractionPostProcess, SharpenPostProcess, StereoscopicInterlacePostProcess, TonemappingOperator, TonemapPostProcess, VolumetricLightScatteringPostProcess, VRDistortionCorrectionPostProcess, ReflectionProbe, BoundingBoxRenderer, DepthRenderer, DepthRendererSceneComponent, EdgesRenderer, LineEdgesRenderer, GeometryBufferRenderer, GeometryBufferRendererSceneComponent, OutlineRenderer, RenderingGroup, RenderingGroupInfo, RenderingManager, UtilityLayerRenderer, Sprite, SpriteManager, SpriteSceneComponent, _AlphaState, _DepthCullingState, _StencilState, AndOrNotEvaluator, AssetTaskState, AbstractAssetTask, AssetsProgressEvent, MeshAssetTask, TextFileAssetTask, BinaryFileAssetTask, ImageAssetTask, TextureAssetTask, CubeTextureAssetTask, HDRCubeTextureAssetTask, AssetsManager, DDSTools, expandToProperty, serialize, serializeAsTexture, serializeAsColor3, serializeAsFresnelParameters, serializeAsVector2, serializeAsVector3, serializeAsMeshReference, serializeAsColorCurves, serializeAsColor4, serializeAsImageProcessingConfiguration, serializeAsQuaternion, serializeAsCameraReference, SerializationHelper, Deferred, EnvironmentTextureTools, 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, ColorGradient, Color3Gradient, FactorGradient, LoadFileError, RetryStrategy, Tools, PerfCounter, className, AsyncLoop, VideoRecorder, JoystickAxis, VirtualJoystick, WorkerPool, Logger, _TypeStore, FilesInputStore, DeepCopier, PivotTools, PrecisionDate, ScreenshotTools, AttachToBoxBehavior, FadeInOutBehavior, MultiPointerScaleBehavior, SixDofDragBehavior, ArcRotateCameraGamepadInput, ArcRotateCameraKeyboardMoveInput, ArcRotateCameraMouseWheelInput, ArcRotateCameraPointersInput, ArcRotateCameraVRDeviceOrientationInput, FlyCameraKeyboardInput, FlyCameraMouseInput, FreeCameraDeviceOrientationInput, FreeCameraGamepadInput, FreeCameraKeyboardMoveInput, FreeCameraMouseInput, FreeCameraTouchInput, FreeCameraVirtualJoystickInput, AnaglyphArcRotateCamera, AnaglyphFreeCamera, AnaglyphGamepadCamera, AnaglyphUniversalCamera, StereoscopicArcRotateCamera, StereoscopicFreeCamera, StereoscopicGamepadCamera, StereoscopicUniversalCamera, VRCameraMetrics, VRDeviceOrientationArcRotateCamera, VRDeviceOrientationFreeCamera, VRDeviceOrientationGamepadCamera, VRExperienceHelper, WebVRFreeCamera, WebXRCamera, WebXREnterExitUIButton, WebXREnterExitUIOptions, WebXREnterExitUI, WebXRState, WebXRExperienceHelper, WebXRController, WebXRInput, WebXRManagedOutputCanvas, WebXRSessionManager, Octree, OctreeBlock, OctreeSceneComponent, _OcclusionDataStorage, _forceTransformFeedbackToBundle, ShadowGenerator, ShadowGeneratorSceneComponent, _BabylonLoaderRegistered, BackgroundMaterial, PBRBaseMaterial, PBRBaseSimpleMaterial, PBRMaterial, PBRMetallicRoughnessMaterial, PBRSpecularGlossinessMaterial, ColorGradingTexture, DynamicTexture, ProceduralTexture, RawCubeTexture, RawTexture, RawTexture3D, RefractionTexture, VideoTexture, DracoCompression, DiscBuilder, RibbonBuilder, TorusBuilder, TorusKnotBuilder, PolygonBuilder, ShapeBuilder, LatheBuilder, GroundBuilder, TubeBuilder, PolyhedronBuilder, IcoSphereBuilder, DecalBuilder, BoxParticleEmitter, ConeParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, HemisphericParticleEmitter, PointParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CannonJSPlugin, AmmoJSPlugin, OimoJSPlugin, PostProcessRenderEffect, PostProcessRenderPipeline, PostProcessRenderPipelineManager, PostProcessRenderPipelineManagerSceneComponent, CubeMapToSphericalPolynomialTools, HDRTools, PanoramaToCubeMapTools, _DDSTextureLoader, _ENVTextureLoader, _KTXTextureLoader, _TGATextureLoader, CustomProceduralTexture, NoiseProceduralTexture, ProceduralTextureSceneComponent, DefaultRenderingPipeline, LensRenderingPipeline, SSAO2RenderingPipeline, SSAORenderingPipeline, StandardRenderingPipeline */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -133000,14 +133000,14 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FramingBehavior", function() { return _Behaviors_index__WEBPACK_IMPORTED_MODULE_5__["FramingBehavior"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PointerDragBehavior", function() { return _Behaviors_index__WEBPACK_IMPORTED_MODULE_5__["PointerDragBehavior"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AttachToBoxBehavior", function() { return _Behaviors_index__WEBPACK_IMPORTED_MODULE_5__["AttachToBoxBehavior"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FadeInOutBehavior", function() { return _Behaviors_index__WEBPACK_IMPORTED_MODULE_5__["FadeInOutBehavior"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiPointerScaleBehavior", function() { return _Behaviors_index__WEBPACK_IMPORTED_MODULE_5__["MultiPointerScaleBehavior"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PointerDragBehavior", function() { return _Behaviors_index__WEBPACK_IMPORTED_MODULE_5__["PointerDragBehavior"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SixDofDragBehavior", function() { return _Behaviors_index__WEBPACK_IMPORTED_MODULE_5__["SixDofDragBehavior"]; }); /* harmony import */ var _Bones_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Bones/index */ "./Bones/index.ts"); @@ -133372,8 +133372,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MultiRenderTarget", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["MultiRenderTarget"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["RawTexture"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RenderTargetTexture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["RenderTargetTexture"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Texture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["Texture"]; }); @@ -133400,10 +133398,10 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTexture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["ProceduralTexture"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["ProceduralTextureSceneComponent"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawCubeTexture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["RawCubeTexture"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["RawTexture"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RawTexture3D", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["RawTexture3D"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RefractionTexture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["RefractionTexture"]; }); @@ -133422,6 +133420,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NoiseProceduralTexture", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["NoiseProceduralTexture"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProceduralTextureSceneComponent", function() { return _Materials_index__WEBPACK_IMPORTED_MODULE_21__["ProceduralTextureSceneComponent"]; }); + /* harmony import */ var _Maths_index__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Maths/index */ "./Maths/index.ts"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scalar", function() { return _Maths_index__WEBPACK_IMPORTED_MODULE_22__["Scalar"]; }); @@ -133532,8 +133532,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoxBuilder", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["BoxBuilder"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiscBuilder", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["DiscBuilder"]; }); - /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SphereBuilder", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["SphereBuilder"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CylinderBuilder", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["CylinderBuilder"]; }); @@ -133544,6 +133542,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DracoCompression", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["DracoCompression"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiscBuilder", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["DiscBuilder"]; }); + /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RibbonBuilder", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["RibbonBuilder"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TorusBuilder", function() { return _Meshes_index__WEBPACK_IMPORTED_MODULE_23__["TorusBuilder"]; }); diff --git a/dist/preview release/gui/babylon.gui.d.ts b/dist/preview release/gui/babylon.gui.d.ts index 5dde69214f4..4bb9b1a0c2a 100644 --- a/dist/preview release/gui/babylon.gui.d.ts +++ b/dist/preview release/gui/babylon.gui.d.ts @@ -2372,6 +2372,7 @@ declare module BABYLON.GUI { protected _barOffset: ValueAndUnit; private _isThumbClamped; protected _displayThumb: boolean; + private _step; protected _effectiveBarOffset: number; protected _renderLeft: number; protected _renderTop: number; @@ -2384,6 +2385,8 @@ declare module BABYLON.GUI { onValueChangedObservable: BABYLON.Observable; /** Gets or sets a boolean indicating if the thumb must be rendered */ displayThumb: boolean; + /** Gets or sets a step to apply to values (0 by default) */ + step: number; /** Gets or sets main bar offset (ie. the margin applied to the value bar) */ barOffset: string | number; /** Gets main bar offset in pixels*/ diff --git a/dist/preview release/gui/babylon.gui.js b/dist/preview release/gui/babylon.gui.js index e483abba712..42c63f21fab 100644 --- a/dist/preview release/gui/babylon.gui.js +++ b/dist/preview release/gui/babylon.gui.js @@ -5088,9 +5088,9 @@ var Control = /** @class */ (function () { // Transform this._transform(context); // Clip - if (this.clipChildren) { - this._clip(context, invalidatedRectangle); - } + // if (this.clipChildren) { + this._clip(context, invalidatedRectangle); + // } if (this.onBeforeDrawObservable.hasObservers()) { this.onBeforeDrawObservable.notifyObservers(this); } @@ -9985,6 +9985,7 @@ var BaseSlider = /** @class */ (function (_super) { _this._barOffset = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__["ValueAndUnit"](5, _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__["ValueAndUnit"].UNITMODE_PIXEL, false); _this._isThumbClamped = false; _this._displayThumb = true; + _this._step = 0; // Shared rendering info _this._effectiveBarOffset = 0; /** Observable raised when the sldier value changes */ @@ -10009,6 +10010,21 @@ var BaseSlider = /** @class */ (function (_super) { enumerable: true, configurable: true }); + Object.defineProperty(BaseSlider.prototype, "step", { + /** Gets or sets a step to apply to values (0 by default) */ + get: function () { + return this._step; + }, + set: function (value) { + if (this._step === value) { + return; + } + this._step = value; + this._markAsDirty(); + }, + enumerable: true, + configurable: true + }); Object.defineProperty(BaseSlider.prototype, "barOffset", { /** Gets or sets main bar offset (ie. the margin applied to the value bar) */ get: function () { @@ -10215,12 +10231,15 @@ var BaseSlider = /** @class */ (function (_super) { x = this._transformedPosition.x; y = this._transformedPosition.y; } + var value; if (this._isVertical) { - this.value = this._minimum + (1 - ((y - this._currentMeasure.top) / this._currentMeasure.height)) * (this._maximum - this._minimum); + value = this._minimum + (1 - ((y - this._currentMeasure.top) / this._currentMeasure.height)) * (this._maximum - this._minimum); } else { - this.value = this._minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this._maximum - this._minimum); + value = this._minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this._maximum - this._minimum); } + var mult = (1 / this._step) | 0; + this.value = this._step ? ((value * mult) | 0) / mult : value; }; BaseSlider.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex) { if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex)) { diff --git a/dist/preview release/gui/babylon.gui.js.map b/dist/preview release/gui/babylon.gui.js.map index 51a3172bc74..33c92d91e33 100644 --- a/dist/preview release/gui/babylon.gui.js.map +++ b/dist/preview release/gui/babylon.gui.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://BABYLONJS/gui/src/webpack/universalModuleDefinition","webpack://BABYLONJS/gui/src/webpack/bootstrap","webpack://BABYLONJS/node_modules/tslib/tslib.es6.js","webpack://BABYLONJS/gui/src/(webpack)/buildin/global.js","webpack://BABYLONJS/gui/src/2D/adtInstrumentation.ts","webpack://BABYLONJS/gui/src/2D/advancedDynamicTexture.ts","webpack://BABYLONJS/gui/src/2D/controls/button.ts","webpack://BABYLONJS/gui/src/2D/controls/checkbox.ts","webpack://BABYLONJS/gui/src/2D/controls/colorpicker.ts","webpack://BABYLONJS/gui/src/2D/controls/container.ts","webpack://BABYLONJS/gui/src/2D/controls/control.ts","webpack://BABYLONJS/gui/src/2D/controls/displayGrid.ts","webpack://BABYLONJS/gui/src/2D/controls/ellipse.ts","webpack://BABYLONJS/gui/src/2D/controls/grid.ts","webpack://BABYLONJS/gui/src/2D/controls/image.ts","webpack://BABYLONJS/gui/src/2D/controls/index.ts","webpack://BABYLONJS/gui/src/2D/controls/inputPassword.ts","webpack://BABYLONJS/gui/src/2D/controls/inputText.ts","webpack://BABYLONJS/gui/src/2D/controls/line.ts","webpack://BABYLONJS/gui/src/2D/controls/multiLine.ts","webpack://BABYLONJS/gui/src/2D/controls/radioButton.ts","webpack://BABYLONJS/gui/src/2D/controls/rectangle.ts","webpack://BABYLONJS/gui/src/2D/controls/scrollViewers/scrollViewer.ts","webpack://BABYLONJS/gui/src/2D/controls/scrollViewers/scrollViewerWindow.ts","webpack://BABYLONJS/gui/src/2D/controls/selector.ts","webpack://BABYLONJS/gui/src/2D/controls/sliders/baseSlider.ts","webpack://BABYLONJS/gui/src/2D/controls/sliders/imageBasedSlider.ts","webpack://BABYLONJS/gui/src/2D/controls/sliders/scrollBar.ts","webpack://BABYLONJS/gui/src/2D/controls/sliders/slider.ts","webpack://BABYLONJS/gui/src/2D/controls/stackPanel.ts","webpack://BABYLONJS/gui/src/2D/controls/statics.ts","webpack://BABYLONJS/gui/src/2D/controls/textBlock.ts","webpack://BABYLONJS/gui/src/2D/controls/virtualKeyboard.ts","webpack://BABYLONJS/gui/src/2D/index.ts","webpack://BABYLONJS/gui/src/2D/math2D.ts","webpack://BABYLONJS/gui/src/2D/measure.ts","webpack://BABYLONJS/gui/src/2D/multiLinePoint.ts","webpack://BABYLONJS/gui/src/2D/style.ts","webpack://BABYLONJS/gui/src/2D/valueAndUnit.ts","webpack://BABYLONJS/gui/src/3D/controls/abstractButton3D.ts","webpack://BABYLONJS/gui/src/3D/controls/button3D.ts","webpack://BABYLONJS/gui/src/3D/controls/container3D.ts","webpack://BABYLONJS/gui/src/3D/controls/control3D.ts","webpack://BABYLONJS/gui/src/3D/controls/cylinderPanel.ts","webpack://BABYLONJS/gui/src/3D/controls/holographicButton.ts","webpack://BABYLONJS/gui/src/3D/controls/index.ts","webpack://BABYLONJS/gui/src/3D/controls/meshButton3D.ts","webpack://BABYLONJS/gui/src/3D/controls/planePanel.ts","webpack://BABYLONJS/gui/src/3D/controls/scatterPanel.ts","webpack://BABYLONJS/gui/src/3D/controls/spherePanel.ts","webpack://BABYLONJS/gui/src/3D/controls/stackPanel3D.ts","webpack://BABYLONJS/gui/src/3D/controls/volumeBasedPanel.ts","webpack://BABYLONJS/gui/src/3D/gui3DManager.ts","webpack://BABYLONJS/gui/src/3D/index.ts","webpack://BABYLONJS/gui/src/3D/materials/fluentMaterial.ts","webpack://BABYLONJS/gui/src/3D/materials/index.ts","webpack://BABYLONJS/gui/src/3D/materials/shaders/fluent.fragment.ts","webpack://BABYLONJS/gui/src/3D/materials/shaders/fluent.vertex.ts","webpack://BABYLONJS/gui/src/3D/vector3WithInfo.ts","webpack://BABYLONJS/gui/src/index.ts","webpack://BABYLONJS/gui/src/legacy/legacy.ts","webpack://BABYLONJS/gui/src/external {\"root\":\"BABYLON\",\"commonjs\":\"babylonjs\",\"commonjs2\":\"babylonjs\",\"amd\":\"babylonjs\"}"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA,+DAA+D;AAC/D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;;AAEO;AACP;AACA,mBAAmB,sBAAsB;AACzC;AACA;;AAEO;AACP;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;;AAEO;AACP;AACA;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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgC;AAEhC;;;;;GAKG;AACH,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IAC/B,YAAa,CAAC,OAAO,GAAS,YAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAC1D,YAAa,CAAC,OAAO,CAAC,GAAG,GAAG,mCAAG,CAAC;CACzC;AAEwB;;;;;;;;;;;;;ACdzB,uE","file":"babylon.gui.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"babylonjs\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"babylonjs-gui\", [\"babylonjs\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"babylonjs-gui\"] = factory(require(\"babylonjs\"));\n\telse\n\t\troot[\"BABYLON\"] = root[\"BABYLON\"] || {}, root[\"BABYLON\"][\"GUI\"] = factory(root[\"BABYLON\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./legacy/legacy.ts\");\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","\r\nimport { Nullable } from \"babylonjs/types\";\r\nimport { Observer } from \"babylonjs/Misc/observable\";\r\nimport { PerfCounter } from \"babylonjs/Misc/tools\";\r\nimport { IDisposable } from \"babylonjs/scene\";\r\n\r\nimport { AdvancedDynamicTexture } from \"./advancedDynamicTexture\";\r\n\r\n/**\r\n * This class can be used to get instrumentation data from a AdvancedDynamicTexture object\r\n */\r\nexport class AdvancedDynamicTextureInstrumentation implements IDisposable {\r\n private _captureRenderTime = false;\r\n private _renderTime = new PerfCounter();\r\n\r\n private _captureLayoutTime = false;\r\n private _layoutTime = new PerfCounter();\r\n\r\n // Observers\r\n private _onBeginRenderObserver: Nullable> = null;\r\n private _onEndRenderObserver: Nullable> = null;\r\n private _onBeginLayoutObserver: Nullable> = null;\r\n private _onEndLayoutObserver: Nullable> = null;\r\n\r\n // Properties\r\n\r\n /**\r\n * Gets the perf counter used to capture render time\r\n */\r\n public get renderTimeCounter(): PerfCounter {\r\n return this._renderTime;\r\n }\r\n\r\n /**\r\n * Gets the perf counter used to capture layout time\r\n */\r\n public get layoutTimeCounter(): PerfCounter {\r\n return this._layoutTime;\r\n }\r\n\r\n /**\r\n * Enable or disable the render time capture\r\n */\r\n public get captureRenderTime(): boolean {\r\n return this._captureRenderTime;\r\n }\r\n\r\n public set captureRenderTime(value: boolean) {\r\n if (value === this._captureRenderTime) {\r\n return;\r\n }\r\n\r\n this._captureRenderTime = value;\r\n\r\n if (value) {\r\n this._onBeginRenderObserver = this.texture.onBeginRenderObservable.add(() => {\r\n this._renderTime.beginMonitoring();\r\n });\r\n\r\n this._onEndRenderObserver = this.texture.onEndRenderObservable.add(() => {\r\n this._renderTime.endMonitoring(true);\r\n });\r\n } else {\r\n this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver);\r\n this._onBeginRenderObserver = null;\r\n this.texture.onEndRenderObservable.remove(this._onEndRenderObserver);\r\n this._onEndRenderObserver = null;\r\n }\r\n }\r\n\r\n /**\r\n * Enable or disable the layout time capture\r\n */\r\n public get captureLayoutTime(): boolean {\r\n return this._captureLayoutTime;\r\n }\r\n\r\n public set captureLayoutTime(value: boolean) {\r\n if (value === this._captureLayoutTime) {\r\n return;\r\n }\r\n\r\n this._captureLayoutTime = value;\r\n\r\n if (value) {\r\n this._onBeginLayoutObserver = this.texture.onBeginLayoutObservable.add(() => {\r\n this._layoutTime.beginMonitoring();\r\n });\r\n\r\n this._onEndLayoutObserver = this.texture.onEndLayoutObservable.add(() => {\r\n this._layoutTime.endMonitoring(true);\r\n });\r\n } else {\r\n this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver);\r\n this._onBeginLayoutObserver = null;\r\n this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver);\r\n this._onEndLayoutObserver = null;\r\n }\r\n }\r\n /**\r\n * Instantiates a new advanced dynamic texture instrumentation.\r\n * This class can be used to get instrumentation data from an AdvancedDynamicTexture object\r\n * @param texture Defines the AdvancedDynamicTexture to instrument\r\n */\r\n public constructor(\r\n /**\r\n * Define the instrumented AdvancedDynamicTexture.\r\n */\r\n public texture: AdvancedDynamicTexture) {\r\n }\r\n\r\n /**\r\n * Dispose and release associated resources.\r\n */\r\n public dispose() {\r\n this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver);\r\n this._onBeginRenderObserver = null;\r\n this.texture.onEndRenderObservable.remove(this._onEndRenderObserver);\r\n this._onEndRenderObserver = null;\r\n this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver);\r\n this._onBeginLayoutObserver = null;\r\n this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver);\r\n this._onEndLayoutObserver = null;\r\n\r\n (this.texture) = null;\r\n }\r\n}","import { Nullable } from \"babylonjs/types\";\nimport { Observable, Observer } from \"babylonjs/Misc/observable\";\nimport { Viewport, Color3, Vector2, Vector3, Matrix } from \"babylonjs/Maths/math\";\nimport { Tools } from \"babylonjs/Misc/tools\";\nimport { PointerInfoPre, PointerInfo, PointerEventTypes } from 'babylonjs/Events/pointerEvents';\nimport { ClipboardEventTypes, ClipboardInfo } from \"babylonjs/Events/clipboardEvents\";\nimport { KeyboardInfoPre, KeyboardEventTypes } from \"babylonjs/Events/keyboardEvents\";\nimport { Camera } from \"babylonjs/Cameras/camera\";\nimport { StandardMaterial } from \"babylonjs/Materials/standardMaterial\";\nimport { Texture } from \"babylonjs/Materials/Textures/texture\";\nimport { DynamicTexture } from \"babylonjs/Materials/Textures/dynamicTexture\";\nimport { AbstractMesh } from \"babylonjs/Meshes/abstractMesh\";\nimport { Layer } from \"babylonjs/Layers/layer\";\nimport { Engine } from \"babylonjs/Engines/engine\";\nimport { Scene } from \"babylonjs/scene\";\n\nimport { Container } from \"./controls/container\";\nimport { Control } from \"./controls/control\";\nimport { Style } from \"./style\";\nimport { Measure } from \"./measure\";\n/**\n* Interface used to define a control that can receive focus\n*/\nexport interface IFocusableControl {\n /**\n * Function called when the control receives the focus\n */\n onFocus(): void;\n /**\n * Function called when the control loses the focus\n */\n onBlur(): void;\n /**\n * Function called to let the control handle keyboard events\n * @param evt defines the current keyboard event\n */\n processKeyboard(evt: KeyboardEvent): void;\n /**\n * Function called to get the list of controls that should not steal the focus from this control\n * @returns an array of controls\n */\n keepsFocusWith(): Nullable;\n}\n/**\n* Class used to create texture to support 2D GUI elements\n* @see http://doc.babylonjs.com/how_to/gui\n*/\nexport class AdvancedDynamicTexture extends DynamicTexture {\n private _isDirty = false;\n private _renderObserver: Nullable>;\n private _resizeObserver: Nullable>;\n private _preKeyboardObserver: Nullable>;\n private _pointerMoveObserver: Nullable>;\n private _pointerObserver: Nullable>;\n private _canvasPointerOutObserver: Nullable>;\n private _background: string;\n /** @hidden */\n public _rootContainer = new Container(\"root\");\n /** @hidden */\n public _lastPickedControl: Control;\n /** @hidden */\n public _lastControlOver: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _lastControlDown: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _capturingControl: { [pointerId: number]: Control } = {};\n /** @hidden */\n public _shouldBlockPointer: boolean;\n /** @hidden */\n public _layerToDispose: Nullable;\n /** @hidden */\n public _linkedControls = new Array();\n private _isFullscreen = false;\n private _fullscreenViewport = new Viewport(0, 0, 1, 1);\n private _idealWidth = 0;\n private _idealHeight = 0;\n private _useSmallestIdeal: boolean = false;\n private _renderAtIdealSize = false;\n private _focusedControl: Nullable;\n private _blockNextFocusCheck = false;\n private _renderScale = 1;\n private _rootCanvas: Nullable;\n /**\n * Define type to string to ensure compatibility across browsers\n * Safari doesn't support DataTransfer constructor\n */\n private _clipboardData: string = \"\";\n /**\n * Observable event triggered each time an clipboard event is received from the rendering canvas\n */\n public onClipboardObservable = new Observable();\n /**\n * Observable event triggered each time a pointer down is intercepted by a control\n */\n public onControlPickedObservable = new Observable();\n /**\n * Observable event triggered before layout is evaluated\n */\n public onBeginLayoutObservable = new Observable();\n /**\n * Observable event triggered after the layout was evaluated\n */\n public onEndLayoutObservable = new Observable();\n /**\n * Observable event triggered before the texture is rendered\n */\n public onBeginRenderObservable = new Observable();\n /**\n * Observable event triggered after the texture was rendered\n */\n public onEndRenderObservable = new Observable();\n /**\n * Gets or sets a boolean defining if alpha is stored as premultiplied\n */\n public premulAlpha = false;\n /**\n * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).\n * Useful when you want more antialiasing\n */\n public get renderScale(): number {\n return this._renderScale;\n }\n public set renderScale(value: number) {\n if (value === this._renderScale) {\n return;\n }\n this._renderScale = value;\n this._onResize();\n }\n /** Gets or sets the background color */\n public get background(): string {\n return this._background;\n }\n public set background(value: string) {\n if (this._background === value) {\n return;\n }\n this._background = value;\n this.markAsDirty();\n }\n /**\n * Gets or sets the ideal width used to design controls.\n * The GUI will then rescale everything accordingly\n * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get idealWidth(): number {\n return this._idealWidth;\n }\n public set idealWidth(value: number) {\n if (this._idealWidth === value) {\n return;\n }\n this._idealWidth = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets the ideal height used to design controls.\n * The GUI will then rescale everything accordingly\n * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get idealHeight(): number {\n return this._idealHeight;\n }\n public set idealHeight(value: number) {\n if (this._idealHeight === value) {\n return;\n }\n this._idealHeight = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set\n * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get useSmallestIdeal(): boolean {\n return this._useSmallestIdeal;\n }\n public set useSmallestIdeal(value: boolean) {\n if (this._useSmallestIdeal === value) {\n return;\n }\n this._useSmallestIdeal = value;\n this.markAsDirty();\n this._rootContainer._markAllAsDirty();\n }\n /**\n * Gets or sets a boolean indicating if adaptive scaling must be used\n * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling\n */\n public get renderAtIdealSize(): boolean {\n return this._renderAtIdealSize;\n }\n public set renderAtIdealSize(value: boolean) {\n if (this._renderAtIdealSize === value) {\n return;\n }\n this._renderAtIdealSize = value;\n this._onResize();\n }\n /**\n * Gets the underlying layer used to render the texture when in fullscreen mode\n */\n public get layer(): Nullable {\n return this._layerToDispose;\n }\n /**\n * Gets the root container control\n */\n public get rootContainer(): Container {\n return this._rootContainer;\n }\n /**\n * Returns an array containing the root container.\n * This is mostly used to let the Inspector introspects the ADT\n * @returns an array containing the rootContainer\n */\n public getChildren(): Array {\n return [this._rootContainer];\n }\n /**\n * Will return all controls that are inside this texture\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\n * @return all child controls\n */\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[] {\n return this._rootContainer.getDescendants(directDescendantsOnly, predicate);\n }\n /**\n * Gets or sets the current focused control\n */\n public get focusedControl(): Nullable {\n return this._focusedControl;\n }\n public set focusedControl(control: Nullable) {\n if (this._focusedControl == control) {\n return;\n }\n if (this._focusedControl) {\n this._focusedControl.onBlur();\n }\n if (control) {\n control.onFocus();\n }\n this._focusedControl = control;\n }\n /**\n * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode\n */\n public get isForeground(): boolean {\n if (!this.layer) {\n return true;\n }\n return (!this.layer.isBackground);\n }\n public set isForeground(value: boolean) {\n if (!this.layer) {\n return;\n }\n if (this.layer.isBackground === !value) {\n return;\n }\n this.layer.isBackground = !value;\n }\n /**\n * Gets or set information about clipboardData\n */\n public get clipboardData(): string {\n return this._clipboardData;\n }\n public set clipboardData(value: string) {\n this._clipboardData = value;\n }\n /**\n * Creates a new AdvancedDynamicTexture\n * @param name defines the name of the texture\n * @param width defines the width of the texture\n * @param height defines the height of the texture\n * @param scene defines the hosting scene\n * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)\n * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\n */\n constructor(name: string, width = 0, height = 0, scene: Nullable, generateMipMaps = false, samplingMode = Texture.NEAREST_SAMPLINGMODE) {\n super(name, { width: width, height: height }, scene, generateMipMaps, samplingMode, Engine.TEXTUREFORMAT_RGBA);\n scene = this.getScene();\n if (!scene || !this._texture) {\n return;\n }\n this._rootCanvas = scene.getEngine()!.getRenderingCanvas()!;\n this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera: Camera) => this._checkUpdate(camera));\n this._preKeyboardObserver = scene.onPreKeyboardObservable.add((info) => {\n if (!this._focusedControl) {\n return;\n }\n if (info.type === KeyboardEventTypes.KEYDOWN) {\n this._focusedControl.processKeyboard(info.event);\n }\n info.skipOnPointerObservable = true;\n });\n this._rootContainer._link(this);\n this.hasAlpha = true;\n if (!width || !height) {\n this._resizeObserver = scene.getEngine().onResizeObservable.add(() => this._onResize());\n this._onResize();\n }\n this._texture.isReady = true;\n }\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"AdvancedDynamicTexture\"\n */\n public getClassName(): string {\n return \"AdvancedDynamicTexture\";\n }\n /**\n * Function used to execute a function on all controls\n * @param func defines the function to execute\n * @param container defines the container where controls belong. If null the root container will be used\n */\n public executeOnAllControls(func: (control: Control) => void, container?: Container) {\n if (!container) {\n container = this._rootContainer;\n }\n func(container);\n for (var child of container.children) {\n if ((child).children) {\n this.executeOnAllControls(func, (child));\n continue;\n }\n func(child);\n }\n }\n\n private _useInvalidateRectOptimization = true;\n\n /**\n * Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on\n */\n public get useInvalidateRectOptimization(): boolean {\n return this._useInvalidateRectOptimization;\n }\n\n public set useInvalidateRectOptimization(value: boolean) {\n this._useInvalidateRectOptimization = value;\n }\n\n // Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position\n private _invalidatedRectangle: Nullable = null;\n /**\n * Invalidates a rectangle area on the gui texture\n * @param invalidMinX left most position of the rectangle to invalidate in the texture\n * @param invalidMinY top most position of the rectangle to invalidate in the texture\n * @param invalidMaxX right most position of the rectangle to invalidate in the texture\n * @param invalidMaxY bottom most position of the rectangle to invalidate in the texture\n */\n public invalidateRect(invalidMinX: number, invalidMinY: number, invalidMaxX: number, invalidMaxY: number) {\n if (!this._useInvalidateRectOptimization) {\n return;\n }\n if (!this._invalidatedRectangle) {\n this._invalidatedRectangle = new Measure(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1);\n } else {\n // Compute intersection\n var maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX));\n var maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY));\n this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX));\n this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY));\n this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1;\n this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1;\n }\n }\n /**\n * Marks the texture as dirty forcing a complete update\n */\n public markAsDirty() {\n this._isDirty = true;\n }\n /**\n * Helper function used to create a new style\n * @returns a new style\n * @see http://doc.babylonjs.com/how_to/gui#styles\n */\n public createStyle(): Style {\n return new Style(this);\n }\n /**\n * Adds a new control to the root container\n * @param control defines the control to add\n * @returns the current texture\n */\n public addControl(control: Control): AdvancedDynamicTexture {\n this._rootContainer.addControl(control);\n return this;\n }\n /**\n * Removes a control from the root container\n * @param control defines the control to remove\n * @returns the current texture\n */\n public removeControl(control: Control): AdvancedDynamicTexture {\n this._rootContainer.removeControl(control);\n return this;\n }\n /**\n * Release all resources\n */\n public dispose(): void {\n let scene = this.getScene();\n if (!scene) {\n return;\n }\n this._rootCanvas = null;\n scene.onBeforeCameraRenderObservable.remove(this._renderObserver);\n if (this._resizeObserver) {\n scene.getEngine().onResizeObservable.remove(this._resizeObserver);\n }\n if (this._pointerMoveObserver) {\n scene.onPrePointerObservable.remove(this._pointerMoveObserver);\n }\n if (this._pointerObserver) {\n scene.onPointerObservable.remove(this._pointerObserver);\n }\n if (this._preKeyboardObserver) {\n scene.onPreKeyboardObservable.remove(this._preKeyboardObserver);\n }\n if (this._canvasPointerOutObserver) {\n scene.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver);\n }\n if (this._layerToDispose) {\n this._layerToDispose.texture = null;\n this._layerToDispose.dispose();\n this._layerToDispose = null;\n }\n this._rootContainer.dispose();\n this.onClipboardObservable.clear();\n this.onControlPickedObservable.clear();\n this.onBeginRenderObservable.clear();\n this.onEndRenderObservable.clear();\n this.onBeginLayoutObservable.clear();\n this.onEndLayoutObservable.clear();\n super.dispose();\n }\n private _onResize(): void {\n let scene = this.getScene();\n if (!scene) {\n return;\n }\n // Check size\n var engine = scene.getEngine();\n var textureSize = this.getSize();\n var renderWidth = engine.getRenderWidth() * this._renderScale;\n var renderHeight = engine.getRenderHeight() * this._renderScale;\n if (this._renderAtIdealSize) {\n if (this._idealWidth) {\n renderHeight = (renderHeight * this._idealWidth) / renderWidth;\n renderWidth = this._idealWidth;\n } else if (this._idealHeight) {\n renderWidth = (renderWidth * this._idealHeight) / renderHeight;\n renderHeight = this._idealHeight;\n }\n }\n if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) {\n this.scaleTo(renderWidth, renderHeight);\n this.markAsDirty();\n if (this._idealWidth || this._idealHeight) {\n this._rootContainer._markAllAsDirty();\n }\n }\n this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1);\n }\n /** @hidden */\n public _getGlobalViewport(scene: Scene): Viewport {\n var engine = scene.getEngine();\n return this._fullscreenViewport.toGlobal(engine.getRenderWidth(), engine.getRenderHeight());\n }\n /**\n * Get screen coordinates for a vector3\n * @param position defines the position to project\n * @param worldMatrix defines the world matrix to use\n * @returns the projected position\n */\n public getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2 {\n var scene = this.getScene();\n if (!scene) {\n return Vector2.Zero();\n }\n var globalViewport = this._getGlobalViewport(scene);\n var projectedPosition = Vector3.Project(position, worldMatrix, scene.getTransformMatrix(), globalViewport);\n projectedPosition.scaleInPlace(this.renderScale);\n return new Vector2(projectedPosition.x, projectedPosition.y);\n }\n private _checkUpdate(camera: Camera): void {\n if (this._layerToDispose) {\n if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {\n return;\n }\n }\n if (this._isFullscreen && this._linkedControls.length) {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var globalViewport = this._getGlobalViewport(scene);\n for (var control of this._linkedControls) {\n if (!control.isVisible) {\n continue;\n }\n var mesh = control._linkedMesh;\n if (!mesh || mesh.isDisposed()) {\n Tools.SetImmediate(() => {\n control.linkWithMesh(null);\n });\n continue;\n }\n var position = mesh.getBoundingInfo().boundingSphere.center;\n var projectedPosition = Vector3.Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);\n if (projectedPosition.z < 0 || projectedPosition.z > 1) {\n control.notRenderable = true;\n continue;\n }\n control.notRenderable = false;\n // Account for RenderScale.\n projectedPosition.scaleInPlace(this.renderScale);\n control._moveToProjectedPosition(projectedPosition);\n }\n }\n if (!this._isDirty && !this._rootContainer.isDirty) {\n return;\n }\n this._isDirty = false;\n this._render();\n this.update(true, this.premulAlpha);\n }\n private _clearMeasure = new Measure(0, 0, 0, 0);\n private _render(): void {\n var textureSize = this.getSize();\n var renderWidth = textureSize.width;\n var renderHeight = textureSize.height;\n\n var context = this.getContext();\n context.font = \"18px Arial\";\n context.strokeStyle = \"white\";\n\n // Layout\n this.onBeginLayoutObservable.notifyObservers(this);\n var measure = new Measure(0, 0, renderWidth, renderHeight);\n this._rootContainer._layout(measure, context);\n this.onEndLayoutObservable.notifyObservers(this);\n this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing\n\n // Clear\n if (this._invalidatedRectangle) {\n this._clearMeasure.copyFrom(this._invalidatedRectangle);\n } else {\n this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight);\n }\n context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\n if (this._background) {\n context.save();\n context.fillStyle = this._background;\n context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);\n context.restore();\n }\n\n // Render\n this.onBeginRenderObservable.notifyObservers(this);\n this._rootContainer._render(context, this._invalidatedRectangle);\n this.onEndRenderObservable.notifyObservers(this);\n this._invalidatedRectangle = null;\n }\n /** @hidden */\n public _changeCursor(cursor: string) {\n if (this._rootCanvas) {\n this._rootCanvas.style.cursor = cursor;\n }\n }\n /** @hidden */\n public _registerLastControlDown(control: Control, pointerId: number) {\n this._lastControlDown[pointerId] = control;\n this.onControlPickedObservable.notifyObservers(control);\n }\n private _doPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): void {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n var engine = scene.getEngine();\n var textureSize = this.getSize();\n if (this._isFullscreen) {\n let camera = scene.cameraToUseForPointers || scene.activeCamera;\n let viewport = camera!.viewport;\n x = x * (textureSize.width / (engine.getRenderWidth() * viewport.width));\n y = y * (textureSize.height / (engine.getRenderHeight() * viewport.height));\n }\n if (this._capturingControl[pointerId]) {\n this._capturingControl[pointerId]._processObservables(type, x, y, pointerId, buttonIndex);\n return;\n }\n if (!this._rootContainer._processPicking(x, y, type, pointerId, buttonIndex)) {\n this._changeCursor(\"\");\n if (type === PointerEventTypes.POINTERMOVE) {\n if (this._lastControlOver[pointerId]) {\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId]);\n delete this._lastControlOver[pointerId];\n }\n }\n }\n this._manageFocus();\n }\n /** @hidden */\n public _cleanControlAfterRemovalFromList(list: { [pointerId: number]: Control }, control: Control) {\n for (var pointerId in list) {\n if (!list.hasOwnProperty(pointerId)) {\n continue;\n }\n var lastControlOver = list[pointerId];\n if (lastControlOver === control) {\n delete list[pointerId];\n }\n }\n }\n /** @hidden */\n public _cleanControlAfterRemoval(control: Control) {\n this._cleanControlAfterRemovalFromList(this._lastControlDown, control);\n this._cleanControlAfterRemovalFromList(this._lastControlOver, control);\n }\n /** Attach to all scene events required to support pointer events */\n public attach(): void {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n\n let tempViewport = new Viewport(0, 0, 0, 0);\n\n this._pointerMoveObserver = scene.onPrePointerObservable.add((pi, state) => {\n if (scene!.isPointerCaptured(((pi.event)).pointerId)) {\n return;\n }\n if (pi.type !== PointerEventTypes.POINTERMOVE\n && pi.type !== PointerEventTypes.POINTERUP\n && pi.type !== PointerEventTypes.POINTERDOWN) {\n return;\n }\n if (!scene) {\n return;\n }\n\n let camera = scene.cameraToUseForPointers || scene.activeCamera;\n let engine = scene.getEngine();\n\n if (!camera) {\n tempViewport.x = 0;\n tempViewport.y = 0;\n tempViewport.width = engine.getRenderWidth();\n tempViewport.height = engine.getRenderHeight();\n } else {\n camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);\n }\n\n let x = scene.pointerX / engine.getHardwareScalingLevel() - tempViewport.x;\n let y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);\n this._shouldBlockPointer = false;\n // Do picking modifies _shouldBlockPointer\n this._doPicking(x, y, pi.type, (pi.event as PointerEvent).pointerId || 0, pi.event.button);\n // Avoid overwriting a true skipOnPointerObservable to false\n if (this._shouldBlockPointer) {\n pi.skipOnPointerObservable = this._shouldBlockPointer;\n }\n });\n this._attachToOnPointerOut(scene);\n }\n /** @hidden */\n private onClipboardCopy = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.COPY, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n }\n /** @hidden */\n private onClipboardCut = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.CUT, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n }\n /** @hidden */\n private onClipboardPaste = (rawEvt: Event) => {\n const evt = rawEvt as ClipboardEvent;\n let ev = new ClipboardInfo(ClipboardEventTypes.PASTE, evt);\n this.onClipboardObservable.notifyObservers(ev);\n evt.preventDefault();\n }\n /**\n * Register the clipboard Events onto the canvas\n */\n public registerClipboardEvents(): void {\n self.addEventListener(\"copy\", this.onClipboardCopy, false);\n self.addEventListener(\"cut\", this.onClipboardCut, false);\n self.addEventListener(\"paste\", this.onClipboardPaste, false);\n }\n /**\n * Unregister the clipboard Events from the canvas\n */\n public unRegisterClipboardEvents(): void {\n self.removeEventListener(\"copy\", this.onClipboardCopy);\n self.removeEventListener(\"cut\", this.onClipboardCut);\n self.removeEventListener(\"paste\", this.onClipboardPaste);\n }\n /**\n * Connect the texture to a hosting mesh to enable interactions\n * @param mesh defines the mesh to attach to\n * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well\n */\n public attachToMesh(mesh: AbstractMesh, supportPointerMove = true): void {\n var scene = this.getScene();\n if (!scene) {\n return;\n }\n this._pointerObserver = scene.onPointerObservable.add((pi, state) => {\n if (pi.type !== PointerEventTypes.POINTERMOVE\n && pi.type !== PointerEventTypes.POINTERUP\n && pi.type !== PointerEventTypes.POINTERDOWN) {\n return;\n }\n var pointerId = (pi.event as PointerEvent).pointerId || 0;\n if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {\n var uv = pi.pickInfo.getTextureCoordinates();\n if (uv) {\n let size = this.getSize();\n this._doPicking(uv.x * size.width, (1.0 - uv.y) * size.height, pi.type, pointerId, pi.event.button);\n }\n } else if (pi.type === PointerEventTypes.POINTERUP) {\n if (this._lastControlDown[pointerId]) {\n this._lastControlDown[pointerId]._forcePointerUp(pointerId);\n }\n delete this._lastControlDown[pointerId];\n if (this.focusedControl) {\n const friendlyControls = this.focusedControl.keepsFocusWith();\n let canMoveFocus = true;\n if (friendlyControls) {\n for (var control of friendlyControls) {\n // Same host, no need to keep the focus\n if (this === control._host) {\n continue;\n }\n // Different hosts\n const otherHost = control._host;\n if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control)) {\n canMoveFocus = false;\n break;\n }\n }\n }\n if (canMoveFocus) {\n this.focusedControl = null;\n }\n }\n } else if (pi.type === PointerEventTypes.POINTERMOVE) {\n if (this._lastControlOver[pointerId]) {\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], true);\n }\n delete this._lastControlOver[pointerId];\n }\n });\n mesh.enablePointerMoveEvents = supportPointerMove;\n this._attachToOnPointerOut(scene);\n }\n /**\n * Move the focus to a specific control\n * @param control defines the control which will receive the focus\n */\n public moveFocusToControl(control: IFocusableControl): void {\n this.focusedControl = control;\n this._lastPickedControl = control;\n this._blockNextFocusCheck = true;\n }\n private _manageFocus(): void {\n if (this._blockNextFocusCheck) {\n this._blockNextFocusCheck = false;\n this._lastPickedControl = this._focusedControl;\n return;\n }\n // Focus management\n if (this._focusedControl) {\n if (this._focusedControl !== (this._lastPickedControl)) {\n if (this._lastPickedControl.isFocusInvisible) {\n return;\n }\n this.focusedControl = null;\n }\n }\n }\n private _attachToOnPointerOut(scene: Scene): void {\n this._canvasPointerOutObserver = scene.getEngine().onCanvasPointerOutObservable.add((pointerEvent) => {\n if (this._lastControlOver[pointerEvent.pointerId]) {\n this._lastControlOver[pointerEvent.pointerId]._onPointerOut(this._lastControlOver[pointerEvent.pointerId]);\n }\n delete this._lastControlOver[pointerEvent.pointerId];\n if (this._lastControlDown[pointerEvent.pointerId] && this._lastControlDown[pointerEvent.pointerId] !== this._capturingControl[pointerEvent.pointerId]) {\n this._lastControlDown[pointerEvent.pointerId]._forcePointerUp();\n delete this._lastControlDown[pointerEvent.pointerId];\n }\n });\n }\n // Statics\n /**\n * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)\n * @param mesh defines the mesh which will receive the texture\n * @param width defines the texture width (1024 by default)\n * @param height defines the texture height (1024 by default)\n * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)\n * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateForMesh(mesh: AbstractMesh, width = 1024, height = 1024, supportPointerMove = true, onlyAlphaTesting = false): AdvancedDynamicTexture {\n var result = new AdvancedDynamicTexture(mesh.name + \" AdvancedDynamicTexture\", width, height, mesh.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE);\n var material = new StandardMaterial(\"AdvancedDynamicTextureMaterial\", mesh.getScene());\n material.backFaceCulling = false;\n material.diffuseColor = Color3.Black();\n material.specularColor = Color3.Black();\n if (onlyAlphaTesting) {\n material.diffuseTexture = result;\n material.emissiveTexture = result;\n result.hasAlpha = true;\n } else {\n material.emissiveTexture = result;\n material.opacityTexture = result;\n }\n mesh.material = material;\n result.attachToMesh(mesh, supportPointerMove);\n return result;\n }\n /**\n * Creates a new AdvancedDynamicTexture in fullscreen mode.\n * In this mode the texture will rely on a layer for its rendering.\n * This allows it to be treated like any other layer.\n * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.\n * LayerMask is set through advancedTexture.layer.layerMask\n * @param name defines name for the texture\n * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)\n * @param scene defines the hsoting scene\n * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)\n * @returns a new AdvancedDynamicTexture\n */\n public static CreateFullscreenUI(name: string, foreground: boolean = true, scene: Nullable = null, sampling = Texture.BILINEAR_SAMPLINGMODE): AdvancedDynamicTexture {\n var result = new AdvancedDynamicTexture(name, 0, 0, scene, false, sampling);\n // Display\n var layer = new Layer(name + \"_layer\", null, scene, !foreground);\n layer.texture = result;\n result._layerToDispose = layer;\n result._isFullscreen = true;\n // Attach\n result.attach();\n return result;\n }\n}\n","import { Nullable } from \"babylonjs/types\";\r\nimport { Vector2 } from \"babylonjs/Maths/math\";\r\n\r\nimport { Rectangle } from \"./rectangle\";\r\nimport { Control } from \"./control\";\r\nimport { TextBlock } from \"./textBlock\";\r\nimport { Image } from \"./image\";\r\n\r\n/**\r\n * Class used to create 2D buttons\r\n */\r\nexport class Button extends Rectangle {\r\n /**\r\n * Function called to generate a pointer enter animation\r\n */\r\n public pointerEnterAnimation: () => void;\r\n /**\r\n * Function called to generate a pointer out animation\r\n */\r\n public pointerOutAnimation: () => void;\r\n /**\r\n * Function called to generate a pointer down animation\r\n */\r\n public pointerDownAnimation: () => void;\r\n /**\r\n * Function called to generate a pointer up animation\r\n */\r\n public pointerUpAnimation: () => void;\r\n\r\n private _image: Nullable;\r\n /**\r\n * Returns the image part of the button (if any)\r\n */\r\n public get image(): Nullable {\r\n return this._image;\r\n }\r\n\r\n private _textBlock: Nullable;\r\n /**\r\n * Returns the image part of the button (if any)\r\n */\r\n public get textBlock(): Nullable {\r\n return this._textBlock;\r\n }\r\n\r\n /**\r\n * Creates a new Button\r\n * @param name defines the name of the button\r\n */\r\n constructor(public name?: string) {\r\n super(name);\r\n\r\n this.thickness = 1;\r\n this.isPointerBlocker = true;\r\n\r\n let alphaStore: Nullable = null;\r\n\r\n this.pointerEnterAnimation = () => {\r\n alphaStore = this.alpha;\r\n this.alpha -= 0.1;\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n if (alphaStore !== null) {\r\n this.alpha = alphaStore;\r\n }\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n this.scaleX -= 0.05;\r\n this.scaleY -= 0.05;\r\n };\r\n\r\n this.pointerUpAnimation = () => {\r\n this.scaleX += 0.05;\r\n this.scaleY += 0.05;\r\n };\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Button\";\r\n }\r\n\r\n // While being a container, the button behaves like a control.\r\n /** @hidden */\r\n public _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean {\r\n if (!this.isHitTestVisible || !this.isVisible || this.notRenderable) {\r\n return false;\r\n }\r\n\r\n if (!super.contains(x, y)) {\r\n return false;\r\n }\r\n\r\n this._processObservables(type, x, y, pointerId, buttonIndex);\r\n\r\n return true;\r\n }\r\n\r\n /** @hidden */\r\n public _onPointerEnter(target: Control): boolean {\r\n if (!super._onPointerEnter(target)) {\r\n return false;\r\n }\r\n\r\n if (this.pointerEnterAnimation) {\r\n this.pointerEnterAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** @hidden */\r\n public _onPointerOut(target: Control, force = false): void {\r\n if (this.pointerOutAnimation) {\r\n this.pointerOutAnimation();\r\n }\r\n\r\n super._onPointerOut(target, force);\r\n }\r\n\r\n /** @hidden */\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex)) {\r\n return false;\r\n }\r\n\r\n if (this.pointerDownAnimation) {\r\n this.pointerDownAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /** @hidden */\r\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n if (this.pointerUpAnimation) {\r\n this.pointerUpAnimation();\r\n }\r\n\r\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\r\n }\r\n\r\n // Statics\r\n /**\r\n * Creates a new button made with an image and a text\r\n * @param name defines the name of the button\r\n * @param text defines the text of the button\r\n * @param imageUrl defines the url of the image\r\n * @returns a new Button\r\n */\r\n public static CreateImageButton(name: string, text: string, imageUrl: string): Button {\r\n var result = new Button(name);\r\n\r\n // Adding text\r\n var textBlock = new TextBlock(name + \"_button\", text);\r\n textBlock.textWrapping = true;\r\n textBlock.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n textBlock.paddingLeft = \"20%\";\r\n result.addControl(textBlock);\r\n\r\n // Adding image\r\n var iconImage = new Image(name + \"_icon\", imageUrl);\r\n iconImage.width = \"20%\";\r\n iconImage.stretch = Image.STRETCH_UNIFORM;\r\n iconImage.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n result.addControl(iconImage);\r\n\r\n // Store\r\n result._image = iconImage;\r\n result._textBlock = textBlock;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new button made with an image\r\n * @param name defines the name of the button\r\n * @param imageUrl defines the url of the image\r\n * @returns a new Button\r\n */\r\n public static CreateImageOnlyButton(name: string, imageUrl: string): Button {\r\n var result = new Button(name);\r\n\r\n // Adding image\r\n var iconImage = new Image(name + \"_icon\", imageUrl);\r\n iconImage.stretch = Image.STRETCH_FILL;\r\n iconImage.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n result.addControl(iconImage);\r\n\r\n // Store\r\n result._image = iconImage;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new button made with a text\r\n * @param name defines the name of the button\r\n * @param text defines the text of the button\r\n * @returns a new Button\r\n */\r\n public static CreateSimpleButton(name: string, text: string): Button {\r\n var result = new Button(name);\r\n\r\n // Adding text\r\n var textBlock = new TextBlock(name + \"_button\", text);\r\n textBlock.textWrapping = true;\r\n textBlock.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n result.addControl(textBlock);\r\n\r\n // Store\r\n result._textBlock = textBlock;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new button made with an image and a centered text\r\n * @param name defines the name of the button\r\n * @param text defines the text of the button\r\n * @param imageUrl defines the url of the image\r\n * @returns a new Button\r\n */\r\n public static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button {\r\n var result = new Button(name);\r\n\r\n // Adding image\r\n var iconImage = new Image(name + \"_icon\", imageUrl);\r\n iconImage.stretch = Image.STRETCH_FILL;\r\n result.addControl(iconImage);\r\n\r\n // Adding text\r\n var textBlock = new TextBlock(name + \"_button\", text);\r\n textBlock.textWrapping = true;\r\n textBlock.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n result.addControl(textBlock);\r\n\r\n // Store\r\n result._image = iconImage;\r\n result._textBlock = textBlock;\r\n\r\n return result;\r\n }\r\n}","import { Observable } from \"babylonjs/Misc/observable\";\r\nimport { Vector2 } from \"babylonjs/Maths/math\";\r\n\r\nimport { Control } from \"./control\";\r\nimport { StackPanel } from \"./stackPanel\";\r\nimport { TextBlock } from \"./textBlock\";\r\n\r\n/**\r\n * Class used to represent a 2D checkbox\r\n */\r\nexport class Checkbox extends Control {\r\n private _isChecked = false;\r\n private _background = \"black\";\r\n private _checkSizeRatio = 0.8;\r\n private _thickness = 1;\r\n\r\n /** Gets or sets border thickness */\r\n public get thickness(): number {\r\n return this._thickness;\r\n }\r\n\r\n public set thickness(value: number) {\r\n if (this._thickness === value) {\r\n return;\r\n }\r\n\r\n this._thickness = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Observable raised when isChecked property changes\r\n */\r\n public onIsCheckedChangedObservable = new Observable();\r\n\r\n /** Gets or sets a value indicating the ratio between overall size and check size */\r\n public get checkSizeRatio(): number {\r\n return this._checkSizeRatio;\r\n }\r\n\r\n public set checkSizeRatio(value: number) {\r\n value = Math.max(Math.min(1, value), 0);\r\n\r\n if (this._checkSizeRatio === value) {\r\n return;\r\n }\r\n\r\n this._checkSizeRatio = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets background color */\r\n public get background(): string {\r\n return this._background;\r\n }\r\n\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n\r\n this._background = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the checkbox is checked or not */\r\n public get isChecked(): boolean {\r\n return this._isChecked;\r\n }\r\n\r\n public set isChecked(value: boolean) {\r\n if (this._isChecked === value) {\r\n return;\r\n }\r\n\r\n this._isChecked = value;\r\n this._markAsDirty();\r\n\r\n this.onIsCheckedChangedObservable.notifyObservers(value);\r\n }\r\n\r\n /**\r\n * Creates a new CheckBox\r\n * @param name defines the control name\r\n */\r\n constructor(public name?: string) {\r\n super(name);\r\n this.isPointerBlocker = true;\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Checkbox\";\r\n }\r\n\r\n /** @hidden */\r\n public _draw(context: CanvasRenderingContext2D): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n let actualWidth = this._currentMeasure.width - this._thickness;\r\n let actualHeight = this._currentMeasure.height - this._thickness;\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n context.fillStyle = this._isEnabled ? this._background : this._disabledColor;\r\n context.fillRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight);\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n if (this._isChecked) {\r\n context.fillStyle = this._isEnabled ? this.color : this._disabledColor;\r\n let offsetWidth = actualWidth * this._checkSizeRatio;\r\n let offseHeight = actualHeight * this._checkSizeRatio;\r\n\r\n context.fillRect(this._currentMeasure.left + this._thickness / 2 + (actualWidth - offsetWidth) / 2, this._currentMeasure.top + this._thickness / 2 + (actualHeight - offseHeight) / 2, offsetWidth, offseHeight);\r\n }\r\n\r\n context.strokeStyle = this.color;\r\n context.lineWidth = this._thickness;\r\n\r\n context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight);\r\n\r\n context.restore();\r\n }\r\n\r\n // Events\r\n\r\n /** @hidden */\r\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex)) {\r\n return false;\r\n }\r\n\r\n this.isChecked = !this.isChecked;\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Utility function to easily create a checkbox with a header\r\n * @param title defines the label to use for the header\r\n * @param onValueChanged defines the callback to call when value changes\r\n * @returns a StackPanel containing the checkbox and a textBlock\r\n */\r\n public static AddCheckBoxWithHeader(title: string, onValueChanged: (value: boolean) => void): StackPanel {\r\n var panel = new StackPanel();\r\n panel.isVertical = false;\r\n panel.height = \"30px\";\r\n\r\n var checkbox = new Checkbox();\r\n checkbox.width = \"20px\";\r\n checkbox.height = \"20px\";\r\n checkbox.isChecked = true;\r\n checkbox.color = \"green\";\r\n checkbox.onIsCheckedChangedObservable.add(onValueChanged);\r\n panel.addControl(checkbox);\r\n\r\n var header = new TextBlock();\r\n header.text = title;\r\n header.width = \"180px\";\r\n header.paddingLeft = \"5px\";\r\n header.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n header.color = \"white\";\r\n panel.addControl(header);\r\n\r\n return panel;\r\n }\r\n}\r\n","import { Observable } from \"babylonjs/Misc/observable\";\nimport { Color3, Vector2 } from \"babylonjs/Maths/math\";\n\nimport { Control } from \"./control\";\nimport { Measure } from \"../measure\";\nimport { InputText } from \"./inputText\";\nimport { Rectangle } from \"./rectangle\";\nimport { Button } from \"./button\";\nimport { Grid } from \"./grid\";\nimport { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\nimport { TextBlock } from \"../controls/textBlock\";\n\n/** Class used to create color pickers */\nexport class ColorPicker extends Control {\n private static _Epsilon = 0.000001;\n private _colorWheelCanvas: HTMLCanvasElement;\n\n private _value: Color3 = Color3.Red();\n private _tmpColor = new Color3();\n\n private _pointerStartedOnSquare = false;\n private _pointerStartedOnWheel = false;\n\n private _squareLeft = 0;\n private _squareTop = 0;\n private _squareSize = 0;\n\n private _h = 360;\n private _s = 1;\n private _v = 1;\n\n /**\n * Observable raised when the value changes\n */\n public onValueChangedObservable = new Observable();\n\n /** Gets or sets the color of the color picker */\n public get value(): Color3 {\n return this._value;\n }\n\n public set value(value: Color3) {\n if (this._value.equals(value)) {\n return;\n }\n\n this._value.copyFrom(value);\n\n this._RGBtoHSV(this._value, this._tmpColor);\n\n this._h = this._tmpColor.r;\n this._s = Math.max(this._tmpColor.g, 0.00001);\n this._v = Math.max(this._tmpColor.b, 0.00001);\n\n this._markAsDirty();\n\n if (this._value.r <= ColorPicker._Epsilon) {\n this._value.r = 0;\n }\n\n if (this._value.g <= ColorPicker._Epsilon) {\n this._value.g = 0;\n }\n\n if (this._value.b <= ColorPicker._Epsilon) {\n this._value.b = 0;\n }\n\n if (this._value.r >= 1.0 - ColorPicker._Epsilon) {\n this._value.r = 1.0;\n }\n\n if (this._value.g >= 1.0 - ColorPicker._Epsilon) {\n this._value.g = 1.0;\n }\n\n if (this._value.b >= 1.0 - ColorPicker._Epsilon) {\n this._value.b = 1.0;\n }\n\n this.onValueChangedObservable.notifyObservers(this._value);\n }\n\n /**\n * Gets or sets control width\n * @see http://doc.babylonjs.com/how_to/gui#position-and-size\n */\n public get width(): string | number {\n return this._width.toString(this._host);\n }\n\n public set width(value: string | number) {\n if (this._width.toString(this._host) === value) {\n return;\n }\n\n if (this._width.fromString(value)) {\n this._height.fromString(value);\n this._markAsDirty();\n }\n }\n\n /**\n * Gets or sets control height\n * @see http://doc.babylonjs.com/how_to/gui#position-and-size\n */\n public get height(): string | number {\n return this._height.toString(this._host);\n }\n\n /** Gets or sets control height */\n public set height(value: string | number) {\n if (this._height.toString(this._host) === value) {\n return;\n }\n\n if (this._height.fromString(value)) {\n this._width.fromString(value);\n this._markAsDirty();\n }\n }\n\n /** Gets or sets control size */\n public get size(): string | number {\n return this.width;\n }\n\n public set size(value: string | number) {\n this.width = value;\n }\n\n /**\n * Creates a new ColorPicker\n * @param name defines the control name\n */\n constructor(public name?: string) {\n super(name);\n this.value = new Color3(.88, .1, .1);\n this.size = \"200px\";\n this.isPointerBlocker = true;\n }\n\n protected _getTypeName(): string {\n return \"ColorPicker\";\n }\n\n /** @hidden */\n protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void {\n\n if (parentMeasure.width < parentMeasure.height) {\n this._currentMeasure.height = parentMeasure.width;\n } else {\n this._currentMeasure.width = parentMeasure.height;\n }\n }\n\n private _updateSquareProps(): void {\n var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * .5;\n var wheelThickness = radius * .2;\n var innerDiameter = (radius - wheelThickness) * 2;\n var squareSize = innerDiameter / (Math.sqrt(2));\n var offset = radius - squareSize * .5;\n\n this._squareLeft = this._currentMeasure.left + offset;\n this._squareTop = this._currentMeasure.top + offset;\n this._squareSize = squareSize;\n }\n\n private _drawGradientSquare(hueValue: number, left: number, top: number, width: number, height: number, context: CanvasRenderingContext2D) {\n var lgh = context.createLinearGradient(left, top, width + left, top);\n lgh.addColorStop(0, '#fff');\n lgh.addColorStop(1, 'hsl(' + hueValue + ', 100%, 50%)');\n\n context.fillStyle = lgh;\n context.fillRect(left, top, width, height);\n\n var lgv = context.createLinearGradient(left, top, left, height + top);\n lgv.addColorStop(0, 'rgba(0,0,0,0)');\n lgv.addColorStop(1, '#000');\n\n context.fillStyle = lgv;\n context.fillRect(left, top, width, height);\n }\n\n private _drawCircle(centerX: number, centerY: number, radius: number, context: CanvasRenderingContext2D) {\n context.beginPath();\n context.arc(centerX, centerY, radius + 1, 0, 2 * Math.PI, false);\n context.lineWidth = 3;\n context.strokeStyle = '#333333';\n context.stroke();\n context.beginPath();\n context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);\n context.lineWidth = 3;\n context.strokeStyle = '#ffffff';\n context.stroke();\n }\n\n private _createColorWheelCanvas(radius: number, thickness: number): HTMLCanvasElement {\n var canvas = document.createElement(\"canvas\");\n canvas.width = radius * 2;\n canvas.height = radius * 2;\n var context = canvas.getContext(\"2d\");\n var image = context.getImageData(0, 0, radius * 2, radius * 2);\n var data = image.data;\n\n var color = this._tmpColor;\n var maxDistSq = radius * radius;\n var innerRadius = radius - thickness;\n var minDistSq = innerRadius * innerRadius;\n\n for (var x = -radius; x < radius; x++) {\n for (var y = -radius; y < radius; y++) {\n\n var distSq = x * x + y * y;\n\n if (distSq > maxDistSq || distSq < minDistSq) {\n continue;\n }\n\n var dist = Math.sqrt(distSq);\n var ang = Math.atan2(y, x);\n\n this._HSVtoRGB(ang * 180 / Math.PI + 180, dist / radius, 1, color);\n\n var index = ((x + radius) + ((y + radius) * 2 * radius)) * 4;\n\n data[index] = color.r * 255;\n data[index + 1] = color.g * 255;\n data[index + 2] = color.b * 255;\n var alphaRatio = (dist - innerRadius) / (radius - innerRadius);\n\n //apply less alpha to bigger color pickers\n var alphaAmount = .2;\n var maxAlpha = .2;\n var minAlpha = .04;\n var lowerRadius = 50;\n var upperRadius = 150;\n\n if (radius < lowerRadius) {\n alphaAmount = maxAlpha;\n } else if (radius > upperRadius) {\n alphaAmount = minAlpha;\n } else {\n alphaAmount = (minAlpha - maxAlpha) * (radius - lowerRadius) / (upperRadius - lowerRadius) + maxAlpha;\n }\n\n var alphaRatio = (dist - innerRadius) / (radius - innerRadius);\n\n if (alphaRatio < alphaAmount) {\n data[index + 3] = 255 * (alphaRatio / alphaAmount);\n } else if (alphaRatio > 1 - alphaAmount) {\n data[index + 3] = 255 * (1.0 - ((alphaRatio - (1 - alphaAmount)) / alphaAmount));\n } else {\n data[index + 3] = 255;\n }\n\n }\n }\n\n context.putImageData(image, 0, 0);\n\n return canvas;\n }\n\n private _RGBtoHSV(color: Color3, result: Color3) {\n var r = color.r;\n var g = color.g;\n var b = color.b;\n\n var max = Math.max(r, g, b);\n var min = Math.min(r, g, b);\n var h = 0;\n var s = 0;\n var v = max;\n\n var dm = max - min;\n\n if (max !== 0) {\n s = dm / max;\n }\n\n if (max != min) {\n if (max == r) {\n h = (g - b) / dm;\n if (g < b) {\n h += 6;\n }\n } else if (max == g) {\n h = (b - r) / dm + 2;\n } else if (max == b) {\n h = (r - g) / dm + 4;\n }\n h *= 60;\n }\n\n result.r = h;\n result.g = s;\n result.b = v;\n }\n\n private _HSVtoRGB(hue: number, saturation: number, value: number, result: Color3) {\n var chroma = value * saturation;\n var h = hue / 60;\n var x = chroma * (1 - Math.abs((h % 2) - 1));\n var r = 0;\n var g = 0;\n var b = 0;\n\n if (h >= 0 && h <= 1) {\n r = chroma;\n g = x;\n } else if (h >= 1 && h <= 2) {\n r = x;\n g = chroma;\n } else if (h >= 2 && h <= 3) {\n g = chroma;\n b = x;\n } else if (h >= 3 && h <= 4) {\n g = x;\n b = chroma;\n } else if (h >= 4 && h <= 5) {\n r = x;\n b = chroma;\n } else if (h >= 5 && h <= 6) {\n r = chroma;\n b = x;\n }\n\n var m = value - chroma;\n result.set((r + m), (g + m), (b + m));\n }\n\n /** @hidden */\n public _draw(context: CanvasRenderingContext2D): void {\n context.save();\n\n this._applyStates(context);\n\n var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * .5;\n var wheelThickness = radius * .2;\n var left = this._currentMeasure.left;\n var top = this._currentMeasure.top;\n\n if (!this._colorWheelCanvas || this._colorWheelCanvas.width != radius * 2) {\n this._colorWheelCanvas = this._createColorWheelCanvas(radius, wheelThickness);\n }\n\n this._updateSquareProps();\n\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\n context.shadowColor = this.shadowColor;\n context.shadowBlur = this.shadowBlur;\n context.shadowOffsetX = this.shadowOffsetX;\n context.shadowOffsetY = this.shadowOffsetY;\n\n context.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize);\n }\n\n context.drawImage(this._colorWheelCanvas, left, top);\n\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n\n this._drawGradientSquare(this._h,\n this._squareLeft,\n this._squareTop,\n this._squareSize,\n this._squareSize,\n context);\n\n var cx = this._squareLeft + this._squareSize * this._s;\n var cy = this._squareTop + this._squareSize * (1 - this._v);\n\n this._drawCircle(cx, cy, radius * .04, context);\n\n var dist = radius - wheelThickness * .5;\n cx = left + radius + Math.cos((this._h - 180) * Math.PI / 180) * dist;\n cy = top + radius + Math.sin((this._h - 180) * Math.PI / 180) * dist;\n this._drawCircle(cx, cy, wheelThickness * .35, context);\n\n context.restore();\n }\n\n // Events\n private _pointerIsDown = false;\n\n private _updateValueFromPointer(x: number, y: number): void {\n if (this._pointerStartedOnWheel) {\n var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * .5;\n var centerX = radius + this._currentMeasure.left;\n var centerY = radius + this._currentMeasure.top;\n this._h = Math.atan2(y - centerY, x - centerX) * 180 / Math.PI + 180;\n }\n else if (this._pointerStartedOnSquare) {\n this._updateSquareProps();\n this._s = (x - this._squareLeft) / this._squareSize;\n this._v = 1 - (y - this._squareTop) / this._squareSize;\n this._s = Math.min(this._s, 1);\n this._s = Math.max(this._s, ColorPicker._Epsilon);\n this._v = Math.min(this._v, 1);\n this._v = Math.max(this._v, ColorPicker._Epsilon);\n }\n\n this._HSVtoRGB(this._h, this._s, this._v, this._tmpColor);\n\n this.value = this._tmpColor;\n }\n\n private _isPointOnSquare(x: number, y: number): boolean {\n this._updateSquareProps();\n\n var left = this._squareLeft;\n var top = this._squareTop;\n var size = this._squareSize;\n\n if (x >= left && x <= left + size &&\n y >= top && y <= top + size) {\n return true;\n }\n\n return false;\n }\n\n private _isPointOnWheel(x: number, y: number): boolean {\n var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * .5;\n var centerX = radius + this._currentMeasure.left;\n var centerY = radius + this._currentMeasure.top;\n var wheelThickness = radius * .2;\n var innerRadius = radius - wheelThickness;\n var radiusSq = radius * radius;\n var innerRadiusSq = innerRadius * innerRadius;\n\n var dx = x - centerX;\n var dy = y - centerY;\n\n var distSq = dx * dx + dy * dy;\n\n if (distSq <= radiusSq && distSq >= innerRadiusSq) {\n return true;\n }\n\n return false;\n }\n\n public _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean {\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex)) {\n return false;\n }\n\n this._pointerIsDown = true;\n\n this._pointerStartedOnSquare = false;\n this._pointerStartedOnWheel = false;\n\n // Invert transform\n this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);\n\n let x = this._transformedPosition.x;\n let y = this._transformedPosition.y;\n\n if (this._isPointOnSquare(x, y)) {\n this._pointerStartedOnSquare = true;\n } else if (this._isPointOnWheel(x, y)) {\n this._pointerStartedOnWheel = true;\n }\n\n this._updateValueFromPointer(x, y);\n this._host._capturingControl[pointerId] = this;\n\n return true;\n }\n\n public _onPointerMove(target: Control, coordinates: Vector2): void {\n // Invert transform\n this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);\n\n let x = this._transformedPosition.x;\n let y = this._transformedPosition.y;\n\n if (this._pointerIsDown) {\n this._updateValueFromPointer(x, y);\n }\n\n super._onPointerMove(target, coordinates);\n }\n\n public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\n this._pointerIsDown = false;\n\n delete this._host._capturingControl[pointerId];\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\n }\n\n /**\n * This function expands the color picker by creating a color picker dialog with manual\n * color value input and the ability to save colors into an array to be used later in\n * subsequent launches of the dialogue.\n * @param advancedTexture defines the AdvancedDynamicTexture the dialog is assigned to\n * @param options defines size for dialog and options for saved colors. Also accepts last color picked as hex string and saved colors array as hex strings.\n * @returns picked color as a hex string and the saved colors array as hex strings.\n */\n public static ShowPickerDialogAsync(advancedTexture: AdvancedDynamicTexture,\n options: {\n pickerWidth?: string,\n pickerHeight?: string,\n headerHeight?: string,\n lastColor?: string,\n swatchLimit?: number,\n numSwatchesPerLine?: number,\n savedColors?: Array\n }\n ): Promise<{\n savedColors?: string[],\n pickedColor: string\n }> {\n\n return new Promise((resolve, reject) => {\n // Default options\n options.pickerWidth = options.pickerWidth || \"640px\";\n options.pickerHeight = options.pickerHeight || \"400px\";\n options.headerHeight = options.headerHeight || \"35px\";\n options.lastColor = options.lastColor || \"#000000\";\n options.swatchLimit = options.swatchLimit || 20;\n options.numSwatchesPerLine = options.numSwatchesPerLine || 10;\n\n // Window size settings\n var drawerMaxRows: number = options.swatchLimit / options.numSwatchesPerLine;\n var rawSwatchSize: number = parseFloat(options.pickerWidth) / options.numSwatchesPerLine;\n var gutterSize: number = Math.floor(rawSwatchSize * 0.25);\n var colGutters: number = gutterSize * (options.numSwatchesPerLine + 1);\n var swatchSize: number = Math.floor((parseFloat(options.pickerWidth) - colGutters) / options.numSwatchesPerLine);\n var drawerMaxSize: number = (swatchSize * drawerMaxRows) + (gutterSize * (drawerMaxRows + 1));\n var containerSize: string = (parseInt(options.pickerHeight) + drawerMaxSize + Math.floor(swatchSize * 0.25)).toString() + \"px\";\n\n // Button Colors\n var buttonColor: string = \"#c0c0c0\";\n var buttonBackgroundColor: string = \"#535353\";\n var buttonBackgroundHoverColor: string = \"#414141\";\n var buttonBackgroundClickColor: string = \"515151\";\n var buttonDisabledColor: string = \"#555555\";\n var buttonDisabledBackgroundColor: string = \"#454545\";\n var currentSwatchesOutlineColor: string = \"#404040\";\n var luminanceLimitColor: Color3 = Color3.FromHexString(\"#dddddd\");\n var luminanceLimit: number = luminanceLimitColor.r + luminanceLimitColor.g + luminanceLimitColor.b;\n var iconColorDark: string = \"#aaaaaa\";\n var iconColorLight: string = \"#ffffff\";\n var closeIconColor: Color3;\n\n // Button settings\n var buttonFontSize: number;\n var butEdit: Button;\n var buttonWidth: string;\n var buttonHeight: string;\n\n // Input Text Colors\n var inputFieldLabels: string[] = [\"R\", \"G\", \"B\"];\n var inputTextBackgroundColor: string = \"#454545\";\n var inputTextColor: string = \"#f0f0f0\";\n\n // This is the current color as set by either the picker or by entering a value\n var currentColor: Color3;\n\n // This int is used for naming swatches and serves as the index for calling them from the list\n var swatchNumber: number;\n\n // Menu Panel options. We need to know if the swatchDrawer exists so we can create it if needed.\n var swatchDrawer: Grid;\n var editSwatchMode: boolean = false;\n\n // Color InputText fields that will be updated upon value change\n var picker: ColorPicker;\n var rValInt: InputText;\n var gValInt: InputText;\n var bValInt: InputText;\n var rValDec: InputText;\n var gValDec: InputText;\n var bValDec: InputText;\n var hexVal: InputText;\n var newSwatch: Rectangle;\n var lastVal: string;\n var activeField: string;\n\n /**\n * Will update all values for InputText and ColorPicker controls based on the BABYLON.Color3 passed to this function.\n * Each InputText control and the ColorPicker control will be tested to see if they are the activeField and if they\n * are will receive no update. This is to prevent the input from the user being overwritten.\n */\n function updateValues(value: Color3, inputField: string) {\n activeField = inputField;\n var pickedColor: string = value.toHexString();\n newSwatch.background = pickedColor;\n if (rValInt.name != activeField) {\n rValInt.text = Math.floor(value.r * 255).toString();\n }\n if (gValInt.name != activeField) {\n gValInt.text = Math.floor(value.g * 255).toString();\n }\n if (bValInt.name != activeField) {\n bValInt.text = Math.floor(value.b * 255).toString();\n }\n if (rValDec.name != activeField) {\n rValDec.text = value.r.toString();\n }\n if (gValDec.name != activeField) {\n gValDec.text = value.g.toString();\n }\n if (bValDec.name != activeField) {\n bValDec.text = value.b.toString();\n }\n if (hexVal.name != activeField) {\n var minusPound: string[] = pickedColor.split(\"#\");\n hexVal.text = minusPound[1];\n }\n if (picker.name != activeField) {\n picker.value = value;\n }\n }\n\n // When the user enters an integer for R, G, or B we check to make sure it is a valid number and replace if not.\n function updateInt(field: InputText, channel: string) {\n var newValue: string = field.text;\n var checkVal: boolean = /[^0-9]/g.test(newValue);\n if (checkVal) {\n field.text = lastVal;\n return;\n }\n else {\n if (newValue != \"\") {\n if (Math.floor(parseInt(newValue)) < 0) {\n newValue = \"0\";\n }\n else if (Math.floor(parseInt(newValue)) > 255) {\n newValue = \"255\";\n }\n else if (isNaN(parseInt(newValue))) {\n newValue = \"0\";\n }\n }\n if (activeField == field.name) {\n lastVal = newValue;\n }\n }\n if (newValue != \"\") {\n newValue = parseInt(newValue).toString();\n field.text = newValue;\n var newSwatchRGB: Color3 = Color3.FromHexString(newSwatch.background);\n if (activeField == field.name) {\n if (channel == \"r\") {\n updateValues(new Color3((parseInt(newValue)) / 255, newSwatchRGB.g, newSwatchRGB.b), field.name);\n }\n else if (channel == \"g\") {\n updateValues(new Color3(newSwatchRGB.r, (parseInt(newValue)) / 255, newSwatchRGB.b), field.name);\n }\n else {\n updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, (parseInt(newValue)) / 255), field.name);\n }\n }\n }\n }\n\n // When the user enters a float for R, G, or B we check to make sure it is a valid number and replace if not.\n function updateFloat(field: InputText, channel: string) {\n var newValue: string = field.text;\n var checkVal: boolean = /[^0-9\\.]/g.test(newValue);\n if (checkVal) {\n field.text = lastVal;\n return;\n }\n else {\n if (newValue != \"\" && newValue != \".\" && parseFloat(newValue) != 0) {\n if (parseFloat(newValue) < 0.0) {\n newValue = \"0.0\";\n }\n else if (parseFloat(newValue) > 1.0) {\n newValue = \"1.0\";\n }\n else if (isNaN(parseFloat(newValue))) {\n newValue = \"0.0\";\n }\n }\n if (activeField == field.name) {\n lastVal = newValue;\n }\n }\n if (newValue != \"\" && newValue != \".\" && parseFloat(newValue) != 0) {\n newValue = parseFloat(newValue).toString();\n field.text = newValue;\n }\n else {\n newValue = \"0.0\";\n }\n var newSwatchRGB = Color3.FromHexString(newSwatch.background);\n if (activeField == field.name) {\n if (channel == \"r\") {\n updateValues(new Color3(parseFloat(newValue), newSwatchRGB.g, newSwatchRGB.b), field.name);\n }\n else if (channel == \"g\") {\n updateValues(new Color3(newSwatchRGB.r, parseFloat(newValue), newSwatchRGB.b), field.name);\n }\n else {\n updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseFloat(newValue)), field.name);\n }\n }\n\n }\n\n // Removes the current index from the savedColors array. Drawer can then be regenerated.\n function deleteSwatch(index: number) {\n if (options.savedColors) {\n options.savedColors.splice(index, 1);\n }\n if (options.savedColors && options.savedColors.length == 0) {\n setEditButtonVisibility(false);\n editSwatchMode = false;\n }\n }\n\n // Creates and styles an individual swatch when updateSwatches is called.\n function createSwatch() {\n if (options.savedColors && options.savedColors[swatchNumber]) {\n if (editSwatchMode) {\n var icon: string = \"b\";\n }\n else {\n var icon: string = \"\";\n }\n var swatch: Button = Button.CreateSimpleButton(\"Swatch_\" + swatchNumber, icon);\n swatch.fontFamily = \"BabylonJSglyphs\";\n var swatchColor: Color3 = Color3.FromHexString(options.savedColors[swatchNumber]);\n var swatchLuminence: number = swatchColor.r + swatchColor.g + swatchColor.b;\n\n // Set color of outline and textBlock based on luminance of the color swatch so feedback always visible\n if (swatchLuminence > luminanceLimit) {\n swatch.color = iconColorDark;\n }\n else {\n swatch.color = iconColorLight;\n }\n swatch.fontSize = Math.floor(swatchSize * 0.7);\n swatch.textBlock!.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\n swatch.height = swatch.width = (swatchSize).toString() + \"px\";\n swatch.background = options.savedColors[swatchNumber];\n swatch.thickness = 2;\n let metadata = swatchNumber;\n swatch.pointerDownAnimation = () => {\n swatch.thickness = 4;\n };\n swatch.pointerUpAnimation = () => {\n swatch.thickness = 3;\n };\n swatch.pointerEnterAnimation = () => {\n swatch.thickness = 3;\n };\n swatch.pointerOutAnimation = () => {\n swatch.thickness = 2;\n };\n swatch.onPointerClickObservable.add(() => {\n if (!editSwatchMode) {\n if (options.savedColors) {\n updateValues(Color3.FromHexString(options.savedColors[metadata]), swatch.name!);\n }\n }\n else {\n deleteSwatch(metadata);\n updateSwatches(\"\", butSave);\n }\n });\n return swatch;\n }\n else {\n return null;\n }\n }\n\n // Mode switch to render button text and close symbols on swatch controls\n function editSwatches(mode?: boolean) {\n if (mode !== undefined) {\n editSwatchMode = mode;\n }\n if (editSwatchMode) {\n for (var i = 0; i < swatchDrawer.children.length; i++) {\n var thisButton: Button = swatchDrawer.children[i] as Button;\n thisButton.textBlock!.text = \"b\";\n }\n if (butEdit !== undefined) {\n butEdit.textBlock!.text = \"Done\";\n }\n }\n else {\n for (var i = 0; i < swatchDrawer.children.length; i++) {\n var thisButton: Button = swatchDrawer.children[i] as Button;\n thisButton.textBlock!.text = \"\";\n }\n if (butEdit !== undefined) {\n butEdit.textBlock!.text = \"Edit\";\n }\n }\n }\n\n /**\n * When Save Color button is pressed this function will first create a swatch drawer if one is not already\n * made. Then all controls are removed from the drawer and we step through the savedColors array and\n * creates one swatch per color. It will also set the height of the drawer control based on how many\n * saved colors there are and how many can be stored per row.\n */\n function updateSwatches(color: string, button: Button) {\n if (options.savedColors) {\n\n if (color != \"\") {\n options.savedColors.push(color);\n }\n swatchNumber = 0;\n swatchDrawer.clearControls();\n var rowCount: number = Math.ceil(options.savedColors.length / options.numSwatchesPerLine!);\n if (rowCount == 0) {\n var gutterCount: number = 0;\n }\n else {\n var gutterCount: number = rowCount + 1;\n }\n if (swatchDrawer.rowCount != rowCount + gutterCount) {\n var currentRows: number = swatchDrawer.rowCount;\n for (var i = 0; i < currentRows; i++) {\n swatchDrawer.removeRowDefinition(0);\n }\n for (var i = 0; i < rowCount + gutterCount; i++) {\n if (i % 2) {\n swatchDrawer.addRowDefinition(swatchSize, true);\n }\n else {\n swatchDrawer.addRowDefinition(gutterSize, true);\n }\n }\n }\n swatchDrawer.height = ((swatchSize * rowCount) + (gutterCount * gutterSize)).toString() + \"px\";\n\n for (var y = 1, thisRow = 1; y < rowCount + gutterCount; y += 2, thisRow++) {\n\n // Determine number of buttons to create per row based on the button limit per row and number of saved colors\n if (options.savedColors.length > thisRow * options.numSwatchesPerLine!) {\n var totalButtonsThisRow = options.numSwatchesPerLine!;\n }\n else {\n var totalButtonsThisRow = options.savedColors.length - ((thisRow - 1) * options.numSwatchesPerLine!);\n }\n var buttonIterations: number = (Math.min(Math.max(totalButtonsThisRow, 0), options.numSwatchesPerLine!));\n for (var x = 0, w = 1; x < buttonIterations; x++) {\n if (x > options.numSwatchesPerLine!) {\n continue;\n }\n var swatch: Button | null = createSwatch();\n if (swatch != null) {\n swatchDrawer.addControl(swatch, y, w);\n w += 2;\n swatchNumber++;\n }\n else {\n continue;\n }\n }\n }\n if (options.savedColors.length >= options.swatchLimit!) {\n disableButton(button, true);\n }\n else {\n disableButton(button, false);\n }\n }\n }\n\n // Shows or hides edit swatches button depending on if there are saved swatches\n function setEditButtonVisibility(enableButton: boolean) {\n if (enableButton) {\n butEdit = Button.CreateSimpleButton(\"butEdit\", \"Edit\");\n butEdit.width = buttonWidth;\n butEdit.height = buttonHeight;\n butEdit.left = (Math.floor(parseInt(buttonWidth) * 0.1)).toString() + \"px\";\n butEdit.top = (parseFloat(butEdit.left) * -1).toString() + \"px\";\n butEdit.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM;\n butEdit.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\n butEdit.thickness = 2;\n butEdit.color = buttonColor;\n butEdit.fontSize = buttonFontSize;\n butEdit.background = buttonBackgroundColor;\n butEdit.onPointerEnterObservable.add(() => {\n butEdit.background = buttonBackgroundHoverColor;\n });\n butEdit.onPointerOutObservable.add(() => {\n butEdit.background = buttonBackgroundColor;\n });\n butEdit.pointerDownAnimation = () => {\n butEdit.background = buttonBackgroundClickColor;\n };\n butEdit.pointerUpAnimation = () => {\n butEdit.background = buttonBackgroundHoverColor;\n };\n butEdit.onPointerClickObservable.add(() => {\n if (editSwatchMode) {\n editSwatchMode = false;\n }\n else {\n editSwatchMode = true;\n }\n editSwatches();\n });\n pickerGrid.addControl(butEdit, 1, 0);\n }\n else {\n pickerGrid.removeControl(butEdit);\n }\n }\n\n // Called when the user hits the limit of saved colors in the drawer.\n function disableButton(button: Button, disabled: boolean) {\n if (disabled) {\n button.color = buttonDisabledColor;\n button.background = buttonDisabledBackgroundColor;\n }\n else {\n button.color = buttonColor;\n button.background = buttonBackgroundColor;\n }\n }\n\n // Passes last chosen color back to scene and kills dialog by removing from AdvancedDynamicTexture\n function closePicker(color: string) {\n if (options.savedColors && options.savedColors.length > 0) {\n resolve({\n savedColors: options.savedColors,\n pickedColor: color\n });\n }\n else {\n resolve({\n pickedColor: color\n });\n }\n advancedTexture.removeControl(dialogContainer);\n }\n\n // Dialogue menu container which will contain both the main dialogue window and the swatch drawer which opens once a color is saved.\n var dialogContainer: Grid = new Grid();\n dialogContainer.name = \"Dialog Container\";\n dialogContainer.width = options.pickerWidth;\n if (options.savedColors) {\n dialogContainer.height = containerSize;\n var topRow: number = parseInt(options.pickerHeight) / parseInt(containerSize);\n dialogContainer.addRowDefinition(topRow, false);\n dialogContainer.addRowDefinition(1.0 - topRow, false);\n }\n else {\n dialogContainer.height = options.pickerHeight;\n dialogContainer.addRowDefinition(1.0, false);\n }\n advancedTexture.addControl(dialogContainer);\n\n // Swatch drawer which contains all saved color buttons\n if (options.savedColors) {\n swatchDrawer = new Grid();\n swatchDrawer.name = \"Swatch Drawer\";\n swatchDrawer.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\n swatchDrawer.background = buttonBackgroundColor;\n swatchDrawer.width = options.pickerWidth!;\n var initialRows: number = options.savedColors.length / options.numSwatchesPerLine;\n if (initialRows == 0) {\n var gutterCount: number = 0;\n }\n else {\n var gutterCount: number = initialRows + 1;\n }\n swatchDrawer.height = ((swatchSize * initialRows) + (gutterCount * gutterSize)).toString() + \"px\";\n swatchDrawer.top = Math.floor(swatchSize * 0.25).toString() + \"px\";\n for (var i = 0; i < (Math.ceil(options.savedColors.length / options.numSwatchesPerLine) * 2) + 1; i++) {\n if (i % 2 != 0) {\n swatchDrawer.addRowDefinition(swatchSize, true);\n }\n else {\n swatchDrawer.addRowDefinition(gutterSize, true);\n }\n }\n for (var i = 0; i < options.numSwatchesPerLine! * 2 + 1; i++) {\n if (i % 2 != 0) {\n swatchDrawer.addColumnDefinition(swatchSize, true);\n }\n else {\n swatchDrawer.addColumnDefinition(gutterSize, true);\n }\n }\n dialogContainer.addControl(swatchDrawer, 1, 0);\n }\n\n // Picker container\n var pickerPanel: Grid = new Grid();\n pickerPanel.name = \"Picker Panel\";\n pickerPanel.height = options.pickerHeight;\n var panelHead: number = parseInt(options.headerHeight) / parseInt(options.pickerHeight);\n var pickerPanelRows: number[] = [panelHead, 1.0 - panelHead];\n pickerPanel.addRowDefinition(pickerPanelRows[0], false);\n pickerPanel.addRowDefinition(pickerPanelRows[1], false);\n dialogContainer.addControl(pickerPanel, 0, 0);\n\n // Picker container header\n var header: Rectangle = new Rectangle();\n header.name = \"Dialogue Header Bar\";\n header.background = \"#cccccc\";\n header.thickness = 0;\n pickerPanel.addControl(header, 0, 0);\n\n // Header close button\n var closeButton: Button = Button.CreateSimpleButton(\"closeButton\", \"a\");\n closeButton.fontFamily = \"BabylonJSglyphs\";\n var headerColor3: Color3 = Color3.FromHexString(header.background);\n closeIconColor = new Color3(1.0 - headerColor3.r, 1.0 - headerColor3.g, 1.0 - headerColor3.b);\n closeButton.color = closeIconColor.toHexString();\n closeButton.fontSize = Math.floor(parseInt(options.headerHeight!) * 0.6);\n closeButton.textBlock!.textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\n closeButton.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_RIGHT;\n closeButton.height = closeButton.width = options.headerHeight;\n closeButton.background = header.background;\n closeButton.thickness = 0;\n closeButton.pointerDownAnimation = () => {\n };\n closeButton.pointerUpAnimation = () => {\n closeButton.background = header.background;\n };\n closeButton.pointerEnterAnimation = () => {\n closeButton.color = header.background;\n closeButton.background = \"red\";\n };\n closeButton.pointerOutAnimation = () => {\n closeButton.color = closeIconColor.toHexString();\n closeButton.background = header.background;\n };\n closeButton.onPointerClickObservable.add(() => {\n closePicker(currentSwatch.background);\n });\n pickerPanel.addControl(closeButton, 0, 0);\n\n // Dialog container body\n var dialogBody: Grid = new Grid();\n dialogBody.name = \"Dialogue Body\";\n dialogBody.background = buttonBackgroundColor;\n var dialogBodyCols: number[] = [0.4375, 0.5625];\n dialogBody.addRowDefinition(1.0, false);\n dialogBody.addColumnDefinition(dialogBodyCols[0], false);\n dialogBody.addColumnDefinition(dialogBodyCols[1], false);\n pickerPanel.addControl(dialogBody, 1, 0);\n\n // Picker grid\n var pickerGrid: Grid = new Grid();\n pickerGrid.name = \"Picker Grid\";\n pickerGrid.addRowDefinition(0.85, false);\n pickerGrid.addRowDefinition(0.15, false);\n dialogBody.addControl(pickerGrid, 0, 0);\n\n // Picker control\n picker = new ColorPicker();\n picker.name = \"GUI Color Picker\";\n if (options.pickerHeight < options.pickerWidth) {\n picker.width = 0.89;\n }\n else {\n picker.height = 0.89;\n }\n picker.value = Color3.FromHexString(options.lastColor);\n picker.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\n picker.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\n picker.onPointerDownObservable.add(() => {\n activeField = picker.name!;\n lastVal = \"\";\n editSwatches(false);\n });\n picker.onValueChangedObservable.add(function(value) { // value is a color3\n if (activeField == picker.name) {\n updateValues(value, picker.name);\n }\n });\n pickerGrid.addControl(picker, 0, 0);\n\n // Picker body right quarant\n var pickerBodyRight: Grid = new Grid();\n pickerBodyRight.name = \"Dialogue Right Half\";\n pickerBodyRight.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\n var pickerBodyRightRows: number[] = [0.514, 0.486];\n pickerBodyRight.addRowDefinition(pickerBodyRightRows[0], false);\n pickerBodyRight.addRowDefinition(pickerBodyRightRows[1], false);\n dialogBody.addControl(pickerBodyRight, 1, 1);\n\n // Picker container swatches and buttons\n var pickerSwatchesButtons: Grid = new Grid();\n pickerSwatchesButtons.name = \"Swatches and Buttons\";\n var pickerButtonsCol: number[] = [0.417, 0.583];\n pickerSwatchesButtons.addRowDefinition(1.0, false);\n pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[0], false);\n pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[1], false);\n pickerBodyRight.addControl(pickerSwatchesButtons, 0, 0);\n\n // Picker Swatches quadrant\n var pickerSwatches: Grid = new Grid();\n pickerSwatches.name = \"New and Current Swatches\";\n var pickeSwatchesRows: number[] = [0.04, 0.16, 0.64, 0.16];\n pickerSwatches.addRowDefinition(pickeSwatchesRows[0], false);\n pickerSwatches.addRowDefinition(pickeSwatchesRows[1], false);\n pickerSwatches.addRowDefinition(pickeSwatchesRows[2], false);\n pickerSwatches.addRowDefinition(pickeSwatchesRows[3], false);\n pickerSwatchesButtons.addControl(pickerSwatches, 0, 0);\n\n // Active swatches\n var activeSwatches: Grid = new Grid();\n activeSwatches.name = \"Active Swatches\";\n activeSwatches.width = 0.67;\n activeSwatches.addRowDefinition(0.5, false);\n activeSwatches.addRowDefinition(0.5, false);\n pickerSwatches.addControl(activeSwatches, 2, 0);\n\n var labelWidth: number = (Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[0] * 0.11));\n var labelHeight: number = (Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * pickeSwatchesRows[1] * 0.5));\n\n if (options.pickerWidth > options.pickerHeight) {\n var labelTextSize: number = labelHeight;\n }\n else {\n var labelTextSize: number = labelWidth;\n }\n // New color swatch and previous color button\n var newText: TextBlock = new TextBlock();\n newText.text = \"new\";\n newText.name = \"New Color Label\";\n newText.color = buttonColor;\n newText.fontSize = labelTextSize;\n pickerSwatches.addControl(newText, 1, 0);\n\n newSwatch = new Rectangle();\n newSwatch.name = \"New Color Swatch\";\n newSwatch.background = options.lastColor;\n newSwatch.thickness = 0;\n activeSwatches.addControl(newSwatch, 0, 0);\n\n var currentSwatch: Button = Button.CreateSimpleButton(\"currentSwatch\", \"\");\n currentSwatch.background = options.lastColor;\n currentSwatch.thickness = 0;\n currentSwatch.onPointerClickObservable.add(() => {\n var revertColor = Color3.FromHexString(currentSwatch.background);\n updateValues(revertColor, currentSwatch.name!);\n editSwatches(false);\n });\n currentSwatch.pointerDownAnimation = () => { };\n currentSwatch.pointerUpAnimation = () => { };\n currentSwatch.pointerEnterAnimation = () => { };\n currentSwatch.pointerOutAnimation = () => { };\n activeSwatches.addControl(currentSwatch, 1, 0);\n\n var swatchOutline: Rectangle = new Rectangle();\n swatchOutline.name = \"Swatch Outline\";\n swatchOutline.width = 0.67;\n swatchOutline.thickness = 2;\n swatchOutline.color = currentSwatchesOutlineColor;\n swatchOutline.isHitTestVisible = false;\n pickerSwatches.addControl(swatchOutline, 2, 0);\n\n var currentText: TextBlock = new TextBlock();\n currentText.name = \"Current Color Label\";\n currentText.text = \"current\";\n currentText.color = buttonColor;\n currentText.fontSize = labelTextSize;\n pickerSwatches.addControl(currentText, 3, 0);\n\n // Buttons grid\n var buttonGrid: Grid = new Grid();\n buttonGrid.name = \"Button Grid\";\n buttonGrid.height = 0.8;\n var buttonGridRows: number = 1 / 3;\n buttonGrid.addRowDefinition(buttonGridRows, false);\n buttonGrid.addRowDefinition(buttonGridRows, false);\n buttonGrid.addRowDefinition(buttonGridRows, false);\n pickerSwatchesButtons.addControl(buttonGrid, 0, 1);\n\n // Determine pixel width and height for all buttons from overall panel dimensions\n buttonWidth = (Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[1] * 0.67)).toString() + \"px\";\n buttonHeight = (Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * (parseFloat(buttonGrid.height.toString()) / 100) * buttonGridRows * 0.7)).toString() + \"px\";\n\n // Determine button type size\n if (parseFloat(buttonWidth) > parseFloat(buttonHeight)) {\n buttonFontSize = Math.floor(parseFloat(buttonHeight) * 0.45);\n }\n else {\n buttonFontSize = Math.floor(parseFloat(buttonWidth) * 0.11);\n }\n\n // Panel Buttons\n var butOK: Button = Button.CreateSimpleButton(\"butOK\", \"OK\");\n butOK.width = buttonWidth;\n butOK.height = buttonHeight;\n butOK.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\n butOK.thickness = 2;\n butOK.color = buttonColor;\n butOK.fontSize = buttonFontSize;\n butOK.background = buttonBackgroundColor;\n butOK.onPointerEnterObservable.add(() => { butOK.background = buttonBackgroundHoverColor; });\n butOK.onPointerOutObservable.add(() => { butOK.background = buttonBackgroundColor; });\n butOK.pointerDownAnimation = () => {\n butOK.background = buttonBackgroundClickColor;\n };\n butOK.pointerUpAnimation = () => {\n butOK.background = buttonBackgroundHoverColor;\n };\n butOK.onPointerClickObservable.add(() => {\n editSwatches(false);\n closePicker(newSwatch.background);\n });\n buttonGrid.addControl(butOK, 0, 0);\n\n var butCancel: Button = Button.CreateSimpleButton(\"butCancel\", \"Cancel\");\n butCancel.width = buttonWidth;\n butCancel.height = buttonHeight;\n butCancel.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\n butCancel.thickness = 2;\n butCancel.color = buttonColor;\n butCancel.fontSize = buttonFontSize;\n butCancel.background = buttonBackgroundColor;\n butCancel.onPointerEnterObservable.add(() => { butCancel.background = buttonBackgroundHoverColor; });\n butCancel.onPointerOutObservable.add(() => { butCancel.background = buttonBackgroundColor; });\n butCancel.pointerDownAnimation = () => {\n butCancel.background = buttonBackgroundClickColor;\n };\n butCancel.pointerUpAnimation = () => {\n butCancel.background = buttonBackgroundHoverColor;\n };\n butCancel.onPointerClickObservable.add(() => {\n editSwatches(false);\n closePicker(currentSwatch.background);\n });\n buttonGrid.addControl(butCancel, 1, 0);\n\n if (options.savedColors) {\n var butSave: Button = Button.CreateSimpleButton(\"butSave\", \"Save\");\n butSave.width = buttonWidth;\n butSave.height = buttonHeight;\n butSave.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\n butSave.thickness = 2;\n butSave.fontSize = buttonFontSize;\n if (options.savedColors.length < options.swatchLimit!) {\n butSave.color = buttonColor;\n butSave.background = buttonBackgroundColor;\n }\n else {\n disableButton(butSave, true);\n }\n butSave.onPointerEnterObservable.add(() => {\n if (options.savedColors) {\n if (options.savedColors.length < options.swatchLimit!) {\n butSave.background = buttonBackgroundHoverColor;\n }\n }\n });\n butSave.onPointerOutObservable.add(() => {\n if (options.savedColors) {\n if (options.savedColors.length < options.swatchLimit!) {\n butSave.background = buttonBackgroundColor;\n }\n }\n });\n butSave.pointerDownAnimation = () => {\n if (options.savedColors) {\n if (options.savedColors.length < options.swatchLimit!) {\n butSave.background = buttonBackgroundClickColor;\n }\n }\n };\n butSave.pointerUpAnimation = () => {\n if (options.savedColors) {\n if (options.savedColors.length < options.swatchLimit!) {\n butSave.background = buttonBackgroundHoverColor;\n }\n }\n };\n butSave.onPointerClickObservable.add(() => {\n if (options.savedColors) {\n if (options.savedColors.length == 0) {\n setEditButtonVisibility(true);\n }\n if (options.savedColors.length < options.swatchLimit!) {\n updateSwatches(newSwatch.background, butSave);\n }\n editSwatches(false);\n }\n });\n if (options.savedColors.length > 0) {\n setEditButtonVisibility(true);\n }\n buttonGrid.addControl(butSave, 2, 0);\n }\n\n // Picker color values input\n var pickerColorValues: Grid = new Grid();\n pickerColorValues.name = \"Dialog Lower Right\";\n pickerColorValues.addRowDefinition(0.02, false);\n pickerColorValues.addRowDefinition(0.63, false);\n pickerColorValues.addRowDefinition(0.21, false);\n pickerColorValues.addRowDefinition(0.14, false);\n pickerBodyRight.addControl(pickerColorValues, 1, 0);\n\n // RGB values text boxes\n currentColor = Color3.FromHexString(options.lastColor);\n var rgbValuesQuadrant: Grid = new Grid();\n rgbValuesQuadrant.name = \"RGB Values\";\n rgbValuesQuadrant.width = 0.82;\n rgbValuesQuadrant.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\n rgbValuesQuadrant.addColumnDefinition(0.1, false);\n rgbValuesQuadrant.addColumnDefinition(0.2, false);\n rgbValuesQuadrant.addColumnDefinition(0.7, false);\n pickerColorValues.addControl(rgbValuesQuadrant, 1, 0);\n\n for (var i = 0; i < inputFieldLabels.length; i++) {\n var labelText: TextBlock = new TextBlock();\n labelText.text = inputFieldLabels[i];\n labelText.color = buttonColor;\n labelText.fontSize = buttonFontSize;\n rgbValuesQuadrant.addControl(labelText, i, 0);\n }\n\n // Input fields for RGB values\n rValInt = new InputText();\n rValInt.width = 0.83;\n rValInt.height = 0.72;\n rValInt.name = \"rIntField\";\n rValInt.fontSize = buttonFontSize;\n rValInt.text = (currentColor.r * 255).toString();\n rValInt.color = inputTextColor;\n rValInt.background = inputTextBackgroundColor;\n rValInt.onFocusObservable.add(() => {\n activeField = rValInt.name!;\n lastVal = rValInt.text;\n editSwatches(false);\n });\n rValInt.onBlurObservable.add(() => {\n if (rValInt.text == \"\") {\n rValInt.text = \"0\";\n }\n updateInt(rValInt, \"r\");\n if (activeField == rValInt.name) {\n activeField = \"\";\n }\n });\n rValInt.onTextChangedObservable.add(() => {\n if (activeField == rValInt.name) {\n updateInt(rValInt, \"r\");\n }\n });\n rgbValuesQuadrant.addControl(rValInt, 0, 1);\n\n gValInt = new InputText();\n gValInt.width = 0.83;\n gValInt.height = 0.72;\n gValInt.name = \"gIntField\";\n gValInt.fontSize = buttonFontSize;\n gValInt.text = (currentColor.g * 255).toString();\n gValInt.color = inputTextColor;\n gValInt.background = inputTextBackgroundColor;\n gValInt.onFocusObservable.add(() => {\n activeField = gValInt.name!;\n lastVal = gValInt.text;\n editSwatches(false);\n });\n gValInt.onBlurObservable.add(() => {\n if (gValInt.text == \"\") {\n gValInt.text = \"0\";\n }\n updateInt(gValInt, \"g\");\n if (activeField == gValInt.name) {\n activeField = \"\";\n }\n });\n gValInt.onTextChangedObservable.add(() => {\n if (activeField == gValInt.name) {\n updateInt(gValInt, \"g\");\n }\n });\n rgbValuesQuadrant.addControl(gValInt, 1, 1);\n\n bValInt = new InputText();\n bValInt.width = 0.83;\n bValInt.height = 0.72;\n bValInt.name = \"bIntField\";\n bValInt.fontSize = buttonFontSize;\n bValInt.text = (currentColor.b * 255).toString();\n bValInt.color = inputTextColor;\n bValInt.background = inputTextBackgroundColor;\n bValInt.onFocusObservable.add(() => {\n activeField = bValInt.name!;\n lastVal = bValInt.text;\n editSwatches(false);\n });\n bValInt.onBlurObservable.add(() => {\n if (bValInt.text == \"\") {\n bValInt.text = \"0\";\n }\n updateInt(bValInt, \"b\");\n if (activeField == bValInt.name) {\n activeField = \"\";\n }\n });\n bValInt.onTextChangedObservable.add(() => {\n if (activeField == bValInt.name) {\n updateInt(bValInt, \"b\");\n }\n });\n rgbValuesQuadrant.addControl(bValInt, 2, 1);\n\n rValDec = new InputText();\n rValDec.width = 0.95;\n rValDec.height = 0.72;\n rValDec.name = \"rDecField\";\n rValDec.fontSize = buttonFontSize;\n rValDec.text = currentColor.r.toString();\n rValDec.color = inputTextColor;\n rValDec.background = inputTextBackgroundColor;\n rValDec.onFocusObservable.add(() => {\n activeField = rValDec.name!;\n lastVal = rValDec.text;\n editSwatches(false);\n });\n rValDec.onBlurObservable.add(() => {\n if (parseFloat(rValDec.text) == 0 || rValDec.text == \"\") {\n rValDec.text = \"0\";\n updateFloat(rValDec, \"r\");\n }\n if (activeField == rValDec.name) {\n activeField = \"\";\n }\n });\n rValDec.onTextChangedObservable.add(() => {\n if (activeField == rValDec.name) {\n updateFloat(rValDec, \"r\");\n }\n });\n rgbValuesQuadrant.addControl(rValDec, 0, 2);\n\n gValDec = new InputText();\n gValDec.width = 0.95;\n gValDec.height = 0.72;\n gValDec.name = \"gDecField\";\n gValDec.fontSize = buttonFontSize;\n gValDec.text = currentColor.g.toString();\n gValDec.color = inputTextColor;\n gValDec.background = inputTextBackgroundColor;\n gValDec.onFocusObservable.add(() => {\n activeField = gValDec.name!;\n lastVal = gValDec.text;\n editSwatches(false);\n });\n gValDec.onBlurObservable.add(() => {\n if (parseFloat(gValDec.text) == 0 || gValDec.text == \"\") {\n gValDec.text = \"0\";\n updateFloat(gValDec, \"g\");\n }\n if (activeField == gValDec.name) {\n activeField = \"\";\n }\n });\n gValDec.onTextChangedObservable.add(() => {\n if (activeField == gValDec.name) {\n updateFloat(gValDec, \"g\");\n }\n });\n rgbValuesQuadrant.addControl(gValDec, 1, 2);\n\n bValDec = new InputText();\n bValDec.width = 0.95;\n bValDec.height = 0.72;\n bValDec.name = \"bDecField\";\n bValDec.fontSize = buttonFontSize;\n bValDec.text = currentColor.b.toString();\n bValDec.color = inputTextColor;\n bValDec.background = inputTextBackgroundColor;\n bValDec.onFocusObservable.add(() => {\n activeField = bValDec.name!;\n lastVal = bValDec.text;\n editSwatches(false);\n });\n bValDec.onBlurObservable.add(() => {\n if (parseFloat(bValDec.text) == 0 || bValDec.text == \"\") {\n bValDec.text = \"0\";\n updateFloat(bValDec, \"b\");\n }\n if (activeField == bValDec.name) {\n activeField = \"\";\n }\n });\n bValDec.onTextChangedObservable.add(() => {\n if (activeField == bValDec.name) {\n updateFloat(bValDec, \"b\");\n }\n });\n rgbValuesQuadrant.addControl(bValDec, 2, 2);\n\n // Hex value input\n var hexValueQuadrant: Grid = new Grid();\n hexValueQuadrant.name = \"Hex Value\";\n hexValueQuadrant.width = 0.82;\n hexValueQuadrant.addRowDefinition(1.0, false);\n hexValueQuadrant.addColumnDefinition(0.1, false);\n hexValueQuadrant.addColumnDefinition(0.9, false);\n pickerColorValues.addControl(hexValueQuadrant, 2, 0);\n\n var labelText: TextBlock = new TextBlock();\n labelText.text = \"#\";\n labelText.color = buttonColor;\n labelText.fontSize = buttonFontSize;\n hexValueQuadrant.addControl(labelText, 0, 0);\n\n hexVal = new InputText();\n hexVal.width = 0.96;\n hexVal.height = 0.72;\n hexVal.name = \"hexField\";\n hexVal.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\n hexVal.fontSize = buttonFontSize;\n var minusPound = options.lastColor.split(\"#\");\n hexVal.text = minusPound[1];\n hexVal.color = inputTextColor;\n hexVal.background = inputTextBackgroundColor;\n hexVal.onFocusObservable.add(() => {\n activeField = hexVal.name!;\n lastVal = hexVal.text;\n editSwatches(false);\n });\n hexVal.onBlurObservable.add(() => {\n if (hexVal.text.length == 3) {\n var val = hexVal.text.split(\"\");\n hexVal.text = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];\n }\n if (hexVal.text == \"\") {\n hexVal.text = \"000000\";\n updateValues(Color3.FromHexString(hexVal.text), \"b\");\n }\n if (activeField == hexVal.name) {\n activeField = \"\";\n }\n });\n hexVal.onTextChangedObservable.add(() => {\n var newHexValue: string = hexVal.text;\n var checkHex: boolean = /[^0-9A-F]/i.test(newHexValue);\n if ((hexVal.text.length > 6 || checkHex) && activeField == hexVal.name) {\n hexVal.text = lastVal;\n }\n else {\n if (hexVal.text.length < 6) {\n var leadingZero: Number = 6 - hexVal.text.length;\n for (var i = 0; i < leadingZero; i++) {\n newHexValue = \"0\" + newHexValue;\n }\n }\n if (hexVal.text.length == 3) {\n var val: string[] = hexVal.text.split(\"\");\n newHexValue = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];\n }\n newHexValue = \"#\" + newHexValue;\n if (activeField == hexVal.name) {\n lastVal = hexVal.text;\n updateValues(Color3.FromHexString(newHexValue), hexVal.name);\n }\n }\n });\n hexValueQuadrant.addControl(hexVal, 0, 1);\n\n if (options.savedColors && options.savedColors.length > 0) {\n updateSwatches(\"\", butSave!);\n }\n });\n }\n}","import { Nullable } from \"babylonjs/types\";\r\nimport { Logger } from \"babylonjs/Misc/logger\";\r\n\r\nimport { Control } from \"./control\";\r\nimport { Measure } from \"../measure\";\r\nimport { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\n\r\n/**\r\n * Root class for 2D containers\r\n * @see http://doc.babylonjs.com/how_to/gui#containers\r\n */\r\nexport class Container extends Control {\r\n /** @hidden */\r\n protected _children = new Array();\r\n /** @hidden */\r\n protected _measureForChildren = Measure.Empty();\r\n /** @hidden */\r\n protected _background = \"\";\r\n /** @hidden */\r\n protected _adaptWidthToChildren = false;\r\n /** @hidden */\r\n protected _adaptHeightToChildren = false;\r\n\r\n /** Gets or sets a boolean indicating if the container should try to adapt to its children height */\r\n public get adaptHeightToChildren(): boolean {\r\n return this._adaptHeightToChildren;\r\n }\r\n\r\n public set adaptHeightToChildren(value: boolean) {\r\n if (this._adaptHeightToChildren === value) {\r\n return;\r\n }\r\n\r\n this._adaptHeightToChildren = value;\r\n\r\n if (value) {\r\n this.height = \"100%\";\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the container should try to adapt to its children width */\r\n public get adaptWidthToChildren(): boolean {\r\n return this._adaptWidthToChildren;\r\n }\r\n\r\n public set adaptWidthToChildren(value: boolean) {\r\n if (this._adaptWidthToChildren === value) {\r\n return;\r\n }\r\n\r\n this._adaptWidthToChildren = value;\r\n\r\n if (value) {\r\n this.width = \"100%\";\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets background color */\r\n public get background(): string {\r\n return this._background;\r\n }\r\n\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n\r\n this._background = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets the list of children */\r\n public get children(): Control[] {\r\n return this._children;\r\n }\r\n\r\n /**\r\n * Creates a new Container\r\n * @param name defines the name of the container\r\n */\r\n constructor(public name?: string) {\r\n super(name);\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Container\";\r\n }\r\n\r\n public _flagDescendantsAsMatrixDirty(): void {\r\n for (var child of this.children) {\r\n child._markMatrixAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets a child using its name\r\n * @param name defines the child name to look for\r\n * @returns the child control if found\r\n */\r\n public getChildByName(name: string): Nullable {\r\n for (var child of this.children) {\r\n if (child.name === name) {\r\n return child;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets a child using its type and its name\r\n * @param name defines the child name to look for\r\n * @param type defines the child type to look for\r\n * @returns the child control if found\r\n */\r\n public getChildByType(name: string, type: string): Nullable {\r\n for (var child of this.children) {\r\n if (child.typeName === type) {\r\n return child;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Search for a specific control in children\r\n * @param control defines the control to look for\r\n * @returns true if the control is in child list\r\n */\r\n public containsControl(control: Control): boolean {\r\n return this.children.indexOf(control) !== -1;\r\n }\r\n\r\n /**\r\n * Adds a new control to the current container\r\n * @param control defines the control to add\r\n * @returns the current container\r\n */\r\n public addControl(control: Nullable): Container {\r\n if (!control) {\r\n return this;\r\n }\r\n\r\n var index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n control._link(this._host);\r\n\r\n control._markAllAsDirty();\r\n\r\n this._reOrderControl(control);\r\n\r\n this._markAsDirty();\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes all controls from the current container\r\n * @returns the current container\r\n */\r\n public clearControls(): Container {\r\n let children = this.children.slice();\r\n\r\n for (var child of children) {\r\n this.removeControl(child);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes a control from the current container\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control): Container {\r\n var index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n this._children.splice(index, 1);\r\n\r\n control.parent = null;\r\n }\r\n\r\n control.linkWithMesh(null);\r\n\r\n if (this._host) {\r\n this._host._cleanControlAfterRemoval(control);\r\n }\r\n\r\n this._markAsDirty();\r\n return this;\r\n }\r\n\r\n /** @hidden */\r\n public _reOrderControl(control: Control): void {\r\n this.removeControl(control);\r\n\r\n let wasAdded = false;\r\n for (var index = 0; index < this._children.length; index++) {\r\n if (this._children[index].zIndex > control.zIndex) {\r\n this._children.splice(index, 0, control);\r\n wasAdded = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!wasAdded) {\r\n this._children.push(control);\r\n }\r\n\r\n control.parent = this;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** @hidden */\r\n public _offsetLeft(offset: number) {\r\n super._offsetLeft(offset);\r\n\r\n for (var child of this._children) {\r\n child._offsetLeft(offset);\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _offsetTop(offset: number) {\r\n super._offsetTop(offset);\r\n\r\n for (var child of this._children) {\r\n child._offsetTop(offset);\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _markAllAsDirty(): void {\r\n super._markAllAsDirty();\r\n\r\n for (var index = 0; index < this._children.length; index++) {\r\n this._children[index]._markAllAsDirty();\r\n }\r\n }\r\n\r\n /** @hidden */\r\n protected _localDraw(context: CanvasRenderingContext2D): void {\r\n if (this._background) {\r\n context.save();\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n context.fillStyle = this._background;\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n context.restore();\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _link(host: AdvancedDynamicTexture): void {\r\n super._link(host);\r\n\r\n for (var child of this._children) {\r\n child._link(host);\r\n }\r\n }\r\n\r\n /** @hidden */\r\n protected _beforeLayout() {\r\n // Do nothing\r\n }\r\n\r\n /** @hidden */\r\n protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): void {\r\n if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) {\r\n super._processMeasures(parentMeasure, context);\r\n this._evaluateClippingState(parentMeasure);\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _layout(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean {\r\n if (!this.isDirty && (!this.isVisible || this.notRenderable)) {\r\n return false;\r\n }\r\n\r\n if (this._isDirty) {\r\n this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace);\r\n }\r\n\r\n let rebuildCount = 0;\r\n\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n this._beforeLayout();\r\n\r\n do {\r\n let computedWidth = -1;\r\n let computedHeight = -1;\r\n this._rebuildLayout = false;\r\n this._processMeasures(parentMeasure, context);\r\n\r\n if (!this._isClipped) {\r\n for (var child of this._children) {\r\n child._tempParentMeasure.copyFrom(this._measureForChildren);\r\n\r\n if (child._layout(this._measureForChildren, context)) {\r\n\r\n if (this.adaptWidthToChildren && child._width.isPixel) {\r\n computedWidth = Math.max(computedWidth, child._currentMeasure.width);\r\n }\r\n if (this.adaptHeightToChildren && child._height.isPixel) {\r\n computedHeight = Math.max(computedHeight, child._currentMeasure.height);\r\n }\r\n }\r\n }\r\n\r\n if (this.adaptWidthToChildren && computedWidth >= 0) {\r\n if (this.width !== computedWidth + \"px\") {\r\n this.width = computedWidth + \"px\";\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n if (this.adaptHeightToChildren && computedHeight >= 0) {\r\n if (this.height !== computedHeight + \"px\") {\r\n this.height = computedHeight + \"px\";\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n\r\n this._postMeasure();\r\n }\r\n rebuildCount++;\r\n }\r\n while (this._rebuildLayout && rebuildCount < 3);\r\n\r\n if (rebuildCount >= 3) {\r\n Logger.Error(`Layout cycle detected in GUI (Container name=${this.name}, uniqueId=${this.uniqueId})`);\r\n }\r\n\r\n context.restore();\r\n\r\n if (this._isDirty) {\r\n this.invalidateRect();\r\n\r\n this._isDirty = false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n protected _postMeasure() {\r\n // Do nothing by default\r\n }\r\n\r\n /** @hidden */\r\n public _draw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void {\r\n\r\n this._localDraw(context);\r\n\r\n if (this.clipChildren) {\r\n this._clipForChildren(context);\r\n }\r\n\r\n for (var child of this._children) {\r\n // Only redraw parts of the screen that are invalidated\r\n if (invalidatedRectangle) {\r\n if (!child._intersectsRect(invalidatedRectangle)) {\r\n continue;\r\n }\r\n }\r\n child._render(context, invalidatedRectangle);\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _getDescendants(results: Control[], directDescendantsOnly: boolean = false, predicate?: (control: Control) => boolean): void {\r\n if (!this.children) {\r\n return;\r\n }\r\n\r\n for (var index = 0; index < this.children.length; index++) {\r\n var item = this.children[index];\r\n\r\n if (!predicate || predicate(item)) {\r\n results.push(item);\r\n }\r\n\r\n if (!directDescendantsOnly) {\r\n item._getDescendants(results, false, predicate);\r\n }\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean {\r\n if (!this.isVisible || this.notRenderable) {\r\n return false;\r\n }\r\n\r\n if (!super.contains(x, y)) {\r\n return false;\r\n }\r\n\r\n // Checking backwards to pick closest first\r\n for (var index = this._children.length - 1; index >= 0; index--) {\r\n var child = this._children[index];\r\n if (child._processPicking(x, y, type, pointerId, buttonIndex)) {\r\n if (child.hoverCursor) {\r\n this._host._changeCursor(child.hoverCursor);\r\n }\r\n return true;\r\n }\r\n }\r\n\r\n if (!this.isHitTestVisible) {\r\n return false;\r\n }\r\n\r\n return this._processObservables(type, x, y, pointerId, buttonIndex);\r\n }\r\n\r\n /** @hidden */\r\n protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void {\r\n super._additionalProcessing(parentMeasure, context);\r\n\r\n this._measureForChildren.copyFrom(this._currentMeasure);\r\n }\r\n\r\n /** Releases associated resources */\r\n public dispose() {\r\n super.dispose();\r\n\r\n for (var index = this.children.length - 1; index >= 0; index--) {\r\n this.children[index].dispose();\r\n }\r\n }\r\n}","import { Nullable } from \"babylonjs/types\";\nimport { Observable, Observer } from \"babylonjs/Misc/observable\";\nimport { Vector2, Vector3, Matrix } from \"babylonjs/Maths/math\";\nimport { PointerEventTypes } from 'babylonjs/Events/pointerEvents';\nimport { Logger } from \"babylonjs/Misc/logger\";\nimport { Tools } from \"babylonjs/Misc/tools\";\nimport { AbstractMesh } from \"babylonjs/Meshes/abstractMesh\";\nimport { Scene } from \"babylonjs/scene\";\n\nimport { Container } from \"./container\";\nimport { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\nimport { ValueAndUnit } from \"../valueAndUnit\";\nimport { Measure } from \"../measure\";\nimport { Style } from \"../style\";\nimport { Matrix2D, Vector2WithInfo } from \"../math2D\";\n\n/**\n * Root class used for all 2D controls\n * @see http://doc.babylonjs.com/how_to/gui#controls\n */\nexport class Control {\n /**\n * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)\n */\n public static AllowAlphaInheritance = false;\n\n private _alpha = 1;\n private _alphaSet = false;\n private _zIndex = 0;\n /** @hidden */\n public _host: AdvancedDynamicTexture;\n /** Gets or sets the control parent */\n public parent: Nullable;\n /** @hidden */\n public _currentMeasure = Measure.Empty();\n private _fontFamily = \"Arial\";\n private _fontStyle = \"\";\n private _fontWeight = \"\";\n private _fontSize = new ValueAndUnit(18, ValueAndUnit.UNITMODE_PIXEL, false);\n private _font: string;\n /** @hidden */\n public _width = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\n /** @hidden */\n public _height = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);\n /** @hidden */\n protected _fontOffset: { ascent: number, height: number, descent: number };\n private _color = \"\";\n private _style: Nullable