hytopia 0.5.6-dev16 → 0.5.6-dev17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.5.6-dev16",
3
+ "version": "0.5.6-dev17",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.api.json CHANGED
@@ -4920,8 +4920,8 @@
4920
4920
  },
4921
4921
  {
4922
4922
  "kind": "Reference",
4923
- "text": "TrimeshColliderOptions",
4924
- "canonicalReference": "server!TrimeshColliderOptions:interface"
4923
+ "text": "VoxelsColliderOptions",
4924
+ "canonicalReference": "server!VoxelsColliderOptions:interface"
4925
4925
  },
4926
4926
  {
4927
4927
  "kind": "Content",
@@ -5322,8 +5322,8 @@
5322
5322
  },
5323
5323
  {
5324
5324
  "kind": "Reference",
5325
- "text": "TrimeshColliderOptions",
5326
- "canonicalReference": "server!TrimeshColliderOptions:interface"
5325
+ "text": "VoxelsColliderOptions",
5326
+ "canonicalReference": "server!VoxelsColliderOptions:interface"
5327
5327
  },
5328
5328
  {
5329
5329
  "kind": "Content",
@@ -9280,6 +9280,71 @@
9280
9280
  "isAbstract": false,
9281
9281
  "name": "setTag"
9282
9282
  },
9283
+ {
9284
+ "kind": "Method",
9285
+ "canonicalReference": "server!Collider#setVoxel:member(1)",
9286
+ "docComment": "/**\n * Sets the voxel at the given coordinate as filled or not filled.\n *\n * @param coordinate - The coordinate of the voxel to set.\n *\n * @param filled - True if the voxel at the coordinate should be filled, false if it should be removed.\n */\n",
9287
+ "excerptTokens": [
9288
+ {
9289
+ "kind": "Content",
9290
+ "text": "setVoxel(coordinate: "
9291
+ },
9292
+ {
9293
+ "kind": "Reference",
9294
+ "text": "Vector3Like",
9295
+ "canonicalReference": "server!Vector3Like:interface"
9296
+ },
9297
+ {
9298
+ "kind": "Content",
9299
+ "text": ", filled: "
9300
+ },
9301
+ {
9302
+ "kind": "Content",
9303
+ "text": "boolean"
9304
+ },
9305
+ {
9306
+ "kind": "Content",
9307
+ "text": "): "
9308
+ },
9309
+ {
9310
+ "kind": "Content",
9311
+ "text": "void"
9312
+ },
9313
+ {
9314
+ "kind": "Content",
9315
+ "text": ";"
9316
+ }
9317
+ ],
9318
+ "isStatic": false,
9319
+ "returnTypeTokenRange": {
9320
+ "startIndex": 5,
9321
+ "endIndex": 6
9322
+ },
9323
+ "releaseTag": "Public",
9324
+ "isProtected": false,
9325
+ "overloadIndex": 1,
9326
+ "parameters": [
9327
+ {
9328
+ "parameterName": "coordinate",
9329
+ "parameterTypeTokenRange": {
9330
+ "startIndex": 1,
9331
+ "endIndex": 2
9332
+ },
9333
+ "isOptional": false
9334
+ },
9335
+ {
9336
+ "parameterName": "filled",
9337
+ "parameterTypeTokenRange": {
9338
+ "startIndex": 3,
9339
+ "endIndex": 4
9340
+ },
9341
+ "isOptional": false
9342
+ }
9343
+ ],
9344
+ "isOptional": false,
9345
+ "isAbstract": false,
9346
+ "name": "setVoxel"
9347
+ },
9283
9348
  {
9284
9349
  "kind": "Property",
9285
9350
  "canonicalReference": "server!Collider#shape:member",
@@ -9420,6 +9485,15 @@
9420
9485
  "kind": "Content",
9421
9486
  "text": " | "
9422
9487
  },
9488
+ {
9489
+ "kind": "Reference",
9490
+ "text": "VoxelsColliderOptions",
9491
+ "canonicalReference": "server!VoxelsColliderOptions:interface"
9492
+ },
9493
+ {
9494
+ "kind": "Content",
9495
+ "text": " | "
9496
+ },
9423
9497
  {
9424
9498
  "kind": "Reference",
9425
9499
  "text": "WedgeColliderOptions",
@@ -9444,7 +9518,7 @@
9444
9518
  "name": "ColliderOptions",
9445
9519
  "typeTokenRange": {
9446
9520
  "startIndex": 1,
9447
- "endIndex": 18
9521
+ "endIndex": 20
9448
9522
  }
9449
9523
  },
9450
9524
  {
@@ -9630,6 +9704,27 @@
9630
9704
  "releaseTag": "Public",
9631
9705
  "name": "TRIMESH"
9632
9706
  },
9707
+ {
9708
+ "kind": "EnumMember",
9709
+ "canonicalReference": "server!ColliderShape.VOXELS:member",
9710
+ "docComment": "",
9711
+ "excerptTokens": [
9712
+ {
9713
+ "kind": "Content",
9714
+ "text": "VOXELS = "
9715
+ },
9716
+ {
9717
+ "kind": "Content",
9718
+ "text": "\"voxels\""
9719
+ }
9720
+ ],
9721
+ "initializerTokenRange": {
9722
+ "startIndex": 1,
9723
+ "endIndex": 2
9724
+ },
9725
+ "releaseTag": "Public",
9726
+ "name": "VOXELS"
9727
+ },
9633
9728
  {
9634
9729
  "kind": "EnumMember",
9635
9730
  "canonicalReference": "server!ColliderShape.WEDGE:member",
@@ -43469,6 +43564,126 @@
43469
43564
  ],
43470
43565
  "extendsTokenRanges": []
43471
43566
  },
43567
+ {
43568
+ "kind": "Interface",
43569
+ "canonicalReference": "server!VoxelsColliderOptions:interface",
43570
+ "docComment": "/**\n * The options for a voxels collider.\n *\n * @public\n */\n",
43571
+ "excerptTokens": [
43572
+ {
43573
+ "kind": "Content",
43574
+ "text": "export interface VoxelsColliderOptions extends "
43575
+ },
43576
+ {
43577
+ "kind": "Reference",
43578
+ "text": "BaseColliderOptions",
43579
+ "canonicalReference": "server!BaseColliderOptions:interface"
43580
+ },
43581
+ {
43582
+ "kind": "Content",
43583
+ "text": " "
43584
+ }
43585
+ ],
43586
+ "fileUrlPath": "src/worlds/physics/Collider.ts",
43587
+ "releaseTag": "Public",
43588
+ "name": "VoxelsColliderOptions",
43589
+ "preserveMemberOrder": false,
43590
+ "members": [
43591
+ {
43592
+ "kind": "PropertySignature",
43593
+ "canonicalReference": "server!VoxelsColliderOptions#coordinates:member",
43594
+ "docComment": "/**\n * The coordinate of each voxel in the collider.\n */\n",
43595
+ "excerptTokens": [
43596
+ {
43597
+ "kind": "Content",
43598
+ "text": "coordinates?: "
43599
+ },
43600
+ {
43601
+ "kind": "Reference",
43602
+ "text": "Vector3Like",
43603
+ "canonicalReference": "server!Vector3Like:interface"
43604
+ },
43605
+ {
43606
+ "kind": "Content",
43607
+ "text": "[]"
43608
+ },
43609
+ {
43610
+ "kind": "Content",
43611
+ "text": ";"
43612
+ }
43613
+ ],
43614
+ "isReadonly": false,
43615
+ "isOptional": true,
43616
+ "releaseTag": "Public",
43617
+ "name": "coordinates",
43618
+ "propertyTypeTokenRange": {
43619
+ "startIndex": 1,
43620
+ "endIndex": 3
43621
+ }
43622
+ },
43623
+ {
43624
+ "kind": "PropertySignature",
43625
+ "canonicalReference": "server!VoxelsColliderOptions#shape:member",
43626
+ "docComment": "",
43627
+ "excerptTokens": [
43628
+ {
43629
+ "kind": "Content",
43630
+ "text": "shape: "
43631
+ },
43632
+ {
43633
+ "kind": "Reference",
43634
+ "text": "ColliderShape.VOXELS",
43635
+ "canonicalReference": "server!ColliderShape.VOXELS:member"
43636
+ },
43637
+ {
43638
+ "kind": "Content",
43639
+ "text": ";"
43640
+ }
43641
+ ],
43642
+ "isReadonly": false,
43643
+ "isOptional": false,
43644
+ "releaseTag": "Public",
43645
+ "name": "shape",
43646
+ "propertyTypeTokenRange": {
43647
+ "startIndex": 1,
43648
+ "endIndex": 2
43649
+ }
43650
+ },
43651
+ {
43652
+ "kind": "PropertySignature",
43653
+ "canonicalReference": "server!VoxelsColliderOptions#size:member",
43654
+ "docComment": "/**\n * The size of each voxel in the collider.\n */\n",
43655
+ "excerptTokens": [
43656
+ {
43657
+ "kind": "Content",
43658
+ "text": "size?: "
43659
+ },
43660
+ {
43661
+ "kind": "Reference",
43662
+ "text": "Vector3Like",
43663
+ "canonicalReference": "server!Vector3Like:interface"
43664
+ },
43665
+ {
43666
+ "kind": "Content",
43667
+ "text": ";"
43668
+ }
43669
+ ],
43670
+ "isReadonly": false,
43671
+ "isOptional": true,
43672
+ "releaseTag": "Public",
43673
+ "name": "size",
43674
+ "propertyTypeTokenRange": {
43675
+ "startIndex": 1,
43676
+ "endIndex": 2
43677
+ }
43678
+ }
43679
+ ],
43680
+ "extendsTokenRanges": [
43681
+ {
43682
+ "startIndex": 1,
43683
+ "endIndex": 2
43684
+ }
43685
+ ]
43686
+ },
43472
43687
  {
43473
43688
  "kind": "TypeAlias",
43474
43689
  "canonicalReference": "server!WaypointMoveCompleteCallback:type",
package/server.d.ts CHANGED
@@ -609,7 +609,7 @@ export declare class BlockType extends EventRouter implements protocol.Serializa
609
609
  /** The unique identifier for the block type. */
610
610
  get id(): number;
611
611
  /** The collider options for the block type. */
612
- get colliderOptions(): TrimeshColliderOptions;
612
+ get colliderOptions(): VoxelsColliderOptions;
613
613
  /** Whether the block type is a liquid. */
614
614
  get isLiquid(): boolean;
615
615
  /** Whether the block type is meshable. */
@@ -651,7 +651,7 @@ export declare interface BlockTypeOptions {
651
651
  /** The unique numeric identifier for the block type. */
652
652
  id: number;
653
653
  /** The custom collider options for the block type. */
654
- customColliderOptions?: TrimeshColliderOptions;
654
+ customColliderOptions?: VoxelsColliderOptions;
655
655
  /** Whether the block type is a liquid. */
656
656
  isLiquid?: boolean;
657
657
  /** The name of the block type. */
@@ -880,19 +880,23 @@ export declare class Chunk extends EventRouter implements protocol.Serializable
880
880
 
881
881
 
882
882
 
883
+
884
+
885
+
886
+
883
887
  /**
884
888
  * Creates a new chunk instance.
885
889
  */
886
890
  constructor();
887
891
  /** The blocks in the chunk as a flat Uint8Array[4096], each index as 0 or a block type id. */
888
892
  get blocks(): Readonly<Uint8Array>;
889
-
890
893
  /** Whether the chunk is actively simulated in the internal physics engine. */
891
894
  get isSimulated(): boolean;
892
895
  /** Whether the chunk has been spawned. */
893
896
  get isSpawned(): boolean;
894
897
  /** The origin coordinate of the chunk. */
895
898
  get originCoordinate(): Vector3Like | undefined;
899
+
896
900
  /** The world the chunk belongs to. */
897
901
  get world(): World | undefined;
898
902
  /**
@@ -950,8 +954,6 @@ export declare class Chunk extends EventRouter implements protocol.Serializable
950
954
 
951
955
 
952
956
 
953
- private _meshColliders;
954
-
955
957
 
956
958
 
957
959
 
@@ -1201,6 +1203,12 @@ export declare class Collider extends EventRouter {
1201
1203
  * @param tag - The tag of the collider.
1202
1204
  */
1203
1205
  setTag(tag: string): void;
1206
+ /**
1207
+ * Sets the voxel at the given coordinate as filled or not filled.
1208
+ * @param coordinate - The coordinate of the voxel to set.
1209
+ * @param filled - True if the voxel at the coordinate should be filled, false if it should be removed.
1210
+ */
1211
+ setVoxel(coordinate: Vector3Like, filled: boolean): void;
1204
1212
  /**
1205
1213
  * Adds the collider to the simulation.
1206
1214
  * @param simulation - The simulation to add the collider to.
@@ -1231,10 +1239,11 @@ export declare class Collider extends EventRouter {
1231
1239
 
1232
1240
 
1233
1241
 
1242
+
1234
1243
  }
1235
1244
 
1236
1245
  /** The options for a collider. @public */
1237
- export declare type ColliderOptions = BallColliderOptions | BlockColliderOptions | CapsuleColliderOptions | ConeColliderOptions | CylinderColliderOptions | RoundCylinderColliderOptions | TrimeshColliderOptions | WedgeColliderOptions | NoneColliderOptions;
1246
+ export declare type ColliderOptions = BallColliderOptions | BlockColliderOptions | CapsuleColliderOptions | ConeColliderOptions | CylinderColliderOptions | RoundCylinderColliderOptions | TrimeshColliderOptions | VoxelsColliderOptions | WedgeColliderOptions | NoneColliderOptions;
1238
1247
 
1239
1248
  /** The shapes a collider can be. @public */
1240
1249
  export declare enum ColliderShape {
@@ -1246,6 +1255,7 @@ export declare enum ColliderShape {
1246
1255
  CYLINDER = "cylinder",
1247
1256
  ROUND_CYLINDER = "round-cylinder",
1248
1257
  TRIMESH = "trimesh",
1258
+ VOXELS = "voxels",
1249
1259
  WEDGE = "wedge"
1250
1260
  }
1251
1261
 
@@ -5622,6 +5632,15 @@ export declare interface Vector3Like {
5622
5632
  z: number;
5623
5633
  }
5624
5634
 
5635
+ /** The options for a voxels collider. @public */
5636
+ export declare interface VoxelsColliderOptions extends BaseColliderOptions {
5637
+ shape: ColliderShape.VOXELS;
5638
+ /** The coordinate of each voxel in the collider. */
5639
+ coordinates?: Vector3Like[];
5640
+ /** The size of each voxel in the collider. */
5641
+ size?: Vector3Like;
5642
+ }
5643
+
5625
5644
  /**
5626
5645
  * A callback function called when the entity associated with the
5627
5646
  * PathfindingEntityController finishes moving to a calculate waypoint