UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

3 lines (2 loc) 1.87 kB
import{G as e,U as t,a as i}from"./environmentTextureTools.pure-DawhOrPy.esm.min.js";import{C as o}from"./cubemapToSphericalPolynomial-PoSb7sAl.esm.min.js";import{p as r}from"./index-BPURObVq.esm.min.js";import"./sphericalPolynomial.pure-CsRKkAN3.esm.min.js";import"./thinEngine-DuQ_dtuu.esm.min.js";let l=!1;class s{constructor(){this.supportCascades=!1}loadCubeData(s,n,a,m,h){if(Array.isArray(s))return;const p=e(s);if(p){n.width=p.width,n.height=p.width;try{l||(l=!0,r.prototype._sphericalPolynomialTargetSize=0,r.prototype.forceSphericalPolynomialsRecompute=function(){this._texture&&(this._texture._sphericalPolynomial=null,this._texture._sphericalPolynomialPromise=null,this._texture._sphericalPolynomialComputed=!1)},Object.defineProperty(r.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial||this._texture._sphericalPolynomialComputed)return this._texture._sphericalPolynomial;if(this._texture.isReady)return this._texture._sphericalPolynomialPromise||(this._texture._sphericalPolynomialPromise=o.ConvertCubeMapTextureToSphericalPolynomial(this),null===this._texture._sphericalPolynomialPromise?this._texture._sphericalPolynomialComputed=!0:this._texture._sphericalPolynomialPromise.then(e=>{this._texture._sphericalPolynomial=e,this._texture._sphericalPolynomialComputed=!0})),null}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0})),t(n,p),i(n,s,p).then(()=>{n.isReady=!0,n.onLoadedObservable.notifyObservers(n),n.onLoadedObservable.clear(),m&&m()},e=>{h?.("Can not upload environment levels",e)})}catch(e){h?.("Can not upload environment file",e)}}else h&&h("Can not parse the environment file",null)}loadData(){throw".env not supported in 2d."}}export{s as _ENVTextureLoader}; //# sourceMappingURL=envTextureLoader-Dw03Oizu.esm.min.js.map