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.1 kB
import{bK as e,bH as s,bG as r}from"./index-yNtOWHHe.esm.min.js";import{GLTFLoader as o}from"./glTFLoader-DrZpsmpQ.esm.min.js";import"./bone-WlJTsCYz.esm.min.js";import"./skeleton-DrI_Z0uE.esm.min.js";import"./rawTexture-BOCcQuA1.esm.min.js";import"./assetContainer-Dkk4zkgP.esm.min.js";import"./objectModelMapping-DJGnHmCN.esm.min.js";const i="KHR_materials_ior";class t{constructor(e){this.name=i,this.order=180,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,r){return o.LoadExtensionAsync(e,s,this.name,(async(o,i)=>{const t=new Array;return t.push(this._loader.loadMaterialPropertiesAsync(e,s,r)),t.push(this._loadIorPropertiesAsync(o,i,r)),await Promise.all(t).then((()=>{}))}))}_loadIorPropertiesAsync(s,r,o){if(!(o instanceof e))throw new Error(`${s}: Material type not supported`);return void 0!==r.ior?o.indexOfRefraction=r.ior:o.indexOfRefraction=t._DEFAULT_IOR,Promise.resolve()}}t._DEFAULT_IOR=1.5,s(i),r(i,!0,(e=>new t(e)));export{t as KHR_materials_ior}; //# sourceMappingURL=KHR_materials_ior-mjDccSE1.esm.min.js.map