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.
Files changed (315) hide show
  1. package/bin/scripts.js +10 -1
  2. package/docs/server.basecharactercontroller.createcolliders.md +19 -0
  3. package/docs/server.basecharactercontroller.md +2 -2
  4. package/docs/server.blocktype.md +1 -1
  5. package/docs/server.blocktype.onentitycollision.md +6 -1
  6. package/docs/server.blocktype.onentitycontactforce.md +5 -0
  7. package/docs/server.coefficientcombinerule.md +89 -0
  8. package/docs/server.collider.getbouncinesscombinerule.md +19 -0
  9. package/docs/server.collider.getfrictioncombinerule.md +19 -0
  10. package/docs/server.collider.md +56 -0
  11. package/docs/server.collider.setbouncinesscombinerule.md +53 -0
  12. package/docs/server.collider.setfrictioncombinerule.md +53 -0
  13. package/docs/server.collideroptions.bouncinesscombinerule.md +13 -0
  14. package/docs/server.collideroptions.frictioncombinerule.md +13 -0
  15. package/docs/server.collideroptions.indices.md +13 -0
  16. package/docs/server.collideroptions.md +76 -0
  17. package/docs/server.collideroptions.vertices.md +13 -0
  18. package/docs/server.collidershape.md +14 -0
  19. package/docs/server.collisioncallback.md +1 -1
  20. package/docs/{server.defaultcharactercontroller.createsensorcolliders.md → server.defaultcharactercontroller.createcolliders.md} +4 -4
  21. package/docs/server.defaultcharactercontroller.md +2 -2
  22. package/docs/server.entity.isblockentity.md +13 -0
  23. package/docs/server.entity.ismodelentity.md +13 -0
  24. package/docs/server.entity.md +44 -2
  25. package/docs/server.entity.onblockcollision.md +6 -1
  26. package/docs/server.entity.onblockcontactforce.md +5 -0
  27. package/docs/server.entity.onentitycollision.md +6 -1
  28. package/docs/server.entity.onentitycontactforce.md +5 -0
  29. package/docs/server.entity.startmodelloopedanimations.md +4 -0
  30. package/docs/server.entity.startmodeloneshotanimations.md +4 -0
  31. package/docs/server.entity.stopmodelanimations.md +4 -0
  32. package/docs/server.hytopia.basecharactercontroller.createcolliders.md +19 -0
  33. package/docs/server.hytopia.basecharactercontroller.md +2 -2
  34. package/docs/server.hytopia.blocktype.md +1 -1
  35. package/docs/server.hytopia.blocktype.onentitycollision.md +6 -1
  36. package/docs/server.hytopia.blocktype.onentitycontactforce.md +5 -0
  37. package/docs/server.hytopia.coefficientcombinerule.md +89 -0
  38. package/docs/server.hytopia.collider.getbouncinesscombinerule.md +19 -0
  39. package/docs/server.hytopia.collider.getfrictioncombinerule.md +19 -0
  40. package/docs/server.hytopia.collider.md +56 -0
  41. package/docs/server.hytopia.collider.setbouncinesscombinerule.md +53 -0
  42. package/docs/server.hytopia.collider.setfrictioncombinerule.md +53 -0
  43. package/docs/server.hytopia.collideroptions.bouncinesscombinerule.md +13 -0
  44. package/docs/server.hytopia.collideroptions.frictioncombinerule.md +13 -0
  45. package/docs/server.hytopia.collideroptions.indices.md +13 -0
  46. package/docs/server.hytopia.collideroptions.md +76 -0
  47. package/docs/server.hytopia.collideroptions.vertices.md +13 -0
  48. package/docs/server.hytopia.collidershape.md +14 -0
  49. package/docs/server.hytopia.collisioncallback.md +1 -1
  50. package/docs/server.hytopia.defaultcharactercontroller.createcolliders.md +19 -0
  51. package/docs/server.hytopia.defaultcharactercontroller.md +2 -2
  52. package/docs/server.hytopia.entity.isblockentity.md +13 -0
  53. package/docs/server.hytopia.entity.ismodelentity.md +13 -0
  54. package/docs/server.hytopia.entity.md +44 -2
  55. package/docs/server.hytopia.entity.onblockcollision.md +6 -1
  56. package/docs/server.hytopia.entity.onblockcontactforce.md +5 -0
  57. package/docs/server.hytopia.entity.onentitycollision.md +6 -1
  58. package/docs/server.hytopia.entity.onentitycontactforce.md +5 -0
  59. package/docs/server.hytopia.entity.startmodelloopedanimations.md +4 -0
  60. package/docs/server.hytopia.entity.startmodeloneshotanimations.md +4 -0
  61. package/docs/server.hytopia.entity.stopmodelanimations.md +4 -0
  62. package/docs/server.hytopia.md +11 -0
  63. package/docs/server.hytopia.simulation.getcontactmanifolds.md +75 -0
  64. package/docs/server.hytopia.simulation.md +14 -0
  65. package/docs/server.md +11 -0
  66. package/docs/server.simulation.getcontactmanifolds.md +75 -0
  67. package/docs/server.simulation.md +14 -0
  68. package/examples/big-world/README.md +15 -0
  69. package/examples/big-world/index.ts +41 -0
  70. package/examples/block-entity/index.ts +4 -1
  71. package/examples/character-controller/MyCharacterController.ts +25 -5
  72. package/examples/character-controller/index.ts +3 -1
  73. package/examples/entity-spawn/index.ts +3 -1
  74. package/examples/payload-game/index.ts +2 -2
  75. package/package.json +1 -1
  76. package/server.api.json +1256 -58
  77. package/server.d.ts +120 -14
  78. package/server.js +79 -79
  79. package/boilerplate/assets/audio/music/cave.mp3 +0 -0
  80. package/boilerplate/assets/audio/music/desert.mp3 +0 -0
  81. package/boilerplate/assets/audio/music/end.mp3 +0 -0
  82. package/boilerplate/assets/audio/music/jungle.mp3 +0 -0
  83. package/boilerplate/assets/audio/music/nether.mp3 +0 -0
  84. package/boilerplate/assets/audio/music/night.mp3 +0 -0
  85. package/boilerplate/assets/audio/music/night2.mp3 +0 -0
  86. package/boilerplate/assets/audio/music/overworld.mp3 +0 -0
  87. package/boilerplate/assets/audio/music/snow.mp3 +0 -0
  88. package/boilerplate/assets/audio/sfx/damage.wav +0 -0
  89. package/boilerplate/assets/audio/sfx/step.wav +0 -0
  90. package/boilerplate/assets/certs/README.md +0 -10
  91. package/boilerplate/assets/certs/localhost.crt +0 -20
  92. package/boilerplate/assets/certs/localhost.key +0 -27
  93. package/boilerplate/assets/cubemaps/skybox/+x.png +0 -0
  94. package/boilerplate/assets/cubemaps/skybox/+y.png +0 -0
  95. package/boilerplate/assets/cubemaps/skybox/+z.png +0 -0
  96. package/boilerplate/assets/cubemaps/skybox/-x.png +0 -0
  97. package/boilerplate/assets/cubemaps/skybox/-y.png +0 -0
  98. package/boilerplate/assets/cubemaps/skybox/-z.png +0 -0
  99. package/boilerplate/assets/map.json +0 -2623
  100. package/boilerplate/assets/models/bat.gltf +0 -1
  101. package/boilerplate/assets/models/chicken.gltf +0 -1
  102. package/boilerplate/assets/models/cow.gltf +0 -1
  103. package/boilerplate/assets/models/donkey.gltf +0 -1
  104. package/boilerplate/assets/models/horse.gltf +0 -1
  105. package/boilerplate/assets/models/mindflayer.gltf +0 -1
  106. package/boilerplate/assets/models/pig.gltf +0 -1
  107. package/boilerplate/assets/models/player.gltf +0 -1
  108. package/boilerplate/assets/models/rabbit.gltf +0 -1
  109. package/boilerplate/assets/models/sheep.gltf +0 -1
  110. package/boilerplate/assets/models/skeleton.gltf +0 -1
  111. package/boilerplate/assets/models/spider.gltf +0 -1
  112. package/boilerplate/assets/models/squid.gltf +0 -1
  113. package/boilerplate/assets/models/stalker.gltf +0 -1
  114. package/boilerplate/assets/models/zombie.gltf +0 -1
  115. package/boilerplate/assets/textures/bricks.png +0 -0
  116. package/boilerplate/assets/textures/clay.png +0 -0
  117. package/boilerplate/assets/textures/cobblestone.png +0 -0
  118. package/boilerplate/assets/textures/diamond_ore.png +0 -0
  119. package/boilerplate/assets/textures/dirt.png +0 -0
  120. package/boilerplate/assets/textures/dragons_stone.png +0 -0
  121. package/boilerplate/assets/textures/emerald_ore.png +0 -0
  122. package/boilerplate/assets/textures/glass.png +0 -0
  123. package/boilerplate/assets/textures/gold_ore.png +0 -0
  124. package/boilerplate/assets/textures/grass/+x.png +0 -0
  125. package/boilerplate/assets/textures/grass/+y.png +0 -0
  126. package/boilerplate/assets/textures/grass/+z.png +0 -0
  127. package/boilerplate/assets/textures/grass/-x.png +0 -0
  128. package/boilerplate/assets/textures/grass/-y.png +0 -0
  129. package/boilerplate/assets/textures/grass/-z.png +0 -0
  130. package/boilerplate/assets/textures/gravel.png +0 -0
  131. package/boilerplate/assets/textures/ice.png +0 -0
  132. package/boilerplate/assets/textures/infected_shadowrock.png +0 -0
  133. package/boilerplate/assets/textures/iron_ore.png +0 -0
  134. package/boilerplate/assets/textures/lava.png +0 -0
  135. package/boilerplate/assets/textures/log_side.png +0 -0
  136. package/boilerplate/assets/textures/log_top.png +0 -0
  137. package/boilerplate/assets/textures/mossy_coblestone.png +0 -0
  138. package/boilerplate/assets/textures/nuit.png +0 -0
  139. package/boilerplate/assets/textures/oak_leaves.png +0 -0
  140. package/boilerplate/assets/textures/oak_planks.png +0 -0
  141. package/boilerplate/assets/textures/sand.png +0 -0
  142. package/boilerplate/assets/textures/sandstone.png +0 -0
  143. package/boilerplate/assets/textures/shadowrock.png +0 -0
  144. package/boilerplate/assets/textures/snow.png +0 -0
  145. package/boilerplate/assets/textures/stone.png +0 -0
  146. package/boilerplate/assets/textures/stone_bricks.png +0 -0
  147. package/boilerplate/assets/textures/void_grass/+x.png +0 -0
  148. package/boilerplate/assets/textures/void_grass/+y.png +0 -0
  149. package/boilerplate/assets/textures/void_grass/+z.png +0 -0
  150. package/boilerplate/assets/textures/void_grass/-x.png +0 -0
  151. package/boilerplate/assets/textures/void_grass/-y.png +0 -0
  152. package/boilerplate/assets/textures/void_grass/-z.png +0 -0
  153. package/boilerplate/assets/textures/void_sand.png +0 -0
  154. package/boilerplate/assets/textures/water.png +0 -0
  155. package/docs/server.basecharactercontroller.createsensorcolliders.md +0 -19
  156. package/docs/server.hytopia.basecharactercontroller.createsensorcolliders.md +0 -19
  157. package/docs/server.hytopia.defaultcharactercontroller.createsensorcolliders.md +0 -19
  158. package/examples/block-entity/assets/audio/music/cave.mp3 +0 -0
  159. package/examples/block-entity/assets/audio/music/desert.mp3 +0 -0
  160. package/examples/block-entity/assets/audio/music/end.mp3 +0 -0
  161. package/examples/block-entity/assets/audio/music/jungle.mp3 +0 -0
  162. package/examples/block-entity/assets/audio/music/nether.mp3 +0 -0
  163. package/examples/block-entity/assets/audio/music/night.mp3 +0 -0
  164. package/examples/block-entity/assets/audio/music/night2.mp3 +0 -0
  165. package/examples/block-entity/assets/audio/music/overworld.mp3 +0 -0
  166. package/examples/block-entity/assets/audio/music/snow.mp3 +0 -0
  167. package/examples/block-entity/assets/audio/sfx/damage.wav +0 -0
  168. package/examples/block-entity/assets/audio/sfx/step.wav +0 -0
  169. package/examples/block-entity/assets/certs/README.md +0 -10
  170. package/examples/block-entity/assets/certs/localhost.crt +0 -20
  171. package/examples/block-entity/assets/certs/localhost.key +0 -27
  172. package/examples/block-entity/assets/cubemaps/skybox/+x.png +0 -0
  173. package/examples/block-entity/assets/cubemaps/skybox/+y.png +0 -0
  174. package/examples/block-entity/assets/cubemaps/skybox/+z.png +0 -0
  175. package/examples/block-entity/assets/cubemaps/skybox/-x.png +0 -0
  176. package/examples/block-entity/assets/cubemaps/skybox/-y.png +0 -0
  177. package/examples/block-entity/assets/cubemaps/skybox/-z.png +0 -0
  178. package/examples/block-entity/assets/map.json +0 -2623
  179. package/examples/block-entity/assets/models/bat.gltf +0 -1
  180. package/examples/block-entity/assets/models/chicken.gltf +0 -1
  181. package/examples/block-entity/assets/models/cow.gltf +0 -1
  182. package/examples/block-entity/assets/models/donkey.gltf +0 -1
  183. package/examples/block-entity/assets/models/horse.gltf +0 -1
  184. package/examples/block-entity/assets/models/mindflayer.gltf +0 -1
  185. package/examples/block-entity/assets/models/pig.gltf +0 -1
  186. package/examples/block-entity/assets/models/player.gltf +0 -1
  187. package/examples/block-entity/assets/models/rabbit.gltf +0 -1
  188. package/examples/block-entity/assets/models/sheep.gltf +0 -1
  189. package/examples/block-entity/assets/models/skeleton.gltf +0 -1
  190. package/examples/block-entity/assets/models/spider.gltf +0 -1
  191. package/examples/block-entity/assets/models/squid.gltf +0 -1
  192. package/examples/block-entity/assets/models/stalker.gltf +0 -1
  193. package/examples/block-entity/assets/models/zombie.gltf +0 -1
  194. package/examples/block-entity/assets/textures/bricks.png +0 -0
  195. package/examples/block-entity/assets/textures/clay.png +0 -0
  196. package/examples/block-entity/assets/textures/cobblestone.png +0 -0
  197. package/examples/block-entity/assets/textures/diamond_ore.png +0 -0
  198. package/examples/block-entity/assets/textures/dirt.png +0 -0
  199. package/examples/block-entity/assets/textures/dragons_stone.png +0 -0
  200. package/examples/block-entity/assets/textures/emerald_ore.png +0 -0
  201. package/examples/block-entity/assets/textures/glass.png +0 -0
  202. package/examples/block-entity/assets/textures/gold_ore.png +0 -0
  203. package/examples/block-entity/assets/textures/grass/+x.png +0 -0
  204. package/examples/block-entity/assets/textures/grass/+y.png +0 -0
  205. package/examples/block-entity/assets/textures/grass/+z.png +0 -0
  206. package/examples/block-entity/assets/textures/grass/-x.png +0 -0
  207. package/examples/block-entity/assets/textures/grass/-y.png +0 -0
  208. package/examples/block-entity/assets/textures/grass/-z.png +0 -0
  209. package/examples/block-entity/assets/textures/gravel.png +0 -0
  210. package/examples/block-entity/assets/textures/ice.png +0 -0
  211. package/examples/block-entity/assets/textures/infected_shadowrock.png +0 -0
  212. package/examples/block-entity/assets/textures/iron_ore.png +0 -0
  213. package/examples/block-entity/assets/textures/lava.png +0 -0
  214. package/examples/block-entity/assets/textures/log_side.png +0 -0
  215. package/examples/block-entity/assets/textures/log_top.png +0 -0
  216. package/examples/block-entity/assets/textures/mossy_coblestone.png +0 -0
  217. package/examples/block-entity/assets/textures/nuit.png +0 -0
  218. package/examples/block-entity/assets/textures/oak_leaves.png +0 -0
  219. package/examples/block-entity/assets/textures/oak_planks.png +0 -0
  220. package/examples/block-entity/assets/textures/sand.png +0 -0
  221. package/examples/block-entity/assets/textures/sandstone.png +0 -0
  222. package/examples/block-entity/assets/textures/shadowrock.png +0 -0
  223. package/examples/block-entity/assets/textures/snow.png +0 -0
  224. package/examples/block-entity/assets/textures/stone.png +0 -0
  225. package/examples/block-entity/assets/textures/stone_bricks.png +0 -0
  226. package/examples/block-entity/assets/textures/void_grass/+x.png +0 -0
  227. package/examples/block-entity/assets/textures/void_grass/+y.png +0 -0
  228. package/examples/block-entity/assets/textures/void_grass/+z.png +0 -0
  229. package/examples/block-entity/assets/textures/void_grass/-x.png +0 -0
  230. package/examples/block-entity/assets/textures/void_grass/-y.png +0 -0
  231. package/examples/block-entity/assets/textures/void_grass/-z.png +0 -0
  232. package/examples/block-entity/assets/textures/void_sand.png +0 -0
  233. package/examples/block-entity/assets/textures/water.png +0 -0
  234. package/examples/block-entity/package.json +0 -14
  235. package/examples/character-controller/assets/audio/sfx/damage.wav +0 -0
  236. package/examples/character-controller/assets/audio/sfx/step.wav +0 -0
  237. package/examples/character-controller/assets/certs/README.md +0 -10
  238. package/examples/character-controller/assets/certs/localhost.crt +0 -20
  239. package/examples/character-controller/assets/certs/localhost.key +0 -27
  240. package/examples/character-controller/assets/cubemaps/skybox/+x.png +0 -0
  241. package/examples/character-controller/assets/cubemaps/skybox/+y.png +0 -0
  242. package/examples/character-controller/assets/cubemaps/skybox/+z.png +0 -0
  243. package/examples/character-controller/assets/cubemaps/skybox/-x.png +0 -0
  244. package/examples/character-controller/assets/cubemaps/skybox/-y.png +0 -0
  245. package/examples/character-controller/assets/cubemaps/skybox/-z.png +0 -0
  246. package/examples/character-controller/assets/map.json +0 -2623
  247. package/examples/character-controller/assets/models/player.gltf +0 -1
  248. package/examples/character-controller/assets/textures/bricks.png +0 -0
  249. package/examples/character-controller/assets/textures/clay.png +0 -0
  250. package/examples/character-controller/assets/textures/diamond_ore.png +0 -0
  251. package/examples/character-controller/assets/textures/dirt.png +0 -0
  252. package/examples/character-controller/assets/textures/dragons_stone.png +0 -0
  253. package/examples/character-controller/assets/textures/glass.png +0 -0
  254. package/examples/character-controller/assets/textures/grass/+x.png +0 -0
  255. package/examples/character-controller/assets/textures/grass/+y.png +0 -0
  256. package/examples/character-controller/assets/textures/grass/+z.png +0 -0
  257. package/examples/character-controller/assets/textures/grass/-x.png +0 -0
  258. package/examples/character-controller/assets/textures/grass/-y.png +0 -0
  259. package/examples/character-controller/assets/textures/grass/-z.png +0 -0
  260. package/examples/character-controller/assets/textures/grass.png +0 -0
  261. package/examples/character-controller/assets/textures/gravel.png +0 -0
  262. package/examples/character-controller/assets/textures/ice.png +0 -0
  263. package/examples/character-controller/assets/textures/infected_shadowrock.png +0 -0
  264. package/examples/character-controller/assets/textures/log_side.png +0 -0
  265. package/examples/character-controller/assets/textures/log_top.png +0 -0
  266. package/examples/character-controller/assets/textures/mossy_coblestone.png +0 -0
  267. package/examples/character-controller/assets/textures/nuit.png +0 -0
  268. package/examples/character-controller/assets/textures/oak_leaves.png +0 -0
  269. package/examples/character-controller/assets/textures/oak_planks.png +0 -0
  270. package/examples/character-controller/assets/textures/sand.png +0 -0
  271. package/examples/character-controller/assets/textures/shadowrock.png +0 -0
  272. package/examples/character-controller/assets/textures/stone.png +0 -0
  273. package/examples/character-controller/assets/textures/stone_bricks.png +0 -0
  274. package/examples/character-controller/assets/textures/void_sand.png +0 -0
  275. package/examples/character-controller/assets/textures/water_still.png +0 -0
  276. package/examples/entity-spawn/assets/certs/README.md +0 -10
  277. package/examples/entity-spawn/assets/certs/localhost.crt +0 -20
  278. package/examples/entity-spawn/assets/certs/localhost.key +0 -27
  279. package/examples/entity-spawn/assets/cubemaps/skybox/+x.png +0 -0
  280. package/examples/entity-spawn/assets/cubemaps/skybox/+y.png +0 -0
  281. package/examples/entity-spawn/assets/cubemaps/skybox/+z.png +0 -0
  282. package/examples/entity-spawn/assets/cubemaps/skybox/-x.png +0 -0
  283. package/examples/entity-spawn/assets/cubemaps/skybox/-y.png +0 -0
  284. package/examples/entity-spawn/assets/cubemaps/skybox/-z.png +0 -0
  285. package/examples/entity-spawn/assets/map.json +0 -2623
  286. package/examples/entity-spawn/assets/models/player.gltf +0 -1
  287. package/examples/entity-spawn/assets/models/spider.gltf +0 -1
  288. package/examples/entity-spawn/assets/textures/bricks.png +0 -0
  289. package/examples/entity-spawn/assets/textures/clay.png +0 -0
  290. package/examples/entity-spawn/assets/textures/diamond_ore.png +0 -0
  291. package/examples/entity-spawn/assets/textures/dirt.png +0 -0
  292. package/examples/entity-spawn/assets/textures/dragons_stone.png +0 -0
  293. package/examples/entity-spawn/assets/textures/glass.png +0 -0
  294. package/examples/entity-spawn/assets/textures/grass/+x.png +0 -0
  295. package/examples/entity-spawn/assets/textures/grass/+y.png +0 -0
  296. package/examples/entity-spawn/assets/textures/grass/+z.png +0 -0
  297. package/examples/entity-spawn/assets/textures/grass/-x.png +0 -0
  298. package/examples/entity-spawn/assets/textures/grass/-y.png +0 -0
  299. package/examples/entity-spawn/assets/textures/grass/-z.png +0 -0
  300. package/examples/entity-spawn/assets/textures/grass.png +0 -0
  301. package/examples/entity-spawn/assets/textures/gravel.png +0 -0
  302. package/examples/entity-spawn/assets/textures/ice.png +0 -0
  303. package/examples/entity-spawn/assets/textures/infected_shadowrock.png +0 -0
  304. package/examples/entity-spawn/assets/textures/log_side.png +0 -0
  305. package/examples/entity-spawn/assets/textures/log_top.png +0 -0
  306. package/examples/entity-spawn/assets/textures/mossy_coblestone.png +0 -0
  307. package/examples/entity-spawn/assets/textures/nuit.png +0 -0
  308. package/examples/entity-spawn/assets/textures/oak_leaves.png +0 -0
  309. package/examples/entity-spawn/assets/textures/oak_planks.png +0 -0
  310. package/examples/entity-spawn/assets/textures/sand.png +0 -0
  311. package/examples/entity-spawn/assets/textures/shadowrock.png +0 -0
  312. package/examples/entity-spawn/assets/textures/stone.png +0 -0
  313. package/examples/entity-spawn/assets/textures/stone_bricks.png +0 -0
  314. package/examples/entity-spawn/assets/textures/void_sand.png +0 -0
  315. package/examples/entity-spawn/assets/textures/water_still.png +0 -0
@@ -113,5 +113,19 @@ ROUND\_CYLINDER
113
113
  </td><td>
114
114
 
115
115
 
116
+ </td></tr>
117
+ <tr><td>
118
+
119
+ TRIMESH
120
+
121
+
122
+ </td><td>
123
+
124
+ `"trimesh"`
125
+
126
+
127
+ </td><td>
128
+
129
+
116
130
  </td></tr>
117
131
  </tbody></table>
@@ -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) &gt; [server](./server.md) &gt; [HYTOPIA](./server.hytopia.md) &gt; [DefaultCharacterController](./server.hytopia.defaultcharactercontroller.md) &gt; [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
- [createSensorColliders()](./server.hytopia.defaultcharactercontroller.createsensorcolliders.md)
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 sensor colliders for the character controller, overriding the default implementation.
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) &gt; [server](./server.md) &gt; [HYTOPIA](./server.hytopia.md) &gt; [Entity](./server.hytopia.entity.md) &gt; [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) &gt; [server](./server.md) &gt; [HYTOPIA](./server.hytopia.md) &gt; [Entity](./server.hytopia.entity.md) &gt; [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) =&gt; void
386
+ ((entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, started: boolean) =&gt; void) \| ((entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, started: boolean, colliderHandleA: number, colliderHandleB: number) =&gt; 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) =&gt; void
443
+ ((entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, started: boolean) =&gt; void) \| ((entity: [Entity](./server.entity.md)<!-- -->, otherEntity: [Entity](./server.entity.md)<!-- -->, started: boolean, colliderHandleA: number, colliderHandleB: number) =&gt; 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
+
@@ -51,3 +51,7 @@ The animations to start.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ This method will be ignored and do nothing if the entity is a block entity.
57
+
@@ -51,3 +51,7 @@ The animations to start.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ This method will be ignored and do nothing if the entity is a block entity.
57
+
@@ -51,3 +51,7 @@ The animations to stop.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ This method will be ignored and do nothing if the entity is a block entity.
57
+
@@ -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) &gt; [server](./server.md) &gt; [HYTOPIA](./server.hytopia.md) &gt; [Simulation](./server.hytopia.simulation.md) &gt; [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) &gt; [server](./server.md) &gt; [Simulation](./server.simulation.md) &gt; [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
- world.simulation.enableDebugRendering(true);
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 sensor colliders for the character controller.
51
+ * Create the colliders for the character controller.
51
52
  */
52
- public createSensorColliders(): Collider[] {
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 sensorColliders: Collider[] = [];
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
- sensorColliders.push(new Collider({
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
- return sensorColliders;
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
- world.simulation.enableDebugRendering(true);
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
- world.simulation.enableDebugRendering(true);
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
- // Enable debug rendering
94
- // world.simulation.enableDebugRendering(true);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hytopia",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.",
5
5
  "main": "server.js",
6
6
  "bin": {