浏览代码

Merge pull request #8938 from bghgary/gltf-loader-fix

Fix bug in glTF loader with interleaved animation data
David Catuhe 5 年之前
父节点
当前提交
3015ee7eed
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      loaders/src/glTF/2.0/glTFLoader.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -138,6 +138,7 @@
 - Fixed issue with loading screen hiding too early when loading multiple assets concurrently. ([bghgary](https://github.com/bghgary))
 - Added the `loadAllMaterials` property to the gLTF loader to load materials even if not used by any mesh ([Popov72](https://github.com/Popov72))
 - Added transmission prerender pass when using KHR_materials_transmission ([MiiBond](https://github.com/MiiBond/))
+- Fixed a bug when loading glTF with interleaved animation data. ([bghgary](https://github.com/bghgary))
 
 ### Serializers
 

+ 1 - 1
loaders/src/glTF/2.0/glTFLoader.ts

@@ -1525,7 +1525,7 @@ export class GLTFLoader implements IGLTFLoader {
         else {
             const bufferView = ArrayItem.Get(`${context}/bufferView`, this._gltf.bufferViews, accessor.bufferView);
             accessor._data = this.loadBufferViewAsync(`/bufferViews/${bufferView.index}`, bufferView).then((data) => {
-                if (accessor.componentType === AccessorComponentType.FLOAT && !accessor.normalized) {
+                if (accessor.componentType === AccessorComponentType.FLOAT && !accessor.normalized && (!bufferView.byteStride || bufferView.byteStride === byteStride)) {
                     return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
                 }
                 else {