소스 검색

Throw error when texture coordinate set index >= 2

Gary Hsu 6 년 전
부모
커밋
b67855ab0e
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      loaders/src/glTF/2.0/glTFLoader.ts

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

@@ -1812,6 +1812,10 @@ export class GLTFLoader implements IGLTFLoader {
 
         this.logOpen(`${context}`);
 
+        if (textureInfo.texCoord! >= 2) {
+            throw new Error(`${context}/texCoord: Invalid value (${textureInfo.texCoord})`);
+        }
+
         const texture = ArrayItem.Get(`${context}/index`, this._gltf.textures, textureInfo.index);
         const promise = this._loadTextureAsync(`/textures/${textureInfo.index}`, texture, (babylonTexture) => {
             babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;