File tree 1 file changed +8
-8
lines changed
libs/soba/misc/src/animations 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ export function injectNgtsAnimations(
12
12
} : { ref ?: NgtRef < THREE . Object3D > ; playFirstClip ?: boolean ; injector ?: Injector } = { } ,
13
13
) {
14
14
injector = assertInjector ( injectNgtsAnimations , injector ) ;
15
+
16
+ const mixer = new THREE . AnimationMixer ( null ! ) ;
17
+ const actions = { } as Record < string , THREE . AnimationAction > ;
18
+ let cached = { } as Record < string , THREE . AnimationAction > ;
19
+ let object : THREE . Object3D | null = null ;
20
+ const names = [ ] as string [ ] ;
21
+ const clips = [ ] as THREE . AnimationClip [ ] ;
22
+
15
23
return runInInjectionContext ( injector , ( ) => {
16
24
let actualRef = injectNgtRef < THREE . Object3D > ( ) ;
17
25
@@ -23,14 +31,6 @@ export function injectNgtsAnimations(
23
31
}
24
32
}
25
33
26
- const mixer = new THREE . AnimationMixer ( null ! ) ;
27
- const actions = { } as Record < string , THREE . AnimationAction > ;
28
- let cached = { } as Record < string , THREE . AnimationAction > ;
29
- let object : THREE . Object3D | null = null ;
30
-
31
- const clips = [ ] as THREE . AnimationClip [ ] ;
32
- const names = [ ] as string [ ] ;
33
-
34
34
injectBeforeRender ( ( { delta } ) => mixer . update ( delta ) ) ;
35
35
36
36
const ready = computed ( ( ) => ! ! actualRef . nativeElement && ! ! animationsFactory ( ) . length ) ;
You can’t perform that action at this time.
0 commit comments