Skip to content

Commit 18bdf52

Browse files
committed
chore: clean up sandbox
1 parent 72fef8c commit 18bdf52

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

apps/sandbox/src/app/app.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Type, ViewChild, ViewContainerRef, effect, signal } from '@angular/core';
2-
import { NgtCanvas, NgtKey, extend } from 'angular-three';
2+
import { extend } from 'angular-three';
33
import { NgtsLoader } from 'angular-three-soba/loaders';
44
import * as THREE from 'three';
55
import { AviatorCanvas } from './aviator/canvas.component';
@@ -23,7 +23,7 @@ type AvailableCanvas = (typeof availableCanvases)[number];
2323

2424
@Component({
2525
standalone: true,
26-
imports: [NgtCanvas, NgtKey, NgtsLoader],
26+
imports: [NgtsLoader],
2727
selector: 'sandbox-root',
2828
template: `
2929
<ng-container #anchor />
@@ -36,7 +36,7 @@ type AvailableCanvas = (typeof availableCanvases)[number];
3636
},
3737
})
3838
export class AppComponent {
39-
canvas = signal<AvailableCanvas>('aviator');
39+
canvas = signal<AvailableCanvas>('cannon');
4040

4141
@ViewChild('anchor', { static: true, read: ViewContainerRef }) vcr!: ViewContainerRef;
4242

apps/sandbox/src/app/cannon/scene.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ import { injectBox, injectPlane } from 'angular-three-cannon/services';
1111
standalone: true,
1212
template: `
1313
<ngt-mesh [ref]="planeApi.ref" [receiveShadow]="true">
14-
<ngt-plane-geometry *args="[1000, 1000]" />
14+
<ngt-plane-geometry *args="planeArgs" />
1515
<ngt-mesh-standard-material color="#171717" />
1616
</ngt-mesh>
1717
`,
1818
imports: [NgtArgs],
1919
schemas: [CUSTOM_ELEMENTS_SCHEMA],
2020
})
2121
export class Plane {
22-
Math = Math;
2322
@Input() position: Triplet = [0, 0, 0];
23+
planeArgs = [1000, 1000];
2424

25-
planeApi = injectPlane(() => ({ mass: 0, position: this.position, args: [1000, 1000] }));
25+
planeApi = injectPlane(() => ({ mass: 0, position: this.position, args: this.planeArgs }));
2626
}
2727

2828
@Component({
2929
selector: 'app-box',
3030
standalone: true,
3131
template: `
3232
<ngt-mesh [ref]="boxApi.ref" [receiveShadow]="true" [castShadow]="true">
33-
<ngt-box-geometry *args="[2, 2, 2]" />
33+
<ngt-box-geometry *args="boxArgs" />
3434
<ngt-mesh-standard-material [roughness]="0.5" color="#575757" />
3535
</ngt-mesh>
3636
`,
@@ -39,8 +39,9 @@ export class Plane {
3939
})
4040
export class Box {
4141
@Input() position: Triplet = [0, 0, 0];
42+
boxArgs: Triplet = [2, 2, 2];
4243

43-
boxApi = injectBox(() => ({ mass: 10000, position: this.position, args: [2, 2, 2] }));
44+
boxApi = injectBox(() => ({ mass: 10000, position: this.position, args: this.boxArgs }));
4445
}
4546

4647
@Component({

0 commit comments

Comments
 (0)