hytopia 0.1.49 → 0.1.51
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/boilerplate/assets/map.json +2623 -0
- 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
@@ -115,7 +115,7 @@ _(Optional)_ A callback function for when the controller ticks.
|
|
115
115
|
</td></tr>
|
116
116
|
<tr><td>
|
117
117
|
|
118
|
-
[
|
118
|
+
[onTickWithPlayerInput?](./server.basecharactercontroller.ontickwithplayerinput.md)
|
119
119
|
|
120
120
|
|
121
121
|
</td><td>
|
@@ -123,12 +123,12 @@ _(Optional)_ A callback function for when the controller ticks.
|
|
123
123
|
|
124
124
|
</td><td>
|
125
125
|
|
126
|
-
(
|
126
|
+
(input: [PlayerInput](./server.playerinput.md)<!-- -->, cameraOrientation: [PlayerCameraOrientation](./server.playercameraorientation.md)<!-- -->, deltaTimeMs: number) => void
|
127
127
|
|
128
128
|
|
129
129
|
</td><td>
|
130
130
|
|
131
|
-
_(Optional)_ A callback function for when the controller ticks player movement.
|
131
|
+
_(Optional)_ A callback function for when the controller ticks player movement. This is called every tick by a PlayerEntity with a character controller.
|
132
132
|
|
133
133
|
|
134
134
|
</td></tr>
|
@@ -182,7 +182,7 @@ Override this method to handle entity movements based on your character controll
|
|
182
182
|
</td></tr>
|
183
183
|
<tr><td>
|
184
184
|
|
185
|
-
[
|
185
|
+
[tickWithPlayerInput(input, cameraOrientation, deltaTimeMs)](./server.basecharactercontroller.tickwithplayerinput.md)
|
186
186
|
|
187
187
|
|
188
188
|
</td><td>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BaseCharacterController](./server.basecharactercontroller.md) > [onTickWithPlayerInput](./server.basecharactercontroller.ontickwithplayerinput.md)
|
4
|
+
|
5
|
+
## BaseCharacterController.onTickWithPlayerInput property
|
6
|
+
|
7
|
+
A callback function for when the controller ticks player movement. This is called every tick by a PlayerEntity with a character controller.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
onTickWithPlayerInput?: (input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number) => void;
|
13
|
+
```
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
2
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [BaseCharacterController](./server.basecharactercontroller.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [BaseCharacterController](./server.basecharactercontroller.md) > [tickWithPlayerInput](./server.basecharactercontroller.tickwithplayerinput.md)
|
4
4
|
|
5
|
-
## BaseCharacterController.
|
5
|
+
## BaseCharacterController.tickWithPlayerInput() method
|
6
6
|
|
7
7
|
Override this method to handle entity movements based on player input for your character controller.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
tickWithPlayerInput(input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -32,12 +32,12 @@ Description
|
|
32
32
|
</th></tr></thead>
|
33
33
|
<tbody><tr><td>
|
34
34
|
|
35
|
-
|
35
|
+
input
|
36
36
|
|
37
37
|
|
38
38
|
</td><td>
|
39
39
|
|
40
|
-
[
|
40
|
+
[PlayerInput](./server.playerinput.md)
|
41
41
|
|
42
42
|
|
43
43
|
</td><td>
|
@@ -48,17 +48,17 @@ The current input state of the player.
|
|
48
48
|
</td></tr>
|
49
49
|
<tr><td>
|
50
50
|
|
51
|
-
|
51
|
+
cameraOrientation
|
52
52
|
|
53
53
|
|
54
54
|
</td><td>
|
55
55
|
|
56
|
-
[
|
56
|
+
[PlayerCameraOrientation](./server.playercameraorientation.md)
|
57
57
|
|
58
58
|
|
59
59
|
</td><td>
|
60
60
|
|
61
|
-
The current orientation state of the player.
|
61
|
+
The current camera orientation state of the player.
|
62
62
|
|
63
63
|
|
64
64
|
</td></tr>
|
@@ -304,7 +304,7 @@ Creates the colliders for the character controller, overriding the default imple
|
|
304
304
|
</td></tr>
|
305
305
|
<tr><td>
|
306
306
|
|
307
|
-
[
|
307
|
+
[tickWithPlayerInput(input, cameraOrientation, deltaTimeMs)](./server.defaultcharactercontroller.tickwithplayerinput.md)
|
308
308
|
|
309
309
|
|
310
310
|
</td><td>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
2
|
|
3
|
-
[Home](./index.md) > [server](./server.md) > [DefaultCharacterController](./server.defaultcharactercontroller.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [DefaultCharacterController](./server.defaultcharactercontroller.md) > [tickWithPlayerInput](./server.defaultcharactercontroller.tickwithplayerinput.md)
|
4
4
|
|
5
|
-
## DefaultCharacterController.
|
5
|
+
## DefaultCharacterController.tickWithPlayerInput() method
|
6
6
|
|
7
7
|
Ticks the player movement for the character controller, overriding the default implementation.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
tickWithPlayerInput(input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -32,12 +32,12 @@ Description
|
|
32
32
|
</th></tr></thead>
|
33
33
|
<tbody><tr><td>
|
34
34
|
|
35
|
-
|
35
|
+
input
|
36
36
|
|
37
37
|
|
38
38
|
</td><td>
|
39
39
|
|
40
|
-
[
|
40
|
+
[PlayerInput](./server.playerinput.md)
|
41
41
|
|
42
42
|
|
43
43
|
</td><td>
|
@@ -48,17 +48,17 @@ The current input state of the player.
|
|
48
48
|
</td></tr>
|
49
49
|
<tr><td>
|
50
50
|
|
51
|
-
|
51
|
+
cameraOrientation
|
52
52
|
|
53
53
|
|
54
54
|
</td><td>
|
55
55
|
|
56
|
-
[
|
56
|
+
[PlayerCameraOrientation](./server.playercameraorientation.md)
|
57
57
|
|
58
58
|
|
59
59
|
</td><td>
|
60
60
|
|
61
|
-
The current orientation state of the player.
|
61
|
+
The current camera orientation state of the player.
|
62
62
|
|
63
63
|
|
64
64
|
</td></tr>
|
package/docs/server.md
CHANGED
@@ -904,7 +904,7 @@ The port the server will run on. You can override this in your .env by setting P
|
|
904
904
|
|
905
905
|
</td><td>
|
906
906
|
|
907
|
-
The input keys that
|
907
|
+
The input keys that are included in the PlayerInput.
|
908
908
|
|
909
909
|
|
910
910
|
</td></tr>
|
@@ -1035,23 +1035,23 @@ Options for the [SimpleCharacterController.move()](./server.simplecharactercontr
|
|
1035
1035
|
</td></tr>
|
1036
1036
|
<tr><td>
|
1037
1037
|
|
1038
|
-
[
|
1038
|
+
[PlayerCameraOrientation](./server.playercameraorientation.md)
|
1039
1039
|
|
1040
1040
|
|
1041
1041
|
</td><td>
|
1042
1042
|
|
1043
|
-
The
|
1043
|
+
The camera orientation state of a Player.
|
1044
1044
|
|
1045
1045
|
|
1046
1046
|
</td></tr>
|
1047
1047
|
<tr><td>
|
1048
1048
|
|
1049
|
-
[
|
1049
|
+
[PlayerInput](./server.playerinput.md)
|
1050
1050
|
|
1051
1051
|
|
1052
1052
|
</td><td>
|
1053
1053
|
|
1054
|
-
The
|
1054
|
+
The input state of a Player; keys from SUPPORTED\_INPUT\_KEYS.
|
1055
1055
|
|
1056
1056
|
|
1057
1057
|
</td></tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Player](./server.player.md) > [cameraOrientation](./server.player.cameraorientation.md)
|
4
|
+
|
5
|
+
## Player.cameraOrientation property
|
6
|
+
|
7
|
+
The current [PlayerCameraOrientation](./server.playercameraorientation.md) of the player.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get cameraOrientation(): Readonly<PlayerCameraOrientation>;
|
13
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Player](./server.player.md) > [input](./server.player.input.md)
|
4
|
+
|
5
|
+
## Player.input property
|
6
|
+
|
7
|
+
The current [PlayerInput](./server.playerinput.md) of the player.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get input(): Readonly<PlayerInput>;
|
13
|
+
```
|
package/docs/server.player.md
CHANGED
@@ -64,7 +64,7 @@ The camera for the player.
|
|
64
64
|
</td></tr>
|
65
65
|
<tr><td>
|
66
66
|
|
67
|
-
[
|
67
|
+
[cameraOrientation](./server.player.cameraorientation.md)
|
68
68
|
|
69
69
|
|
70
70
|
</td><td>
|
@@ -74,18 +74,18 @@ The camera for the player.
|
|
74
74
|
|
75
75
|
</td><td>
|
76
76
|
|
77
|
-
|
77
|
+
Readonly<[PlayerCameraOrientation](./server.playercameraorientation.md)<!-- -->>
|
78
78
|
|
79
79
|
|
80
80
|
</td><td>
|
81
81
|
|
82
|
-
The
|
82
|
+
The current [PlayerCameraOrientation](./server.playercameraorientation.md) of the player.
|
83
83
|
|
84
84
|
|
85
85
|
</td></tr>
|
86
86
|
<tr><td>
|
87
87
|
|
88
|
-
[
|
88
|
+
[id](./server.player.id.md)
|
89
89
|
|
90
90
|
|
91
91
|
</td><td>
|
@@ -95,18 +95,18 @@ The unique identifier for the player.
|
|
95
95
|
|
96
96
|
</td><td>
|
97
97
|
|
98
|
-
|
98
|
+
number
|
99
99
|
|
100
100
|
|
101
101
|
</td><td>
|
102
102
|
|
103
|
-
The
|
103
|
+
The unique identifier for the player.
|
104
104
|
|
105
105
|
|
106
106
|
</td></tr>
|
107
107
|
<tr><td>
|
108
108
|
|
109
|
-
[
|
109
|
+
[input](./server.player.input.md)
|
110
110
|
|
111
111
|
|
112
112
|
</td><td>
|
@@ -116,12 +116,12 @@ The current [PlayerInputState](./server.playerinputstate.md) of the player.
|
|
116
116
|
|
117
117
|
</td><td>
|
118
118
|
|
119
|
-
Readonly<[
|
119
|
+
Readonly<[PlayerInput](./server.playerinput.md)<!-- -->>
|
120
120
|
|
121
121
|
|
122
122
|
</td><td>
|
123
123
|
|
124
|
-
The current [
|
124
|
+
The current [PlayerInput](./server.playerinput.md) of the player.
|
125
125
|
|
126
126
|
|
127
127
|
</td></tr>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [PlayerCameraOrientation](./server.playercameraorientation.md)
|
4
|
+
|
5
|
+
## PlayerCameraOrientation type
|
6
|
+
|
7
|
+
The camera orientation state of a Player.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type PlayerCameraOrientation = {
|
13
|
+
pitch: number;
|
14
|
+
yaw: number;
|
15
|
+
};
|
16
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [PlayerInput](./server.playerinput.md)
|
4
|
+
|
5
|
+
## PlayerInput type
|
6
|
+
|
7
|
+
The input state of a Player; keys from SUPPORTED\_INPUT\_KEYS.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type PlayerInput = Partial<Record<keyof InputSchema, boolean>>;
|
13
|
+
```
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [enableDebugRaycasting](./server.simulation.enabledebugraycasting.md)
|
4
|
+
|
5
|
+
## Simulation.enableDebugRaycasting() method
|
6
|
+
|
7
|
+
Enables or disables debug raycasting for the simulation. This will render lines for the raycast that disappear after a few seconds.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
enableDebugRaycasting(enabled: boolean): 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
|
+
enabled
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
boolean
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
Whether to enable debug raycasting.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
void
|
53
|
+
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
## Simulation.enableDebugRendering() method
|
6
6
|
|
7
|
-
Enables or disables debug rendering for the simulation. When enabled, all colliders
|
7
|
+
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.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [isDebugRaycastingEnabled](./server.simulation.isdebugraycastingenabled.md)
|
4
|
+
|
5
|
+
## Simulation.isDebugRaycastingEnabled property
|
6
|
+
|
7
|
+
Whether the simulation has debug raycasting enabled
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get isDebugRaycastingEnabled(): boolean;
|
13
|
+
```
|
@@ -61,6 +61,27 @@ RAPIER.Vector3
|
|
61
61
|
The gravity vector for the simulation.
|
62
62
|
|
63
63
|
|
64
|
+
</td></tr>
|
65
|
+
<tr><td>
|
66
|
+
|
67
|
+
[isDebugRaycastingEnabled](./server.simulation.isdebugraycastingenabled.md)
|
68
|
+
|
69
|
+
|
70
|
+
</td><td>
|
71
|
+
|
72
|
+
`readonly`
|
73
|
+
|
74
|
+
|
75
|
+
</td><td>
|
76
|
+
|
77
|
+
boolean
|
78
|
+
|
79
|
+
|
80
|
+
</td><td>
|
81
|
+
|
82
|
+
Whether the simulation has debug raycasting enabled
|
83
|
+
|
84
|
+
|
64
85
|
</td></tr>
|
65
86
|
<tr><td>
|
66
87
|
|
@@ -158,6 +179,20 @@ Description
|
|
158
179
|
Casts a ray through the simulation.
|
159
180
|
|
160
181
|
|
182
|
+
</td></tr>
|
183
|
+
<tr><td>
|
184
|
+
|
185
|
+
[enableDebugRaycasting(enabled)](./server.simulation.enabledebugraycasting.md)
|
186
|
+
|
187
|
+
|
188
|
+
</td><td>
|
189
|
+
|
190
|
+
|
191
|
+
</td><td>
|
192
|
+
|
193
|
+
Enables or disables debug raycasting for the simulation. This will render lines for the raycast that disappear after a few seconds.
|
194
|
+
|
195
|
+
|
161
196
|
</td></tr>
|
162
197
|
<tr><td>
|
163
198
|
|
@@ -169,7 +204,7 @@ Casts a ray through the simulation.
|
|
169
204
|
|
170
205
|
</td><td>
|
171
206
|
|
172
|
-
Enables or disables debug rendering for the simulation. When enabled, all colliders
|
207
|
+
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.
|
173
208
|
|
174
209
|
|
175
210
|
</td></tr>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"name": "big-world",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC",
|
11
|
+
"devDependencies": {
|
12
|
+
"@hytopia.com/assets": "^0.1.6"
|
13
|
+
}
|
14
|
+
}
|