Skip to content

Commit dd0aafb

Browse files
committed
chore: format
1 parent d8910ea commit dd0aafb

File tree

97 files changed

+1195
-636
lines changed

Some content is hidden

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

97 files changed

+1195
-636
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"singleQuote": true,
33
"useTabs": true,
4-
"tabWidth": 2,
4+
"tabWidth": 4,
55
"printWidth": 120,
66
"plugins": ["prettier-plugin-organize-imports"],
77
"htmlWhitespaceSensitivity": "ignore",

CONTRIBUTING.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you would like to _implement_ a new feature, please consider the size of the
3535
- For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed.
3636
This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
3737

38-
**Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature.
38+
**Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature.
3939

4040
- **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
4141

@@ -71,9 +71,9 @@ Before you submit your Pull Request (PR) consider the following guidelines:
7171

7272
4. In your forked repository, make your changes in a new git branch:
7373

74-
```shell
75-
git checkout -b my-fix-branch main
76-
```
74+
```shell
75+
git checkout -b my-fix-branch main
76+
```
7777

7878
5. Create your patch, **including appropriate test cases**.
7979

@@ -82,17 +82,17 @@ Before you submit your Pull Request (PR) consider the following guidelines:
8282
7. Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit).
8383
Adherence to these conventions is necessary because release notes are automatically generated from these messages.
8484

85-
```shell
86-
git commit --all
87-
```
85+
```shell
86+
git commit --all
87+
```
8888

89-
Note: the optional commit `--all` command line option will automatically "add" and "rm" edited files.
89+
Note: the optional commit `--all` command line option will automatically "add" and "rm" edited files.
9090

9191
8. Push your branch to GitHub:
9292

93-
```shell
94-
git push origin my-fix-branch
95-
```
93+
```shell
94+
git push origin my-fix-branch
95+
```
9696

9797
9. In GitHub, send a pull request to `angular-three:main`.
9898

@@ -104,12 +104,12 @@ If we ask for changes via code reviews then:
104104

105105
2. Create a fixup commit and push to your GitHub repository (this will update your Pull Request):
106106

107-
```shell
108-
git commit --all --fixup HEAD
109-
git push
110-
```
107+
```shell
108+
git commit --all --fixup HEAD
109+
git push
110+
```
111111

112-
For more info on working with fixup commits see [here](./contributing-docs/using-fixup-commits.md).
112+
For more info on working with fixup commits see [here](./contributing-docs/using-fixup-commits.md).
113113

114114
That's it! Thank you for your contribution!
115115
@@ -120,21 +120,21 @@ In order to update the commit message of the last commit on your branch:
120120
121121
1. Check out your branch:
122122
123-
```shell
124-
git checkout my-fix-branch
125-
```
123+
```shell
124+
git checkout my-fix-branch
125+
```
126126
127127
2. Amend the last commit and modify the commit message:
128128
129-
```shell
130-
git commit --amend
131-
```
129+
```shell
130+
git commit --amend
131+
```
132132
133133
3. Push to your GitHub repository:
134134
135-
```shell
136-
git push --force-with-lease
137-
```
135+
```shell
136+
git push --force-with-lease
137+
```
138138
139139
> NOTE:<br />
140140
> If you need to update the commit message of an earlier commit, you can use `git rebase` in interactive mode.
@@ -146,27 +146,27 @@ After your pull request is merged, you can safely delete your branch and pull th
146146
147147
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
148148
149-
```shell
150-
git push origin --delete my-fix-branch
151-
```
149+
```shell
150+
git push origin --delete my-fix-branch
151+
```
152152
153153
- Check out the main branch:
154154
155-
```shell
156-
git checkout main -f
157-
```
155+
```shell
156+
git checkout main -f
157+
```
158158
159159
- Delete the local branch:
160160
161-
```shell
162-
git branch -D my-fix-branch
163-
```
161+
```shell
162+
git branch -D my-fix-branch
163+
```
164164
165165
- Update your local `main` with the latest upstream version:
166166
167-
```shell
168-
git pull --ff upstream main
169-
```
167+
```shell
168+
git pull --ff upstream main
169+
```
170170
171171
## <a name="rules"></a> Coding Rules
172172

apps/examples/public/earth.gltf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@
255255
{
256256
"children": [5, 6, 7],
257257
"matrix": [
258-
99.86371360033668, -6.938893903907228e-16, -5.2190713685417345, 0, -5.219071368541729, -0.000004371139006309477,
259-
-99.86371360033658, 0, -2.281328639885949e-7, 99.9999999999999, -0.000004365181749399483, 0, 0, 0, 0, 1
258+
99.86371360033668, -6.938893903907228e-16, -5.2190713685417345, 0, -5.219071368541729,
259+
-0.000004371139006309477, -99.86371360033658, 0, -2.281328639885949e-7, 99.9999999999999,
260+
-0.000004365181749399483, 0, 0, 0, 0, 1
260261
],
261262
"name": "URF-Height"
262263
},

apps/examples/public/rock2/scene.gltf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@
163163
{
164164
"children": [3],
165165
"matrix": [
166-
1, 0, 0, 0, 0, -4.3711390063094768e-8, 0.999999999999999, 0, 0, -0.999999999999999, -4.3711390063094768e-8, 0,
167-
0, 0, 0, 1
166+
1, 0, 0, 0, 0, -4.3711390063094768e-8, 0.999999999999999, 0, 0, -0.999999999999999,
167+
-4.3711390063094768e-8, 0, 0, 0, 0, 1
168168
],
169169
"name": "Collada visual scene group"
170170
},

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ export class ChainLink {
6363
protected mesh = viewChild.required<ElementRef<Mesh>>('mesh');
6464

6565
constructor() {
66-
injectCylinder(() => ({ mass: 1, args: this.args(), linearDamping: 0.8, position: this.position() }), this.mesh);
66+
injectCylinder(
67+
() => ({ mass: 1, args: this.args(), linearDamping: 0.8, position: this.position() }),
68+
this.mesh,
69+
);
6770

6871
const injector = inject(Injector);
6972
// NOTE: we want to run this in afterNextRender because we want the input to resolve

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ export class Spheres extends InstancesInput {
100100
private mesh = viewChild<ElementRef<InstancedMesh>>('mesh');
101101

102102
bodyApi = injectSphere(
103-
() => ({ args: [this.size()], mass: 1, position: [Math.random() - 0.5, Math.random() * 2, Math.random() - 0.5] }),
103+
() => ({
104+
args: [this.size()],
105+
mass: 1,
106+
position: [Math.random() - 0.5, Math.random() * 2, Math.random() - 0.5],
107+
}),
104108
this.mesh,
105109
);
106110
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,10 @@ export class Cursor {
402402
mesh = viewChild.required<ElementRef<Mesh>>('mesh');
403403

404404
constructor() {
405-
const sphereApi = injectSphere<Mesh>(() => ({ args: [0.5], position: [0, 0, 10000], type: 'Static' }), this.mesh);
405+
const sphereApi = injectSphere<Mesh>(
406+
() => ({ args: [0.5], position: [0, 0, 10000], type: 'Static' }),
407+
this.mesh,
408+
);
406409
injectBeforeRender(({ pointer, viewport: { width, height } }) => {
407410
const x = pointer.x * width;
408411
const y = (pointer.y * height) / 1.9 + -x / 3.5;

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ import { injectSuzanne } from '../suzanne';
2121
@if (gltf(); as gltf) {
2222
<ngt-object3D rigidBody [position]="position()">
2323
<ngt-mesh [geometry]="gltf.nodes.Suzanne.geometry" castShadow receiveShadow>
24-
<ngt-mesh-physical-material [roughness]="0" [transmission]="0" [thickness]="0.2" [ior]="1.5" color="orange" />
24+
<ngt-mesh-physical-material
25+
[roughness]="0"
26+
[transmission]="0"
27+
[thickness]="0.2"
28+
[ior]="1.5"
29+
color="orange"
30+
/>
2531
</ngt-mesh>
2632
</ngt-object3D>
2733
}
@@ -72,7 +78,11 @@ export class MonkeySwarm {
7278
...prev,
7379
{
7480
key: Math.random() + Date.now(),
75-
position: [Math.random() * 10 - 5, Math.random(), Math.random() * 10 - 5] as [number, number, number],
81+
position: [Math.random() * 10 - 5, Math.random(), Math.random() * 10 - 5] as [
82+
number,
83+
number,
84+
number,
85+
],
7686
},
7787
]);
7888
}, 50);

apps/examples/src/app/routed-rocks/colored-rock.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ import { RockStore } from './store';
88
template: `
99
@if (selectedRock(); as rock) {
1010
<ngt-group *parent="rock.name">
11-
<ngt-mesh castShadow receiveShadow [rotation]="[0, Math.PI / 4, 0]" [position]="[0, 7, 0]" [scale]="0.5">
11+
<ngt-mesh
12+
castShadow
13+
receiveShadow
14+
[rotation]="[0, Math.PI / 4, 0]"
15+
[position]="[0, 7, 0]"
16+
[scale]="0.5"
17+
>
1218
<ngt-box-geometry *args="[0.7, 0.7, 0.7]" />
1319
<ngt-mesh-phong-material [color]="rock.color" [side]="FrontSide" />
1420
</ngt-mesh>

apps/examples/src/app/routed-rocks/rocks.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ interface RockGLTF extends GLTF {
5252
}
5353
5454
<ngts-camera-controls
55-
[options]="{ makeDefault: true, minDistance: 12, maxDistance: 12, minPolarAngle: 0, maxPolarAngle: Math.PI / 2 }"
55+
[options]="{
56+
makeDefault: true,
57+
minDistance: 12,
58+
maxDistance: 12,
59+
minPolarAngle: 0,
60+
maxPolarAngle: Math.PI / 2,
61+
}"
5662
/>
5763
5864
<ngt-icosahedron-geometry #geometry attach="none" />

apps/examples/src/app/soba/aquarium/scene.ts

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,27 @@ import { Turtle } from './turtle';
4040
}"
4141
>
4242
<ngts-randomized-lights
43-
[options]="{ amount: 8, radius: 15, ambient: 0.5, intensity: Math.PI, position: [-5, 10, -5], size: 20 }"
43+
[options]="{
44+
amount: 8,
45+
radius: 15,
46+
ambient: 0.5,
47+
intensity: Math.PI,
48+
position: [-5, 10, -5],
49+
size: 20,
50+
}"
4451
/>
4552
</ngts-accumulative-shadows>
4653
4754
<!-- custom env map -->
4855
<ngts-environment [options]="{ resolution: 1024 }">
4956
<ngt-group * [rotation]="[-Math.PI / 3, 0, 0]">
5057
<ngts-lightformer
51-
[options]="{ intensity: 4, rotation: [Math.PI / 2, 0, 0], position: [0, 5, -9], scale: [10, 10, 1] }"
58+
[options]="{
59+
intensity: 4,
60+
rotation: [Math.PI / 2, 0, 0],
61+
position: [0, 5, -9],
62+
scale: [10, 10, 1],
63+
}"
5264
/>
5365
5466
@for (x of lightPositions; track $index) {
@@ -64,15 +76,27 @@ import { Turtle } from './turtle';
6476
}
6577
6678
<ngts-lightformer
67-
[options]="{ intensity: 2, rotation: [Math.PI / 2, 0, 0], position: [-5, 1, -1], scale: [50, 2, 1] }"
79+
[options]="{
80+
intensity: 2,
81+
rotation: [Math.PI / 2, 0, 0],
82+
position: [-5, 1, -1],
83+
scale: [50, 2, 1],
84+
}"
6885
/>
6986
<ngts-lightformer
70-
[options]="{ intensity: 2, rotation: [-Math.PI / 2, 0, 0], position: [10, 1, 0], scale: [50, 2, 1] }"
87+
[options]="{
88+
intensity: 2,
89+
rotation: [-Math.PI / 2, 0, 0],
90+
position: [10, 1, 0],
91+
scale: [50, 2, 1],
92+
}"
7193
/>
7294
</ngt-group>
7395
</ngts-environment>
7496
75-
<ngts-camera-controls [options]="{ minPolarAngle: 0, maxPolarAngle: Math.PI / 2, truckSpeed: 0, dollySpeed: 0 }" />
97+
<ngts-camera-controls
98+
[options]="{ minPolarAngle: 0, maxPolarAngle: Math.PI / 2, truckSpeed: 0, dollySpeed: 0 }"
99+
/>
76100
`,
77101
imports: [
78102
NgtArgs,

apps/examples/src/app/soba/backdrop-cable/cable.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export class Cable {
2929
const [v1, v2] = [new Vector3(), new Vector3()];
3030

3131
injectBeforeRender(() => {
32-
const [bezierLine, start, end] = [this.bezierLine(), this.startRef()?.nativeElement, this.endRef().nativeElement];
32+
const [bezierLine, start, end] = [
33+
this.bezierLine(),
34+
this.startRef()?.nativeElement,
35+
this.endRef().nativeElement,
36+
];
3337
if (!start || !end) return;
3438
bezierLine.setPoints(start.getWorldPosition(v1), end.getWorldPosition(v2));
3539
});

apps/examples/src/app/soba/baking-soft-shadows/scene.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ export class Suzi {
8585
}"
8686
>
8787
<ngts-randomized-lights
88-
[options]="{ intensity: Math.PI, amount: 8, radius: 4, ambient: 0.5, position: [5, 5, -10], bias: 0.001 }"
88+
[options]="{
89+
intensity: Math.PI,
90+
amount: 8,
91+
radius: 4,
92+
ambient: 0.5,
93+
position: [5, 5, -10],
94+
bias: 0.001,
95+
}"
8996
/>
9097
</ngts-accumulative-shadows>
9198
</ngt-group>

0 commit comments

Comments
 (0)