hytopia 0.2.0 → 0.2.2

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.
Files changed (50) hide show
  1. package/docs/server.quaternion.identity.md +19 -0
  2. package/docs/server.quaternion.length.md +13 -0
  3. package/docs/server.quaternion.logarithm.md +19 -0
  4. package/docs/server.quaternion.magnitude.md +1 -1
  5. package/docs/server.quaternion.md +114 -2
  6. package/docs/server.quaternion.power.md +55 -0
  7. package/docs/server.quaternion.randomize.md +19 -0
  8. package/docs/server.quaternion.setaxisangle.md +71 -0
  9. package/docs/server.quaternion.squaredlength.md +13 -0
  10. package/docs/server.quaternion.squaredmagnitude.md +1 -1
  11. package/docs/server.vector3.create.md +19 -0
  12. package/docs/server.vector3.length.md +13 -0
  13. package/docs/server.vector3.magnitude.md +1 -1
  14. package/docs/server.vector3.md +144 -2
  15. package/docs/server.vector3.randomize.md +55 -0
  16. package/docs/server.vector3.scaleandadd.md +71 -0
  17. package/docs/server.vector3.squaredlength.md +13 -0
  18. package/docs/server.vector3.squaredmagnitude.md +1 -1
  19. package/docs/server.vector3.transformmatrix3.md +55 -0
  20. package/docs/server.vector3.transformmatrix4.md +55 -0
  21. package/docs/server.vector3.transformquaternion.md +55 -0
  22. package/docs/server.vector3.zero.md +19 -0
  23. package/examples/hole-in-wall-game/index.ts +4 -4
  24. package/examples/wall-dodge-game/assets/audio/bgm.mp3 +0 -0
  25. package/examples/wall-dodge-game/index.ts +7 -0
  26. package/examples/zombies-fps/assets/ui/index.html +7 -1
  27. package/examples/zombies-fps/classes/EnemyEntity.ts +5 -3
  28. package/examples/zombies-fps/classes/GameManager.ts +112 -18
  29. package/examples/zombies-fps/classes/GamePlayerEntity.ts +11 -1
  30. package/examples/zombies-fps/classes/GunEntity.ts +13 -13
  31. package/examples/zombies-fps/classes/PurchaseBarrierEntity.ts +1 -0
  32. package/examples/zombies-fps/index.ts +2 -7
  33. package/package.json +1 -1
  34. package/server.api.json +678 -18
  35. package/server.d.ts +535 -4
  36. package/server.js +51 -51
  37. package/examples/ai-agents/bun.lockb +0 -0
  38. package/examples/big-world/bun.lockb +0 -0
  39. package/examples/block-entity/bun.lockb +0 -0
  40. package/examples/child-entity/bun.lockb +0 -0
  41. package/examples/child-entity/package-lock.json +0 -30
  42. package/examples/custom-ui/bun.lockb +0 -0
  43. package/examples/entity-controller/bun.lockb +0 -0
  44. package/examples/entity-spawn/bun.lockb +0 -0
  45. package/examples/hole-in-wall-game/bun.lockb +0 -0
  46. package/examples/lighting/bun.lockb +0 -0
  47. package/examples/pathfinding/bun.lockb +0 -0
  48. package/examples/payload-game/bun.lockb +0 -0
  49. package/examples/wall-dodge-game/bun.lockb +0 -0
  50. package/examples/zombies-fps/bun.lockb +0 -0
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Quaternion](./server.quaternion.md) &gt; [identity](./server.quaternion.identity.md)
4
+
5
+ ## Quaternion.identity() method
6
+
7
+ Sets the current quaternion to the identity quaternion.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ identity(): Quaternion;
13
+ ```
14
+ **Returns:**
15
+
16
+ [Quaternion](./server.quaternion.md)
17
+
18
+ The current quaternion.
19
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Quaternion](./server.quaternion.md) &gt; [length](./server.quaternion.length.md)
4
+
5
+ ## Quaternion.length property
6
+
7
+ The length of the quaternion.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ get length(): number;
13
+ ```
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Quaternion](./server.quaternion.md) &gt; [logarithm](./server.quaternion.logarithm.md)
4
+
5
+ ## Quaternion.logarithm() method
6
+
7
+ Sets the current quaternion to its natural logarithm.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ logarithm(): Quaternion;
13
+ ```
14
+ **Returns:**
15
+
16
+ [Quaternion](./server.quaternion.md)
17
+
18
+ The current quaternion.
19
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Quaternion.magnitude property
6
6
 
7
- The magnitude of the quaternion. Also known as the length.
7
+ The magnitude of the quaternion. Alias for `.length`<!-- -->.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -78,6 +78,27 @@ Description
78
78
  </th></tr></thead>
79
79
  <tbody><tr><td>
80
80
 
81
+ [length](./server.quaternion.length.md)
82
+
83
+
84
+ </td><td>
85
+
86
+ `readonly`
87
+
88
+
89
+ </td><td>
90
+
91
+ number
92
+
93
+
94
+ </td><td>
95
+
96
+ The length of the quaternion.
97
+
98
+
99
+ </td></tr>
100
+ <tr><td>
101
+
81
102
  [magnitude](./server.quaternion.magnitude.md)
82
103
 
83
104
 
@@ -93,7 +114,28 @@ number
93
114
 
94
115
  </td><td>
95
116
 
96
- The magnitude of the quaternion. Also known as the length.
117
+ The magnitude of the quaternion. Alias for `.length`<!-- -->.
118
+
119
+
120
+ </td></tr>
121
+ <tr><td>
122
+
123
+ [squaredLength](./server.quaternion.squaredlength.md)
124
+
125
+
126
+ </td><td>
127
+
128
+ `readonly`
129
+
130
+
131
+ </td><td>
132
+
133
+ number
134
+
135
+
136
+ </td><td>
137
+
138
+ The squared length of the quaternion.
97
139
 
98
140
 
99
141
  </td></tr>
@@ -114,7 +156,7 @@ number
114
156
 
115
157
  </td><td>
116
158
 
117
- The squared magnitude of the quaternion. Also known as the squared length.
159
+ The squared magnitude of the quaternion. Alias for `.squaredLength`<!-- -->.
118
160
 
119
161
 
120
162
  </td></tr>
@@ -357,6 +399,20 @@ Creates a quaternion from a `QuaternionLike` object.
357
399
  Calculates and returns the angle between the current quaternion and another quaternion.
358
400
 
359
401
 
402
+ </td></tr>
403
+ <tr><td>
404
+
405
+ [identity()](./server.quaternion.identity.md)
406
+
407
+
408
+ </td><td>
409
+
410
+
411
+ </td><td>
412
+
413
+ Sets the current quaternion to the identity quaternion.
414
+
415
+
360
416
  </td></tr>
361
417
  <tr><td>
362
418
 
@@ -385,6 +441,20 @@ Inverts each component of the quaternion.
385
441
  Linearly interpolates between the current quaternion and another quaternion.
386
442
 
387
443
 
444
+ </td></tr>
445
+ <tr><td>
446
+
447
+ [logarithm()](./server.quaternion.logarithm.md)
448
+
449
+
450
+ </td><td>
451
+
452
+
453
+ </td><td>
454
+
455
+ Sets the current quaternion to its natural logarithm.
456
+
457
+
388
458
  </td></tr>
389
459
  <tr><td>
390
460
 
@@ -413,6 +483,34 @@ Multiplies the quaternion by another quaternion.
413
483
  Normalizes the quaternion.
414
484
 
415
485
 
486
+ </td></tr>
487
+ <tr><td>
488
+
489
+ [power(exponent)](./server.quaternion.power.md)
490
+
491
+
492
+ </td><td>
493
+
494
+
495
+ </td><td>
496
+
497
+ Raises the current quaternion to a power.
498
+
499
+
500
+ </td></tr>
501
+ <tr><td>
502
+
503
+ [randomize()](./server.quaternion.randomize.md)
504
+
505
+
506
+ </td><td>
507
+
508
+
509
+ </td><td>
510
+
511
+ Randomizes the current quaternion.
512
+
513
+
416
514
  </td></tr>
417
515
  <tr><td>
418
516
 
@@ -469,6 +567,20 @@ Rotates the quaternion around the z-axis.
469
567
  Scales the quaternion by a scalar value.
470
568
 
471
569
 
570
+ </td></tr>
571
+ <tr><td>
572
+
573
+ [setAxisAngle(axis, angle)](./server.quaternion.setaxisangle.md)
574
+
575
+
576
+ </td><td>
577
+
578
+
579
+ </td><td>
580
+
581
+ Sets the current quaternion to the angle and rotation axis.
582
+
583
+
472
584
  </td></tr>
473
585
  <tr><td>
474
586
 
@@ -0,0 +1,55 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Quaternion](./server.quaternion.md) &gt; [power](./server.quaternion.power.md)
4
+
5
+ ## Quaternion.power() method
6
+
7
+ Raises the current quaternion to a power.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ power(exponent: number): Quaternion;
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
+ exponent
36
+
37
+
38
+ </td><td>
39
+
40
+ number
41
+
42
+
43
+ </td><td>
44
+
45
+ The exponent to raise the quaternion to.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ [Quaternion](./server.quaternion.md)
53
+
54
+ The current quaternion.
55
+
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Quaternion](./server.quaternion.md) &gt; [randomize](./server.quaternion.randomize.md)
4
+
5
+ ## Quaternion.randomize() method
6
+
7
+ Randomizes the current quaternion.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ randomize(): Quaternion;
13
+ ```
14
+ **Returns:**
15
+
16
+ [Quaternion](./server.quaternion.md)
17
+
18
+ The current quaternion.
19
+
@@ -0,0 +1,71 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Quaternion](./server.quaternion.md) &gt; [setAxisAngle](./server.quaternion.setaxisangle.md)
4
+
5
+ ## Quaternion.setAxisAngle() method
6
+
7
+ Sets the current quaternion to the angle and rotation axis.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ setAxisAngle(axis: Vector3, angle: number): Quaternion;
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
+ axis
36
+
37
+
38
+ </td><td>
39
+
40
+ [Vector3](./server.vector3.md)
41
+
42
+
43
+ </td><td>
44
+
45
+ The axis to rotate around.
46
+
47
+
48
+ </td></tr>
49
+ <tr><td>
50
+
51
+ angle
52
+
53
+
54
+ </td><td>
55
+
56
+ number
57
+
58
+
59
+ </td><td>
60
+
61
+ The angle to rotate in radians.
62
+
63
+
64
+ </td></tr>
65
+ </tbody></table>
66
+ **Returns:**
67
+
68
+ [Quaternion](./server.quaternion.md)
69
+
70
+ The current quaternion.
71
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Quaternion](./server.quaternion.md) &gt; [squaredLength](./server.quaternion.squaredlength.md)
4
+
5
+ ## Quaternion.squaredLength property
6
+
7
+ The squared length of the quaternion.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ get squaredLength(): number;
13
+ ```
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Quaternion.squaredMagnitude property
6
6
 
7
- The squared magnitude of the quaternion. Also known as the squared length.
7
+ The squared magnitude of the quaternion. Alias for `.squaredLength`<!-- -->.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -0,0 +1,19 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Vector3](./server.vector3.md) &gt; [create](./server.vector3.create.md)
4
+
5
+ ## Vector3.create() method
6
+
7
+ Creates a new `Vector3` instance.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ static create(): Vector3;
13
+ ```
14
+ **Returns:**
15
+
16
+ [Vector3](./server.vector3.md)
17
+
18
+ A new `Vector3` instance.
19
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Vector3](./server.vector3.md) &gt; [length](./server.vector3.length.md)
4
+
5
+ ## Vector3.length property
6
+
7
+ The length of the vector.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ get length(): number;
13
+ ```
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Vector3.magnitude property
6
6
 
7
- The magnitude of the vector. Also known as the length.
7
+ The magnitude of the vector. Alias for `length`<!-- -->.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -78,6 +78,27 @@ Description
78
78
  </th></tr></thead>
79
79
  <tbody><tr><td>
80
80
 
81
+ [length](./server.vector3.length.md)
82
+
83
+
84
+ </td><td>
85
+
86
+ `readonly`
87
+
88
+
89
+ </td><td>
90
+
91
+ number
92
+
93
+
94
+ </td><td>
95
+
96
+ The length of the vector.
97
+
98
+
99
+ </td></tr>
100
+ <tr><td>
101
+
81
102
  [magnitude](./server.vector3.magnitude.md)
82
103
 
83
104
 
@@ -93,7 +114,28 @@ number
93
114
 
94
115
  </td><td>
95
116
 
96
- The magnitude of the vector. Also known as the length.
117
+ The magnitude of the vector. Alias for `length`<!-- -->.
118
+
119
+
120
+ </td></tr>
121
+ <tr><td>
122
+
123
+ [squaredLength](./server.vector3.squaredlength.md)
124
+
125
+
126
+ </td><td>
127
+
128
+ `readonly`
129
+
130
+
131
+ </td><td>
132
+
133
+ number
134
+
135
+
136
+ </td><td>
137
+
138
+ The squared length of the vector.
97
139
 
98
140
 
99
141
  </td></tr>
@@ -114,7 +156,7 @@ number
114
156
 
115
157
  </td><td>
116
158
 
117
- The squared magnitude of the vector. Also known as the squared length.
159
+ The squared magnitude of the vector. Alias for `squaredLength`<!-- -->.
118
160
 
119
161
 
120
162
  </td></tr>
@@ -250,6 +292,22 @@ Returns a new vector with the same components as the current vector.
250
292
  Copies the components of a vector to the current vector.
251
293
 
252
294
 
295
+ </td></tr>
296
+ <tr><td>
297
+
298
+ [create()](./server.vector3.create.md)
299
+
300
+
301
+ </td><td>
302
+
303
+ `static`
304
+
305
+
306
+ </td><td>
307
+
308
+ Creates a new `Vector3` instance.
309
+
310
+
253
311
  </td></tr>
254
312
  <tr><td>
255
313
 
@@ -448,6 +506,20 @@ Negates each component of the vector.
448
506
  Normalizes the vector.
449
507
 
450
508
 
509
+ </td></tr>
510
+ <tr><td>
511
+
512
+ [randomize(scale)](./server.vector3.randomize.md)
513
+
514
+
515
+ </td><td>
516
+
517
+
518
+ </td><td>
519
+
520
+ Randomizes the vector.
521
+
522
+
451
523
  </td></tr>
452
524
  <tr><td>
453
525
 
@@ -518,6 +590,20 @@ Rounds each component of the vector to the nearest integer.
518
590
  Scales each component of the vector by a scalar value.
519
591
 
520
592
 
593
+ </td></tr>
594
+ <tr><td>
595
+
596
+ [scaleAndAdd(vector3, scale)](./server.vector3.scaleandadd.md)
597
+
598
+
599
+ </td><td>
600
+
601
+
602
+ </td><td>
603
+
604
+ Adds 2 vectors together after scaling the provided vector by a scalar value.
605
+
606
+
521
607
  </td></tr>
522
608
  <tr><td>
523
609
 
@@ -546,5 +632,61 @@ Subtracts a vector from the current vector.
546
632
  Returns a string representation of the vector in x,y,z format.
547
633
 
548
634
 
635
+ </td></tr>
636
+ <tr><td>
637
+
638
+ [transformMatrix3(matrix3)](./server.vector3.transformmatrix3.md)
639
+
640
+
641
+ </td><td>
642
+
643
+
644
+ </td><td>
645
+
646
+ Transforms the vector by a matrix3.
647
+
648
+
649
+ </td></tr>
650
+ <tr><td>
651
+
652
+ [transformMatrix4(matrix4)](./server.vector3.transformmatrix4.md)
653
+
654
+
655
+ </td><td>
656
+
657
+
658
+ </td><td>
659
+
660
+ Transforms the vector by a matrix4.
661
+
662
+
663
+ </td></tr>
664
+ <tr><td>
665
+
666
+ [transformQuaternion(quaternion)](./server.vector3.transformquaternion.md)
667
+
668
+
669
+ </td><td>
670
+
671
+
672
+ </td><td>
673
+
674
+ Transforms the vector by a quaternion.
675
+
676
+
677
+ </td></tr>
678
+ <tr><td>
679
+
680
+ [zero()](./server.vector3.zero.md)
681
+
682
+
683
+ </td><td>
684
+
685
+
686
+ </td><td>
687
+
688
+ Sets each component of the vector to zero.
689
+
690
+
549
691
  </td></tr>
550
692
  </tbody></table>
@@ -0,0 +1,55 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Vector3](./server.vector3.md) &gt; [randomize](./server.vector3.randomize.md)
4
+
5
+ ## Vector3.randomize() method
6
+
7
+ Randomizes the vector.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ randomize(scale?: number): Vector3;
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
+ number
41
+
42
+
43
+ </td><td>
44
+
45
+ _(Optional)_ Length of the resulting vector, if omitted a unit vector is set.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ [Vector3](./server.vector3.md)
53
+
54
+ The current vector.
55
+