@@ -11,7 +11,7 @@ import {
11
11
viewChild ,
12
12
} from '@angular/core' ;
13
13
import { Meta } from '@storybook/angular' ;
14
- import { NgtArgs , NgtThreeEvent } from 'angular-three' ;
14
+ import { NgtArgs } from 'angular-three' ;
15
15
import { NgtsPerspectiveCamera } from 'angular-three-soba/cameras' ;
16
16
import { NgtsOrbitControls } from 'angular-three-soba/controls' ;
17
17
import { injectTexture } from 'angular-three-soba/loaders' ;
@@ -62,24 +62,26 @@ class LoopOverInstancedBufferAttribute {
62
62
63
63
<ngt-directional-light [position]="[1, -1, 1]" [intensity]="Math.PI" />
64
64
65
- <ngt-mesh #mesh (click)="onClick($any($event))" >
65
+ <ngt-mesh #mesh>
66
66
<ngt-sphere-geometry *args="[3, 32, 32]" />
67
67
<ngt-mesh-physical-material color="tomato" [roughness]="0.5" />
68
68
</ngt-mesh>
69
69
70
- <decal-loop-over-instanced-buffer-attribute [buffer]="bufferAttribute()">
71
- <ngts-decal *="let options" [mesh]="$any(mesh)" [options]="options">
72
- <ngt-mesh-physical-material
73
- [roughness]="0.2"
74
- [transparent]="true"
75
- [depthTest]="false"
76
- [map]="Math.random() > 0.5 ? decals()?.reactMap : decals()?.threeMap"
77
- [alphaTest]="0"
78
- [polygonOffset]="true"
79
- [polygonOffsetFactor]="-10"
80
- />
81
- </ngts-decal>
82
- </decal-loop-over-instanced-buffer-attribute>
70
+ @if (decals(); as decals) {
71
+ <decal-loop-over-instanced-buffer-attribute [buffer]="bufferAttribute()">
72
+ <ngts-decal *="let options" [mesh]="meshRef()" [options]="options">
73
+ <ngt-mesh-physical-material
74
+ [roughness]="0.2"
75
+ [transparent]="true"
76
+ [depthTest]="false"
77
+ [map]="Math.random() > 0.5 ? decals.reactMap : decals.threeMap"
78
+ [alphaTest]="0"
79
+ [polygonOffset]="true"
80
+ [polygonOffsetFactor]="-10"
81
+ />
82
+ </ngts-decal>
83
+ </decal-loop-over-instanced-buffer-attribute>
84
+ }
83
85
` ,
84
86
schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
85
87
changeDetection : ChangeDetectionStrategy . OnPush ,
@@ -108,10 +110,6 @@ class DefaultDecalStory {
108
110
dummy . lookAt ( p . add ( normal ) ) ;
109
111
} ,
110
112
} ) ) ;
111
-
112
- onClick ( event : NgtThreeEvent < PointerEvent > ) {
113
- console . log ( event ) ;
114
- }
115
113
}
116
114
117
115
export default {
0 commit comments