hytopia 0.1.52 → 0.1.54

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/server.api.json CHANGED
@@ -3011,6 +3011,56 @@
3011
3011
  "isProtected": false,
3012
3012
  "isAbstract": false
3013
3013
  },
3014
+ {
3015
+ "kind": "Method",
3016
+ "canonicalReference": "server!Block#getNeighborGlobalCoordinateFromHitPoint:member(1)",
3017
+ "docComment": "/**\n * Gets the most adjacent neighbor global coordinate of this block based on a relative hit point, typically from a raycast.\n *\n * @param hitPoint - The hit point on this block to get the neighbor coordinate from.\n *\n * @returns A neighbor global coordinate of this block based on the hit point.\n */\n",
3018
+ "excerptTokens": [
3019
+ {
3020
+ "kind": "Content",
3021
+ "text": "getNeighborGlobalCoordinateFromHitPoint(hitPoint: "
3022
+ },
3023
+ {
3024
+ "kind": "Reference",
3025
+ "text": "Vector3Like",
3026
+ "canonicalReference": "server!Vector3Like:interface"
3027
+ },
3028
+ {
3029
+ "kind": "Content",
3030
+ "text": "): "
3031
+ },
3032
+ {
3033
+ "kind": "Reference",
3034
+ "text": "Vector3Like",
3035
+ "canonicalReference": "server!Vector3Like:interface"
3036
+ },
3037
+ {
3038
+ "kind": "Content",
3039
+ "text": ";"
3040
+ }
3041
+ ],
3042
+ "isStatic": false,
3043
+ "returnTypeTokenRange": {
3044
+ "startIndex": 3,
3045
+ "endIndex": 4
3046
+ },
3047
+ "releaseTag": "Public",
3048
+ "isProtected": false,
3049
+ "overloadIndex": 1,
3050
+ "parameters": [
3051
+ {
3052
+ "parameterName": "hitPoint",
3053
+ "parameterTypeTokenRange": {
3054
+ "startIndex": 1,
3055
+ "endIndex": 2
3056
+ },
3057
+ "isOptional": false
3058
+ }
3059
+ ],
3060
+ "isOptional": false,
3061
+ "isAbstract": false,
3062
+ "name": "getNeighborGlobalCoordinateFromHitPoint"
3063
+ },
3014
3064
  {
3015
3065
  "kind": "Property",
3016
3066
  "canonicalReference": "server!Block#globalCoordinate:member",
@@ -3324,7 +3374,7 @@
3324
3374
  {
3325
3375
  "kind": "Reference",
3326
3376
  "text": "ContactForceData",
3327
- "canonicalReference": "server!~ContactForceData:type"
3377
+ "canonicalReference": "server!ContactForceData:type"
3328
3378
  },
3329
3379
  {
3330
3380
  "kind": "Content",
@@ -8434,6 +8484,103 @@
8434
8484
  "endIndex": 4
8435
8485
  }
8436
8486
  },
8487
+ {
8488
+ "kind": "TypeAlias",
8489
+ "canonicalReference": "server!ContactForceData:type",
8490
+ "docComment": "/**\n * Data for contact forces.\n *\n * @public\n */\n",
8491
+ "excerptTokens": [
8492
+ {
8493
+ "kind": "Content",
8494
+ "text": "export type ContactForceData = "
8495
+ },
8496
+ {
8497
+ "kind": "Content",
8498
+ "text": "{\n totalForce: "
8499
+ },
8500
+ {
8501
+ "kind": "Reference",
8502
+ "text": "RAPIER.Vector",
8503
+ "canonicalReference": "@dimforge/rapier3d-compat!Vector:interface"
8504
+ },
8505
+ {
8506
+ "kind": "Content",
8507
+ "text": ";\n totalForceMagnitude: number;\n maxForceDirection: "
8508
+ },
8509
+ {
8510
+ "kind": "Reference",
8511
+ "text": "RAPIER.Vector",
8512
+ "canonicalReference": "@dimforge/rapier3d-compat!Vector:interface"
8513
+ },
8514
+ {
8515
+ "kind": "Content",
8516
+ "text": ";\n maxForceMagnitude: number;\n}"
8517
+ },
8518
+ {
8519
+ "kind": "Content",
8520
+ "text": ";"
8521
+ }
8522
+ ],
8523
+ "fileUrlPath": "src/world/physics/Simulation.ts",
8524
+ "releaseTag": "Public",
8525
+ "name": "ContactForceData",
8526
+ "typeTokenRange": {
8527
+ "startIndex": 1,
8528
+ "endIndex": 6
8529
+ }
8530
+ },
8531
+ {
8532
+ "kind": "TypeAlias",
8533
+ "canonicalReference": "server!ContactManifold:type",
8534
+ "docComment": "/**\n * A contact manifold.\n *\n * @public\n */\n",
8535
+ "excerptTokens": [
8536
+ {
8537
+ "kind": "Content",
8538
+ "text": "export type ContactManifold = "
8539
+ },
8540
+ {
8541
+ "kind": "Content",
8542
+ "text": "{\n localNormalA: "
8543
+ },
8544
+ {
8545
+ "kind": "Reference",
8546
+ "text": "Vector3Like",
8547
+ "canonicalReference": "server!Vector3Like:interface"
8548
+ },
8549
+ {
8550
+ "kind": "Content",
8551
+ "text": ";\n localNormalB: "
8552
+ },
8553
+ {
8554
+ "kind": "Reference",
8555
+ "text": "Vector3Like",
8556
+ "canonicalReference": "server!Vector3Like:interface"
8557
+ },
8558
+ {
8559
+ "kind": "Content",
8560
+ "text": ";\n normal: "
8561
+ },
8562
+ {
8563
+ "kind": "Reference",
8564
+ "text": "Vector3Like",
8565
+ "canonicalReference": "server!Vector3Like:interface"
8566
+ },
8567
+ {
8568
+ "kind": "Content",
8569
+ "text": ";\n}"
8570
+ },
8571
+ {
8572
+ "kind": "Content",
8573
+ "text": ";"
8574
+ }
8575
+ ],
8576
+ "fileUrlPath": "src/world/physics/Simulation.ts",
8577
+ "releaseTag": "Public",
8578
+ "name": "ContactManifold",
8579
+ "typeTokenRange": {
8580
+ "startIndex": 1,
8581
+ "endIndex": 8
8582
+ }
8583
+ },
8437
8584
  {
8438
8585
  "kind": "TypeAlias",
8439
8586
  "canonicalReference": "server!DecodedCollisionGroups:type",
@@ -9812,7 +9959,7 @@
9812
9959
  {
9813
9960
  "kind": "Reference",
9814
9961
  "text": "ContactForceData",
9815
- "canonicalReference": "server!~ContactForceData:type"
9962
+ "canonicalReference": "server!ContactForceData:type"
9816
9963
  },
9817
9964
  {
9818
9965
  "kind": "Content",
@@ -9974,7 +10121,7 @@
9974
10121
  {
9975
10122
  "kind": "Reference",
9976
10123
  "text": "ContactForceData",
9977
- "canonicalReference": "server!~ContactForceData:type"
10124
+ "canonicalReference": "server!ContactForceData:type"
9978
10125
  },
9979
10126
  {
9980
10127
  "kind": "Content",
@@ -13232,50 +13379,6 @@
13232
13379
  "isProtected": false,
13233
13380
  "isAbstract": false
13234
13381
  },
13235
- {
13236
- "kind": "Property",
13237
- "canonicalReference": "server!Player#cameraOrientation:member",
13238
- "docComment": "/**\n * The current {@link PlayerCameraOrientation} of the player.\n */\n",
13239
- "excerptTokens": [
13240
- {
13241
- "kind": "Content",
13242
- "text": "get cameraOrientation(): "
13243
- },
13244
- {
13245
- "kind": "Reference",
13246
- "text": "Readonly",
13247
- "canonicalReference": "!Readonly:type"
13248
- },
13249
- {
13250
- "kind": "Content",
13251
- "text": "<"
13252
- },
13253
- {
13254
- "kind": "Reference",
13255
- "text": "PlayerCameraOrientation",
13256
- "canonicalReference": "server!PlayerCameraOrientation:type"
13257
- },
13258
- {
13259
- "kind": "Content",
13260
- "text": ">"
13261
- },
13262
- {
13263
- "kind": "Content",
13264
- "text": ";"
13265
- }
13266
- ],
13267
- "isReadonly": true,
13268
- "isOptional": false,
13269
- "releaseTag": "Public",
13270
- "name": "cameraOrientation",
13271
- "propertyTypeTokenRange": {
13272
- "startIndex": 1,
13273
- "endIndex": 5
13274
- },
13275
- "isStatic": false,
13276
- "isProtected": false,
13277
- "isAbstract": false
13278
- },
13279
13382
  {
13280
13383
  "kind": "Method",
13281
13384
  "canonicalReference": "server!Player#disconnect:member(1)",
@@ -13655,6 +13758,37 @@
13655
13758
  "isProtected": false,
13656
13759
  "isAbstract": false
13657
13760
  },
13761
+ {
13762
+ "kind": "Property",
13763
+ "canonicalReference": "server!PlayerCamera#facingDirection:member",
13764
+ "docComment": "/**\n * The facing direction vector of the camera based on its current orientation.\n */\n",
13765
+ "excerptTokens": [
13766
+ {
13767
+ "kind": "Content",
13768
+ "text": "get facingDirection(): "
13769
+ },
13770
+ {
13771
+ "kind": "Reference",
13772
+ "text": "Vector3Like",
13773
+ "canonicalReference": "server!Vector3Like:interface"
13774
+ },
13775
+ {
13776
+ "kind": "Content",
13777
+ "text": ";"
13778
+ }
13779
+ ],
13780
+ "isReadonly": true,
13781
+ "isOptional": false,
13782
+ "releaseTag": "Public",
13783
+ "name": "facingDirection",
13784
+ "propertyTypeTokenRange": {
13785
+ "startIndex": 1,
13786
+ "endIndex": 2
13787
+ },
13788
+ "isStatic": false,
13789
+ "isProtected": false,
13790
+ "isAbstract": false
13791
+ },
13658
13792
  {
13659
13793
  "kind": "Property",
13660
13794
  "canonicalReference": "server!PlayerCamera#filmOffset:member",
@@ -13940,6 +14074,37 @@
13940
14074
  "isProtected": false,
13941
14075
  "isAbstract": false
13942
14076
  },
14077
+ {
14078
+ "kind": "Property",
14079
+ "canonicalReference": "server!PlayerCamera#orientation:member",
14080
+ "docComment": "/**\n * The current orientation of the camera.\n */\n",
14081
+ "excerptTokens": [
14082
+ {
14083
+ "kind": "Content",
14084
+ "text": "get orientation(): "
14085
+ },
14086
+ {
14087
+ "kind": "Reference",
14088
+ "text": "PlayerCameraOrientation",
14089
+ "canonicalReference": "server!PlayerCameraOrientation:type"
14090
+ },
14091
+ {
14092
+ "kind": "Content",
14093
+ "text": ";"
14094
+ }
14095
+ ],
14096
+ "isReadonly": true,
14097
+ "isOptional": false,
14098
+ "releaseTag": "Public",
14099
+ "name": "orientation",
14100
+ "propertyTypeTokenRange": {
14101
+ "startIndex": 1,
14102
+ "endIndex": 2
14103
+ },
14104
+ "isStatic": false,
14105
+ "isProtected": false,
14106
+ "isAbstract": false
14107
+ },
13943
14108
  {
13944
14109
  "kind": "Property",
13945
14110
  "canonicalReference": "server!PlayerCamera#player:member",
@@ -15888,7 +16053,7 @@
15888
16053
  {
15889
16054
  "kind": "Enum",
15890
16055
  "canonicalReference": "server!PlayerCameraMode:enum",
15891
- "docComment": "",
16056
+ "docComment": "/**\n * The mode of the camera.\n *\n * @public\n */\n",
15892
16057
  "excerptTokens": [
15893
16058
  {
15894
16059
  "kind": "Content",
@@ -15962,7 +16127,7 @@
15962
16127
  "text": ";"
15963
16128
  }
15964
16129
  ],
15965
- "fileUrlPath": "src/networking/players/Player.ts",
16130
+ "fileUrlPath": "src/networking/players/PlayerCamera.ts",
15966
16131
  "releaseTag": "Public",
15967
16132
  "name": "PlayerCameraOrientation",
15968
16133
  "typeTokenRange": {
@@ -17099,7 +17264,7 @@
17099
17264
  {
17100
17265
  "kind": "Enum",
17101
17266
  "canonicalReference": "server!PlayerUIEventType:enum",
17102
- "docComment": "/**\n * Event types a\n */\n",
17267
+ "docComment": "/**\n * Event types a PlayerUI can emit.\n *\n * @public\n */\n",
17103
17268
  "excerptTokens": [
17104
17269
  {
17105
17270
  "kind": "Content",
@@ -18583,6 +18748,121 @@
18583
18748
  "endIndex": 2
18584
18749
  }
18585
18750
  },
18751
+ {
18752
+ "kind": "TypeAlias",
18753
+ "canonicalReference": "server!RaycastHit:type",
18754
+ "docComment": "/**\n * A hit result from a raycast.\n *\n * @public\n */\n",
18755
+ "excerptTokens": [
18756
+ {
18757
+ "kind": "Content",
18758
+ "text": "export type RaycastHit = "
18759
+ },
18760
+ {
18761
+ "kind": "Content",
18762
+ "text": "{\n hitBlock?: "
18763
+ },
18764
+ {
18765
+ "kind": "Reference",
18766
+ "text": "Block",
18767
+ "canonicalReference": "server!Block:class"
18768
+ },
18769
+ {
18770
+ "kind": "Content",
18771
+ "text": ";\n hitEntity?: "
18772
+ },
18773
+ {
18774
+ "kind": "Reference",
18775
+ "text": "Entity",
18776
+ "canonicalReference": "server!Entity:class"
18777
+ },
18778
+ {
18779
+ "kind": "Content",
18780
+ "text": ";\n hitPoint: "
18781
+ },
18782
+ {
18783
+ "kind": "Reference",
18784
+ "text": "Vector3Like",
18785
+ "canonicalReference": "server!Vector3Like:interface"
18786
+ },
18787
+ {
18788
+ "kind": "Content",
18789
+ "text": ";\n hitDistance: number;\n}"
18790
+ },
18791
+ {
18792
+ "kind": "Content",
18793
+ "text": ";"
18794
+ }
18795
+ ],
18796
+ "fileUrlPath": "src/world/physics/Simulation.ts",
18797
+ "releaseTag": "Public",
18798
+ "name": "RaycastHit",
18799
+ "typeTokenRange": {
18800
+ "startIndex": 1,
18801
+ "endIndex": 8
18802
+ }
18803
+ },
18804
+ {
18805
+ "kind": "TypeAlias",
18806
+ "canonicalReference": "server!RaycastOptions:type",
18807
+ "docComment": "/**\n * Options for raycasting.\n *\n * @public\n */\n",
18808
+ "excerptTokens": [
18809
+ {
18810
+ "kind": "Content",
18811
+ "text": "export type RaycastOptions = "
18812
+ },
18813
+ {
18814
+ "kind": "Content",
18815
+ "text": "{\n ignoresSensors?: boolean;\n filterFlags?: "
18816
+ },
18817
+ {
18818
+ "kind": "Reference",
18819
+ "text": "RAPIER.QueryFilterFlags",
18820
+ "canonicalReference": "@dimforge/rapier3d-compat!QueryFilterFlags:enum"
18821
+ },
18822
+ {
18823
+ "kind": "Content",
18824
+ "text": ";\n filterGroups?: number;\n filterExcludeCollider?: "
18825
+ },
18826
+ {
18827
+ "kind": "Reference",
18828
+ "text": "RAPIER.Collider",
18829
+ "canonicalReference": "@dimforge/rapier3d-compat!Collider:class"
18830
+ },
18831
+ {
18832
+ "kind": "Content",
18833
+ "text": ";\n filterExcludeRigidBody?: "
18834
+ },
18835
+ {
18836
+ "kind": "Reference",
18837
+ "text": "RAPIER.RigidBody",
18838
+ "canonicalReference": "@dimforge/rapier3d-compat!RigidBody:class"
18839
+ },
18840
+ {
18841
+ "kind": "Content",
18842
+ "text": ";\n filterPredicate?: (collider: "
18843
+ },
18844
+ {
18845
+ "kind": "Reference",
18846
+ "text": "RAPIER.Collider",
18847
+ "canonicalReference": "@dimforge/rapier3d-compat!Collider:class"
18848
+ },
18849
+ {
18850
+ "kind": "Content",
18851
+ "text": ") => boolean;\n}"
18852
+ },
18853
+ {
18854
+ "kind": "Content",
18855
+ "text": ";"
18856
+ }
18857
+ ],
18858
+ "fileUrlPath": "src/world/physics/Simulation.ts",
18859
+ "releaseTag": "Public",
18860
+ "name": "RaycastOptions",
18861
+ "typeTokenRange": {
18862
+ "startIndex": 1,
18863
+ "endIndex": 10
18864
+ }
18865
+ },
18586
18866
  {
18587
18867
  "kind": "Interface",
18588
18868
  "canonicalReference": "server!RgbColor:interface",
@@ -22811,7 +23091,7 @@
22811
23091
  {
22812
23092
  "kind": "Reference",
22813
23093
  "text": "ContactManifold",
22814
- "canonicalReference": "server!~ContactManifold:type"
23094
+ "canonicalReference": "server!ContactManifold:type"
22815
23095
  },
22816
23096
  {
22817
23097
  "kind": "Content",
@@ -22981,7 +23261,7 @@
22981
23261
  {
22982
23262
  "kind": "Reference",
22983
23263
  "text": "RaycastOptions",
22984
- "canonicalReference": "server!~RaycastOptions:type"
23264
+ "canonicalReference": "server!RaycastOptions:type"
22985
23265
  },
22986
23266
  {
22987
23267
  "kind": "Content",
@@ -22990,7 +23270,7 @@
22990
23270
  {
22991
23271
  "kind": "Reference",
22992
23272
  "text": "RaycastHit",
22993
- "canonicalReference": "server!~RaycastHit:type"
23273
+ "canonicalReference": "server!RaycastHit:type"
22994
23274
  },
22995
23275
  {
22996
23276
  "kind": "Content",
package/server.d.ts CHANGED
@@ -348,6 +348,14 @@ export declare class Block {
348
348
  readonly blockType: BlockType;
349
349
 
350
350
 
351
+ /**
352
+ * Gets the most adjacent neighbor global coordinate of this block
353
+ * based on a relative hit point, typically from a raycast.
354
+ *
355
+ * @param hitPoint - The hit point on this block to get the neighbor coordinate from.
356
+ * @returns A neighbor global coordinate of this block based on the hit point.
357
+ */
358
+ getNeighborGlobalCoordinateFromHitPoint(hitPoint: Vector3Like): Vector3Like;
351
359
  }
352
360
 
353
361
  /**
@@ -1121,7 +1129,7 @@ export declare class CollisionGroupsBuilder {
1121
1129
  export declare type CommandCallback = (player: Player, args: string[], message: string) => void;
1122
1130
 
1123
1131
  /** Data for contact forces. @public */
1124
- declare type ContactForceData = {
1132
+ export declare type ContactForceData = {
1125
1133
  /** The total force vector. */
1126
1134
  totalForce: RAPIER.Vector;
1127
1135
  /** The magnitude of the total force. */
@@ -1133,7 +1141,7 @@ declare type ContactForceData = {
1133
1141
  };
1134
1142
 
1135
1143
  /** A contact manifold. @public */
1136
- declare type ContactManifold = {
1144
+ export declare type ContactManifold = {
1137
1145
  /** The local normal vector of the first collider. */
1138
1146
  localNormalA: Vector3Like;
1139
1147
  /** The local normal vector of the second collider. */
@@ -1820,11 +1828,8 @@ export declare class Player {
1820
1828
 
1821
1829
 
1822
1830
 
1823
-
1824
1831
  /** The current {@link PlayerInput} of the player. */
1825
1832
  get input(): Readonly<PlayerInput>;
1826
- /** The current {@link PlayerCameraOrientation} of the player. */
1827
- get cameraOrientation(): Readonly<PlayerCameraOrientation>;
1828
1833
  /** The current {@link World} the player is in. */
1829
1834
  get world(): World | undefined;
1830
1835
  /**
@@ -1884,10 +1889,13 @@ export declare class PlayerCamera implements protocol.Serializable {
1884
1889
 
1885
1890
 
1886
1891
 
1892
+
1887
1893
  /** The entity the camera is attached to. */
1888
1894
  get attachedToEntity(): Entity | undefined;
1889
1895
  /** The position the camera is attached to. */
1890
1896
  get attachedToPosition(): Vector3Like | undefined;
1897
+ /** The facing direction vector of the camera based on its current orientation. */
1898
+ get facingDirection(): Vector3Like;
1891
1899
  /** The film offset of the camera. A positive value shifts the camera right, a negative value shifts it left. */
1892
1900
  get filmOffset(): number;
1893
1901
  /** Only used in first-person mode. The forward offset of the camera. A positive number shifts the camera forward, a negative number shifts it backward. */
@@ -1900,6 +1908,8 @@ export declare class PlayerCamera implements protocol.Serializable {
1900
1908
  get mode(): PlayerCameraMode;
1901
1909
  /** The relative offset of the camera from the entity or position it is attached to. */
1902
1910
  get offset(): Vector3Like;
1911
+ /** The current orientation of the camera. */
1912
+ get orientation(): PlayerCameraOrientation;
1903
1913
  /** The entity the camera will constantly look at, even if the camera attached or tracked entity moves. */
1904
1914
  get trackedEntity(): Entity | undefined;
1905
1915
  /** The position the camera will constantly look at, even if the camera attached entity moves. */
@@ -1966,6 +1976,8 @@ export declare class PlayerCamera implements protocol.Serializable {
1966
1976
  * @param offset - The offset to set.
1967
1977
  */
1968
1978
  setOffset(offset: Vector3Like): void;
1979
+
1980
+
1969
1981
  /**
1970
1982
  * Sets the entity the camera will constantly look at,
1971
1983
  * even if the camera attached or tracked entity moves.
@@ -2060,6 +2072,7 @@ export declare enum PlayerCameraEventType {
2060
2072
  SET_ZOOM = "PLAYER_CAMERA.SET_ZOOM"
2061
2073
  }
2062
2074
 
2075
+ /** The mode of the camera. @public */
2063
2076
  export declare enum PlayerCameraMode {
2064
2077
  FIRST_PERSON = 0,
2065
2078
  THIRD_PERSON = 1
@@ -2239,7 +2252,7 @@ export declare namespace PlayerUIEventPayload {
2239
2252
  }
2240
2253
  }
2241
2254
 
2242
- /** Event types a */
2255
+ /** Event types a PlayerUI can emit. @public */
2243
2256
  export declare enum PlayerUIEventType {
2244
2257
  LOAD = "PLAYER_UI.LOAD",
2245
2258
  SEND_DATA = "PLAYER_UI.SEND_DATA"
@@ -2433,9 +2446,12 @@ export declare interface QuaternionLike {
2433
2446
  /** A raw set of collision groups represented as a 32-bit number. @public */
2434
2447
  export declare type RawCollisionGroups = RAPIER.InteractionGroups;
2435
2448
 
2436
- declare type RaycastHit = {
2437
- /** The block or entity the raycast hit. */
2438
- hitObject: Block | Entity;
2449
+ /** A hit result from a raycast. @public */
2450
+ export declare type RaycastHit = {
2451
+ /** The block the raycast hit. */
2452
+ hitBlock?: Block;
2453
+ /** The entity the raycast hit */
2454
+ hitEntity?: Entity;
2439
2455
  /** The point in global coordinate space the raycast hit the object. */
2440
2456
  hitPoint: Vector3Like;
2441
2457
  /** The distance from origin where the raycast hit. */
@@ -2443,7 +2459,7 @@ declare type RaycastHit = {
2443
2459
  };
2444
2460
 
2445
2461
  /** Options for raycasting. @public */
2446
- declare type RaycastOptions = {
2462
+ export declare type RaycastOptions = {
2447
2463
  /** Whether to ignore sensor colliders. */
2448
2464
  ignoresSensors?: boolean;
2449
2465
  /** The query filter flags. */