hytopia 0.1.51 → 0.1.53
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/docs/server.basecharactercontroller.md +2 -2
- package/docs/server.basecharactercontroller.ontickwithplayerinput.md +1 -1
- package/docs/server.basecharactercontroller.tickwithplayerinput.md +1 -1
- package/docs/server.blocktype.md +1 -1
- package/docs/server.contactforcedata.md +18 -0
- package/docs/server.contactmanifold.md +19 -0
- package/docs/server.entity.md +2 -2
- package/docs/server.md +42 -0
- package/docs/server.raycasthit.md +17 -0
- package/docs/server.raycastoptions.md +20 -0
- package/docs/server.simulation.getcontactmanifolds.md +1 -1
- package/docs/server.simulation.md +8 -8
- package/docs/{server.simulation.castray.md → server.simulation.raycast.md} +10 -6
- package/examples/payload-game/assets/ui/index.html +2 -2
- package/package.json +1 -1
- package/server.api.json +322 -119
- package/server.d.ts +22 -7
- package/server.js +39 -39
@@ -128,7 +128,7 @@ _(Optional)_ A callback function for when the controller ticks.
|
|
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.
|
132
132
|
|
133
133
|
|
134
134
|
</td></tr>
|
@@ -190,7 +190,7 @@ Override this method to handle entity movements based on your character controll
|
|
190
190
|
|
191
191
|
</td><td>
|
192
192
|
|
193
|
-
Override this method to handle entity movements based on player input for your character controller.
|
193
|
+
Override this method to handle entity movements based on player input for your character controller. This is called every tick by a PlayerEntity with a character controller.
|
194
194
|
|
195
195
|
|
196
196
|
</td></tr>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
## BaseCharacterController.onTickWithPlayerInput property
|
6
6
|
|
7
|
-
A callback function for when the controller ticks player movement.
|
7
|
+
A callback function for when the controller ticks player movement.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
## BaseCharacterController.tickWithPlayerInput() method
|
6
6
|
|
7
|
-
Override this method to handle entity movements based on player input for your character controller.
|
7
|
+
Override this method to handle entity movements based on player input for your character controller. This is called every tick by a PlayerEntity with a character controller.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
package/docs/server.blocktype.md
CHANGED
@@ -202,7 +202,7 @@ _(Optional)_ A callback function that is invoked when an entity collides with bl
|
|
202
202
|
|
203
203
|
</td><td>
|
204
204
|
|
205
|
-
(blockType: [BlockType](./server.blocktype.md)<!-- -->, entity: [Entity](./server.entity.md)<!-- -->, contactForceData: ContactForceData) => void
|
205
|
+
(blockType: [BlockType](./server.blocktype.md)<!-- -->, entity: [Entity](./server.entity.md)<!-- -->, contactForceData: [ContactForceData](./server.contactforcedata.md)<!-- -->) => void
|
206
206
|
|
207
207
|
|
208
208
|
</td><td>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [ContactForceData](./server.contactforcedata.md)
|
4
|
+
|
5
|
+
## ContactForceData type
|
6
|
+
|
7
|
+
Data for contact forces.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type ContactForceData = {
|
13
|
+
totalForce: RAPIER.Vector;
|
14
|
+
totalForceMagnitude: number;
|
15
|
+
maxForceDirection: RAPIER.Vector;
|
16
|
+
maxForceMagnitude: number;
|
17
|
+
};
|
18
|
+
```
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [ContactManifold](./server.contactmanifold.md)
|
4
|
+
|
5
|
+
## ContactManifold type
|
6
|
+
|
7
|
+
A contact manifold.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type ContactManifold = {
|
13
|
+
localNormalA: Vector3Like;
|
14
|
+
localNormalB: Vector3Like;
|
15
|
+
normal: Vector3Like;
|
16
|
+
};
|
17
|
+
```
|
18
|
+
**References:** [Vector3Like](./server.vector3like.md)
|
19
|
+
|
package/docs/server.entity.md
CHANGED
@@ -402,7 +402,7 @@ _(Optional)_ A function that is called when the entity collides with a block.
|
|
402
402
|
|
403
403
|
</td><td>
|
404
404
|
|
405
|
-
(entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, contactForceData: ContactForceData) => void
|
405
|
+
(entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, contactForceData: [ContactForceData](./server.contactforcedata.md)<!-- -->) => void
|
406
406
|
|
407
407
|
|
408
408
|
</td><td>
|
@@ -459,7 +459,7 @@ _(Optional)_ A function that is called when the entity collides with another ent
|
|
459
459
|
|
460
460
|
</td><td>
|
461
461
|
|
462
|
-
(entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, contactForceData: ContactForceData) => void
|
462
|
+
(entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, contactForceData: [ContactForceData](./server.contactforcedata.md)<!-- -->) => void
|
463
463
|
|
464
464
|
|
465
465
|
</td><td>
|
package/docs/server.md
CHANGED
@@ -955,6 +955,28 @@ A set of collision groups.
|
|
955
955
|
A callback function for a chat command.
|
956
956
|
|
957
957
|
|
958
|
+
</td></tr>
|
959
|
+
<tr><td>
|
960
|
+
|
961
|
+
[ContactForceData](./server.contactforcedata.md)
|
962
|
+
|
963
|
+
|
964
|
+
</td><td>
|
965
|
+
|
966
|
+
Data for contact forces.
|
967
|
+
|
968
|
+
|
969
|
+
</td></tr>
|
970
|
+
<tr><td>
|
971
|
+
|
972
|
+
[ContactManifold](./server.contactmanifold.md)
|
973
|
+
|
974
|
+
|
975
|
+
</td><td>
|
976
|
+
|
977
|
+
A contact manifold.
|
978
|
+
|
979
|
+
|
958
980
|
</td></tr>
|
959
981
|
<tr><td>
|
960
982
|
|
@@ -1065,6 +1087,26 @@ The input state of a Player; keys from SUPPORTED\_INPUT\_KEYS.
|
|
1065
1087
|
A raw set of collision groups represented as a 32-bit number.
|
1066
1088
|
|
1067
1089
|
|
1090
|
+
</td></tr>
|
1091
|
+
<tr><td>
|
1092
|
+
|
1093
|
+
[RaycastHit](./server.raycasthit.md)
|
1094
|
+
|
1095
|
+
|
1096
|
+
</td><td>
|
1097
|
+
|
1098
|
+
|
1099
|
+
</td></tr>
|
1100
|
+
<tr><td>
|
1101
|
+
|
1102
|
+
[RaycastOptions](./server.raycastoptions.md)
|
1103
|
+
|
1104
|
+
|
1105
|
+
</td><td>
|
1106
|
+
|
1107
|
+
Options for raycasting.
|
1108
|
+
|
1109
|
+
|
1068
1110
|
</td></tr>
|
1069
1111
|
<tr><td>
|
1070
1112
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [RaycastHit](./server.raycasthit.md)
|
4
|
+
|
5
|
+
## RaycastHit type
|
6
|
+
|
7
|
+
**Signature:**
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
export type RaycastHit = {
|
11
|
+
hitObject: Block | Entity;
|
12
|
+
hitPoint: Vector3Like;
|
13
|
+
hitDistance: number;
|
14
|
+
};
|
15
|
+
```
|
16
|
+
**References:** [Block](./server.block.md)<!-- -->, [Entity](./server.entity.md)<!-- -->, [Vector3Like](./server.vector3like.md)
|
17
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [RaycastOptions](./server.raycastoptions.md)
|
4
|
+
|
5
|
+
## RaycastOptions type
|
6
|
+
|
7
|
+
Options for raycasting.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export type RaycastOptions = {
|
13
|
+
ignoresSensors?: boolean;
|
14
|
+
filterFlags?: RAPIER.QueryFilterFlags;
|
15
|
+
filterGroups?: number;
|
16
|
+
filterExcludeCollider?: RAPIER.Collider;
|
17
|
+
filterExcludeRigidBody?: RAPIER.RigidBody;
|
18
|
+
filterPredicate?: (collider: RAPIER.Collider) => boolean;
|
19
|
+
};
|
20
|
+
```
|
@@ -168,7 +168,7 @@ Description
|
|
168
168
|
</th></tr></thead>
|
169
169
|
<tbody><tr><td>
|
170
170
|
|
171
|
-
[
|
171
|
+
[enableDebugRaycasting(enabled)](./server.simulation.enabledebugraycasting.md)
|
172
172
|
|
173
173
|
|
174
174
|
</td><td>
|
@@ -176,13 +176,13 @@ Description
|
|
176
176
|
|
177
177
|
</td><td>
|
178
178
|
|
179
|
-
|
179
|
+
Enables or disables debug raycasting for the simulation. This will render lines for the raycast that disappear after a few seconds.
|
180
180
|
|
181
181
|
|
182
182
|
</td></tr>
|
183
183
|
<tr><td>
|
184
184
|
|
185
|
-
[
|
185
|
+
[enableDebugRendering(enabled)](./server.simulation.enabledebugrendering.md)
|
186
186
|
|
187
187
|
|
188
188
|
</td><td>
|
@@ -190,13 +190,13 @@ Casts a ray through the simulation.
|
|
190
190
|
|
191
191
|
</td><td>
|
192
192
|
|
193
|
-
Enables or disables debug
|
193
|
+
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.
|
194
194
|
|
195
195
|
|
196
196
|
</td></tr>
|
197
197
|
<tr><td>
|
198
198
|
|
199
|
-
[
|
199
|
+
[getContactManifolds(colliderHandleA, colliderHandleB)](./server.simulation.getcontactmanifolds.md)
|
200
200
|
|
201
201
|
|
202
202
|
</td><td>
|
@@ -204,13 +204,13 @@ Enables or disables debug raycasting for the simulation. This will render lines
|
|
204
204
|
|
205
205
|
</td><td>
|
206
206
|
|
207
|
-
|
207
|
+
Gets the contact manifolds for a pair of colliders.
|
208
208
|
|
209
209
|
|
210
210
|
</td></tr>
|
211
211
|
<tr><td>
|
212
212
|
|
213
|
-
[
|
213
|
+
[raycast(origin, direction, length, options)](./server.simulation.raycast.md)
|
214
214
|
|
215
215
|
|
216
216
|
</td><td>
|
@@ -218,7 +218,7 @@ Enables or disables debug rendering for the simulation. When enabled, all collid
|
|
218
218
|
|
219
219
|
</td><td>
|
220
220
|
|
221
|
-
|
221
|
+
Casts a ray through the simulation.
|
222
222
|
|
223
223
|
|
224
224
|
</td></tr>
|
@@ -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) > [Simulation](./server.simulation.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [raycast](./server.simulation.raycast.md)
|
4
4
|
|
5
|
-
## Simulation.
|
5
|
+
## Simulation.raycast() method
|
6
6
|
|
7
7
|
Casts a ray through the simulation.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
raycast(origin: RAPIER.Vector3, direction: RAPIER.Vector3, length: number, options?: RaycastOptions): RaycastHit | null;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -85,7 +85,7 @@ options
|
|
85
85
|
|
86
86
|
</td><td>
|
87
87
|
|
88
|
-
|
88
|
+
[RaycastOptions](./server.raycastoptions.md)
|
89
89
|
|
90
90
|
|
91
91
|
</td><td>
|
@@ -97,7 +97,11 @@ _(Optional)_ The options for the raycast.
|
|
97
97
|
</tbody></table>
|
98
98
|
**Returns:**
|
99
99
|
|
100
|
-
[
|
100
|
+
[RaycastHit](./server.raycasthit.md) \| null
|
101
101
|
|
102
|
-
|
102
|
+
A RaycastHit object containing the first block or entity hit by the ray, or null if no hit.
|
103
|
+
|
104
|
+
## Remarks
|
105
|
+
|
106
|
+
The cast ray will stop at the the first block or entity hit within the length of the ray.
|
103
107
|
|