hytopia 0.1.38 → 0.1.40
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/bin/scripts.js +10 -1
- package/docs/server.basecharactercontroller.createcolliders.md +19 -0
- package/docs/server.basecharactercontroller.md +2 -2
- package/docs/server.blocktype.md +1 -1
- package/docs/server.blocktype.onentitycollision.md +6 -1
- package/docs/server.blocktype.onentitycontactforce.md +5 -0
- package/docs/server.coefficientcombinerule.md +89 -0
- package/docs/server.collider.getbouncinesscombinerule.md +19 -0
- package/docs/server.collider.getfrictioncombinerule.md +19 -0
- package/docs/server.collider.md +56 -0
- package/docs/server.collider.setbouncinesscombinerule.md +53 -0
- package/docs/server.collider.setfrictioncombinerule.md +53 -0
- package/docs/server.collideroptions.bouncinesscombinerule.md +13 -0
- package/docs/server.collideroptions.frictioncombinerule.md +13 -0
- package/docs/server.collideroptions.indices.md +13 -0
- package/docs/server.collideroptions.md +76 -0
- package/docs/server.collideroptions.vertices.md +13 -0
- package/docs/server.collidershape.md +14 -0
- package/docs/server.collisioncallback.md +1 -1
- package/docs/{server.defaultcharactercontroller.createsensorcolliders.md → server.defaultcharactercontroller.createcolliders.md} +4 -4
- package/docs/server.defaultcharactercontroller.md +2 -2
- package/docs/server.entity.isblockentity.md +13 -0
- package/docs/server.entity.ismodelentity.md +13 -0
- package/docs/server.entity.md +44 -2
- package/docs/server.entity.onblockcollision.md +6 -1
- package/docs/server.entity.onblockcontactforce.md +5 -0
- package/docs/server.entity.onentitycollision.md +6 -1
- package/docs/server.entity.onentitycontactforce.md +5 -0
- package/docs/server.entity.startmodelloopedanimations.md +4 -0
- package/docs/server.entity.startmodeloneshotanimations.md +4 -0
- package/docs/server.entity.stopmodelanimations.md +4 -0
- package/docs/server.hytopia.basecharactercontroller.createcolliders.md +19 -0
- package/docs/server.hytopia.basecharactercontroller.md +2 -2
- package/docs/server.hytopia.blocktype.md +1 -1
- package/docs/server.hytopia.blocktype.onentitycollision.md +6 -1
- package/docs/server.hytopia.blocktype.onentitycontactforce.md +5 -0
- package/docs/server.hytopia.coefficientcombinerule.md +89 -0
- package/docs/server.hytopia.collider.getbouncinesscombinerule.md +19 -0
- package/docs/server.hytopia.collider.getfrictioncombinerule.md +19 -0
- package/docs/server.hytopia.collider.md +56 -0
- package/docs/server.hytopia.collider.setbouncinesscombinerule.md +53 -0
- package/docs/server.hytopia.collider.setfrictioncombinerule.md +53 -0
- package/docs/server.hytopia.collideroptions.bouncinesscombinerule.md +13 -0
- package/docs/server.hytopia.collideroptions.frictioncombinerule.md +13 -0
- package/docs/server.hytopia.collideroptions.indices.md +13 -0
- package/docs/server.hytopia.collideroptions.md +76 -0
- package/docs/server.hytopia.collideroptions.vertices.md +13 -0
- package/docs/server.hytopia.collidershape.md +14 -0
- package/docs/server.hytopia.collisioncallback.md +1 -1
- package/docs/server.hytopia.defaultcharactercontroller.createcolliders.md +19 -0
- package/docs/server.hytopia.defaultcharactercontroller.md +2 -2
- package/docs/server.hytopia.entity.isblockentity.md +13 -0
- package/docs/server.hytopia.entity.ismodelentity.md +13 -0
- package/docs/server.hytopia.entity.md +44 -2
- package/docs/server.hytopia.entity.onblockcollision.md +6 -1
- package/docs/server.hytopia.entity.onblockcontactforce.md +5 -0
- package/docs/server.hytopia.entity.onentitycollision.md +6 -1
- package/docs/server.hytopia.entity.onentitycontactforce.md +5 -0
- package/docs/server.hytopia.entity.startmodelloopedanimations.md +4 -0
- package/docs/server.hytopia.entity.startmodeloneshotanimations.md +4 -0
- package/docs/server.hytopia.entity.stopmodelanimations.md +4 -0
- package/docs/server.hytopia.md +11 -0
- package/docs/server.hytopia.simulation.getcontactmanifolds.md +75 -0
- package/docs/server.hytopia.simulation.md +14 -0
- package/docs/server.md +11 -0
- package/docs/server.simulation.getcontactmanifolds.md +75 -0
- package/docs/server.simulation.md +14 -0
- package/examples/big-world/README.md +15 -0
- package/examples/big-world/index.ts +41 -0
- package/examples/block-entity/index.ts +4 -1
- package/examples/character-controller/MyCharacterController.ts +25 -5
- package/examples/character-controller/index.ts +3 -1
- package/examples/entity-spawn/index.ts +3 -1
- package/examples/payload-game/index.ts +2 -2
- package/package.json +1 -1
- package/server.api.json +1256 -58
- package/server.d.ts +120 -14
- package/server.js +79 -79
- package/boilerplate/assets/audio/music/cave.mp3 +0 -0
- package/boilerplate/assets/audio/music/desert.mp3 +0 -0
- package/boilerplate/assets/audio/music/end.mp3 +0 -0
- package/boilerplate/assets/audio/music/jungle.mp3 +0 -0
- package/boilerplate/assets/audio/music/nether.mp3 +0 -0
- package/boilerplate/assets/audio/music/night.mp3 +0 -0
- package/boilerplate/assets/audio/music/night2.mp3 +0 -0
- package/boilerplate/assets/audio/music/overworld.mp3 +0 -0
- package/boilerplate/assets/audio/music/snow.mp3 +0 -0
- package/boilerplate/assets/audio/sfx/damage.wav +0 -0
- package/boilerplate/assets/audio/sfx/step.wav +0 -0
- package/boilerplate/assets/certs/README.md +0 -10
- package/boilerplate/assets/certs/localhost.crt +0 -20
- package/boilerplate/assets/certs/localhost.key +0 -27
- package/boilerplate/assets/cubemaps/skybox/+x.png +0 -0
- package/boilerplate/assets/cubemaps/skybox/+y.png +0 -0
- package/boilerplate/assets/cubemaps/skybox/+z.png +0 -0
- package/boilerplate/assets/cubemaps/skybox/-x.png +0 -0
- package/boilerplate/assets/cubemaps/skybox/-y.png +0 -0
- package/boilerplate/assets/cubemaps/skybox/-z.png +0 -0
- package/boilerplate/assets/map.json +0 -2623
- package/boilerplate/assets/models/bat.gltf +0 -1
- package/boilerplate/assets/models/chicken.gltf +0 -1
- package/boilerplate/assets/models/cow.gltf +0 -1
- package/boilerplate/assets/models/donkey.gltf +0 -1
- package/boilerplate/assets/models/horse.gltf +0 -1
- package/boilerplate/assets/models/mindflayer.gltf +0 -1
- package/boilerplate/assets/models/pig.gltf +0 -1
- package/boilerplate/assets/models/player.gltf +0 -1
- package/boilerplate/assets/models/rabbit.gltf +0 -1
- package/boilerplate/assets/models/sheep.gltf +0 -1
- package/boilerplate/assets/models/skeleton.gltf +0 -1
- package/boilerplate/assets/models/spider.gltf +0 -1
- package/boilerplate/assets/models/squid.gltf +0 -1
- package/boilerplate/assets/models/stalker.gltf +0 -1
- package/boilerplate/assets/models/zombie.gltf +0 -1
- package/boilerplate/assets/textures/bricks.png +0 -0
- package/boilerplate/assets/textures/clay.png +0 -0
- package/boilerplate/assets/textures/cobblestone.png +0 -0
- package/boilerplate/assets/textures/diamond_ore.png +0 -0
- package/boilerplate/assets/textures/dirt.png +0 -0
- package/boilerplate/assets/textures/dragons_stone.png +0 -0
- package/boilerplate/assets/textures/emerald_ore.png +0 -0
- package/boilerplate/assets/textures/glass.png +0 -0
- package/boilerplate/assets/textures/gold_ore.png +0 -0
- package/boilerplate/assets/textures/grass/+x.png +0 -0
- package/boilerplate/assets/textures/grass/+y.png +0 -0
- package/boilerplate/assets/textures/grass/+z.png +0 -0
- package/boilerplate/assets/textures/grass/-x.png +0 -0
- package/boilerplate/assets/textures/grass/-y.png +0 -0
- package/boilerplate/assets/textures/grass/-z.png +0 -0
- package/boilerplate/assets/textures/gravel.png +0 -0
- package/boilerplate/assets/textures/ice.png +0 -0
- package/boilerplate/assets/textures/infected_shadowrock.png +0 -0
- package/boilerplate/assets/textures/iron_ore.png +0 -0
- package/boilerplate/assets/textures/lava.png +0 -0
- package/boilerplate/assets/textures/log_side.png +0 -0
- package/boilerplate/assets/textures/log_top.png +0 -0
- package/boilerplate/assets/textures/mossy_coblestone.png +0 -0
- package/boilerplate/assets/textures/nuit.png +0 -0
- package/boilerplate/assets/textures/oak_leaves.png +0 -0
- package/boilerplate/assets/textures/oak_planks.png +0 -0
- package/boilerplate/assets/textures/sand.png +0 -0
- package/boilerplate/assets/textures/sandstone.png +0 -0
- package/boilerplate/assets/textures/shadowrock.png +0 -0
- package/boilerplate/assets/textures/snow.png +0 -0
- package/boilerplate/assets/textures/stone.png +0 -0
- package/boilerplate/assets/textures/stone_bricks.png +0 -0
- package/boilerplate/assets/textures/void_grass/+x.png +0 -0
- package/boilerplate/assets/textures/void_grass/+y.png +0 -0
- package/boilerplate/assets/textures/void_grass/+z.png +0 -0
- package/boilerplate/assets/textures/void_grass/-x.png +0 -0
- package/boilerplate/assets/textures/void_grass/-y.png +0 -0
- package/boilerplate/assets/textures/void_grass/-z.png +0 -0
- package/boilerplate/assets/textures/void_sand.png +0 -0
- package/boilerplate/assets/textures/water.png +0 -0
- package/docs/server.basecharactercontroller.createsensorcolliders.md +0 -19
- package/docs/server.hytopia.basecharactercontroller.createsensorcolliders.md +0 -19
- package/docs/server.hytopia.defaultcharactercontroller.createsensorcolliders.md +0 -19
- 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 +0 -10
- package/examples/block-entity/assets/certs/localhost.crt +0 -20
- package/examples/block-entity/assets/certs/localhost.key +0 -27
- 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 +0 -2623
- package/examples/block-entity/assets/models/bat.gltf +0 -1
- package/examples/block-entity/assets/models/chicken.gltf +0 -1
- package/examples/block-entity/assets/models/cow.gltf +0 -1
- package/examples/block-entity/assets/models/donkey.gltf +0 -1
- package/examples/block-entity/assets/models/horse.gltf +0 -1
- package/examples/block-entity/assets/models/mindflayer.gltf +0 -1
- package/examples/block-entity/assets/models/pig.gltf +0 -1
- package/examples/block-entity/assets/models/player.gltf +0 -1
- package/examples/block-entity/assets/models/rabbit.gltf +0 -1
- package/examples/block-entity/assets/models/sheep.gltf +0 -1
- package/examples/block-entity/assets/models/skeleton.gltf +0 -1
- package/examples/block-entity/assets/models/spider.gltf +0 -1
- package/examples/block-entity/assets/models/squid.gltf +0 -1
- package/examples/block-entity/assets/models/stalker.gltf +0 -1
- package/examples/block-entity/assets/models/zombie.gltf +0 -1
- 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/package.json +0 -14
- package/examples/character-controller/assets/audio/sfx/damage.wav +0 -0
- package/examples/character-controller/assets/audio/sfx/step.wav +0 -0
- package/examples/character-controller/assets/certs/README.md +0 -10
- package/examples/character-controller/assets/certs/localhost.crt +0 -20
- package/examples/character-controller/assets/certs/localhost.key +0 -27
- package/examples/character-controller/assets/cubemaps/skybox/+x.png +0 -0
- package/examples/character-controller/assets/cubemaps/skybox/+y.png +0 -0
- package/examples/character-controller/assets/cubemaps/skybox/+z.png +0 -0
- package/examples/character-controller/assets/cubemaps/skybox/-x.png +0 -0
- package/examples/character-controller/assets/cubemaps/skybox/-y.png +0 -0
- package/examples/character-controller/assets/cubemaps/skybox/-z.png +0 -0
- package/examples/character-controller/assets/map.json +0 -2623
- package/examples/character-controller/assets/models/player.gltf +0 -1
- package/examples/character-controller/assets/textures/bricks.png +0 -0
- package/examples/character-controller/assets/textures/clay.png +0 -0
- package/examples/character-controller/assets/textures/diamond_ore.png +0 -0
- package/examples/character-controller/assets/textures/dirt.png +0 -0
- package/examples/character-controller/assets/textures/dragons_stone.png +0 -0
- package/examples/character-controller/assets/textures/glass.png +0 -0
- package/examples/character-controller/assets/textures/grass/+x.png +0 -0
- package/examples/character-controller/assets/textures/grass/+y.png +0 -0
- package/examples/character-controller/assets/textures/grass/+z.png +0 -0
- package/examples/character-controller/assets/textures/grass/-x.png +0 -0
- package/examples/character-controller/assets/textures/grass/-y.png +0 -0
- package/examples/character-controller/assets/textures/grass/-z.png +0 -0
- package/examples/character-controller/assets/textures/grass.png +0 -0
- package/examples/character-controller/assets/textures/gravel.png +0 -0
- package/examples/character-controller/assets/textures/ice.png +0 -0
- package/examples/character-controller/assets/textures/infected_shadowrock.png +0 -0
- package/examples/character-controller/assets/textures/log_side.png +0 -0
- package/examples/character-controller/assets/textures/log_top.png +0 -0
- package/examples/character-controller/assets/textures/mossy_coblestone.png +0 -0
- package/examples/character-controller/assets/textures/nuit.png +0 -0
- package/examples/character-controller/assets/textures/oak_leaves.png +0 -0
- package/examples/character-controller/assets/textures/oak_planks.png +0 -0
- package/examples/character-controller/assets/textures/sand.png +0 -0
- package/examples/character-controller/assets/textures/shadowrock.png +0 -0
- package/examples/character-controller/assets/textures/stone.png +0 -0
- package/examples/character-controller/assets/textures/stone_bricks.png +0 -0
- package/examples/character-controller/assets/textures/void_sand.png +0 -0
- package/examples/character-controller/assets/textures/water_still.png +0 -0
- package/examples/entity-spawn/assets/certs/README.md +0 -10
- package/examples/entity-spawn/assets/certs/localhost.crt +0 -20
- package/examples/entity-spawn/assets/certs/localhost.key +0 -27
- package/examples/entity-spawn/assets/cubemaps/skybox/+x.png +0 -0
- package/examples/entity-spawn/assets/cubemaps/skybox/+y.png +0 -0
- package/examples/entity-spawn/assets/cubemaps/skybox/+z.png +0 -0
- package/examples/entity-spawn/assets/cubemaps/skybox/-x.png +0 -0
- package/examples/entity-spawn/assets/cubemaps/skybox/-y.png +0 -0
- package/examples/entity-spawn/assets/cubemaps/skybox/-z.png +0 -0
- package/examples/entity-spawn/assets/map.json +0 -2623
- package/examples/entity-spawn/assets/models/player.gltf +0 -1
- package/examples/entity-spawn/assets/models/spider.gltf +0 -1
- package/examples/entity-spawn/assets/textures/bricks.png +0 -0
- package/examples/entity-spawn/assets/textures/clay.png +0 -0
- package/examples/entity-spawn/assets/textures/diamond_ore.png +0 -0
- package/examples/entity-spawn/assets/textures/dirt.png +0 -0
- package/examples/entity-spawn/assets/textures/dragons_stone.png +0 -0
- package/examples/entity-spawn/assets/textures/glass.png +0 -0
- package/examples/entity-spawn/assets/textures/grass/+x.png +0 -0
- package/examples/entity-spawn/assets/textures/grass/+y.png +0 -0
- package/examples/entity-spawn/assets/textures/grass/+z.png +0 -0
- package/examples/entity-spawn/assets/textures/grass/-x.png +0 -0
- package/examples/entity-spawn/assets/textures/grass/-y.png +0 -0
- package/examples/entity-spawn/assets/textures/grass/-z.png +0 -0
- package/examples/entity-spawn/assets/textures/grass.png +0 -0
- package/examples/entity-spawn/assets/textures/gravel.png +0 -0
- package/examples/entity-spawn/assets/textures/ice.png +0 -0
- package/examples/entity-spawn/assets/textures/infected_shadowrock.png +0 -0
- package/examples/entity-spawn/assets/textures/log_side.png +0 -0
- package/examples/entity-spawn/assets/textures/log_top.png +0 -0
- package/examples/entity-spawn/assets/textures/mossy_coblestone.png +0 -0
- package/examples/entity-spawn/assets/textures/nuit.png +0 -0
- package/examples/entity-spawn/assets/textures/oak_leaves.png +0 -0
- package/examples/entity-spawn/assets/textures/oak_planks.png +0 -0
- package/examples/entity-spawn/assets/textures/sand.png +0 -0
- package/examples/entity-spawn/assets/textures/shadowrock.png +0 -0
- package/examples/entity-spawn/assets/textures/stone.png +0 -0
- package/examples/entity-spawn/assets/textures/stone_bricks.png +0 -0
- package/examples/entity-spawn/assets/textures/void_sand.png +0 -0
- package/examples/entity-spawn/assets/textures/water_still.png +0 -0
package/server.d.ts
CHANGED
@@ -308,11 +308,11 @@ export declare abstract class BaseCharacterController {
|
|
308
308
|
*/
|
309
309
|
constructor(entity: Entity, _options?: Record<string, unknown>);
|
310
310
|
/**
|
311
|
-
* Override this method to create
|
311
|
+
* Override this method to create controller specific colliders
|
312
312
|
* to be attached to the controlled entity when it spawns.
|
313
313
|
* @returns An array of colliders.
|
314
314
|
*/
|
315
|
-
|
315
|
+
createColliders(): Collider[];
|
316
316
|
/**
|
317
317
|
* Override this method to handle entity movements
|
318
318
|
* based on player input for your character controller.
|
@@ -377,13 +377,25 @@ export declare class Block {
|
|
377
377
|
export declare class BlockType implements protocol.Serializable {
|
378
378
|
/**
|
379
379
|
* A callback function that is invoked when an entity collides with blocks of this type.
|
380
|
+
*
|
381
|
+
* @remarks
|
382
|
+
* This must be set before a block of this type is created.
|
383
|
+
* If it is set after a block is created, only future created
|
384
|
+
* blocks of this type will have the callback set.
|
385
|
+
*
|
380
386
|
* @param blockType - The block type the collision is for.
|
381
387
|
* @param entity - The entity that collided with the block type.
|
382
388
|
* @param started - Whether the collision started.
|
383
389
|
*/
|
384
|
-
onEntityCollision?: (blockType: BlockType, entity: Entity, started: boolean) => void;
|
390
|
+
onEntityCollision?: ((blockType: BlockType, entity: Entity, started: boolean) => void) | ((blockType: BlockType, entity: Entity, started: boolean, colliderHandleA: number, colliderHandleB: number) => void);
|
385
391
|
/**
|
386
392
|
* A callback function that is invoked when an entity contacts a block of this type.
|
393
|
+
*
|
394
|
+
* @remarks
|
395
|
+
* This must be set before a block of this type is created.
|
396
|
+
* If it is set after a block is created, only future created
|
397
|
+
* blocks of this type will have the callback set.
|
398
|
+
*
|
387
399
|
* @param blockType - The block type the contact is for.
|
388
400
|
* @param entity - The entity that contacted the block type.
|
389
401
|
* @param contactForceData - The contact force data.
|
@@ -682,7 +694,7 @@ export declare class Chunk implements protocol.Serializable {
|
|
682
694
|
setBlock(localCoordinate: Vector3Like, blockTypeId: number): void;
|
683
695
|
|
684
696
|
|
685
|
-
|
697
|
+
private _meshColliders;
|
686
698
|
|
687
699
|
|
688
700
|
|
@@ -771,6 +783,14 @@ export declare class ChunkLattice {
|
|
771
783
|
|
772
784
|
}
|
773
785
|
|
786
|
+
/** The coefficient for friction or bounciness combine rule. @public */
|
787
|
+
export declare enum CoefficientCombineRule {
|
788
|
+
Average = 0,
|
789
|
+
Min = 1,
|
790
|
+
Multiply = 2,
|
791
|
+
Max = 3
|
792
|
+
}
|
793
|
+
|
774
794
|
/**
|
775
795
|
* Represents a collider in a world's physics simulation.
|
776
796
|
*
|
@@ -817,6 +837,11 @@ export declare class Collider {
|
|
817
837
|
* @returns The bounciness of the collider.
|
818
838
|
*/
|
819
839
|
getBounciness(): number;
|
840
|
+
/**
|
841
|
+
* Gets the bounciness combine rule of the collider.
|
842
|
+
* @returns The bounciness combine rule of the collider.
|
843
|
+
*/
|
844
|
+
getBouncinessCombineRule(): CoefficientCombineRule;
|
820
845
|
/**
|
821
846
|
* Gets the collision groups the collider belongs to.
|
822
847
|
* @returns The collision groups the collider belongs to.
|
@@ -827,6 +852,11 @@ export declare class Collider {
|
|
827
852
|
* @returns The friction of the collider.
|
828
853
|
*/
|
829
854
|
getFriction(): number;
|
855
|
+
/**
|
856
|
+
* Gets the friction combine rule of the collider.
|
857
|
+
* @returns The friction combine rule of the collider.
|
858
|
+
*/
|
859
|
+
getFrictionCombineRule(): CoefficientCombineRule;
|
830
860
|
/**
|
831
861
|
* Gets the relative rotation of the collider.
|
832
862
|
* @returns The relative rotation of the collider.
|
@@ -843,10 +873,10 @@ export declare class Collider {
|
|
843
873
|
*/
|
844
874
|
setBounciness(bounciness: number): void;
|
845
875
|
/**
|
846
|
-
* Sets the
|
847
|
-
* @param
|
876
|
+
* Sets the bounciness combine rule of the collider.
|
877
|
+
* @param bouncinessCombineRule - The bounciness combine rule of the collider.
|
848
878
|
*/
|
849
|
-
|
879
|
+
setBouncinessCombineRule(bouncinessCombineRule: CoefficientCombineRule): void;
|
850
880
|
/**
|
851
881
|
* Sets the collision groups of the collider.
|
852
882
|
* @param collisionGroups - The collision groups of the collider.
|
@@ -862,11 +892,21 @@ export declare class Collider {
|
|
862
892
|
* @param friction - The friction of the collider.
|
863
893
|
*/
|
864
894
|
setFriction(friction: number): void;
|
895
|
+
/**
|
896
|
+
* Sets the friction combine rule of the collider.
|
897
|
+
* @param frictionCombineRule - The friction combine rule of the collider.
|
898
|
+
*/
|
899
|
+
setFrictionCombineRule(frictionCombineRule: CoefficientCombineRule): void;
|
865
900
|
/**
|
866
901
|
* Sets the mass of the collider.
|
867
902
|
* @param mass - The mass of the collider.
|
868
903
|
*/
|
869
904
|
setMass(mass: number): void;
|
905
|
+
/**
|
906
|
+
* Sets the on collision callback for the collider.
|
907
|
+
* @param callback - The on collision callback for the collider.
|
908
|
+
*/
|
909
|
+
setOnCollision(callback: CollisionCallback | undefined): void;
|
870
910
|
/**
|
871
911
|
* Sets the relative rotation of the collider.
|
872
912
|
* @param rotation - The relative rotation of the collider.
|
@@ -924,16 +964,22 @@ export declare interface ColliderOptions {
|
|
924
964
|
borderRadius?: number;
|
925
965
|
/** The bounciness of the collider. */
|
926
966
|
bounciness?: number;
|
967
|
+
/** The bounciness combine rule of the collider. */
|
968
|
+
bouncinessCombineRule?: CoefficientCombineRule;
|
927
969
|
/** The collision groups the collider belongs to. */
|
928
970
|
collisionGroups?: CollisionGroups;
|
929
971
|
/** Whether the collider is enabled. */
|
930
972
|
enabled?: boolean;
|
931
973
|
/** The friction of the collider. */
|
932
974
|
friction?: number;
|
975
|
+
/** The friction combine rule of the collider. */
|
976
|
+
frictionCombineRule?: CoefficientCombineRule;
|
933
977
|
/** The half extents of the collider if the shape is a block. */
|
934
978
|
halfExtents?: Vector3Like;
|
935
979
|
/** The half height of the collider if the shape is a capsule, cone, cylinder, or round cylinder. */
|
936
980
|
halfHeight?: number;
|
981
|
+
/** The indices of the collider if the shape is a trimesh. */
|
982
|
+
indices?: Uint32Array;
|
937
983
|
/** Whether the collider is a sensor. */
|
938
984
|
isSensor?: boolean;
|
939
985
|
/** The mass of the collider. */
|
@@ -952,6 +998,8 @@ export declare interface ColliderOptions {
|
|
952
998
|
simulation?: Simulation;
|
953
999
|
/** An arbitrary identifier tag of the collider. Useful for your own logic. */
|
954
1000
|
tag?: string;
|
1001
|
+
/** The vertices of the collider if the shape is a trimesh. */
|
1002
|
+
vertices?: Float32Array;
|
955
1003
|
}
|
956
1004
|
|
957
1005
|
/** The shapes a collider can be. @public */
|
@@ -961,7 +1009,8 @@ export declare enum ColliderShape {
|
|
961
1009
|
CAPSULE = "capsule",
|
962
1010
|
CONE = "cone",
|
963
1011
|
CYLINDER = "cylinder",
|
964
|
-
ROUND_CYLINDER = "round-cylinder"
|
1012
|
+
ROUND_CYLINDER = "round-cylinder",
|
1013
|
+
TRIMESH = "trimesh"
|
965
1014
|
}
|
966
1015
|
|
967
1016
|
/**
|
@@ -970,7 +1019,7 @@ export declare enum ColliderShape {
|
|
970
1019
|
* @param started - Whether the collision has started or ended.
|
971
1020
|
* @public
|
972
1021
|
*/
|
973
|
-
export declare type CollisionCallback = (other: BlockType | Entity, started: boolean) => void;
|
1022
|
+
export declare type CollisionCallback = ((other: BlockType | Entity, started: boolean) => void) | ((other: BlockType | Entity, started: boolean, colliderHandleA: number, colliderHandleB: number) => void);
|
974
1023
|
|
975
1024
|
/**
|
976
1025
|
* The default collision groups.
|
@@ -1081,6 +1130,16 @@ declare type ContactForceData = {
|
|
1081
1130
|
maxForceMagnitude: number;
|
1082
1131
|
};
|
1083
1132
|
|
1133
|
+
/** A contact manifold. @public */
|
1134
|
+
declare type ContactManifold = {
|
1135
|
+
/** The local normal vector of the first collider. */
|
1136
|
+
localNormalA: Vector3Like;
|
1137
|
+
/** The local normal vector of the second collider. */
|
1138
|
+
localNormalB: Vector3Like;
|
1139
|
+
/** The normal vector of the contact. */
|
1140
|
+
normal: Vector3Like;
|
1141
|
+
};
|
1142
|
+
|
1084
1143
|
/** A decoded set of collision groups represented as their string equivalents. @public */
|
1085
1144
|
export declare type DecodedCollisionGroups = {
|
1086
1145
|
belongsTo: string[];
|
@@ -1161,11 +1220,11 @@ export declare class DefaultCharacterController extends BaseCharacterController
|
|
1161
1220
|
/** The platform the entity is on, if any. */
|
1162
1221
|
get platform(): Entity | undefined;
|
1163
1222
|
/**
|
1164
|
-
* Creates the
|
1223
|
+
* Creates the colliders for the character controller,
|
1165
1224
|
* overriding the default implementation.
|
1166
1225
|
* @returns An array of colliders.
|
1167
1226
|
*/
|
1168
|
-
|
1227
|
+
createColliders(): Collider[];
|
1169
1228
|
/**
|
1170
1229
|
* Ticks the player movement for the character controller,
|
1171
1230
|
* overriding the default implementation.
|
@@ -1236,13 +1295,21 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1236
1295
|
createCustomCharacterController?: (entity: Entity) => BaseCharacterController;
|
1237
1296
|
/**
|
1238
1297
|
* A function that is called when the entity collides with a block.
|
1298
|
+
*
|
1299
|
+
* @remarks
|
1300
|
+
* This must be set before the entity is spawned.
|
1301
|
+
*
|
1239
1302
|
* @param entity - The Entity instance the collision is for.
|
1240
1303
|
* @param blockType - The block type that the entity collided with.
|
1241
1304
|
* @param started - Whether the collision started or ended.
|
1242
1305
|
*/
|
1243
|
-
onBlockCollision?: (entity: Entity, blockType: BlockType, started: boolean) => void;
|
1306
|
+
onBlockCollision?: ((entity: Entity, blockType: BlockType, started: boolean) => void) | ((entity: Entity, blockType: BlockType, started: boolean, colliderHandleA: number, colliderHandleB: number) => void);
|
1244
1307
|
/**
|
1245
1308
|
* A function that is called when the entity collides with a block.
|
1309
|
+
*
|
1310
|
+
* @remarks
|
1311
|
+
* This must be set before the entity is spawned.
|
1312
|
+
*
|
1246
1313
|
* @param entity - The Entity instance the collision is for.
|
1247
1314
|
* @param blockType - The block type that the entity collided with.
|
1248
1315
|
* @param contactForceData - The contact force data.
|
@@ -1250,13 +1317,21 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1250
1317
|
onBlockContactForce?: (entity: Entity, blockType: BlockType, contactForceData: ContactForceData) => void;
|
1251
1318
|
/**
|
1252
1319
|
* A function that is called when the entity collides with another entity.
|
1320
|
+
*
|
1321
|
+
* @remarks
|
1322
|
+
* This must be set before the entity is spawned.
|
1323
|
+
*
|
1253
1324
|
* @param entity - The Entity instance the collision is for.
|
1254
1325
|
* @param otherEntity - The other entity that the entity collided with.
|
1255
1326
|
* @param started - Whether the collision started or ended.
|
1256
1327
|
*/
|
1257
|
-
onEntityCollision?: (entity: Entity, otherEntity: Entity, started: boolean) => void;
|
1328
|
+
onEntityCollision?: ((entity: Entity, otherEntity: Entity, started: boolean) => void) | ((entity: Entity, otherEntity: Entity, started: boolean, colliderHandleA: number, colliderHandleB: number) => void);
|
1258
1329
|
/**
|
1259
1330
|
* A function that is called when the entity contacts another entity.
|
1331
|
+
*
|
1332
|
+
* @remarks
|
1333
|
+
* This must be set before the entity is spawned.
|
1334
|
+
*
|
1260
1335
|
* @param entity - The Entity instance the collision is for.
|
1261
1336
|
* @param otherEntity - The other entity that the entity collided with.
|
1262
1337
|
* @param contactForceData - The contact force data.
|
@@ -1319,6 +1394,10 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1319
1394
|
get tag(): string | undefined;
|
1320
1395
|
/** The tint color of the entity. */
|
1321
1396
|
get tintColor(): RgbColor | undefined;
|
1397
|
+
/** Whether the entity is a block entity. */
|
1398
|
+
get isBlockEntity(): boolean;
|
1399
|
+
/** Whether the entity is a model entity. */
|
1400
|
+
get isModelEntity(): boolean;
|
1322
1401
|
/** Whether the entity is spawned. */
|
1323
1402
|
get isSpawned(): boolean;
|
1324
1403
|
/** The world the entity is in. */
|
@@ -1353,17 +1432,32 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1353
1432
|
/**
|
1354
1433
|
* Starts looped animations for the entity, blending with
|
1355
1434
|
* other animations currently playing.
|
1435
|
+
*
|
1436
|
+
* @remarks
|
1437
|
+
* This method will be ignored and do nothing if the entity
|
1438
|
+
* is a block entity.
|
1439
|
+
*
|
1356
1440
|
* @param animations - The animations to start.
|
1357
1441
|
*/
|
1358
1442
|
startModelLoopedAnimations(animations: string[]): void;
|
1359
1443
|
/**
|
1360
1444
|
* Starts a oneshot animation for the entity, blending with
|
1361
1445
|
* other animations currently playing.
|
1446
|
+
*
|
1447
|
+
* @remarks
|
1448
|
+
* This method will be ignored and do nothing if the entity
|
1449
|
+
* is a block entity.
|
1450
|
+
*
|
1362
1451
|
* @param animations - The animations to start.
|
1363
1452
|
*/
|
1364
1453
|
startModelOneshotAnimations(animations: string[]): void;
|
1365
1454
|
/**
|
1366
1455
|
* Stops the provided model animations for the entity.
|
1456
|
+
*
|
1457
|
+
* @remarks
|
1458
|
+
* This method will be ignored and do nothing if the entity
|
1459
|
+
* is a block entity.
|
1460
|
+
*
|
1367
1461
|
* @param animations - The animations to stop.
|
1368
1462
|
*/
|
1369
1463
|
stopModelAnimations(animations: string[]): void;
|
@@ -1373,7 +1467,6 @@ export declare class Entity extends RigidBody implements protocol.Serializable {
|
|
1373
1467
|
|
1374
1468
|
|
1375
1469
|
|
1376
|
-
|
1377
1470
|
}
|
1378
1471
|
|
1379
1472
|
/** Payloads for events an Entity instance can emit. @public */
|
@@ -1689,6 +1782,7 @@ declare namespace HYTOPIA {
|
|
1689
1782
|
ChunkEventPayload,
|
1690
1783
|
ChunkLattice,
|
1691
1784
|
Collider,
|
1785
|
+
CoefficientCombineRule,
|
1692
1786
|
ColliderShape,
|
1693
1787
|
ColliderOptions,
|
1694
1788
|
CollisionCallback,
|
@@ -2952,6 +3046,18 @@ export declare class Simulation {
|
|
2952
3046
|
* @param enabled - Whether to enable debug rendering.
|
2953
3047
|
*/
|
2954
3048
|
enableDebugRendering(enabled: boolean): void;
|
3049
|
+
/**
|
3050
|
+
* Gets the contact manifolds for a pair of colliders.
|
3051
|
+
*
|
3052
|
+
* @remarks
|
3053
|
+
* Contact manifolds will not be returned for contacts that
|
3054
|
+
* involve sensors.
|
3055
|
+
*
|
3056
|
+
* @param colliderHandleA - The handle of the first collider.
|
3057
|
+
* @param colliderHandleB - The handle of the second collider.
|
3058
|
+
* @returns The contact manifolds, or an empty array if no contact.
|
3059
|
+
*/
|
3060
|
+
getContactManifolds(colliderHandleA: RAPIER.ColliderHandle, colliderHandleB: RAPIER.ColliderHandle): ContactManifold[];
|
2955
3061
|
|
2956
3062
|
|
2957
3063
|
/**
|