melonjs 20.6.0 → 20.8.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 (265) hide show
  1. package/README.md +6 -3
  2. package/build/application/defaultApplicationSettings.d.ts +5 -0
  3. package/build/application/defaultApplicationSettings.d.ts.map +1 -1
  4. package/build/application/header.d.ts.map +1 -1
  5. package/build/application/settings.d.ts +88 -0
  6. package/build/application/settings.d.ts.map +1 -1
  7. package/build/audio/backend/engine.d.ts +0 -1
  8. package/build/audio/backend/sound.d.ts +0 -1
  9. package/build/camera/camera2d.d.ts.map +1 -1
  10. package/build/camera/camera3d.d.ts +95 -8
  11. package/build/camera/camera3d.d.ts.map +1 -1
  12. package/build/geometries/box3d.d.ts +24 -6
  13. package/build/geometries/box3d.d.ts.map +1 -1
  14. package/build/geometries/ellipse.d.ts +14 -0
  15. package/build/geometries/ellipse.d.ts.map +1 -1
  16. package/build/geometries/polygon.d.ts +14 -0
  17. package/build/geometries/polygon.d.ts.map +1 -1
  18. package/build/geometries/sphere.d.ts +35 -6
  19. package/build/geometries/sphere.d.ts.map +1 -1
  20. package/build/index.d.ts +10 -3
  21. package/build/index.d.ts.map +1 -1
  22. package/build/index.js +23361 -20195
  23. package/build/index.js.map +4 -4
  24. package/build/input/pointerevent.d.ts +8 -0
  25. package/build/input/pointerevent.d.ts.map +1 -1
  26. package/build/lang/deprecated.d.ts.map +1 -1
  27. package/build/level/gltf/GLTFModel.d.ts +17 -31
  28. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  29. package/build/level/gltf/GLTFScene.d.ts +40 -1
  30. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  31. package/build/level/level.d.ts +36 -0
  32. package/build/level/level.d.ts.map +1 -1
  33. package/build/level/tiled/TMXLayer.d.ts +5 -2
  34. package/build/level/tiled/TMXLayer.d.ts.map +1 -1
  35. package/build/level/tiled/TMXObject.d.ts +0 -1
  36. package/build/level/tiled/TMXTile.d.ts +2 -1
  37. package/build/level/tiled/TMXTile.d.ts.map +1 -1
  38. package/build/level/tiled/TMXTileMap.d.ts +7 -4
  39. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  40. package/build/level/tiled/TMXTileset.d.ts +1 -1
  41. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  42. package/build/level/tiled/TMXTilesetGroup.d.ts +5 -0
  43. package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
  44. package/build/level/tiled/factories/shape.d.ts +0 -1
  45. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +6 -5
  46. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
  47. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +5 -0
  48. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
  49. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +8 -7
  50. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  51. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +5 -0
  52. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
  53. package/build/level/tiled/renderer/TMXRenderer.d.ts +19 -4
  54. package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
  55. package/build/level/tiled/renderer/autodetect.d.ts +0 -4
  56. package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
  57. package/build/lighting/light2d.d.ts +68 -2
  58. package/build/lighting/light2d.d.ts.map +1 -1
  59. package/build/lighting/light3d.d.ts.map +1 -1
  60. package/build/loader/loader.d.ts +63 -0
  61. package/build/loader/loader.d.ts.map +1 -1
  62. package/build/loader/loadingscreen.d.ts +1 -2
  63. package/build/loader/loadingscreen.d.ts.map +1 -1
  64. package/build/loader/parsers/fontface.d.ts +2 -0
  65. package/build/loader/parsers/fontface.d.ts.map +1 -1
  66. package/build/loader/parsers/mtl.d.ts.map +1 -1
  67. package/build/loader/parsers/shader.d.ts +0 -2
  68. package/build/math/color.d.ts +27 -4
  69. package/build/math/color.d.ts.map +1 -1
  70. package/build/particles/emitter.d.ts.map +1 -1
  71. package/build/particles/particle.d.ts +22 -1
  72. package/build/particles/particle.d.ts.map +1 -1
  73. package/build/particles/settings.d.ts +69 -0
  74. package/build/particles/settings.d.ts.map +1 -1
  75. package/build/physics/adapter.d.ts +152 -3
  76. package/build/physics/adapter.d.ts.map +1 -1
  77. package/build/physics/builtin/body.d.ts +9 -18
  78. package/build/physics/builtin/body.d.ts.map +1 -1
  79. package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
  80. package/build/physics/builtin/detector.d.ts +0 -1
  81. package/build/physics/builtin/detector.d.ts.map +1 -1
  82. package/build/physics/builtin/sat.d.ts +0 -7
  83. package/build/physics/builtin/sat.d.ts.map +1 -1
  84. package/build/physics/builtin/sat3d.d.ts +46 -0
  85. package/build/physics/builtin/sat3d.d.ts.map +1 -1
  86. package/build/physics/physicseditor.d.ts +2 -0
  87. package/build/physics/physicseditor.d.ts.map +1 -0
  88. package/build/physics/response.d.ts +45 -62
  89. package/build/physics/response.d.ts.map +1 -1
  90. package/build/renderable/collectable.d.ts +6 -1
  91. package/build/renderable/collectable.d.ts.map +1 -1
  92. package/build/renderable/colorlayer.d.ts +4 -4
  93. package/build/renderable/colorlayer.d.ts.map +1 -1
  94. package/build/renderable/container.d.ts +23 -17
  95. package/build/renderable/container.d.ts.map +1 -1
  96. package/build/renderable/entity/entity.d.ts +14 -16
  97. package/build/renderable/entity/entity.d.ts.map +1 -1
  98. package/build/renderable/frameAnimation.d.ts +1 -1
  99. package/build/renderable/groundshadow.d.ts +1 -0
  100. package/build/renderable/groundshadow.d.ts.map +1 -1
  101. package/build/renderable/imagelayer.d.ts +12 -5
  102. package/build/renderable/imagelayer.d.ts.map +1 -1
  103. package/build/renderable/instanced_mesh.d.ts +2 -9
  104. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  105. package/build/renderable/mesh.d.ts +306 -5
  106. package/build/renderable/mesh.d.ts.map +1 -1
  107. package/build/renderable/nineslicesprite.d.ts +3 -13
  108. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  109. package/build/renderable/renderable.d.ts +129 -28
  110. package/build/renderable/renderable.d.ts.map +1 -1
  111. package/build/renderable/sprite.d.ts +77 -19
  112. package/build/renderable/sprite.d.ts.map +1 -1
  113. package/build/renderable/sprite3d.d.ts +27 -16
  114. package/build/renderable/sprite3d.d.ts.map +1 -1
  115. package/build/renderable/text/bitmaptext.d.ts +13 -3
  116. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  117. package/build/renderable/text/bitmaptextdata.d.ts +0 -4
  118. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  119. package/build/renderable/text/text.d.ts +5 -3
  120. package/build/renderable/text/text.d.ts.map +1 -1
  121. package/build/renderable/text/textmetrics.d.ts +2 -0
  122. package/build/renderable/text/textmetrics.d.ts.map +1 -1
  123. package/build/renderable/trail.d.ts +0 -1
  124. package/build/renderable/trail.d.ts.map +1 -1
  125. package/build/renderable/trigger.d.ts +39 -14
  126. package/build/renderable/trigger.d.ts.map +1 -1
  127. package/build/renderable/ui/progressbar.d.ts +194 -0
  128. package/build/renderable/ui/progressbar.d.ts.map +1 -0
  129. package/build/renderable/ui/uibaseelement.d.ts +48 -3
  130. package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
  131. package/build/renderable/ui/uispriteelement.d.ts +19 -3
  132. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  133. package/build/state/stage.d.ts +22 -0
  134. package/build/state/stage.d.ts.map +1 -1
  135. package/build/system/legacy_pool.d.ts +2 -2
  136. package/build/system/legacy_pool.d.ts.map +1 -1
  137. package/build/system/pool.d.ts +10 -0
  138. package/build/system/pool.d.ts.map +1 -1
  139. package/build/tweens/tween.d.ts +49 -2
  140. package/build/tweens/tween.d.ts.map +1 -1
  141. package/build/video/buffer/vertex.d.ts.map +1 -1
  142. package/build/video/canvas/canvas_renderer.d.ts +34 -23
  143. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  144. package/build/video/effects/blendEffect.d.ts +0 -1
  145. package/build/video/effects/bloom.d.ts +72 -0
  146. package/build/video/effects/bloom.d.ts.map +1 -0
  147. package/build/video/effects/blur.d.ts +3 -2
  148. package/build/video/effects/blur.d.ts.map +1 -1
  149. package/build/video/effects/chromaticAberration.d.ts +3 -2
  150. package/build/video/effects/chromaticAberration.d.ts.map +1 -1
  151. package/build/video/effects/colorMatrix.d.ts +3 -2
  152. package/build/video/effects/colorMatrix.d.ts.map +1 -1
  153. package/build/video/effects/desaturate.d.ts +10 -2
  154. package/build/video/effects/desaturate.d.ts.map +1 -1
  155. package/build/video/effects/dissolve.d.ts +3 -2
  156. package/build/video/effects/dissolve.d.ts.map +1 -1
  157. package/build/video/effects/dropShadow.d.ts +3 -2
  158. package/build/video/effects/dropShadow.d.ts.map +1 -1
  159. package/build/video/effects/flash.d.ts +3 -2
  160. package/build/video/effects/flash.d.ts.map +1 -1
  161. package/build/video/effects/glow.d.ts +3 -2
  162. package/build/video/effects/glow.d.ts.map +1 -1
  163. package/build/video/effects/hologram.d.ts +3 -2
  164. package/build/video/effects/hologram.d.ts.map +1 -1
  165. package/build/video/effects/invert.d.ts +10 -2
  166. package/build/video/effects/invert.d.ts.map +1 -1
  167. package/build/video/effects/outline.d.ts +3 -2
  168. package/build/video/effects/outline.d.ts.map +1 -1
  169. package/build/video/effects/pixelate.d.ts +3 -2
  170. package/build/video/effects/pixelate.d.ts.map +1 -1
  171. package/build/video/effects/radialGradient.d.ts +8 -3
  172. package/build/video/effects/radialGradient.d.ts.map +1 -1
  173. package/build/video/effects/scanline.d.ts +3 -2
  174. package/build/video/effects/scanline.d.ts.map +1 -1
  175. package/build/video/effects/sepia.d.ts +10 -2
  176. package/build/video/effects/sepia.d.ts.map +1 -1
  177. package/build/video/effects/shadereffect.d.ts +10 -4
  178. package/build/video/effects/shadereffect.d.ts.map +1 -1
  179. package/build/video/effects/shine.d.ts +3 -2
  180. package/build/video/effects/shine.d.ts.map +1 -1
  181. package/build/video/effects/tintPulse.d.ts +3 -2
  182. package/build/video/effects/tintPulse.d.ts.map +1 -1
  183. package/build/video/effects/tonemap.d.ts +121 -0
  184. package/build/video/effects/tonemap.d.ts.map +1 -0
  185. package/build/video/effects/vignette.d.ts +3 -2
  186. package/build/video/effects/vignette.d.ts.map +1 -1
  187. package/build/video/effects/wave.d.ts +3 -2
  188. package/build/video/effects/wave.d.ts.map +1 -1
  189. package/build/video/gpu/meshmaterial.d.ts +2 -0
  190. package/build/video/gpu/meshmaterial.d.ts.map +1 -0
  191. package/build/video/gpu/vertexformat.d.ts +26 -0
  192. package/build/video/gpu/vertexformat.d.ts.map +1 -1
  193. package/build/video/gradient.d.ts +0 -1
  194. package/build/video/gradient.d.ts.map +1 -1
  195. package/build/video/renderer.d.ts +111 -7
  196. package/build/video/renderer.d.ts.map +1 -1
  197. package/build/video/renderstate.d.ts +2 -0
  198. package/build/video/renderstate.d.ts.map +1 -1
  199. package/build/video/rendertarget/canvasrendertarget.d.ts +3 -4
  200. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  201. package/build/video/rendertarget/render_target_pool.d.ts +0 -1
  202. package/build/video/rendertarget/webglrendertarget.d.ts +0 -1
  203. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  204. package/build/video/rendertarget/webgpurendertarget.d.ts +18 -2
  205. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  206. package/build/video/texture/atlas.d.ts +1 -0
  207. package/build/video/texture/atlas.d.ts.map +1 -1
  208. package/build/video/texture/cache.d.ts +1 -3
  209. package/build/video/texture/frametexture.d.ts +0 -1
  210. package/build/video/texture/frametexture.d.ts.map +1 -1
  211. package/build/video/texture/noise_texture2d.d.ts +1 -0
  212. package/build/video/texture/noise_texture2d.d.ts.map +1 -1
  213. package/build/video/utils/autodetect.d.ts +0 -2
  214. package/build/video/webgl/batchers/batcher.d.ts +0 -9
  215. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  216. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +13 -1
  217. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  218. package/build/video/webgl/batchers/material_batcher.d.ts +4 -2
  219. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  220. package/build/video/webgl/batchers/mesh_batcher.d.ts +2 -3
  221. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  222. package/build/video/webgl/batchers/quad_batcher.d.ts +4 -0
  223. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  224. package/build/video/webgl/buffer/index.d.ts +0 -1
  225. package/build/video/webgl/buffer/retained_geometry.d.ts +0 -1
  226. package/build/video/webgl/glshader.d.ts +5 -3
  227. package/build/video/webgl/glshader.d.ts.map +1 -1
  228. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +0 -4
  229. package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
  230. package/build/video/webgl/texture/store.d.ts +0 -1
  231. package/build/video/webgl/webgl_renderer.d.ts +63 -24
  232. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  233. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +17 -0
  234. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
  235. package/build/video/webgpu/batchers/mesh_batcher.d.ts +0 -3
  236. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
  237. package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -2
  238. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
  239. package/build/video/webgpu/batchers/webgpu_batcher.d.ts +0 -2
  240. package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -1
  241. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
  242. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +0 -2
  243. package/build/video/webgpu/texture/frametexture.d.ts +0 -2
  244. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
  245. package/build/video/webgpu/texture/store.d.ts +0 -1
  246. package/build/video/webgpu/texture/store.d.ts.map +1 -1
  247. package/build/video/webgpu/webgpu_renderer.d.ts +8 -75
  248. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
  249. package/package.json +1 -1
  250. package/skills/melonjs-3d/SKILL.md +293 -19
  251. package/skills/melonjs-3d-assets/SKILL.md +123 -13
  252. package/skills/melonjs-camera-and-drawing/SKILL.md +57 -1
  253. package/skills/melonjs-effects-and-shaders/SKILL.md +341 -29
  254. package/skills/melonjs-input/SKILL.md +48 -4
  255. package/skills/melonjs-lighting/SKILL.md +45 -1
  256. package/skills/melonjs-loading-assets/SKILL.md +1 -1
  257. package/skills/melonjs-particles-and-trails/SKILL.md +106 -4
  258. package/skills/melonjs-performance/SKILL.md +79 -2
  259. package/skills/melonjs-physics/SKILL.md +420 -29
  260. package/skills/melonjs-renderables/SKILL.md +15 -1
  261. package/skills/melonjs-scenes-and-state/SKILL.md +121 -1
  262. package/skills/melonjs-tilemaps/SKILL.md +9 -0
  263. package/skills/melonjs-ui-and-text/SKILL.md +165 -4
  264. package/build/level/gltf/srgb.d.ts +0 -20
  265. package/build/level/gltf/srgb.d.ts.map +0 -1
@@ -167,6 +167,23 @@ export default class Mesh extends Renderable {
167
167
  * @type {TextureAtlas|undefined}
168
168
  */
169
169
  alphaMap: TextureAtlas | undefined;
170
+ /**
171
+ * Tangent-space normal map (MTL `map_bump` / `bump` / `norm`), or
172
+ * `undefined`. Perturbs the interpolated vertex normal per fragment,
173
+ * so a flat face can carry surface detail — rivets, grain, panel
174
+ * seams — that the geometry does not have.
175
+ *
176
+ * The tangent frame is derived per fragment from the screen-space
177
+ * derivatives of position and UV rather than from an authored tangent
178
+ * attribute, so a normal map costs no change to the vertex format and
179
+ * works on any mesh that already has UVs. The trade is accuracy under
180
+ * extreme UV distortion, which low-poly props do not have.
181
+ *
182
+ * Only meaningful on a `lit` mesh: with no lights there is no shading
183
+ * term for a perturbed normal to change. GPU mesh path only.
184
+ * @type {TextureAtlas|undefined}
185
+ */
186
+ normalMap: TextureAtlas | undefined;
170
187
  /**
171
188
  * Cast a soft dark ellipse — a "blob" shadow — on the ground beneath
172
189
  * this mesh (#1515).
@@ -288,6 +305,45 @@ export default class Mesh extends Renderable {
288
305
  * });
289
306
  */
290
307
  transparent: boolean | undefined;
308
+ /**
309
+ * Whether geometry in front of this mesh hides it.
310
+ *
311
+ * Depth TEST, not depth WRITE. The two are different questions and the
312
+ * engine answers them in different places: writing is policy, and the
313
+ * transparent pass already turns it off for everything blended so
314
+ * overlapping draws blend instead of fighting. Testing is an authoring
315
+ * choice, and this is it.
316
+ *
317
+ * `false` is for something with no surface to be occluded ON. An
318
+ * additive glow is the case that forced it: it is a screen-space
319
+ * effect wearing a mesh's clothes, carrying a world position only so
320
+ * it can sort and move with the thing it belongs to. Left depth
321
+ * tested, a flat billboard is sliced along a straight line the moment
322
+ * any geometry is nearer at some pixel — most visibly where a glowing
323
+ * object passes near the limb of something round.
324
+ *
325
+ * Leave it `true` for anything that is genuinely in the scene. A
326
+ * muzzle flash behind a wall should still be behind the wall; this is
327
+ * not a synonym for "additive".
328
+ *
329
+ * Honoured in the transparent pass, so a mesh wanting it also wants
330
+ * {@link Mesh#transparent}. The Canvas renderer has no depth buffer
331
+ * and ignores it.
332
+ * @type {boolean}
333
+ * @default true
334
+ * @example
335
+ * // a glow that belongs to the rock, but is never cut by the planet
336
+ * const halo = new Sprite3d(0, 0, {
337
+ * image: glowTexture,
338
+ * width: 64, height: 64,
339
+ * billboard: "spherical",
340
+ * blendMode: "additive",
341
+ * transparent: true,
342
+ * alphaCutoff: 0,
343
+ * depthTest: false,
344
+ * });
345
+ */
346
+ depthTest: boolean;
291
347
  /**
292
348
  * World Y of the floor the shadow lands on, or `undefined` (the
293
349
  * default) to mean "this object is standing on the ground" — the
@@ -304,6 +360,13 @@ export default class Mesh extends Renderable {
304
360
  * object above it.
305
361
  * @type {number|undefined}
306
362
  * @default undefined
363
+ * @example
364
+ * // a collectible bobbing above the floor: naming the floor is what
365
+ * // lets the blob shrink and fade as it rises. Left unset the blob
366
+ * // rides the object's own base and never leaves it.
367
+ * const coin = new Mesh(x, floorY, { ...geometry, castGroundShadow: true });
368
+ * coin.shadowGroundY = floorY;
369
+ * coin.pos.y = floorY - 40 - 30 * Math.sin(t);
307
370
  */
308
371
  shadowGroundY: number | undefined;
309
372
  /**
@@ -313,6 +376,148 @@ export default class Mesh extends Renderable {
313
376
  * @default 0.45
314
377
  */
315
378
  shadowOpacity: number;
379
+ /**
380
+ * Multiplier for the ground shadow's footprint, independent of the
381
+ * object's size, ground height and opacity. Values above `1` can reveal
382
+ * the blob beneath a wide prop; values below `1` tighten it.
383
+ * Non-positive or non-finite values hide the shadow. Can be changed live
384
+ * on an {@link InstancedMesh} too: the set's shared quad is rewritten in
385
+ * place rather than rebuilt, so animating it allocates nothing.
386
+ * @type {number}
387
+ * @default 1
388
+ * @example
389
+ * // a crate's own blob hides underneath it, so widen it until the edge
390
+ * // shows; `0` and below hide the shadow and leave the mesh drawn
391
+ * crate.shadowScale = 1.6;
392
+ */
393
+ shadowScale: number;
394
+ /**
395
+ * How far to slide the ground shadow along
396
+ * {@link Mesh#shadowDirectionX}/{@link Mesh#shadowDirectionZ}, in
397
+ * multiples of the blob's OWN radius, which is what gives the look of
398
+ * a light that is not directly overhead.
399
+ *
400
+ * A ratio rather than a world distance. The distance that reads right
401
+ * is the one that shifts a stretched ellipse far enough for its
402
+ * trailing edge to stay at the caster's feet, which is about
403
+ * `stretch - 1` of its radius, so a world distance has to be retuned
404
+ * for every size of thing and cannot serve the parts of one glTF model
405
+ * at all. {@link Mesh#shadowScale} rides in that radius, so widening
406
+ * the blob carries the offset with it.
407
+ *
408
+ * Honoured ONLY when {@link Mesh#shadowGroundY} is set. The blob is a
409
+ * flat quad on one named plane with no contact with terrain, so sliding
410
+ * it across a plane the game has not named puts it somewhere there may
411
+ * be no floor at all. Setting `shadowGroundY` is the game saying where
412
+ * its floor is, and that is the only case where an offset is honest.
413
+ *
414
+ * An {@link InstancedMesh} honours it too, as one throw shared by the
415
+ * whole set, measured in the SET's own blob radius.
416
+ * @type {number}
417
+ * @default 0
418
+ */
419
+ shadowOffset: number;
420
+ /**
421
+ * How much longer the ground shadow is along its direction, for the
422
+ * look of a low light. `1` leaves it round.
423
+ *
424
+ * Clamped to 3, and the blob fades as it stretches: this is art
425
+ * direction, not a projection, and the further it is pulled the less
426
+ * there is to believe. Values below `1` are treated as `1`; shortening
427
+ * the blob is what {@link Mesh#shadowScale} is for.
428
+ *
429
+ * An {@link InstancedMesh} honours it too: one stretch along one
430
+ * direction for the whole set, baked into the quad its blobs share
431
+ * rather than into the matrix that also places them.
432
+ * @type {number}
433
+ * @default 1
434
+ */
435
+ shadowStretch: number;
436
+ /**
437
+ * X of the ground direction the shadow is cast along.
438
+ * @type {number}
439
+ * @default 0
440
+ * @see Mesh#shadowOffset
441
+ */
442
+ shadowDirectionX: number;
443
+ /**
444
+ * Z of the ground direction the shadow is cast along. Together with
445
+ * {@link Mesh#shadowDirectionX}, a zero-length pair means no offset and
446
+ * no stretch.
447
+ * @type {number}
448
+ * @default 0
449
+ * @see Mesh#shadowOffset
450
+ */
451
+ shadowDirectionZ: number;
452
+ /**
453
+ * A {@link Light3d} to take the shadow direction from, instead of
454
+ * setting it by hand.
455
+ *
456
+ * Read every draw, so a sun that moves carries the shadow with it.
457
+ * NOTHING is inferred: the engine never picks a dominant light for you,
458
+ * because a scene with several has no non-arbitrary answer and one with
459
+ * none has no answer at all. Name the light or get no direction.
460
+ * @type {Light3d|undefined}
461
+ * @example
462
+ * // one sun, every shadow in the scene following it. Read every draw,
463
+ * // so a day/night cycle needs nothing else.
464
+ * const sun = new Light3d({ direction: [0.4, 1, 0.2] });
465
+ * app.world.addChild(sun);
466
+ * for (const prop of props) {
467
+ * prop.castGroundShadow = true;
468
+ * prop.shadowGroundY = floorY;
469
+ * prop.shadowLight = sun; // instead of shadowDirectionX / Z
470
+ * prop.shadowOffset = 0.8; // slid out from its feet, in blob radii
471
+ * prop.shadowStretch = 2; // and pulled long, for a low sun
472
+ * }
473
+ * // later: turning the sun turns every blob with it
474
+ * sun.direction.set(Math.sin(t), 1, Math.cos(t)).normalize();
475
+ */
476
+ shadowLight: Light3d | undefined;
477
+ /**
478
+ * Takes an array or a `Vector3d` and keeps a normalized copy of its own,
479
+ * so a game that goes on mutating what it passed does not steer this
480
+ * mesh's shadow by accident. `undefined` puts the blob back level.
481
+ * @param {number[]|Vector3d|undefined} value - the floor's up normal
482
+ * @example
483
+ * // a prop standing on a 20 degree hillside: `shadowGroundY` says where
484
+ * // the floor is, this says which way it faces. World up is (0, -1, 0),
485
+ * // because render space is Y-down.
486
+ * prop.shadowGroundY = groundAt(prop.pos.x);
487
+ * prop.shadowGroundNormal = [Math.sin(0.35), -Math.cos(0.35), 0];
488
+ */
489
+ set shadowGroundNormal(value: number[] | Vector3d | undefined);
490
+ /**
491
+ * The UP normal of the floor this object's shadow lands on, for a
492
+ * surface that is not level.
493
+ *
494
+ * {@link Mesh#shadowGroundY} says where the floor is and this says
495
+ * which way it faces, so it is honoured only alongside it: tilting the
496
+ * fallback plane, which is the caster's own bounds, has no anchor to
497
+ * tilt about. Defaults to world up, which is `(0, -1, 0)` because
498
+ * render space is Y-down, and that default reproduces a level blob
499
+ * exactly.
500
+ *
501
+ * The blob is ROTATED onto the plane, not projected, so it keeps its
502
+ * shape; it still sits directly under the caster rather than sliding
503
+ * along the slope, and it is still a flat quad with no contact with
504
+ * what it lies on. The tilt is clamped at 75 degrees, past which an
505
+ * edge-on blob has nothing left to show.
506
+ *
507
+ * On an {@link InstancedMesh} the plane serves the WHOLE set: it passes
508
+ * through the set's origin at `shadowGroundY` and faces this way, and
509
+ * every blob is projected onto it whatever height its own instance sits
510
+ * at, exactly as the level case puts every blob at one height. A scatter
511
+ * spread over curved ground is therefore one set per flat facet, each
512
+ * with the facet's own plane, not one set with an averaged normal.
513
+ * @type {Vector3d|undefined}
514
+ * @default undefined
515
+ * @example
516
+ * // a prop resting on a 20 degree slope that falls away along +x
517
+ * prop.shadowGroundY = floorY;
518
+ * prop.shadowGroundNormal = [Math.sin(0.35), -Math.cos(0.35), 0];
519
+ */
520
+ get shadowGroundNormal(): Vector3d | undefined;
316
521
  /**
317
522
  * whether to cull back-facing triangles
318
523
  * @type {boolean}
@@ -411,12 +616,13 @@ export default class Mesh extends Renderable {
411
616
  * The Canvas renderer ignores this: a multi-material mesh takes its
412
617
  * per-triangle solid-fill path there and never samples a texture at
413
618
  * all.
414
- * @type {Array<{texture: TextureAtlas, start: number, count: number}>|undefined}
619
+ * @type {Array<{texture: TextureAtlas, start: number, count: number, normalMap: TextureAtlas|undefined}>|undefined}
415
620
  */
416
621
  textureGroups: Array<{
417
622
  texture: TextureAtlas;
418
623
  start: number;
419
624
  count: number;
625
+ normalMap: TextureAtlas | undefined;
420
626
  }> | undefined;
421
627
  /**
422
628
  * Per-mesh texture wrap mode (`"repeat"` / `"repeat-x"` / `"repeat-y"`
@@ -484,6 +690,29 @@ export default class Mesh extends Renderable {
484
690
  * }
485
691
  */
486
692
  setVertexColor(index: number, color: Color): void;
693
+ set shader(value: GLShader | undefined);
694
+ /**
695
+ * A custom shader hosted on this mesh's draw, replacing the built-in
696
+ * mesh shading: a {@link GLShader} carrying a `{vertex, fragment}`
697
+ * GLSL program (hosted by the WebGL renderer) and/or a complete
698
+ * `wgsl` module (hosted by the WebGPU renderer — see the GLShader
699
+ * class docs for the module contract). One object serves both
700
+ * backends; a shader without a realization for the active backend
701
+ * (or `null`) degrades to the built-in shading. The tint, texture,
702
+ * placement and (for `lit` meshes) light data keep flowing through
703
+ * their usual uniforms — the custom shader decides what to do with
704
+ * them.
705
+ * @type {GLShader|undefined}
706
+ * @example
707
+ * me.loader.preload([{ name: "toon", type: "shader", src: {
708
+ * vertex: "shaders/toon.vert", // GLSL pair for WebGL
709
+ * fragment: "shaders/toon.frag",
710
+ * wgsl: "shaders/toon.wgsl", // complete module for WebGPU
711
+ * }}], () => {
712
+ * myMesh.addPostEffect(me.loader.getShader("toon"));
713
+ * });
714
+ */
715
+ get shader(): GLShader | undefined;
487
716
  /**
488
717
  * The mesh's world-space 3D axis-aligned bounding box. This is the 3D analog
489
718
  * of {@link Renderable#getBounds} (which returns a flat 2D box from
@@ -499,6 +728,41 @@ export default class Mesh extends Renderable {
499
728
  * @returns {AABB3d} the world-space bounding box (reused instance)
500
729
  */
501
730
  getBounds3d(): AABB3d;
731
+ /**
732
+ * Draw the mesh (automatically called by melonJS). Picks between two
733
+ * projection paths based on the camera that was active when this mesh
734
+ * was added to the world (captured in {@link Mesh#onActivateEvent}):
735
+ *
736
+ * - **Camera3d** → world-space output via {@link Mesh#_projectVerticesWorld}.
737
+ * Vertices land in world coordinates at `(pos.x, pos.y, depth)`; the
738
+ * camera's perspective handles the final projection per-frame on the
739
+ * GPU. Triangle winding is reversed once at first draw so back-face
740
+ * culling stays correct under the Y-flip.
741
+ * - **Camera2d** (or no camera) → legacy self-projection via
742
+ * {@link Mesh#projectionMatrix} × {@link Renderable#currentTransform},
743
+ * emitting vertices in pixel-ish space directly. Backwards-compatible
744
+ * with single-mesh-in-a-2D-scene usage.
745
+ *
746
+ * Multi-material meshes need no extra `drawMesh` calls per material vs
747
+ * single-material — each material's diffuse color is baked into
748
+ * `vertexColors` at construction time and pushed through the renderer's
749
+ * per-vertex `aColor` (GPU backends) or per-triangle solid-fill (Canvas)
750
+ * path. The GPU batchers may still chunk very large meshes across multiple
751
+ * `drawElements` calls to fit its vertex/index buffer limits, and split the
752
+ * draw once per entry in {@link Mesh#textureGroups} when the materials
753
+ * carry different diffuse textures (#1573).
754
+ *
755
+ * The active path is picked from the `viewport` passed in by
756
+ * `Container.draw`, NOT from the activation-time `_useWorldSpace`
757
+ * flag. The flag is kept as a fallback only for callers that
758
+ * invoke `draw(renderer)` without a viewport (tests, batched
759
+ * builds). Without the per-draw read, a stage with multiple
760
+ * cameras (Camera3d main + Camera2d minimap, say) would run the
761
+ * wrong projection on whichever camera didn't match activation.
762
+ * @param {Renderer} renderer - a renderer instance
763
+ * @param {Camera2d} [viewport] - the camera rendering this frame
764
+ */
765
+ draw(renderer: Renderer, viewport?: Camera2d): void;
502
766
  /**
503
767
  * Render the mesh at its current state (transforms, projection, tint) to an offscreen canvas.
504
768
  * The returned canvas can be used with `renderer.drawImage()`, as a `Sprite` image source,
@@ -558,7 +822,7 @@ export type MeshSettings = {
558
822
  /**
559
823
  * - display width in pixels. With normalization on (the default) the model is scaled to fit this size; with `normalize: false` this is the uniform pixels-per-unit scale applied to the raw geometry. With `normalize: false` and an explicit `scale`, an omitted `width`/`height` is derived from the GEOMETRY's own extent, the way a Sprite takes its size from its frame — a mesh that reports no extent misleads frustum culling, pointer picking and the physics broadphase alike.
560
824
  */
561
- width: number;
825
+ width?: number;
562
826
  /**
563
827
  * - display height in pixels (normalized models only; ignored when `normalize: false`)
564
828
  */
@@ -615,6 +879,10 @@ export type MeshSettings = {
615
879
  * - specular exponent for the lit path (MTL `Ns`). `0` for a fully diffuse surface.
616
880
  */
617
881
  shininess?: number;
882
+ /**
883
+ * - tangent-space normal map (MTL `map_bump`/`bump`/`norm`), perturbing the lit path's shading normal per fragment. Needs `lit` to have any effect, and a `Camera3d`. See the [Material Textures example](https://melonjs.github.io/melonJS/examples/#/material-textures).
884
+ */
885
+ normalMap?: string | TextureAtlas | HTMLImageElement;
618
886
  /**
619
887
  * - per-texel opacity map, sampled in addition to the diffuse texture (MTL `map_d`).
620
888
  */
@@ -627,6 +895,10 @@ export type MeshSettings = {
627
895
  * - 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
628
896
  */
629
897
  transparent?: boolean;
898
+ /**
899
+ * - whether geometry in front of this mesh hides it. `false` draws it over whatever is already there, for a glow or an overlay that has no surface to be occluded ON. Separate from the depth WRITE the transparent pass turns off on its own. Transparent pass only, GPU backends only
900
+ */
901
+ depthTest?: boolean;
630
902
  /**
631
903
  * - set `false` to exempt this mesh from the camera's distance fog ({@link Camera3d#setFog}); omit to fog whenever the camera does
632
904
  */
@@ -639,14 +911,43 @@ export type MeshSettings = {
639
911
  * - opacity of the shadow directly beneath the object, before any height fade.
640
912
  */
641
913
  shadowOpacity?: number;
914
+ /**
915
+ * - multiplier for the ground shadow's footprint. Non-positive or non-finite values hide the shadow without hiding the mesh.
916
+ */
917
+ shadowScale?: number;
918
+ /**
919
+ * - how far to slide the shadow along `shadowDirectionX`/`shadowDirectionZ`, in multiples of the blob's own radius, for the look of a light that is not directly overhead. A ratio rather than a world distance so one value serves casters of any size. Honoured only when `shadowGroundY` is set, since the blob is a flat quad and sliding it off a plane the game has NOT named puts it somewhere there is no floor. On an `InstancedMesh` it is one throw for the whole set.
920
+ */
921
+ shadowOffset?: number;
922
+ /**
923
+ * - how much longer the blob is along `shadowDirectionX`/`shadowDirectionZ`, for the look of a low light. Clamped to 3, and the shadow fades as it stretches. On an `InstancedMesh` it is one stretch for the whole set.
924
+ */
925
+ shadowStretch?: number;
926
+ /**
927
+ * - x of the ground direction the shadow is cast along. Together with `shadowDirectionZ`, zero length means no offset and no stretch.
928
+ */
929
+ shadowDirectionX?: number;
930
+ /**
931
+ * - z of the ground direction the shadow is cast along.
932
+ */
933
+ shadowDirectionZ?: number;
934
+ /**
935
+ * - the UP normal of the floor the shadow lands on, for a surface that is not level. Needs `shadowGroundY`, which says where that floor is; this says which way it faces. Defaults to world up, and the tilt is clamped at 75 degrees. On an `InstancedMesh` one plane serves the whole set, through the set's origin at `shadowGroundY`, so a scatter over curved ground is one set per facet.
936
+ */
937
+ shadowGroundNormal?: number[] | Vector3d;
938
+ /**
939
+ * - a {@link Light3d} to take the direction from instead of setting it by hand. Read every draw, so a moving sun carries the shadow with it. Nothing is inferred from the scene: no light here means no direction.
940
+ */
941
+ shadowLight?: Light3d;
642
942
  };
643
943
  import Renderable from "./renderable.js";
644
944
  import { TextureAtlas } from "./../video/texture/atlas.js";
945
+ import { Vector3d } from "../math/vector3d.ts";
645
946
  import { Color } from "../math/color.ts";
646
947
  import { Matrix3d } from "../math/matrix3d.ts";
647
- import { Vector2d } from "../math/vector2d.ts";
648
- import { Polygon } from "../geometries/polygon.ts";
948
+ import type GLShader from "../video/webgl/glshader.js";
649
949
  import { AABB3d } from "../physics/broadphase/aabb3d.ts";
650
- import type WebGLRenderer from "./../video/webgl/webgl_renderer.js";
950
+ import Renderer from "./../video/renderer.js";
951
+ import type Camera2d from "../camera/camera2d.ts";
651
952
  import Texture2d from "./../video/texture/texture2d.ts";
652
953
  //# sourceMappingURL=mesh.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../../src/renderable/mesh.js"],"names":[],"mappings":"AAwZA;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,eAhDW,MAAM,KACN,MAAM,YACN,YAAY,EA+0BtB;IApxBC;;;OAGG;IACH,kBAFU,YAAY,CAEkB;IAExC;;;OAGG;IACH,KAFU,YAAY,CAEA;IAqBtB;;;OAGG;IACH,aAFU,MAAM,CAEsB;IAmCvC;;;OAGG;IACH,2BAAoC;IAIpC;;;;;;;;;;;;;;OAcG;IACH,UAFU,YAAY,CAEgC;IAEtD;;;;;OAKG;IACH,iBAFU,YAAY,GAAC,SAAS,CAclB;IAEd;;;;;;;;;OASG;IACH,SAFU,YAAY,CAE+B;IAErD;;;;;;;;;OASG;IACH,KAHU,OAAO,CAGe;IAEhC;;;;;;;;;OASG;IACH,aAHU,MAAM,CAIoD;IAEpE;;;;;;;;;OASG;IACH,UAFU,YAAY,GAAC,SAAS,CAEa;IAE7C;;;;;;;;;;;;OAYG;IACH,UAHU,YAAY,GAAC,SAAS,CAGa;IAE7C;;;;;;;;OAQG;IACH,WAHU,MAAM,CAIgD;IAEhE;;;;;;;;;;OAUG;IACH,UAFU,YAAY,GAAC,SAAS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AAO,CAAC,WAAW,CAAC,CAOhC;IAED;;;;;OAKG;IACH,gBAMC;CACD;;;;;;;;;;;;YAtxEa,MAAM;;;;eACN,YAAY,GAAC,MAAM,EAAE;;;;UACrB,YAAY,GAAC,MAAM,EAAE;;;;cACrB,WAAW,GAAC,WAAW,GAAC,MAAM,EAAE;;;;cAChC,gBAAgB,GAAC,iBAAiB,GAAC,SAAS,GAAC,YAAY,GAAC,MAAM;;;;eAChE,MAAM;;;;YACN,MAAM;;;;aACN,MAAM;;;;oBACN,OAAO;;;;gBACP,OAAO;;;;YACP,MAAM;;;;kBACN,OAAO;;;;oBACP,MAAM;;;;oBACN,MAAM;;;;kBACN,MAAM;;;;eACN,MAAM,EAAE,GAAC,YAAY;;;;UACrB,OAAO;;;;mBACP,WAAW,GAAC,KAAK,EAAE,GAAC,MAAM,EAAE;;;;cAC5B,MAAM,EAAE,GAAC,YAAY;;;;eACrB,MAAM,EAAE,GAAC,YAAY;;;;gBACrB,MAAM;;;;gBACN,MAAM,GAAC,YAAY,GAAC,gBAAgB;;;;eACpC,MAAM,GAAC,YAAY,GAAC,gBAAgB;;;;uBACpC,OAAO;;;;kBACP,OAAO;;;;gBACP,OAAO;;;;UACP,OAAO;;;;oBACP,MAAM;;;;oBACN,MAAM;;;;kBACN,MAAM;;;;mBACN,MAAM;;;;oBACN,MAAM;;;;uBACN,MAAM;;;;uBACN,MAAM;;;;yBACN,MAAM,EAAE,GAAC,QAAQ;;;;;;uBAzYR,iBAAiB;6BAVX,6BAA6B;yBATjC,qBAAqB;sBAHxB,kBAAkB;yBACf,qBAAqB;yBACrB,qBAAqB;wBALtB,0BAA0B;0BAuCzB,4BAA4B;uBA1B9B,iCAAiC;+BAuB1B,oCAAoC;qBAtB7C,wBAAwB;0BAuBpB,uBAAuB;sBArB1B,iCAAiC"}
@@ -47,20 +47,8 @@ export default class NineSliceSprite extends Sprite {
47
47
  anchorPoint?: string | Vector2d | {
48
48
  x: number;
49
49
  y: number;
50
- };
50
+ } | undefined;
51
51
  });
52
- set width(value: number);
53
- /**
54
- * width of the NineSliceSprite
55
- * @type {number}
56
- */
57
- get width(): number;
58
- set height(value: number);
59
- /**
60
- * height of the NineSliceSprite
61
- * @type {number}
62
- */
63
- get height(): number;
64
52
  nss_width: number;
65
53
  nss_height: number;
66
54
  insetx: number | undefined;
@@ -68,5 +56,7 @@ export default class NineSliceSprite extends Sprite {
68
56
  }
69
57
  import Sprite from "./sprite.js";
70
58
  import type { TextureAtlas } from "./../video/texture/atlas.js";
59
+ import type { CompressedImage } from "../loader/parsers/compressed_textures/compressed_image.js";
71
60
  import type { Color } from "./../math/color.ts";
61
+ import type { Vector2d } from "../math/vector2d.ts";
72
62
  //# sourceMappingURL=nineslicesprite.d.ts.map
@@ -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;IAmD9B;;;OAGG;IACH,0BA6EC;CACD;mBA7MkB,aAAa;kCAKC,6BAA6B;2BADtC,oBAAoB"}
1
+ {"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAoBA;;;;;;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;eAAvC,MAAM;eAAG,MAAM;;KAC1C,EA8BF;IALA,kBAA2B;IAC3B,mBAA6B;IAE7B,2BAA6B;IAC7B,2BAA6B;IAmD9B;;;OAGG;IACH,0BA6EC;CACD;mBA/MkB,aAAa;kCAKC,6BAA6B;qCAC5B,2DAA2D;2BAFrE,oBAAoB;8BAGjB,qBAAqB"}