import{GLTFLoader as m}from"./glTFLoader-f5CXkgzs.js";import{aG as d,aH as c}from"./index-T8LZyOXI.js";import"./index-BkylzejB.js";import"./bone-DGunMt7J.js";import"./skeleton-00tPGJ0X.js";import"./rawTexture-Duv-4ySK.js";import"./assetContainer-DNTqZfyb.js";import"./objectModelMapping-D1pI71RW.js";const a="KHR_materials_anisotropy";class _{constructor(t){this.name=a,this.order=195,this._loader=t,this.enabled=this._loader.isExtensionUsed(a)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,o,r){return m.LoadExtensionAsync(t,o,this.name,async(s,n)=>{const e=new Array;e.push(this._loader.loadMaterialPropertiesAsync(t,o,r)),e.push(this._loadAnisotropyPropertiesAsync(s,n,r)),await Promise.all(e)})}async _loadAnisotropyPropertiesAsync(t,o,r){const s=this._loader._getOrCreateMaterialAdapter(r),n=new Array,e=o.anisotropyStrength??0,l=o.anisotropyRotation??0;s.specularRoughnessAnisotropy=e,s.geometryTangentAngle=l;const p=o.extensions??{};(!p.EXT_materials_anisotropy_openpbr||!p.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled)&&s.configureGltfStyleAnisotropy(!0),o.anisotropyTexture&&(o.anisotropyTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${t}/anisotropyTexture`,o.anisotropyTexture,y=>{y.name=`${r.name} (Anisotropy Intensity)`,s.geometryTangentTexture=y}))),await Promise.all(n)}}d(a);c(a,!0,i=>new _(i));export{_ as KHR_materials_anisotropy};
