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
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 sensor colliders
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
- createSensorColliders(): Collider[];
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 on collision callback for the collider.
847
- * @param callback - The on collision callback for the collider.
876
+ * Sets the bounciness combine rule of the collider.
877
+ * @param bouncinessCombineRule - The bounciness combine rule of the collider.
848
878
  */
849
- setOnCollision(callback: CollisionCallback | undefined): void;
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 sensor colliders for the character controller,
1223
+ * Creates the colliders for the character controller,
1165
1224
  * overriding the default implementation.
1166
1225
  * @returns An array of colliders.
1167
1226
  */
1168
- createSensorColliders(): Collider[];
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
  /**