瀏覽代碼

Handle more comments

Popov72 4 年之前
父節點
當前提交
2284c7f0a8
共有 2 個文件被更改,包括 2 次插入7 次删除
  1. 0 7
      loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts
  2. 2 0
      loaders/src/glTF/2.0/glTFLoader.ts

+ 0 - 7
loaders/src/glTF/2.0/Extensions/KHR_texture_basisu.ts

@@ -32,13 +32,6 @@ export class KHR_texture_basisu implements IGLTFLoaderExtension {
     }
 
     /** @hidden */
-    public loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
-        const texture = ArrayItem.Get(`${context}/index`, this._loader.gltf.textures, textureInfo.index);
-        texture._textureInfo = textureInfo; // need to save this for use in _loadTextureAsync below
-        return this._loader.loadTextureInfoAsync(context, textureInfo, assign);
-    }
-
-    /** @hidden */
     public _loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
         return GLTFLoader.LoadExtensionAsync<IKHRTextureBasisU, BaseTexture>(context, texture, this.name, (extensionContext, extension) => {
             const sampler = (texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler));

+ 2 - 0
loaders/src/glTF/2.0/glTFLoader.ts

@@ -1950,6 +1950,8 @@ export class GLTFLoader implements IGLTFLoader {
         }
 
         const texture = ArrayItem.Get(`${context}/index`, this._gltf.textures, textureInfo.index);
+        texture._textureInfo = textureInfo;
+
         const promise = this._loadTextureAsync(`/textures/${textureInfo.index}`, texture, (babylonTexture) => {
             babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;
             GLTFLoader.AddPointerMetadata(babylonTexture, context);