hytopia 0.4.3 → 0.5.0-dev

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 (127) hide show
  1. package/docs/server.chunklattice.clear.md +17 -0
  2. package/docs/server.chunklattice.md +14 -0
  3. package/docs/server.collider.md +1 -1
  4. package/docs/server.collider.optionsfrommodeluri.md +18 -2
  5. package/docs/server.collideroptions.md +2 -2
  6. package/docs/server.collidershape.md +14 -0
  7. package/docs/server.defaultplayerentity._constructor_.md +47 -0
  8. package/docs/server.defaultplayerentity.md +61 -0
  9. package/docs/server.defaultplayerentitycontroller._constructor_.md +49 -0
  10. package/docs/{server.playerentitycontroller.attach.md → server.defaultplayerentitycontroller.attach.md} +2 -2
  11. package/docs/server.defaultplayerentitycontroller.autocancelmouseleftclick.md +13 -0
  12. package/docs/server.defaultplayerentitycontroller.canjump.md +13 -0
  13. package/docs/server.defaultplayerentitycontroller.canrun.md +13 -0
  14. package/docs/server.defaultplayerentitycontroller.canwalk.md +13 -0
  15. package/docs/server.defaultplayerentitycontroller.idleloopedanimations.md +13 -0
  16. package/docs/server.defaultplayerentitycontroller.interactoneshotanimations.md +13 -0
  17. package/docs/server.defaultplayerentitycontroller.isgrounded.md +13 -0
  18. package/docs/server.defaultplayerentitycontroller.isonplatform.md +13 -0
  19. package/docs/server.defaultplayerentitycontroller.isswimming.md +13 -0
  20. package/docs/server.defaultplayerentitycontroller.jumponeshotanimations.md +13 -0
  21. package/docs/server.defaultplayerentitycontroller.jumpvelocity.md +13 -0
  22. package/docs/server.defaultplayerentitycontroller.md +599 -0
  23. package/docs/server.defaultplayerentitycontroller.platform.md +13 -0
  24. package/docs/server.defaultplayerentitycontroller.runloopedanimations.md +13 -0
  25. package/docs/server.defaultplayerentitycontroller.runvelocity.md +13 -0
  26. package/docs/server.defaultplayerentitycontroller.spawn.md +53 -0
  27. package/docs/server.defaultplayerentitycontroller.stickstoplatforms.md +13 -0
  28. package/docs/server.defaultplayerentitycontroller.swimfastvelocity.md +13 -0
  29. package/docs/server.defaultplayerentitycontroller.swimgravity.md +13 -0
  30. package/docs/server.defaultplayerentitycontroller.swimloopedanimations.md +13 -0
  31. package/docs/server.defaultplayerentitycontroller.swimmaxgravityvelocity.md +13 -0
  32. package/docs/server.defaultplayerentitycontroller.swimslowvelocity.md +13 -0
  33. package/docs/server.defaultplayerentitycontroller.swimupwardvelocity.md +13 -0
  34. package/docs/{server.playerentitycontroller.tickwithplayerinput.md → server.defaultplayerentitycontroller.tickwithplayerinput.md} +2 -2
  35. package/docs/server.defaultplayerentitycontroller.walkloopedanimations.md +13 -0
  36. package/docs/server.defaultplayerentitycontroller.walkvelocity.md +13 -0
  37. package/docs/server.defaultplayerentitycontrolleroptions.autocancelmouseleftclick.md +13 -0
  38. package/docs/server.defaultplayerentitycontrolleroptions.canjump.md +13 -0
  39. package/docs/server.defaultplayerentitycontrolleroptions.canrun.md +13 -0
  40. package/docs/server.defaultplayerentitycontrolleroptions.canwalk.md +13 -0
  41. package/docs/server.defaultplayerentitycontrolleroptions.idleloopedanimations.md +13 -0
  42. package/docs/server.defaultplayerentitycontrolleroptions.interactoneshotanimations.md +13 -0
  43. package/docs/server.defaultplayerentitycontrolleroptions.jumponeshotanimations.md +13 -0
  44. package/docs/server.defaultplayerentitycontrolleroptions.jumpvelocity.md +13 -0
  45. package/docs/server.defaultplayerentitycontrolleroptions.md +399 -0
  46. package/docs/server.defaultplayerentitycontrolleroptions.runloopedanimations.md +13 -0
  47. package/docs/server.defaultplayerentitycontrolleroptions.runvelocity.md +13 -0
  48. package/docs/server.defaultplayerentitycontrolleroptions.stickstoplatforms.md +13 -0
  49. package/docs/server.defaultplayerentitycontrolleroptions.swimfastvelocity.md +13 -0
  50. package/docs/server.defaultplayerentitycontrolleroptions.swimgravity.md +13 -0
  51. package/docs/server.defaultplayerentitycontrolleroptions.swimloopedanimations.md +13 -0
  52. package/docs/server.defaultplayerentitycontrolleroptions.swimmaxgravityvelocity.md +13 -0
  53. package/docs/server.defaultplayerentitycontrolleroptions.swimslowvelocity.md +13 -0
  54. package/docs/server.defaultplayerentitycontrolleroptions.swimupwardvelocity.md +13 -0
  55. package/docs/server.defaultplayerentitycontrolleroptions.walkloopedanimations.md +13 -0
  56. package/docs/server.defaultplayerentitycontrolleroptions.walkvelocity.md +13 -0
  57. package/docs/server.defaultplayerentityoptions.md +15 -0
  58. package/docs/server.entity.md +21 -0
  59. package/docs/server.entity.modelpreferredshape.md +13 -0
  60. package/docs/server.md +77 -22
  61. package/docs/server.modelboundingbox.md +18 -0
  62. package/docs/server.modelentityoptions.md +19 -0
  63. package/docs/server.modelentityoptions.modelpreferredshape.md +13 -0
  64. package/docs/server.modelregistry.getboundingbox.md +1 -1
  65. package/docs/server.modelregistry.gettrimesh.md +71 -0
  66. package/docs/server.modelregistry.md +14 -0
  67. package/docs/server.modeltrimesh.md +16 -0
  68. package/docs/server.playerentity.md +1 -1
  69. package/docs/server.wedgecollideroptions.extents.md +13 -0
  70. package/docs/server.wedgecollideroptions.md +75 -0
  71. package/docs/server.wedgecollideroptions.shape.md +11 -0
  72. package/docs/server.world.loadmap.md +1 -1
  73. package/docs/server.world.md +1 -1
  74. package/examples/ai-agents/index.ts +2 -6
  75. package/examples/big-world/index.ts +2 -5
  76. package/examples/block-entity/index.ts +2 -5
  77. package/examples/child-entity/index.ts +2 -5
  78. package/examples/custom-ui/index.ts +3 -6
  79. package/examples/entity-controller/index.ts +2 -5
  80. package/examples/entity-spawn/index.ts +2 -5
  81. package/examples/hole-in-wall-game/index.ts +8 -9
  82. package/examples/hygrounds/classes/GameManager.ts +1 -0
  83. package/examples/hygrounds/classes/GamePlayerEntity.ts +5 -6
  84. package/examples/lighting/index.ts +3 -6
  85. package/examples/mobile-controls/index.ts +2 -5
  86. package/examples/pathfinding/index.ts +2 -5
  87. package/examples/payload-game/index.ts +15 -17
  88. package/examples/player-persistence/index.ts +2 -5
  89. package/examples/wall-dodge-game/index.ts +8 -11
  90. package/examples/zombies-fps/classes/GamePlayerEntity.ts +5 -8
  91. package/package.json +1 -1
  92. package/server.api.json +10086 -9232
  93. package/server.d.ts +241 -147
  94. package/server.js +143 -129
  95. package/docs/server.playerentitycontroller._constructor_.md +0 -49
  96. package/docs/server.playerentitycontroller.autocancelmouseleftclick.md +0 -13
  97. package/docs/server.playerentitycontroller.canjump.md +0 -13
  98. package/docs/server.playerentitycontroller.canrun.md +0 -13
  99. package/docs/server.playerentitycontroller.canwalk.md +0 -13
  100. package/docs/server.playerentitycontroller.idleloopedanimations.md +0 -13
  101. package/docs/server.playerentitycontroller.interactoneshotanimations.md +0 -13
  102. package/docs/server.playerentitycontroller.isgrounded.md +0 -13
  103. package/docs/server.playerentitycontroller.isonplatform.md +0 -13
  104. package/docs/server.playerentitycontroller.jumponeshotanimations.md +0 -13
  105. package/docs/server.playerentitycontroller.jumpvelocity.md +0 -13
  106. package/docs/server.playerentitycontroller.md +0 -464
  107. package/docs/server.playerentitycontroller.platform.md +0 -13
  108. package/docs/server.playerentitycontroller.runloopedanimations.md +0 -13
  109. package/docs/server.playerentitycontroller.runvelocity.md +0 -13
  110. package/docs/server.playerentitycontroller.spawn.md +0 -53
  111. package/docs/server.playerentitycontroller.stickstoplatforms.md +0 -13
  112. package/docs/server.playerentitycontroller.walkloopedanimations.md +0 -13
  113. package/docs/server.playerentitycontroller.walkvelocity.md +0 -13
  114. package/docs/server.playerentitycontrolleroptions.autocancelmouseleftclick.md +0 -13
  115. package/docs/server.playerentitycontrolleroptions.canjump.md +0 -13
  116. package/docs/server.playerentitycontrolleroptions.canrun.md +0 -13
  117. package/docs/server.playerentitycontrolleroptions.canwalk.md +0 -13
  118. package/docs/server.playerentitycontrolleroptions.idleloopedanimations.md +0 -13
  119. package/docs/server.playerentitycontrolleroptions.interactoneshotanimations.md +0 -13
  120. package/docs/server.playerentitycontrolleroptions.jumponeshotanimations.md +0 -13
  121. package/docs/server.playerentitycontrolleroptions.jumpvelocity.md +0 -13
  122. package/docs/server.playerentitycontrolleroptions.md +0 -285
  123. package/docs/server.playerentitycontrolleroptions.runloopedanimations.md +0 -13
  124. package/docs/server.playerentitycontrolleroptions.runvelocity.md +0 -13
  125. package/docs/server.playerentitycontrolleroptions.stickstoplatforms.md +0 -13
  126. package/docs/server.playerentitycontrolleroptions.walkloopedanimations.md +0 -13
  127. package/docs/server.playerentitycontrolleroptions.walkvelocity.md +0 -13
package/server.d.ts CHANGED
@@ -1002,6 +1002,10 @@ export declare class ChunkLattice {
1002
1002
  constructor(world: World);
1003
1003
 
1004
1004
 
1005
+ /**
1006
+ * Despawns and clears all chunks in the lattice.
1007
+ */
1008
+ clear(): void;
1005
1009
  /**
1006
1010
  * Get the block type id at a specific global coordinate.
1007
1011
  * @param globalCoordinate - The global coordinate of the block to get.
@@ -1090,9 +1094,11 @@ export declare class Collider extends EventRouter {
1090
1094
  /**
1091
1095
  * Creates a collider options object from a modelUri with best approximate shape and size.
1092
1096
  * @param modelUri - The URI of the model.
1097
+ * @param scale - The scale of the model.
1098
+ * @param preferredShape - The preferred shape to use for the collider.
1093
1099
  * @returns The collider options object.
1094
1100
  */
1095
- static optionsFromModelUri(modelUri: string, scale?: number): ColliderOptions;
1101
+ static optionsFromModelUri(modelUri: string, scale?: number, preferredShape?: ColliderShape): ColliderOptions;
1096
1102
  /** The bounciness of the collider. */
1097
1103
  get bounciness(): number;
1098
1104
  /** The bounciness combine rule of the collider. */
@@ -1217,15 +1223,16 @@ export declare class Collider extends EventRouter {
1217
1223
  removeFromSimulation(): void;
1218
1224
 
1219
1225
 
1226
+ private _buildWedgeConvexHullVertices;
1227
+
1228
+
1220
1229
 
1221
1230
 
1222
- private _requireUnsimulated;
1223
- private _requireNotRemoved;
1224
1231
 
1225
1232
  }
1226
1233
 
1227
1234
  /** The options for a collider. @public */
1228
- export declare type ColliderOptions = BallColliderOptions | BlockColliderOptions | CapsuleColliderOptions | ConeColliderOptions | CylinderColliderOptions | RoundCylinderColliderOptions | TrimeshColliderOptions | NoneColliderOptions;
1235
+ export declare type ColliderOptions = BallColliderOptions | BlockColliderOptions | CapsuleColliderOptions | ConeColliderOptions | CylinderColliderOptions | RoundCylinderColliderOptions | TrimeshColliderOptions | WedgeColliderOptions | NoneColliderOptions;
1229
1236
 
1230
1237
  /** The shapes a collider can be. @public */
1231
1238
  export declare enum ColliderShape {
@@ -1236,7 +1243,8 @@ export declare enum ColliderShape {
1236
1243
  CONE = "cone",
1237
1244
  CYLINDER = "cylinder",
1238
1245
  ROUND_CYLINDER = "round-cylinder",
1239
- TRIMESH = "trimesh"
1246
+ TRIMESH = "trimesh",
1247
+ WEDGE = "wedge"
1240
1248
  }
1241
1249
 
1242
1250
  /**
@@ -1407,6 +1415,197 @@ export declare type DecodedCollisionGroups = {
1407
1415
  /** The default rigid body options for a model entity when EntityOptions.rigidBodyOptions is not provided. @public */
1408
1416
  export declare const DEFAULT_ENTITY_RIGID_BODY_OPTIONS: RigidBodyOptions;
1409
1417
 
1418
+ /**
1419
+ * Represents the default player model entity.
1420
+ *
1421
+ * @remarks
1422
+ * The default player entity extends the {@link PlayerEntity} class,
1423
+ * uses the default player model, and assigns a DefaultPlayerEntityController.
1424
+ * This entity is the most commonly used player controlled entity in games.
1425
+ * It automatically handles things like managing player visual customizations
1426
+ * and cosmetics, and more. If you want to change the default model used, you
1427
+ * can override all of the defaults, including the modelUri, but you must
1428
+ * ensure that the model used has the same animation names and anchor points
1429
+ * as the default player model in order to prevent unexpected behavior.
1430
+ *
1431
+ * @example
1432
+ * ```typescript
1433
+ * const playerEntity = new DefaultPlayerEntity({ player });
1434
+ *
1435
+ * playerEntity.spawn(world, { x: 0, y: 10, z: 0 });
1436
+ * ```
1437
+ *
1438
+ * @public
1439
+ */
1440
+ export declare class DefaultPlayerEntity extends PlayerEntity {
1441
+ constructor(options: DefaultPlayerEntityOptions);
1442
+ }
1443
+
1444
+ /**
1445
+ * The player entity controller implementation.
1446
+ *
1447
+ * @remarks
1448
+ * This class extends {@link BaseEntityController}
1449
+ * and implements the default movement, platforming, jump,
1450
+ * swimming, and other basic logic for the
1451
+ * default player entity. We recommend you extend this class
1452
+ * if you'd like to implement additional logic on top of the
1453
+ * DefaultPlayerEntityController implementation.
1454
+ *
1455
+ * @example
1456
+ * ```typescript
1457
+ * // Create a custom entity controller for myEntity, prior to spawning it.
1458
+ * myEntity.setController(new DefaultPlayerEntityController({
1459
+ * jumpVelocity: 10,
1460
+ * runVelocity: 8,
1461
+ * walkVelocity: 4,
1462
+ * }));
1463
+ *
1464
+ * // Spawn the entity in the world.
1465
+ * myEntity.spawn(world, { x: 53, y: 10, z: 23 });
1466
+ * ```
1467
+ *
1468
+ * @public
1469
+ */
1470
+ export declare class DefaultPlayerEntityController extends BaseEntityController {
1471
+ /** Whether to automatically cancel left click input after first processed tick, defaults to true. */
1472
+ autoCancelMouseLeftClick: boolean;
1473
+ /**
1474
+ * A function allowing custom logic to determine if the entity can walk.
1475
+ * @param controller - The default player entity controller instance.
1476
+ * @returns Whether the entity of the entity controller can walk.
1477
+ */
1478
+ canWalk: (controller: DefaultPlayerEntityController) => boolean;
1479
+ /**
1480
+ * A function allowing custom logic to determine if the entity can run.
1481
+ * @param controller - The default player entity controller instance.
1482
+ * @returns Whether the entity of the entity controller can run.
1483
+ */
1484
+ canRun: (controller: DefaultPlayerEntityController) => boolean;
1485
+ /**
1486
+ * A function allowing custom logic to determine if the entity can jump.
1487
+ * @param controller - The default player entity controller instance.
1488
+ * @returns Whether the entity of the entity controller can jump.
1489
+ */
1490
+ canJump: (controller: DefaultPlayerEntityController) => boolean;
1491
+ /** The looped animation(s) that will play when the entity is idle. */
1492
+ idleLoopedAnimations: string[];
1493
+ /** The oneshot animation(s) that will play when the entity interacts (left click) */
1494
+ interactOneshotAnimations: string[];
1495
+ /** The oneshot animation(s) that will play when the entity is jumping. */
1496
+ jumpOneshotAnimations: string[];
1497
+ /** The upward velocity applied to the entity when it jumps. */
1498
+ jumpVelocity: number;
1499
+ /** The looped animation(s) that will play when the entity is running. */
1500
+ runLoopedAnimations: string[];
1501
+ /** The normalized horizontal velocity applied to the entity when it runs. */
1502
+ runVelocity: number;
1503
+ /** Whether the entity sticks to platforms. */
1504
+ sticksToPlatforms: boolean;
1505
+ /** The normalized horizontal velocity applied to the entity when it swims fast (equivalent to running). */
1506
+ swimFastVelocity: number;
1507
+ /** The gravity modifier applied to the entity when swimming. */
1508
+ swimGravity: number;
1509
+ /** The looped animation(s) that will play when the entity is swimming. */
1510
+ swimLoopedAnimations: string[];
1511
+ /** The maximum downward velocity that the entity can reach when affected by gravity while swimming. */
1512
+ swimMaxGravityVelocity: number;
1513
+ /** The normalized horizontal velocity applied to the entity when it swims slowly (equivalent to walking). */
1514
+ swimSlowVelocity: number;
1515
+ /** The upward velocity applied to the entity when swimming. */
1516
+ swimUpwardVelocity: number;
1517
+ /** The looped animation(s) that will play when the entity is walking. */
1518
+ walkLoopedAnimations: string[];
1519
+ /** The normalized horizontal velocity applied to the entity when it walks. */
1520
+ walkVelocity: number;
1521
+
1522
+
1523
+
1524
+
1525
+
1526
+ /**
1527
+ * @param options - Options for the controller.
1528
+ */
1529
+ constructor(options?: DefaultPlayerEntityControllerOptions);
1530
+ /** Whether the entity is grounded. */
1531
+ get isGrounded(): boolean;
1532
+ /** Whether the entity is on a platform, a platform is any entity with a kinematic rigid body. */
1533
+ get isOnPlatform(): boolean;
1534
+ /** Whether the entity is swimming, this is determined by if the entity is in a liquid block. */
1535
+ get isSwimming(): boolean;
1536
+ /** The platform the entity is on, if any. */
1537
+ get platform(): Entity | undefined;
1538
+ /**
1539
+ * Called when the controller is attached to an entity.
1540
+ * @param entity - The entity to attach the controller to.
1541
+ */
1542
+ attach(entity: Entity): void;
1543
+ /**
1544
+ * Called when the controlled entity is spawned.
1545
+ * In DefaultPlayerEntityController, this function is used to create
1546
+ * the colliders for the entity for wall and ground detection.
1547
+ * @param entity - The entity that is spawned.
1548
+ */
1549
+ spawn(entity: Entity): void;
1550
+ /**
1551
+ * Ticks the player movement for the entity controller,
1552
+ * overriding the default implementation. If the entity to tick
1553
+ * is a child entity, only the event will be emitted but the default
1554
+ * movement logic will not be applied.
1555
+ *
1556
+ * @param entity - The entity to tick.
1557
+ * @param input - The current input state of the player.
1558
+ * @param cameraOrientation - The current camera orientation state of the player.
1559
+ * @param deltaTimeMs - The delta time in milliseconds since the last tick.
1560
+ */
1561
+ tickWithPlayerInput(entity: PlayerEntity, input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
1562
+ }
1563
+
1564
+ /** Options for creating a DefaultPlayerEntityController instance. @public */
1565
+ export declare interface DefaultPlayerEntityControllerOptions {
1566
+ /** Whether to automatically cancel left click input after first processed tick, defaults to true. */
1567
+ autoCancelMouseLeftClick?: boolean;
1568
+ /** A function allowing custom logic to determine if the entity can jump. */
1569
+ canJump?: () => boolean;
1570
+ /** A function allowing custom logic to determine if the entity can walk. */
1571
+ canWalk?: () => boolean;
1572
+ /** A function allowing custom logic to determine if the entity can run. */
1573
+ canRun?: () => boolean;
1574
+ /** Overrides the animation(s) that will play when the entity is idle. */
1575
+ idleLoopedAnimations?: string[];
1576
+ /** Overrides the animation(s) that will play when the entity interacts (left click) */
1577
+ interactOneshotAnimations?: string[];
1578
+ /** Overrides the animation(s) that will play when the entity is jumping. */
1579
+ jumpOneshotAnimations?: string[];
1580
+ /** The upward velocity applied to the entity when it jumps. */
1581
+ jumpVelocity?: number;
1582
+ /** The normalized horizontal velocity applied to the entity when it runs. */
1583
+ runVelocity?: number;
1584
+ /** Overrides the animation(s) that will play when the entity is running. */
1585
+ runLoopedAnimations?: string[];
1586
+ /** Whether the entity sticks to platforms, defaults to true. */
1587
+ sticksToPlatforms?: boolean;
1588
+ /** The normalized horizontal velocity applied to the entity when it swims fast (equivalent to running). */
1589
+ swimFastVelocity?: number;
1590
+ /** The gravity modifier applied to the entity when swimming. */
1591
+ swimGravity?: number;
1592
+ /** The maximum downward velocity that the entity can reach when affected by gravity while swimming. */
1593
+ swimMaxGravityVelocity?: number;
1594
+ /** The looped animation(s) that will play when the entity is swimming. */
1595
+ swimLoopedAnimations?: string[];
1596
+ /** The normalized horizontal velocity applied to the entity when it swims slowly (equivalent to walking). */
1597
+ swimSlowVelocity?: number;
1598
+ /** The upward velocity applied to the entity when swimming. */
1599
+ swimUpwardVelocity?: number;
1600
+ /** Overrides the animation(s) that will play when the entity is walking. */
1601
+ walkLoopedAnimations?: string[];
1602
+ /** The normalized horizontal velocity applied to the entity when it walks. */
1603
+ walkVelocity?: number;
1604
+ }
1605
+
1606
+ /** Options for creating a DefaultPlayerEntity instance. @public */
1607
+ export declare type DefaultPlayerEntityOptions = {} & PlayerEntityOptions;
1608
+
1410
1609
  /** The options for a dynamic rigid body, also the default type. @public */
1411
1610
  export declare interface DynamicRigidBodyOptions extends BaseRigidBodyOptions {
1412
1611
  type?: RigidBodyType.DYNAMIC;
@@ -1500,6 +1699,7 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
1500
1699
 
1501
1700
 
1502
1701
 
1702
+
1503
1703
 
1504
1704
  /**
1505
1705
  * @param options - The options for the entity.
@@ -1521,6 +1721,8 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
1521
1721
  get modelHiddenNodes(): ReadonlySet<string>;
1522
1722
  /** The looped animations to start when the entity is spawned. */
1523
1723
  get modelLoopedAnimations(): ReadonlySet<string>;
1724
+ /** The preferred shape of the entity's model when automatically generating its collider when no explicit colliders are provided. */
1725
+ get modelPreferredShape(): ColliderShape | undefined;
1524
1726
  /** The scale of the entity's model. */
1525
1727
  get modelScale(): number | undefined;
1526
1728
  /** The URI or path to the .gltf model asset to be used for the entity. */
@@ -2940,7 +3142,7 @@ export declare class Matrix4 extends Float32Array {
2940
3142
  }
2941
3143
 
2942
3144
  /** A bounding box for a model. @public */
2943
- declare type ModelBoundingBox = {
3145
+ export declare type ModelBoundingBox = {
2944
3146
  min: Vector3Like;
2945
3147
  max: Vector3Like;
2946
3148
  };
@@ -2953,6 +3155,8 @@ export declare interface ModelEntityOptions extends BaseEntityOptions {
2953
3155
  modelHiddenNodes?: string[];
2954
3156
  /** The looped animations to start when the entity is spawned. */
2955
3157
  modelLoopedAnimations?: string[];
3158
+ /** The preferred shape of the entity's model when automatically generating its collider when no explicit colliders are provided. */
3159
+ modelPreferredShape?: ColliderShape;
2956
3160
  /** The scale of the entity's model. */
2957
3161
  modelScale?: number;
2958
3162
  /** The URI or path to the .gltf model asset to be used for the entity. */
@@ -2989,6 +3193,7 @@ export declare class ModelRegistry {
2989
3193
 
2990
3194
 
2991
3195
 
3196
+
2992
3197
  /**
2993
3198
  * Retrieves the bounding box of a model.
2994
3199
  *
@@ -3010,6 +3215,14 @@ export declare class ModelRegistry {
3010
3215
  * @returns The names of all nodes in the model.
3011
3216
  */
3012
3217
  getNodeNames(modelUri: string): string[];
3218
+ /**
3219
+ * Retrieves the trimesh of a model.
3220
+ *
3221
+ * @param modelUri - The URI of the model to retrieve the trimesh for.
3222
+ * @param scale - Optional uniform scaling to apply to the trimesh. Defaults to 1, which is no scaling.
3223
+ * @returns The trimesh of the model.
3224
+ */
3225
+ getTrimesh(modelUri: string, scale?: number): ModelTrimesh | undefined;
3013
3226
  /**
3014
3227
  * Checks if a model has a node with the given name.
3015
3228
  *
@@ -3026,8 +3239,15 @@ export declare class ModelRegistry {
3026
3239
 
3027
3240
 
3028
3241
 
3242
+
3029
3243
  }
3030
3244
 
3245
+ /** A trimesh for a model. @public */
3246
+ export declare type ModelTrimesh = {
3247
+ vertices: Float32Array;
3248
+ indices: Uint32Array;
3249
+ };
3250
+
3031
3251
  /**
3032
3252
  * A callback function called when the entity associated with the
3033
3253
  * SimpleEntityController updates its position as it is
@@ -3557,12 +3777,13 @@ export declare type PlayerCameraOrientation = {
3557
3777
  *
3558
3778
  * @remarks
3559
3779
  * Player entities extend the {@link Entity} class.
3560
- * They can be created and assigned to a player when
3561
- * a player joins a world. PlayerEntity automatically
3562
- * handles mapping player inputs to the associated
3563
- * entity controller of the entity, calling the
3564
- * entity controller's onTickPlayerMovement method
3565
- * when player input has changed.
3780
+ * They can be created and assigned to a player at
3781
+ * anytime during gameplay, but most commonly when
3782
+ * a player joins a world. PlayerEntity expects
3783
+ * a controller to be set prior to spawning.
3784
+ * Without setting a controller, the player entity
3785
+ * will not respond to player inputs and throw an
3786
+ * error.
3566
3787
  *
3567
3788
  * @example
3568
3789
  * ```typescript
@@ -3594,140 +3815,6 @@ export declare class PlayerEntity extends Entity {
3594
3815
 
3595
3816
  }
3596
3817
 
3597
- /**
3598
- * The player entity controller implementation.
3599
- *
3600
- * @remarks
3601
- * This class extends {@link BaseEntityController}
3602
- * and implements the default movement logic for a
3603
- * entity. This is used as the default for
3604
- * players when they join your game. This class may be extended
3605
- * if you'd like to implement additional logic on top of the
3606
- * PlayerEntityController implementation.
3607
- *
3608
- * @example
3609
- * ```typescript
3610
- * // Create a custom entity controller for myEntity, prior to spawning it.
3611
- * myEntity.setController(new PlayerEntityController(myEntity, {
3612
- * jumpVelocity: 10,
3613
- * runVelocity: 8,
3614
- * walkVelocity: 4,
3615
- * }));
3616
- *
3617
- * // Spawn the entity in the world.
3618
- * myEntity.spawn(world, { x: 53, y: 10, z: 23 });
3619
- * ```
3620
- *
3621
- * @public
3622
- */
3623
- export declare class PlayerEntityController extends BaseEntityController {
3624
- /** Whether to automatically cancel left click input after first processed tick, defaults to true. */
3625
- autoCancelMouseLeftClick: boolean;
3626
- /**
3627
- * A function allowing custom logic to determine if the entity can walk.
3628
- * @param playerEntityController - The entity controller instance.
3629
- * @returns Whether the entity of the entity controller can walk.
3630
- */
3631
- canWalk: (playerEntityController: PlayerEntityController) => boolean;
3632
- /**
3633
- * A function allowing custom logic to determine if the entity can run.
3634
- * @param playerEntityController - The entity controller instance.
3635
- * @returns Whether the entity of the entity controller can run.
3636
- */
3637
- canRun: (playerEntityController: PlayerEntityController) => boolean;
3638
- /**
3639
- * A function allowing custom logic to determine if the entity can jump.
3640
- * @param playerEntityController - The entity controller instance.
3641
- * @returns Whether the entity of the entity controller can jump.
3642
- */
3643
- canJump: (playerEntityController: PlayerEntityController) => boolean;
3644
- /** The looped animation(s) that will play when the entity is idle. */
3645
- idleLoopedAnimations: string[];
3646
- /** The oneshot animation(s) that will play when the entity interacts (left click) */
3647
- interactOneshotAnimations: string[];
3648
- /** The oneshot animation(s) that will play when the entity is jumping. */
3649
- jumpOneshotAnimations: string[];
3650
- /** The upward velocity applied to the entity when it jumps. */
3651
- jumpVelocity: number;
3652
- /** The looped animation(s) that will play when the entity is running. */
3653
- runLoopedAnimations: string[];
3654
- /** The normalized horizontal velocity applied to the entity when it runs. */
3655
- runVelocity: number;
3656
- /** Whether the entity sticks to platforms. */
3657
- sticksToPlatforms: boolean;
3658
- /** The looped animation(s) that will play when the entity is walking. */
3659
- walkLoopedAnimations: string[];
3660
- /** The normalized horizontal velocity applied to the entity when it walks. */
3661
- walkVelocity: number;
3662
-
3663
-
3664
-
3665
- /**
3666
- * @param options - Options for the controller.
3667
- */
3668
- constructor(options?: PlayerEntityControllerOptions);
3669
- /** Whether the entity is grounded. */
3670
- get isGrounded(): boolean;
3671
- /** Whether the entity is on a platform, a platform is any entity with a kinematic rigid body. */
3672
- get isOnPlatform(): boolean;
3673
- /** The platform the entity is on, if any. */
3674
- get platform(): Entity | undefined;
3675
- /**
3676
- * Called when the controller is attached to an entity.
3677
- * @param entity - The entity to attach the controller to.
3678
- */
3679
- attach(entity: Entity): void;
3680
- /**
3681
- * Called when the controlled entity is spawned.
3682
- * In PlayerEntityController, this function is used to create
3683
- * the colliders for the entity for wall and ground detection.
3684
- * @param entity - The entity that is spawned.
3685
- */
3686
- spawn(entity: Entity): void;
3687
- /**
3688
- * Ticks the player movement for the entity controller,
3689
- * overriding the default implementation. If the entity to tick
3690
- * is a child entity, only the event will be emitted but the default
3691
- * movement logic will not be applied.
3692
- *
3693
- * @param entity - The entity to tick.
3694
- * @param input - The current input state of the player.
3695
- * @param cameraOrientation - The current camera orientation state of the player.
3696
- * @param deltaTimeMs - The delta time in milliseconds since the last tick.
3697
- */
3698
- tickWithPlayerInput(entity: PlayerEntity, input: PlayerInput, cameraOrientation: PlayerCameraOrientation, deltaTimeMs: number): void;
3699
- }
3700
-
3701
- /** Options for creating a PlayerEntityController instance. @public */
3702
- export declare interface PlayerEntityControllerOptions {
3703
- /** Whether to automatically cancel left click input after first processed tick, defaults to true. */
3704
- autoCancelMouseLeftClick?: boolean;
3705
- /** A function allowing custom logic to determine if the entity can jump. */
3706
- canJump?: () => boolean;
3707
- /** A function allowing custom logic to determine if the entity can walk. */
3708
- canWalk?: () => boolean;
3709
- /** A function allowing custom logic to determine if the entity can run. */
3710
- canRun?: () => boolean;
3711
- /** Overrides the animation(s) that will play when the entity is idle. */
3712
- idleLoopedAnimations?: string[];
3713
- /** Overrides the animation(s) that will play when the entity interacts (left click) */
3714
- interactOneshotAnimations?: string[];
3715
- /** Overrides the animation(s) that will play when the entity is jumping. */
3716
- jumpOneshotAnimations?: string[];
3717
- /** The upward velocity applied to the entity when it jumps. */
3718
- jumpVelocity?: number;
3719
- /** The normalized horizontal velocity applied to the entity when it runs. */
3720
- runVelocity?: number;
3721
- /** Overrides the animation(s) that will play when the entity is running. */
3722
- runLoopedAnimations?: string[];
3723
- /** Whether the entity sticks to platforms, defaults to true. */
3724
- sticksToPlatforms?: boolean;
3725
- /** Overrides the animation(s) that will play when the entity is walking. */
3726
- walkLoopedAnimations?: string[];
3727
- /** The normalized horizontal velocity applied to the entity when it walks. */
3728
- walkVelocity?: number;
3729
- }
3730
-
3731
3818
  /** Options for creating a PlayerEntity instance. @public */
3732
3819
  export declare type PlayerEntityOptions = {
3733
3820
  /** The player the player entity is assigned to. */
@@ -5510,6 +5597,13 @@ export declare type WaypointMoveCompleteCallback = (waypoint: Vector3Like, waypo
5510
5597
  */
5511
5598
  export declare type WaypointMoveSkippedCallback = (waypoint: Vector3Like, waypointIndex: number) => void;
5512
5599
 
5600
+ /** The options for a wedge collider. @public */
5601
+ export declare interface WedgeColliderOptions extends BaseColliderOptions {
5602
+ shape: ColliderShape.WEDGE;
5603
+ /** The extents of the wedge collider, defining full width (x), height (y), and length (z). */
5604
+ extents?: Vector3Like;
5605
+ }
5606
+
5513
5607
  /**
5514
5608
  * Represents a world in the game server.
5515
5609
  *
@@ -5600,7 +5694,7 @@ export declare class World extends EventRouter implements protocol.Serializable
5600
5694
  /** The simulation for the world. */
5601
5695
  get simulation(): Simulation;
5602
5696
  /**
5603
- * Loads a map into the world.
5697
+ * Loads a map into the world, clearing any prior map.
5604
5698
  * @param map - The map to load.
5605
5699
  */
5606
5700
  loadMap(map: WorldMap): void;