@woosh/meep-engine 2.165.0 → 2.165.1
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 +137 -108
- package/build/bundle-worker-image-decoder.js +1 -1
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +3 -3
- package/samples/generation/filters/SampleGroundMoistureFilter.js +63 -56
- package/samples/generation/filters/SampleNoise20_0.js +6 -1
- package/samples/generation/themes/SampleTheme0.js +47 -47
- package/src/core/color/YCoCg/rgb_to_ycocg.d.ts +17 -0
- package/src/core/color/YCoCg/rgb_to_ycocg.d.ts.map +1 -0
- package/src/core/color/YCoCg/rgb_to_ycocg.js +20 -0
- package/src/core/color/YCoCg/ycocg_to_rgb.d.ts +14 -0
- package/src/core/color/YCoCg/ycocg_to_rgb.d.ts.map +1 -0
- package/src/core/color/YCoCg/ycocg_to_rgb.js +17 -0
- package/src/engine/REVIEW_2026_07_03.md +211 -0
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -1
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.js +3 -2
- package/src/engine/animation/curve/compression/sample_animation_curve_to_float_array.js +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.js +3 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +2 -2
- package/src/engine/asset/preloader/AssetPreloader.d.ts.map +1 -1
- package/src/engine/asset/preloader/AssetPreloader.js +6 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +5 -2
- package/src/engine/ecs/Entity.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +1 -0
- package/src/engine/ecs/EntityManager.js +1 -1
- package/src/engine/ecs/EntityObserver.js +1 -1
- package/src/engine/ecs/animation/AnimationClip.js +1 -1
- package/src/engine/ecs/attachment/AttachmentSystem.js +2 -2
- package/src/engine/ecs/attachment/TransformAttachmentBinding.d.ts.map +1 -1
- package/src/engine/ecs/attachment/TransformAttachmentBinding.js +11 -0
- package/src/engine/ecs/fow/FogOfWar.js +2 -2
- package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.d.ts.map +1 -1
- package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js +8 -0
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts +3 -1
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.js +4 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +10 -0
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +43 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts +93 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js +315 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts +48 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.js +331 -0
- package/src/engine/ecs/storage/binary/object-v2/DESIGN.md +199 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts +53 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.js +57 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts +53 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.js +56 -0
- package/src/engine/ecs/storage/binary/object-v2/README.md +110 -0
- package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts +13 -0
- package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.js +48 -0
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +29 -0
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +1 -0
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js +44 -0
- package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts.map +1 -1
- package/src/engine/graphics/camera/makeScreenScissorFrustum.js +11 -10
- package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.d.ts.map +1 -1
- package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.js +3 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.js +2 -0
- package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/Camera.js +4 -0
- package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js +7 -2
- package/src/engine/graphics/ecs/camera/set_camera_aspect_ratio.js +1 -1
- package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.js +4 -1
- package/src/engine/graphics/ecs/light/binding/LightBinding.js +2 -2
- package/src/engine/graphics/ecs/mesh/MeshSystem.js +1 -1
- package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.js +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts +6 -0
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.js +12 -1
- package/src/engine/graphics/geometry/buffered/ensureGeometryBoundingSphere.js +1 -1
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.js +0 -15
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +10 -10
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
- package/src/engine/graphics/material/SplatMaterial.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +3 -2
- package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +1 -1
- package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/group/ParticleGroup.js +3 -2
- package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts +1 -8
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +2 -14
- package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts +9 -0
- package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts.map +1 -0
- package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.js +14 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.js +4 -1
- package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts +69 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGrid.js +173 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts +24 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.js +88 -0
- package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts +20 -0
- package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.js +79 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts +11 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.js +84 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts +29 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.js +160 -0
- package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts +23 -0
- package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.js +228 -0
- package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts +2 -0
- package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.js +24 -0
- package/src/engine/graphics/sh3/lpg/material/common.d.ts +3 -0
- package/src/engine/graphics/sh3/lpg/material/common.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/common.js +73 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.js +42 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.js +49 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts +9 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js +12 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.js +30 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts +6 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.js +41 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts +3 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.js +15 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts +3 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.js +9 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts +9 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.js +12 -0
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts +20 -0
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.js +59 -0
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js +8 -0
- package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts +2 -0
- package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts.map +1 -0
- package/src/engine/graphics/sh3/prototypeLightProbeGrid.js +170 -0
- package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +1 -1
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +1 -1
- package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.js +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +3 -3
- package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
- package/src/engine/graphics/util/build_max_height_pyramid.js +5 -2
- package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +1 -1
- package/src/engine/input/ecs/components/InputBinding.d.ts +7 -1
- package/src/engine/input/ecs/components/InputBinding.d.ts.map +1 -1
- package/src/engine/input/ecs/components/InputBinding.js +8 -1
- package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +2 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js +6 -2
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +2 -4
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts +1 -2
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts.map +1 -1
- package/src/engine/logging/elastic/ElasticSearchLogger.js +14 -10
- package/src/engine/navigation/ecs/path_following/PathFollower.js +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +5 -2
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +17 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
- package/src/engine/scene/SceneManager.d.ts.map +1 -1
- package/src/engine/scene/SceneManager.js +4 -2
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/simulation/Ticker.js +9 -0
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +6 -1
- package/src/engine/sound/material/concrete/json/serializeSoundMaterialToJSON.js +1 -1
- package/src/generation/theme/ThemeEngine.d.ts +9 -0
- package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
- package/src/generation/theme/ThemeEngine.js +37 -2
|
@@ -83,7 +83,7 @@ export class AnimationClip {
|
|
|
83
83
|
if (typeof json.repeatCount === "number") {
|
|
84
84
|
this.repeatCount.fromJSON(json.repeatCount);
|
|
85
85
|
} else {
|
|
86
|
-
this.repeatCount.set(
|
|
86
|
+
this.repeatCount.set(1);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (typeof json.weight === "number") {
|
|
@@ -75,9 +75,9 @@ export class AttachmentSystem extends System {
|
|
|
75
75
|
let numRecords = waiting.length;
|
|
76
76
|
|
|
77
77
|
for (let i = 0; i < numRecords; i++) {
|
|
78
|
-
const
|
|
78
|
+
const record = waiting[i];
|
|
79
79
|
|
|
80
|
-
if (
|
|
80
|
+
if (record === entity) {
|
|
81
81
|
waiting.splice(i, 1);
|
|
82
82
|
removedCount++;
|
|
83
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransformAttachmentBinding.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/attachment/TransformAttachmentBinding.js"],"names":[],"mappings":"AAOA;
|
|
1
|
+
{"version":3,"file":"TransformAttachmentBinding.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/attachment/TransformAttachmentBinding.js"],"names":[],"mappings":"AAOA;CA2CC;kCAjDiC,wBAAwB"}
|
|
@@ -30,11 +30,22 @@ export class TransformAttachmentBinding extends AttachmentBinding {
|
|
|
30
30
|
this.parentTransform.position.onChanged.add(this.update, this);
|
|
31
31
|
this.parentTransform.rotation.onChanged.add(this.update, this);
|
|
32
32
|
this.parentTransform.scale.onChanged.add(this.update, this);
|
|
33
|
+
|
|
34
|
+
// update() also composes the attachment's local socket offset, so changes
|
|
35
|
+
// to it must trigger a recompute too — otherwise a moved socket offset only
|
|
36
|
+
// takes effect the next time the parent transform happens to change.
|
|
37
|
+
this.attachment.transform.position.onChanged.add(this.update, this);
|
|
38
|
+
this.attachment.transform.rotation.onChanged.add(this.update, this);
|
|
39
|
+
this.attachment.transform.scale.onChanged.add(this.update, this);
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
unlink() {
|
|
36
43
|
this.parentTransform.position.onChanged.remove(this.update, this);
|
|
37
44
|
this.parentTransform.rotation.onChanged.remove(this.update, this);
|
|
38
45
|
this.parentTransform.scale.onChanged.remove(this.update, this);
|
|
46
|
+
|
|
47
|
+
this.attachment.transform.position.onChanged.remove(this.update, this);
|
|
48
|
+
this.attachment.transform.rotation.onChanged.remove(this.update, this);
|
|
49
|
+
this.attachment.transform.scale.onChanged.remove(this.update, this);
|
|
39
50
|
}
|
|
40
51
|
}
|
|
@@ -559,8 +559,8 @@ export class FogOfWar {
|
|
|
559
559
|
rebuildSampler() {
|
|
560
560
|
|
|
561
561
|
//resize the sampler
|
|
562
|
-
const
|
|
563
|
-
const
|
|
562
|
+
const samplerWidth = this.size.x + 2;
|
|
563
|
+
const samplerHeight = this.size.y + 2;
|
|
564
564
|
const uint8Array = new Uint8Array(samplerWidth * samplerHeight);
|
|
565
565
|
|
|
566
566
|
uint8Array.fill(255);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenSpaceFogOfWarShader.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,kDAFW,cAAc,
|
|
1
|
+
{"version":3,"file":"screenSpaceFogOfWarShader.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,kDAFW,cAAc,CAyJxB;+BA9JyE,OAAO"}
|
|
@@ -64,6 +64,11 @@ export function buildScreenSpaceFogOfWarShader() {
|
|
|
64
64
|
float Gaussian(float sigma2_sq, float x){
|
|
65
65
|
return exp(-(x*x) / sigma2_sq);
|
|
66
66
|
}
|
|
67
|
+
|
|
68
|
+
// interleaved gradient noise (Jimenez 2014, "Next Generation Post Processing in Call of Duty")
|
|
69
|
+
float gradientNoise(const in vec2 fragCoord){
|
|
70
|
+
return fract(52.9829189 * fract(dot(fragCoord, vec2(0.06711056, 0.00583715))));
|
|
71
|
+
}
|
|
67
72
|
|
|
68
73
|
float getFog(const in vec2 uv){
|
|
69
74
|
|
|
@@ -104,6 +109,9 @@ export function buildScreenSpaceFogOfWarShader() {
|
|
|
104
109
|
|
|
105
110
|
gl_FragColor = uColor;
|
|
106
111
|
gl_FragColor.a *= fogValue;
|
|
112
|
+
|
|
113
|
+
// dither the alpha ramp to break up 8-bit quantization banding
|
|
114
|
+
gl_FragColor.a += gradientNoise(gl_FragCoord.xy) * (1.0 / 255.0) - (0.5 / 255.0);
|
|
107
115
|
}
|
|
108
116
|
`;
|
|
109
117
|
}
|
|
@@ -50,10 +50,11 @@ declare class ViewportPosition {
|
|
|
50
50
|
*/
|
|
51
51
|
equals(other: ViewportPosition): boolean;
|
|
52
52
|
hash(): number;
|
|
53
|
-
fromJSON({ position, offset, anchor, screenEdgeWidth, stickToScreenEdge, enabled, }: {
|
|
53
|
+
fromJSON({ position, offset, anchor, resolveGuiCollisions, screenEdgeWidth, stickToScreenEdge, enabled, }: {
|
|
54
54
|
position?: Vector2;
|
|
55
55
|
offset?: Vector2;
|
|
56
56
|
anchor?: Vector2;
|
|
57
|
+
resolveGuiCollisions?: boolean;
|
|
57
58
|
screenEdgeWidth?: number;
|
|
58
59
|
stickToScreenEdge?: boolean;
|
|
59
60
|
enabled?: boolean;
|
|
@@ -71,6 +72,7 @@ declare class ViewportPosition {
|
|
|
71
72
|
x: number;
|
|
72
73
|
y: number;
|
|
73
74
|
};
|
|
75
|
+
resolveGuiCollisions: boolean;
|
|
74
76
|
screenEdgeWidth: number;
|
|
75
77
|
stickToScreenEdge: boolean;
|
|
76
78
|
enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportPosition.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPosition.js"],"names":[],"mappings":"oCAOU,MAAM;;;;;;AAOhB;
|
|
1
|
+
{"version":3,"file":"ViewportPosition.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPosition.js"],"names":[],"mappings":"oCAOU,MAAM;;;;;;AAOhB;IA0GI,4CAMC;IA/GD;;;OAGG;IACH,UAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,QAFU,OAAO,CAEM;IACvB;;;OAGG;IACH,QAFU,OAAO,CAEU;IAG3B;;;;OAIG;IACH,sBAFU,OAAO,CAEY;IAE7B;;;;OAIG;IACH,iBAFU,MAAM,CAEK;IAGrB;;;OAGG;IACH,mBAFU,OAAO,CAES;IAE1B;;;OAGG;IACH,SAFU,eAAe,CAEW;IAEpC;;;;OAIG;IACH,cAHW,gBAAgB,GACd,OAAO,CAWnB;IAED,eAUC;IAED;;;;;;;;aAkBC;IAED;;;;;;;;;;;;;;;;;MAUC;CASJ;;;;;oBA9HmB,kCAAkC;4BAC1B,2CAA2C"}
|
|
@@ -91,7 +91,8 @@ class ViewportPosition {
|
|
|
91
91
|
position = Vector2.zero,
|
|
92
92
|
offset = Vector2.zero,
|
|
93
93
|
anchor = Vector2.zero,
|
|
94
|
-
|
|
94
|
+
resolveGuiCollisions = false,
|
|
95
|
+
screenEdgeWidth = 10,
|
|
95
96
|
stickToScreenEdge = false,
|
|
96
97
|
enabled = true,
|
|
97
98
|
}
|
|
@@ -99,6 +100,7 @@ class ViewportPosition {
|
|
|
99
100
|
this.position.fromJSON(position);
|
|
100
101
|
this.offset.fromJSON(offset);
|
|
101
102
|
this.anchor.fromJSON(anchor);
|
|
103
|
+
this.resolveGuiCollisions = resolveGuiCollisions;
|
|
102
104
|
this.screenEdgeWidth = screenEdgeWidth;
|
|
103
105
|
this.stickToScreenEdge = stickToScreenEdge;
|
|
104
106
|
this.enabled.fromJSON(enabled);
|
|
@@ -109,6 +111,7 @@ class ViewportPosition {
|
|
|
109
111
|
position: this.position.toJSON(),
|
|
110
112
|
offset: this.offset.toJSON(),
|
|
111
113
|
anchor: this.anchor.toJSON(),
|
|
114
|
+
resolveGuiCollisions: this.resolveGuiCollisions,
|
|
112
115
|
screenEdgeWidth: this.screenEdgeWidth,
|
|
113
116
|
stickToScreenEdge: this.stickToScreenEdge,
|
|
114
117
|
enabled: this.enabled.toJSON()
|
|
@@ -36,6 +36,15 @@ export class BinarySerializationRegistry {
|
|
|
36
36
|
* @returns {BinaryClassSerializationAdapter|undefined}
|
|
37
37
|
*/
|
|
38
38
|
removeAdapter(className: string): BinaryClassSerializationAdapter | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Reverse of {@link registerAdapter}: resolve the registered class name for a given class (constructor).
|
|
41
|
+
* Useful when serializing a value whose class name is not known up-front — obtain the constructor via
|
|
42
|
+
* `Object.getPrototypeOf(value).constructor` and look it up here. Does not read or mutate any instance.
|
|
43
|
+
*
|
|
44
|
+
* @param {Function} klass class/constructor to look up
|
|
45
|
+
* @returns {string|undefined} the class name under which an adapter is registered, or `undefined` if none
|
|
46
|
+
*/
|
|
47
|
+
getClassName(klass: Function): string | undefined;
|
|
39
48
|
/**
|
|
40
49
|
*
|
|
41
50
|
* @param {string} className
|
|
@@ -62,5 +71,6 @@ export class BinarySerializationRegistry {
|
|
|
62
71
|
* @type {boolean}
|
|
63
72
|
*/
|
|
64
73
|
readonly isBinarySerializationRegistry: boolean;
|
|
74
|
+
#private;
|
|
65
75
|
}
|
|
66
76
|
//# sourceMappingURL=BinarySerializationRegistry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinarySerializationRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinarySerializationRegistry.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH;IAEI;;;;OAIG;IACH,2BAAsB;IACtB;;;;OAIG;IACH,6BAAwB;
|
|
1
|
+
{"version":3,"file":"BinarySerializationRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinarySerializationRegistry.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH;IAEI;;;;OAIG;IACH,2BAAsB;IACtB;;;;OAIG;IACH,6BAAwB;IAWxB;;;OAGG;IACH,2BAFW,iCAAiC,QAM3C;IAED;;;;;;OAMG;IACH,sEAJW,MAAM,GACJ,OAAO,CAyCnB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,kCAAgC,SAAS,CA2BrD;IAED;;;;;;;OAOG;IACH,+BAFa,MAAM,GAAC,SAAS,CAI5B;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,kCAAgC,SAAS,CAMrD;IAED;;;;;OAKG;IACH,4BAJW,MAAM,kCAEJ,OAAO,CA6CnB;IAED;;;;;;OAMG;IACH,6BALW,MAAM,gBACN,MAAM,eACN,MAAM,GACJ,qBAAqB,GAAC,IAAI,CA0DtC;IAIL;;;OAGG;IACH,wCAFU,OAAO,CAEkD;;CANlE"}
|
|
@@ -22,6 +22,15 @@ export class BinarySerializationRegistry {
|
|
|
22
22
|
*/
|
|
23
23
|
serializers = new Map();
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Reverse index of the {@link serializers} map, keyed by the adapter's {@link BinaryClassSerializationAdapter.klass}.
|
|
27
|
+
* Lets callers resolve the registered class name of a value from its constructor without touching the value itself.
|
|
28
|
+
* When one class is registered under several names, the first registered name wins (mirrors {@link serializers}).
|
|
29
|
+
* @readonly
|
|
30
|
+
* @type {Map<Function, string>}
|
|
31
|
+
*/
|
|
32
|
+
#klass_to_name = new Map();
|
|
33
|
+
|
|
25
34
|
/**
|
|
26
35
|
*
|
|
27
36
|
* @param {BinaryClassSerializationAdapter[]} adapters
|
|
@@ -69,6 +78,13 @@ export class BinarySerializationRegistry {
|
|
|
69
78
|
|
|
70
79
|
this.serializers.set(_className, adapter);
|
|
71
80
|
|
|
81
|
+
const klass = adapter.klass;
|
|
82
|
+
|
|
83
|
+
if (klass !== null && klass !== undefined && !this.#klass_to_name.has(klass)) {
|
|
84
|
+
// record reverse mapping, first registered name wins
|
|
85
|
+
this.#klass_to_name.set(klass, _className);
|
|
86
|
+
}
|
|
87
|
+
|
|
72
88
|
return true;
|
|
73
89
|
}
|
|
74
90
|
|
|
@@ -84,11 +100,38 @@ export class BinarySerializationRegistry {
|
|
|
84
100
|
|
|
85
101
|
if (adapter !== undefined) {
|
|
86
102
|
this.serializers.delete(className);
|
|
103
|
+
|
|
104
|
+
const klass = adapter.klass;
|
|
105
|
+
|
|
106
|
+
if (klass !== null && klass !== undefined && this.#klass_to_name.get(klass) === className) {
|
|
107
|
+
// this name owned the reverse mapping; hand it to another surviving name for the same class if
|
|
108
|
+
// one exists, so getClassName stays consistent when a class is registered under several names
|
|
109
|
+
this.#klass_to_name.delete(klass);
|
|
110
|
+
|
|
111
|
+
for (const [otherName, otherAdapter] of this.serializers) {
|
|
112
|
+
if (otherAdapter.klass === klass) {
|
|
113
|
+
this.#klass_to_name.set(klass, otherName);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
87
118
|
}
|
|
88
119
|
|
|
89
120
|
return adapter;
|
|
90
121
|
}
|
|
91
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Reverse of {@link registerAdapter}: resolve the registered class name for a given class (constructor).
|
|
125
|
+
* Useful when serializing a value whose class name is not known up-front — obtain the constructor via
|
|
126
|
+
* `Object.getPrototypeOf(value).constructor` and look it up here. Does not read or mutate any instance.
|
|
127
|
+
*
|
|
128
|
+
* @param {Function} klass class/constructor to look up
|
|
129
|
+
* @returns {string|undefined} the class name under which an adapter is registered, or `undefined` if none
|
|
130
|
+
*/
|
|
131
|
+
getClassName(klass) {
|
|
132
|
+
return this.#klass_to_name.get(klass);
|
|
133
|
+
}
|
|
134
|
+
|
|
92
135
|
/**
|
|
93
136
|
*
|
|
94
137
|
* @param {string} className
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A resolved class-table entry. Migration is resolved lazily, on the first adapter-encoded object of the class,
|
|
3
|
+
* because whether a class was written via an adapter (and therefore whether the stored version needs migrating) is
|
|
4
|
+
* a property of the object tag in the body, not of the reader's registry.
|
|
5
|
+
*
|
|
6
|
+
* @typedef {Object} ResolvedClass
|
|
7
|
+
* @property {string} typeName
|
|
8
|
+
* @property {number} version version the data was written with
|
|
9
|
+
* @property {BinaryClassSerializationAdapter|undefined} adapter registered adapter, or undefined
|
|
10
|
+
* @property {Function|undefined} Klass constructor to instantiate, or undefined if unresolvable
|
|
11
|
+
* @property {BinaryClassUpgrader[]|null} migrators cached migrator chain (null = none needed)
|
|
12
|
+
* @property {boolean} migratorsResolved whether the migrator chain has been computed yet
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Reader half of the general object-graph binary serializer. Consumes documents produced by
|
|
16
|
+
* {@link BinaryObjectSerializer}.
|
|
17
|
+
*
|
|
18
|
+
* Needs:
|
|
19
|
+
* - a {@link BinarySerializationRegistry} for hand-written adapters and version migrators;
|
|
20
|
+
* - a {@link ModuleRegistry} mapping `typeName -> class` so reflective (adapter-less) class instances can be
|
|
21
|
+
* reconstructed. It may be omitted if the data contains no reflective class instances (plain objects, arrays and
|
|
22
|
+
* adapter-backed classes need no module registry).
|
|
23
|
+
*
|
|
24
|
+
* @author Alex Goldring
|
|
25
|
+
* @copyright Company Named Limited (c) 2026
|
|
26
|
+
*/
|
|
27
|
+
export class BinaryObjectDeSerializer {
|
|
28
|
+
/**
|
|
29
|
+
* @param {BinarySerializationRegistry} registry
|
|
30
|
+
* @param {ModuleRegistry} [modules] required only if the data contains reflective (adapter-less) class instances
|
|
31
|
+
*/
|
|
32
|
+
constructor(registry: BinarySerializationRegistry, modules?: ModuleRegistry);
|
|
33
|
+
/**
|
|
34
|
+
* @param {BinarySerializationRegistry} registry
|
|
35
|
+
*/
|
|
36
|
+
setRegistry(registry: BinarySerializationRegistry): void;
|
|
37
|
+
/**
|
|
38
|
+
* @param {ModuleRegistry} [modules]
|
|
39
|
+
*/
|
|
40
|
+
setModuleRegistry(modules?: ModuleRegistry): void;
|
|
41
|
+
/**
|
|
42
|
+
* Deserialize a complete document written by {@link BinaryObjectSerializer.serialize}.
|
|
43
|
+
*
|
|
44
|
+
* @template T
|
|
45
|
+
* @param {BinaryBuffer} buffer source, read at the current {@link BinaryBuffer.position}
|
|
46
|
+
* @returns {T}
|
|
47
|
+
*/
|
|
48
|
+
deserialize<T>(buffer: BinaryBuffer): T;
|
|
49
|
+
/**
|
|
50
|
+
* Read a single value. Nesting adapters call this to deserialize a child of any type.
|
|
51
|
+
*
|
|
52
|
+
* @template T
|
|
53
|
+
* @param {BinaryBuffer} buffer
|
|
54
|
+
* @returns {T}
|
|
55
|
+
*/
|
|
56
|
+
readValue<T_1>(buffer: BinaryBuffer): T_1;
|
|
57
|
+
/**
|
|
58
|
+
* @readonly
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
*/
|
|
61
|
+
readonly isBinaryObjectDeSerializer: boolean;
|
|
62
|
+
#private;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A resolved class-table entry. Migration is resolved lazily, on the first adapter-encoded object of the class,
|
|
66
|
+
* because whether a class was written via an adapter (and therefore whether the stored version needs migrating) is
|
|
67
|
+
* a property of the object tag in the body, not of the reader's registry.
|
|
68
|
+
*/
|
|
69
|
+
export type ResolvedClass = {
|
|
70
|
+
typeName: string;
|
|
71
|
+
/**
|
|
72
|
+
* version the data was written with
|
|
73
|
+
*/
|
|
74
|
+
version: number;
|
|
75
|
+
/**
|
|
76
|
+
* registered adapter, or undefined
|
|
77
|
+
*/
|
|
78
|
+
adapter: BinaryClassSerializationAdapter | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* constructor to instantiate, or undefined if unresolvable
|
|
81
|
+
*/
|
|
82
|
+
Klass: Function | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* cached migrator chain (null = none needed)
|
|
85
|
+
*/
|
|
86
|
+
migrators: BinaryClassUpgrader[] | null;
|
|
87
|
+
/**
|
|
88
|
+
* whether the migrator chain has been computed yet
|
|
89
|
+
*/
|
|
90
|
+
migratorsResolved: boolean;
|
|
91
|
+
};
|
|
92
|
+
import { BinaryBuffer } from "../../../../../core/binary/BinaryBuffer.js";
|
|
93
|
+
//# sourceMappingURL=BinaryObjectDeSerializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BinaryObjectDeSerializer.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;GAYG;AACH;IA4BI;;;OAGG;IACH,6EAGC;IAED;;OAEG;IACH,yDAKC;IAED;;OAEG;IACH,kDAEC;IAED;;;;;;OAMG;IACH,uBAHW,YAAY,KAwCtB;IA0BD;;;;;;OAMG;IACH,uBAHW,YAAY,OAgDtB;IAoFL;;;OAGG;IACH,qCAFU,OAAO,CAE4C;;CAN5D;;;;;;;cAvRa,MAAM;;;;aACN,MAAM;;;;aACN,kCAAgC,SAAS;;;;WACzC,WAAS,SAAS;;;;eAClB,qBAAqB,GAAC,IAAI;;;;uBAC1B,OAAO;;6BAjCQ,4CAA4C"}
|