1 |
- {"ast":null,"code":"import { PBRMaterial } from \"@babylonjs/core/Materials/PBR/pbrMaterial.js\";\nimport { GLTFLoader } from \"../glTFLoader.js\";\nconst NAME = \"KHR_materials_emissive_strength\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_emissive_strength {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 170;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n return this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial).then(() => {\n this._loadEmissiveProperties(extensionContext, extension, babylonMaterial);\n });\n });\n }\n _loadEmissiveProperties(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n if (properties.emissiveStrength !== undefined) {\n babylonMaterial.emissiveIntensity = properties.emissiveStrength;\n }\n }\n}\nGLTFLoader.RegisterExtension(NAME, loader => new KHR_materials_emissive_strength(loader));","map":{"version":3,"names":["PBRMaterial","GLTFLoader","NAME","KHR_materials_emissive_strength","constructor","loader","name","order","_loader","enabled","isExtensionUsed","dispose","loadMaterialPropertiesAsync","context","material","babylonMaterial","LoadExtensionAsync","extensionContext","extension","then","_loadEmissiveProperties","properties","Error","emissiveStrength","undefined","emissiveIntensity","RegisterExtension"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/KHR_materials_emissive_strength.js"],"sourcesContent":["import { PBRMaterial } from \"@babylonjs/core/Materials/PBR/pbrMaterial.js\";\nimport { GLTFLoader } from \"../glTFLoader.js\";\nconst NAME = \"KHR_materials_emissive_strength\";\n/**\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class KHR_materials_emissive_strength {\n /**\n * @internal\n */\n constructor(loader) {\n /**\n * The name of this extension.\n */\n this.name = NAME;\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n this.order = 170;\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n loadMaterialPropertiesAsync(context, material, babylonMaterial) {\n return GLTFLoader.LoadExtensionAsync(context, material, this.name, (extensionContext, extension) => {\n return this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial).then(() => {\n this._loadEmissiveProperties(extensionContext, extension, babylonMaterial);\n });\n });\n }\n _loadEmissiveProperties(context, properties, babylonMaterial) {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n if (properties.emissiveStrength !== undefined) {\n babylonMaterial.emissiveIntensity = properties.emissiveStrength;\n }\n }\n}\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_materials_emissive_strength(loader));\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,8CAA8C;AAC1E,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,MAAMC,IAAI,GAAG,iCAAiC;AAC9C;AACA;AACA;AACA;AACA,OAAO,MAAMC,+BAA+B,CAAC;EACzC;AACJ;AACA;EACIC,WAAWA,CAACC,MAAM,EAAE;IAChB;AACR;AACA;IACQ,IAAI,CAACC,IAAI,GAAGJ,IAAI;IAChB;AACR;AACA;IACQ,IAAI,CAACK,KAAK,GAAG,GAAG;IAChB,IAAI,CAACC,OAAO,GAAGH,MAAM;IACrB,IAAI,CAACI,OAAO,GAAG,IAAI,CAACD,OAAO,CAACE,eAAe,CAACR,I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