Commit 7ac7d5c 1 parent 329e52f commit 7ac7d5c Copy full SHA for 7ac7d5c
File tree 1 file changed +5
-4
lines changed
packages/loader/src/gltf/parser
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,15 @@ export class GLTFAnimationParser extends GLTFParser {
36
36
const { glTF } = context ;
37
37
const { accessors, bufferViews } = glTF ;
38
38
const { channels, samplers } = animationInfo ;
39
- const sampleDataCollection = new Array < SampleData > ( ) ;
39
+ const len = samplers . length ;
40
+ const sampleDataCollection = new Array < SampleData > ( len ) ;
40
41
const entities = context . get < Entity > ( GLTFParserType . Entity ) ;
41
42
42
43
let duration = - 1 ;
43
44
let promises = new Array < Promise < void | Entity [ ] > > ( ) ;
44
45
45
46
// parse samplers
46
- for ( let j = 0 , m = samplers . length ; j < m ; j ++ ) {
47
+ for ( let j = 0 , m = len ; j < m ; j ++ ) {
47
48
const glTFSampler = samplers [ j ] ;
48
49
const inputAccessor = accessors [ glTFSampler . input ] ;
49
50
const outputAccessor = accessors [ glTFSampler . output ] ;
@@ -84,13 +85,13 @@ export class GLTFAnimationParser extends GLTFParser {
84
85
duration = maxTime ;
85
86
}
86
87
87
- sampleDataCollection . push ( {
88
+ sampleDataCollection [ j ] = {
88
89
type : outputAccessor . type ,
89
90
interpolation : samplerInterpolation ,
90
91
input,
91
92
output,
92
93
outputSize : outputStride
93
- } ) ;
94
+ } ;
94
95
} ) ;
95
96
promises . push ( promise ) ;
96
97
}
You can’t perform that action at this time.
0 commit comments