import{GLTFLoader as m}from"./glTFLoader-Bp7IfGPK.js";import{aG as d,aH as c}from"./index-CDrXokXW.js";import"./index-DWyDLubb.js";import"./bone-z620UXj2.js";import"./skeleton-3aE04lM6.js";import"./rawTexture-DYLCXHMF.js";import"./assetContainer-D7EiOqw6.js";import"./objectModelMapping-CGWnurZP.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};
