hytopia 0.1.33 → 0.1.36
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/README.md +3 -1
- package/docs/server.audio.md +1 -1
- package/docs/server.blocktype.md +1 -1
- package/docs/server.blocktyperegistry.md +2 -2
- package/docs/server.blocktyperegistry.registerblocktype.md +2 -18
- package/docs/server.chunk.getblock.md +55 -0
- package/docs/server.chunk.hasblock.md +55 -0
- package/docs/server.chunk.md +28 -0
- package/docs/server.chunklattice.getblock.md +55 -0
- package/docs/server.chunklattice.hasblock.md +55 -0
- package/docs/server.chunklattice.md +29 -1
- package/docs/server.chunklattice.setblock.md +2 -2
- package/docs/server.collider.md +21 -0
- package/docs/server.collider.shape.md +13 -0
- package/docs/server.default_block_entity_rigid_body_options.md +13 -0
- package/docs/server.default_entity_rigid_body_options.md +1 -1
- package/docs/server.entity.blockhalfextents.md +13 -0
- package/docs/server.entity.blocktextureuri.md +13 -0
- package/docs/server.entity.md +98 -0
- package/docs/server.entity.settintcolor.md +53 -0
- package/docs/server.entity.tag.md +13 -0
- package/docs/server.entity.tintcolor.md +13 -0
- package/docs/server.entityeventpayload.md +9 -0
- package/docs/server.entityeventpayload.settintcolor.entity.md +11 -0
- package/docs/server.entityeventpayload.settintcolor.md +70 -0
- package/docs/server.entityeventpayload.settintcolor.tintcolor.md +11 -0
- package/docs/server.entityeventtype.md +15 -1
- package/docs/server.entitymanager.getentitiesbytag.md +55 -0
- package/docs/server.entitymanager.getentitiesbytagsubstring.md +55 -0
- package/docs/server.entitymanager.md +28 -0
- package/docs/server.entityoptions.blockhalfextents.md +13 -0
- package/docs/server.entityoptions.blocktextureuri.md +13 -0
- package/docs/server.entityoptions.md +76 -0
- package/docs/server.entityoptions.tag.md +13 -0
- package/docs/server.entityoptions.tintcolor.md +13 -0
- package/docs/server.gameserver.md +1 -1
- package/docs/server.hytopia.audio.md +1 -1
- package/docs/server.hytopia.blocktype.md +1 -1
- package/docs/server.hytopia.blocktyperegistry.md +2 -2
- package/docs/server.hytopia.blocktyperegistry.registerblocktype.md +2 -18
- package/docs/server.hytopia.chunk.getblock.md +55 -0
- package/docs/server.hytopia.chunk.hasblock.md +55 -0
- package/docs/server.hytopia.chunk.md +28 -0
- package/docs/server.hytopia.chunklattice.getblock.md +55 -0
- package/docs/server.hytopia.chunklattice.hasblock.md +55 -0
- package/docs/server.hytopia.chunklattice.md +29 -1
- package/docs/server.hytopia.chunklattice.setblock.md +2 -2
- package/docs/server.hytopia.collider.md +21 -0
- package/docs/server.hytopia.collider.shape.md +13 -0
- package/docs/server.hytopia.default_block_entity_rigid_body_options.md +13 -0
- package/docs/server.hytopia.default_entity_rigid_body_options.md +1 -1
- package/docs/server.hytopia.entity.blockhalfextents.md +13 -0
- package/docs/server.hytopia.entity.blocktextureuri.md +13 -0
- package/docs/server.hytopia.entity.md +98 -0
- package/docs/server.hytopia.entity.settintcolor.md +53 -0
- package/docs/server.hytopia.entity.tag.md +13 -0
- package/docs/server.hytopia.entity.tintcolor.md +13 -0
- package/docs/server.hytopia.entityeventpayload.md +9 -0
- package/docs/server.hytopia.entityeventpayload.settintcolor.entity.md +11 -0
- package/docs/server.hytopia.entityeventpayload.settintcolor.md +70 -0
- package/docs/server.hytopia.entityeventpayload.settintcolor.tintcolor.md +11 -0
- package/docs/server.hytopia.entityeventtype.md +15 -1
- package/docs/server.hytopia.entitymanager.getentitiesbytag.md +55 -0
- package/docs/server.hytopia.entitymanager.getentitiesbytagsubstring.md +55 -0
- package/docs/server.hytopia.entitymanager.md +28 -0
- package/docs/server.hytopia.entityoptions.blockhalfextents.md +13 -0
- package/docs/server.hytopia.entityoptions.blocktextureuri.md +13 -0
- package/docs/server.hytopia.entityoptions.md +76 -0
- package/docs/server.hytopia.entityoptions.tag.md +13 -0
- package/docs/server.hytopia.entityoptions.tintcolor.md +13 -0
- package/docs/server.hytopia.gameserver.md +1 -1
- package/docs/server.hytopia.md +23 -12
- package/docs/server.hytopia.rgbcolor.b.md +11 -0
- package/docs/server.hytopia.rgbcolor.g.md +11 -0
- package/docs/server.hytopia.rgbcolor.md +89 -0
- package/docs/server.hytopia.rgbcolor.r.md +11 -0
- package/docs/server.hytopia.rigidbody.md +0 -35
- package/docs/server.hytopia.rigidbodyoptions.md +0 -19
- package/docs/server.hytopia.simulation.md +14 -0
- package/docs/{server.hytopia.rigidbody.settag.md → server.hytopia.simulation.setgravity.md} +7 -7
- package/docs/server.hytopia.worldmap.blocktypes.md +1 -5
- package/docs/server.hytopia.worldmap.md +1 -1
- package/docs/server.md +23 -12
- package/docs/server.rgbcolor.b.md +11 -0
- package/docs/server.rgbcolor.g.md +11 -0
- package/docs/server.rgbcolor.md +89 -0
- package/docs/server.rgbcolor.r.md +11 -0
- package/docs/server.rigidbody.md +0 -35
- package/docs/server.rigidbodyoptions.md +0 -19
- package/docs/server.simulation.md +14 -0
- package/docs/server.simulation.setgravity.md +53 -0
- package/docs/server.worldmap.blocktypes.md +1 -5
- package/docs/server.worldmap.md +1 -1
- package/examples/block-entity/README.md +15 -0
- package/examples/block-entity/assets/audio/music/cave.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/desert.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/end.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/jungle.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/nether.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/night.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/night2.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/overworld.mp3 +0 -0
- package/examples/block-entity/assets/audio/music/snow.mp3 +0 -0
- package/examples/block-entity/assets/audio/sfx/damage.wav +0 -0
- package/examples/block-entity/assets/audio/sfx/step.wav +0 -0
- package/examples/block-entity/assets/certs/README.md +10 -0
- package/examples/block-entity/assets/certs/localhost.crt +20 -0
- package/examples/block-entity/assets/certs/localhost.key +27 -0
- package/examples/block-entity/assets/cubemaps/skybox/+x.png +0 -0
- package/examples/block-entity/assets/cubemaps/skybox/+y.png +0 -0
- package/examples/block-entity/assets/cubemaps/skybox/+z.png +0 -0
- package/examples/block-entity/assets/cubemaps/skybox/-x.png +0 -0
- package/examples/block-entity/assets/cubemaps/skybox/-y.png +0 -0
- package/examples/block-entity/assets/cubemaps/skybox/-z.png +0 -0
- package/examples/block-entity/assets/map.json +2623 -0
- package/examples/block-entity/assets/models/bat.gltf +1 -0
- package/examples/block-entity/assets/models/chicken.gltf +1 -0
- package/examples/block-entity/assets/models/cow.gltf +1 -0
- package/examples/block-entity/assets/models/donkey.gltf +1 -0
- package/examples/block-entity/assets/models/horse.gltf +1 -0
- package/examples/block-entity/assets/models/mindflayer.gltf +1 -0
- package/examples/block-entity/assets/models/pig.gltf +1 -0
- package/examples/block-entity/assets/models/player.gltf +1 -0
- package/examples/block-entity/assets/models/rabbit.gltf +1 -0
- package/examples/block-entity/assets/models/sheep.gltf +1 -0
- package/examples/block-entity/assets/models/skeleton.gltf +1 -0
- package/examples/block-entity/assets/models/spider.gltf +1 -0
- package/examples/block-entity/assets/models/squid.gltf +1 -0
- package/examples/block-entity/assets/models/stalker.gltf +1 -0
- package/examples/block-entity/assets/models/zombie.gltf +1 -0
- package/examples/block-entity/assets/textures/bricks.png +0 -0
- package/examples/block-entity/assets/textures/clay.png +0 -0
- package/examples/block-entity/assets/textures/cobblestone.png +0 -0
- package/examples/block-entity/assets/textures/diamond_ore.png +0 -0
- package/examples/block-entity/assets/textures/dirt.png +0 -0
- package/examples/block-entity/assets/textures/dragons_stone.png +0 -0
- package/examples/block-entity/assets/textures/emerald_ore.png +0 -0
- package/examples/block-entity/assets/textures/glass.png +0 -0
- package/examples/block-entity/assets/textures/gold_ore.png +0 -0
- package/examples/block-entity/assets/textures/grass/+x.png +0 -0
- package/examples/block-entity/assets/textures/grass/+y.png +0 -0
- package/examples/block-entity/assets/textures/grass/+z.png +0 -0
- package/examples/block-entity/assets/textures/grass/-x.png +0 -0
- package/examples/block-entity/assets/textures/grass/-y.png +0 -0
- package/examples/block-entity/assets/textures/grass/-z.png +0 -0
- package/examples/block-entity/assets/textures/gravel.png +0 -0
- package/examples/block-entity/assets/textures/ice.png +0 -0
- package/examples/block-entity/assets/textures/infected_shadowrock.png +0 -0
- package/examples/block-entity/assets/textures/iron_ore.png +0 -0
- package/examples/block-entity/assets/textures/lava.png +0 -0
- package/examples/block-entity/assets/textures/log_side.png +0 -0
- package/examples/block-entity/assets/textures/log_top.png +0 -0
- package/examples/block-entity/assets/textures/mossy_coblestone.png +0 -0
- package/examples/block-entity/assets/textures/nuit.png +0 -0
- package/examples/block-entity/assets/textures/oak_leaves.png +0 -0
- package/examples/block-entity/assets/textures/oak_planks.png +0 -0
- package/examples/block-entity/assets/textures/sand.png +0 -0
- package/examples/block-entity/assets/textures/sandstone.png +0 -0
- package/examples/block-entity/assets/textures/shadowrock.png +0 -0
- package/examples/block-entity/assets/textures/snow.png +0 -0
- package/examples/block-entity/assets/textures/stone.png +0 -0
- package/examples/block-entity/assets/textures/stone_bricks.png +0 -0
- package/examples/block-entity/assets/textures/void_grass/+x.png +0 -0
- package/examples/block-entity/assets/textures/void_grass/+y.png +0 -0
- package/examples/block-entity/assets/textures/void_grass/+z.png +0 -0
- package/examples/block-entity/assets/textures/void_grass/-x.png +0 -0
- package/examples/block-entity/assets/textures/void_grass/-y.png +0 -0
- package/examples/block-entity/assets/textures/void_grass/-z.png +0 -0
- package/examples/block-entity/assets/textures/void_sand.png +0 -0
- package/examples/block-entity/assets/textures/water.png +0 -0
- package/examples/block-entity/index.ts +173 -0
- package/examples/block-entity/package.json +14 -0
- package/examples/payload-game/index.ts +7 -0
- package/package.json +1 -1
- package/readme/assets/banner-2.jpeg +0 -0
- package/server.api.json +1910 -414
- package/server.d.ts +98 -58
- package/server.js +80 -80
- package/docs/server.hytopia.rigidbody.tag.md +0 -13
- package/docs/server.hytopia.rigidbodyoptions.tag.md +0 -13
- package/docs/server.hytopia.webserver.md +0 -21
- package/docs/server.rigidbody.settag.md +0 -53
- package/docs/server.rigidbody.tag.md +0 -13
- package/docs/server.rigidbodyoptions.tag.md +0 -13
- package/docs/server.webserver.md +0 -21
- package/examples/README.md +0 -22
package/server.d.ts
CHANGED
@@ -23,7 +23,7 @@ import { WebSocket as WebSocket_2 } from 'ws';
|
|
23
23
|
* @example
|
24
24
|
* ```typescript
|
25
25
|
* (new Audio({
|
26
|
-
* uri: 'assets/music/song.mp3
|
26
|
+
* uri: 'music/song.mp3', // relative to the server's assets directory in the project root, resolves to assets/music/song.mp3
|
27
27
|
* loop: true,
|
28
28
|
* volume: 0.5,
|
29
29
|
* })).play(world);
|
@@ -365,7 +365,7 @@ export declare class Block {
|
|
365
365
|
* const stoneBlockTypeId = 10;
|
366
366
|
* world.blockTypeRegistry.registerBlockType(stoneBlockTypeId, new BlockType({
|
367
367
|
* id: stoneBlockTypeId,
|
368
|
-
* textureUri: '
|
368
|
+
* textureUri: 'textures/stone.png',
|
369
369
|
* name: 'Stone',
|
370
370
|
* }));
|
371
371
|
*
|
@@ -435,7 +435,7 @@ export declare interface BlockTypeOptions {
|
|
435
435
|
* ```typescript
|
436
436
|
* world.blockTypeRegistry.registerGenericBlockType({
|
437
437
|
* id: 15,
|
438
|
-
* textureUri: '
|
438
|
+
* textureUri: 'textures/dirt.png',
|
439
439
|
* name: 'Dirt',
|
440
440
|
* });
|
441
441
|
* ```
|
@@ -467,10 +467,9 @@ export declare class BlockTypeRegistry implements protocol.Serializable {
|
|
467
467
|
registerGenericBlockType(blockTypeOptions: BlockTypeOptions): BlockType;
|
468
468
|
/**
|
469
469
|
* Register a block type.
|
470
|
-
* @param
|
471
|
-
* @param blockTypeReference - The block type to register.
|
470
|
+
* @param blockType - The block type to register.
|
472
471
|
*/
|
473
|
-
registerBlockType(
|
472
|
+
registerBlockType(blockType: BlockType): void;
|
474
473
|
|
475
474
|
}
|
476
475
|
|
@@ -664,6 +663,18 @@ export declare class Chunk implements protocol.Serializable {
|
|
664
663
|
* Despawn the chunk from the world.
|
665
664
|
*/
|
666
665
|
despawn(): void;
|
666
|
+
/**
|
667
|
+
* Get the block type id at a specific local coordinate.
|
668
|
+
* @param localCoordinate - The local coordinate of the block to get.
|
669
|
+
* @returns The block type id.
|
670
|
+
*/
|
671
|
+
getBlock(localCoordinate: Vector3): number;
|
672
|
+
/**
|
673
|
+
* Check if a block exists at a specific local coordinate.
|
674
|
+
* @param localCoordinate - The local coordinate of the block to check.
|
675
|
+
* @returns Whether a block exists.
|
676
|
+
*/
|
677
|
+
hasBlock(localCoordinate: Vector3): boolean;
|
667
678
|
/**
|
668
679
|
* Set the block at a specific local coordinate by block type id.
|
669
680
|
* @param localCoordinate - The local coordinate of the block to set.
|
@@ -721,6 +732,12 @@ export declare class ChunkLattice {
|
|
721
732
|
constructor(world: World);
|
722
733
|
|
723
734
|
|
735
|
+
/**
|
736
|
+
* Get the block type id at a specific global coordinate.
|
737
|
+
* @param globalCoordinate - The global coordinate of the block to get.
|
738
|
+
* @returns The block type id, 0 if no block is set.
|
739
|
+
*/
|
740
|
+
getBlock(globalCoordinate: Vector3): number;
|
724
741
|
/**
|
725
742
|
* Get a chunk by its origin coordinate.
|
726
743
|
* @param originCoordinate - The origin coordinate of the chunk to get.
|
@@ -732,6 +749,12 @@ export declare class ChunkLattice {
|
|
732
749
|
* @returns An array of all chunks in the lattice.
|
733
750
|
*/
|
734
751
|
getAllChunks(): Chunk[];
|
752
|
+
/**
|
753
|
+
* Check if a block exists at a specific global coordinate.
|
754
|
+
* @param globalCoordinate - The global coordinate of the block to check.
|
755
|
+
* @returns Whether a block exists.
|
756
|
+
*/
|
757
|
+
hasBlock(globalCoordinate: Vector3): boolean;
|
735
758
|
/**
|
736
759
|
* Check if a chunk exists by its origin coordinate.
|
737
760
|
* @param originCoordinate - The origin coordinate of the chunk to check.
|
@@ -740,9 +763,9 @@ export declare class ChunkLattice {
|
|
740
763
|
hasChunk(originCoordinate: Vector3): boolean;
|
741
764
|
/**
|
742
765
|
* Set the block at a global coordinate by block type id, automatically
|
743
|
-
* creating a chunk if it doesn't exist.
|
766
|
+
* creating a chunk if it doesn't exist. Use block type id 0 for air.
|
744
767
|
* @param globalCoordinate - The global coordinate of the block to set.
|
745
|
-
* @param blockTypeId - The block type id to set.
|
768
|
+
* @param blockTypeId - The block type id to set. Use 0 to remove the block and replace with air.
|
746
769
|
*/
|
747
770
|
setBlock(globalCoordinate: Vector3, blockTypeId: number): void;
|
748
771
|
|
@@ -769,6 +792,7 @@ export declare class Collider {
|
|
769
792
|
|
770
793
|
|
771
794
|
|
795
|
+
|
772
796
|
/**
|
773
797
|
* @param colliderOptions - The options for the collider instance.
|
774
798
|
*/
|
@@ -785,6 +809,8 @@ export declare class Collider {
|
|
785
809
|
get parentRigidBody(): RigidBody | undefined;
|
786
810
|
/** The raw collider object from the Rapier physics engine. */
|
787
811
|
get rawCollider(): RAPIER.Collider | undefined;
|
812
|
+
/** The shape of the collider. */
|
813
|
+
get shape(): ColliderShape;
|
788
814
|
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
789
815
|
get tag(): string | undefined;
|
790
816
|
/**
|
@@ -1062,7 +1088,10 @@ export declare type DecodedCollisionGroups = {
|
|
1062
1088
|
collidesWith: string[];
|
1063
1089
|
};
|
1064
1090
|
|
1065
|
-
/** The default rigid body options when EntityOptions.rigidBodyOptions is not provided. @public */
|
1091
|
+
/** The default rigid body options for a block entity when EntityOptions.rigidBodyOptions is not provided. @public */
|
1092
|
+
export declare const DEFAULT_BLOCK_ENTITY_RIGID_BODY_OPTIONS: RigidBodyOptions;
|
1093
|
+
|
1094
|
+
/** The default rigid body options for a model entity when EntityOptions.rigidBodyOptions is not provided. @public */
|
1066
1095
|
export declare const DEFAULT_ENTITY_RIGID_BODY_OPTIONS: RigidBodyOptions;
|
1067
1096
|
|
1068
1097
|
/**
|
@@ -1260,12 +1289,22 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1260
1289
|
|
1261
1290
|
|
1262
1291
|
|
1292
|
+
|
1293
|
+
|
1294
|
+
|
1295
|
+
|
1263
1296
|
/**
|
1264
1297
|
* @param options - The options for the entity.
|
1265
1298
|
*/
|
1266
1299
|
constructor(options: EntityOptions);
|
1267
1300
|
/** The unique identifier for the entity. */
|
1268
1301
|
get id(): number | undefined;
|
1302
|
+
/** The character controller for the entity. */
|
1303
|
+
get characterController(): BaseCharacterController | undefined;
|
1304
|
+
/** The half extends of the visual size of the block entity when blockTextureUri is set. */
|
1305
|
+
get blockHalfExtents(): Vector3 | undefined;
|
1306
|
+
/** The URI or path to the texture to be used, if this is set, the entity is a block entity. */
|
1307
|
+
get blockTextureUri(): string | undefined;
|
1269
1308
|
/** The URI or path to the .gltf model asset to be used for the entity. */
|
1270
1309
|
get modelUri(): string | undefined;
|
1271
1310
|
/** The looped animations to start when the entity is spawned. */
|
@@ -1274,8 +1313,10 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1274
1313
|
get modelScale(): number | undefined;
|
1275
1314
|
/** The name of the entity. */
|
1276
1315
|
get name(): string;
|
1277
|
-
/**
|
1278
|
-
get
|
1316
|
+
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
1317
|
+
get tag(): string | undefined;
|
1318
|
+
/** The tint color of the entity. */
|
1319
|
+
get tintColor(): RgbColor | undefined;
|
1279
1320
|
/** Whether the entity is spawned. */
|
1280
1321
|
get isSpawned(): boolean;
|
1281
1322
|
/** The world the entity is in. */
|
@@ -1295,6 +1336,11 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1295
1336
|
* @param characterController - The character controller to set.
|
1296
1337
|
*/
|
1297
1338
|
setCharacterController(characterController: BaseCharacterController): void;
|
1339
|
+
/**
|
1340
|
+
* Sets the tint color of the entity.
|
1341
|
+
* @param tintColor - The tint color of the entity.
|
1342
|
+
*/
|
1343
|
+
setTintColor(tintColor: RgbColor | undefined): void;
|
1298
1344
|
/**
|
1299
1345
|
* Starts looped animations for the entity, blending with
|
1300
1346
|
* other animations currently playing.
|
@@ -1326,6 +1372,10 @@ export declare namespace EntityEventPayload {
|
|
1326
1372
|
export interface Despawn {
|
1327
1373
|
entity: Entity;
|
1328
1374
|
}
|
1375
|
+
export interface SetTintColor {
|
1376
|
+
entity: Entity;
|
1377
|
+
tintColor: RgbColor | undefined;
|
1378
|
+
}
|
1329
1379
|
export interface Spawn {
|
1330
1380
|
entity: Entity;
|
1331
1381
|
}
|
@@ -1354,8 +1404,9 @@ export declare namespace EntityEventPayload {
|
|
1354
1404
|
/** Event types an Entity instance can emit. @public */
|
1355
1405
|
export declare enum EntityEventType {
|
1356
1406
|
DESPAWN = "ENTITY.DESPAWN",
|
1407
|
+
SET_TINT_COLOR = "ENTITY.SET_TINT_COLOR",
|
1357
1408
|
SPAWN = "ENTITY.SPAWN",
|
1358
|
-
START_MODEL_LOOPED_ANIMATIONS = "ENTITY.
|
1409
|
+
START_MODEL_LOOPED_ANIMATIONS = "ENTITY.START_MODEL_LOOPED_ANIMATIONS",
|
1359
1410
|
START_MODEL_ONESHOT_ANIMATIONS = "ENTITY.START_MODEL_ONESHOT_ANIMATIONS",
|
1360
1411
|
STOP_MODEL_ANIMATIONS = "ENTITY.STOP_MODEL_ANIMATIONS",
|
1361
1412
|
UPDATE_ROTATION = "ENTITY.UPDATE_ROTATION",
|
@@ -1406,12 +1457,28 @@ export declare class EntityManager {
|
|
1406
1457
|
* @returns The spawned entity with the provided id, or undefined if no entity is found.
|
1407
1458
|
*/
|
1408
1459
|
getEntity<T extends Entity>(id: number): T | undefined;
|
1460
|
+
/**
|
1461
|
+
* Gets all spawned entities in the world with a specific tag.
|
1462
|
+
* @param tag - The tag to get the entities for.
|
1463
|
+
* @returns All spawned entities in the world with the provided tag.
|
1464
|
+
*/
|
1465
|
+
getEntitiesByTag(tag: string): Entity[];
|
1466
|
+
/**
|
1467
|
+
* Gets all spawned entities in the world with a tag that includes a specific substring.
|
1468
|
+
* @param tagSubstring - The tag substring to get the entities for.
|
1469
|
+
* @returns All spawned entities in the world with a tag that includes the provided substring.
|
1470
|
+
*/
|
1471
|
+
getEntitiesByTagSubstring(tagSubstring: string): Entity[];
|
1409
1472
|
|
1410
1473
|
|
1411
1474
|
}
|
1412
1475
|
|
1413
1476
|
/** Options for creating an Entity instance. @public */
|
1414
1477
|
export declare interface EntityOptions {
|
1478
|
+
/** The half extents of the visual size of the block entity when blockTextureUri is set. If no rigidBodyOptions.colliders are provided, a block collider with the size of the half extents will be created. */
|
1479
|
+
blockHalfExtents?: Vector3;
|
1480
|
+
/** The texture uri of a entity if the entity is a block entity, if set rigidBodyOptions collider shape [0] must be a block */
|
1481
|
+
blockTextureUri?: string;
|
1415
1482
|
/**
|
1416
1483
|
* A function that creates a custom character controller for the entity when it spawns.
|
1417
1484
|
* @param entity - The Entity instance.
|
@@ -1428,6 +1495,10 @@ export declare interface EntityOptions {
|
|
1428
1495
|
name?: string;
|
1429
1496
|
/** The rigid body options for the entity. */
|
1430
1497
|
rigidBodyOptions?: RigidBodyOptions;
|
1498
|
+
/** An arbitrary identifier tag of the entity. Useful for your own logic. */
|
1499
|
+
tag?: string;
|
1500
|
+
/** The tint color of the entity as a hex code. */
|
1501
|
+
tintColor?: RgbColor;
|
1431
1502
|
}
|
1432
1503
|
|
1433
1504
|
/** An EventRouter event. @public */
|
@@ -1614,6 +1685,7 @@ declare namespace HYTOPIA {
|
|
1614
1685
|
DefaultCharacterControllerOptions,
|
1615
1686
|
Entity,
|
1616
1687
|
EntityEventType,
|
1688
|
+
DEFAULT_BLOCK_ENTITY_RIGID_BODY_OPTIONS,
|
1617
1689
|
DEFAULT_ENTITY_RIGID_BODY_OPTIONS,
|
1618
1690
|
EntityOptions,
|
1619
1691
|
EntityEventPayload,
|
@@ -1624,6 +1696,7 @@ declare namespace HYTOPIA {
|
|
1624
1696
|
GameServerEventType,
|
1625
1697
|
startServer,
|
1626
1698
|
GameServerEventPayload,
|
1699
|
+
RgbColor,
|
1627
1700
|
Rotation,
|
1628
1701
|
SpdMatrix3,
|
1629
1702
|
Vector3,
|
@@ -1653,7 +1726,6 @@ declare namespace HYTOPIA {
|
|
1653
1726
|
MoveCompleteCallback,
|
1654
1727
|
MoveOptions,
|
1655
1728
|
Simulation,
|
1656
|
-
WebServer,
|
1657
1729
|
PORT,
|
1658
1730
|
World,
|
1659
1731
|
WorldMap,
|
@@ -2118,6 +2190,13 @@ declare type RayCastOptions = {
|
|
2118
2190
|
filterPredicate?: (collider: RAPIER.Collider) => boolean;
|
2119
2191
|
};
|
2120
2192
|
|
2193
|
+
/** A RGB color. @public */
|
2194
|
+
export declare interface RgbColor {
|
2195
|
+
r: number;
|
2196
|
+
g: number;
|
2197
|
+
b: number;
|
2198
|
+
}
|
2199
|
+
|
2121
2200
|
/**
|
2122
2201
|
* Represents a rigid body in a world's physics simulation.
|
2123
2202
|
*
|
@@ -2138,7 +2217,6 @@ export declare class RigidBody {
|
|
2138
2217
|
|
2139
2218
|
|
2140
2219
|
|
2141
|
-
|
2142
2220
|
/**
|
2143
2221
|
* @param options - The options for the rigid body instance.
|
2144
2222
|
*/
|
@@ -2171,8 +2249,6 @@ export declare class RigidBody {
|
|
2171
2249
|
get numColliders(): number;
|
2172
2250
|
/** The raw RAPIER rigid body instance. */
|
2173
2251
|
get rawRigidBody(): RAPIER.RigidBody | undefined;
|
2174
|
-
/** An arbitrary identifier tag of the rigid body. Useful for your own logic. */
|
2175
|
-
get tag(): string | undefined;
|
2176
2252
|
/**
|
2177
2253
|
* Gets the additional mass of the rigid body.
|
2178
2254
|
* @returns The additional mass of the rigid body.
|
@@ -2409,11 +2485,6 @@ export declare class RigidBody {
|
|
2409
2485
|
* @param collisionGroups - The collision groups for solid colliders of the rigid body.
|
2410
2486
|
*/
|
2411
2487
|
setCollisionGroupsForSolidColliders(collisionGroups: CollisionGroups): void;
|
2412
|
-
/**
|
2413
|
-
* Sets the tag of the rigid body.
|
2414
|
-
* @param tag - The tag of the rigid body.
|
2415
|
-
*/
|
2416
|
-
setTag(tag: string): void;
|
2417
2488
|
/**
|
2418
2489
|
* Sets the translation of the rigid body.
|
2419
2490
|
* @param translation - The translation of the rigid body.
|
@@ -2558,8 +2629,6 @@ export declare interface RigidBodyOptions {
|
|
2558
2629
|
sleeping?: boolean;
|
2559
2630
|
/** The soft continuous collision detection prediction of the rigid body. */
|
2560
2631
|
softCcdPrediction?: number;
|
2561
|
-
/** The tag of the rigid body. */
|
2562
|
-
tag?: string;
|
2563
2632
|
/** The translation of the rigid body. */
|
2564
2633
|
translation?: Vector3;
|
2565
2634
|
}
|
@@ -2700,6 +2769,11 @@ export declare class Simulation {
|
|
2700
2769
|
enableDebugRendering(enabled: boolean): void;
|
2701
2770
|
|
2702
2771
|
|
2772
|
+
/**
|
2773
|
+
* Sets the gravity vector for the simulation.
|
2774
|
+
* @param gravity - The gravity vector.
|
2775
|
+
*/
|
2776
|
+
setGravity(gravity: RAPIER.Vector3): void;
|
2703
2777
|
|
2704
2778
|
|
2705
2779
|
|
@@ -2740,33 +2814,6 @@ export declare interface Vector3Boolean {
|
|
2740
2814
|
x: boolean;
|
2741
2815
|
y: boolean;
|
2742
2816
|
z: boolean;
|
2743
|
-
}
|
2744
|
-
|
2745
|
-
/**
|
2746
|
-
* Manages the internal HTTP server for the game server.
|
2747
|
-
*
|
2748
|
-
* @remarks
|
2749
|
-
* This class is used as a singleton and should be
|
2750
|
-
* accessed via the GameServer.webServer property.
|
2751
|
-
*
|
2752
|
-
* @public
|
2753
|
-
*/
|
2754
|
-
export declare class WebServer implements Readyable {
|
2755
|
-
|
2756
|
-
|
2757
|
-
|
2758
|
-
|
2759
|
-
|
2760
|
-
|
2761
|
-
|
2762
|
-
|
2763
|
-
|
2764
|
-
|
2765
|
-
|
2766
|
-
|
2767
|
-
|
2768
|
-
|
2769
|
-
|
2770
2817
|
}
|
2771
2818
|
|
2772
2819
|
/**
|
@@ -2935,14 +2982,7 @@ export declare enum WorldLoopEventType {
|
|
2935
2982
|
/** A map representation for a world. @public */
|
2936
2983
|
export declare interface WorldMap {
|
2937
2984
|
/** The block types in the map. */
|
2938
|
-
blockTypes:
|
2939
|
-
/** The ID of the block type. */
|
2940
|
-
id: number;
|
2941
|
-
/** The name of the block type. */
|
2942
|
-
name: string;
|
2943
|
-
/** The URI of the texture for the block type. */
|
2944
|
-
textureUri: string;
|
2945
|
-
}[];
|
2985
|
+
blockTypes: BlockTypeOptions[];
|
2946
2986
|
/** The blocks in the map */
|
2947
2987
|
blocks: {
|
2948
2988
|
/** The global coordinate to block type id mapping. */
|