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 77 input ,
88 viewChild ,
99} from '@angular/core' ;
10- import { NgtVector3 } from 'angular-three' ;
10+ import { getLocalState , NgtVector3 } from 'angular-three' ;
1111import { injectGLTF } from 'angular-three-soba/loaders' ;
1212import { NgtsMeshTransmissionMaterial } from 'angular-three-soba/materials' ;
1313import { injectMask } from 'angular-three-soba/staging' ;
@@ -67,9 +67,15 @@ export class Tank {
6767 const group = this . groupRef ( ) ?. nativeElement ;
6868 if ( ! group ) return ;
6969
70+ const localState = getLocalState ( group ) ;
71+ if ( ! localState ) return ;
72+
73+ // track all children
74+ localState . objects ( ) ;
75+
7076 // Apply stencil to all contents
7177 group . traverse ( ( child ) => {
72- if ( child instanceof Mesh && child . material ) {
78+ if ( child instanceof Mesh ) {
7379 Object . assign ( child . material , { ...this . stencilParameters ( ) } ) ;
7480 }
7581 } ) ;
You can’t perform that action at this time.
0 commit comments