Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1381512

Browse files
committed
refactor(soba): clean up
1 parent 99625b1 commit 1381512

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

apps/examples/src/app/theatre/basic/basic.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import stateJson from './state.json';
88
template: `
99
<ngt-canvas shadows>
1010
<theatre-project *canvasContent studio [config]="{ state }">
11-
<theatre-sheet [sequence]="{ autoplay: true, iterationCount: Infinity }">
12-
<app-scene-graph />
13-
</theatre-sheet>
11+
<app-scene-graph sheet [sequence]="{ autoplay: true, iterationCount: Infinity }" />
1412
</theatre-project>
1513
</ngt-canvas>
1614
`,

apps/examples/src/app/theatre/basic/scene.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChangeDetectionStrategy, Component, CUSTOM_ELEMENTS_SCHEMA, signal, viewChild } from '@angular/core';
2-
import { injectBeforeRender, NgtArgs } from 'angular-three';
2+
import { injectBeforeRender } from 'angular-three';
33
import { NgtsRoundedBox } from 'angular-three-soba/abstractions';
44
import { NgtsPerspectiveCamera } from 'angular-three-soba/cameras';
55
import { TheatreSheetObject, TheatreSheetObjectTransform } from 'angular-three-theatre';
@@ -46,7 +46,7 @@ import { TheatreSheetObject, TheatreSheetObjectTransform } from 'angular-three-t
4646
</ngt-mesh>
4747
`,
4848
schemas: [CUSTOM_ELEMENTS_SCHEMA],
49-
imports: [NgtArgs, TheatreSheetObject, NgtsRoundedBox, NgtsPerspectiveCamera],
49+
imports: [TheatreSheetObject, NgtsRoundedBox, NgtsPerspectiveCamera],
5050
changeDetection: ChangeDetectionStrategy.OnPush,
5151
host: { class: 'experience-basic-theatre', '(document:keyup)': 'onKeyup($event)' },
5252
})

libs/soba/misc/src/lib/sampler.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ export class NgtsSampler {
172172
options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
173173
protected parameters = omit(this.options, ['weight', 'transform', 'count']);
174174

175-
// NOTE: this could have been a viewChild.required, but we need to _try_ to consume
176-
// this Signal earlier than when a viewChild.required would resolve.
177175
groupRef = viewChild.required<ElementRef<THREE.Group>>('group');
178176

179177
private count = pick(this.options, 'count');
@@ -209,9 +207,9 @@ export class NgtsSampler {
209207
) as unknown as THREE.InstancedMesh;
210208
});
211209

212-
// NOTE: because injectSurfaceSampler returns a computed, we need to consume
210+
// NOTE: because surfaceSampler returns a computed, we need to consume
213211
// this computed in a Reactive Context (an effect) to ensure the inner logic of
214-
// injectSurfaceSampler is run properly.
212+
// surfaceSampler is run properly.
215213
const sampler = surfaceSampler(meshToSample, {
216214
count: this.count,
217215
transform: this.transform,

libs/soba/staging/src/lib/accumulative-shadows.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ const defaultOptions: NgtsAccumulativeShadowsOptions = {
8181
changeDetection: ChangeDetectionStrategy.OnPush,
8282
})
8383
export class NgtsAccumulativeShadows {
84-
nullTraversal = () => null;
85-
Math = Math;
84+
protected readonly nullTraversal = () => null;
85+
protected readonly Math = Math;
8686

8787
options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
8888
parameters = omit(this.options, [

0 commit comments

Comments
 (0)