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.
@@ -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. This is called every tick by a PlayerEntity with a character controller.
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. This is called every tick by a PlayerEntity with a character controller.
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
 
@@ -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) =&gt; void
205
+ (blockType: [BlockType](./server.blocktype.md)<!-- -->, entity: [Entity](./server.entity.md)<!-- -->, contactForceData: [ContactForceData](./server.contactforcedata.md)<!-- -->) =&gt; 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) &gt; [server](./server.md) &gt; [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) &gt; [server](./server.md) &gt; [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
+
@@ -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) =&gt; void
405
+ (entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, contactForceData: [ContactForceData](./server.contactforcedata.md)<!-- -->) =&gt; 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) =&gt; void
462
+ (entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, contactForceData: [ContactForceData](./server.contactforcedata.md)<!-- -->) =&gt; 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) &gt; [server](./server.md) &gt; [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) &gt; [server](./server.md) &gt; [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
+ ```
@@ -65,7 +65,7 @@ The handle of the second collider.
65
65
  </tbody></table>
66
66
  **Returns:**
67
67
 
68
- ContactManifold\[\]
68
+ [ContactManifold](./server.contactmanifold.md)<!-- -->\[\]
69
69
 
70
70
  The contact manifolds, or an empty array if no contact.
71
71
 
@@ -168,7 +168,7 @@ Description
168
168
  </th></tr></thead>
169
169
  <tbody><tr><td>
170
170
 
171
- [castRay(origin, direction, length, options)](./server.simulation.castray.md)
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
- Casts a ray through the simulation.
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
- [enableDebugRaycasting(enabled)](./server.simulation.enabledebugraycasting.md)
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 raycasting for the simulation. This will render lines for the raycast that disappear after a few seconds.
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
- [enableDebugRendering(enabled)](./server.simulation.enabledebugrendering.md)
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
- 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.
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
- [getContactManifolds(colliderHandleA, colliderHandleB)](./server.simulation.getcontactmanifolds.md)
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
- Gets the contact manifolds for a pair of colliders.
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) &gt; [server](./server.md) &gt; [Simulation](./server.simulation.md) &gt; [castRay](./server.simulation.castray.md)
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [Simulation](./server.simulation.md) &gt; [raycast](./server.simulation.raycast.md)
4
4
 
5
- ## Simulation.castRay() method
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
- castRay(origin: RAPIER.Vector3, direction: RAPIER.Vector3, length: number, options?: RayCastOptions): Block | Entity | null;
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
- RayCastOptions
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
- [Block](./server.block.md) \| [Entity](./server.entity.md) \| null
100
+ [RaycastHit](./server.raycasthit.md) \| null
101
101
 
102
- The first block or entity hit by the ray, or null if no hit.
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
 
@@ -1,4 +1,4 @@
1
- <html></html>
1
+ <html>
2
2
  <body>
3
3
  <!--
4
4
  The Hytopia-ui script MUST be included, otherwise your
@@ -39,4 +39,4 @@
39
39
  </style>
40
40
  <div class="crosshair"></div>
41
41
  </body>
42
- </html>
42
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {