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
@@ -9,7 +9,7 @@ A callback function that is called when a collision occurs.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
export type CollisionCallback = (other: BlockType | Entity, started: boolean) => void;
|
12
|
+
export type CollisionCallback = ((other: BlockType | Entity, started: boolean) => void) | ((other: BlockType | Entity, started: boolean, colliderHandleA: number, colliderHandleB: number) => void);
|
13
13
|
```
|
14
14
|
**References:** [BlockType](./server.blocktype.md)<!-- -->, [Entity](./server.entity.md)
|
15
15
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [DefaultCharacterController](./server.hytopia.defaultcharactercontroller.md) > [createColliders](./server.hytopia.defaultcharactercontroller.createcolliders.md)
|
4
|
+
|
5
|
+
## HYTOPIA.DefaultCharacterController.createColliders() method
|
6
|
+
|
7
|
+
Creates the colliders for the character controller, overriding the default implementation.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
createColliders(): Collider[];
|
13
|
+
```
|
14
|
+
**Returns:**
|
15
|
+
|
16
|
+
[Collider](./server.collider.md)<!-- -->\[\]
|
17
|
+
|
18
|
+
An array of colliders.
|
19
|
+
|
@@ -290,7 +290,7 @@ Description
|
|
290
290
|
</th></tr></thead>
|
291
291
|
<tbody><tr><td>
|
292
292
|
|
293
|
-
[
|
293
|
+
[createColliders()](./server.hytopia.defaultcharactercontroller.createcolliders.md)
|
294
294
|
|
295
295
|
|
296
296
|
</td><td>
|
@@ -298,7 +298,7 @@ Description
|
|
298
298
|
|
299
299
|
</td><td>
|
300
300
|
|
301
|
-
Creates the
|
301
|
+
Creates the colliders for the character controller, overriding the default implementation.
|
302
302
|
|
303
303
|
|
304
304
|
</td></tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Entity](./server.hytopia.entity.md) > [isBlockEntity](./server.hytopia.entity.isblockentity.md)
|
4
|
+
|
5
|
+
## HYTOPIA.Entity.isBlockEntity property
|
6
|
+
|
7
|
+
Whether the entity is a block entity.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get isBlockEntity(): boolean;
|
13
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Entity](./server.hytopia.entity.md) > [isModelEntity](./server.hytopia.entity.ismodelentity.md)
|
4
|
+
|
5
|
+
## HYTOPIA.Entity.isModelEntity property
|
6
|
+
|
7
|
+
Whether the entity is a model entity.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get isModelEntity(): boolean;
|
13
|
+
```
|
@@ -204,6 +204,48 @@ number \| undefined
|
|
204
204
|
The unique identifier for the entity.
|
205
205
|
|
206
206
|
|
207
|
+
</td></tr>
|
208
|
+
<tr><td>
|
209
|
+
|
210
|
+
[isBlockEntity](./server.hytopia.entity.isblockentity.md)
|
211
|
+
|
212
|
+
|
213
|
+
</td><td>
|
214
|
+
|
215
|
+
`readonly`
|
216
|
+
|
217
|
+
|
218
|
+
</td><td>
|
219
|
+
|
220
|
+
boolean
|
221
|
+
|
222
|
+
|
223
|
+
</td><td>
|
224
|
+
|
225
|
+
Whether the entity is a block entity.
|
226
|
+
|
227
|
+
|
228
|
+
</td></tr>
|
229
|
+
<tr><td>
|
230
|
+
|
231
|
+
[isModelEntity](./server.hytopia.entity.ismodelentity.md)
|
232
|
+
|
233
|
+
|
234
|
+
</td><td>
|
235
|
+
|
236
|
+
`readonly`
|
237
|
+
|
238
|
+
|
239
|
+
</td><td>
|
240
|
+
|
241
|
+
boolean
|
242
|
+
|
243
|
+
|
244
|
+
</td><td>
|
245
|
+
|
246
|
+
Whether the entity is a model entity.
|
247
|
+
|
248
|
+
|
207
249
|
</td></tr>
|
208
250
|
<tr><td>
|
209
251
|
|
@@ -341,7 +383,7 @@ The name of the entity.
|
|
341
383
|
|
342
384
|
</td><td>
|
343
385
|
|
344
|
-
(entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, started: boolean) => void
|
386
|
+
((entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, started: boolean) => void) \| ((entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, started: boolean, colliderHandleA: number, colliderHandleB: number) => void)
|
345
387
|
|
346
388
|
|
347
389
|
</td><td>
|
@@ -398,7 +440,7 @@ _(Optional)_ A function that is called when the entity is despawned.
|
|
398
440
|
|
399
441
|
</td><td>
|
400
442
|
|
401
|
-
(entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, started: boolean) => void
|
443
|
+
((entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, started: boolean) => void) \| ((entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, started: boolean, colliderHandleA: number, colliderHandleB: number) => void)
|
402
444
|
|
403
445
|
|
404
446
|
</td><td>
|
@@ -9,5 +9,10 @@ A function that is called when the entity collides with a block.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onBlockCollision?: (entity: Entity, blockType: BlockType, started: boolean) => void;
|
12
|
+
onBlockCollision?: ((entity: Entity, blockType: BlockType, started: boolean) => void) | ((entity: Entity, blockType: BlockType, started: boolean, colliderHandleA: number, colliderHandleB: number) => void);
|
13
13
|
```
|
14
|
+
|
15
|
+
## Remarks
|
16
|
+
|
17
|
+
This must be set before the entity is spawned.
|
18
|
+
|
@@ -11,3 +11,8 @@ A function that is called when the entity collides with a block.
|
|
11
11
|
```typescript
|
12
12
|
onBlockContactForce?: (entity: Entity, blockType: BlockType, contactForceData: ContactForceData) => void;
|
13
13
|
```
|
14
|
+
|
15
|
+
## Remarks
|
16
|
+
|
17
|
+
This must be set before the entity is spawned.
|
18
|
+
|
@@ -9,5 +9,10 @@ A function that is called when the entity collides with another entity.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onEntityCollision?: (entity: Entity, otherEntity: Entity, started: boolean) => void;
|
12
|
+
onEntityCollision?: ((entity: Entity, otherEntity: Entity, started: boolean) => void) | ((entity: Entity, otherEntity: Entity, started: boolean, colliderHandleA: number, colliderHandleB: number) => void);
|
13
13
|
```
|
14
|
+
|
15
|
+
## Remarks
|
16
|
+
|
17
|
+
This must be set before the entity is spawned.
|
18
|
+
|
@@ -11,3 +11,8 @@ A function that is called when the entity contacts another entity.
|
|
11
11
|
```typescript
|
12
12
|
onEntityContactForce?: (entity: Entity, otherEntity: Entity, contactForceData: ContactForceData) => void;
|
13
13
|
```
|
14
|
+
|
15
|
+
## Remarks
|
16
|
+
|
17
|
+
This must be set before the entity is spawned.
|
18
|
+
|
package/docs/server.hytopia.md
CHANGED
@@ -387,6 +387,17 @@ Event types a ChatManager instance can emit.
|
|
387
387
|
Event types a Chunk instance can emit.
|
388
388
|
|
389
389
|
|
390
|
+
</td></tr>
|
391
|
+
<tr><td>
|
392
|
+
|
393
|
+
[CoefficientCombineRule](./server.hytopia.coefficientcombinerule.md)
|
394
|
+
|
395
|
+
|
396
|
+
</td><td>
|
397
|
+
|
398
|
+
The coefficient for friction or bounciness combine rule.
|
399
|
+
|
400
|
+
|
390
401
|
</td></tr>
|
391
402
|
<tr><td>
|
392
403
|
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Simulation](./server.hytopia.simulation.md) > [getContactManifolds](./server.hytopia.simulation.getcontactmanifolds.md)
|
4
|
+
|
5
|
+
## HYTOPIA.Simulation.getContactManifolds() method
|
6
|
+
|
7
|
+
Gets the contact manifolds for a pair of colliders.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
getContactManifolds(colliderHandleA: RAPIER.ColliderHandle, colliderHandleB: RAPIER.ColliderHandle): ContactManifold[];
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
colliderHandleA
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
RAPIER.ColliderHandle
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The handle of the first collider.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
colliderHandleB
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
RAPIER.ColliderHandle
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The handle of the second collider.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
</tbody></table>
|
66
|
+
**Returns:**
|
67
|
+
|
68
|
+
ContactManifold\[\]
|
69
|
+
|
70
|
+
The contact manifolds, or an empty array if no contact.
|
71
|
+
|
72
|
+
## Remarks
|
73
|
+
|
74
|
+
Contact manifolds will not be returned for contacts that involve sensors.
|
75
|
+
|
@@ -172,6 +172,20 @@ Casts a ray through the simulation.
|
|
172
172
|
Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.
|
173
173
|
|
174
174
|
|
175
|
+
</td></tr>
|
176
|
+
<tr><td>
|
177
|
+
|
178
|
+
[getContactManifolds(colliderHandleA, colliderHandleB)](./server.hytopia.simulation.getcontactmanifolds.md)
|
179
|
+
|
180
|
+
|
181
|
+
</td><td>
|
182
|
+
|
183
|
+
|
184
|
+
</td><td>
|
185
|
+
|
186
|
+
Gets the contact manifolds for a pair of colliders.
|
187
|
+
|
188
|
+
|
175
189
|
</td></tr>
|
176
190
|
<tr><td>
|
177
191
|
|
package/docs/server.md
CHANGED
@@ -387,6 +387,17 @@ Event types a ChatManager instance can emit.
|
|
387
387
|
Event types a Chunk instance can emit.
|
388
388
|
|
389
389
|
|
390
|
+
</td></tr>
|
391
|
+
<tr><td>
|
392
|
+
|
393
|
+
[CoefficientCombineRule](./server.coefficientcombinerule.md)
|
394
|
+
|
395
|
+
|
396
|
+
</td><td>
|
397
|
+
|
398
|
+
The coefficient for friction or bounciness combine rule.
|
399
|
+
|
400
|
+
|
390
401
|
</td></tr>
|
391
402
|
<tr><td>
|
392
403
|
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [Simulation](./server.simulation.md) > [getContactManifolds](./server.simulation.getcontactmanifolds.md)
|
4
|
+
|
5
|
+
## Simulation.getContactManifolds() method
|
6
|
+
|
7
|
+
Gets the contact manifolds for a pair of colliders.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
getContactManifolds(colliderHandleA: RAPIER.ColliderHandle, colliderHandleB: RAPIER.ColliderHandle): ContactManifold[];
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
colliderHandleA
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
RAPIER.ColliderHandle
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The handle of the first collider.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
colliderHandleB
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
RAPIER.ColliderHandle
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The handle of the second collider.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
</tbody></table>
|
66
|
+
**Returns:**
|
67
|
+
|
68
|
+
ContactManifold\[\]
|
69
|
+
|
70
|
+
The contact manifolds, or an empty array if no contact.
|
71
|
+
|
72
|
+
## Remarks
|
73
|
+
|
74
|
+
Contact manifolds will not be returned for contacts that involve sensors.
|
75
|
+
|
@@ -172,6 +172,20 @@ Casts a ray through the simulation.
|
|
172
172
|
Enables or disables debug rendering for the simulation. When enabled, all colliders, rigid body and raycast outlines will be rendered in the world. Do not enable this in production. In large worlds enabling this can cause noticable lag and RTT spikes.
|
173
173
|
|
174
174
|
|
175
|
+
</td></tr>
|
176
|
+
<tr><td>
|
177
|
+
|
178
|
+
[getContactManifolds(colliderHandleA, colliderHandleB)](./server.simulation.getcontactmanifolds.md)
|
179
|
+
|
180
|
+
|
181
|
+
</td><td>
|
182
|
+
|
183
|
+
|
184
|
+
</td><td>
|
185
|
+
|
186
|
+
Gets the contact manifolds for a pair of colliders.
|
187
|
+
|
188
|
+
|
175
189
|
</td></tr>
|
176
190
|
<tr><td>
|
177
191
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# big-world
|
2
|
+
|
3
|
+
To install dependencies:
|
4
|
+
|
5
|
+
```bash
|
6
|
+
bun install
|
7
|
+
```
|
8
|
+
|
9
|
+
To run:
|
10
|
+
|
11
|
+
```bash
|
12
|
+
bun run index.ts
|
13
|
+
```
|
14
|
+
|
15
|
+
This project was created using `bun init` in bun v1.1.26. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import {
|
2
|
+
startServer,
|
3
|
+
PlayerEntity,
|
4
|
+
} from 'hytopia';
|
5
|
+
|
6
|
+
import worldMap from './assets/map.json';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* This example loads and simulates extremely large map that is
|
10
|
+
* 750^2 blocks in area. Approximately 2,000,000+ blocks are loaded,
|
11
|
+
* resulting in thousands of chunks and a large amount of physics vertices.
|
12
|
+
*
|
13
|
+
* This example is meant to showcase the performance of the server.
|
14
|
+
* When dealing with large fully simulated worlds, as well as benchmark
|
15
|
+
* and test client performance.
|
16
|
+
*
|
17
|
+
* Client load times may take a few seconds because batch
|
18
|
+
* loading is not yet implemented.
|
19
|
+
*/
|
20
|
+
|
21
|
+
startServer(world => {
|
22
|
+
world.loadMap(worldMap);
|
23
|
+
|
24
|
+
// Spawn a player entity when a player joins the game.
|
25
|
+
world.onPlayerJoin = player => {
|
26
|
+
const playerEntity = new PlayerEntity({
|
27
|
+
player,
|
28
|
+
name: 'Player',
|
29
|
+
modelUri: 'models/player.gltf',
|
30
|
+
modelLoopedAnimations: [ 'idle' ],
|
31
|
+
modelScale: 0.5,
|
32
|
+
});
|
33
|
+
|
34
|
+
playerEntity.spawn(world, { x: 0, y: 10, z: 0 });
|
35
|
+
};
|
36
|
+
|
37
|
+
// Despawn all player entities when a player leaves the game.
|
38
|
+
world.onPlayerLeave = player => {
|
39
|
+
world.entityManager.getAllPlayerEntities(player).forEach(entity => entity.despawn());
|
40
|
+
};
|
41
|
+
});
|
@@ -12,7 +12,10 @@ import worldMap from './assets/map.json';
|
|
12
12
|
|
13
13
|
startServer(world => {
|
14
14
|
// Boilerplate
|
15
|
-
|
15
|
+
|
16
|
+
// Uncomment this to visualize physics vertices, will cause noticable lag.
|
17
|
+
// world.simulation.enableDebugRendering(true);
|
18
|
+
|
16
19
|
world.loadMap(worldMap);
|
17
20
|
world.onPlayerJoin = player => {
|
18
21
|
const playerEntity = new PlayerEntity({
|
@@ -5,6 +5,7 @@ import {
|
|
5
5
|
Collider,
|
6
6
|
Entity,
|
7
7
|
ColliderShape,
|
8
|
+
CoefficientCombineRule,
|
8
9
|
BlockType,
|
9
10
|
} from 'hytopia';
|
10
11
|
|
@@ -47,14 +48,14 @@ export default class MyCharacterController extends BaseCharacterController {
|
|
47
48
|
public get platform(): Entity | undefined { return this._platform; }
|
48
49
|
|
49
50
|
/**
|
50
|
-
* Create the
|
51
|
+
* Create the colliders for the character controller.
|
51
52
|
*/
|
52
|
-
public
|
53
|
+
public createColliders(): Collider[] {
|
53
54
|
if (!this.entity.isSpawned) {
|
54
55
|
throw new Error('CharacterController.createSensorColliders(): Entity is not spawned!');
|
55
56
|
}
|
56
57
|
|
57
|
-
const
|
58
|
+
const colliders: Collider[] = [];
|
58
59
|
|
59
60
|
/**
|
60
61
|
* Our ground sensor detects when we're on the ground.
|
@@ -63,7 +64,7 @@ export default class MyCharacterController extends BaseCharacterController {
|
|
63
64
|
* by the DEFAULT_ENTITY_RIGID_BODY_OPTIONS constant of
|
64
65
|
* the hytopia package.
|
65
66
|
*/
|
66
|
-
|
67
|
+
colliders.push(new Collider({
|
67
68
|
shape: ColliderShape.CYLINDER,
|
68
69
|
radius: 0.30,
|
69
70
|
halfHeight: 0.125,
|
@@ -95,7 +96,26 @@ export default class MyCharacterController extends BaseCharacterController {
|
|
95
96
|
},
|
96
97
|
}));
|
97
98
|
|
98
|
-
|
99
|
+
/**
|
100
|
+
* A wall collider slightly larger than our player hitbox with
|
101
|
+
* a collision group that only collides with blocks. This prevent
|
102
|
+
* sticking and friction to blocks as a player moves, creating
|
103
|
+
* a smooth slide effect on walls that we jump into, etc.
|
104
|
+
*/
|
105
|
+
colliders.push(new Collider({
|
106
|
+
shape: ColliderShape.CAPSULE,
|
107
|
+
halfHeight: 0.30,
|
108
|
+
radius: 0.37,
|
109
|
+
collisionGroups: {
|
110
|
+
belongsTo: [ CollisionGroup.ENTITY_SENSOR ],
|
111
|
+
collidesWith: [ CollisionGroup.BLOCK ],
|
112
|
+
},
|
113
|
+
friction: 0,
|
114
|
+
frictionCombineRule: CoefficientCombineRule.Min,
|
115
|
+
tag: 'wallCollider',
|
116
|
+
}));
|
117
|
+
|
118
|
+
return colliders;
|
99
119
|
}
|
100
120
|
|
101
121
|
/**
|
@@ -8,7 +8,9 @@ import MyCharacterController from './MyCharacterController';
|
|
8
8
|
import worldMap from './assets/map.json';
|
9
9
|
|
10
10
|
startServer(world => {
|
11
|
-
|
11
|
+
// Uncomment this to visualize physics vertices, will cause noticable lag.
|
12
|
+
// world.simulation.enableDebugRendering(true);
|
13
|
+
|
12
14
|
world.loadMap(worldMap);
|
13
15
|
|
14
16
|
world.onPlayerJoin = player => {
|
@@ -67,7 +67,9 @@ startServer(world => {
|
|
67
67
|
* Boilerplate setup for our example
|
68
68
|
*/
|
69
69
|
function setup(world: World) {
|
70
|
-
|
70
|
+
// Uncomment this to visualize physics vertices, will cause noticable lag.
|
71
|
+
// world.simulation.enableDebugRendering(true);
|
72
|
+
|
71
73
|
world.loadMap(worldMap);
|
72
74
|
|
73
75
|
// Spawn a player entity when a player joins the game.
|
@@ -90,8 +90,8 @@ let targetWaypointCoordinateIndex = 0; // Current waypoint coordinate index for
|
|
90
90
|
startServer(world => { // Perform our game setup logic in the startServer init callback here.
|
91
91
|
const chatManager = world.chatManager;
|
92
92
|
|
93
|
-
//
|
94
|
-
//
|
93
|
+
// Uncomment this to visualize physics vertices, will cause noticable lag.
|
94
|
+
// world.simulation.enableDebugRendering(true);
|
95
95
|
|
96
96
|
// Load Map
|
97
97
|
world.loadMap(map);
|