File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
apps/kitchen-sink/src/app/soba/aquarium Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 7
7
input ,
8
8
viewChild ,
9
9
} from '@angular/core' ;
10
- import { NgtVector3 } from 'angular-three' ;
10
+ import { getLocalState , NgtVector3 } from 'angular-three' ;
11
11
import { injectGLTF } from 'angular-three-soba/loaders' ;
12
12
import { NgtsMeshTransmissionMaterial } from 'angular-three-soba/materials' ;
13
13
import { injectMask } from 'angular-three-soba/staging' ;
@@ -67,9 +67,15 @@ export class Tank {
67
67
const group = this . groupRef ( ) ?. nativeElement ;
68
68
if ( ! group ) return ;
69
69
70
+ const localState = getLocalState ( group ) ;
71
+ if ( ! localState ) return ;
72
+
73
+ // track all children
74
+ localState . objects ( ) ;
75
+
70
76
// Apply stencil to all contents
71
77
group . traverse ( ( child ) => {
72
- if ( child instanceof Mesh && child . material ) {
78
+ if ( child instanceof Mesh ) {
73
79
Object . assign ( child . material , { ...this . stencilParameters ( ) } ) ;
74
80
}
75
81
} ) ;
You can’t perform that action at this time.
0 commit comments