11import { 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' ;
33import { NgtpEffectComposer , NgtpOutline , NgtpSMAA } from 'angular-three-postprocessing' ;
44import { NgtsOrbitControls } from 'angular-three-soba/controls' ;
55import { KernelSize } from 'postprocessing' ;
66
77/**
88 * There are multiple ways to use the Outline effect.
99 *
10- * 1. Via NgtSelection and NgtSelect
10+ * 1. Via NgtSelectionApi and NgtSelect
1111 * This is the recommended way to use the Outline effect.
1212 *
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.
1414 * NgtpOutline will automatically be aware of the NgtSelection context and will use it for the selected objects.
1515 *
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].
1718 *
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.
1920 *
2021 * 2. Via selection input on NgtpOutline
2122 * 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';
3637 <ngt-point-light [position]="[0, -1, -1]" [decay]="0" color="green" />
3738 <ngt-directional-light [position]="[0, 1, 1]" />
3839
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)">
4041 <ngt-mesh>
4142 <ngt-box-geometry />
4243 <ngt-mesh-standard-material color="hotpink" />
@@ -59,8 +60,8 @@ import { KernelSize } from 'postprocessing';
5960 schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
6061 changeDetection : ChangeDetectionStrategy . OnPush ,
6162 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 ] ,
6465} )
6566export class SceneGraph {
6667 protected KernelSize = KernelSize ;
0 commit comments