1
1
import { ChangeDetectionStrategy , Component , CUSTOM_ELEMENTS_SCHEMA , signal } from '@angular/core' ;
2
- import { NgtArgs , NgtSelect , NgtSelection } from 'angular-three' ;
2
+ import { NgtArgs , NgtSelection , NgtSelectionApi } from 'angular-three' ;
3
3
import { NgtpEffectComposer , NgtpOutline , NgtpSMAA } from 'angular-three-postprocessing' ;
4
4
import { NgtsOrbitControls } from 'angular-three-soba/controls' ;
5
5
import { KernelSize } from 'postprocessing' ;
6
6
7
7
/**
8
8
* There are multiple ways to use the Outline effect.
9
9
*
10
- * 1. Via NgtSelection and NgtSelect
10
+ * 1. Via NgtSelectionApi and NgtSelect
11
11
* This is the recommended way to use the Outline effect.
12
12
*
13
- * 1a. We can use NgtSelection as hostDirective (as shown) to enable Selection on the entire scene.
13
+ * 1a. We can use NgtSelectionApi as hostDirective (as shown) to enable Selection on the entire scene.
14
14
* NgtpOutline will automatically be aware of the NgtSelection context and will use it for the selected objects.
15
15
*
16
- * 1b. We can wrap `<ng-container ngtSelection>` around the objects we want to select AS WELL AS the Outline effect.
16
+ * 1b. We can wrap `<ng-container selection>` around the objects we want to select AS WELL AS the Outline effect.
17
+ * When using this approach, you can use `NgtSelection` in the imports array instead of [NgtSelectionApi, NgtSelect].
17
18
*
18
- * ngtSelect can be used on ngt-group or ngt-mesh. ngt-group will select all children, ngt-mesh will only select itself.
19
+ * select can be used on ngt-group or ngt-mesh. ngt-group will select all children, ngt-mesh will only select itself.
19
20
*
20
21
* 2. Via selection input on NgtpOutline
21
22
* If we want to control the selection ourselves, we can pass in the selection input an Array of Object3D or ElementRef<Object3D>
@@ -36,7 +37,7 @@ import { KernelSize } from 'postprocessing';
36
37
<ngt-point-light [position]="[0, -1, -1]" [decay]="0" color="green" />
37
38
<ngt-directional-light [position]="[0, 1, 1]" />
38
39
39
- <ngt-group [ngtSelect ]="hovered()" (pointerenter)="hovered.set(true)" (pointerleave)="hovered.set(false)">
40
+ <ngt-group [select ]="hovered()" (pointerenter)="hovered.set(true)" (pointerleave)="hovered.set(false)">
40
41
<ngt-mesh>
41
42
<ngt-box-geometry />
42
43
<ngt-mesh-standard-material color="hotpink" />
@@ -59,8 +60,8 @@ import { KernelSize } from 'postprocessing';
59
60
schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
60
61
changeDetection : ChangeDetectionStrategy . OnPush ,
61
62
host : { class : 'postprocessing-sample' } ,
62
- hostDirectives : [ NgtSelection ] ,
63
- imports : [ NgtsOrbitControls , NgtSelect , NgtpEffectComposer , NgtpOutline , NgtArgs , NgtpSMAA ] ,
63
+ hostDirectives : [ NgtSelectionApi ] ,
64
+ imports : [ NgtsOrbitControls , NgtSelection , NgtpEffectComposer , NgtpOutline , NgtArgs , NgtpSMAA ] ,
64
65
} )
65
66
export class SceneGraph {
66
67
protected KernelSize = KernelSize ;
0 commit comments