melonjs 20.2.0 → 20.4.0

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 (515) hide show
  1. package/README.md +86 -8
  2. package/build/application/application.d.ts +0 -17
  3. package/build/application/application.d.ts.map +1 -1
  4. package/build/application/settings.d.ts +6 -2
  5. package/build/application/settings.d.ts.map +1 -1
  6. package/build/audio/audio.d.ts +2 -2
  7. package/build/audio/audio.d.ts.map +1 -1
  8. package/build/audio/backend/buffer.d.ts +26 -0
  9. package/build/audio/backend/buffer.d.ts.map +1 -0
  10. package/build/audio/backend/cache.d.ts +2 -0
  11. package/build/audio/backend/cache.d.ts.map +1 -0
  12. package/build/audio/backend/core.d.ts +24 -0
  13. package/build/audio/backend/core.d.ts.map +1 -0
  14. package/build/audio/backend/engine.d.ts +35 -0
  15. package/build/audio/backend/engine.d.ts.map +1 -0
  16. package/build/audio/backend/sound.d.ts +29 -0
  17. package/build/audio/backend/sound.d.ts.map +1 -0
  18. package/build/audio/backend/spatial.d.ts +191 -0
  19. package/build/audio/backend/spatial.d.ts.map +1 -0
  20. package/build/audio/backend/types.d.ts +107 -0
  21. package/build/audio/backend/types.d.ts.map +1 -0
  22. package/build/audio/backend/voice.d.ts +8 -0
  23. package/build/audio/backend/voice.d.ts.map +1 -0
  24. package/build/audio/playback.d.ts +49 -4
  25. package/build/audio/playback.d.ts.map +1 -1
  26. package/build/audio/procedural.d.ts.map +1 -1
  27. package/build/audio/state.d.ts +69 -0
  28. package/build/audio/state.d.ts.map +1 -0
  29. package/build/audio/types.d.ts +93 -1
  30. package/build/audio/types.d.ts.map +1 -1
  31. package/build/camera/camera2d.d.ts +0 -68
  32. package/build/camera/camera2d.d.ts.map +1 -1
  33. package/build/camera/camera3d.d.ts +91 -84
  34. package/build/camera/camera3d.d.ts.map +1 -1
  35. package/build/camera/effects/fade_effect.d.ts +0 -5
  36. package/build/camera/effects/fade_effect.d.ts.map +1 -1
  37. package/build/camera/effects/mask_effect.d.ts +0 -5
  38. package/build/camera/effects/mask_effect.d.ts.map +1 -1
  39. package/build/camera/fog.d.ts +118 -0
  40. package/build/camera/fog.d.ts.map +1 -0
  41. package/build/const.d.ts +2 -2
  42. package/build/geometries/box3d.d.ts +0 -28
  43. package/build/geometries/box3d.d.ts.map +1 -1
  44. package/build/geometries/ellipse.d.ts +0 -20
  45. package/build/geometries/ellipse.d.ts.map +1 -1
  46. package/build/geometries/observablePoint.d.ts +0 -3
  47. package/build/geometries/observablePoint.d.ts.map +1 -1
  48. package/build/geometries/path2d.d.ts +0 -19
  49. package/build/geometries/path2d.d.ts.map +1 -1
  50. package/build/geometries/polygon.d.ts +0 -12
  51. package/build/geometries/polygon.d.ts.map +1 -1
  52. package/build/geometries/roundrect.d.ts +0 -18
  53. package/build/geometries/roundrect.d.ts.map +1 -1
  54. package/build/geometries/sphere.d.ts +0 -9
  55. package/build/geometries/sphere.d.ts.map +1 -1
  56. package/build/geometries/toarccanvas.d.ts.map +1 -1
  57. package/build/index.d.ts +1 -0
  58. package/build/index.d.ts.map +1 -1
  59. package/build/index.js +12150 -11289
  60. package/build/index.js.map +4 -4
  61. package/build/input/gamepad.d.ts.map +1 -1
  62. package/build/input/input.d.ts +19 -0
  63. package/build/input/input.d.ts.map +1 -1
  64. package/build/input/pointer.d.ts +0 -4
  65. package/build/input/pointer.d.ts.map +1 -1
  66. package/build/input/pointerevent.d.ts +0 -6
  67. package/build/input/pointerevent.d.ts.map +1 -1
  68. package/build/lang/deprecated.d.ts +4 -2
  69. package/build/lang/deprecated.d.ts.map +1 -1
  70. package/build/level/gltf/GLTFModel.d.ts +0 -81
  71. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  72. package/build/level/gltf/GLTFScene.d.ts +13 -44
  73. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  74. package/build/level/gltf/gltf_sampler.d.ts +1 -48
  75. package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
  76. package/build/level/level.d.ts +195 -113
  77. package/build/level/level.d.ts.map +1 -1
  78. package/build/level/tiled/TMXGroup.d.ts +1 -65
  79. package/build/level/tiled/TMXGroup.d.ts.map +1 -1
  80. package/build/level/tiled/TMXLayer.d.ts +0 -44
  81. package/build/level/tiled/TMXLayer.d.ts.map +1 -1
  82. package/build/level/tiled/TMXObject.d.ts +1 -136
  83. package/build/level/tiled/TMXObject.d.ts.map +1 -1
  84. package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
  85. package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
  86. package/build/level/tiled/TMXTile.d.ts +1 -30
  87. package/build/level/tiled/TMXTile.d.ts.map +1 -1
  88. package/build/level/tiled/TMXTileMap.d.ts +0 -10
  89. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  90. package/build/level/tiled/TMXTileset.d.ts +0 -113
  91. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  92. package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
  93. package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
  94. package/build/level/tiled/TMXUtils.d.ts +1 -43
  95. package/build/level/tiled/TMXUtils.d.ts.map +1 -1
  96. package/build/level/tiled/factories/shape.d.ts +1 -7
  97. package/build/level/tiled/factories/shape.d.ts.map +1 -1
  98. package/build/level/tiled/factories/text.d.ts +1 -7
  99. package/build/level/tiled/factories/text.d.ts.map +1 -1
  100. package/build/level/tiled/factories/tile.d.ts +1 -7
  101. package/build/level/tiled/factories/tile.d.ts.map +1 -1
  102. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
  103. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
  104. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
  105. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
  106. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
  107. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  108. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
  109. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
  110. package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
  111. package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
  112. package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
  113. package/build/level/tiled/renderer/autodetect.d.ts +1 -6
  114. package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
  115. package/build/lighting/light2d.d.ts +0 -25
  116. package/build/lighting/light2d.d.ts.map +1 -1
  117. package/build/lighting/light3d.d.ts +0 -16
  118. package/build/lighting/light3d.d.ts.map +1 -1
  119. package/build/loader/loader.d.ts +46 -73
  120. package/build/loader/loader.d.ts.map +1 -1
  121. package/build/loader/loadingscreen.d.ts +0 -33
  122. package/build/loader/loadingscreen.d.ts.map +1 -1
  123. package/build/loader/parsers/aseprite.d.ts +0 -13
  124. package/build/loader/parsers/aseprite.d.ts.map +1 -1
  125. package/build/loader/parsers/audio.d.ts +2 -0
  126. package/build/loader/parsers/audio.d.ts.map +1 -0
  127. package/build/loader/parsers/binary.d.ts +1 -10
  128. package/build/loader/parsers/binary.d.ts.map +1 -1
  129. package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
  130. package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
  131. package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
  132. package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
  133. package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
  134. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
  135. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
  136. package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
  137. package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
  138. package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
  139. package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
  140. package/build/loader/parsers/fontface.d.ts +1 -13
  141. package/build/loader/parsers/fontface.d.ts.map +1 -1
  142. package/build/loader/parsers/gltf.d.ts +1 -70
  143. package/build/loader/parsers/gltf.d.ts.map +1 -1
  144. package/build/loader/parsers/image.d.ts +1 -22
  145. package/build/loader/parsers/image.d.ts.map +1 -1
  146. package/build/loader/parsers/json.d.ts +1 -10
  147. package/build/loader/parsers/json.d.ts.map +1 -1
  148. package/build/loader/parsers/mtl.d.ts +1 -28
  149. package/build/loader/parsers/mtl.d.ts.map +1 -1
  150. package/build/loader/parsers/obj.d.ts +1 -59
  151. package/build/loader/parsers/obj.d.ts.map +1 -1
  152. package/build/loader/parsers/pbr.d.ts +1 -62
  153. package/build/loader/parsers/pbr.d.ts.map +1 -1
  154. package/build/loader/parsers/script.d.ts +1 -10
  155. package/build/loader/parsers/script.d.ts.map +1 -1
  156. package/build/loader/parsers/shader.d.ts +1 -52
  157. package/build/loader/parsers/shader.d.ts.map +1 -1
  158. package/build/loader/parsers/tmx.d.ts +1 -10
  159. package/build/loader/parsers/tmx.d.ts.map +1 -1
  160. package/build/loader/parsers/video.d.ts +1 -10
  161. package/build/loader/parsers/video.d.ts.map +1 -1
  162. package/build/math/color.d.ts.map +1 -1
  163. package/build/math/noise.d.ts +0 -40
  164. package/build/math/noise.d.ts.map +1 -1
  165. package/build/math/observableVector2d.d.ts +0 -3
  166. package/build/math/observableVector2d.d.ts.map +1 -1
  167. package/build/math/observableVector3d.d.ts +0 -3
  168. package/build/math/observableVector3d.d.ts.map +1 -1
  169. package/build/math/vector2d.d.ts +0 -6
  170. package/build/math/vector2d.d.ts.map +1 -1
  171. package/build/math/vertex.d.ts +25 -0
  172. package/build/math/vertex.d.ts.map +1 -1
  173. package/build/particles/emitter.d.ts +0 -65
  174. package/build/particles/emitter.d.ts.map +1 -1
  175. package/build/particles/particle.d.ts +0 -81
  176. package/build/particles/particle.d.ts.map +1 -1
  177. package/build/physics/adapter.d.ts +3 -3
  178. package/build/physics/bounds.d.ts +0 -1
  179. package/build/physics/bounds.d.ts.map +1 -1
  180. package/build/physics/broadphase/broadphase.d.ts +0 -7
  181. package/build/physics/broadphase/broadphase.d.ts.map +1 -1
  182. package/build/physics/broadphase/octree.d.ts +0 -91
  183. package/build/physics/broadphase/octree.d.ts.map +1 -1
  184. package/build/physics/broadphase/quadtree.d.ts +0 -47
  185. package/build/physics/broadphase/quadtree.d.ts.map +1 -1
  186. package/build/physics/builtin/body.d.ts +5 -69
  187. package/build/physics/builtin/body.d.ts.map +1 -1
  188. package/build/physics/builtin/detector.d.ts +0 -312
  189. package/build/physics/builtin/detector.d.ts.map +1 -1
  190. package/build/physics/builtin/sat.d.ts +1 -48
  191. package/build/physics/builtin/sat.d.ts.map +1 -1
  192. package/build/physics/builtin/sat3d.d.ts +1 -56
  193. package/build/physics/builtin/sat3d.d.ts.map +1 -1
  194. package/build/physics/collision.d.ts +0 -2
  195. package/build/physics/collision.d.ts.map +1 -1
  196. package/build/physics/response.d.ts +0 -1
  197. package/build/physics/response.d.ts.map +1 -1
  198. package/build/physics/world.d.ts.map +1 -1
  199. package/build/plugin/plugin.d.ts +9 -1
  200. package/build/plugin/plugin.d.ts.map +1 -1
  201. package/build/polyfill/index.d.ts +1 -4
  202. package/build/polyfill/index.d.ts.map +1 -1
  203. package/build/renderable/anchorPoint.d.ts +1 -73
  204. package/build/renderable/anchorPoint.d.ts.map +1 -1
  205. package/build/renderable/animation.d.ts +0 -7
  206. package/build/renderable/animation.d.ts.map +1 -1
  207. package/build/renderable/colorlayer.d.ts +0 -5
  208. package/build/renderable/colorlayer.d.ts.map +1 -1
  209. package/build/renderable/container.d.ts +0 -55
  210. package/build/renderable/container.d.ts.map +1 -1
  211. package/build/renderable/draggable.d.ts +0 -5
  212. package/build/renderable/draggable.d.ts.map +1 -1
  213. package/build/renderable/dragndrop.d.ts +1 -12
  214. package/build/renderable/dragndrop.d.ts.map +1 -1
  215. package/build/renderable/entity/entity.d.ts +0 -8
  216. package/build/renderable/entity/entity.d.ts.map +1 -1
  217. package/build/renderable/frameAnimation.d.ts +0 -41
  218. package/build/renderable/frameAnimation.d.ts.map +1 -1
  219. package/build/renderable/groundshadow.d.ts +1 -91
  220. package/build/renderable/groundshadow.d.ts.map +1 -1
  221. package/build/renderable/imagelayer.d.ts +0 -29
  222. package/build/renderable/imagelayer.d.ts.map +1 -1
  223. package/build/renderable/instanced_mesh.d.ts +26 -104
  224. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  225. package/build/renderable/mesh.d.ts +145 -140
  226. package/build/renderable/mesh.d.ts.map +1 -1
  227. package/build/renderable/nineslicesprite.d.ts +0 -4
  228. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  229. package/build/renderable/renderable.d.ts +17 -54
  230. package/build/renderable/renderable.d.ts.map +1 -1
  231. package/build/renderable/sprite.d.ts +7 -52
  232. package/build/renderable/sprite.d.ts.map +1 -1
  233. package/build/renderable/sprite3d.d.ts +0 -95
  234. package/build/renderable/sprite3d.d.ts.map +1 -1
  235. package/build/renderable/text/bitmaptext.d.ts +0 -14
  236. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  237. package/build/renderable/text/bitmaptextdata.d.ts +0 -22
  238. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  239. package/build/renderable/text/glyph.d.ts +1 -39
  240. package/build/renderable/text/glyph.d.ts.map +1 -1
  241. package/build/renderable/text/text.d.ts +0 -20
  242. package/build/renderable/text/text.d.ts.map +1 -1
  243. package/build/renderable/text/textstyle.d.ts +1 -5
  244. package/build/renderable/text/textstyle.d.ts.map +1 -1
  245. package/build/renderable/trail.d.ts +0 -29
  246. package/build/renderable/trail.d.ts.map +1 -1
  247. package/build/renderable/trigger.d.ts +0 -6
  248. package/build/renderable/trigger.d.ts.map +1 -1
  249. package/build/renderable/ui/uibaseelement.d.ts +0 -40
  250. package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
  251. package/build/renderable/ui/uispriteelement.d.ts +0 -35
  252. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  253. package/build/state/stage.d.ts +4 -68
  254. package/build/state/stage.d.ts.map +1 -1
  255. package/build/state/state.d.ts.map +1 -1
  256. package/build/system/device.d.ts +0 -12
  257. package/build/system/device.d.ts.map +1 -1
  258. package/build/system/dom.d.ts +1 -8
  259. package/build/system/dom.d.ts.map +1 -1
  260. package/build/system/event.d.ts +1 -1
  261. package/build/system/legacy_pool.d.ts +1 -6
  262. package/build/system/legacy_pool.d.ts.map +1 -1
  263. package/build/system/platform.d.ts +21 -2
  264. package/build/system/platform.d.ts.map +1 -1
  265. package/build/system/pool.d.ts +0 -9
  266. package/build/system/pool.d.ts.map +1 -1
  267. package/build/system/save.d.ts.map +1 -1
  268. package/build/system/timer.d.ts +0 -20
  269. package/build/system/timer.d.ts.map +1 -1
  270. package/build/tweens/tween.d.ts +0 -62
  271. package/build/tweens/tween.d.ts.map +1 -1
  272. package/build/utils/array-multimap.d.ts +1 -13
  273. package/build/utils/array-multimap.d.ts.map +1 -1
  274. package/build/utils/decode.d.ts.map +1 -1
  275. package/build/utils/fetchdata.d.ts +2 -0
  276. package/build/utils/fetchdata.d.ts.map +1 -0
  277. package/build/utils/utils.d.ts +0 -13
  278. package/build/utils/utils.d.ts.map +1 -1
  279. package/build/video/blendmodes.d.ts +1 -106
  280. package/build/video/blendmodes.d.ts.map +1 -1
  281. package/build/video/buffer/index.d.ts +1 -39
  282. package/build/video/buffer/index.d.ts.map +1 -1
  283. package/build/video/buffer/vertex.d.ts +1 -82
  284. package/build/video/buffer/vertex.d.ts.map +1 -1
  285. package/build/video/canvas/canvas_renderer.d.ts +7 -25
  286. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  287. package/build/video/canvas_factory.d.ts +1 -24
  288. package/build/video/canvas_factory.d.ts.map +1 -1
  289. package/build/video/effects/blendEffect.d.ts +0 -54
  290. package/build/video/effects/blendEffect.d.ts.map +1 -1
  291. package/build/video/effects/blur.d.ts +4 -4
  292. package/build/video/effects/blur.d.ts.map +1 -1
  293. package/build/video/effects/chromaticAberration.d.ts +5 -5
  294. package/build/video/effects/chromaticAberration.d.ts.map +1 -1
  295. package/build/video/effects/colorMatrix.d.ts +5 -15
  296. package/build/video/effects/colorMatrix.d.ts.map +1 -1
  297. package/build/video/effects/desaturate.d.ts +5 -5
  298. package/build/video/effects/desaturate.d.ts.map +1 -1
  299. package/build/video/effects/dissolve.d.ts +4 -4
  300. package/build/video/effects/dissolve.d.ts.map +1 -1
  301. package/build/video/effects/dropShadow.d.ts +5 -5
  302. package/build/video/effects/dropShadow.d.ts.map +1 -1
  303. package/build/video/effects/flash.d.ts +4 -4
  304. package/build/video/effects/flash.d.ts.map +1 -1
  305. package/build/video/effects/glow.d.ts +5 -5
  306. package/build/video/effects/glow.d.ts.map +1 -1
  307. package/build/video/effects/glsl_realization.d.ts +1 -17
  308. package/build/video/effects/glsl_realization.d.ts.map +1 -1
  309. package/build/video/effects/hologram.d.ts +4 -4
  310. package/build/video/effects/hologram.d.ts.map +1 -1
  311. package/build/video/effects/invert.d.ts +5 -5
  312. package/build/video/effects/invert.d.ts.map +1 -1
  313. package/build/video/effects/outline.d.ts +6 -6
  314. package/build/video/effects/outline.d.ts.map +1 -1
  315. package/build/video/effects/pixelate.d.ts +4 -4
  316. package/build/video/effects/pixelate.d.ts.map +1 -1
  317. package/build/video/effects/radialGradient.d.ts +2 -3
  318. package/build/video/effects/radialGradient.d.ts.map +1 -1
  319. package/build/video/effects/scanline.d.ts +6 -6
  320. package/build/video/effects/scanline.d.ts.map +1 -1
  321. package/build/video/effects/sepia.d.ts +5 -5
  322. package/build/video/effects/sepia.d.ts.map +1 -1
  323. package/build/video/effects/shadereffect.d.ts +12 -123
  324. package/build/video/effects/shadereffect.d.ts.map +1 -1
  325. package/build/video/effects/shine.d.ts +3 -3
  326. package/build/video/effects/shine.d.ts.map +1 -1
  327. package/build/video/effects/tintPulse.d.ts +4 -4
  328. package/build/video/effects/tintPulse.d.ts.map +1 -1
  329. package/build/video/effects/vignette.d.ts +6 -6
  330. package/build/video/effects/vignette.d.ts.map +1 -1
  331. package/build/video/effects/wave.d.ts +4 -4
  332. package/build/video/effects/wave.d.ts.map +1 -1
  333. package/build/video/effects/wgsl/layout.d.ts +1 -27
  334. package/build/video/effects/wgsl/layout.d.ts.map +1 -1
  335. package/build/video/effects/wgsl/parse.d.ts +1 -8
  336. package/build/video/effects/wgsl/parse.d.ts.map +1 -1
  337. package/build/video/effects/wgsl/scaffold.d.ts +1 -42
  338. package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
  339. package/build/video/effects/wgsl_realization.d.ts +1 -82
  340. package/build/video/effects/wgsl_realization.d.ts.map +1 -1
  341. package/build/video/gpu/batcher.d.ts +1 -13
  342. package/build/video/gpu/batcher.d.ts.map +1 -1
  343. package/build/video/gpu/instancerecord.d.ts +1 -163
  344. package/build/video/gpu/instancerecord.d.ts.map +1 -1
  345. package/build/video/gpu/meshchunk.d.ts +1 -48
  346. package/build/video/gpu/meshchunk.d.ts.map +1 -1
  347. package/build/video/gpu/meshvertex.d.ts +1 -53
  348. package/build/video/gpu/meshvertex.d.ts.map +1 -1
  349. package/build/video/gpu/primitives.d.ts +1 -59
  350. package/build/video/gpu/primitives.d.ts.map +1 -1
  351. package/build/video/gpu/quadcorners.d.ts +1 -10
  352. package/build/video/gpu/quadcorners.d.ts.map +1 -1
  353. package/build/video/gpu/textureslots.d.ts +1 -121
  354. package/build/video/gpu/textureslots.d.ts.map +1 -1
  355. package/build/video/gpu/texturestore.d.ts +1 -138
  356. package/build/video/gpu/texturestore.d.ts.map +1 -1
  357. package/build/video/gpu/topology.d.ts.map +1 -1
  358. package/build/video/gpu/vertexformat.d.ts +0 -28
  359. package/build/video/gpu/vertexformat.d.ts.map +1 -1
  360. package/build/video/gradient.d.ts +0 -81
  361. package/build/video/gradient.d.ts.map +1 -1
  362. package/build/video/renderer.d.ts +21 -102
  363. package/build/video/renderer.d.ts.map +1 -1
  364. package/build/video/renderstate.d.ts +0 -51
  365. package/build/video/renderstate.d.ts.map +1 -1
  366. package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
  367. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  368. package/build/video/rendertarget/render_target_pool.d.ts +1 -82
  369. package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
  370. package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
  371. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  372. package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
  373. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  374. package/build/video/texture/atlas.d.ts +2 -76
  375. package/build/video/texture/atlas.d.ts.map +1 -1
  376. package/build/video/texture/cache.d.ts +0 -136
  377. package/build/video/texture/cache.d.ts.map +1 -1
  378. package/build/video/texture/frametexture.d.ts +1 -71
  379. package/build/video/texture/frametexture.d.ts.map +1 -1
  380. package/build/video/texture/noise_texture2d.d.ts +0 -43
  381. package/build/video/texture/noise_texture2d.d.ts.map +1 -1
  382. package/build/video/texture/parser/aseprite.d.ts +1 -8
  383. package/build/video/texture/parser/aseprite.d.ts.map +1 -1
  384. package/build/video/texture/parser/spritesheet.d.ts +1 -8
  385. package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
  386. package/build/video/texture/parser/texturepacker.d.ts +1 -8
  387. package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
  388. package/build/video/texture/resource.d.ts +0 -9
  389. package/build/video/texture/resource.d.ts.map +1 -1
  390. package/build/video/texture/texture2d.d.ts +0 -11
  391. package/build/video/texture/texture2d.d.ts.map +1 -1
  392. package/build/video/utils/autodetect.d.ts +1 -5
  393. package/build/video/utils/autodetect.d.ts.map +1 -1
  394. package/build/video/webgl/batchers/batcher.d.ts +0 -55
  395. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  396. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
  397. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
  398. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
  399. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  400. package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
  401. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  402. package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
  403. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  404. package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
  405. package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
  406. package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
  407. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  408. package/build/video/webgl/buffer/index.d.ts +1 -36
  409. package/build/video/webgl/buffer/index.d.ts.map +1 -1
  410. package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
  411. package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
  412. package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
  413. package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
  414. package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
  415. package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
  416. package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
  417. package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
  418. package/build/video/webgl/glshader.d.ts +2 -51
  419. package/build/video/webgl/glshader.d.ts.map +1 -1
  420. package/build/video/webgl/lighting/pack3d.d.ts +1 -47
  421. package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
  422. package/build/video/webgl/lighting/std140.d.ts +1 -109
  423. package/build/video/webgl/lighting/std140.d.ts.map +1 -1
  424. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
  425. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  426. package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
  427. package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
  428. package/build/video/webgl/shaders/multitexture.d.ts +1 -9
  429. package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
  430. package/build/video/webgl/texture/store.d.ts +1 -50
  431. package/build/video/webgl/texture/store.d.ts.map +1 -1
  432. package/build/video/webgl/utils/attributes.d.ts +1 -11
  433. package/build/video/webgl/utils/attributes.d.ts.map +1 -1
  434. package/build/video/webgl/utils/maxtextures.d.ts +1 -36
  435. package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
  436. package/build/video/webgl/utils/precision.d.ts +1 -14
  437. package/build/video/webgl/utils/precision.d.ts.map +1 -1
  438. package/build/video/webgl/utils/program.d.ts +1 -5
  439. package/build/video/webgl/utils/program.d.ts.map +1 -1
  440. package/build/video/webgl/utils/samplercache.d.ts +1 -68
  441. package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
  442. package/build/video/webgl/utils/string.d.ts +1 -21
  443. package/build/video/webgl/utils/string.d.ts.map +1 -1
  444. package/build/video/webgl/utils/topology.d.ts +1 -23
  445. package/build/video/webgl/utils/topology.d.ts.map +1 -1
  446. package/build/video/webgl/utils/uniforms.d.ts +1 -25
  447. package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
  448. package/build/video/webgl/utils/vertexformat.d.ts +1 -26
  449. package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
  450. package/build/video/webgl/webgl_renderer.d.ts +24 -286
  451. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  452. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
  453. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
  454. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
  455. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
  456. package/build/video/webgpu/batchers/mesh_batcher.d.ts +1 -230
  457. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
  458. package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
  459. package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
  460. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
  461. package/build/video/webgpu/buffer/arena.d.ts +1 -63
  462. package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
  463. package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
  464. package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
  465. package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
  466. package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
  467. package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
  468. package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
  469. package/build/video/webgpu/effect_binding.d.ts +1 -16
  470. package/build/video/webgpu/effect_binding.d.ts.map +1 -1
  471. package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
  472. package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
  473. package/build/video/webgpu/pipeline/cache.d.ts +1 -163
  474. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
  475. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
  476. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  477. package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
  478. package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
  479. package/build/video/webgpu/texture/compressed.d.ts +1 -32
  480. package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
  481. package/build/video/webgpu/texture/frametexture.d.ts +1 -62
  482. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
  483. package/build/video/webgpu/texture/store.d.ts +1 -147
  484. package/build/video/webgpu/texture/store.d.ts.map +1 -1
  485. package/build/video/webgpu/webgpu_renderer.d.ts +2 -89
  486. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
  487. package/package.json +8 -11
  488. package/skills/AGENTS.md +67 -0
  489. package/skills/melonjs/SKILL.md +156 -0
  490. package/skills/melonjs-20-migration/SKILL.md +160 -0
  491. package/skills/melonjs-3d/SKILL.md +525 -0
  492. package/skills/melonjs-3d-assets/SKILL.md +258 -0
  493. package/skills/melonjs-audio/SKILL.md +236 -0
  494. package/skills/melonjs-camera-and-drawing/SKILL.md +175 -0
  495. package/skills/melonjs-deployment/SKILL.md +113 -0
  496. package/skills/melonjs-effects-and-shaders/SKILL.md +178 -0
  497. package/skills/melonjs-events/SKILL.md +159 -0
  498. package/skills/melonjs-getting-started/SKILL.md +183 -0
  499. package/skills/melonjs-input/SKILL.md +166 -0
  500. package/skills/melonjs-lighting/SKILL.md +139 -0
  501. package/skills/melonjs-loading-assets/SKILL.md +186 -0
  502. package/skills/melonjs-particles-and-trails/SKILL.md +136 -0
  503. package/skills/melonjs-performance/SKILL.md +183 -0
  504. package/skills/melonjs-physics/SKILL.md +321 -0
  505. package/skills/melonjs-plugins/SKILL.md +191 -0
  506. package/skills/melonjs-renderables/SKILL.md +214 -0
  507. package/skills/melonjs-renderer-backends/SKILL.md +173 -0
  508. package/skills/melonjs-scenes-and-state/SKILL.md +180 -0
  509. package/skills/melonjs-sprites-and-animation/SKILL.md +173 -0
  510. package/skills/melonjs-tilemaps/SKILL.md +213 -0
  511. package/skills/melonjs-ui-and-text/SKILL.md +65 -0
  512. package/build/audio/backend.d.ts +0 -140
  513. package/build/audio/backend.d.ts.map +0 -1
  514. package/build/loader/parsers/fetchdata.d.ts +0 -32
  515. package/build/loader/parsers/fetchdata.d.ts.map +0 -1
@@ -56,6 +56,17 @@ export default class Mesh extends Renderable {
56
56
  * @param {string} [settings.textureFilter] - texture magnification filter (`"nearest"` for crisp pixel-art upscaling, `"linear"` for smooth) applied to the resolved texture. Omit to keep the renderer's global `antiAlias` default. On the mesh path, linear filtering also samples a generated mip chain with trilinear minification and 4× anisotropy (distant geometry stops shimmering) — `"nearest"` opts out, keeping crisp pixel-art models on hard level-0 sampling. GPU backends only (ignored by the Canvas renderer).
57
57
  * @param {number} [settings.alphaCutoff=0] - alpha cutout threshold. Fragments whose final alpha is below this value are discarded (hard-edged cutout — foliage, fences, decals — with no blending or sorting). `0` disables the cutout. Set automatically by the glTF loader from a material's `alphaMode: "MASK"`. GPU mesh path only (WebGL and WebGPU; the Canvas renderer ignores it).
58
58
  * @param {number[]|Float32Array} [settings.emissive] - emissive (self-illumination) color `[r, g, b]` (0..1, may exceed 1 for HDR glow) added on top of the lit/unlit color so the surface glows regardless of scene lights (neon, lava, screens). Omit / all-zero for no emission. Set automatically by the glTF loader (`emissiveFactor`) and OBJ loader (MTL `Ke`). GPU mesh path only (WebGL and WebGPU; the Canvas renderer ignores it).
59
+ * @param {boolean} [settings.lit=false] - shade this mesh with the scene's {@link Light3d} lights (the lit mesh pipeline) instead of rendering fullbright. Set automatically by the glTF importer when the scene carries a directional, point or spot light. With `lit` on and no lights present the batcher uploads a white ambient, so the result is indistinguishable from unlit.
60
+ * @param {Uint32Array|Color[]|number[]} [settings.vertexColors] - per-vertex colour, one entry per vertex, multiplied into {@link Mesh#tint}. Either packed RGBA8 (`Uint32Array`, the form the batchers read — no conversion) or one {@link Color} per vertex. Omit for plain white. Lets a single mesh carry a gradient — fading a terrain toward the sky with distance, darkening a crease — which a per-object `tint` cannot express. An explicit value wins over the colours a multi-material OBJ bakes from its MTL.
61
+ * @param {number[]|Float32Array} [settings.normals] - per-vertex normals for the lit path. An explicit value wins over the ones an OBJ or glTF source supplies; omit it and they are taken from the model, or generated from the geometry when the mesh is `lit`. Generated normals average per vertex where faces share vertices (smooth shading) and equal the face normal where they do not (flat shading) — the geometry decides, not a flag.
62
+ * @param {number[]|Float32Array} [settings.specular] - specular color `[r, g, b]` (0..1) for the lit path. Set by the OBJ loader from MTL `Ks`, and derived from glTF metallic/roughness.
63
+ * @param {number} [settings.shininess=0] - specular exponent for the lit path (MTL `Ns`). `0` for a fully diffuse surface.
64
+ * @param {string|TextureAtlas|HTMLImageElement} [settings.alphaMap] - per-texel opacity map, sampled in addition to the diffuse texture (MTL `map_d`).
65
+ * @param {boolean} [settings.castGroundShadow] - give this mesh a blob ground shadow, overriding the application's `castGroundShadow` setting in both directions. Omit to inherit. Needs a GPU backend and a `Camera3d`.
66
+ * @param {boolean} [settings.transparent] - draw in the transparent pass (blended, back-to-front, no depth write). Omit and a mesh goes transparent whenever its draw alpha is fractional; `true` for soft-alpha textures; `false` to stay opaque however faded
67
+ * @param {boolean} [settings.fog] - set `false` to exempt this mesh from the camera's distance fog ({@link Camera3d#setFog}); omit to fog whenever the camera does
68
+ * @param {number} [settings.shadowGroundY] - world Y of the floor the shadow lands on. Omit and the blob sits at the object's own base at full strength; set it and the blob shrinks and fades as the object rises. Render space is Y-down, so the floor is a **greater** Y than the object above it.
69
+ * @param {number} [settings.shadowOpacity=0.45] - opacity of the shadow directly beneath the object, before any height fade.
59
70
  * @example
60
71
  * // create from OBJ + MTL (texture auto-resolved from material)
61
72
  * let mesh = new me.Mesh(0, 0, {
@@ -118,6 +129,17 @@ export default class Mesh extends Renderable {
118
129
  textureFilter?: string | undefined;
119
130
  alphaCutoff?: number | undefined;
120
131
  emissive?: number[] | Float32Array<ArrayBufferLike> | undefined;
132
+ lit?: boolean | undefined;
133
+ vertexColors?: number[] | Uint32Array<ArrayBufferLike> | Color[] | undefined;
134
+ normals?: number[] | Float32Array<ArrayBufferLike> | undefined;
135
+ specular?: number[] | Float32Array<ArrayBufferLike> | undefined;
136
+ shininess?: number | undefined;
137
+ alphaMap?: string | HTMLImageElement | TextureAtlas | undefined;
138
+ castGroundShadow?: boolean | undefined;
139
+ transparent?: boolean | undefined;
140
+ fog?: boolean | undefined;
141
+ shadowGroundY?: number | undefined;
142
+ shadowOpacity?: number | undefined;
121
143
  });
122
144
  /**
123
145
  * the original (untransformed) vertex positions as x,y,z triplets
@@ -134,7 +156,6 @@ export default class Mesh extends Renderable {
134
156
  * @type {number}
135
157
  */
136
158
  vertexCount: number;
137
- _indicesOriginal: number[];
138
159
  /**
139
160
  * the projected vertex positions.
140
161
  *
@@ -252,6 +273,102 @@ export default class Mesh extends Renderable {
252
273
  * @see Mesh#shadowGroundY
253
274
  */
254
275
  castGroundShadow: boolean | undefined;
276
+ /**
277
+ * Whether this mesh is affected by the camera's distance fog
278
+ * ({@link Camera3d#setFog}).
279
+ *
280
+ * Left **unset** (`undefined`, the default) the mesh fogs whenever the
281
+ * camera drawing it has fog — which for a scene that never enables fog
282
+ * means never. Set it to `false` and this mesh is never fogged, however
283
+ * far away it is: the escape hatch for something that has to stay
284
+ * readable at any distance, such as an objective marker or a waypoint.
285
+ * `true` is accepted for symmetry and behaves as the default.
286
+ *
287
+ * It exempts the **mesh**, not the ground shadow it casts. A blob is a
288
+ * mark on the floor and fogs with the floor it lies on — one staying
289
+ * crisp under an object whose surroundings had dissolved would read as
290
+ * a fault rather than as emphasis. The blob quad is also shared by
291
+ * every caster in the scene, so it carries no per-object state to read.
292
+ *
293
+ * Emissive surfaces fog too — light travelling through fog is
294
+ * attenuated like anything else — so a neon sign that should punch
295
+ * through wants `fog: false` rather than a brighter emissive.
296
+ * @type {boolean|undefined}
297
+ * @default undefined
298
+ * @see Camera3d#setFog
299
+ * @example
300
+ * // the world fogs; this waypoint stays readable at any distance
301
+ * camera.setFog({ near: 1200, far: 7000 });
302
+ *
303
+ * const marker = new Mesh(0, 0, {
304
+ * ...beaconGeometry,
305
+ * emissive: [1, 0.6, 0],
306
+ * fog: false,
307
+ * });
308
+ * // or afterwards, on anything already built
309
+ * marker.fog = false;
310
+ */
311
+ fog: boolean | undefined;
312
+ /**
313
+ * Whether this mesh draws in the **transparent pass** — blended,
314
+ * back-to-front, writing no depth — instead of the opaque one.
315
+ *
316
+ * Left **unset** (`undefined`, the default) the mesh goes transparent
317
+ * whenever the draw resolves to fractional alpha, so `setOpacity(0.5)`
318
+ * simply fades it. That is the useful default because the opaque path
319
+ * writes premultiplied colour with blending off: a faded mesh comes out
320
+ * *darkened toward black* rather than see-through, which is a defect
321
+ * rather than a contract — the fully transparent end of the same range
322
+ * used to paint an opaque black silhouette until it was fixed.
323
+ *
324
+ * Set it **`true`** when the transparency lives in the TEXTURE rather
325
+ * than in the opacity — a soft-edged glow, smoke, a glTF material with
326
+ * `alphaMode: "BLEND"`. The automatic check reads the draw's alpha and
327
+ * cannot see into the texture. The glTF loader does not set this for
328
+ * you: one loaded mesh can merge several materials, and this flag
329
+ * routes the whole mesh, so a `"BLEND"` material sharing geometry with
330
+ * an opaque one would drag the opaque half into the transparent pass.
331
+ * Note that `alphaCutoff` discards texels before blending sees them, so
332
+ * a soft edge needs a low cutoff (see {@link Sprite3d}, which lowers
333
+ * its default for exactly this). The cutoff thresholds the MATERIAL's
334
+ * alpha, not the drawn alpha, so a fading cutout mesh keeps its shape
335
+ * rather than disappearing at its own threshold.
336
+ *
337
+ * The pass composites premultiplied, which is what the mesh vertex
338
+ * stage always emits. A texture uploaded with straight alpha and drawn
339
+ * with `transparent: true` therefore reads slightly bright at its soft
340
+ * texels; upload it premultiplied (the default) and it is exact.
341
+ *
342
+ * {@link Renderable#blendMode} is honoured per entry, with one limit:
343
+ * the advanced modes (`"overlay"`, `"difference"`, and the rest that
344
+ * need a compositing pass) fall back to `"normal"` here on both
345
+ * backends, since the pass rasterizes directly into the target.
346
+ *
347
+ * Set it **`false`** to keep a mesh in the opaque pass however it is
348
+ * faded — it will darken rather than fade, and it will keep writing
349
+ * depth.
350
+ *
351
+ * Sorting is **per object**, by distance from the camera, so two
352
+ * intersecting or mutually enclosing transparent meshes may pop as the
353
+ * camera moves; split them, or accept it. Needs a GPU backend and a
354
+ * {@link Camera3d} — the 2D-camera path is unaffected.
355
+ * @type {boolean|undefined}
356
+ * @default undefined
357
+ * @see Renderable#blendMode
358
+ * @example
359
+ * // a ghost that fades in — nothing else needed
360
+ * ghost.setOpacity(0.4);
361
+ *
362
+ * // a glow that blends at full opacity, and additively
363
+ * const glow = new Mesh(0, 0, {
364
+ * ...quad,
365
+ * texture: glowTexture,
366
+ * transparent: true,
367
+ * blendMode: "additive",
368
+ * alphaCutoff: 0,
369
+ * });
370
+ */
371
+ transparent: boolean | undefined;
255
372
  /**
256
373
  * World Y of the floor the shadow lands on, or `undefined` (the
257
374
  * default) to mean "this object is standing on the ground" — the
@@ -277,17 +394,6 @@ export default class Mesh extends Renderable {
277
394
  * @default 0.45
278
395
  */
279
396
  shadowOpacity: number;
280
- /**
281
- * Cached horizontal half-extent used to size the shadow, resolved on
282
- * first shadowed draw. Cached because the alternative is a
283
- * `getBounds3d()` per frame per shadow, which re-bounds every source
284
- * vertex through the model matrix.
285
- * @ignore
286
- */
287
- _shadowHalfX: number;
288
- _shadowHalfZ: number;
289
- _shadowGeomVersion: number;
290
- _shadowHasHeight: boolean;
291
397
  /**
292
398
  * whether to cull back-facing triangles
293
399
  * @type {boolean}
@@ -361,9 +467,15 @@ export default class Mesh extends Renderable {
361
467
  * material has its own dedup scope in the OBJ parser), so
362
468
  * every vertex belongs to exactly one material group and
363
469
  * carries that group's color unambiguously.
364
- * @type {Uint32Array}
470
+ *
471
+ * This is also what `settings.vertexColors` and
472
+ * {@link Mesh#setVertexColor} populate, so procedural geometry
473
+ * can carry a gradient a per-object `tint` cannot express.
474
+ * `undefined` when every vertex is plain white.
475
+ * @type {Uint32Array|undefined}
476
+ * @see Mesh#setVertexColor
365
477
  */
366
- vertexColors: Uint32Array;
478
+ vertexColors: Uint32Array | undefined;
367
479
  texture: any;
368
480
  /**
369
481
  * Index ranges that each need their own diffuse texture bound, for a
@@ -414,23 +526,6 @@ export default class Mesh extends Renderable {
414
526
  * @type {Matrix3d}
415
527
  */
416
528
  projectionMatrix: Matrix3d;
417
- /** @ignore */
418
- _anchorBaked: boolean;
419
- /** @ignore */
420
- _hullPoints: Vector2d[];
421
- /** @ignore */
422
- _hullPolygon: Polygon | null;
423
- /** @ignore */
424
- _geometryVersion: number;
425
- /**
426
- * Project all vertices through projectionMatrix × currentTransform
427
- * and store the results in `this.vertices`.
428
- * @param {number} [offsetX=0] - x offset added to each projected vertex
429
- * @param {number} [offsetY=0] - y offset added to each projected vertex
430
- * @param {number} [zScale=0] - scale factor for Z output (0 = skip Z, 1000 = depth buffer range)
431
- * @ignore
432
- */
433
- _projectVertices(offsetX?: number, offsetY?: number, zScale?: number): void;
434
529
  /**
435
530
  * Signal that this mesh's geometry itself has changed — its vertices, UVs,
436
531
  * indices, normals or per-vertex colours were edited in place.
@@ -447,80 +542,29 @@ export default class Mesh extends Renderable {
447
542
  */
448
543
  set needsUpdate(value: any);
449
544
  /**
450
- * Compose this mesh's placement into a single matrix: where its model-space
451
- * geometry sits in the world.
545
+ * Set one vertex's colour, multiplied into {@link Mesh#tint}.
452
546
  *
453
- * This is the matrix form of {@link Mesh#_projectVerticesWorld} — the same
454
- * transform, scale and axis bridge, expressed once instead of applied to
455
- * every vertex:
547
+ * The mesh starts carrying per-vertex colour on the first call — every
548
+ * other vertex is white until coloured, so a mesh built without
549
+ * `settings.vertexColors` looks unchanged until you touch it.
456
550
  *
457
- * `translate(pos, depth) · scale(s, -s, ±s) · currentTransform`
551
+ * Out-of-range indices are ignored rather than throwing, matching
552
+ * {@link InstancedMesh#setInstanceColor}.
458
553
  *
459
- * The Y negation bridges Y-up geometry to the engine's Y-down world; Z is
460
- * negated too for right-handed (glTF) sources, which makes the bridge a
461
- * rotation rather than a reflection and so preserves triangle winding.
462
- * @returns {Matrix3d} the mesh's model matrix (reused instance)
463
- * @ignore
464
- */
465
- _composeModelMatrix(): Matrix3d;
466
- /** @ignore */
467
- _modelMatrix: Matrix3d | undefined;
468
- /**
469
- * Project vertices into **world space** for the Camera3d render path.
470
- * Bypasses {@link Mesh#projectionMatrix} (the self-contained
471
- * perspective that's meaningful only under Camera2d) and emits
472
- * vertices that the active 3D camera then projects via its own
473
- * view + projection matrices, the same way it does for Sprites.
474
- *
475
- * Per-vertex math: `currentTransform × originalVertex`, then a uniform
476
- * scale by `this.width`, the Y-up→Y-down bridge (negate Y, and also Z when
477
- * {@link Mesh#rightHanded} is set so the bridge is a rotation rather than a
478
- * mirror), and a translate to `(offsetX, offsetY, offsetZ)`.
479
- *
480
- * @param {number} offsetX - world X to place the mesh center at
481
- * @param {number} offsetY - world Y to place the mesh center at
482
- * @param {number} offsetZ - world Z to place the mesh center at
483
- * @ignore
484
- */
485
- _projectVerticesWorld(offsetX: number, offsetY: number, offsetZ: number): void;
486
- /**
487
- * Project {@link Mesh#originalNormals} into world space for lit shading,
488
- * storing the result in {@link Mesh#normals}. Applies the rotation/scale of
489
- * {@link Renderable#currentTransform} (no translation), the same Y-down /
490
- * `rightHanded` Y/Z bridge as {@link Mesh#_projectVerticesWorld}, then
491
- * renormalizes. No-op when the mesh has no source normals.
492
- *
493
- * Note: uses the transform's rotation/scale columns directly rather than
494
- * the inverse-transpose, so normals are exact under rotation + uniform
495
- * scale (the common case); a strongly non-uniform scale would skew them
496
- * slightly — acceptable for the diffuse lighting path.
497
- * @ignore
498
- */
499
- _projectNormalsWorld(): void;
500
- /**
501
- * Build the winding-reversed indices buffer used by the Camera3d
502
- * world-space path. Called once, lazily, the first time the mesh
503
- * draws under Camera3d. Why: the world-space path Y-flips vertices
504
- * on output (a reflection, det = -1), which inverts triangle
505
- * winding in screen space. Without the swap, `cullBackFaces: true`
506
- * would end up culling the front faces and the model would look
507
- * hollow.
508
- *
509
- * Both buffers are kept alive — `_indicesOriginal` is the original
510
- * OBJ-shared (or user-supplied) winding, `_indicesReversed` is the
511
- * Camera3d-flipped copy. `draw()` swaps `this.indices` between them
512
- * each frame based on the active camera, so a Mesh that was first
513
- * drawn under Camera3d and later re-parented to a Camera2d stage
514
- * (e.g. a level transition into a 2D minigame) gets its original
515
- * winding back and stays correctly oriented under
516
- * `cullBackFaces: true`.
517
- * @param {boolean} [needsReversedIndices=true] - build the winding-reversed index copy. `false` on the retained path, which corrects winding with `frontFace` and would otherwise duplicate the index array for nothing.
518
- * @ignore
554
+ * Bumps {@link Mesh#needsUpdate} for you: the retained `Camera3d` path
555
+ * uploads geometry once and compares the version, so a colour written
556
+ * without it would apply on the immediate path and silently not on the
557
+ * retained one.
558
+ * @param {number} index - the vertex to colour
559
+ * @param {Color} color - the vertex colour
560
+ * @example
561
+ * // fade a procedural terrain toward the sky with distance
562
+ * for (let i = 0; i < mesh.vertexCount; i++) {
563
+ * const t = Math.min(1, mesh.originalVertices[i * 3 + 2] / 6000);
564
+ * mesh.setVertexColor(i, haze.copy(ground).lerp(sky, t));
565
+ * }
519
566
  */
520
- _setupWorldSpace(needsReversedIndices?: boolean): void;
521
- _indicesReversed: any;
522
- _worldSpace: boolean | undefined;
523
- _useWorldSpace: boolean | undefined;
567
+ setVertexColor(index: number, color: Color): void;
524
568
  /**
525
569
  * The mesh's world-space 3D axis-aligned bounding box. This is the 3D analog
526
570
  * of {@link Renderable#getBounds} (which returns a flat 2D box from
@@ -536,39 +580,6 @@ export default class Mesh extends Renderable {
536
580
  * @returns {AABB3d} the world-space bounding box (reused instance)
537
581
  */
538
582
  getBounds3d(): AABB3d;
539
- /** @ignore */
540
- _bounds3d: AABB3d | undefined;
541
- /**
542
- * Whether this mesh casts a ground shadow on this draw (#1515).
543
- *
544
- * Precedence, most specific first: the mesh's own `castGroundShadow`, then
545
- * the application's `castGroundShadow` setting. A per-mesh value is an
546
- * explicit instruction and is obeyed as given; the application default is a
547
- * blanket one, so it skips meshes with no vertical extent — which is what a
548
- * ground plane is, and a flat plane lying on the floor has nothing to cast.
549
- * Read off the renderer rather than the global application instance, the
550
- * same way the `textureFilter` default is.
551
- * @param {WebGLRenderer|WebGPURenderer} renderer - the active renderer
552
- * @returns {boolean} true if a shadow should be drawn
553
- * @ignore
554
- */
555
- _castsGroundShadow(renderer: WebGLRenderer | WebGPURenderer): boolean;
556
- /**
557
- * Measure the model-space footprint the blob is built from, and whether the
558
- * geometry has any height at all — once per geometry version.
559
- * @ignore
560
- */
561
- _measureShadowFootprint(): void;
562
- /**
563
- * Draw this mesh's ground shadow: the shared blob quad, flattened onto the
564
- * ground plane beneath the object (#1515).
565
- *
566
- * The quad is shared by every shadow in the scene and its geometry is
567
- * uploaded once, so this is one draw and no allocation.
568
- * @param {WebGLRenderer} renderer - the active renderer
569
- * @ignore
570
- */
571
- _drawGroundShadow(renderer: WebGLRenderer): void;
572
583
  /**
573
584
  * Render the mesh at its current state (transforms, projection, tint) to an offscreen canvas.
574
585
  * The returned canvas can be used with `renderer.drawImage()`, as a `Sprite` image source,
@@ -592,12 +603,6 @@ export default class Mesh extends Renderable {
592
603
  * const sprite = new me.Sprite(100, 100, { image: bitmap });
593
604
  */
594
605
  toImageBitmap(): Promise<ImageBitmap>;
595
- /**
596
- * Release this mesh's GPU-resident geometry, if a renderer is holding any,
597
- * then destroy the renderable.
598
- * @ignore
599
- */
600
- destroy(): void;
601
606
  }
602
607
  import Renderable from "./renderable.js";
603
608
  import { TextureAtlas } from "./../video/texture/atlas.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../../src/renderable/mesh.js"],"names":[],"mappings":"AA0OA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEG;IACH,eAhEW,MAAM,KACN,MAAM,YAEd;QAA0B,KAAK;QACU,QAAQ;QACR,GAAG;QACJ,OAAO;QACS,OAAO;QACrC,QAAQ;QACT,KAAK,EAAtB,MAAM;QACY,MAAM;QACL,aAAa;QACb,SAAS;QACV,KAAK;QACJ,WAAW;QACZ,aAAa;QACb,aAAa;QACb,WAAW;QACI,QAAQ;KACjD,EAqrBF;IA3nBC;;;OAGG;IACH,kBAFU,YAAY,CAEkB;IAExC;;;OAGG;IACH,KAFU,YAAY,CAEA;IAqBtB;;;OAGG;IACH,aAFU,MAAM,CAEsB;IAmCvC,2BAAoC;IAIpC;;;;;;;;;;;;;;OAcG;IACH,UAFU,YAAY,CAEgC;IAEtD;;;;;OAKG;IACH,iBAFU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AAyB;IAOzB;;;OAGG;IACH,wBAEE;IACF;;;OAGG;IACH,6BAAwB;IAKxB;;;OAGG;IACH,yBAAyB;IAG1B;;;;;;;;OAQG;IACH,2BANW,MAAM,YACN,MAAM,WACN,MAAM,QAkBhB;IAED;;;;;;;;;;;;;OAaG;IAKH,4BAIC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,sBATW,MAAM,SACN,KAAK,QAiBf;IA+BD;;;;;;;;;;;;;;;;OAgBG;IACH,uBAJa,QAAQ,CA+BpB;IAzBC;;;OAGG;IACH,mCAAkC;IAuBpC;;;;;;;;;;;;;;;;;OAiBG;IACH,+BANW,MAAM,WACN,MAAM,WACN,MAAM,QAsChB;IAED;;;;;;;;;;;;;OAaG;IACH,6BA8BC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,wCAJW,OAAO,QAsCjB;IAXC;;;OAGG;IACH,sBAA2B;IAE5B;;;OAGG;IACH,iCAAuB;IAqBvB;;;OAGG;IACH,oCAAuD;IAsBxD;;;;;;;;;;;;;OAaG;IACH,eAFa,MAAM,CAmBlB;IAfC;;;OAGG;IACH,8BAA6B;IAkC/B;;;;;;;;;;;;;;OAcG;IACH,6BALW,aAAa,GAAC,cAAc,GAC1B,OAAO,CAkBnB;IAED;;;;;OAKG;IACH,gCA0BC;IAED;;;;;;;;;OASG;IACH,4BAJW,aAAa,QAoJvB;IA0ID;;;;;;;;;;;;OAYG;IACH,YATa,iBAAiB,CAoH7B;IAED;;;;;;;OAOG;IACH,iBALa,OAAO,CAAC,WAAW,CAAC,CAOhC;IAED;;;;;OAKG;IACH,gBAMC;CACD;uBAniEsB,iBAAiB;6BAHX,6BAA6B;sBAXpC,kBAAkB;yBACf,qBAAqB;yBACrB,qBAAqB;wBALtB,0BAA0B;uBAY3B,iCAAiC;+BAU1B,oCAAoC"}
@@ -65,10 +65,6 @@ export default class NineSliceSprite extends Sprite {
65
65
  nss_height: number;
66
66
  insetx: number | undefined;
67
67
  insety: number | undefined;
68
- /**
69
- * @ignore
70
- */
71
- draw(renderer: any): void;
72
68
  }
73
69
  import Sprite from "./sprite.js";
74
70
  import type { TextureAtlas } from "./../video/texture/atlas.js";
@@ -1 +1 @@
1
- {"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,eAxBW,MAAM,KACN,MAAM,YAEd;QAAyB,KAAK,EAAtB,MAAM;QACW,MAAM,EAAvB,MAAM;QACY,MAAM;QACN,MAAM;QACyD,KAAK,EAAtF,gBAAgB,GAAC,iBAAiB,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QACpD,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACwB,WAAW,GAA1D,MAAM,GAAC,QAAQ,GAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAA;SAAC;KAC3C,EA8BF;IASD,iBALU,MAAM,EAOf;IATD;;;OAGG;IACH,aAFU,MAAM,CAIf;IAYD,kBALU,MAAM,EAOf;IATD;;;OAGG;IACH,cAFU,MAAM,CAIf;IAxBA,kBAA2B;IAC3B,mBAA6B;IAE7B,2BAA6B;IAC7B,2BAA6B;IAkD9B;;OAEG;IACH,0BA6EC;CACD;mBA3MkB,aAAa;kCAKC,6BAA6B;2BADtC,oBAAoB"}
1
+ {"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,eAxBW,MAAM,KACN,MAAM,YAEd;QAAyB,KAAK,EAAtB,MAAM;QACW,MAAM,EAAvB,MAAM;QACY,MAAM;QACN,MAAM;QACyD,KAAK,EAAtF,gBAAgB,GAAC,iBAAiB,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QACpD,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACwB,WAAW,GAA1D,MAAM,GAAC,QAAQ,GAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAA;SAAC;KAC3C,EA8BF;IASD,iBALU,MAAM,EAOf;IATD;;;OAGG;IACH,aAFU,MAAM,CAIf;IAYD,kBALU,MAAM,EAOf;IATD;;;OAGG;IACH,cAFU,MAAM,CAIf;IAxBA,kBAA2B;IAC3B,mBAA6B;IAE7B,2BAA6B;IAC7B,2BAA6B;IAmD9B;;;OAGG;IACH,0BA6EC;CACD;mBA7MkB,aAAa;kCAKC,6BAA6B;2BADtC,oBAAoB"}
@@ -64,7 +64,7 @@ export default class Renderable extends Rect {
64
64
  * this.isKinematic = false;
65
65
  *
66
66
  * // set the display to follow our position on both axis
67
- * app.viewport.follow(this.pos, app.viewport.AXIS.BOTH);
67
+ * app.viewport.follow(this, app.viewport.AXIS.BOTH);
68
68
  * }
69
69
  *
70
70
  * ...
@@ -241,11 +241,6 @@ export default class Renderable extends Rect {
241
241
  * mySprite.postEffects = [new SepiaEffect(renderer), new VignetteEffect(renderer)];
242
242
  */
243
243
  postEffects: Array<GLShader | ShaderEffect>;
244
- /**
245
- * whether this renderable manages its own FBO lifecycle (e.g. Camera2d)
246
- * @ignore
247
- */
248
- _postEffectManaged: boolean;
249
244
  /**
250
245
  * the blend mode to be applied to this renderable — any of the modes
251
246
  * listed on {@link CanvasRenderer#setBlendMode}, honoured identically by
@@ -262,45 +257,12 @@ export default class Renderable extends Rect {
262
257
  * @default ""
263
258
  */
264
259
  name: string;
265
- /**
266
- * to identify the object as a renderable object
267
- * @ignore
268
- */
269
- isRenderable: boolean;
270
260
  /**
271
261
  * If true then physic collision and input events will not impact this renderable
272
262
  * @type {boolean}
273
263
  * @default true
274
264
  */
275
265
  isKinematic: boolean;
276
- /**
277
- * cache the absolute position of the renderable
278
- * @ignore
279
- */
280
- _absPos: import("../index.ts").Vector3d | undefined;
281
- /**
282
- * keep track of when we flip
283
- * @ignore
284
- */
285
- _flip: {
286
- x: boolean;
287
- y: boolean;
288
- };
289
- /**
290
- * viewport flag
291
- * @ignore
292
- */
293
- _inViewport: boolean;
294
- /**
295
- * cache value for the parentApp
296
- * @ignore
297
- */
298
- _parentApp: any;
299
- /**
300
- * renderable cache tint value used by the getter/setter
301
- * @ignore
302
- */
303
- _tint: import("../index.ts").Color;
304
266
  /**
305
267
  * returns the parent application (or game) to which this renderable is attached to
306
268
  * @return {Application} the parent application or undefined if not attached to any container/app
@@ -610,8 +572,11 @@ export default class Renderable extends Rect {
610
572
  * to the position or transforms set or applied by the preDraw method.
611
573
  * The main draw loop will first call preDraw() to prepare the context for drawing the renderable,
612
574
  * then draw() to draw the renderable, and finally postDraw() to clear the context.
613
- * If you override this method, be mindful about the drawing logic; for example if you draw a shape
614
- * from the draw method, you should make sure that your draw it at the 0, 0 coordinates.
575
+ * If you override this method, be mindful about the drawing logic: `preDraw`
576
+ * applies this renderable's transforms, tint and anchor offset, but does
577
+ * **not** translate to `this.pos`. The renderer arrives positioned at the
578
+ * parent container's origin, so draw relative to `this.pos` — drawing at
579
+ * `(0, 0)` places the shape at the container's origin instead.
615
580
  * @see Renderable#preDraw
616
581
  * @see Renderable#postDraw
617
582
  * @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
@@ -647,7 +612,7 @@ export default class Renderable extends Rect {
647
612
  * `onCollision` only when its every-frame, return-false, fixed-`a`/`b`
648
613
  * semantics are what you want.
649
614
  *
650
- * @param {import("../physics/adapter.ts").CollisionResponse} response - the collision response object
615
+ * @param {import("../physics/response.js").default} response - the SAT response object; the legacy handler receives this, not the adapter's `CollisionResponse`, which is why `normal` and `depth` are absent from the table above
651
616
  * @param {Renderable} other - the other renderable touching this one (a reference to response.a or response.b)
652
617
  * @returns {boolean} true if the object should respond to the collision (its position and velocity will be corrected); the return value is only honored by the builtin SAT adapter.
653
618
  * @example
@@ -661,18 +626,14 @@ export default class Renderable extends Rect {
661
626
  * return true;
662
627
  * }
663
628
  */
664
- onCollision(_response: any, _other: any): boolean;
665
- /**
666
- * Destroy function<br>
667
- * @ignore
668
- */
669
- destroy(...args: any[]): void;
629
+ onCollision(response: import("../physics/response.js").default, other: Renderable): boolean;
670
630
  /**
671
631
  * OnDestroy Notification function<br>
672
- * Called by engine before deleting the object. `Stage.destroy(app)`
673
- * forwards the active Application, so subclasses that wire teardown
674
- * against the app object can override as `onDestroyEvent(app)`.
675
- * @param {...*} _args - forwarded by `destroy(...args)`; Stage passes the Application instance
632
+ * Called by engine before deleting the object. Receives whatever
633
+ * `destroy(...args)` was called with — the production path
634
+ * (`Container.removeChildNow`) passes nothing. {@link Stage} has its own
635
+ * `onDestroyEvent`, which does forward the active Application.
636
+ * @param {...*} _args - forwarded by `destroy(...args)`; normally empty
676
637
  */
677
638
  onDestroyEvent(..._args: any[]): void;
678
639
  /**
@@ -681,7 +642,8 @@ export default class Renderable extends Rect {
681
642
  * Override to wire up input handlers, register external listeners,
682
643
  * or grab adapter references — `this.parentApp` is guaranteed to be
683
644
  * available here. Pair with {@link Renderable#onDeactivateEvent}.
684
- * @param {...*} _args - forwarded by `Container.addChild`
645
+ * @param {...*} _args - the rest parameter exists for subclass-signature
646
+ * compatibility; `Container.addChild` currently forwards nothing
685
647
  */
686
648
  onActivateEvent(..._args: any[]): void;
687
649
  /**
@@ -689,7 +651,8 @@ export default class Renderable extends Rect {
689
651
  * removed from its container or its container is itself removed.
690
652
  * Override to release input handlers, unsubscribe from events, or
691
653
  * drop adapter references. Pair with {@link Renderable#onActivateEvent}.
692
- * @param {...*} _args - forwarded by `Container.removeChildNow`
654
+ * @param {...*} _args - the rest parameter exists for subclass-signature
655
+ * compatibility; `Container.removeChildNow` currently forwards nothing
693
656
  */
694
657
  onDeactivateEvent(..._args: any[]): void;
695
658
  }
@@ -1 +1 @@
1
-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