hytopia 0.1.54 → 0.1.55
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.collider.bounciness.md +13 -0
- package/docs/server.collider.bouncinesscombinerule.md +13 -0
- package/docs/server.collider.collisiongroups.md +13 -0
- package/docs/{server.collider.getfriction.md → server.collider.friction.md} +4 -10
- package/docs/server.collider.frictioncombinerule.md +13 -0
- package/docs/server.collider.md +112 -63
- package/docs/server.collider.relativeposition.md +13 -0
- package/docs/server.collider.relativerotation.md +13 -0
- package/docs/{server.collider.setrelativetranslation.md → server.collider.setrelativeposition.md} +6 -6
- package/docs/server.collideroptions.md +6 -6
- package/docs/server.collideroptions.relativeposition.md +13 -0
- package/docs/server.entityeventpayload.md +2 -2
- package/docs/server.entityeventpayload.updateposition.entity.md +11 -0
- package/docs/{server.entityeventpayload.updatetranslation.md → server.entityeventpayload.updateposition.md} +5 -5
- package/docs/server.entityeventpayload.updateposition.position.md +11 -0
- package/docs/server.entityeventtype.md +4 -4
- package/docs/server.md +1 -1
- package/docs/server.movecallback.md +2 -2
- package/docs/server.movecompletecallback.md +1 -1
- package/docs/server.rigidbody.additionalmass.md +13 -0
- package/docs/server.rigidbody.additionalsolveriterations.md +13 -0
- package/docs/server.rigidbody.angulardamping.md +13 -0
- package/docs/server.rigidbody.angularvelocity.md +13 -0
- package/docs/server.rigidbody.directionfromrotation.md +13 -0
- package/docs/server.rigidbody.dominancegroup.md +13 -0
- package/docs/server.rigidbody.effectiveangularinertia.md +13 -0
- package/docs/server.rigidbody.effectiveinversemass.md +13 -0
- package/docs/server.rigidbody.effectiveworldinverseprincipalangularinertiasqrt.md +13 -0
- package/docs/server.rigidbody.enabledpositions.md +13 -0
- package/docs/server.rigidbody.enabledrotations.md +13 -0
- package/docs/server.rigidbody.gravityscale.md +13 -0
- package/docs/server.rigidbody.inversemass.md +13 -0
- package/docs/server.rigidbody.inverseprincipalangularinertiasqrt.md +13 -0
- package/docs/server.rigidbody.lineardamping.md +13 -0
- package/docs/server.rigidbody.linearvelocity.md +13 -0
- package/docs/server.rigidbody.localcenterofmass.md +13 -0
- package/docs/server.rigidbody.lockallpositions.md +17 -0
- package/docs/{server.rigidbody.getmass.md → server.rigidbody.mass.md} +4 -10
- package/docs/server.rigidbody.md +339 -150
- package/docs/server.rigidbody.nextkinematicposition.md +13 -0
- package/docs/server.rigidbody.nextkinematicrotation.md +13 -0
- package/docs/server.rigidbody.position.md +13 -0
- package/docs/server.rigidbody.principalangularinertia.md +13 -0
- package/docs/server.rigidbody.principalangularinertialocalframe.md +13 -0
- package/docs/server.rigidbody.rotation.md +13 -0
- package/docs/{server.rigidbody.setenabledtranslations.md → server.rigidbody.setenabledpositions.md} +6 -6
- package/docs/{server.rigidbody.setnextkinematictranslation.md → server.rigidbody.setnextkinematicposition.md} +6 -6
- package/docs/{server.rigidbody.settranslation.md → server.rigidbody.setposition.md} +6 -6
- package/docs/server.rigidbody.softccdprediction.md +13 -0
- package/docs/server.rigidbody.type.md +13 -0
- package/docs/server.rigidbody.worldcenterofmass.md +13 -0
- package/docs/server.rigidbodyoptions.enabledpositions.md +13 -0
- package/docs/server.rigidbodyoptions.md +19 -19
- package/docs/server.rigidbodyoptions.position.md +13 -0
- package/examples/block-entity/index.ts +2 -2
- package/examples/custom-ui/index.ts +1 -1
- package/examples/payload-game/index.ts +11 -11
- package/package.json +1 -1
- package/server.api.json +981 -1015
- package/server.d.ts +110 -212
- package/server.js +67 -67
- package/docs/server.collider.getbounciness.md +0 -19
- package/docs/server.collider.getbouncinesscombinerule.md +0 -19
- package/docs/server.collider.getcollisiongroups.md +0 -19
- package/docs/server.collider.getfrictioncombinerule.md +0 -19
- package/docs/server.collider.getrelativerotation.md +0 -19
- package/docs/server.collider.getrelativetranslation.md +0 -19
- package/docs/server.collideroptions.relativetranslation.md +0 -13
- package/docs/server.entityeventpayload.updatetranslation.entity.md +0 -11
- package/docs/server.entityeventpayload.updatetranslation.translation.md +0 -11
- package/docs/server.rigidbody.getadditionalmass.md +0 -19
- package/docs/server.rigidbody.getadditionalsolveriterations.md +0 -19
- package/docs/server.rigidbody.getangulardamping.md +0 -19
- package/docs/server.rigidbody.getangularvelocity.md +0 -19
- package/docs/server.rigidbody.getdirectionfromrotation.md +0 -19
- package/docs/server.rigidbody.getdominancegroup.md +0 -19
- package/docs/server.rigidbody.geteffectiveangularinertia.md +0 -19
- package/docs/server.rigidbody.geteffectiveinversemass.md +0 -19
- package/docs/server.rigidbody.geteffectiveworldinverseprincipalangularinertiasqrt.md +0 -19
- package/docs/server.rigidbody.getenabledrotations.md +0 -19
- package/docs/server.rigidbody.getenabledtranslations.md +0 -19
- package/docs/server.rigidbody.getgravityscale.md +0 -19
- package/docs/server.rigidbody.getinversemass.md +0 -19
- package/docs/server.rigidbody.getinverseprincipalangularinertiasqrt.md +0 -19
- package/docs/server.rigidbody.getlineardamping.md +0 -19
- package/docs/server.rigidbody.getlinearvelocity.md +0 -19
- package/docs/server.rigidbody.getlocalcenterofmass.md +0 -19
- package/docs/server.rigidbody.getnextkinematicrotation.md +0 -19
- package/docs/server.rigidbody.getnextkinematictranslation.md +0 -19
- package/docs/server.rigidbody.getprincipalangularinertia.md +0 -19
- package/docs/server.rigidbody.getprincipalangularinertialocalframe.md +0 -19
- package/docs/server.rigidbody.getrotation.md +0 -19
- package/docs/server.rigidbody.getsoftccdprediction.md +0 -19
- package/docs/server.rigidbody.gettranslation.md +0 -19
- package/docs/server.rigidbody.gettype.md +0 -19
- package/docs/server.rigidbody.getworldcenterofmass.md +0 -19
- package/docs/server.rigidbody.lockalltranslations.md +0 -17
- package/docs/server.rigidbodyoptions.enabledtranslations.md +0 -13
- package/docs/server.rigidbodyoptions.translation.md +0 -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) > [RigidBody](./server.rigidbody.md) > [nextKinematicPosition](./server.rigidbody.nextkinematicposition.md)
|
4
|
+
|
5
|
+
## RigidBody.nextKinematicPosition property
|
6
|
+
|
7
|
+
The next kinematic position of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get nextKinematicPosition(): Vector3Like;
|
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) > [RigidBody](./server.rigidbody.md) > [nextKinematicRotation](./server.rigidbody.nextkinematicrotation.md)
|
4
|
+
|
5
|
+
## RigidBody.nextKinematicRotation property
|
6
|
+
|
7
|
+
The next kinematic rotation of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get nextKinematicRotation(): QuaternionLike;
|
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) > [RigidBody](./server.rigidbody.md) > [position](./server.rigidbody.position.md)
|
4
|
+
|
5
|
+
## RigidBody.position property
|
6
|
+
|
7
|
+
The position of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get position(): Vector3Like;
|
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) > [RigidBody](./server.rigidbody.md) > [principalAngularInertia](./server.rigidbody.principalangularinertia.md)
|
4
|
+
|
5
|
+
## RigidBody.principalAngularInertia property
|
6
|
+
|
7
|
+
The principal angular inertia of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get principalAngularInertia(): Vector3Like;
|
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) > [RigidBody](./server.rigidbody.md) > [principalAngularInertiaLocalFrame](./server.rigidbody.principalangularinertialocalframe.md)
|
4
|
+
|
5
|
+
## RigidBody.principalAngularInertiaLocalFrame property
|
6
|
+
|
7
|
+
The principal angular inertia local frame of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get principalAngularInertiaLocalFrame(): QuaternionLike | undefined;
|
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) > [RigidBody](./server.rigidbody.md) > [rotation](./server.rigidbody.rotation.md)
|
4
|
+
|
5
|
+
## RigidBody.rotation property
|
6
|
+
|
7
|
+
The rotation of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get rotation(): QuaternionLike;
|
13
|
+
```
|
package/docs/{server.rigidbody.setenabledtranslations.md → server.rigidbody.setenabledpositions.md}
RENAMED
@@ -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) > [RigidBody](./server.rigidbody.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [RigidBody](./server.rigidbody.md) > [setEnabledPositions](./server.rigidbody.setenabledpositions.md)
|
4
4
|
|
5
|
-
## RigidBody.
|
5
|
+
## RigidBody.setEnabledPositions() method
|
6
6
|
|
7
|
-
Sets whether the rigid body has enabled
|
7
|
+
Sets whether the rigid body has enabled positional movement.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
setEnabledPositions(enabledPositions: Vector3Boolean): void;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -32,7 +32,7 @@ Description
|
|
32
32
|
</th></tr></thead>
|
33
33
|
<tbody><tr><td>
|
34
34
|
|
35
|
-
|
35
|
+
enabledPositions
|
36
36
|
|
37
37
|
|
38
38
|
</td><td>
|
@@ -42,7 +42,7 @@ enabledTranslations
|
|
42
42
|
|
43
43
|
</td><td>
|
44
44
|
|
45
|
-
Whether the rigid body has enabled
|
45
|
+
Whether the rigid body has enabled positional movement.
|
46
46
|
|
47
47
|
|
48
48
|
</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) > [RigidBody](./server.rigidbody.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [RigidBody](./server.rigidbody.md) > [setNextKinematicPosition](./server.rigidbody.setnextkinematicposition.md)
|
4
4
|
|
5
|
-
## RigidBody.
|
5
|
+
## RigidBody.setNextKinematicPosition() method
|
6
6
|
|
7
|
-
Sets the next kinematic
|
7
|
+
Sets the next kinematic position of the rigid body.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
setNextKinematicPosition(nextKinematicPosition: Vector3Like): void;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -32,7 +32,7 @@ Description
|
|
32
32
|
</th></tr></thead>
|
33
33
|
<tbody><tr><td>
|
34
34
|
|
35
|
-
|
35
|
+
nextKinematicPosition
|
36
36
|
|
37
37
|
|
38
38
|
</td><td>
|
@@ -42,7 +42,7 @@ nextKinematicTranslation
|
|
42
42
|
|
43
43
|
</td><td>
|
44
44
|
|
45
|
-
The next kinematic
|
45
|
+
The next kinematic position of the rigid body.
|
46
46
|
|
47
47
|
|
48
48
|
</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) > [RigidBody](./server.rigidbody.md) > [
|
3
|
+
[Home](./index.md) > [server](./server.md) > [RigidBody](./server.rigidbody.md) > [setPosition](./server.rigidbody.setposition.md)
|
4
4
|
|
5
|
-
## RigidBody.
|
5
|
+
## RigidBody.setPosition() method
|
6
6
|
|
7
|
-
Sets the
|
7
|
+
Sets the position of the rigid body.
|
8
8
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
|
12
|
+
setPosition(position: Vector3Like): void;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -32,7 +32,7 @@ Description
|
|
32
32
|
</th></tr></thead>
|
33
33
|
<tbody><tr><td>
|
34
34
|
|
35
|
-
|
35
|
+
position
|
36
36
|
|
37
37
|
|
38
38
|
</td><td>
|
@@ -42,7 +42,7 @@ translation
|
|
42
42
|
|
43
43
|
</td><td>
|
44
44
|
|
45
|
-
The
|
45
|
+
The position of the rigid body.
|
46
46
|
|
47
47
|
|
48
48
|
</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) > [RigidBody](./server.rigidbody.md) > [softCcdPrediction](./server.rigidbody.softccdprediction.md)
|
4
|
+
|
5
|
+
## RigidBody.softCcdPrediction property
|
6
|
+
|
7
|
+
The soft continuous collision detection prediction of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get softCcdPrediction(): number;
|
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) > [RigidBody](./server.rigidbody.md) > [type](./server.rigidbody.type.md)
|
4
|
+
|
5
|
+
## RigidBody.type property
|
6
|
+
|
7
|
+
The type of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get type(): RigidBodyType;
|
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) > [RigidBody](./server.rigidbody.md) > [worldCenterOfMass](./server.rigidbody.worldcenterofmass.md)
|
4
|
+
|
5
|
+
## RigidBody.worldCenterOfMass property
|
6
|
+
|
7
|
+
The world center of mass of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get worldCenterOfMass(): Vector3Like | undefined;
|
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) > [RigidBodyOptions](./server.rigidbodyoptions.md) > [enabledPositions](./server.rigidbodyoptions.enabledpositions.md)
|
4
|
+
|
5
|
+
## RigidBodyOptions.enabledPositions property
|
6
|
+
|
7
|
+
The enabled axes of positional movement of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
enabledPositions?: Vector3Boolean;
|
13
|
+
```
|
@@ -208,7 +208,7 @@ _(Optional)_ Whether the rigid body is enabled.
|
|
208
208
|
</td></tr>
|
209
209
|
<tr><td>
|
210
210
|
|
211
|
-
[
|
211
|
+
[enabledPositions?](./server.rigidbodyoptions.enabledpositions.md)
|
212
212
|
|
213
213
|
|
214
214
|
</td><td>
|
@@ -221,13 +221,13 @@ _(Optional)_ Whether the rigid body is enabled.
|
|
221
221
|
|
222
222
|
</td><td>
|
223
223
|
|
224
|
-
_(Optional)_ The enabled
|
224
|
+
_(Optional)_ The enabled axes of positional movement of the rigid body.
|
225
225
|
|
226
226
|
|
227
227
|
</td></tr>
|
228
228
|
<tr><td>
|
229
229
|
|
230
|
-
[
|
230
|
+
[enabledRotations?](./server.rigidbodyoptions.enabledrotations.md)
|
231
231
|
|
232
232
|
|
233
233
|
</td><td>
|
@@ -240,7 +240,7 @@ _(Optional)_ The enabled rotations of the rigid body.
|
|
240
240
|
|
241
241
|
</td><td>
|
242
242
|
|
243
|
-
_(Optional)_ The enabled
|
243
|
+
_(Optional)_ The enabled rotations of the rigid body.
|
244
244
|
|
245
245
|
|
246
246
|
</td></tr>
|
@@ -303,7 +303,7 @@ _(Optional)_ The linear velocity of the rigid body.
|
|
303
303
|
</td></tr>
|
304
304
|
<tr><td>
|
305
305
|
|
306
|
-
[
|
306
|
+
[position?](./server.rigidbodyoptions.position.md)
|
307
307
|
|
308
308
|
|
309
309
|
</td><td>
|
@@ -311,18 +311,18 @@ _(Optional)_ The linear velocity of the rigid body.
|
|
311
311
|
|
312
312
|
</td><td>
|
313
313
|
|
314
|
-
[
|
314
|
+
[Vector3Like](./server.vector3like.md)
|
315
315
|
|
316
316
|
|
317
317
|
</td><td>
|
318
318
|
|
319
|
-
_(Optional)_ The
|
319
|
+
_(Optional)_ The position of the rigid body.
|
320
320
|
|
321
321
|
|
322
322
|
</td></tr>
|
323
323
|
<tr><td>
|
324
324
|
|
325
|
-
[
|
325
|
+
[rotation?](./server.rigidbodyoptions.rotation.md)
|
326
326
|
|
327
327
|
|
328
328
|
</td><td>
|
@@ -330,18 +330,18 @@ _(Optional)_ The rotation of the rigid body.
|
|
330
330
|
|
331
331
|
</td><td>
|
332
332
|
|
333
|
-
[
|
333
|
+
[QuaternionLike](./server.quaternionlike.md)
|
334
334
|
|
335
335
|
|
336
336
|
</td><td>
|
337
337
|
|
338
|
-
_(Optional)_ The
|
338
|
+
_(Optional)_ The rotation of the rigid body.
|
339
339
|
|
340
340
|
|
341
341
|
</td></tr>
|
342
342
|
<tr><td>
|
343
343
|
|
344
|
-
[
|
344
|
+
[simulation?](./server.rigidbodyoptions.simulation.md)
|
345
345
|
|
346
346
|
|
347
347
|
</td><td>
|
@@ -349,18 +349,18 @@ _(Optional)_ The simulation the rigid body is in. If provided, the rigid body wi
|
|
349
349
|
|
350
350
|
</td><td>
|
351
351
|
|
352
|
-
|
352
|
+
[Simulation](./server.simulation.md)
|
353
353
|
|
354
354
|
|
355
355
|
</td><td>
|
356
356
|
|
357
|
-
_(Optional)_
|
357
|
+
_(Optional)_ The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation.
|
358
358
|
|
359
359
|
|
360
360
|
</td></tr>
|
361
361
|
<tr><td>
|
362
362
|
|
363
|
-
[
|
363
|
+
[sleeping?](./server.rigidbodyoptions.sleeping.md)
|
364
364
|
|
365
365
|
|
366
366
|
</td><td>
|
@@ -368,18 +368,18 @@ _(Optional)_ Whether the rigid body is sleeping.
|
|
368
368
|
|
369
369
|
</td><td>
|
370
370
|
|
371
|
-
|
371
|
+
boolean
|
372
372
|
|
373
373
|
|
374
374
|
</td><td>
|
375
375
|
|
376
|
-
_(Optional)_
|
376
|
+
_(Optional)_ Whether the rigid body is sleeping.
|
377
377
|
|
378
378
|
|
379
379
|
</td></tr>
|
380
380
|
<tr><td>
|
381
381
|
|
382
|
-
[
|
382
|
+
[softCcdPrediction?](./server.rigidbodyoptions.softccdprediction.md)
|
383
383
|
|
384
384
|
|
385
385
|
</td><td>
|
@@ -387,12 +387,12 @@ _(Optional)_ The soft continuous collision detection prediction of the rigid bod
|
|
387
387
|
|
388
388
|
</td><td>
|
389
389
|
|
390
|
-
|
390
|
+
number
|
391
391
|
|
392
392
|
|
393
393
|
</td><td>
|
394
394
|
|
395
|
-
_(Optional)_ The
|
395
|
+
_(Optional)_ The soft continuous collision detection prediction of the rigid body.
|
396
396
|
|
397
397
|
|
398
398
|
</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) > [RigidBodyOptions](./server.rigidbodyoptions.md) > [position](./server.rigidbodyoptions.position.md)
|
4
|
+
|
5
|
+
## RigidBodyOptions.position property
|
6
|
+
|
7
|
+
The position of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
position?: Vector3Like;
|
13
|
+
```
|
@@ -47,7 +47,7 @@ startServer(world => {
|
|
47
47
|
|
48
48
|
// Clamp the z range the platform moves back and forth between
|
49
49
|
blockPlatform.onTick = blockPlatform => {
|
50
|
-
const position = blockPlatform.
|
50
|
+
const position = blockPlatform.position;
|
51
51
|
|
52
52
|
if (position.z < -9) {
|
53
53
|
blockPlatform.setLinearVelocity({ x: 0, y: 0, z: 3 });
|
@@ -168,7 +168,7 @@ startServer(world => {
|
|
168
168
|
|
169
169
|
// pathfind to the player's entity
|
170
170
|
const blockPetCharacterController = blockPet.characterController as SimpleCharacterController;
|
171
|
-
const targetPosition = targetPlayerEntity.
|
171
|
+
const targetPosition = targetPlayerEntity.position;
|
172
172
|
blockPetCharacterController.move(targetPosition, 3);
|
173
173
|
blockPetCharacterController.face(targetPosition, 1);
|
174
174
|
}
|
@@ -75,7 +75,7 @@ function updatePlayerList() {
|
|
75
75
|
// For each player, return their username and current position
|
76
76
|
return {
|
77
77
|
username: player.username,
|
78
|
-
position: entity.
|
78
|
+
position: entity.position, // Gets x,y,z coordinate
|
79
79
|
};
|
80
80
|
});
|
81
81
|
|
@@ -151,7 +151,7 @@ startServer(world => { // Perform our game setup logic in the startServer init c
|
|
151
151
|
// physics engine we use where entities despawned to not trigger a collision
|
152
152
|
// event for leaving a sensor. This is a workaround till a better solution is found.
|
153
153
|
world.entityManager.getAllPlayerEntities(player).forEach(entity => {
|
154
|
-
entity.
|
154
|
+
entity.setPosition({ x: 0, y: 100, z: 0 });
|
155
155
|
setTimeout(() => entity.despawn(), 50); // Despawn after a short delay so we step the physics after translating it so leaving the sensor registers.
|
156
156
|
});
|
157
157
|
|
@@ -254,8 +254,8 @@ function spawnBullet(world: World, coordinate: Vector3Like, direction: Vector3Li
|
|
254
254
|
// Apply knockback, the knockback effect is less if the spider is larger, and more if it is smaller
|
255
255
|
// because of how the physics simulation applies forces relative to automatically calculated mass from the spider's
|
256
256
|
// size
|
257
|
-
const bulletDirection = bullet.
|
258
|
-
const mass = otherEntity.
|
257
|
+
const bulletDirection = bullet.directionFromRotation;
|
258
|
+
const mass = otherEntity.mass;
|
259
259
|
const knockback = 14 * mass;
|
260
260
|
|
261
261
|
otherEntity.applyImpulse({
|
@@ -266,7 +266,7 @@ function spawnBullet(world: World, coordinate: Vector3Like, direction: Vector3Li
|
|
266
266
|
|
267
267
|
if (enemyHealth[otherEntity.id!] <= 0) {
|
268
268
|
// YEET the spider before despawning it so it registers leaving the sensor
|
269
|
-
otherEntity.
|
269
|
+
otherEntity.setPosition({ x: 0, y: 100, z: 0 });
|
270
270
|
setTimeout(() => { otherEntity.despawn(); }, 50); // Despawn after a short delay so we step the physics after translating it so leaving the sensor registers.
|
271
271
|
}
|
272
272
|
|
@@ -399,7 +399,7 @@ function spawnSpider(world: World, coordinate: Vector3Like) {
|
|
399
399
|
|
400
400
|
spider.onEntityCollision = (spider: Entity, entity: Entity, started: boolean) => { // If the spider hits a player, deal damage and apply knockback
|
401
401
|
if (started && entity instanceof PlayerEntity && entity.isSpawned) {
|
402
|
-
const spiderDirection = spider.
|
402
|
+
const spiderDirection = spider.directionFromRotation;
|
403
403
|
const knockback = 4 * randomScaleMultiplier;
|
404
404
|
|
405
405
|
entity.applyImpulse({
|
@@ -466,19 +466,19 @@ function onTickPathfindEnemy(entity: Entity, targetPlayers: Set<PlayerEntity>, s
|
|
466
466
|
const targetPlayer = targetPlayers.values().next().value as PlayerEntity | undefined;
|
467
467
|
|
468
468
|
enemyPathfindingTargets[entityId] = targetPlayer?.isSpawned
|
469
|
-
? targetPlayer.
|
470
|
-
: payloadEntity.
|
469
|
+
? targetPlayer.position
|
470
|
+
: payloadEntity.position;
|
471
471
|
|
472
472
|
enemyPathfindAccumulators[entityId] -= PATHFIND_ACCUMULATOR_THRESHOLD;
|
473
473
|
|
474
474
|
// Make the spider jump if its close to the target player
|
475
|
-
const currentPosition = entity.
|
475
|
+
const currentPosition = entity.position;
|
476
476
|
const dx = enemyPathfindingTargets[entityId].x - currentPosition.x;
|
477
477
|
const dz = enemyPathfindingTargets[entityId].z - currentPosition.z;
|
478
478
|
const distance = Math.sqrt(dx * dx + dz * dz);
|
479
479
|
|
480
480
|
if (distance < 10) {
|
481
|
-
const mass = entity.
|
481
|
+
const mass = entity.mass;
|
482
482
|
entity.applyImpulse({ x: 0, y: (10 * Math.random() + 5) * mass, z: 0 });
|
483
483
|
}
|
484
484
|
|
@@ -501,7 +501,7 @@ function onTickWithPlayerInput(this: DefaultCharacterController, input: PlayerIn
|
|
501
501
|
if (input.ml) {
|
502
502
|
const world = this.entity.world;
|
503
503
|
const entity = this.entity;
|
504
|
-
const direction = Vector3.fromVector3Like(entity.
|
504
|
+
const direction = Vector3.fromVector3Like(entity.directionFromRotation);
|
505
505
|
|
506
506
|
direction.y = Math.sin(cameraOrientation.pitch);
|
507
507
|
|
@@ -516,7 +516,7 @@ function onTickWithPlayerInput(this: DefaultCharacterController, input: PlayerIn
|
|
516
516
|
this.entity.startModelOneshotAnimations([ 'shoot' ]);
|
517
517
|
|
518
518
|
// Adjust bullet origin roughly for camera offset so crosshair is accurate
|
519
|
-
const bulletOrigin = entity.
|
519
|
+
const bulletOrigin = entity.position;
|
520
520
|
bulletOrigin.y += 0.65;
|
521
521
|
|
522
522
|
const bullet = spawnBullet(world, bulletOrigin, direction);
|