hytopia 0.1.49 → 0.1.50
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 +1 -1
- package/docs/server.basecharactercontroller.md +4 -4
- package/docs/server.basecharactercontroller.ontickwithplayerinput.md +13 -0
- package/docs/{server.basecharactercontroller.tickplayermovement.md → server.basecharactercontroller.tickwithplayerinput.md} +8 -8
- package/docs/server.defaultcharactercontroller.md +1 -1
- package/docs/{server.defaultcharactercontroller.tickplayermovement.md → server.defaultcharactercontroller.tickwithplayerinput.md} +8 -8
- package/docs/server.md +5 -5
- package/docs/server.player.cameraorientation.md +13 -0
- package/docs/server.player.input.md +13 -0
- package/docs/server.player.md +9 -9
- package/docs/server.playercameraorientation.md +16 -0
- package/docs/server.playerinput.md +13 -0
- package/docs/server.simulation.enabledebugraycasting.md +53 -0
- package/docs/server.simulation.enabledebugrendering.md +1 -1
- package/docs/server.simulation.isdebugraycastingenabled.md +13 -0
- package/docs/server.simulation.md +36 -1
- package/docs/server.supported_input_keys.md +1 -1
- package/examples/big-world/README.md +4 -0
- package/examples/big-world/package.json +14 -0
- package/examples/block-entity/README.md +3 -0
- package/examples/block-entity/assets/map.json +2623 -0
- package/examples/block-entity/package.json +15 -0
- package/examples/character-controller/MyCharacterController.ts +8 -8
- package/examples/character-controller/README.md +4 -0
- package/examples/character-controller/assets/map.json +2623 -0
- package/examples/character-controller/package.json +15 -0
- package/examples/custom-ui/README.md +4 -0
- package/examples/custom-ui/assets/map.json +2623 -0
- package/examples/custom-ui/package.json +15 -0
- package/examples/entity-spawn/README.md +3 -0
- package/examples/entity-spawn/assets/map.json +2623 -0
- package/examples/entity-spawn/package.json +15 -0
- package/examples/payload-game/README.md +8 -0
- package/examples/payload-game/assets/ui/index.html +42 -0
- package/examples/payload-game/index.ts +24 -18
- package/examples/payload-game/package.json +15 -0
- package/package.json +1 -1
- package/server.api.json +191 -113
- package/server.d.ts +34 -23
- package/server.js +80 -80
- package/docs/server.basecharactercontroller.ontickplayermovement.md +0 -13
- package/docs/server.player.inputstate.md +0 -13
- package/docs/server.player.orientationstate.md +0 -13
- package/docs/server.playerinputstate.md +0 -13
- package/docs/server.playerorientationstate.md +0 -16
package/server.api.json
CHANGED
@@ -2785,30 +2785,30 @@
|
|
2785
2785
|
},
|
2786
2786
|
{
|
2787
2787
|
"kind": "Property",
|
2788
|
-
"canonicalReference": "server!BaseCharacterController#
|
2789
|
-
"docComment": "/**\n * A callback function for when the controller ticks player movement.\n *\n * @param
|
2788
|
+
"canonicalReference": "server!BaseCharacterController#onTickWithPlayerInput:member",
|
2789
|
+
"docComment": "/**\n * A callback function for when the controller ticks player movement. This is called every tick by a PlayerEntity with a character controller.\n *\n * @param input - The current input state of the player.\n *\n * @param cameraOrientation - The current camera orientation state of the player.\n *\n * @param deltaTimeMs - The delta time in milliseconds since the last tick.\n */\n",
|
2790
2790
|
"excerptTokens": [
|
2791
2791
|
{
|
2792
2792
|
"kind": "Content",
|
2793
|
-
"text": "
|
2793
|
+
"text": "onTickWithPlayerInput?: "
|
2794
2794
|
},
|
2795
2795
|
{
|
2796
2796
|
"kind": "Content",
|
2797
|
-
"text": "(
|
2797
|
+
"text": "(input: "
|
2798
2798
|
},
|
2799
2799
|
{
|
2800
2800
|
"kind": "Reference",
|
2801
|
-
"text": "
|
2802
|
-
"canonicalReference": "server!
|
2801
|
+
"text": "PlayerInput",
|
2802
|
+
"canonicalReference": "server!PlayerInput:type"
|
2803
2803
|
},
|
2804
2804
|
{
|
2805
2805
|
"kind": "Content",
|
2806
|
-
"text": ",
|
2806
|
+
"text": ", cameraOrientation: "
|
2807
2807
|
},
|
2808
2808
|
{
|
2809
2809
|
"kind": "Reference",
|
2810
|
-
"text": "
|
2811
|
-
"canonicalReference": "server!
|
2810
|
+
"text": "PlayerCameraOrientation",
|
2811
|
+
"canonicalReference": "server!PlayerCameraOrientation:type"
|
2812
2812
|
},
|
2813
2813
|
{
|
2814
2814
|
"kind": "Content",
|
@@ -2822,7 +2822,7 @@
|
|
2822
2822
|
"isReadonly": false,
|
2823
2823
|
"isOptional": true,
|
2824
2824
|
"releaseTag": "Public",
|
2825
|
-
"name": "
|
2825
|
+
"name": "onTickWithPlayerInput",
|
2826
2826
|
"propertyTypeTokenRange": {
|
2827
2827
|
"startIndex": 1,
|
2828
2828
|
"endIndex": 6
|
@@ -2881,26 +2881,26 @@
|
|
2881
2881
|
},
|
2882
2882
|
{
|
2883
2883
|
"kind": "Method",
|
2884
|
-
"canonicalReference": "server!BaseCharacterController#
|
2885
|
-
"docComment": "/**\n * Override this method to handle entity movements based on player input for your character controller.\n *\n * @param
|
2884
|
+
"canonicalReference": "server!BaseCharacterController#tickWithPlayerInput:member(1)",
|
2885
|
+
"docComment": "/**\n * Override this method to handle entity movements based on player input for your character controller.\n *\n * @param input - The current input state of the player.\n *\n * @param cameraOrientation - The current camera orientation state of the player.\n *\n * @param deltaTimeMs - The delta time in milliseconds since the last tick.\n */\n",
|
2886
2886
|
"excerptTokens": [
|
2887
2887
|
{
|
2888
2888
|
"kind": "Content",
|
2889
|
-
"text": "
|
2889
|
+
"text": "tickWithPlayerInput(input: "
|
2890
2890
|
},
|
2891
2891
|
{
|
2892
2892
|
"kind": "Reference",
|
2893
|
-
"text": "
|
2894
|
-
"canonicalReference": "server!
|
2893
|
+
"text": "PlayerInput",
|
2894
|
+
"canonicalReference": "server!PlayerInput:type"
|
2895
2895
|
},
|
2896
2896
|
{
|
2897
2897
|
"kind": "Content",
|
2898
|
-
"text": ",
|
2898
|
+
"text": ", cameraOrientation: "
|
2899
2899
|
},
|
2900
2900
|
{
|
2901
2901
|
"kind": "Reference",
|
2902
|
-
"text": "
|
2903
|
-
"canonicalReference": "server!
|
2902
|
+
"text": "PlayerCameraOrientation",
|
2903
|
+
"canonicalReference": "server!PlayerCameraOrientation:type"
|
2904
2904
|
},
|
2905
2905
|
{
|
2906
2906
|
"kind": "Content",
|
@@ -2933,7 +2933,7 @@
|
|
2933
2933
|
"overloadIndex": 1,
|
2934
2934
|
"parameters": [
|
2935
2935
|
{
|
2936
|
-
"parameterName": "
|
2936
|
+
"parameterName": "input",
|
2937
2937
|
"parameterTypeTokenRange": {
|
2938
2938
|
"startIndex": 1,
|
2939
2939
|
"endIndex": 2
|
@@ -2941,7 +2941,7 @@
|
|
2941
2941
|
"isOptional": false
|
2942
2942
|
},
|
2943
2943
|
{
|
2944
|
-
"parameterName": "
|
2944
|
+
"parameterName": "cameraOrientation",
|
2945
2945
|
"parameterTypeTokenRange": {
|
2946
2946
|
"startIndex": 3,
|
2947
2947
|
"endIndex": 4
|
@@ -2959,7 +2959,7 @@
|
|
2959
2959
|
],
|
2960
2960
|
"isOptional": false,
|
2961
2961
|
"isAbstract": false,
|
2962
|
-
"name": "
|
2962
|
+
"name": "tickWithPlayerInput"
|
2963
2963
|
}
|
2964
2964
|
],
|
2965
2965
|
"implementsTokenRanges": []
|
@@ -8893,26 +8893,26 @@
|
|
8893
8893
|
},
|
8894
8894
|
{
|
8895
8895
|
"kind": "Method",
|
8896
|
-
"canonicalReference": "server!DefaultCharacterController#
|
8897
|
-
"docComment": "/**\n * Ticks the player movement for the character controller, overriding the default implementation.\n *\n * @param
|
8896
|
+
"canonicalReference": "server!DefaultCharacterController#tickWithPlayerInput:member(1)",
|
8897
|
+
"docComment": "/**\n * Ticks the player movement for the character controller, overriding the default implementation.\n *\n * @param input - The current input state of the player.\n *\n * @param cameraOrientation - The current camera orientation state of the player.\n *\n * @param deltaTimeMs - The delta time in milliseconds since the last tick.\n */\n",
|
8898
8898
|
"excerptTokens": [
|
8899
8899
|
{
|
8900
8900
|
"kind": "Content",
|
8901
|
-
"text": "
|
8901
|
+
"text": "tickWithPlayerInput(input: "
|
8902
8902
|
},
|
8903
8903
|
{
|
8904
8904
|
"kind": "Reference",
|
8905
|
-
"text": "
|
8906
|
-
"canonicalReference": "server!
|
8905
|
+
"text": "PlayerInput",
|
8906
|
+
"canonicalReference": "server!PlayerInput:type"
|
8907
8907
|
},
|
8908
8908
|
{
|
8909
8909
|
"kind": "Content",
|
8910
|
-
"text": ",
|
8910
|
+
"text": ", cameraOrientation: "
|
8911
8911
|
},
|
8912
8912
|
{
|
8913
8913
|
"kind": "Reference",
|
8914
|
-
"text": "
|
8915
|
-
"canonicalReference": "server!
|
8914
|
+
"text": "PlayerCameraOrientation",
|
8915
|
+
"canonicalReference": "server!PlayerCameraOrientation:type"
|
8916
8916
|
},
|
8917
8917
|
{
|
8918
8918
|
"kind": "Content",
|
@@ -8945,7 +8945,7 @@
|
|
8945
8945
|
"overloadIndex": 1,
|
8946
8946
|
"parameters": [
|
8947
8947
|
{
|
8948
|
-
"parameterName": "
|
8948
|
+
"parameterName": "input",
|
8949
8949
|
"parameterTypeTokenRange": {
|
8950
8950
|
"startIndex": 1,
|
8951
8951
|
"endIndex": 2
|
@@ -8953,7 +8953,7 @@
|
|
8953
8953
|
"isOptional": false
|
8954
8954
|
},
|
8955
8955
|
{
|
8956
|
-
"parameterName": "
|
8956
|
+
"parameterName": "cameraOrientation",
|
8957
8957
|
"parameterTypeTokenRange": {
|
8958
8958
|
"startIndex": 3,
|
8959
8959
|
"endIndex": 4
|
@@ -8971,7 +8971,7 @@
|
|
8971
8971
|
],
|
8972
8972
|
"isOptional": false,
|
8973
8973
|
"isAbstract": false,
|
8974
|
-
"name": "
|
8974
|
+
"name": "tickWithPlayerInput"
|
8975
8975
|
},
|
8976
8976
|
{
|
8977
8977
|
"kind": "Property",
|
@@ -13232,6 +13232,50 @@
|
|
13232
13232
|
"isProtected": false,
|
13233
13233
|
"isAbstract": false
|
13234
13234
|
},
|
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
|
+
},
|
13235
13279
|
{
|
13236
13280
|
"kind": "Method",
|
13237
13281
|
"canonicalReference": "server!Player#disconnect:member(1)",
|
@@ -13295,12 +13339,12 @@
|
|
13295
13339
|
},
|
13296
13340
|
{
|
13297
13341
|
"kind": "Property",
|
13298
|
-
"canonicalReference": "server!Player#
|
13299
|
-
"docComment": "/**\n * The current {@link
|
13342
|
+
"canonicalReference": "server!Player#input:member",
|
13343
|
+
"docComment": "/**\n * The current {@link PlayerInput} of the player.\n */\n",
|
13300
13344
|
"excerptTokens": [
|
13301
13345
|
{
|
13302
13346
|
"kind": "Content",
|
13303
|
-
"text": "get
|
13347
|
+
"text": "get input(): "
|
13304
13348
|
},
|
13305
13349
|
{
|
13306
13350
|
"kind": "Reference",
|
@@ -13313,8 +13357,8 @@
|
|
13313
13357
|
},
|
13314
13358
|
{
|
13315
13359
|
"kind": "Reference",
|
13316
|
-
"text": "
|
13317
|
-
"canonicalReference": "server!
|
13360
|
+
"text": "PlayerInput",
|
13361
|
+
"canonicalReference": "server!PlayerInput:type"
|
13318
13362
|
},
|
13319
13363
|
{
|
13320
13364
|
"kind": "Content",
|
@@ -13328,7 +13372,7 @@
|
|
13328
13372
|
"isReadonly": true,
|
13329
13373
|
"isOptional": false,
|
13330
13374
|
"releaseTag": "Public",
|
13331
|
-
"name": "
|
13375
|
+
"name": "input",
|
13332
13376
|
"propertyTypeTokenRange": {
|
13333
13377
|
"startIndex": 1,
|
13334
13378
|
"endIndex": 5
|
@@ -13417,50 +13461,6 @@
|
|
13417
13461
|
"isAbstract": false,
|
13418
13462
|
"name": "leaveWorld"
|
13419
13463
|
},
|
13420
|
-
{
|
13421
|
-
"kind": "Property",
|
13422
|
-
"canonicalReference": "server!Player#orientationState:member",
|
13423
|
-
"docComment": "/**\n * The current {@link PlayerOrientationState} of the player.\n */\n",
|
13424
|
-
"excerptTokens": [
|
13425
|
-
{
|
13426
|
-
"kind": "Content",
|
13427
|
-
"text": "get orientationState(): "
|
13428
|
-
},
|
13429
|
-
{
|
13430
|
-
"kind": "Reference",
|
13431
|
-
"text": "Readonly",
|
13432
|
-
"canonicalReference": "!Readonly:type"
|
13433
|
-
},
|
13434
|
-
{
|
13435
|
-
"kind": "Content",
|
13436
|
-
"text": "<"
|
13437
|
-
},
|
13438
|
-
{
|
13439
|
-
"kind": "Reference",
|
13440
|
-
"text": "PlayerOrientationState",
|
13441
|
-
"canonicalReference": "server!PlayerOrientationState:type"
|
13442
|
-
},
|
13443
|
-
{
|
13444
|
-
"kind": "Content",
|
13445
|
-
"text": ">"
|
13446
|
-
},
|
13447
|
-
{
|
13448
|
-
"kind": "Content",
|
13449
|
-
"text": ";"
|
13450
|
-
}
|
13451
|
-
],
|
13452
|
-
"isReadonly": true,
|
13453
|
-
"isOptional": false,
|
13454
|
-
"releaseTag": "Public",
|
13455
|
-
"name": "orientationState",
|
13456
|
-
"propertyTypeTokenRange": {
|
13457
|
-
"startIndex": 1,
|
13458
|
-
"endIndex": 5
|
13459
|
-
},
|
13460
|
-
"isStatic": false,
|
13461
|
-
"isProtected": false,
|
13462
|
-
"isAbstract": false
|
13463
|
-
},
|
13464
13464
|
{
|
13465
13465
|
"kind": "Property",
|
13466
13466
|
"canonicalReference": "server!Player#ui:member",
|
@@ -15944,6 +15944,32 @@
|
|
15944
15944
|
}
|
15945
15945
|
]
|
15946
15946
|
},
|
15947
|
+
{
|
15948
|
+
"kind": "TypeAlias",
|
15949
|
+
"canonicalReference": "server!PlayerCameraOrientation:type",
|
15950
|
+
"docComment": "/**\n * The camera orientation state of a Player.\n *\n * @public\n */\n",
|
15951
|
+
"excerptTokens": [
|
15952
|
+
{
|
15953
|
+
"kind": "Content",
|
15954
|
+
"text": "export type PlayerCameraOrientation = "
|
15955
|
+
},
|
15956
|
+
{
|
15957
|
+
"kind": "Content",
|
15958
|
+
"text": "{\n pitch: number;\n yaw: number;\n}"
|
15959
|
+
},
|
15960
|
+
{
|
15961
|
+
"kind": "Content",
|
15962
|
+
"text": ";"
|
15963
|
+
}
|
15964
|
+
],
|
15965
|
+
"fileUrlPath": "src/networking/players/Player.ts",
|
15966
|
+
"releaseTag": "Public",
|
15967
|
+
"name": "PlayerCameraOrientation",
|
15968
|
+
"typeTokenRange": {
|
15969
|
+
"startIndex": 1,
|
15970
|
+
"endIndex": 2
|
15971
|
+
}
|
15972
|
+
},
|
15947
15973
|
{
|
15948
15974
|
"kind": "Class",
|
15949
15975
|
"canonicalReference": "server!PlayerEntity:class",
|
@@ -16538,12 +16564,12 @@
|
|
16538
16564
|
},
|
16539
16565
|
{
|
16540
16566
|
"kind": "TypeAlias",
|
16541
|
-
"canonicalReference": "server!
|
16567
|
+
"canonicalReference": "server!PlayerInput:type",
|
16542
16568
|
"docComment": "/**\n * The input state of a Player; keys from SUPPORTED_INPUT_KEYS.\n *\n * @public\n */\n",
|
16543
16569
|
"excerptTokens": [
|
16544
16570
|
{
|
16545
16571
|
"kind": "Content",
|
16546
|
-
"text": "export type
|
16572
|
+
"text": "export type PlayerInput = "
|
16547
16573
|
},
|
16548
16574
|
{
|
16549
16575
|
"kind": "Reference",
|
@@ -16579,7 +16605,7 @@
|
|
16579
16605
|
],
|
16580
16606
|
"fileUrlPath": "src/networking/players/Player.ts",
|
16581
16607
|
"releaseTag": "Public",
|
16582
|
-
"name": "
|
16608
|
+
"name": "PlayerInput",
|
16583
16609
|
"typeTokenRange": {
|
16584
16610
|
"startIndex": 1,
|
16585
16611
|
"endIndex": 7
|
@@ -16724,32 +16750,6 @@
|
|
16724
16750
|
],
|
16725
16751
|
"implementsTokenRanges": []
|
16726
16752
|
},
|
16727
|
-
{
|
16728
|
-
"kind": "TypeAlias",
|
16729
|
-
"canonicalReference": "server!PlayerOrientationState:type",
|
16730
|
-
"docComment": "/**\n * The camera orientation state of a Player.\n *\n * @public\n */\n",
|
16731
|
-
"excerptTokens": [
|
16732
|
-
{
|
16733
|
-
"kind": "Content",
|
16734
|
-
"text": "export type PlayerOrientationState = "
|
16735
|
-
},
|
16736
|
-
{
|
16737
|
-
"kind": "Content",
|
16738
|
-
"text": "{\n pitch: number;\n yaw: number;\n}"
|
16739
|
-
},
|
16740
|
-
{
|
16741
|
-
"kind": "Content",
|
16742
|
-
"text": ";"
|
16743
|
-
}
|
16744
|
-
],
|
16745
|
-
"fileUrlPath": "src/networking/players/Player.ts",
|
16746
|
-
"releaseTag": "Public",
|
16747
|
-
"name": "PlayerOrientationState",
|
16748
|
-
"typeTokenRange": {
|
16749
|
-
"startIndex": 1,
|
16750
|
-
"endIndex": 2
|
16751
|
-
}
|
16752
|
-
},
|
16753
16753
|
{
|
16754
16754
|
"kind": "Class",
|
16755
16755
|
"canonicalReference": "server!PlayerUI:class",
|
@@ -22798,10 +22798,58 @@
|
|
22798
22798
|
"isAbstract": false,
|
22799
22799
|
"name": "castRay"
|
22800
22800
|
},
|
22801
|
+
{
|
22802
|
+
"kind": "Method",
|
22803
|
+
"canonicalReference": "server!Simulation#enableDebugRaycasting:member(1)",
|
22804
|
+
"docComment": "/**\n * Enables or disables debug raycasting for the simulation. This will render lines for the raycast that disappear after a few seconds.\n *\n * @param enabled - Whether to enable debug raycasting.\n */\n",
|
22805
|
+
"excerptTokens": [
|
22806
|
+
{
|
22807
|
+
"kind": "Content",
|
22808
|
+
"text": "enableDebugRaycasting(enabled: "
|
22809
|
+
},
|
22810
|
+
{
|
22811
|
+
"kind": "Content",
|
22812
|
+
"text": "boolean"
|
22813
|
+
},
|
22814
|
+
{
|
22815
|
+
"kind": "Content",
|
22816
|
+
"text": "): "
|
22817
|
+
},
|
22818
|
+
{
|
22819
|
+
"kind": "Content",
|
22820
|
+
"text": "void"
|
22821
|
+
},
|
22822
|
+
{
|
22823
|
+
"kind": "Content",
|
22824
|
+
"text": ";"
|
22825
|
+
}
|
22826
|
+
],
|
22827
|
+
"isStatic": false,
|
22828
|
+
"returnTypeTokenRange": {
|
22829
|
+
"startIndex": 3,
|
22830
|
+
"endIndex": 4
|
22831
|
+
},
|
22832
|
+
"releaseTag": "Public",
|
22833
|
+
"isProtected": false,
|
22834
|
+
"overloadIndex": 1,
|
22835
|
+
"parameters": [
|
22836
|
+
{
|
22837
|
+
"parameterName": "enabled",
|
22838
|
+
"parameterTypeTokenRange": {
|
22839
|
+
"startIndex": 1,
|
22840
|
+
"endIndex": 2
|
22841
|
+
},
|
22842
|
+
"isOptional": false
|
22843
|
+
}
|
22844
|
+
],
|
22845
|
+
"isOptional": false,
|
22846
|
+
"isAbstract": false,
|
22847
|
+
"name": "enableDebugRaycasting"
|
22848
|
+
},
|
22801
22849
|
{
|
22802
22850
|
"kind": "Method",
|
22803
22851
|
"canonicalReference": "server!Simulation#enableDebugRendering:member(1)",
|
22804
|
-
"docComment": "/**\n * Enables or disables debug rendering for the simulation. When enabled, all colliders
|
22852
|
+
"docComment": "/**\n * Enables or disables debug rendering for the simulation. When enabled, all colliders and rigid body outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.\n *\n * @param enabled - Whether to enable debug rendering.\n */\n",
|
22805
22853
|
"excerptTokens": [
|
22806
22854
|
{
|
22807
22855
|
"kind": "Content",
|
@@ -22948,6 +22996,36 @@
|
|
22948
22996
|
"isProtected": false,
|
22949
22997
|
"isAbstract": false
|
22950
22998
|
},
|
22999
|
+
{
|
23000
|
+
"kind": "Property",
|
23001
|
+
"canonicalReference": "server!Simulation#isDebugRaycastingEnabled:member",
|
23002
|
+
"docComment": "/**\n * Whether the simulation has debug raycasting enabled\n */\n",
|
23003
|
+
"excerptTokens": [
|
23004
|
+
{
|
23005
|
+
"kind": "Content",
|
23006
|
+
"text": "get isDebugRaycastingEnabled(): "
|
23007
|
+
},
|
23008
|
+
{
|
23009
|
+
"kind": "Content",
|
23010
|
+
"text": "boolean"
|
23011
|
+
},
|
23012
|
+
{
|
23013
|
+
"kind": "Content",
|
23014
|
+
"text": ";"
|
23015
|
+
}
|
23016
|
+
],
|
23017
|
+
"isReadonly": true,
|
23018
|
+
"isOptional": false,
|
23019
|
+
"releaseTag": "Public",
|
23020
|
+
"name": "isDebugRaycastingEnabled",
|
23021
|
+
"propertyTypeTokenRange": {
|
23022
|
+
"startIndex": 1,
|
23023
|
+
"endIndex": 2
|
23024
|
+
},
|
23025
|
+
"isStatic": false,
|
23026
|
+
"isProtected": false,
|
23027
|
+
"isAbstract": false
|
23028
|
+
},
|
22951
23029
|
{
|
22952
23030
|
"kind": "Property",
|
22953
23031
|
"canonicalReference": "server!Simulation#isDebugRenderingEnabled:member",
|
@@ -23179,7 +23257,7 @@
|
|
23179
23257
|
{
|
23180
23258
|
"kind": "Variable",
|
23181
23259
|
"canonicalReference": "server!SUPPORTED_INPUT_KEYS:var",
|
23182
|
-
"docComment": "/**\n * The input keys that
|
23260
|
+
"docComment": "/**\n * The input keys that are included in the PlayerInput.\n *\n * @public\n */\n",
|
23183
23261
|
"excerptTokens": [
|
23184
23262
|
{
|
23185
23263
|
"kind": "Content",
|
package/server.d.ts
CHANGED
@@ -296,12 +296,13 @@ export declare abstract class BaseCharacterController {
|
|
296
296
|
onTick?: (deltaTimeMs: number) => void;
|
297
297
|
/**
|
298
298
|
* A callback function for when the controller ticks
|
299
|
-
* player movement.
|
300
|
-
*
|
301
|
-
* @param
|
299
|
+
* player movement. This is called every tick by a
|
300
|
+
* PlayerEntity with a character controller.
|
301
|
+
* @param input - The current input state of the player.
|
302
|
+
* @param cameraOrientation - The current camera orientation state of the player.
|
302
303
|
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
303
304
|
*/
|
304
|
-
|
305
|
+
onTickWithPlayerInput?: (input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number) => void;
|
305
306
|
/**
|
306
307
|
* @param entity - The entity the controller is for.
|
307
308
|
* @param _options - Arbitrary options you may provide or omit for your controller implementation.
|
@@ -316,11 +317,11 @@ export declare abstract class BaseCharacterController {
|
|
316
317
|
/**
|
317
318
|
* Override this method to handle entity movements
|
318
319
|
* based on player input for your character controller.
|
319
|
-
* @param
|
320
|
-
* @param
|
320
|
+
* @param input - The current input state of the player.
|
321
|
+
* @param cameraOrientation - The current camera orientation state of the player.
|
321
322
|
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
322
323
|
*/
|
323
|
-
|
324
|
+
tickWithPlayerInput(input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
|
324
325
|
/**
|
325
326
|
* Override this method to handle entity movements
|
326
327
|
* based on your character controller.
|
@@ -1228,11 +1229,11 @@ export declare class DefaultCharacterController extends BaseCharacterController
|
|
1228
1229
|
/**
|
1229
1230
|
* Ticks the player movement for the character controller,
|
1230
1231
|
* overriding the default implementation.
|
1231
|
-
* @param
|
1232
|
-
* @param
|
1232
|
+
* @param input - The current input state of the player.
|
1233
|
+
* @param cameraOrientation - The current camera orientation state of the player.
|
1233
1234
|
* @param deltaTimeMs - The delta time in milliseconds since the last tick.
|
1234
1235
|
*/
|
1235
|
-
|
1236
|
+
tickWithPlayerInput(input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
|
1236
1237
|
}
|
1237
1238
|
|
1238
1239
|
/** Options for creating a DefaultCharacterController instance. @public */
|
@@ -1819,10 +1820,10 @@ export declare class Player {
|
|
1819
1820
|
|
1820
1821
|
|
1821
1822
|
|
1822
|
-
/** The current {@link
|
1823
|
-
get
|
1824
|
-
/** The current {@link
|
1825
|
-
get
|
1823
|
+
/** The current {@link PlayerInput} of the player. */
|
1824
|
+
get input(): Readonly<PlayerInput>;
|
1825
|
+
/** The current {@link PlayerCameraOrientation} of the player. */
|
1826
|
+
get cameraOrientation(): Readonly<PlayerCameraOrientation>;
|
1826
1827
|
/** The current {@link World} the player is in. */
|
1827
1828
|
get world(): World | undefined;
|
1828
1829
|
/**
|
@@ -2063,6 +2064,12 @@ export declare enum PlayerCameraMode {
|
|
2063
2064
|
THIRD_PERSON = 1
|
2064
2065
|
}
|
2065
2066
|
|
2067
|
+
/** The camera orientation state of a Player. @public */
|
2068
|
+
export declare type PlayerCameraOrientation = {
|
2069
|
+
pitch: number;
|
2070
|
+
yaw: number;
|
2071
|
+
};
|
2072
|
+
|
2066
2073
|
/**
|
2067
2074
|
* Represents an entity controlled by a player in a world.
|
2068
2075
|
*
|
@@ -2138,7 +2145,7 @@ export declare enum PlayerEventType {
|
|
2138
2145
|
}
|
2139
2146
|
|
2140
2147
|
/** The input state of a Player; keys from SUPPORTED_INPUT_KEYS. @public */
|
2141
|
-
export declare type
|
2148
|
+
export declare type PlayerInput = Partial<Record<keyof InputSchema, boolean>>;
|
2142
2149
|
|
2143
2150
|
/**
|
2144
2151
|
* Manages all connected players in a game server.
|
@@ -2180,12 +2187,6 @@ export declare class PlayerManager {
|
|
2180
2187
|
|
2181
2188
|
}
|
2182
2189
|
|
2183
|
-
/** The camera orientation state of a Player. @public */
|
2184
|
-
export declare type PlayerOrientationState = {
|
2185
|
-
pitch: number;
|
2186
|
-
yaw: number;
|
2187
|
-
};
|
2188
|
-
|
2189
2190
|
/**
|
2190
2191
|
* The UI for a player.
|
2191
2192
|
*
|
@@ -2989,6 +2990,9 @@ export declare class Simulation {
|
|
2989
2990
|
|
2990
2991
|
|
2991
2992
|
|
2993
|
+
|
2994
|
+
/** Whether the simulation has debug raycasting enabled */
|
2995
|
+
get isDebugRaycastingEnabled(): boolean;
|
2992
2996
|
/** Whether the simulation has debug rendering enabled. */
|
2993
2997
|
get isDebugRenderingEnabled(): boolean;
|
2994
2998
|
/** The gravity vector for the simulation. */
|
@@ -3008,9 +3012,16 @@ export declare class Simulation {
|
|
3008
3012
|
castRay(origin: RAPIER.Vector3, direction: RAPIER.Vector3, length: number, options?: RayCastOptions): Block | Entity | null;
|
3009
3013
|
|
3010
3014
|
|
3015
|
+
/**
|
3016
|
+
* Enables or disables debug raycasting for the simulation.
|
3017
|
+
* This will render lines for the raycast that disappear
|
3018
|
+
* after a few seconds.
|
3019
|
+
* @param enabled - Whether to enable debug raycasting.
|
3020
|
+
*/
|
3021
|
+
enableDebugRaycasting(enabled: boolean): void;
|
3011
3022
|
/**
|
3012
3023
|
* Enables or disables debug rendering for the simulation.
|
3013
|
-
* When enabled, all colliders
|
3024
|
+
* When enabled, all colliders and rigid body outlines
|
3014
3025
|
* will be rendered in the world. Do not enable this in production.
|
3015
3026
|
* In large worlds enabling this can cause noticable lag and RTT spikes.
|
3016
3027
|
* @param enabled - Whether to enable debug rendering.
|
@@ -3060,7 +3071,7 @@ export declare interface SpdMatrix3 extends SdpMatrix3 {
|
|
3060
3071
|
*/
|
3061
3072
|
export declare function startServer(init: (world: World) => void): void;
|
3062
3073
|
|
3063
|
-
/** The input keys that
|
3074
|
+
/** The input keys that are included in the PlayerInput. @public */
|
3064
3075
|
export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "sh", "tb", "ml", "mr", "q", "e", "r", "f", "z", "x", "c", "v", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
|
3065
3076
|
|
3066
3077
|
/**
|