@galacean/engine-loader 1.2.0-alpha.11 → 1.2.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -2164,7 +2164,9 @@ function registerGLTFParser(pipeline) {
2164
2164
  };
2165
2165
  GLTFUtils.getAccessorBuffer = function getAccessorBuffer(context, bufferViews, accessor) {
2166
2166
  var componentType = accessor.componentType;
2167
- var bufferView = bufferViews[accessor.bufferView];
2167
+ var _accessor_bufferView;
2168
+ var bufferViewIndex = (_accessor_bufferView = accessor.bufferView) != null ? _accessor_bufferView : 0;
2169
+ var bufferView = bufferViews[bufferViewIndex];
2168
2170
  return context.get(exports.GLTFParserType.BufferView, accessor.bufferView).then(function(bufferViewData) {
2169
2171
  var bufferIndex = bufferView.buffer;
2170
2172
  var _bufferViewData_byteOffset;
@@ -2181,7 +2183,7 @@ function registerGLTFParser(pipeline) {
2181
2183
  // According to the glTF official documentation only byteStride not undefined is allowed
2182
2184
  if (bufferStride !== undefined && bufferStride !== elementStride) {
2183
2185
  var bufferSlice = Math.floor(byteOffset / bufferStride);
2184
- var bufferCacheKey = accessor.bufferView + ":" + componentType + ":" + bufferSlice + ":" + accessorCount;
2186
+ var bufferCacheKey = bufferViewIndex + ":" + componentType + ":" + bufferSlice + ":" + accessorCount;
2185
2187
  var accessorBufferCache = context.accessorBufferCache;
2186
2188
  bufferInfo = accessorBufferCache[bufferCacheKey];
2187
2189
  if (!bufferInfo) {
@@ -2222,7 +2224,8 @@ function registerGLTFParser(pipeline) {
2222
2224
  * Get accessor data.
2223
2225
  */ GLTFUtils.getAccessorData = function getAccessorData(glTF, accessor, buffers) {
2224
2226
  var bufferViews = glTF.bufferViews;
2225
- var bufferView = bufferViews[accessor.bufferView];
2227
+ var _accessor_bufferView;
2228
+ var bufferView = bufferViews[(_accessor_bufferView = accessor.bufferView) != null ? _accessor_bufferView : 0];
2226
2229
  var arrayBuffer = buffers[bufferView.buffer];
2227
2230
  var accessorByteOffset = accessor.hasOwnProperty("byteOffset") ? accessor.byteOffset : 0;
2228
2231
  var bufferViewByteOffset = bufferView.hasOwnProperty("byteOffset") ? bufferView.byteOffset : 0;
@@ -3931,13 +3934,13 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
3931
3934
  break;
3932
3935
  }
3933
3936
  input[input.length - 1];
3934
- sampleDataCollection.push({
3937
+ sampleDataCollection[j] = {
3935
3938
  type: outputAccessor.type,
3936
3939
  interpolation: samplerInterpolation,
3937
3940
  input: input,
3938
3941
  output: output,
3939
3942
  outputSize: outputStride
3940
- });
3943
+ };
3941
3944
  });
3942
3945
  promises.push(promise);
3943
3946
  };
@@ -3945,11 +3948,12 @@ exports.GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
3945
3948
  var glTF = context.glTF;
3946
3949
  var accessors = glTF.accessors, bufferViews = glTF.bufferViews;
3947
3950
  var channels = animationInfo.channels, samplers = animationInfo.samplers;
3948
- var sampleDataCollection = new Array();
3951
+ var len = samplers.length;
3952
+ var sampleDataCollection = new Array(len);
3949
3953
  var entities = context.get(exports.GLTFParserType.Entity);
3950
3954
  var promises = new Array();
3951
3955
  // parse samplers
3952
- for(var j = 0, m = samplers.length; j < m; j++)_loop(j);
3956
+ for(var j = 0, m = len; j < m; j++)_loop(j);
3953
3957
  promises.push(context.get(exports.GLTFParserType.Scene));
3954
3958
  return Promise.all(promises).then(function() {
3955
3959
  for(var j = 0, m = channels.length; j < m; j++){