hytopia 0.1.54 → 0.1.56

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.
Files changed (129) hide show
  1. package/docs/server.basecharactercontroller.attach.md +53 -0
  2. package/docs/server.basecharactercontroller.despawn.md +53 -0
  3. package/docs/server.basecharactercontroller.detach.md +53 -0
  4. package/docs/server.basecharactercontroller.md +91 -28
  5. package/docs/server.basecharactercontroller.onattach.md +13 -0
  6. package/docs/server.basecharactercontroller.ondespawn.md +13 -0
  7. package/docs/server.basecharactercontroller.ondetach.md +13 -0
  8. package/docs/server.basecharactercontroller.onspawn.md +13 -0
  9. package/docs/server.basecharactercontroller.ontick.md +2 -2
  10. package/docs/server.basecharactercontroller.ontickwithplayerinput.md +2 -2
  11. package/docs/server.basecharactercontroller.spawn.md +53 -0
  12. package/docs/server.basecharactercontroller.tick.md +15 -1
  13. package/docs/server.basecharactercontroller.tickwithplayerinput.md +17 -1
  14. package/docs/server.collider.bounciness.md +13 -0
  15. package/docs/server.collider.bouncinesscombinerule.md +13 -0
  16. package/docs/server.collider.collisiongroups.md +13 -0
  17. package/docs/{server.collider.getfriction.md → server.collider.friction.md} +4 -10
  18. package/docs/server.collider.frictioncombinerule.md +13 -0
  19. package/docs/server.collider.md +112 -63
  20. package/docs/server.collider.relativeposition.md +13 -0
  21. package/docs/server.collider.relativerotation.md +13 -0
  22. package/docs/{server.collider.setrelativetranslation.md → server.collider.setrelativeposition.md} +6 -6
  23. package/docs/server.collideroptions.md +6 -6
  24. package/docs/server.collideroptions.relativeposition.md +13 -0
  25. package/docs/server.defaultcharactercontroller._constructor_.md +1 -17
  26. package/docs/server.defaultcharactercontroller.attach.md +53 -0
  27. package/docs/server.defaultcharactercontroller.md +18 -4
  28. package/docs/server.defaultcharactercontroller.spawn.md +53 -0
  29. package/docs/server.defaultcharactercontroller.tickwithplayerinput.md +17 -1
  30. package/docs/server.entity.md +0 -19
  31. package/docs/server.entity.setcharactercontroller.md +2 -2
  32. package/docs/server.entityeventpayload.md +2 -2
  33. package/docs/server.entityeventpayload.updateposition.entity.md +11 -0
  34. package/docs/{server.entityeventpayload.updatetranslation.md → server.entityeventpayload.updateposition.md} +5 -5
  35. package/docs/server.entityeventpayload.updateposition.position.md +11 -0
  36. package/docs/server.entityeventtype.md +4 -4
  37. package/docs/server.entityoptions.charactercontroller.md +13 -0
  38. package/docs/server.entityoptions.md +3 -3
  39. package/docs/server.md +1 -1
  40. package/docs/server.movecallback.md +2 -2
  41. package/docs/server.movecompletecallback.md +1 -1
  42. package/docs/server.rigidbody.additionalmass.md +13 -0
  43. package/docs/server.rigidbody.additionalsolveriterations.md +13 -0
  44. package/docs/server.rigidbody.angulardamping.md +13 -0
  45. package/docs/server.rigidbody.angularvelocity.md +13 -0
  46. package/docs/server.rigidbody.directionfromrotation.md +13 -0
  47. package/docs/server.rigidbody.dominancegroup.md +13 -0
  48. package/docs/server.rigidbody.effectiveangularinertia.md +13 -0
  49. package/docs/server.rigidbody.effectiveinversemass.md +13 -0
  50. package/docs/server.rigidbody.effectiveworldinverseprincipalangularinertiasqrt.md +13 -0
  51. package/docs/server.rigidbody.enabledpositions.md +13 -0
  52. package/docs/server.rigidbody.enabledrotations.md +13 -0
  53. package/docs/server.rigidbody.gravityscale.md +13 -0
  54. package/docs/server.rigidbody.inversemass.md +13 -0
  55. package/docs/server.rigidbody.inverseprincipalangularinertiasqrt.md +13 -0
  56. package/docs/server.rigidbody.lineardamping.md +13 -0
  57. package/docs/server.rigidbody.linearvelocity.md +13 -0
  58. package/docs/server.rigidbody.localcenterofmass.md +13 -0
  59. package/docs/server.rigidbody.lockallpositions.md +17 -0
  60. package/docs/{server.rigidbody.getmass.md → server.rigidbody.mass.md} +4 -10
  61. package/docs/server.rigidbody.md +339 -150
  62. package/docs/server.rigidbody.nextkinematicposition.md +13 -0
  63. package/docs/server.rigidbody.nextkinematicrotation.md +13 -0
  64. package/docs/server.rigidbody.position.md +13 -0
  65. package/docs/server.rigidbody.principalangularinertia.md +13 -0
  66. package/docs/server.rigidbody.principalangularinertialocalframe.md +13 -0
  67. package/docs/server.rigidbody.rotation.md +13 -0
  68. package/docs/{server.rigidbody.setenabledtranslations.md → server.rigidbody.setenabledpositions.md} +6 -6
  69. package/docs/{server.rigidbody.setnextkinematictranslation.md → server.rigidbody.setnextkinematicposition.md} +6 -6
  70. package/docs/{server.rigidbody.settranslation.md → server.rigidbody.setposition.md} +6 -6
  71. package/docs/server.rigidbody.softccdprediction.md +13 -0
  72. package/docs/server.rigidbody.type.md +13 -0
  73. package/docs/server.rigidbody.worldcenterofmass.md +13 -0
  74. package/docs/server.rigidbodyoptions.enabledpositions.md +13 -0
  75. package/docs/server.rigidbodyoptions.md +19 -19
  76. package/docs/server.rigidbodyoptions.position.md +13 -0
  77. package/examples/block-entity/index.ts +3 -3
  78. package/examples/character-controller/MyCharacterController.ts +190 -119
  79. package/examples/character-controller/index.ts +5 -10
  80. package/examples/custom-ui/index.ts +2 -2
  81. package/examples/payload-game/index.ts +17 -18
  82. package/package.json +1 -1
  83. package/server.api.json +1461 -1203
  84. package/server.d.ts +181 -252
  85. package/server.js +85 -85
  86. package/docs/server.basecharactercontroller._constructor_.md +0 -65
  87. package/docs/server.basecharactercontroller.createcolliders.md +0 -19
  88. package/docs/server.basecharactercontroller.entity.md +0 -13
  89. package/docs/server.collider.getbounciness.md +0 -19
  90. package/docs/server.collider.getbouncinesscombinerule.md +0 -19
  91. package/docs/server.collider.getcollisiongroups.md +0 -19
  92. package/docs/server.collider.getfrictioncombinerule.md +0 -19
  93. package/docs/server.collider.getrelativerotation.md +0 -19
  94. package/docs/server.collider.getrelativetranslation.md +0 -19
  95. package/docs/server.collideroptions.relativetranslation.md +0 -13
  96. package/docs/server.defaultcharactercontroller.createcolliders.md +0 -19
  97. package/docs/server.entity.createcustomcharactercontroller.md +0 -13
  98. package/docs/server.entityeventpayload.updatetranslation.entity.md +0 -11
  99. package/docs/server.entityeventpayload.updatetranslation.translation.md +0 -11
  100. package/docs/server.entityoptions.createcustomcharactercontroller.md +0 -13
  101. package/docs/server.rigidbody.getadditionalmass.md +0 -19
  102. package/docs/server.rigidbody.getadditionalsolveriterations.md +0 -19
  103. package/docs/server.rigidbody.getangulardamping.md +0 -19
  104. package/docs/server.rigidbody.getangularvelocity.md +0 -19
  105. package/docs/server.rigidbody.getdirectionfromrotation.md +0 -19
  106. package/docs/server.rigidbody.getdominancegroup.md +0 -19
  107. package/docs/server.rigidbody.geteffectiveangularinertia.md +0 -19
  108. package/docs/server.rigidbody.geteffectiveinversemass.md +0 -19
  109. package/docs/server.rigidbody.geteffectiveworldinverseprincipalangularinertiasqrt.md +0 -19
  110. package/docs/server.rigidbody.getenabledrotations.md +0 -19
  111. package/docs/server.rigidbody.getenabledtranslations.md +0 -19
  112. package/docs/server.rigidbody.getgravityscale.md +0 -19
  113. package/docs/server.rigidbody.getinversemass.md +0 -19
  114. package/docs/server.rigidbody.getinverseprincipalangularinertiasqrt.md +0 -19
  115. package/docs/server.rigidbody.getlineardamping.md +0 -19
  116. package/docs/server.rigidbody.getlinearvelocity.md +0 -19
  117. package/docs/server.rigidbody.getlocalcenterofmass.md +0 -19
  118. package/docs/server.rigidbody.getnextkinematicrotation.md +0 -19
  119. package/docs/server.rigidbody.getnextkinematictranslation.md +0 -19
  120. package/docs/server.rigidbody.getprincipalangularinertia.md +0 -19
  121. package/docs/server.rigidbody.getprincipalangularinertialocalframe.md +0 -19
  122. package/docs/server.rigidbody.getrotation.md +0 -19
  123. package/docs/server.rigidbody.getsoftccdprediction.md +0 -19
  124. package/docs/server.rigidbody.gettranslation.md +0 -19
  125. package/docs/server.rigidbody.gettype.md +0 -19
  126. package/docs/server.rigidbody.getworldcenterofmass.md +0 -19
  127. package/docs/server.rigidbody.lockalltranslations.md +0 -17
  128. package/docs/server.rigidbodyoptions.enabledtranslations.md +0 -13
  129. package/docs/server.rigidbodyoptions.translation.md +0 -13
package/server.d.ts CHANGED
@@ -287,48 +287,82 @@ export declare interface AudioOptions {
287
287
  * @public
288
288
  */
289
289
  export declare abstract class BaseCharacterController {
290
- /** The entity the controller is for. */
291
- readonly entity: Entity;
292
290
  /**
293
- * A callback function for when the controller ticks.
294
- * @param deltaTimeMs - The delta time in milliseconds since the last tick.
291
+ * A function that is called every tick. Useful for implementing
292
+ * tick logic without writing a new character controller class.
295
293
  */
296
- onTick?: (deltaTimeMs: number) => void;
294
+ onTick?: (entity: Entity, deltaTimeMs: number) => void;
297
295
  /**
298
- * A callback function for when the controller ticks
299
- * player movement.
300
- * @param input - The current input state of the player.
301
- * @param cameraOrientation - The current camera orientation state of the player.
302
- * @param deltaTimeMs - The delta time in milliseconds since the last tick.
296
+ * A function that is called every tick with player input by a
297
+ * PlayerEntity with this controller attached. Useful for implementing
298
+ * tick logic without writing a new character controller class.
299
+ */
300
+ onTickWithPlayerInput?: (entity: PlayerEntity, input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number) => void;
301
+ /**
302
+ * A function that is called when the controller is attached to an entity.
303
+ * Useful for implementing attach logic without writing a
304
+ * new character controller class.
305
+ */
306
+ onAttach?: (entity: Entity) => void;
307
+ /**
308
+ * A function that is called when the controlled entity is despawned.
309
+ * Useful for implementing despawn logic without writing a
310
+ * new character controller class.
311
+ */
312
+ onDespawn?: (entity: Entity) => void;
313
+ /**
314
+ * A function that is called when the controller is detached from an entity.
315
+ * Useful for implementing detach logic without writing a
316
+ * new character controller class.
317
+ */
318
+ onDetach?: (entity: Entity) => void;
319
+ /**
320
+ * A function that is called when the controlled entity is spawned.
321
+ * Useful for implementing spawn logic without writing a
322
+ * new character controller class.
323
+ */
324
+ onSpawn?: (entity: Entity) => void;
325
+ /**
326
+ * Override this method to handle the attachment of an entity
327
+ * to your character controller.
328
+ * @param entity - The entity to attach the controller to.
329
+ */
330
+ attach(entity: Entity): void;
331
+ /**
332
+ * Override this method to handle the despawn of an entity
333
+ * from your character controller.
334
+ * @param entity - The entity to despawn.
303
335
  */
304
- onTickWithPlayerInput?: (input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number) => void;
336
+ despawn(entity: Entity): void;
305
337
  /**
306
- * @param entity - The entity the controller is for.
307
- * @param _options - Arbitrary options you may provide or omit for your controller implementation.
338
+ * Override this method to handle the detachment of an entity
339
+ * from your character controller.
340
+ * @param entity - The entity to detach.
308
341
  */
309
- constructor(entity: Entity, _options?: Record<string, unknown>);
342
+ detach(entity: Entity): void;
310
343
  /**
311
- * Override this method to create controller specific colliders
312
- * to be attached to the controlled entity when it spawns.
313
- * @returns An array of colliders.
344
+ * Override this method to handle the spawning of an entity
345
+ * to your character controller.
346
+ * @param entity - The entity to spawn.
314
347
  */
315
- createColliders(): Collider[];
348
+ spawn(entity: Entity): void;
316
349
  /**
317
350
  * Override this method to handle entity movements
318
351
  * based on player input for your character controller.
319
352
  * This is called every tick by a PlayerEntity with a
320
353
  * character controller.
354
+ * @param entity - The entity to tick.
321
355
  * @param input - The current input state of the player.
322
356
  * @param cameraOrientation - The current camera orientation state of the player.
323
357
  * @param deltaTimeMs - The delta time in milliseconds since the last tick.
324
358
  */
325
- tickWithPlayerInput(input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
359
+ tickWithPlayerInput(entity: PlayerEntity, input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
326
360
  /**
327
361
  * Override this method to handle entity movements
328
362
  * based on your character controller.
329
363
  * @param deltaTimeMs - The delta time in milliseconds since the last tick.
330
364
  */
331
- tick(deltaTimeMs: number): void;
365
+ tick(entity: Entity, deltaTimeMs: number): void;
332
366
  }
333
367
 
334
368
  /**
@@ -826,6 +860,16 @@ export declare class Collider {
826
860
  * @param colliderOptions - The options for the collider instance.
827
861
  */
828
862
  constructor(colliderOptions: ColliderOptions);
863
+ /** The bounciness of the collider. */
864
+ get bounciness(): number;
865
+ /** The bounciness combine rule of the collider. */
866
+ get bouncinessCombineRule(): CoefficientCombineRule;
867
+ /** The collision groups the collider belongs to. */
868
+ get collisionGroups(): CollisionGroups;
869
+ /** The friction of the collider. */
870
+ get friction(): number;
871
+ /** The friction combine rule of the collider. */
872
+ get frictionCombineRule(): CoefficientCombineRule;
829
873
  /** Whether the collider is enabled. */
830
874
  get isEnabled(): boolean;
831
875
  /** Whether the collider has been removed from the simulation. */
@@ -838,45 +882,14 @@ export declare class Collider {
838
882
  get parentRigidBody(): RigidBody | undefined;
839
883
  /** The raw collider object from the Rapier physics engine. */
840
884
  get rawCollider(): RAPIER.Collider | undefined;
885
+ /** The relative position of the collider to its parent rigid body. */
886
+ get relativePosition(): Vector3Like;
887
+ /** The relative rotation of the collider. */
888
+ get relativeRotation(): QuaternionLike;
841
889
  /** The shape of the collider. */
842
890
  get shape(): ColliderShape;
843
891
  /** An arbitrary identifier tag of the collider. Useful for your own logic. */
844
892
  get tag(): string | undefined;
845
- /**
846
- * Gets the bounciness of the collider.
847
- * @returns The bounciness of the collider.
848
- */
849
- getBounciness(): number;
850
- /**
851
- * Gets the bounciness combine rule of the collider.
852
- * @returns The bounciness combine rule of the collider.
853
- */
854
- getBouncinessCombineRule(): CoefficientCombineRule;
855
- /**
856
- * Gets the collision groups the collider belongs to.
857
- * @returns The collision groups the collider belongs to.
858
- */
859
- getCollisionGroups(): CollisionGroups;
860
- /**
861
- * Gets the friction of the collider.
862
- * @returns The friction of the collider.
863
- */
864
- getFriction(): number;
865
- /**
866
- * Gets the friction combine rule of the collider.
867
- * @returns The friction combine rule of the collider.
868
- */
869
- getFrictionCombineRule(): CoefficientCombineRule;
870
- /**
871
- * Gets the relative rotation of the collider.
872
- * @returns The relative rotation of the collider.
873
- */
874
- getRelativeRotation(): QuaternionLike;
875
- /**
876
- * Gets the relative translation of the collider to its parent rigid body.
877
- * @returns The relative translation of the collider.
878
- */
879
- getRelativeTranslation(): Vector3Like;
880
893
  /**
881
894
  * Sets the bounciness of the collider.
882
895
  * @param bounciness - The bounciness of the collider.
@@ -923,10 +936,10 @@ export declare class Collider {
923
936
  */
924
937
  setRelativeRotation(rotation: QuaternionLike): void;
925
938
  /**
926
- * Sets the relative translation of the collider to its parent rigid body.
927
- * @param translation - The relative translation of the collider.
939
+ * Sets the relative position of the collider to its parent rigid body.
940
+ * @param position - The relative position of the collider.
928
941
  */
929
- setRelativeTranslation(translation: Vector3Like): void;
942
+ setRelativePosition(position: Vector3Like): void;
930
943
  /**
931
944
  * Sets whether the collider is a sensor.
932
945
  * @param sensor - Whether the collider is a sensor.
@@ -1000,10 +1013,10 @@ export declare interface ColliderOptions {
1000
1013
  parentRigidBody?: RigidBody;
1001
1014
  /** The radius of the collider if the shape is a ball, capsule, cone, cylinder, or round cylinder. */
1002
1015
  radius?: number;
1016
+ /** The relative position of the collider. Relative to parent rigid body. */
1017
+ relativePosition?: Vector3Like;
1003
1018
  /** The relative rotation of the collider. Relative to parent rigid body. */
1004
1019
  relativeRotation?: QuaternionLike;
1005
- /** The relative translation of the collider. Relative to parent rigid body. */
1006
- relativeTranslation?: Vector3Like;
1007
1020
  /** The simulation the collider is in, if provided the collider will automatically be added to the simulation. */
1008
1021
  simulation?: Simulation;
1009
1022
  /** An arbitrary identifier tag of the collider. Useful for your own logic. */
@@ -1219,10 +1232,9 @@ export declare class DefaultCharacterController extends BaseCharacterController
1219
1232
 
1220
1233
 
1221
1234
  /**
1222
- * @param entity - The entity the controller is for.
1223
1235
  * @param options - Options for the controller.
1224
1236
  */
1225
- constructor(entity: Entity, options?: DefaultCharacterControllerOptions);
1237
+ constructor(options?: DefaultCharacterControllerOptions);
1226
1238
  /** Whether the entity is grounded. */
1227
1239
  get isGrounded(): boolean;
1228
1240
  /** Whether the entity is on a platform, a platform is any entity with a kinematic rigid body. */
@@ -1230,19 +1242,27 @@ export declare class DefaultCharacterController extends BaseCharacterController
1230
1242
  /** The platform the entity is on, if any. */
1231
1243
  get platform(): Entity | undefined;
1232
1244
  /**
1233
- * Creates the colliders for the character controller,
1234
- * overriding the default implementation.
1235
- * @returns An array of colliders.
1245
+ * Called when the controller is attached to an entity.
1246
+ * @param entity - The entity to attach the controller to.
1247
+ */
1248
+ attach(entity: Entity): void;
1249
+ /**
1250
+ * Called when the controlled entity is spawned.
1251
+ * In DefaultCharacterController, this function is used to create
1252
+ * the colliders for the entity for wall and ground detection.
1253
+ * @param entity - The entity that is spawned.
1236
1254
  */
1237
- createColliders(): Collider[];
1255
+ spawn(entity: Entity): void;
1238
1256
  /**
1239
1257
  * Ticks the player movement for the character controller,
1240
1258
  * overriding the default implementation.
1259
+ *
1260
+ * @param entity - The entity to tick.
1241
1261
  * @param input - The current input state of the player.
1242
1262
  * @param cameraOrientation - The current camera orientation state of the player.
1243
1263
  * @param deltaTimeMs - The delta time in milliseconds since the last tick.
1244
1264
  */
1245
- tickWithPlayerInput(input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
1265
+ tickWithPlayerInput(entity: PlayerEntity, input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
1246
1266
  }
1247
1267
 
1248
1268
  /** Options for creating a DefaultCharacterController instance. @public */
@@ -1297,12 +1317,6 @@ export declare interface DefaultCharacterControllerOptions {
1297
1317
  * @public
1298
1318
  */
1299
1319
  export declare class Entity extends RigidBody implements protocol.Serializable {
1300
- /**
1301
- * A function that creates a custom character controller for the entity when it spawns.
1302
- * @param entity - The Entity instance the character controller is created for.
1303
- * @returns A character controller that extends {@link BaseCharacterController}.
1304
- */
1305
- createCustomCharacterController?: (entity: Entity) => BaseCharacterController;
1306
1320
  /**
1307
1321
  * A function that is called when the entity collides with a block.
1308
1322
  *
@@ -1426,7 +1440,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
1426
1440
  * Sets the character controller for the entity.
1427
1441
  * @param characterController - The character controller to set.
1428
1442
  */
1429
- setCharacterController(characterController: BaseCharacterController): void;
1443
+ setCharacterController(characterController: BaseCharacterController | undefined): void;
1430
1444
  /**
1431
1445
  * Sets the nodes to hide on the entity's model. Matched nodes
1432
1446
  * will be hidden for all players. Uses case insensitive
@@ -1507,13 +1521,13 @@ export declare namespace EntityEventPayload {
1507
1521
  entity: Entity;
1508
1522
  animations: Set<string>;
1509
1523
  }
1510
- export interface UpdateRotation {
1524
+ export interface UpdatePosition {
1511
1525
  entity: Entity;
1512
- rotation: QuaternionLike;
1526
+ position: Vector3Like;
1513
1527
  }
1514
- export interface UpdateTranslation {
1528
+ export interface UpdateRotation {
1515
1529
  entity: Entity;
1516
- translation: Vector3Like;
1530
+ rotation: QuaternionLike;
1517
1531
  }
1518
1532
  }
1519
1533
 
@@ -1526,8 +1540,8 @@ export declare enum EntityEventType {
1526
1540
  START_MODEL_LOOPED_ANIMATIONS = "ENTITY.START_MODEL_LOOPED_ANIMATIONS",
1527
1541
  START_MODEL_ONESHOT_ANIMATIONS = "ENTITY.START_MODEL_ONESHOT_ANIMATIONS",
1528
1542
  STOP_MODEL_ANIMATIONS = "ENTITY.STOP_MODEL_ANIMATIONS",
1529
- UPDATE_ROTATION = "ENTITY.UPDATE_ROTATION",
1530
- UPDATE_TRANSLATION = "ENTITY.UPDATE_TRANSLATION"
1543
+ UPDATE_POSITION = "ENTITY.UPDATE_POSITION",
1544
+ UPDATE_ROTATION = "ENTITY.UPDATE_ROTATION"
1531
1545
  }
1532
1546
 
1533
1547
  /**
@@ -1596,12 +1610,8 @@ export declare interface EntityOptions {
1596
1610
  blockHalfExtents?: Vector3Like;
1597
1611
  /** The texture uri of a entity if the entity is a block entity, if set rigidBodyOptions collider shape [0] must be a block */
1598
1612
  blockTextureUri?: string;
1599
- /**
1600
- * A function that creates a custom character controller for the entity when it spawns.
1601
- * @param entity - The Entity instance.
1602
- * @returns A character controller that extends {@link BaseCharacterController}.
1603
- */
1604
- createCustomCharacterController?: (entity: Entity) => BaseCharacterController;
1613
+ /** The character controller to use for the entity. */
1614
+ characterController?: BaseCharacterController;
1605
1615
  /** The URI or path to the .gltf model asset to be used for the entity. */
1606
1616
  modelUri?: string;
1607
1617
  /** The nodes to hide on the entity's model. */
@@ -1771,22 +1781,22 @@ export declare enum GameServerEventType {
1771
1781
 
1772
1782
  /**
1773
1783
  * A callback function called when the entity associated with the
1774
- * SimpleCharacterController updates its translation as it is
1784
+ * SimpleCharacterController updates its position as it is
1775
1785
  * attempting to move to a target coordinate.
1776
- * @param currentTranslation - The current translation of the entity.
1777
- * @param targetTranslation - The target translation of the entity.
1786
+ * @param currentPosition - The current position of the entity.
1787
+ * @param targetPosition - The target position of the entity.
1778
1788
  * @public
1779
1789
  */
1780
- export declare type MoveCallback = (currentTranslation: Vector3Like, targetTranslation: Vector3Like) => void;
1790
+ export declare type MoveCallback = (currentPosition: Vector3Like, targetPosition: Vector3Like) => void;
1781
1791
 
1782
1792
  /**
1783
1793
  * A callback function called when the entity associated with the
1784
1794
  * SimpleCharacterController reaches the target coordinate. An entity
1785
1795
  * must reach the x,y,z coordinate for the callback to be called.
1786
- * @param endTranslation - The translation of the entity after it has finished moving.
1796
+ * @param endPosition - The position of the entity after it has finished moving.
1787
1797
  * @public
1788
1798
  */
1789
- export declare type MoveCompleteCallback = (endTranslation: Vector3Like) => void;
1799
+ export declare type MoveCompleteCallback = (endPosition: Vector3Like) => void;
1790
1800
 
1791
1801
  /**
1792
1802
  * Options for the {@link SimpleCharacterController.move} method.
@@ -2505,8 +2515,36 @@ export declare class RigidBody {
2505
2515
  * @param options - The options for the rigid body instance.
2506
2516
  */
2507
2517
  constructor(options: RigidBodyOptions);
2518
+ /** The additional mass of the rigid body. */
2519
+ get additionalMass(): number;
2520
+ /** The additional solver iterations of the rigid body. */
2521
+ get additionalSolverIterations(): number;
2522
+ /** The angular damping of the rigid body. */
2523
+ get angularDamping(): number;
2524
+ /** The angular velocity of the rigid body. */
2525
+ get angularVelocity(): Vector3Like;
2508
2526
  /** The colliders of the rigid body. */
2509
2527
  get colliders(): Set<Collider>;
2528
+ /** The dominance group of the rigid body. */
2529
+ get dominanceGroup(): number;
2530
+ /** The direction from the rotation of the rigid body. */
2531
+ get directionFromRotation(): Vector3Like;
2532
+ /** The effective angular inertia of the rigid body. */
2533
+ get effectiveAngularInertia(): SpdMatrix3 | undefined;
2534
+ /** The effective inverse mass of the rigid body. */
2535
+ get effectiveInverseMass(): Vector3Like | undefined;
2536
+ /** The effective world inverse principal angular inertia square root of the rigid body. */
2537
+ get effectiveWorldInversePrincipalAngularInertiaSqrt(): SpdMatrix3 | undefined;
2538
+ /** The enabled axes of rotational movement of the rigid body. */
2539
+ get enabledRotations(): Vector3Boolean;
2540
+ /** The enabled axes of positional movement of the rigid body. */
2541
+ get enabledPositions(): Vector3Boolean;
2542
+ /** The gravity scale of the rigid body. */
2543
+ get gravityScale(): number;
2544
+ /** The inverse mass of the rigid body. */
2545
+ get inverseMass(): number | undefined;
2546
+ /** The inverse principal angular inertia square root of the rigid body. */
2547
+ get inversePrincipalAngularInertiaSqrt(): Vector3Like | undefined;
2510
2548
  /** Whether the rigid body has continuous collision detection enabled. */
2511
2549
  get isCcdEnabled(): boolean;
2512
2550
  /** Whether the rigid body is dynamic. */
@@ -2529,151 +2567,36 @@ export declare class RigidBody {
2529
2567
  get isSimulated(): boolean;
2530
2568
  /** Whether the rigid body is sleeping. */
2531
2569
  get isSleeping(): boolean;
2570
+ /** The linear damping of the rigid body. */
2571
+ get linearDamping(): number;
2572
+ /** The linear velocity of the rigid body. */
2573
+ get linearVelocity(): Vector3Like;
2574
+ /** The local center of mass of the rigid body. */
2575
+ get localCenterOfMass(): Vector3Like;
2576
+ /** The mass of the rigid body. */
2577
+ get mass(): number;
2578
+ /** The next kinematic rotation of the rigid body. */
2579
+ get nextKinematicRotation(): QuaternionLike;
2580
+ /** The next kinematic position of the rigid body. */
2581
+ get nextKinematicPosition(): Vector3Like;
2532
2582
  /** The number of colliders in the rigid body. */
2533
2583
  get numColliders(): number;
2584
+ /** The principal angular inertia of the rigid body. */
2585
+ get principalAngularInertia(): Vector3Like;
2586
+ /** The principal angular inertia local frame of the rigid body. */
2587
+ get principalAngularInertiaLocalFrame(): QuaternionLike | undefined;
2588
+ /** The position of the rigid body. */
2589
+ get position(): Vector3Like;
2534
2590
  /** The raw RAPIER rigid body instance. */
2535
2591
  get rawRigidBody(): RAPIER.RigidBody | undefined;
2536
- /**
2537
- * Gets the additional mass of the rigid body.
2538
- * @returns The additional mass of the rigid body.
2539
- */
2540
- getAdditionalMass(): number;
2541
- /**
2542
- * Gets the additional solver iterations of the rigid body.
2543
- * @returns The additional solver iterations of the rigid body.
2544
- */
2545
- getAdditionalSolverIterations(): number;
2546
- /**
2547
- * Gets the angular damping of the rigid body.
2548
- * @returns The angular damping of the rigid body.
2549
- */
2550
- getAngularDamping(): number;
2551
- /**
2552
- * Gets the angular velocity of the rigid body.
2553
- * @returns The angular velocity of the rigid body.
2554
- */
2555
- getAngularVelocity(): Vector3Like;
2556
- /**
2557
- * Gets the colliders of the rigid body by tag.
2558
- * @param tag - The tag to filter by.
2559
- * @returns The colliders of the rigid body with the given tag.
2560
- */
2561
- getCollidersByTag(tag: string): Collider[];
2562
- /**
2563
- * Gets the dominance group of the rigid body.
2564
- * @returns The dominance group of the rigid body.
2565
- */
2566
- getDominanceGroup(): number;
2567
- /**
2568
- * Gets the direction from the rotation of the rigid body.
2569
- * @returns The direction from the rotation of the rigid body.
2570
- */
2571
- getDirectionFromRotation(): Vector3Like;
2572
- /**
2573
- * Gets the effective angular inertia of the rigid body.
2574
- * @returns The effective angular inertia of the rigid body.
2575
- */
2576
- getEffectiveAngularInertia(): SpdMatrix3 | undefined;
2577
- /**
2578
- * Gets the effective inverse mass of the rigid body.
2579
- * @returns The effective inverse mass of the rigid body.
2580
- */
2581
- getEffectiveInverseMass(): Vector3Like | undefined;
2582
- /**
2583
- * Gets the effective world inverse principal angular inertia square root of the rigid body.
2584
- * @returns The effective world inverse principal angular inertia square root of the rigid body.
2585
- */
2586
- getEffectiveWorldInversePrincipalAngularInertiaSqrt(): SpdMatrix3 | undefined;
2587
- /**
2588
- * Gets the enabled rotations of the rigid body.
2589
- * @returns The enabled rotations of the rigid body.
2590
- */
2591
- getEnabledRotations(): Vector3Boolean;
2592
- /**
2593
- * Gets the enabled translations of the rigid body.
2594
- * @returns The enabled translations of the rigid body.
2595
- */
2596
- getEnabledTranslations(): Vector3Boolean;
2597
- /**
2598
- * Gets the gravity scale of the rigid body.
2599
- * @returns The gravity scale of the rigid body.
2600
- */
2601
- getGravityScale(): number;
2602
- /**
2603
- * Gets the inverse mass of the rigid body.
2604
- * @returns The inverse mass of the rigid body.
2605
- */
2606
- getInverseMass(): number | undefined;
2607
- /**
2608
- * Gets the inverse principal angular inertia square root of the rigid body.
2609
- * @returns The inverse principal angular inertia square root of the rigid body.
2610
- */
2611
- getInversePrincipalAngularInertiaSqrt(): Vector3Like | undefined;
2612
- /**
2613
- * Gets the linear damping of the rigid body.
2614
- * @returns The linear damping of the rigid body.
2615
- */
2616
- getLinearDamping(): number;
2617
- /**
2618
- * Gets the linear velocity of the rigid body.
2619
- * @returns The linear velocity of the rigid body.
2620
- */
2621
- getLinearVelocity(): Vector3Like;
2622
- /**
2623
- * Gets the local center of mass of the rigid body.
2624
- * @returns The local center of mass of the rigid body.
2625
- */
2626
- getLocalCenterOfMass(): Vector3Like;
2627
- /**
2628
- * Gets the mass of the rigid body.
2629
- * @returns The mass of the rigid body.
2630
- */
2631
- getMass(): number;
2632
- /**
2633
- * Gets the next kinematic rotation of the rigid body.
2634
- * @returns The next kinematic rotation of the rigid body.
2635
- */
2636
- getNextKinematicRotation(): QuaternionLike;
2637
- /**
2638
- * Gets the next kinematic translation of the rigid body.
2639
- * @returns The next kinematic translation of the rigid body.
2640
- */
2641
- getNextKinematicTranslation(): Vector3Like;
2642
- /**
2643
- * Gets the principal angular inertia of the rigid body.
2644
- * @returns The principal angular inertia of the rigid body.
2645
- */
2646
- getPrincipalAngularInertia(): Vector3Like;
2647
- /**
2648
- * Gets the principal angular inertia local frame of the rigid body.
2649
- * @returns The principal angular inertia local frame of the rigid body.
2650
- */
2651
- getPrincipalAngularInertiaLocalFrame(): QuaternionLike | undefined;
2652
- /**
2653
- * Gets the rotation of the rigid body.
2654
- * @returns The rotation of the rigid body.
2655
- */
2656
- getRotation(): QuaternionLike;
2657
- /**
2658
- * Gets the soft ccd prediction of the rigid body.
2659
- * @returns The soft ccd prediction of the rigid body.
2660
- */
2661
- getSoftCcdPrediction(): number;
2662
- /**
2663
- * Gets the translation of the rigid body.
2664
- * @returns The translation of the rigid body.
2665
- */
2666
- getTranslation(): Vector3Like;
2667
- /**
2668
- * Gets the type of the rigid body.
2669
- * @returns The type of the rigid body.
2670
- */
2671
- getType(): RigidBodyType;
2672
- /**
2673
- * Gets the world center of mass of the rigid body.
2674
- * @returns The world center of mass of the rigid body.
2675
- */
2676
- getWorldCenterOfMass(): Vector3Like | undefined;
2592
+ /** The rotation of the rigid body. */
2593
+ get rotation(): QuaternionLike;
2594
+ /** The soft continuous collision detection prediction of the rigid body. */
2595
+ get softCcdPrediction(): number;
2596
+ /** The type of the rigid body. */
2597
+ get type(): RigidBodyType;
2598
+ /** The world center of mass of the rigid body. */
2599
+ get worldCenterOfMass(): Vector3Like | undefined;
2677
2600
  /**
2678
2601
  * Sets the additional mass of the rigid body.
2679
2602
  * @param additionalMass - The additional mass of the rigid body.
@@ -2714,16 +2637,16 @@ export declare class RigidBody {
2714
2637
  * @param enabled - Whether the rigid body is enabled.
2715
2638
  */
2716
2639
  setEnabled(enabled: boolean): void;
2640
+ /**
2641
+ * Sets whether the rigid body has enabled positional movement.
2642
+ * @param enabledPositions - Whether the rigid body has enabled positional movement.
2643
+ */
2644
+ setEnabledPositions(enabledPositions: Vector3Boolean): void;
2717
2645
  /**
2718
2646
  * Sets whether the rigid body has enabled rotations.
2719
2647
  * @param enabledRotations - Whether the rigid body has enabled rotations.
2720
2648
  */
2721
2649
  setEnabledRotations(enabledRotations: Vector3Boolean): void;
2722
- /**
2723
- * Sets whether the rigid body has enabled translations.
2724
- * @param enabledTranslations - Whether the rigid body has enabled translations.
2725
- */
2726
- setEnabledTranslations(enabledTranslations: Vector3Boolean): void;
2727
2650
  /**
2728
2651
  * Sets the gravity scale of the rigid body.
2729
2652
  * @param gravityScale - The gravity scale of the rigid body.
@@ -2745,10 +2668,15 @@ export declare class RigidBody {
2745
2668
  */
2746
2669
  setNextKinematicRotation(nextKinematicRotation: QuaternionLike): void;
2747
2670
  /**
2748
- * Sets the next kinematic translation of the rigid body.
2749
- * @param nextKinematicTranslation - The next kinematic translation of the rigid body.
2671
+ * Sets the next kinematic position of the rigid body.
2672
+ * @param nextKinematicPosition - The next kinematic position of the rigid body.
2750
2673
  */
2751
- setNextKinematicTranslation(nextKinematicTranslation: Vector3Like): void;
2674
+ setNextKinematicPosition(nextKinematicPosition: Vector3Like): void;
2675
+ /**
2676
+ * Sets the position of the rigid body.
2677
+ * @param position - The position of the rigid body.
2678
+ */
2679
+ setPosition(position: Vector3Like): void;
2752
2680
  /**
2753
2681
  * Sets the rotation of the rigid body.
2754
2682
  * @param rotation - The rotation of the rigid body.
@@ -2769,11 +2697,6 @@ export declare class RigidBody {
2769
2697
  * @param collisionGroups - The collision groups for solid colliders of the rigid body.
2770
2698
  */
2771
2699
  setCollisionGroupsForSolidColliders(collisionGroups: CollisionGroups): void;
2772
- /**
2773
- * Sets the translation of the rigid body.
2774
- * @param translation - The translation of the rigid body.
2775
- */
2776
- setTranslation(translation: Vector3Like): void;
2777
2700
  /**
2778
2701
  * Sets the type of the rigid body.
2779
2702
  * @param type - The type of the rigid body.
@@ -2827,15 +2750,21 @@ export declare class RigidBody {
2827
2750
  * @returns The child colliders that were added to the rigid body.
2828
2751
  */
2829
2752
  createAndAddChildCollidersToSimulation(colliderOptions: ColliderOptions[]): Collider[];
2753
+ /**
2754
+ * Gets the colliders of the rigid body by tag.
2755
+ * @param tag - The tag to filter by.
2756
+ * @returns The colliders of the rigid body with the given tag.
2757
+ */
2758
+ getCollidersByTag(tag: string): Collider[];
2830
2759
 
2831
2760
  /**
2832
2761
  * Locks all rotations of the rigid body.
2833
2762
  */
2834
2763
  lockAllRotations(): void;
2835
2764
  /**
2836
- * Locks all translations of the rigid body.
2765
+ * Locks all positional movement of the rigid body.
2837
2766
  */
2838
- lockAllTranslations(): void;
2767
+ lockAllPositions(): void;
2839
2768
  /**
2840
2769
  * Removes the rigid body from the simulation it belongs to.
2841
2770
  */
@@ -2895,16 +2824,18 @@ export declare interface RigidBodyOptions {
2895
2824
  dominanceGroup?: number;
2896
2825
  /** Whether the rigid body is enabled. */
2897
2826
  enabled?: boolean;
2827
+ /** The enabled axes of positional movement of the rigid body. */
2828
+ enabledPositions?: Vector3Boolean;
2898
2829
  /** The enabled rotations of the rigid body. */
2899
2830
  enabledRotations?: Vector3Boolean;
2900
- /** The enabled translations of the rigid body. */
2901
- enabledTranslations?: Vector3Boolean;
2902
2831
  /** The gravity scale of the rigid body. */
2903
2832
  gravityScale?: number;
2904
2833
  /** The linear damping of the rigid body. */
2905
2834
  linearDamping?: number;
2906
2835
  /** The linear velocity of the rigid body. */
2907
2836
  linearVelocity?: Vector3Like;
2837
+ /** The position of the rigid body. */
2838
+ position?: Vector3Like;
2908
2839
  /** The rotation of the rigid body. */
2909
2840
  rotation?: QuaternionLike;
2910
2841
  /** The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation. */
@@ -2913,8 +2844,6 @@ export declare interface RigidBodyOptions {
2913
2844
  sleeping?: boolean;
2914
2845
  /** The soft continuous collision detection prediction of the rigid body. */
2915
2846
  softCcdPrediction?: number;
2916
- /** The translation of the rigid body. */
2917
- translation?: Vector3Like;
2918
2847
  }
2919
2848
 
2920
2849
  /** The types a RigidBody can be. @public */