hytopia 0.12.0-prerelease-5 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/scripts.js CHANGED
@@ -374,7 +374,11 @@ async function packageProject() {
374
374
  logDivider();
375
375
 
376
376
  const entryFile = path.join(sourceDir, 'index.mjs');
377
- const child = spawn(process.execPath, [entryFile], { stdio: 'pipe', shell: false, cwd: sourceDir });
377
+ const child = spawn(process.execPath, [entryFile], {
378
+ stdio: 'pipe',
379
+ shell: false,
380
+ cwd: sourceDir,
381
+ });
378
382
 
379
383
  await new Promise(resolve => {
380
384
  child.stdout.on('data', data => {
@@ -462,7 +466,7 @@ async function packageProject() {
462
466
  async function build(devMode = false) {
463
467
  let envFlags = devMode ? '' : '--minify --sourcemap=inline';
464
468
 
465
- execSync(`npx --yes bun build --target=node --env=disable --format=esm ${envFlags} --external=@fails-components/webtransport-transport-http3-quiche --outfile=index.mjs index.ts`, { stdio: 'inherit' });
469
+ execSync(`npx --yes bun build --target=node --env=disable --format=esm ${envFlags} --external=@fails-components/webtransport --external=@fails-components/webtransport-transport-http3-quiche --outfile=index.mjs index.ts`, { stdio: 'inherit' });
466
470
  }
467
471
 
468
472
  /**
@@ -367,6 +367,27 @@ The relative position of the collider to its parent rigid body.
367
367
  The relative rotation of the collider.
368
368
 
369
369
 
370
+ </td></tr>
371
+ <tr><td>
372
+
373
+ [scale](./server.collider.scale.md)
374
+
375
+
376
+ </td><td>
377
+
378
+ `readonly`
379
+
380
+
381
+ </td><td>
382
+
383
+ [Vector3Like](./server.vector3like.md)
384
+
385
+
386
+ </td><td>
387
+
388
+ The scale of the collider.
389
+
390
+
370
391
  </td></tr>
371
392
  <tr><td>
372
393
 
@@ -517,20 +538,6 @@ Creates a collider options object from a modelUri with best approximate shape an
517
538
  Removes the collider from the simulation.
518
539
 
519
540
 
520
- </td></tr>
521
- <tr><td>
522
-
523
- [scale(scalar)](./server.collider.scale.md)
524
-
525
-
526
- </td><td>
527
-
528
-
529
- </td><td>
530
-
531
- Scales the collider by the given scalar. Only ball, block, capsule, cone, cylinder, round cylinder are supported.
532
-
533
-
534
541
  </td></tr>
535
542
  <tr><td>
536
543
 
@@ -615,6 +622,34 @@ Sets the friction of the collider.
615
622
  Sets the friction combine rule of the collider.
616
623
 
617
624
 
625
+ </td></tr>
626
+ <tr><td>
627
+
628
+ [setHalfExtents(halfExtents)](./server.collider.sethalfextents.md)
629
+
630
+
631
+ </td><td>
632
+
633
+
634
+ </td><td>
635
+
636
+ Sets the half extents of a simulated block collider.
637
+
638
+
639
+ </td></tr>
640
+ <tr><td>
641
+
642
+ [setHalfHeight(halfHeight)](./server.collider.sethalfheight.md)
643
+
644
+
645
+ </td><td>
646
+
647
+
648
+ </td><td>
649
+
650
+ Sets the half height of a simulated capsule, cone, cylinder, or round cylinder collider.
651
+
652
+
618
653
  </td></tr>
619
654
  <tr><td>
620
655
 
@@ -643,6 +678,20 @@ Sets the mass of the collider.
643
678
  Sets the on collision callback for the collider.
644
679
 
645
680
 
681
+ </td></tr>
682
+ <tr><td>
683
+
684
+ [setRadius(radius)](./server.collider.setradius.md)
685
+
686
+
687
+ </td><td>
688
+
689
+
690
+ </td><td>
691
+
692
+ Sets the radius of a simulated ball, capsule, cylinder, or round cylinder collider.
693
+
694
+
646
695
  </td></tr>
647
696
  <tr><td>
648
697
 
@@ -671,6 +720,20 @@ Sets the position of the collider relative to its parent rigid body or the world
671
720
  Sets the relative rotation of the collider to its parent rigid body or the world origin.
672
721
 
673
722
 
723
+ </td></tr>
724
+ <tr><td>
725
+
726
+ [setScale(scale)](./server.collider.setscale.md)
727
+
728
+
729
+ </td><td>
730
+
731
+
732
+ </td><td>
733
+
734
+ Scales the collider by the given scalar. Only ball, block, capsule, cone, cylinder, round cylinder are supported.
735
+
736
+
674
737
  </td></tr>
675
738
  <tr><td>
676
739
 
@@ -9,7 +9,7 @@ Creates a collider options object from a modelUri with best approximate shape an
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- static optionsFromModelUri(modelUri: string, scale?: number, preferredShape?: ColliderShape): ColliderOptions;
12
+ static optionsFromModelUri(modelUri: string, scale?: Vector3Like, preferredShape?: ColliderShape): ColliderOptions;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -53,7 +53,7 @@ scale
53
53
 
54
54
  </td><td>
55
55
 
56
- number
56
+ [Vector3Like](./server.vector3like.md)
57
57
 
58
58
 
59
59
  </td><td>
@@ -2,53 +2,12 @@
2
2
 
3
3
  [Home](./index.md) &gt; [server](./server.md) &gt; [Collider](./server.collider.md) &gt; [scale](./server.collider.scale.md)
4
4
 
5
- ## Collider.scale() method
5
+ ## Collider.scale property
6
6
 
7
- Scales the collider by the given scalar. Only ball, block, capsule, cone, cylinder, round cylinder are supported.
7
+ The scale of the collider.
8
8
 
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- scale(scalar: number): void;
12
+ get scale(): Vector3Like;
13
13
  ```
14
-
15
- ## Parameters
16
-
17
- <table><thead><tr><th>
18
-
19
- Parameter
20
-
21
-
22
- </th><th>
23
-
24
- Type
25
-
26
-
27
- </th><th>
28
-
29
- Description
30
-
31
-
32
- </th></tr></thead>
33
- <tbody><tr><td>
34
-
35
- scalar
36
-
37
-
38
- </td><td>
39
-
40
- number
41
-
42
-
43
- </td><td>
44
-
45
- The scalar to scale the collider by.
46
-
47
-
48
- </td></tr>
49
- </tbody></table>
50
-
51
- **Returns:**
52
-
53
- void
54
-
@@ -0,0 +1,54 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Collider](./server.collider.md) &gt; [setHalfExtents](./server.collider.sethalfextents.md)
4
+
5
+ ## Collider.setHalfExtents() method
6
+
7
+ Sets the half extents of a simulated block collider.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ setHalfExtents(halfExtents: Vector3Like): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ halfExtents
36
+
37
+
38
+ </td><td>
39
+
40
+ [Vector3Like](./server.vector3like.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The half extents of the block collider.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
51
+ **Returns:**
52
+
53
+ void
54
+
@@ -0,0 +1,54 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Collider](./server.collider.md) &gt; [setHalfHeight](./server.collider.sethalfheight.md)
4
+
5
+ ## Collider.setHalfHeight() method
6
+
7
+ Sets the half height of a simulated capsule, cone, cylinder, or round cylinder collider.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ setHalfHeight(halfHeight: number): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ halfHeight
36
+
37
+
38
+ </td><td>
39
+
40
+ number
41
+
42
+
43
+ </td><td>
44
+
45
+ The half height of the capsule, cone, cylinder, or round cylinder collider.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
51
+ **Returns:**
52
+
53
+ void
54
+
@@ -0,0 +1,54 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Collider](./server.collider.md) &gt; [setRadius](./server.collider.setradius.md)
4
+
5
+ ## Collider.setRadius() method
6
+
7
+ Sets the radius of a simulated ball, capsule, cylinder, or round cylinder collider.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ setRadius(radius: number): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ radius
36
+
37
+
38
+ </td><td>
39
+
40
+ number
41
+
42
+
43
+ </td><td>
44
+
45
+ The radius of the collider.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
51
+ **Returns:**
52
+
53
+ void
54
+
@@ -0,0 +1,52 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Collider](./server.collider.md) &gt; [setScale](./server.collider.setscale.md)
4
+
5
+ ## Collider.setScale() method
6
+
7
+ Scales the collider by the given scalar. Only ball, block, capsule, cone, cylinder, round cylinder are supported.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ setScale(scale: Vector3Like): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ scale
36
+
37
+
38
+ </td><td>
39
+
40
+ [Vector3Like](./server.vector3like.md)
41
+
42
+
43
+ </td><td>
44
+
45
+
46
+ </td></tr>
47
+ </tbody></table>
48
+
49
+ **Returns:**
50
+
51
+ void
52
+
@@ -412,7 +412,7 @@ The preferred shape of the entity's model when automatically generating its coll
412
412
 
413
413
  </td><td>
414
414
 
415
- number
415
+ [Vector3Like](./server.vector3like.md)
416
416
 
417
417
 
418
418
  </td><td>
@@ -9,5 +9,5 @@ The scale of the entity's model.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- get modelScale(): number;
12
+ get modelScale(): Vector3Like;
13
13
  ```
@@ -9,7 +9,7 @@ Sets the scale of the entity's model and proportionally scales its colliders.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- setModelScale(modelScale: number): void;
12
+ setModelScale(modelScale: Vector3Like | number): void;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -37,12 +37,12 @@ modelScale
37
37
 
38
38
  </td><td>
39
39
 
40
- number
40
+ [Vector3Like](./server.vector3like.md) \| number
41
41
 
42
42
 
43
43
  </td><td>
44
44
 
45
- The scale of the entity's model.
45
+ The scale of the entity's model. Can be a vector or a number for uniform scaling.
46
46
 
47
47
 
48
48
  </td></tr>
@@ -11,6 +11,6 @@ Emitted when the scale of the entity's model is set.
11
11
  ```typescript
12
12
  [EntityEvent.SET_MODEL_SCALE]: {
13
13
  entity: Entity;
14
- modelScale: number;
14
+ modelScale: Vector3Like;
15
15
  };
16
16
  ```
@@ -178,7 +178,7 @@ Emitted when nodes of the entity's model are set to be hidden.
178
178
 
179
179
  </td><td>
180
180
 
181
- { entity: [Entity](./server.entity.md)<!-- -->; modelScale: number; }
181
+ { entity: [Entity](./server.entity.md)<!-- -->; modelScale: [Vector3Like](./server.vector3like.md)<!-- -->; }
182
182
 
183
183
 
184
184
  </td><td>
@@ -122,12 +122,12 @@ _(Optional)_ The preferred shape of the entity's model when automatically genera
122
122
 
123
123
  </td><td>
124
124
 
125
- number
125
+ [Vector3Like](./server.vector3like.md) \| number
126
126
 
127
127
 
128
128
  </td><td>
129
129
 
130
- _(Optional)_ The scale of the entity's model.
130
+ _(Optional)_ The scale of the entity's model. Can be a vector3 for per-axis scaling, or a number for uniform scaling.
131
131
 
132
132
 
133
133
  </td></tr>
@@ -4,10 +4,10 @@
4
4
 
5
5
  ## ModelEntityOptions.modelScale property
6
6
 
7
- The scale of the entity's model.
7
+ The scale of the entity's model. Can be a vector3 for per-axis scaling, or a number for uniform scaling.
8
8
 
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- modelScale?: number;
12
+ modelScale?: Vector3Like | number;
13
13
  ```
@@ -9,7 +9,7 @@ Retrieves the trimesh of a model.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- getTrimesh(modelUri: string, scale?: number): ModelTrimesh | undefined;
12
+ getTrimesh(modelUri: string, scale?: Vector3Like): ModelTrimesh | undefined;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -53,12 +53,12 @@ scale
53
53
 
54
54
  </td><td>
55
55
 
56
- number
56
+ [Vector3Like](./server.vector3like.md)
57
57
 
58
58
 
59
59
  </td><td>
60
60
 
61
- _(Optional)_ Optional uniform scaling to apply to the trimesh. Defaults to 1, which is no scaling.
61
+ _(Optional)_ Optional scaling to apply to the trimesh. Defaults to 1 for all axes (no scaling).
62
62
 
63
63
 
64
64
  </td></tr>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.12.0-prerelease-5",
3
+ "version": "0.12.1",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./server.mjs",
@@ -56,6 +56,7 @@
56
56
  },
57
57
  "homepage": "https://github.com/hytopiagg/sdk#readme",
58
58
  "dependencies": {
59
+ "@fails-components/webtransport": "1.4.4",
59
60
  "@fails-components/webtransport-transport-http3-quiche": "1.4.4",
60
61
  "@gltf-transform/cli": "4.2.1",
61
62
  "archiver": "7.0.1",