Bladeren bron

Update serializes to use the new interface names

Popov72 5 jaren geleden
bovenliggende
commit
95f8408945

+ 9 - 9
serializers/src/glTF/2.0/Extensions/KHR_lights_punctual.ts

@@ -11,7 +11,7 @@ import { IGLTFExporterExtensionV2 } from "../glTFExporterExtension";
 import { _Exporter } from "../glTFExporter";
 import { Logger } from "babylonjs/Misc/logger";
 import { _GLTFUtilities } from "../glTFUtilities";
-import { LightType, ILightReference, ILight, ILights } from "babylonjs-gltf2interface";
+import { IKHRLightsPunctual_LightType, IKHRLightsPunctual_LightReference, IKHRLightsPunctual_Light, IKHRLightsPunctual } from "babylonjs-gltf2interface";
 
 const NAME = "KHR_lights_punctual";
 
@@ -31,7 +31,7 @@ export class KHR_lights_punctual implements IGLTFExporterExtensionV2 {
     /** Reference to the glTF exporter */
     private _exporter: _Exporter;
 
-    private _lights: ILights;
+    private _lights: IKHRLightsPunctual;
 
     /** @hidden */
     constructor(exporter: _Exporter) {
@@ -64,12 +64,12 @@ export class KHR_lights_punctual implements IGLTFExporterExtensionV2 {
         return new Promise((resolve, reject) => {
             if (node && babylonNode instanceof ShadowLight) {
                 const babylonLight: ShadowLight = babylonNode;
-                let light: ILight;
+                let light: IKHRLightsPunctual_Light;
 
                 const lightType = (
-                    babylonLight.getTypeID() == Light.LIGHTTYPEID_POINTLIGHT ? LightType.POINT : (
-                        babylonLight.getTypeID() == Light.LIGHTTYPEID_DIRECTIONALLIGHT ? LightType.DIRECTIONAL : (
-                            babylonLight.getTypeID() == Light.LIGHTTYPEID_SPOTLIGHT ? LightType.SPOT : null
+                    babylonLight.getTypeID() == Light.LIGHTTYPEID_POINTLIGHT ? IKHRLightsPunctual_LightType.POINT : (
+                        babylonLight.getTypeID() == Light.LIGHTTYPEID_DIRECTIONALLIGHT ? IKHRLightsPunctual_LightType.DIRECTIONAL : (
+                            babylonLight.getTypeID() == Light.LIGHTTYPEID_SPOTLIGHT ? IKHRLightsPunctual_LightType.SPOT : null
                         )));
                 if (lightType == null) {
                     Logger.Warn(`${context}: Light ${babylonLight.name} is not supported in ${NAME}`);
@@ -83,7 +83,7 @@ export class KHR_lights_punctual implements IGLTFExporterExtensionV2 {
                         }
                         node.translation = lightPosition.asArray();
                     }
-                    if (lightType !== LightType.POINT) {
+                    if (lightType !== IKHRLightsPunctual_LightType.POINT) {
                         const localAxis = babylonLight.direction;
                         const yaw = -Math.atan2(localAxis.z * (this._exporter._babylonScene.useRightHandedSystem ? -1 : 1), localAxis.x) + Math.PI / 2;
                         const len = Math.sqrt(localAxis.x * localAxis.x + localAxis.z * localAxis.z);
@@ -113,7 +113,7 @@ export class KHR_lights_punctual implements IGLTFExporterExtensionV2 {
                         light.range = babylonLight.range;
                     }
 
-                    if (lightType === LightType.SPOT) {
+                    if (lightType === IKHRLightsPunctual_LightType.SPOT) {
                         const babylonSpotLight = babylonLight as SpotLight;
                         if (babylonSpotLight.angle !== Math.PI / 2.0) {
                             if (light.spot == null) {
@@ -137,7 +137,7 @@ export class KHR_lights_punctual implements IGLTFExporterExtensionV2 {
 
                     this._lights.lights.push(light);
 
-                    const lightReference: ILightReference = {
+                    const lightReference: IKHRLightsPunctual_LightReference = {
                         light: this._lights.lights.length - 1
                     };
 

+ 2 - 2
serializers/src/glTF/2.0/Extensions/KHR_materials_sheen.ts

@@ -6,7 +6,7 @@ import { PBRMaterial } from 'babylonjs/Materials/PBR/pbrMaterial';
 import { Texture } from 'babylonjs/Materials/Textures/texture';
 import { BaseTexture } from 'babylonjs/Materials/Textures/baseTexture';
 import { Nullable } from 'babylonjs/types';
-import { IKHR_materials_sheen } from 'babylonjs-gltf2interface';
+import { IKHRMaterialsSheen } from 'babylonjs-gltf2interface';
 
 const NAME = "KHR_materials_sheen";
 
@@ -84,7 +84,7 @@ export class KHR_materials_sheen implements IGLTFExporterExtensionV2 {
                 if (node.extensions == null) {
                     node.extensions = {};
                 }
-                const sheenInfo: IKHR_materials_sheen = {
+                const sheenInfo: IKHRMaterialsSheen = {
                     sheenColorFactor: babylonMaterial.sheen.color.asArray(),
                     sheenRoughnessFactor: babylonMaterial.sheen.roughness ?? 0
                 };