hytopia 0.1.53 → 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.
Files changed (109) hide show
  1. package/docs/server.block.getneighborglobalcoordinatefromhitpoint.md +55 -0
  2. package/docs/server.block.md +34 -0
  3. package/docs/server.collider.bounciness.md +13 -0
  4. package/docs/server.collider.bouncinesscombinerule.md +13 -0
  5. package/docs/server.collider.collisiongroups.md +13 -0
  6. package/docs/{server.collider.getfriction.md → server.collider.friction.md} +4 -10
  7. package/docs/server.collider.frictioncombinerule.md +13 -0
  8. package/docs/server.collider.md +112 -63
  9. package/docs/server.collider.relativeposition.md +13 -0
  10. package/docs/server.collider.relativerotation.md +13 -0
  11. package/docs/{server.collider.setrelativetranslation.md → server.collider.setrelativeposition.md} +6 -6
  12. package/docs/server.collideroptions.md +6 -6
  13. package/docs/server.collideroptions.relativeposition.md +13 -0
  14. package/docs/server.entityeventpayload.md +2 -2
  15. package/docs/server.entityeventpayload.updateposition.entity.md +11 -0
  16. package/docs/{server.entityeventpayload.updatetranslation.md → server.entityeventpayload.updateposition.md} +5 -5
  17. package/docs/server.entityeventpayload.updateposition.position.md +11 -0
  18. package/docs/server.entityeventtype.md +4 -4
  19. package/docs/server.md +6 -2
  20. package/docs/server.movecallback.md +2 -2
  21. package/docs/server.movecompletecallback.md +1 -1
  22. package/docs/server.player.md +0 -21
  23. package/docs/server.playercamera.facingdirection.md +13 -0
  24. package/docs/server.playercamera.md +42 -0
  25. package/docs/server.playercamera.orientation.md +13 -0
  26. package/docs/server.playercameramode.md +2 -0
  27. package/docs/server.playeruieventtype.md +1 -1
  28. package/docs/server.raycasthit.md +4 -1
  29. package/docs/server.rigidbody.additionalmass.md +13 -0
  30. package/docs/server.rigidbody.additionalsolveriterations.md +13 -0
  31. package/docs/server.rigidbody.angulardamping.md +13 -0
  32. package/docs/server.rigidbody.angularvelocity.md +13 -0
  33. package/docs/server.rigidbody.directionfromrotation.md +13 -0
  34. package/docs/server.rigidbody.dominancegroup.md +13 -0
  35. package/docs/server.rigidbody.effectiveangularinertia.md +13 -0
  36. package/docs/server.rigidbody.effectiveinversemass.md +13 -0
  37. package/docs/server.rigidbody.effectiveworldinverseprincipalangularinertiasqrt.md +13 -0
  38. package/docs/server.rigidbody.enabledpositions.md +13 -0
  39. package/docs/server.rigidbody.enabledrotations.md +13 -0
  40. package/docs/server.rigidbody.gravityscale.md +13 -0
  41. package/docs/server.rigidbody.inversemass.md +13 -0
  42. package/docs/server.rigidbody.inverseprincipalangularinertiasqrt.md +13 -0
  43. package/docs/server.rigidbody.lineardamping.md +13 -0
  44. package/docs/server.rigidbody.linearvelocity.md +13 -0
  45. package/docs/server.rigidbody.localcenterofmass.md +13 -0
  46. package/docs/server.rigidbody.lockallpositions.md +17 -0
  47. package/docs/{server.rigidbody.getmass.md → server.rigidbody.mass.md} +4 -10
  48. package/docs/server.rigidbody.md +339 -150
  49. package/docs/server.rigidbody.nextkinematicposition.md +13 -0
  50. package/docs/server.rigidbody.nextkinematicrotation.md +13 -0
  51. package/docs/server.rigidbody.position.md +13 -0
  52. package/docs/server.rigidbody.principalangularinertia.md +13 -0
  53. package/docs/server.rigidbody.principalangularinertialocalframe.md +13 -0
  54. package/docs/server.rigidbody.rotation.md +13 -0
  55. package/docs/{server.rigidbody.setenabledtranslations.md → server.rigidbody.setenabledpositions.md} +6 -6
  56. package/docs/{server.rigidbody.setnextkinematictranslation.md → server.rigidbody.setnextkinematicposition.md} +6 -6
  57. package/docs/{server.rigidbody.settranslation.md → server.rigidbody.setposition.md} +6 -6
  58. package/docs/server.rigidbody.softccdprediction.md +13 -0
  59. package/docs/server.rigidbody.type.md +13 -0
  60. package/docs/server.rigidbody.worldcenterofmass.md +13 -0
  61. package/docs/server.rigidbodyoptions.enabledpositions.md +13 -0
  62. package/docs/server.rigidbodyoptions.md +19 -19
  63. package/docs/server.rigidbodyoptions.position.md +13 -0
  64. package/examples/block-entity/index.ts +2 -2
  65. package/examples/custom-ui/index.ts +1 -1
  66. package/examples/payload-game/index.ts +11 -11
  67. package/package.json +1 -1
  68. package/server.api.json +1089 -1055
  69. package/server.d.ts +132 -218
  70. package/server.js +67 -67
  71. package/docs/server.collider.getbounciness.md +0 -19
  72. package/docs/server.collider.getbouncinesscombinerule.md +0 -19
  73. package/docs/server.collider.getcollisiongroups.md +0 -19
  74. package/docs/server.collider.getfrictioncombinerule.md +0 -19
  75. package/docs/server.collider.getrelativerotation.md +0 -19
  76. package/docs/server.collider.getrelativetranslation.md +0 -19
  77. package/docs/server.collideroptions.relativetranslation.md +0 -13
  78. package/docs/server.entityeventpayload.updatetranslation.entity.md +0 -11
  79. package/docs/server.entityeventpayload.updatetranslation.translation.md +0 -11
  80. package/docs/server.player.cameraorientation.md +0 -13
  81. package/docs/server.rigidbody.getadditionalmass.md +0 -19
  82. package/docs/server.rigidbody.getadditionalsolveriterations.md +0 -19
  83. package/docs/server.rigidbody.getangulardamping.md +0 -19
  84. package/docs/server.rigidbody.getangularvelocity.md +0 -19
  85. package/docs/server.rigidbody.getdirectionfromrotation.md +0 -19
  86. package/docs/server.rigidbody.getdominancegroup.md +0 -19
  87. package/docs/server.rigidbody.geteffectiveangularinertia.md +0 -19
  88. package/docs/server.rigidbody.geteffectiveinversemass.md +0 -19
  89. package/docs/server.rigidbody.geteffectiveworldinverseprincipalangularinertiasqrt.md +0 -19
  90. package/docs/server.rigidbody.getenabledrotations.md +0 -19
  91. package/docs/server.rigidbody.getenabledtranslations.md +0 -19
  92. package/docs/server.rigidbody.getgravityscale.md +0 -19
  93. package/docs/server.rigidbody.getinversemass.md +0 -19
  94. package/docs/server.rigidbody.getinverseprincipalangularinertiasqrt.md +0 -19
  95. package/docs/server.rigidbody.getlineardamping.md +0 -19
  96. package/docs/server.rigidbody.getlinearvelocity.md +0 -19
  97. package/docs/server.rigidbody.getlocalcenterofmass.md +0 -19
  98. package/docs/server.rigidbody.getnextkinematicrotation.md +0 -19
  99. package/docs/server.rigidbody.getnextkinematictranslation.md +0 -19
  100. package/docs/server.rigidbody.getprincipalangularinertia.md +0 -19
  101. package/docs/server.rigidbody.getprincipalangularinertialocalframe.md +0 -19
  102. package/docs/server.rigidbody.getrotation.md +0 -19
  103. package/docs/server.rigidbody.getsoftccdprediction.md +0 -19
  104. package/docs/server.rigidbody.gettranslation.md +0 -19
  105. package/docs/server.rigidbody.gettype.md +0 -19
  106. package/docs/server.rigidbody.getworldcenterofmass.md +0 -19
  107. package/docs/server.rigidbody.lockalltranslations.md +0 -17
  108. package/docs/server.rigidbodyoptions.enabledtranslations.md +0 -13
  109. package/docs/server.rigidbodyoptions.translation.md +0 -13
package/server.d.ts CHANGED
@@ -348,6 +348,14 @@ export declare class Block {
348
348
  readonly blockType: BlockType;
349
349
 
350
350
 
351
+ /**
352
+ * Gets the most adjacent neighbor global coordinate of this block
353
+ * based on a relative hit point, typically from a raycast.
354
+ *
355
+ * @param hitPoint - The hit point on this block to get the neighbor coordinate from.
356
+ * @returns A neighbor global coordinate of this block based on the hit point.
357
+ */
358
+ getNeighborGlobalCoordinateFromHitPoint(hitPoint: Vector3Like): Vector3Like;
351
359
  }
352
360
 
353
361
  /**
@@ -818,6 +826,16 @@ export declare class Collider {
818
826
  * @param colliderOptions - The options for the collider instance.
819
827
  */
820
828
  constructor(colliderOptions: ColliderOptions);
829
+ /** The bounciness of the collider. */
830
+ get bounciness(): number;
831
+ /** The bounciness combine rule of the collider. */
832
+ get bouncinessCombineRule(): CoefficientCombineRule;
833
+ /** The collision groups the collider belongs to. */
834
+ get collisionGroups(): CollisionGroups;
835
+ /** The friction of the collider. */
836
+ get friction(): number;
837
+ /** The friction combine rule of the collider. */
838
+ get frictionCombineRule(): CoefficientCombineRule;
821
839
  /** Whether the collider is enabled. */
822
840
  get isEnabled(): boolean;
823
841
  /** Whether the collider has been removed from the simulation. */
@@ -830,45 +848,14 @@ export declare class Collider {
830
848
  get parentRigidBody(): RigidBody | undefined;
831
849
  /** The raw collider object from the Rapier physics engine. */
832
850
  get rawCollider(): RAPIER.Collider | undefined;
851
+ /** The relative position of the collider to its parent rigid body. */
852
+ get relativePosition(): Vector3Like;
853
+ /** The relative rotation of the collider. */
854
+ get relativeRotation(): QuaternionLike;
833
855
  /** The shape of the collider. */
834
856
  get shape(): ColliderShape;
835
857
  /** An arbitrary identifier tag of the collider. Useful for your own logic. */
836
858
  get tag(): string | undefined;
837
- /**
838
- * Gets the bounciness of the collider.
839
- * @returns The bounciness of the collider.
840
- */
841
- getBounciness(): number;
842
- /**
843
- * Gets the bounciness combine rule of the collider.
844
- * @returns The bounciness combine rule of the collider.
845
- */
846
- getBouncinessCombineRule(): CoefficientCombineRule;
847
- /**
848
- * Gets the collision groups the collider belongs to.
849
- * @returns The collision groups the collider belongs to.
850
- */
851
- getCollisionGroups(): CollisionGroups;
852
- /**
853
- * Gets the friction of the collider.
854
- * @returns The friction of the collider.
855
- */
856
- getFriction(): number;
857
- /**
858
- * Gets the friction combine rule of the collider.
859
- * @returns The friction combine rule of the collider.
860
- */
861
- getFrictionCombineRule(): CoefficientCombineRule;
862
- /**
863
- * Gets the relative rotation of the collider.
864
- * @returns The relative rotation of the collider.
865
- */
866
- getRelativeRotation(): QuaternionLike;
867
- /**
868
- * Gets the relative translation of the collider to its parent rigid body.
869
- * @returns The relative translation of the collider.
870
- */
871
- getRelativeTranslation(): Vector3Like;
872
859
  /**
873
860
  * Sets the bounciness of the collider.
874
861
  * @param bounciness - The bounciness of the collider.
@@ -915,10 +902,10 @@ export declare class Collider {
915
902
  */
916
903
  setRelativeRotation(rotation: QuaternionLike): void;
917
904
  /**
918
- * Sets the relative translation of the collider to its parent rigid body.
919
- * @param translation - The relative translation of the collider.
905
+ * Sets the relative position of the collider to its parent rigid body.
906
+ * @param position - The relative position of the collider.
920
907
  */
921
- setRelativeTranslation(translation: Vector3Like): void;
908
+ setRelativePosition(position: Vector3Like): void;
922
909
  /**
923
910
  * Sets whether the collider is a sensor.
924
911
  * @param sensor - Whether the collider is a sensor.
@@ -992,10 +979,10 @@ export declare interface ColliderOptions {
992
979
  parentRigidBody?: RigidBody;
993
980
  /** The radius of the collider if the shape is a ball, capsule, cone, cylinder, or round cylinder. */
994
981
  radius?: number;
982
+ /** The relative position of the collider. Relative to parent rigid body. */
983
+ relativePosition?: Vector3Like;
995
984
  /** The relative rotation of the collider. Relative to parent rigid body. */
996
985
  relativeRotation?: QuaternionLike;
997
- /** The relative translation of the collider. Relative to parent rigid body. */
998
- relativeTranslation?: Vector3Like;
999
986
  /** The simulation the collider is in, if provided the collider will automatically be added to the simulation. */
1000
987
  simulation?: Simulation;
1001
988
  /** An arbitrary identifier tag of the collider. Useful for your own logic. */
@@ -1499,13 +1486,13 @@ export declare namespace EntityEventPayload {
1499
1486
  entity: Entity;
1500
1487
  animations: Set<string>;
1501
1488
  }
1502
- export interface UpdateRotation {
1489
+ export interface UpdatePosition {
1503
1490
  entity: Entity;
1504
- rotation: QuaternionLike;
1491
+ position: Vector3Like;
1505
1492
  }
1506
- export interface UpdateTranslation {
1493
+ export interface UpdateRotation {
1507
1494
  entity: Entity;
1508
- translation: Vector3Like;
1495
+ rotation: QuaternionLike;
1509
1496
  }
1510
1497
  }
1511
1498
 
@@ -1518,8 +1505,8 @@ export declare enum EntityEventType {
1518
1505
  START_MODEL_LOOPED_ANIMATIONS = "ENTITY.START_MODEL_LOOPED_ANIMATIONS",
1519
1506
  START_MODEL_ONESHOT_ANIMATIONS = "ENTITY.START_MODEL_ONESHOT_ANIMATIONS",
1520
1507
  STOP_MODEL_ANIMATIONS = "ENTITY.STOP_MODEL_ANIMATIONS",
1521
- UPDATE_ROTATION = "ENTITY.UPDATE_ROTATION",
1522
- UPDATE_TRANSLATION = "ENTITY.UPDATE_TRANSLATION"
1508
+ UPDATE_POSITION = "ENTITY.UPDATE_POSITION",
1509
+ UPDATE_ROTATION = "ENTITY.UPDATE_ROTATION"
1523
1510
  }
1524
1511
 
1525
1512
  /**
@@ -1763,22 +1750,22 @@ export declare enum GameServerEventType {
1763
1750
 
1764
1751
  /**
1765
1752
  * A callback function called when the entity associated with the
1766
- * SimpleCharacterController updates its translation as it is
1753
+ * SimpleCharacterController updates its position as it is
1767
1754
  * attempting to move to a target coordinate.
1768
- * @param currentTranslation - The current translation of the entity.
1769
- * @param targetTranslation - The target translation of the entity.
1755
+ * @param currentPosition - The current position of the entity.
1756
+ * @param targetPosition - The target position of the entity.
1770
1757
  * @public
1771
1758
  */
1772
- export declare type MoveCallback = (currentTranslation: Vector3Like, targetTranslation: Vector3Like) => void;
1759
+ export declare type MoveCallback = (currentPosition: Vector3Like, targetPosition: Vector3Like) => void;
1773
1760
 
1774
1761
  /**
1775
1762
  * A callback function called when the entity associated with the
1776
1763
  * SimpleCharacterController reaches the target coordinate. An entity
1777
1764
  * must reach the x,y,z coordinate for the callback to be called.
1778
- * @param endTranslation - The translation of the entity after it has finished moving.
1765
+ * @param endPosition - The position of the entity after it has finished moving.
1779
1766
  * @public
1780
1767
  */
1781
- export declare type MoveCompleteCallback = (endTranslation: Vector3Like) => void;
1768
+ export declare type MoveCompleteCallback = (endPosition: Vector3Like) => void;
1782
1769
 
1783
1770
  /**
1784
1771
  * Options for the {@link SimpleCharacterController.move} method.
@@ -1820,11 +1807,8 @@ export declare class Player {
1820
1807
 
1821
1808
 
1822
1809
 
1823
-
1824
1810
  /** The current {@link PlayerInput} of the player. */
1825
1811
  get input(): Readonly<PlayerInput>;
1826
- /** The current {@link PlayerCameraOrientation} of the player. */
1827
- get cameraOrientation(): Readonly<PlayerCameraOrientation>;
1828
1812
  /** The current {@link World} the player is in. */
1829
1813
  get world(): World | undefined;
1830
1814
  /**
@@ -1884,10 +1868,13 @@ export declare class PlayerCamera implements protocol.Serializable {
1884
1868
 
1885
1869
 
1886
1870
 
1871
+
1887
1872
  /** The entity the camera is attached to. */
1888
1873
  get attachedToEntity(): Entity | undefined;
1889
1874
  /** The position the camera is attached to. */
1890
1875
  get attachedToPosition(): Vector3Like | undefined;
1876
+ /** The facing direction vector of the camera based on its current orientation. */
1877
+ get facingDirection(): Vector3Like;
1891
1878
  /** The film offset of the camera. A positive value shifts the camera right, a negative value shifts it left. */
1892
1879
  get filmOffset(): number;
1893
1880
  /** Only used in first-person mode. The forward offset of the camera. A positive number shifts the camera forward, a negative number shifts it backward. */
@@ -1900,6 +1887,8 @@ export declare class PlayerCamera implements protocol.Serializable {
1900
1887
  get mode(): PlayerCameraMode;
1901
1888
  /** The relative offset of the camera from the entity or position it is attached to. */
1902
1889
  get offset(): Vector3Like;
1890
+ /** The current orientation of the camera. */
1891
+ get orientation(): PlayerCameraOrientation;
1903
1892
  /** The entity the camera will constantly look at, even if the camera attached or tracked entity moves. */
1904
1893
  get trackedEntity(): Entity | undefined;
1905
1894
  /** The position the camera will constantly look at, even if the camera attached entity moves. */
@@ -1966,6 +1955,8 @@ export declare class PlayerCamera implements protocol.Serializable {
1966
1955
  * @param offset - The offset to set.
1967
1956
  */
1968
1957
  setOffset(offset: Vector3Like): void;
1958
+
1959
+
1969
1960
  /**
1970
1961
  * Sets the entity the camera will constantly look at,
1971
1962
  * even if the camera attached or tracked entity moves.
@@ -2060,6 +2051,7 @@ export declare enum PlayerCameraEventType {
2060
2051
  SET_ZOOM = "PLAYER_CAMERA.SET_ZOOM"
2061
2052
  }
2062
2053
 
2054
+ /** The mode of the camera. @public */
2063
2055
  export declare enum PlayerCameraMode {
2064
2056
  FIRST_PERSON = 0,
2065
2057
  THIRD_PERSON = 1
@@ -2239,7 +2231,7 @@ export declare namespace PlayerUIEventPayload {
2239
2231
  }
2240
2232
  }
2241
2233
 
2242
- /** Event types a */
2234
+ /** Event types a PlayerUI can emit. @public */
2243
2235
  export declare enum PlayerUIEventType {
2244
2236
  LOAD = "PLAYER_UI.LOAD",
2245
2237
  SEND_DATA = "PLAYER_UI.SEND_DATA"
@@ -2433,9 +2425,12 @@ export declare interface QuaternionLike {
2433
2425
  /** A raw set of collision groups represented as a 32-bit number. @public */
2434
2426
  export declare type RawCollisionGroups = RAPIER.InteractionGroups;
2435
2427
 
2428
+ /** A hit result from a raycast. @public */
2436
2429
  export declare type RaycastHit = {
2437
- /** The block or entity the raycast hit. */
2438
- hitObject: Block | Entity;
2430
+ /** The block the raycast hit. */
2431
+ hitBlock?: Block;
2432
+ /** The entity the raycast hit */
2433
+ hitEntity?: Entity;
2439
2434
  /** The point in global coordinate space the raycast hit the object. */
2440
2435
  hitPoint: Vector3Like;
2441
2436
  /** The distance from origin where the raycast hit. */
@@ -2489,8 +2484,36 @@ export declare class RigidBody {
2489
2484
  * @param options - The options for the rigid body instance.
2490
2485
  */
2491
2486
  constructor(options: RigidBodyOptions);
2487
+ /** The additional mass of the rigid body. */
2488
+ get additionalMass(): number;
2489
+ /** The additional solver iterations of the rigid body. */
2490
+ get additionalSolverIterations(): number;
2491
+ /** The angular damping of the rigid body. */
2492
+ get angularDamping(): number;
2493
+ /** The angular velocity of the rigid body. */
2494
+ get angularVelocity(): Vector3Like;
2492
2495
  /** The colliders of the rigid body. */
2493
2496
  get colliders(): Set<Collider>;
2497
+ /** The dominance group of the rigid body. */
2498
+ get dominanceGroup(): number;
2499
+ /** The direction from the rotation of the rigid body. */
2500
+ get directionFromRotation(): Vector3Like;
2501
+ /** The effective angular inertia of the rigid body. */
2502
+ get effectiveAngularInertia(): SpdMatrix3 | undefined;
2503
+ /** The effective inverse mass of the rigid body. */
2504
+ get effectiveInverseMass(): Vector3Like | undefined;
2505
+ /** The effective world inverse principal angular inertia square root of the rigid body. */
2506
+ get effectiveWorldInversePrincipalAngularInertiaSqrt(): SpdMatrix3 | undefined;
2507
+ /** The enabled axes of rotational movement of the rigid body. */
2508
+ get enabledRotations(): Vector3Boolean;
2509
+ /** The enabled axes of positional movement of the rigid body. */
2510
+ get enabledPositions(): Vector3Boolean;
2511
+ /** The gravity scale of the rigid body. */
2512
+ get gravityScale(): number;
2513
+ /** The inverse mass of the rigid body. */
2514
+ get inverseMass(): number | undefined;
2515
+ /** The inverse principal angular inertia square root of the rigid body. */
2516
+ get inversePrincipalAngularInertiaSqrt(): Vector3Like | undefined;
2494
2517
  /** Whether the rigid body has continuous collision detection enabled. */
2495
2518
  get isCcdEnabled(): boolean;
2496
2519
  /** Whether the rigid body is dynamic. */
@@ -2513,151 +2536,36 @@ export declare class RigidBody {
2513
2536
  get isSimulated(): boolean;
2514
2537
  /** Whether the rigid body is sleeping. */
2515
2538
  get isSleeping(): boolean;
2539
+ /** The linear damping of the rigid body. */
2540
+ get linearDamping(): number;
2541
+ /** The linear velocity of the rigid body. */
2542
+ get linearVelocity(): Vector3Like;
2543
+ /** The local center of mass of the rigid body. */
2544
+ get localCenterOfMass(): Vector3Like;
2545
+ /** The mass of the rigid body. */
2546
+ get mass(): number;
2547
+ /** The next kinematic rotation of the rigid body. */
2548
+ get nextKinematicRotation(): QuaternionLike;
2549
+ /** The next kinematic position of the rigid body. */
2550
+ get nextKinematicPosition(): Vector3Like;
2516
2551
  /** The number of colliders in the rigid body. */
2517
2552
  get numColliders(): number;
2553
+ /** The principal angular inertia of the rigid body. */
2554
+ get principalAngularInertia(): Vector3Like;
2555
+ /** The principal angular inertia local frame of the rigid body. */
2556
+ get principalAngularInertiaLocalFrame(): QuaternionLike | undefined;
2557
+ /** The position of the rigid body. */
2558
+ get position(): Vector3Like;
2518
2559
  /** The raw RAPIER rigid body instance. */
2519
2560
  get rawRigidBody(): RAPIER.RigidBody | undefined;
2520
- /**
2521
- * Gets the additional mass of the rigid body.
2522
- * @returns The additional mass of the rigid body.
2523
- */
2524
- getAdditionalMass(): number;
2525
- /**
2526
- * Gets the additional solver iterations of the rigid body.
2527
- * @returns The additional solver iterations of the rigid body.
2528
- */
2529
- getAdditionalSolverIterations(): number;
2530
- /**
2531
- * Gets the angular damping of the rigid body.
2532
- * @returns The angular damping of the rigid body.
2533
- */
2534
- getAngularDamping(): number;
2535
- /**
2536
- * Gets the angular velocity of the rigid body.
2537
- * @returns The angular velocity of the rigid body.
2538
- */
2539
- getAngularVelocity(): Vector3Like;
2540
- /**
2541
- * Gets the colliders of the rigid body by tag.
2542
- * @param tag - The tag to filter by.
2543
- * @returns The colliders of the rigid body with the given tag.
2544
- */
2545
- getCollidersByTag(tag: string): Collider[];
2546
- /**
2547
- * Gets the dominance group of the rigid body.
2548
- * @returns The dominance group of the rigid body.
2549
- */
2550
- getDominanceGroup(): number;
2551
- /**
2552
- * Gets the direction from the rotation of the rigid body.
2553
- * @returns The direction from the rotation of the rigid body.
2554
- */
2555
- getDirectionFromRotation(): Vector3Like;
2556
- /**
2557
- * Gets the effective angular inertia of the rigid body.
2558
- * @returns The effective angular inertia of the rigid body.
2559
- */
2560
- getEffectiveAngularInertia(): SpdMatrix3 | undefined;
2561
- /**
2562
- * Gets the effective inverse mass of the rigid body.
2563
- * @returns The effective inverse mass of the rigid body.
2564
- */
2565
- getEffectiveInverseMass(): Vector3Like | undefined;
2566
- /**
2567
- * Gets the effective world inverse principal angular inertia square root of the rigid body.
2568
- * @returns The effective world inverse principal angular inertia square root of the rigid body.
2569
- */
2570
- getEffectiveWorldInversePrincipalAngularInertiaSqrt(): SpdMatrix3 | undefined;
2571
- /**
2572
- * Gets the enabled rotations of the rigid body.
2573
- * @returns The enabled rotations of the rigid body.
2574
- */
2575
- getEnabledRotations(): Vector3Boolean;
2576
- /**
2577
- * Gets the enabled translations of the rigid body.
2578
- * @returns The enabled translations of the rigid body.
2579
- */
2580
- getEnabledTranslations(): Vector3Boolean;
2581
- /**
2582
- * Gets the gravity scale of the rigid body.
2583
- * @returns The gravity scale of the rigid body.
2584
- */
2585
- getGravityScale(): number;
2586
- /**
2587
- * Gets the inverse mass of the rigid body.
2588
- * @returns The inverse mass of the rigid body.
2589
- */
2590
- getInverseMass(): number | undefined;
2591
- /**
2592
- * Gets the inverse principal angular inertia square root of the rigid body.
2593
- * @returns The inverse principal angular inertia square root of the rigid body.
2594
- */
2595
- getInversePrincipalAngularInertiaSqrt(): Vector3Like | undefined;
2596
- /**
2597
- * Gets the linear damping of the rigid body.
2598
- * @returns The linear damping of the rigid body.
2599
- */
2600
- getLinearDamping(): number;
2601
- /**
2602
- * Gets the linear velocity of the rigid body.
2603
- * @returns The linear velocity of the rigid body.
2604
- */
2605
- getLinearVelocity(): Vector3Like;
2606
- /**
2607
- * Gets the local center of mass of the rigid body.
2608
- * @returns The local center of mass of the rigid body.
2609
- */
2610
- getLocalCenterOfMass(): Vector3Like;
2611
- /**
2612
- * Gets the mass of the rigid body.
2613
- * @returns The mass of the rigid body.
2614
- */
2615
- getMass(): number;
2616
- /**
2617
- * Gets the next kinematic rotation of the rigid body.
2618
- * @returns The next kinematic rotation of the rigid body.
2619
- */
2620
- getNextKinematicRotation(): QuaternionLike;
2621
- /**
2622
- * Gets the next kinematic translation of the rigid body.
2623
- * @returns The next kinematic translation of the rigid body.
2624
- */
2625
- getNextKinematicTranslation(): Vector3Like;
2626
- /**
2627
- * Gets the principal angular inertia of the rigid body.
2628
- * @returns The principal angular inertia of the rigid body.
2629
- */
2630
- getPrincipalAngularInertia(): Vector3Like;
2631
- /**
2632
- * Gets the principal angular inertia local frame of the rigid body.
2633
- * @returns The principal angular inertia local frame of the rigid body.
2634
- */
2635
- getPrincipalAngularInertiaLocalFrame(): QuaternionLike | undefined;
2636
- /**
2637
- * Gets the rotation of the rigid body.
2638
- * @returns The rotation of the rigid body.
2639
- */
2640
- getRotation(): QuaternionLike;
2641
- /**
2642
- * Gets the soft ccd prediction of the rigid body.
2643
- * @returns The soft ccd prediction of the rigid body.
2644
- */
2645
- getSoftCcdPrediction(): number;
2646
- /**
2647
- * Gets the translation of the rigid body.
2648
- * @returns The translation of the rigid body.
2649
- */
2650
- getTranslation(): Vector3Like;
2651
- /**
2652
- * Gets the type of the rigid body.
2653
- * @returns The type of the rigid body.
2654
- */
2655
- getType(): RigidBodyType;
2656
- /**
2657
- * Gets the world center of mass of the rigid body.
2658
- * @returns The world center of mass of the rigid body.
2659
- */
2660
- getWorldCenterOfMass(): Vector3Like | undefined;
2561
+ /** The rotation of the rigid body. */
2562
+ get rotation(): QuaternionLike;
2563
+ /** The soft continuous collision detection prediction of the rigid body. */
2564
+ get softCcdPrediction(): number;
2565
+ /** The type of the rigid body. */
2566
+ get type(): RigidBodyType;
2567
+ /** The world center of mass of the rigid body. */
2568
+ get worldCenterOfMass(): Vector3Like | undefined;
2661
2569
  /**
2662
2570
  * Sets the additional mass of the rigid body.
2663
2571
  * @param additionalMass - The additional mass of the rigid body.
@@ -2698,16 +2606,16 @@ export declare class RigidBody {
2698
2606
  * @param enabled - Whether the rigid body is enabled.
2699
2607
  */
2700
2608
  setEnabled(enabled: boolean): void;
2609
+ /**
2610
+ * Sets whether the rigid body has enabled positional movement.
2611
+ * @param enabledPositions - Whether the rigid body has enabled positional movement.
2612
+ */
2613
+ setEnabledPositions(enabledPositions: Vector3Boolean): void;
2701
2614
  /**
2702
2615
  * Sets whether the rigid body has enabled rotations.
2703
2616
  * @param enabledRotations - Whether the rigid body has enabled rotations.
2704
2617
  */
2705
2618
  setEnabledRotations(enabledRotations: Vector3Boolean): void;
2706
- /**
2707
- * Sets whether the rigid body has enabled translations.
2708
- * @param enabledTranslations - Whether the rigid body has enabled translations.
2709
- */
2710
- setEnabledTranslations(enabledTranslations: Vector3Boolean): void;
2711
2619
  /**
2712
2620
  * Sets the gravity scale of the rigid body.
2713
2621
  * @param gravityScale - The gravity scale of the rigid body.
@@ -2729,10 +2637,15 @@ export declare class RigidBody {
2729
2637
  */
2730
2638
  setNextKinematicRotation(nextKinematicRotation: QuaternionLike): void;
2731
2639
  /**
2732
- * Sets the next kinematic translation of the rigid body.
2733
- * @param nextKinematicTranslation - The next kinematic translation of the rigid body.
2640
+ * Sets the next kinematic position of the rigid body.
2641
+ * @param nextKinematicPosition - The next kinematic position of the rigid body.
2734
2642
  */
2735
- setNextKinematicTranslation(nextKinematicTranslation: Vector3Like): void;
2643
+ setNextKinematicPosition(nextKinematicPosition: Vector3Like): void;
2644
+ /**
2645
+ * Sets the position of the rigid body.
2646
+ * @param position - The position of the rigid body.
2647
+ */
2648
+ setPosition(position: Vector3Like): void;
2736
2649
  /**
2737
2650
  * Sets the rotation of the rigid body.
2738
2651
  * @param rotation - The rotation of the rigid body.
@@ -2753,11 +2666,6 @@ export declare class RigidBody {
2753
2666
  * @param collisionGroups - The collision groups for solid colliders of the rigid body.
2754
2667
  */
2755
2668
  setCollisionGroupsForSolidColliders(collisionGroups: CollisionGroups): void;
2756
- /**
2757
- * Sets the translation of the rigid body.
2758
- * @param translation - The translation of the rigid body.
2759
- */
2760
- setTranslation(translation: Vector3Like): void;
2761
2669
  /**
2762
2670
  * Sets the type of the rigid body.
2763
2671
  * @param type - The type of the rigid body.
@@ -2811,15 +2719,21 @@ export declare class RigidBody {
2811
2719
  * @returns The child colliders that were added to the rigid body.
2812
2720
  */
2813
2721
  createAndAddChildCollidersToSimulation(colliderOptions: ColliderOptions[]): Collider[];
2722
+ /**
2723
+ * Gets the colliders of the rigid body by tag.
2724
+ * @param tag - The tag to filter by.
2725
+ * @returns The colliders of the rigid body with the given tag.
2726
+ */
2727
+ getCollidersByTag(tag: string): Collider[];
2814
2728
 
2815
2729
  /**
2816
2730
  * Locks all rotations of the rigid body.
2817
2731
  */
2818
2732
  lockAllRotations(): void;
2819
2733
  /**
2820
- * Locks all translations of the rigid body.
2734
+ * Locks all positional movement of the rigid body.
2821
2735
  */
2822
- lockAllTranslations(): void;
2736
+ lockAllPositions(): void;
2823
2737
  /**
2824
2738
  * Removes the rigid body from the simulation it belongs to.
2825
2739
  */
@@ -2879,16 +2793,18 @@ export declare interface RigidBodyOptions {
2879
2793
  dominanceGroup?: number;
2880
2794
  /** Whether the rigid body is enabled. */
2881
2795
  enabled?: boolean;
2796
+ /** The enabled axes of positional movement of the rigid body. */
2797
+ enabledPositions?: Vector3Boolean;
2882
2798
  /** The enabled rotations of the rigid body. */
2883
2799
  enabledRotations?: Vector3Boolean;
2884
- /** The enabled translations of the rigid body. */
2885
- enabledTranslations?: Vector3Boolean;
2886
2800
  /** The gravity scale of the rigid body. */
2887
2801
  gravityScale?: number;
2888
2802
  /** The linear damping of the rigid body. */
2889
2803
  linearDamping?: number;
2890
2804
  /** The linear velocity of the rigid body. */
2891
2805
  linearVelocity?: Vector3Like;
2806
+ /** The position of the rigid body. */
2807
+ position?: Vector3Like;
2892
2808
  /** The rotation of the rigid body. */
2893
2809
  rotation?: QuaternionLike;
2894
2810
  /** The simulation the rigid body is in. If provided, the rigid body will be automatically added to the simulation. */
@@ -2897,8 +2813,6 @@ export declare interface RigidBodyOptions {
2897
2813
  sleeping?: boolean;
2898
2814
  /** The soft continuous collision detection prediction of the rigid body. */
2899
2815
  softCcdPrediction?: number;
2900
- /** The translation of the rigid body. */
2901
- translation?: Vector3Like;
2902
2816
  }
2903
2817
 
2904
2818
  /** The types a RigidBody can be. @public */