melonjs 19.9.0 → 20.0.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.
- package/README.md +25 -14
- package/build/application/application.d.ts +70 -16
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +2 -2
- package/build/application/resize.d.ts.map +1 -1
- package/build/application/settings.d.ts +150 -53
- package/build/application/settings.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +1 -1
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +13 -11
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/const.d.ts +55 -26
- package/build/const.d.ts.map +1 -1
- package/build/geometries/box3d.d.ts +156 -0
- package/build/geometries/box3d.d.ts.map +1 -0
- package/build/index.d.ts +33 -23
- package/build/index.d.ts.map +1 -1
- package/build/index.js +21696 -7831
- package/build/index.js.map +4 -4
- package/build/lang/deprecated.d.ts +4 -4
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +4 -0
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +42 -6
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/gltf/srgb.d.ts +20 -0
- package/build/level/gltf/srgb.d.ts.map +1 -0
- package/build/level/level.d.ts +21 -2
- package/build/level/level.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts +61 -13
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +49 -21
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/mtl.d.ts +18 -0
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/obj.d.ts +49 -0
- package/build/loader/parsers/obj.d.ts.map +1 -1
- package/build/loader/parsers/pbr.d.ts +63 -0
- package/build/loader/parsers/pbr.d.ts.map +1 -0
- package/build/loader/parsers/shader.d.ts +32 -24
- package/build/loader/parsers/shader.d.ts.map +1 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +3 -1
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +12 -1
- package/build/physics/adapter.d.ts.map +1 -1
- package/build/physics/broadphase/octree.d.ts +35 -0
- package/build/physics/broadphase/octree.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +123 -6
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +12 -0
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/raycast.d.ts.map +1 -1
- package/build/physics/builtin/sat3d.d.ts +59 -0
- package/build/physics/builtin/sat3d.d.ts.map +1 -0
- package/build/physics/response.d.ts +32 -0
- package/build/physics/response.d.ts.map +1 -1
- package/build/physics/world.d.ts +1 -0
- package/build/physics/world.d.ts.map +1 -1
- package/build/renderable/container.d.ts +1 -0
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/groundshadow.d.ts +92 -0
- package/build/renderable/groundshadow.d.ts.map +1 -0
- package/build/renderable/instanced_mesh.d.ts +286 -0
- package/build/renderable/instanced_mesh.d.ts.map +1 -0
- package/build/renderable/mesh.d.ts +242 -23
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +6 -4
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +3 -1
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +17 -6
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/state/stage.d.ts.map +1 -1
- package/build/system/device.d.ts +11 -40
- package/build/system/device.d.ts.map +1 -1
- package/build/system/platform.d.ts +0 -16
- package/build/system/platform.d.ts.map +1 -1
- package/build/utils/utils.d.ts +2 -0
- package/build/utils/utils.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +22 -16
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/{webgl/effects → effects}/blur.d.ts +2 -2
- package/build/video/effects/blur.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/chromaticAberration.d.ts +2 -2
- package/build/video/effects/chromaticAberration.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/colorMatrix.d.ts +3 -3
- package/build/video/effects/colorMatrix.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/desaturate.d.ts +1 -1
- package/build/video/effects/desaturate.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/dissolve.d.ts +2 -2
- package/build/video/effects/dissolve.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/dropShadow.d.ts +2 -2
- package/build/video/effects/dropShadow.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/flash.d.ts +2 -2
- package/build/video/effects/flash.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/glow.d.ts +2 -2
- package/build/video/effects/glow.d.ts.map +1 -0
- package/build/video/effects/glsl_realization.d.ts +18 -0
- package/build/video/effects/glsl_realization.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/hologram.d.ts +2 -2
- package/build/video/effects/hologram.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/invert.d.ts +1 -1
- package/build/video/effects/invert.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/outline.d.ts +2 -2
- package/build/video/effects/outline.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/pixelate.d.ts +2 -2
- package/build/video/effects/pixelate.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/radialGradient.d.ts +3 -4
- package/build/video/effects/radialGradient.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/scanline.d.ts +2 -2
- package/build/video/effects/scanline.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/sepia.d.ts +1 -1
- package/build/video/effects/sepia.d.ts.map +1 -0
- package/build/video/{webgl → effects}/shadereffect.d.ts +133 -25
- package/build/video/effects/shadereffect.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/shine.d.ts +2 -2
- package/build/video/effects/shine.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/tintPulse.d.ts +2 -2
- package/build/video/effects/tintPulse.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/vignette.d.ts +2 -2
- package/build/video/effects/vignette.d.ts.map +1 -0
- package/build/video/{webgl/effects → effects}/wave.d.ts +2 -2
- package/build/video/effects/wave.d.ts.map +1 -0
- package/build/video/effects/wgsl/layout.d.ts +28 -0
- package/build/video/effects/wgsl/layout.d.ts.map +1 -0
- package/build/video/effects/wgsl/parse.d.ts +9 -0
- package/build/video/effects/wgsl/parse.d.ts.map +1 -0
- package/build/video/effects/wgsl/scaffold.d.ts +43 -0
- package/build/video/effects/wgsl/scaffold.d.ts.map +1 -0
- package/build/video/effects/wgsl_realization.d.ts +83 -0
- package/build/video/effects/wgsl_realization.d.ts.map +1 -0
- package/build/video/gpu/batcher.d.ts +71 -0
- package/build/video/gpu/batcher.d.ts.map +1 -0
- package/build/video/gpu/instancerecord.d.ts +164 -0
- package/build/video/gpu/instancerecord.d.ts.map +1 -0
- package/build/video/gpu/meshchunk.d.ts +49 -0
- package/build/video/gpu/meshchunk.d.ts.map +1 -0
- package/build/video/gpu/meshvertex.d.ts +54 -0
- package/build/video/gpu/meshvertex.d.ts.map +1 -0
- package/build/video/gpu/primitives.d.ts +60 -0
- package/build/video/gpu/primitives.d.ts.map +1 -0
- package/build/video/gpu/quadcorners.d.ts +11 -0
- package/build/video/gpu/quadcorners.d.ts.map +1 -0
- package/build/video/gpu/textureslots.d.ts +122 -0
- package/build/video/gpu/textureslots.d.ts.map +1 -0
- package/build/video/gpu/texturestore.d.ts +139 -0
- package/build/video/gpu/texturestore.d.ts.map +1 -0
- package/build/video/gpu/topology.d.ts +43 -0
- package/build/video/gpu/topology.d.ts.map +1 -0
- package/build/video/gpu/vertexformat.d.ts +72 -0
- package/build/video/gpu/vertexformat.d.ts.map +1 -0
- package/build/video/gradient.d.ts +14 -5
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +153 -8
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +7 -6
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +2 -2
- package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +38 -2
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +83 -0
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -0
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +20 -2
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +2 -2
- package/build/video/utils/autodetect.d.ts.map +1 -1
- package/build/video/video.d.ts +1 -55
- package/build/video/video.d.ts.map +1 -1
- package/build/video/webgl/batchers/batcher.d.ts +132 -35
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +14 -0
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +63 -36
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +29 -20
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +308 -14
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/primitive_batcher.d.ts +2 -2
- package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +0 -2
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +1 -1
- package/build/video/webgl/buffer/instance_buffer.d.ts +54 -0
- package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -0
- package/build/video/webgl/buffer/retained_geometry.d.ts +83 -0
- package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -0
- package/build/video/webgl/buffer/uniformblock.d.ts +81 -0
- package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -0
- package/build/video/webgl/buffer/vertexstate.d.ts +101 -0
- package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -0
- package/build/video/webgl/glshader.d.ts +101 -8
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/lighting/constants.d.ts +20 -8
- package/build/video/webgl/lighting/constants.d.ts.map +1 -1
- package/build/video/webgl/lighting/pack.d.ts +1 -1
- package/build/video/webgl/lighting/pack3d.d.ts +27 -11
- package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
- package/build/video/webgl/lighting/std140.d.ts +110 -0
- package/build/video/webgl/lighting/std140.d.ts.map +1 -0
- package/build/video/webgl/shaders/multitexture-lit.d.ts +7 -3
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/texture/store.d.ts +52 -0
- package/build/video/webgl/texture/store.d.ts.map +1 -0
- package/build/video/webgl/utils/maxtextures.d.ts +37 -0
- package/build/video/webgl/utils/maxtextures.d.ts.map +1 -0
- package/build/video/webgl/utils/samplercache.d.ts +69 -0
- package/build/video/webgl/utils/samplercache.d.ts.map +1 -0
- package/build/video/webgl/utils/string.d.ts +16 -0
- package/build/video/webgl/utils/string.d.ts.map +1 -1
- package/build/video/webgl/utils/topology.d.ts +24 -0
- package/build/video/webgl/utils/topology.d.ts.map +1 -0
- package/build/video/webgl/utils/vertexformat.d.ts +27 -0
- package/build/video/webgl/utils/vertexformat.d.ts.map +1 -0
- package/build/video/webgl/webgl_renderer.d.ts +148 -30
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +40 -0
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -0
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +82 -0
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -0
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +301 -0
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -0
- package/build/video/webgpu/batchers/primitive_batcher.d.ts +39 -0
- package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -0
- package/build/video/webgpu/batchers/quad_batcher.d.ts +143 -0
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -0
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts +70 -0
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -0
- package/build/video/webgpu/buffer/arena.d.ts +64 -0
- package/build/video/webgpu/buffer/arena.d.ts.map +1 -0
- package/build/video/webgpu/buffer/instance_buffer.d.ts +65 -0
- package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -0
- package/build/video/webgpu/buffer/retained_geometry.d.ts +55 -0
- package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -0
- package/build/video/webgpu/buffer/uniformring.d.ts +68 -0
- package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -0
- package/build/video/webgpu/effect_binding.d.ts +17 -0
- package/build/video/webgpu/effect_binding.d.ts.map +1 -0
- package/build/video/webgpu/pipeline/bindgroups.d.ts +36 -0
- package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -0
- package/build/video/webgpu/pipeline/cache.d.ts +173 -0
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -0
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +90 -0
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -0
- package/build/video/webgpu/shaders/mesh-instanced.d.ts +60 -0
- package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -0
- package/build/video/webgpu/texture/compressed.d.ts +33 -0
- package/build/video/webgpu/texture/compressed.d.ts.map +1 -0
- package/build/video/webgpu/texture/frametexture.d.ts +65 -0
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -0
- package/build/video/webgpu/texture/store.d.ts +149 -0
- package/build/video/webgpu/texture/store.d.ts.map +1 -0
- package/build/video/webgpu/webgpu_renderer.d.ts +536 -0
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -0
- package/package.json +5 -5
- package/build/video/webgl/effects/blur.d.ts.map +0 -1
- package/build/video/webgl/effects/chromaticAberration.d.ts.map +0 -1
- package/build/video/webgl/effects/colorMatrix.d.ts.map +0 -1
- package/build/video/webgl/effects/desaturate.d.ts.map +0 -1
- package/build/video/webgl/effects/dissolve.d.ts.map +0 -1
- package/build/video/webgl/effects/dropShadow.d.ts.map +0 -1
- package/build/video/webgl/effects/flash.d.ts.map +0 -1
- package/build/video/webgl/effects/glow.d.ts.map +0 -1
- package/build/video/webgl/effects/hologram.d.ts.map +0 -1
- package/build/video/webgl/effects/invert.d.ts.map +0 -1
- package/build/video/webgl/effects/outline.d.ts.map +0 -1
- package/build/video/webgl/effects/pixelate.d.ts.map +0 -1
- package/build/video/webgl/effects/radialGradient.d.ts.map +0 -1
- package/build/video/webgl/effects/scanline.d.ts.map +0 -1
- package/build/video/webgl/effects/sepia.d.ts.map +0 -1
- package/build/video/webgl/effects/shine.d.ts.map +0 -1
- package/build/video/webgl/effects/tintPulse.d.ts.map +0 -1
- package/build/video/webgl/effects/vignette.d.ts.map +0 -1
- package/build/video/webgl/effects/wave.d.ts.map +0 -1
- package/build/video/webgl/shadereffect.d.ts.map +0 -1
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a Wavefront OBJ file into geometry data.
|
|
3
|
+
* Supports: `v` (vertex positions), `vt` (texture coordinates),
|
|
4
|
+
* `f` (faces in `v`, `v/vt`, `v/vt/vn`, or `v//vn` format),
|
|
5
|
+
* `mtllib` (material library reference),
|
|
6
|
+
* `usemtl` (material group boundaries — emitted as `groups[]`).
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Quad and n-gon triangulation (fan from first vertex)
|
|
10
|
+
* - Automatic CW → CCW winding correction via signed volume test
|
|
11
|
+
* - V texture coordinate flipped for OpenGL convention (OBJ has origin at bottom-left)
|
|
12
|
+
* - Single-pass parsing with direct vertex unification (no intermediate arrays)
|
|
13
|
+
* - Material grouping: each `usemtl` switch emits a new `groups[]` entry
|
|
14
|
+
* pointing to a slice of the unified `indices` buffer, so callers
|
|
15
|
+
* (e.g. `Mesh`) can render each group with its own material without
|
|
16
|
+
* touching the geometry. A model with no `usemtl` directives produces
|
|
17
|
+
* a single group with `materialName: null`.
|
|
18
|
+
*
|
|
19
|
+
* `vn` (vertex normals) are consumed: a face referencing them
|
|
20
|
+
* (`v//vn` or `v/vt/vn`) produces unified vertices carrying the authored
|
|
21
|
+
* normal, so an OBJ model lights under `Light3d` exactly as the same model
|
|
22
|
+
* imported from glTF does. Every vertex WITHOUT a usable authored normal
|
|
23
|
+
* gets one GENERATED from face geometry — angle-weighted, accumulated per
|
|
24
|
+
* source position and normalized, i.e. smooth across UV and material seams
|
|
25
|
+
* — after the winding correction below, so the result follows the final
|
|
26
|
+
* triangle orientation rather than the authored one. That rule is
|
|
27
|
+
* per-vertex, so a file mixing normalled and un-normalled faces, or one
|
|
28
|
+
* carrying an out-of-range `vn`, still comes out fully normalled.
|
|
29
|
+
*
|
|
30
|
+
* Parsed but ignored: `g` (groups), `s` (smooth shading — generated normals
|
|
31
|
+
* are smooth across the whole mesh, so a model relying on hard edges from
|
|
32
|
+
* smoothing groups will read softer than authored),
|
|
33
|
+
* `o` (object name).
|
|
34
|
+
*
|
|
35
|
+
* @param {string} text - raw OBJ file contents
|
|
36
|
+
* @returns {object} parsed geometry with `vertices` (Float32Array),
|
|
37
|
+
* `uvs` (Float32Array), `normals` (Float32Array), `indices`
|
|
38
|
+
* (Uint16Array, widening to Uint32Array past 65 536 vertices),
|
|
39
|
+
* `vertexCount` (number),
|
|
40
|
+
* `mtllib` (string|null), and `groups`
|
|
41
|
+
* (Array<{materialName: string|null, start: number, count: number}>).
|
|
42
|
+
* `groups` follows the glTF convention — each entry is a
|
|
43
|
+
* contiguous slice of the shared `indices` buffer that draws as one
|
|
44
|
+
* submesh against a single material. Single-material models still
|
|
45
|
+
* produce a `groups` array of length 1, so consumers don't need a
|
|
46
|
+
* special case.
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
export function parseOBJ(text: string): object;
|
|
1
50
|
/**
|
|
2
51
|
* parse/preload a Wavefront OBJ file
|
|
3
52
|
* @param {loader.Asset} data - asset data
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obj.d.ts","sourceRoot":"","sources":["../../../src/loader/parsers/obj.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"obj.d.ts","sourceRoot":"","sources":["../../../src/loader/parsers/obj.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,+BAdW,MAAM,GACJ,MAAM,CAkZlB;AAED;;;;;;;;GAQG;AACH,iCAPW,MAAM,CAAC,KAAK,oDAGZ,MAAM,GACJ,MAAM,CAuBlB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping authored metallic/roughness onto the lit mesh path's Blinn-Phong
|
|
3
|
+
* terms (#1575).
|
|
4
|
+
*
|
|
5
|
+
* Two formats describe the same material concept — glTF's
|
|
6
|
+
* `pbrMetallicRoughness` and MTL's `Pr` / `Pm` extension, both of which
|
|
7
|
+
* Blender writes by default — and both land here so the two cannot drift
|
|
8
|
+
* apart. What they land ON is a stylized half-Lambert shading model, not a
|
|
9
|
+
* microfacet BRDF, so this is deliberately an APPROXIMATION: the point is to
|
|
10
|
+
* recover the "is this surface glossy, and what colour does it glint"
|
|
11
|
+
* information the asset already carries, rather than to be energy-correct.
|
|
12
|
+
*
|
|
13
|
+
* An explicitly authored specular (`Ks` + `Ns`) always wins over this — it
|
|
14
|
+
* says exactly what the artist wanted, where metallic/roughness only implies
|
|
15
|
+
* it.
|
|
16
|
+
* @ignore
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The exponent a mirror-smooth surface is clamped to. The Blinn-Phong
|
|
20
|
+
* exponent runs away as roughness approaches 0, and a highlight narrower
|
|
21
|
+
* than a pixel only aliases.
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
export declare const MAX_SHININESS = 256;
|
|
25
|
+
/**
|
|
26
|
+
* The specular reflectance of a non-metal, the standard value used by every
|
|
27
|
+
* metallic/roughness workflow. Metals reflect their own base colour instead.
|
|
28
|
+
* @ignore
|
|
29
|
+
*/
|
|
30
|
+
export declare const DIELECTRIC_F0 = 0.04;
|
|
31
|
+
/**
|
|
32
|
+
* The result of the mapping: a specular colour and exponent ready to hand to
|
|
33
|
+
* a {@link Mesh}, or `undefined` / `0` when the material implies no
|
|
34
|
+
* highlight at all.
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
export interface SpecularTerms {
|
|
38
|
+
/** specular colour `[r, g, b]`, or `undefined` for none */
|
|
39
|
+
specular: number[] | undefined;
|
|
40
|
+
/** specular exponent; `0` disables the term outright */
|
|
41
|
+
shininess: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Map a metallic/roughness pair onto a Blinn-Phong specular colour and
|
|
45
|
+
* exponent.
|
|
46
|
+
*
|
|
47
|
+
* - **roughness → exponent** through the usual Blinn-Phong/GGX bridge,
|
|
48
|
+
* `2 / a^4 - 2` for `a = roughness^2`. A roughness of 1 — which is the
|
|
49
|
+
* glTF default, and what a matte material declares — lands on exactly 0,
|
|
50
|
+
* so a material that says nothing gets no highlight and shades exactly as
|
|
51
|
+
* it did before this existed.
|
|
52
|
+
* - **metallic → tint**, interpolating from the dielectric reflectance to
|
|
53
|
+
* the material's own base colour. Chrome glints in its own hue while
|
|
54
|
+
* plaster gets a faint neutral sheen, which is the visible half of the
|
|
55
|
+
* metal/non-metal distinction.
|
|
56
|
+
* @param roughness - authored roughness (0..1); absent or malformed reads as 1
|
|
57
|
+
* @param metallic - authored metalness (0..1); absent or malformed reads as 1
|
|
58
|
+
* @param baseColor - the material's base colour, `[r, g, b, a?]`
|
|
59
|
+
* @returns the specular terms, inert when the material implies no highlight
|
|
60
|
+
* @ignore
|
|
61
|
+
*/
|
|
62
|
+
export declare function specularFromMetallicRoughness(roughness: unknown, metallic: unknown, baseColor?: number[]): SpecularTerms;
|
|
63
|
+
//# sourceMappingURL=pbr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbr.d.ts","sourceRoot":"","sources":["../../../src/loader/parsers/pbr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/B,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;CAClB;AAgBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6BAA6B,CAC5C,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,OAAO,EACjB,SAAS,GAAE,MAAM,EAAiB,GAChC,aAAa,CAaf"}
|
|
@@ -1,39 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* compile a shader asset's source into its shared, loader-owned instance:
|
|
3
3
|
* a fragment body (the `apply()` convention) compiles into a
|
|
4
|
-
* {@link ShaderEffect}; a
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
4
|
+
* {@link ShaderEffect}; a complete program — a `{vertex, fragment}` GLSL
|
|
5
|
+
* pair and/or a `wgsl` full module, either omittable — compiles into a
|
|
6
|
+
* {@link GLShader} carrying whichever realizations were declared, for the
|
|
7
|
+
* hosted paths that take one (a `Mesh` custom shader,
|
|
8
|
+
* `renderer.customShader`, a custom batcher). The active renderer hosts
|
|
9
|
+
* the realization it speaks; a shader without one for this backend is
|
|
10
|
+
* inert — assigning it degrades to built-in shading, never fails.
|
|
11
|
+
* @param {string|object} source - the fragment body (or `{glsl, wgsl}`
|
|
12
|
+
* bodies), or a complete program: `{vertex, fragment, wgsl?, precision?}`
|
|
13
|
+
* @returns {ShaderEffect|GLShader} the compiled asset, flagged `shared`
|
|
14
|
+
* @throws if called before any `app.init()` resolved (no renderer to compile against)
|
|
13
15
|
* @ignore
|
|
14
16
|
*/
|
|
15
|
-
export function compileShaderAsset(source: string |
|
|
16
|
-
vertex: string;
|
|
17
|
-
fragment: string;
|
|
18
|
-
precision?: string;
|
|
19
|
-
}): ShaderEffect | GLShader | null;
|
|
17
|
+
export function compileShaderAsset(source: string | object): ShaderEffect | GLShader;
|
|
20
18
|
/**
|
|
21
19
|
* parse/preload a shader asset, from a `src` URL (or data: URI) or inline
|
|
22
|
-
*
|
|
20
|
+
* source via the `data` field. Three source shapes are accepted:
|
|
23
21
|
*
|
|
24
22
|
* - a GLSL **fragment body** following the ShaderEffect convention (uniform
|
|
25
23
|
* declarations + `vec4 apply(vec4, vec2)`) → compiles into a shared
|
|
26
24
|
* {@link ShaderEffect};
|
|
27
|
-
* - a
|
|
28
|
-
* `data: {
|
|
29
|
-
* {@link
|
|
30
|
-
*
|
|
25
|
+
* - a **dual-language body** — `src: {glsl: url, wgsl: url}` or
|
|
26
|
+
* `data: {glsl: source, wgsl: source}`, either language omittable — →
|
|
27
|
+
* a shared {@link ShaderEffect} carrying one body per shading language;
|
|
28
|
+
* the renderer compiles the matching one, and when none matches the
|
|
29
|
+
* preload still succeeds with an inert (`enabled === false`) effect;
|
|
30
|
+
* - a complete **program** — `src: {vertex: url, fragment: url}` (GLSL
|
|
31
|
+
* pair), `src: {wgsl: url}` where the WGSL declares its own `@vertex`
|
|
32
|
+
* entry point (a complete module), or both together for a dual-backend
|
|
33
|
+
* asset — → compiles into a shared raw {@link GLShader} carrying the
|
|
34
|
+
* declared realizations (`isWebGL` / `isWebGPU`), for the hosted paths
|
|
35
|
+
* that take one (a `Mesh` custom shader, `renderer.customShader`, a
|
|
36
|
+
* custom batcher); the active renderer hosts the realization it speaks
|
|
37
|
+
* and a missing one degrades to built-in shading.
|
|
31
38
|
*
|
|
32
39
|
* Always compiled AT LOAD TIME, so the GLSL compile cost lands in the
|
|
33
|
-
* loading screen and compile errors carry the asset name.
|
|
34
|
-
* is an inherent precondition of the
|
|
35
|
-
* itself needs the renderer, and a failed
|
|
36
|
-
* loading a shader without it fails with a clear
|
|
40
|
+
* loading screen and compile errors carry the asset name. An initialized
|
|
41
|
+
* Application (`await app.init()`) is an inherent precondition of the
|
|
42
|
+
* preload flow (the loading screen itself needs the renderer, and a failed
|
|
43
|
+
* init rejects and halts) — loading a shader without it fails with a clear
|
|
44
|
+
* error.
|
|
37
45
|
* @param {loader.Asset} data - asset data
|
|
38
46
|
* @param {Function} [onload] - function to be called when the resource is loaded
|
|
39
47
|
* @param {Function} [onerror] - function to be called in case of error
|
|
@@ -42,6 +50,6 @@ export function compileShaderAsset(source: string | {
|
|
|
42
50
|
* @ignore
|
|
43
51
|
*/
|
|
44
52
|
export function preloadShader(data: loader.Asset, onload?: Function, onerror?: Function, settings?: Object): number;
|
|
45
|
-
import ShaderEffect from "../../video/
|
|
53
|
+
import ShaderEffect from "../../video/effects/shadereffect.js";
|
|
46
54
|
import GLShader from "../../video/webgl/glshader.js";
|
|
47
55
|
//# sourceMappingURL=shader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader.d.ts","sourceRoot":"","sources":["../../../src/loader/parsers/shader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader.d.ts","sourceRoot":"","sources":["../../../src/loader/parsers/shader.js"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,GAAC,MAAM,GAEX,YAAY,GAAC,QAAQ,CAqDjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,oCAPW,MAAM,CAAC,KAAK,oDAGZ,MAAM,GACJ,MAAM,CAgHlB;yBA9OwB,qCAAqC;qBACzC,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAG7D,OAAO,UAAU,MAAM,6BAA6B,CAAC;AAErD,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAChE,OAAO,aAAa,MAAM,kCAAkC,CAAC;AAC7D,OAAO,eAAe,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IAC/C,GAAG,EAAE,QAAQ,CAAC;IACd,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBA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E,OAAO,CAAC;IAEf;;OAEG;gBACS,OAAO,EAAE,eAAe;IAiBpC;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,WAAW,GAAE,OAAe;IAwFnE;;;;;OAKG;IACM,MAAM,CAAC,EAAE,EAAE,MAAM;IA+F1B;;OAEG;IACM,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,aAAa;CAMtD;AAED,eAAO,MAAM,YAAY,wEAWxB,CAAC"}
|
|
@@ -135,7 +135,9 @@ export interface ParticleEmitterSettings {
|
|
|
135
135
|
*/
|
|
136
136
|
blendMode: string;
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
138
|
+
* Only repaint particles while they are inside the viewport (off-screen
|
|
139
|
+
* particles keep simulating and living out their lifetime, but do not
|
|
140
|
+
* mark the scene dirty).
|
|
139
141
|
* @default true
|
|
140
142
|
*/
|
|
141
143
|
onlyInViewport: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/particles/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAExD;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAE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
16
16
|
export type BodyType = "static" | "dynamic" | "kinematic";
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Collision shape that a physics body may be composed of.
|
|
19
|
+
*
|
|
20
|
+
* A shape may also carry its own optional collision settings, which refine the
|
|
21
|
+
* body's rather than replacing them — `collisionType`, `collisionMask`,
|
|
22
|
+
* `isTrigger` and `isActive`. See {@link Body#addShape} for the semantics.
|
|
23
|
+
*
|
|
24
|
+
* Adapter support: the builtin and planck adapters honour them (planck maps
|
|
25
|
+
* them onto per-fixture filters, which Box2D provides natively). The matter
|
|
26
|
+
* adapter does NOT — its `collisionFilter` and `isSensor` belong to a body, not
|
|
27
|
+
* to the parts it is built from, so per-shape values are ignored there.
|
|
28
|
+
*/
|
|
18
29
|
export type BodyShape = Rect | Ellipse | Polygon;
|
|
19
30
|
/**
|
|
20
31
|
* Collision response passed to the modern collision lifecycle hooks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/physics/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AA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AS,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAE5D;;;;;;OAMG;IACH,UAAU,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IAE7C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI,CAAC;IAC1D;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;IAC9D,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,EAAE,CAAC;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC;IAC7D,WAAW,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC;IAE3C;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAErE;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,SAAS,EAAE,CAAC;CAC5D"}
|
|
@@ -143,6 +143,41 @@ export default class Octree implements Broadphase<OctreeItem> {
|
|
|
143
143
|
* @returns octant index (0-7) or -1
|
|
144
144
|
*/
|
|
145
145
|
getIndex(item: OctreeItem): number;
|
|
146
|
+
/**
|
|
147
|
+
* Classify an item into one of this node's four x/y quadrants,
|
|
148
|
+
* **ignoring z entirely**. Returns the near-half octant index
|
|
149
|
+
* (0-3, so `+ 4` gives the far-half sibling), or -1 when the item
|
|
150
|
+
* straddles a midpoint or lies outside this node in x/y.
|
|
151
|
+
*
|
|
152
|
+
* Split out of {@link Octree.getIndex} for {@link Octree.retrieve},
|
|
153
|
+
* whose consumers all decide overlap in the XY plane and therefore
|
|
154
|
+
* need x/y pruning WITHOUT a depth opinion. Routing that through
|
|
155
|
+
* `getIndex` instead would reject the item from its own z-sibling
|
|
156
|
+
* on the depth out-of-bounds guard, collapsing that entire subtree
|
|
157
|
+
* into an unpruned walk — measured at ~10× the nodes visited on a
|
|
158
|
+
* depth-spread scene.
|
|
159
|
+
*
|
|
160
|
+
* Boundary convention: a midpoint belongs to the RIGHT / BOTTOM
|
|
161
|
+
* child, and an item whose far edge merely touches a midpoint still
|
|
162
|
+
* counts as wholly inside the near side — `<=` / `>=` rather than
|
|
163
|
+
* strict, because an item sitting exactly ON a midpoint lies wholly
|
|
164
|
+
* within one child and must descend. Only a genuine STRADDLE
|
|
165
|
+
* belongs at this level.
|
|
166
|
+
*
|
|
167
|
+
* This matters more than it looks: the root box is origin-centred,
|
|
168
|
+
* so its midpoints are (0, 0, 0) — the default `pos` of every
|
|
169
|
+
* renderable. Under strict comparisons an entire gameplay plane
|
|
170
|
+
* classified as -1 and sat unpartitioned at the root.
|
|
171
|
+
*
|
|
172
|
+
* Safety: two items separated by a midpoint cannot overlap. If A
|
|
173
|
+
* lies left (`A.right <= mid`) and B lies right (`B.left >= mid`)
|
|
174
|
+
* then `A.right <= B.left`, and touching edges are not an overlap
|
|
175
|
+
* under the engine's strict bounds test.
|
|
176
|
+
* @param item - the object to classify
|
|
177
|
+
* @returns near-half octant index (0-3) or -1
|
|
178
|
+
* @ignore
|
|
179
|
+
*/
|
|
180
|
+
_quadrantXY(item: OctreeItem): number;
|
|
146
181
|
/**
|
|
147
182
|
* Insert the given object container into the node — recursively
|
|
148
183
|
* walks `Container.getChildren()` and inserts each non-kinematic
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"octree.d.ts","sourceRoot":"","sources":["../../../src/physics/broadphase/octree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA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OAAO,EAAE,KAAK,OAAO,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,gBAAgB,EAAE,CAAC;CACvC;AAED,cAAc;AACd,KAAK,aAAa,GAAG;IAAE,WAAW,IAAI,gBAAgB,EAAE,CAAA;CAAE,CAAC;AAC3D,cAAc;AACd,KAAK,qBAAqB,GAAG;IAAE,WAAW,CAAC,IAAI,gBAAgB,EAAE,CAAA;CAAE,CAAC"}
|
|
@@ -185,6 +185,60 @@ export default class Body {
|
|
|
185
185
|
* @default <490,490>
|
|
186
186
|
*/
|
|
187
187
|
public maxVel: Vector2d;
|
|
188
|
+
/**
|
|
189
|
+
* The current velocity of the body along the depth axis.
|
|
190
|
+
*
|
|
191
|
+
* Z arrives as **scalars beside** `vel` / `force` / `friction` /
|
|
192
|
+
* `maxVel` rather than by widening them to {@link Vector3d}, because
|
|
193
|
+
* `Vector3d` is not a subclass of {@link Vector2d}: retyping them —
|
|
194
|
+
* or the {@link Body#getVelocity} vector they hand back — would break
|
|
195
|
+
* every existing 2D consumer. They stay exactly as they were.
|
|
196
|
+
*
|
|
197
|
+
* All four default to the inert value, so a body that never touches
|
|
198
|
+
* them integrates z by `+= 0` and behaves identically to 19.x. Only a
|
|
199
|
+
* body carrying a {@link Box3d} shape can be pushed back along z by
|
|
200
|
+
* the solver.
|
|
201
|
+
* @public
|
|
202
|
+
* @type {number}
|
|
203
|
+
* @default 0
|
|
204
|
+
* @see Body#forceZ
|
|
205
|
+
* @see Box3d
|
|
206
|
+
*/
|
|
207
|
+
public velZ: number;
|
|
208
|
+
/**
|
|
209
|
+
* body force to apply along the depth axis in the current step.
|
|
210
|
+
* @public
|
|
211
|
+
* @type {number}
|
|
212
|
+
* @default 0
|
|
213
|
+
* @see Body#velZ
|
|
214
|
+
*/
|
|
215
|
+
public forceZ: number;
|
|
216
|
+
/**
|
|
217
|
+
* body friction along the depth axis.
|
|
218
|
+
* @public
|
|
219
|
+
* @type {number}
|
|
220
|
+
* @default 0
|
|
221
|
+
* @see Body#setFriction
|
|
222
|
+
*/
|
|
223
|
+
public frictionZ: number;
|
|
224
|
+
/**
|
|
225
|
+
* max velocity along the depth axis (to limit body velocity).
|
|
226
|
+
* @public
|
|
227
|
+
* @type {number}
|
|
228
|
+
* @default 490
|
|
229
|
+
* @see Body#setMaxVelocity
|
|
230
|
+
*/
|
|
231
|
+
public maxVelZ: number;
|
|
232
|
+
/**
|
|
233
|
+
* `true` when at least one of this body's shapes is a {@link Box3d},
|
|
234
|
+
* i.e. this body has a depth extent and can be resolved along z.
|
|
235
|
+
* Maintained by {@link Body#addShape} / {@link Body#removeShape}.
|
|
236
|
+
* @readonly
|
|
237
|
+
* @public
|
|
238
|
+
* @type {boolean}
|
|
239
|
+
* @default false
|
|
240
|
+
*/
|
|
241
|
+
public readonly hasDepth: boolean;
|
|
188
242
|
/**
|
|
189
243
|
* Either this body is a static body or not.
|
|
190
244
|
* A static body is completely fixed and can never change position or angle.
|
|
@@ -422,15 +476,75 @@ export default class Body {
|
|
|
422
476
|
/**
|
|
423
477
|
* add a collision shape to this body <br>
|
|
424
478
|
* (note: me.Rect objects will be converted to me.Polygon before being added)
|
|
479
|
+
*
|
|
480
|
+
* A shape may carry its own collision settings, which refine the body's
|
|
481
|
+
* (see {@link Body#collisionType} / {@link Body#collisionMask}). All are
|
|
482
|
+
* optional, and their defaults are the behaviour a shape has always had:
|
|
483
|
+
*
|
|
484
|
+
* | property | default | effect |
|
|
485
|
+
* |---|---|---|
|
|
486
|
+
* | `collisionType` | inherit body | this shape's own category |
|
|
487
|
+
* | `collisionMask` | inherit body | what this shape collides with |
|
|
488
|
+
* | `isActive` | `true` | `false` removes the shape from collision entirely — no test, no contact, no events — without removing it from the body |
|
|
489
|
+
* | `isTrigger` | `false` | `true` still collides and still fires events, but skips the position correction (per-shape {@link Body#isSensor}) |
|
|
490
|
+
*
|
|
491
|
+
* A shape can only NARROW what its body allows, never widen it: the body's
|
|
492
|
+
* type/mask are still checked first, so a permissive shape on a restrictive
|
|
493
|
+
* body collides with nothing.
|
|
494
|
+
*
|
|
495
|
+
* A trigger removes only ITSELF from the solver. If a solid shape on the
|
|
496
|
+
* same body also overlaps, that contact still pushes out — the narrowphase
|
|
497
|
+
* prefers a solid pair over a trigger pair, so the outcome does not depend
|
|
498
|
+
* on the order shapes were added. `response.isTriggerContact` reports
|
|
499
|
+
* whether a given contact exists only through trigger shapes.
|
|
500
|
+
*
|
|
501
|
+
* `isActive: false` removes the shape from the narrowphase AND from
|
|
502
|
+
* raycasts. It does not shrink the body's `bounds` — those stay
|
|
503
|
+
* conservative, so toggling a shape never resizes the body in the
|
|
504
|
+
* broadphase — nor does it clear `hasDepth` for a `Box3d`.
|
|
505
|
+
*
|
|
506
|
+
* Supported by the builtin and planck adapters. The matter adapter filters
|
|
507
|
+
* per body only and ignores these. Note that under planck, the body-wide
|
|
508
|
+
* setters (`setCollisionType`, `setCollisionMask`, `setSensor`) write every
|
|
509
|
+
* fixture and so overwrite per-shape values.
|
|
425
510
|
* @param {Rect|Polygon|Line|Ellipse|Point|Point[]|Bounds|object} shape - a shape or JSON object
|
|
426
511
|
* @returns {number} the shape array length
|
|
427
512
|
* @example
|
|
428
513
|
* // add a rectangle shape
|
|
429
514
|
* this.body.addShape(new me.Rect(0, 0, image.width, image.height));
|
|
515
|
+
* @example
|
|
516
|
+
* // a character whose feet collide with terrain and whose torso is a hurtbox
|
|
517
|
+
* const feet = new me.Rect(0, 24, 32, 8);
|
|
518
|
+
* feet.collisionMask = me.collision.types.WORLD_SHAPE;
|
|
519
|
+
* const torso = new me.Rect(0, 0, 32, 24);
|
|
520
|
+
* torso.collisionMask = me.collision.types.ENEMY_OBJECT;
|
|
521
|
+
* torso.isTrigger = true; // detect hits, never get pushed by them
|
|
522
|
+
* this.body.addShape(feet);
|
|
523
|
+
* this.body.addShape(torso);
|
|
430
524
|
* // add a shape from a JSON object
|
|
431
525
|
* this.body.addShape(me.loader.getJSON("shapesdef").banana);
|
|
432
526
|
*/
|
|
433
|
-
|
|
527
|
+
/**
|
|
528
|
+
* Give a stored shape its per-shape collision settings, carrying them over
|
|
529
|
+
* from the source object when `addShape` converted it (a `Rect` and a
|
|
530
|
+
* `Bounds` both become a `Polygon`, so anything set on the original would
|
|
531
|
+
* otherwise be dropped on the floor).
|
|
532
|
+
*
|
|
533
|
+
* Every field is written explicitly, including the defaults. That is not
|
|
534
|
+
* tidiness: converted shapes come from `polygonPool`, whose reset restores
|
|
535
|
+
* only position and vertices — a recycled instance would otherwise arrive
|
|
536
|
+
* still carrying the previous owner's `isTrigger` or mask and quietly
|
|
537
|
+
* change how an unrelated body collides.
|
|
538
|
+
*
|
|
539
|
+
* Idempotent, because `removeShape` re-adds every surviving shape through
|
|
540
|
+
* `addShape` and must not disturb their settings.
|
|
541
|
+
* @param {object} stored - the shape as held in `this.shapes`
|
|
542
|
+
* @param {object} [source] - the object passed to `addShape`; omitted when
|
|
543
|
+
* the shape was built here from a pool and has no user-supplied original
|
|
544
|
+
* @private
|
|
545
|
+
*/
|
|
546
|
+
private _initShapeCollision;
|
|
547
|
+
addShape(shape: any): number;
|
|
434
548
|
/**
|
|
435
549
|
* Recompute the default `pseudoInertia` from the current bounds.
|
|
436
550
|
* Uses the moment-of-inertia formula for a unit-mass rectangle —
|
|
@@ -481,10 +595,10 @@ export default class Body {
|
|
|
481
595
|
getBounds(): Bounds;
|
|
482
596
|
/**
|
|
483
597
|
* remove the specified shape from the body shape list
|
|
484
|
-
* @param {Polygon|Line|Ellipse} shape - a shape object
|
|
598
|
+
* @param {Polygon|Line|Ellipse|Box3d} shape - a shape object
|
|
485
599
|
* @returns {number} the shape array length
|
|
486
600
|
*/
|
|
487
|
-
removeShape(shape: Polygon | Line | Ellipse): number;
|
|
601
|
+
removeShape(shape: Polygon | Line | Ellipse | Box3d): number;
|
|
488
602
|
/**
|
|
489
603
|
* remove the shape at the given index from the body shape list
|
|
490
604
|
* @param {number} index - the shape object at the specified index
|
|
@@ -565,14 +679,16 @@ export default class Body {
|
|
|
565
679
|
* cap the body velocity (body.maxVel property) to the specified value<br>
|
|
566
680
|
* @param {number} x - max velocity on x axis
|
|
567
681
|
* @param {number} y - max velocity on y axis
|
|
682
|
+
* @param {number} [z] - max velocity on the depth axis; left unchanged when omitted, so existing two-argument calls keep their behaviour
|
|
568
683
|
*/
|
|
569
|
-
setMaxVelocity(x: number, y: number): void;
|
|
684
|
+
setMaxVelocity(x: number, y: number, z?: number): void;
|
|
570
685
|
/**
|
|
571
686
|
* set the body default friction
|
|
572
687
|
* @param {number} x - horizontal friction
|
|
573
688
|
* @param {number} y - vertical friction
|
|
689
|
+
* @param {number} [z] - depth friction; left unchanged when omitted, so existing two-argument calls keep their behaviour
|
|
574
690
|
*/
|
|
575
|
-
setFriction(x?: number, y?: number): void;
|
|
691
|
+
setFriction(x?: number, y?: number, z?: number): void;
|
|
576
692
|
/**
|
|
577
693
|
* Updates the parent's position as well as computes the new body's velocity based
|
|
578
694
|
* on the values of force/friction. Velocity changes are proportional to the
|
|
@@ -604,6 +720,7 @@ import { Line } from "../../geometries/line.ts";
|
|
|
604
720
|
import { Ellipse } from "../../geometries/ellipse.ts";
|
|
605
721
|
import { Point } from "../../geometries/point.ts";
|
|
606
722
|
import { Vector2d } from "../../math/vector2d.ts";
|
|
607
|
-
import {
|
|
723
|
+
import { Box3d } from "../../geometries/box3d.ts";
|
|
608
724
|
import type ResponseObject from "../response.js";
|
|
725
|
+
import { Rect } from "../../geometries/rectangle.ts";
|
|
609
726
|
//# sourceMappingURL=body.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"AAcA;;;;;;;;IAQI;AAEJ;;;;GAIG;AACH;IACC;;;;OAIG;IACH,sBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAA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ts","sourceRoot":"","sources":["../../../src/physics/builtin/builtin-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,SAAS,EACT,cAAc,EACd,UAAU,EACV,YAAY,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"builtin-adapter.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/builtin-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,SAAS,EACT,cAAc,EACd,UAAU,EACV,YAAY,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,O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U,EAAE,UAAU,GAAG,OAAO;IAQ3C,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI;IAaxD,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI;IAwI5D,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE;IAC3D,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE;IA+CzC,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,EAAE;IA0BnC,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;CAa9B"}
|
|
@@ -59,6 +59,12 @@ declare class Detector {
|
|
|
59
59
|
y: number;
|
|
60
60
|
};
|
|
61
61
|
depth: number;
|
|
62
|
+
overlapNZ: number;
|
|
63
|
+
overlapZ: number;
|
|
64
|
+
normalZ: number;
|
|
65
|
+
indexShapeA: number;
|
|
66
|
+
indexShapeB: number;
|
|
67
|
+
isTriggerContact: boolean;
|
|
62
68
|
}[];
|
|
63
69
|
/**
|
|
64
70
|
* Populate one of the pooled symmetric views from a SAT response.
|
|
@@ -86,6 +92,12 @@ declare class Detector {
|
|
|
86
92
|
y: number;
|
|
87
93
|
};
|
|
88
94
|
depth: number;
|
|
95
|
+
overlapNZ: number;
|
|
96
|
+
overlapZ: number;
|
|
97
|
+
normalZ: number;
|
|
98
|
+
indexShapeA: number;
|
|
99
|
+
indexShapeB: number;
|
|
100
|
+
isTriggerContact: boolean;
|
|
89
101
|
};
|
|
90
102
|
/**
|
|
91
103
|
* Called by the adapter at the start of a physics step. Resets the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/detector.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/detector.js"],"names":[],"mappings":";AAyEA;;GAEG;AACH;IACC;;OAEG;IACH,mBAFW,SAAS,EAgFnB;IA5EA,iBAAkB;IAElB;;;;OAIG;IACH,UAFU,cAAc,CAEY;IAEpC;;;;;OAKG;IACH,4BAA6B;IAC7B;;;;OAIG;IACH,0BAA2B;IAC3B;;;;;;;;;;;;;;OAcG;IACH;;;;;;;;;;;;;;;;;;;;;;;QAsCC;IAGF;;;;;;;;OAQG;IACH;;;;;;;;;;;;;;;;;;;;;;;MA0CC;IAED;;;;;OAKG;IACH,mBAEC;IAED;;;;;;OAMG;IACH,iBA6BC;IAED;;;;;OAKG;IACH,6CAOC;IAED;;;;;;OAMG;IACH,iBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,KAClD,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAiBnB;IAED;;;;;OAKG;IACH,gBAJW,IAAI,SACJ,IAAI,8BACF,OAAO,CAkHnB;IAED;;;;;OAKG;IACH,iBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAqOnB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,cArBW,IAAI,WACJ,KAAK,CAAE,UAAU,CAAC,GAChB,KAAK,CAAE,UAAU,CAAC,CAqC9B;CACD;2BA5nByB,+BAA+B;2BA7D9B,gBAAgB;4BA8DhB,gCAAgC;wBAFpC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;0BAC9C,0BAA0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raycast.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/raycast.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AA+KrC,wBAAgB,YAAY,CAC3B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"raycast.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/raycast.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AA+KrC,wBAAgB,YAAY,CAC3B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,UAAU,EAAE,CAoHd"}
|