Skip to content

Commit 617e987

Browse files
committed
chore(repo): stay consistent with boolean coercion
1 parent 6308326 commit 617e987

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+233
-123
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { State } from './state';
55

66
@Component({
77
template: `
8-
<ngt-canvas [shadows]="true" [camera]="{ position: [0, 0, 15] }">
8+
<ngt-canvas shadows [camera]="{ position: [0, 0, 15] }">
99
<app-scene-graph *canvasContent />
1010
</ngt-canvas>
1111
<div class="font-mono absolute top-0 right-0 flex gap-4 text-white">

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { State } from './state';
2020
@Component({
2121
selector: 'app-plane',
2222
template: `
23-
<ngt-mesh #mesh [receiveShadow]="true">
23+
<ngt-mesh #mesh receiveShadow>
2424
<ngt-plane-geometry *args="args" />
2525
<ngt-mesh-standard-material color="#171717" />
2626
</ngt-mesh>
@@ -42,7 +42,7 @@ export class Plane {
4242
@Component({
4343
selector: 'app-box',
4444
template: `
45-
<ngt-mesh #mesh [receiveShadow]="true" [castShadow]="true">
45+
<ngt-mesh #mesh receiveShadow castShadow>
4646
<ngt-box-geometry *args="args" />
4747
<ngt-mesh-standard-material [roughness]="0.5" color="#575757" />
4848
</ngt-mesh>
@@ -71,7 +71,7 @@ export class Box {
7171
[angle]="0.2"
7272
[penumbra]="1"
7373
[decay]="0"
74-
[castShadow]="true"
74+
castShadow
7575
/>
7676
7777
<ngtc-physics

apps/examples/src/app/cannon/chain/scene.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class StaticHandle {
189189
[penumbra]="1"
190190
[intensity]="Math.PI"
191191
[decay]="0"
192-
[castShadow]="true"
192+
castShadow
193193
/>
194194
195195
<ngtc-physics [options]="{ gravity: [0, -40, 0], allowSleep: false }">

apps/examples/src/app/cannon/compound/scene.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Component,
55
ElementRef,
66
afterNextRender,
7+
booleanAttribute,
78
effect,
89
input,
910
output,
@@ -25,7 +26,7 @@ import { Group } from 'three';
2526
<ngt-plane-geometry *args="[8, 8]" />
2627
<ngt-mesh-basic-material color="#ffb385" />
2728
</ngt-mesh>
28-
<ngt-mesh [receiveShadow]="true">
29+
<ngt-mesh receiveShadow>
2930
<ngt-plane-geometry *args="[8, 8]" />
3031
<ngt-shadow-material color="lightsalmon" />
3132
</ngt-mesh>
@@ -48,11 +49,11 @@ export class Plane {
4849
selector: 'app-compound-body',
4950
template: `
5051
<ngt-group #group>
51-
<ngt-mesh [castShadow]="true">
52+
<ngt-mesh castShadow>
5253
<ngt-box-geometry *args="boxSize" />
5354
<ngt-mesh-normal-material />
5455
</ngt-mesh>
55-
<ngt-mesh [castShadow]="true" [position]="[1, 0, 0]">
56+
<ngt-mesh castShadow [position]="[1, 0, 0]">
5657
<ngt-sphere-geometry *args="[sphereRadius, 16, 16]" />
5758
<ngt-mesh-normal-material />
5859
</ngt-mesh>
@@ -68,7 +69,7 @@ export class CompoundBody {
6869

6970
position = input<Triplet>([0, 0, 0]);
7071
rotation = input<Triplet>([0, 0, 0]);
71-
isTrigger = input(false);
72+
isTrigger = input(false, { transform: booleanAttribute });
7273
mass = input(12);
7374

7475
positionChanged = output<Triplet>();
@@ -111,7 +112,7 @@ export class CompoundBody {
111112
template: `
112113
<ngt-color attach="background" *args="['#f6d186']" />
113114
<ngt-hemisphere-light [intensity]="0.35" />
114-
<ngt-spot-light [position]="[5, 5, 5]" [angle]="0.3" [penumbra]="1" [intensity]="2" [castShadow]="true">
115+
<ngt-spot-light [position]="[5, 5, 5]" [angle]="0.3" [penumbra]="1" [intensity]="2" castShadow>
115116
<ngt-vector2 *args="[1028, 1028]" attach="shadow.mapSize" />
116117
</ngt-spot-light>
117118
@@ -130,7 +131,7 @@ export class CompoundBody {
130131
}
131132
132133
@if (copy()) {
133-
<app-compound-body [isTrigger]="true" [mass]="0" [position]="position" [rotation]="rotation" />
134+
<app-compound-body isTrigger [mass]="0" [position]="position" [rotation]="rotation" />
134135
}
135136
</ngtc-physics>
136137
`,

apps/examples/src/app/cannon/convexpolyhedron/scene.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function toConvexProps(bufferGeometry: BufferGeometry): [vertices: Triplet[], fa
3434
template: `
3535
<ngt-mesh
3636
#mesh
37-
[castShadow]="true"
37+
castShadow
3838
[geometry]="geometry()"
3939
[rotation]="positionRotationInputs.rotation()"
4040
[position]="positionRotationInputs.position()"
@@ -75,8 +75,8 @@ export class Cone {
7575
template: `
7676
<ngt-mesh
7777
#mesh
78-
[receiveShadow]="true"
79-
[castShadow]="true"
78+
receiveShadow
79+
castShadow
8080
[geometry]="geometry()"
8181
[rotation]="positionRotationInputs.rotation()"
8282
[position]="positionRotationInputs.position()"
@@ -121,12 +121,12 @@ type DiamondGLTF = GLTF & {
121121
@if (geometry(); as geometry) {
122122
<ngt-mesh
123123
#mesh
124-
[castShadow]="true"
125-
[receiveShadow]="true"
124+
castShadow
125+
receiveShadow
126126
[geometry]="geometry"
127127
[rotation]="positionRotationInputs.rotation()"
128128
>
129-
<ngt-mesh-standard-material [wireframe]="true" color="white" />
129+
<ngt-mesh-standard-material wireframe color="white" />
130130
</ngt-mesh>
131131
}
132132
`,

apps/examples/src/app/cannon/cube-heap/scene.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { shape } from './state';
2121
@Component({
2222
selector: 'app-plane',
2323
template: `
24-
<ngt-mesh #mesh [receiveShadow]="true">
24+
<ngt-mesh #mesh receiveShadow>
2525
<ngt-plane-geometry *args="[10, 10]" />
2626
<ngt-shadow-material color="#171717" />
2727
</ngt-mesh>
@@ -60,11 +60,11 @@ export abstract class InstancesInput {
6060
@Component({
6161
selector: 'app-boxes',
6262
template: `
63-
<ngt-instanced-mesh *args="[undefined, undefined, count()]" [receiveShadow]="true" [castShadow]="true" #mesh>
63+
<ngt-instanced-mesh *args="[undefined, undefined, count()]" receiveShadow castShadow #mesh>
6464
<ngt-box-geometry *args="args()">
6565
<ngt-instanced-buffer-attribute attach="attributes.color" *args="[colors(), 3]" />
6666
</ngt-box-geometry>
67-
<ngt-mesh-lambert-material [vertexColors]="true" />
67+
<ngt-mesh-lambert-material vertexColors />
6868
</ngt-instanced-mesh>
6969
`,
7070
imports: [NgtArgs],
@@ -84,11 +84,11 @@ export class Boxes extends InstancesInput {
8484
@Component({
8585
selector: 'app-spheres',
8686
template: `
87-
<ngt-instanced-mesh *args="[undefined, undefined, count()]" [receiveShadow]="true" [castShadow]="true" #mesh>
87+
<ngt-instanced-mesh *args="[undefined, undefined, count()]" receiveShadow castShadow #mesh>
8888
<ngt-sphere-geometry *args="[size(), 48, 48]">
8989
<ngt-instanced-buffer-attribute attach="attributes.color" *args="[colors(), 3]" />
9090
</ngt-sphere-geometry>
91-
<ngt-mesh-lambert-material [vertexColors]="true" />
91+
<ngt-mesh-lambert-material vertexColors />
9292
</ngt-instanced-mesh>
9393
`,
9494
imports: [NgtArgs],
@@ -116,7 +116,7 @@ export class Spheres extends InstancesInput {
116116
<ngt-hemisphere-light [intensity]="0.35 * Math.PI" />
117117
<ngt-spot-light
118118
[angle]="0.3"
119-
[castShadow]="true"
119+
castShadow
120120
[decay]="0"
121121
[intensity]="2 * Math.PI"
122122
[penumbra]="1"

apps/examples/src/app/cannon/kinematic-cube/scene.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import niceColors from '../../colors';
1717
@Component({
1818
selector: 'app-plane',
1919
template: `
20-
<ngt-mesh #mesh [receiveShadow]="true">
20+
<ngt-mesh #mesh receiveShadow>
2121
<ngt-plane-geometry *args="[1000, 1000]" />
2222
<ngt-mesh-phong-material [color]="color()" />
2323
</ngt-mesh>
@@ -41,7 +41,7 @@ export class Plane {
4141
@Component({
4242
selector: 'app-box',
4343
template: `
44-
<ngt-mesh #mesh [castShadow]="true" [receiveShadow]="true">
44+
<ngt-mesh #mesh castShadow receiveShadow>
4545
<ngt-box-geometry *args="args" />
4646
<ngt-mesh-lambert-material color="white" />
4747
</ngt-mesh>
@@ -73,14 +73,14 @@ export class Box {
7373
template: `
7474
<ngt-instanced-mesh
7575
#instancedMesh
76-
[castShadow]="true"
77-
[receiveShadow]="true"
76+
castShadow
77+
receiveShadow
7878
*args="[undefined, undefined, count()]"
7979
>
8080
<ngt-sphere-geometry *args="[1, 16, 16]">
8181
<ngt-instanced-buffer-attribute attach="attributes.color" *args="[colors(), 3]" />
8282
</ngt-sphere-geometry>
83-
<ngt-mesh-phong-material [vertexColors]="true" />
83+
<ngt-mesh-phong-material vertexColors />
8484
</ngt-instanced-mesh>
8585
`,
8686
imports: [NgtArgs],
@@ -122,7 +122,7 @@ export class InstancedSpheres {
122122
<ngt-hemisphere-light [intensity]="0.35 * Math.PI" />
123123
<ngt-spot-light
124124
[angle]="0.3"
125-
[castShadow]="true"
125+
castShadow
126126
[decay]="0"
127127
[intensity]="2 * Math.PI"
128128
[penumbra]="1"

apps/examples/src/app/cannon/monday-morning/scene.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Injector,
77
Signal,
88
afterNextRender,
9+
booleanAttribute,
910
computed,
1011
inject,
1112
input,
@@ -81,7 +82,7 @@ export class Box {
8182
depth = input(1);
8283
color = input('white');
8384
opacity = input(1);
84-
transparent = input(false);
85+
transparent = input(false, { transform: booleanAttribute });
8586
args = input([1, 1, 1]);
8687
position = input<NgtVector3>([0, 0, 0]);
8788
scale = input<NgtVector3>([1, 1, 1]);
@@ -183,7 +184,7 @@ export class BodyPart {
183184
[args]="[0.3, 0.01, 0.1]"
184185
[opacity]="0.8"
185186
[position]="[-0.3, 0.1, 0.5]"
186-
[transparent]="true"
187+
transparent
187188
/>
188189
<app-box
189190
color="black"
@@ -193,7 +194,7 @@ export class BodyPart {
193194
[args]="[0.3, 0.01, 0.1]"
194195
[opacity]="0.8"
195196
[position]="[0.3, 0.1, 0.5]"
196-
[transparent]="true"
197+
transparent
197198
/>
198199
</ngt-group>
199200
<app-box
@@ -205,7 +206,7 @@ export class BodyPart {
205206
[args]="[0.3, 0.05, 0.1]"
206207
[opacity]="0.8"
207208
[position]="[0, -0.2, 0.5]"
208-
[transparent]="true"
209+
transparent
209210
/>
210211
</ng-container>
211212
</app-body-part>
@@ -310,14 +311,14 @@ interface CupGLTF extends GLTF {
310311
<ngt-mesh
311312
[material]="gltf.materials.default"
312313
[geometry]="gltf.nodes['buffer-0-mesh-0'].geometry"
313-
[castShadow]="true"
314-
[receiveShadow]="true"
314+
castShadow
315+
receiveShadow
315316
/>
316317
<ngt-mesh
317318
[material]="gltf.materials.Liquid"
318319
[geometry]="gltf.nodes['buffer-0-mesh-0_1'].geometry"
319-
[castShadow]="true"
320-
[receiveShadow]="true"
320+
castShadow
321+
receiveShadow
321322
/>
322323
}
323324
</ngt-group>
@@ -390,7 +391,7 @@ export class Table {
390391
template: `
391392
<ngt-mesh #mesh>
392393
<ngt-sphere-geometry *args="[0.5, 32, 32]" />
393-
<ngt-mesh-basic-material [fog]="false" [depthTest]="false" [transparent]="true" [opacity]="0.5" />
394+
<ngt-mesh-basic-material [fog]="false" [depthTest]="false" transparent [opacity]="0.5" />
394395
</ngt-mesh>
395396
<ng-content />
396397
`,

apps/examples/src/app/rapier/wrapper-default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class Floor {}
4141
} @else {
4242
<ngtr-physics [options]="{ debug: debug(), interpolate: interpolate(), paused: paused() }">
4343
<ng-template>
44-
<ngt-directional-light [castShadow]="true" [position]="10">
44+
<ngt-directional-light castShadow [position]="10">
4545
<ngt-value [rawValue]="-40" attach="shadow.camera.bottom" />
4646
<ngt-value [rawValue]="40" attach="shadow.camera.top" />
4747
<ngt-value [rawValue]="-40" attach="shadow.camera.left" />

apps/examples/src/app/rapier/wrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { debug, interpolate, paused, RapierWrapperDefault } from './wrapper-defa
55

66
@Component({
77
template: `
8-
<ngt-canvas [shadows]="true" [dpr]="1">
8+
<ngt-canvas shadows [dpr]="1">
99
<app-rapier-wrapper-default *canvasContent />
1010
</ngt-canvas>
1111
<div class="absolute top-2 right-2 font-mono flex gap-4">

0 commit comments

Comments
 (0)