@woosh/meep-engine 2.164.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/build/bundle-worker-terrain.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/binary/BitImage2.d.ts +91 -0
- package/src/core/binary/BitImage2.d.ts.map +1 -0
- package/src/core/binary/BitImage2.js +242 -0
- 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/core/geom/2d/oriented-box/min_area_rect_2d.d.ts +22 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts.map +1 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.js +69 -0
- package/src/core/geom/2d/packing/skyline.d.ts +116 -0
- package/src/core/geom/2d/packing/skyline.d.ts.map +1 -0
- package/src/core/geom/2d/packing/skyline.js +258 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts +18 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts.map +1 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.js +86 -0
- package/src/core/geom/3d/atlas/ATLAS_PORT_PLAN.md +486 -0
- package/src/core/geom/3d/atlas/BFF_PLAN.md +174 -0
- package/src/core/geom/3d/atlas/Chart.d.ts +58 -0
- package/src/core/geom/3d/atlas/Chart.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/Chart.js +77 -0
- package/src/core/geom/3d/atlas/REVIEW_02.md +392 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts +73 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.js +315 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.d.ts +17 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.js +16 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts +25 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.js +188 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts +17 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.js +107 -0
- package/src/core/geom/3d/atlas/atlas_generate.d.ts +39 -0
- package/src/core/geom/3d/atlas/atlas_generate.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_generate.js +43 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts +84 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.js +266 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts +25 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.js +36 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts +22 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.js +62 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts +9 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.js +33 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts +9 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.js +50 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts +27 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.js +39 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts +22 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.js +57 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts +36 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.js +46 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts +62 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.js +551 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts +22 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.js +73 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts +37 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.js +270 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts +23 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.js +224 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts +14 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.js +38 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts +22 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.js +86 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts +20 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.js +183 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts +27 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.js +66 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts +31 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.js +40 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts +23 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.js +136 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts +24 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.js +77 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts +27 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.js +113 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts +44 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.js +275 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts +22 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.js +199 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts +32 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.js +64 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts +20 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.js +66 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +13 -11
- package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.js +4 -3
- package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +4 -3
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +4 -3
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.js +10 -6
- package/src/core/geom/3d/topology/struct/TopoMesh.js +2 -2
- package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoTriangle.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.js +8 -27
- package/src/core/geom/vec3/v3_cotangent.d.ts +20 -0
- package/src/core/geom/vec3/v3_cotangent.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_cotangent.js +29 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.d.ts +19 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.js +30 -0
- package/src/core/geom/vec3/v3_multiply.d.ts +16 -0
- package/src/core/geom/vec3/v3_multiply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_multiply.js +19 -0
- package/src/core/math/linalg/cg/cg_solve.d.ts +24 -0
- package/src/core/math/linalg/cg/cg_solve.d.ts.map +1 -0
- package/src/core/math/linalg/cg/cg_solve.js +106 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts +21 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts.map +1 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.js +59 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts +19 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts.map +1 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.js +117 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts +50 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.js +88 -0
- package/src/core/math/linalg/sparse/spm_matvec.d.ts +9 -0
- package/src/core/math/linalg/sparse/spm_matvec.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/spm_matvec.js +22 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts +12 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.js +29 -0
- package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.d.ts +39 -0
- package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.js +22 -1
- package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.d.ts.map +1 -1
- package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.js +32 -9
- package/src/core/math/physics/mie/compute_mie_phase.d.ts +2 -3
- package/src/core/math/physics/mie/compute_mie_phase.d.ts.map +1 -1
- package/src/core/math/physics/mie/compute_mie_phase.js +1 -3
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +0 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.js +0 -7
- 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 +14 -3
- 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 +3 -3
- 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/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.js +4 -3
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +2 -2
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +9 -8
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +2 -1
- 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/decal/v2/FPDecalSystem.js +2 -2
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +2 -2
- 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/ShadedGeometry.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +0 -1
- package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.js +1 -1
- package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.js +8 -7
- 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/MikkT/AvgTSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/AvgTSpace.js +11 -6
- package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.js +2 -3
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +3 -4
- package/src/engine/graphics/geometry/MikkT/DegenEpilogue.js +4 -4
- package/src/engine/graphics/geometry/MikkT/EvalTspace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/EvalTspace.js +11 -8
- package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.js +7 -8
- package/src/engine/graphics/geometry/MikkT/GenerateTSpaces.js +8 -8
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +30 -25
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +7 -7
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts +0 -1
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.js +6 -4
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts +0 -2
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +3 -3
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts +0 -2
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.js +0 -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/impostors/octahedral/ImpostorBaker.d.ts +0 -2
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +4 -3
- package/src/engine/graphics/impostors/octahedral/grid/HemiOctahedralUvEncoder.js +2 -2
- package/src/engine/graphics/impostors/octahedral/grid/UvEncoder.d.ts +17 -7
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +2 -2
- 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/engine/utils/volume/ParticleVolume.js +3 -3
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +4 -3
- 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/LightManager.js +2 -2
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +0 -2
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/model/Decal.js +3 -3
- package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
- package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +4 -3
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +6 -4
- 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/ARTIFACTS_PLAN.md +146 -0
- package/src/engine/graphics/sh3/lightmap/CODE_REVIEW.md +121 -0
- package/src/engine/graphics/sh3/lightmap/LIGHTMAPPER_REVIEW.md +183 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts +90 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.js +681 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts +32 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.js +155 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts +49 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.js +136 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts +19 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.js +89 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts +54 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.js +168 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts +30 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.js +145 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts +38 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.js +152 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts +2 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.js +186 -0
- 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/PathTracedMesh.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +2 -2
- 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/path_tracer/prepare_scene_gltf.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js +6 -4
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +3 -3
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +5 -4
- 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/sh3/sky/hosek/prototype_hosek.js +2 -2
- 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/devices/KeyboardDevice.d.ts +61 -14
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +41 -15
- package/src/engine/input/devices/isHTMLElementFocusable.d.ts.map +1 -1
- package/src/engine/input/devices/isHTMLElementFocusable.js +2 -9
- 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/engine/sound/simulation/prototypeAcousticSolver.js +261 -143
- 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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convenience base class for a hand-written {@link BinaryClassSerializationAdapter} whose class nests other objects
|
|
3
|
+
* that should be serialized through the object-graph system (so they share its reference de-duplication, class table
|
|
4
|
+
* and shape table).
|
|
5
|
+
*
|
|
6
|
+
* Before every use, the driving context passes itself to {@link initialize}: a {@link BinaryObjectSerializer} while
|
|
7
|
+
* writing, a {@link BinaryObjectDeSerializer} while reading. Both expose `writeValue`/`readValue` respectively, so a
|
|
8
|
+
* subclass recurses with `this.context.writeValue(buffer, child)` / `this.context.readValue(buffer)`.
|
|
9
|
+
*
|
|
10
|
+
* Leaf adapters that only read/write primitives do not need this base class — extend
|
|
11
|
+
* {@link BinaryClassSerializationAdapter} directly and ignore the context.
|
|
12
|
+
*
|
|
13
|
+
* Lifecycle note: the object-graph driver calls {@link initialize} before *every* object it (de)serializes (to
|
|
14
|
+
* re-bind the current context) and never calls `finalize()`. Adapters used on this path must therefore not rely on
|
|
15
|
+
* the once-per-run acquire/`finalize`-release lifecycle that the ECS collection path provides.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* class InventoryAdapter extends ObjectSerializationAdapter {
|
|
19
|
+
* klass = Inventory;
|
|
20
|
+
* version = 0;
|
|
21
|
+
*
|
|
22
|
+
* serialize(buffer, inventory) {
|
|
23
|
+
* buffer.writeUintVar(inventory.items.length);
|
|
24
|
+
* for (const item of inventory.items) {
|
|
25
|
+
* this.context.writeValue(buffer, item); // any registered type, plain object, or null
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* deserialize(buffer, inventory) {
|
|
30
|
+
* const n = buffer.readUintVar();
|
|
31
|
+
* for (let i = 0; i < n; i++) {
|
|
32
|
+
* inventory.items.push(this.context.readValue(buffer));
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* @author Alex Goldring
|
|
38
|
+
* @copyright Company Named Limited (c) 2026
|
|
39
|
+
*/
|
|
40
|
+
export class ObjectSerializationAdapter extends BinaryClassSerializationAdapter<any> {
|
|
41
|
+
constructor();
|
|
42
|
+
/**
|
|
43
|
+
* The context driving the current (de)serialization, used to recurse into nested values.
|
|
44
|
+
* @type {BinaryObjectSerializer|BinaryObjectDeSerializer}
|
|
45
|
+
*/
|
|
46
|
+
context: BinaryObjectSerializer | BinaryObjectDeSerializer;
|
|
47
|
+
/**
|
|
48
|
+
* @param {BinaryObjectSerializer|BinaryObjectDeSerializer} context
|
|
49
|
+
*/
|
|
50
|
+
initialize(context: BinaryObjectSerializer | BinaryObjectDeSerializer): void;
|
|
51
|
+
}
|
|
52
|
+
import { BinaryClassSerializationAdapter } from "../BinaryClassSerializationAdapter.js";
|
|
53
|
+
//# sourceMappingURL=ObjectSerializationAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH;;IAEI;;;OAGG;IACH,SAFU,iDAA+C,CAE1C;IAEf;;OAEG;IACH,oBAFW,iDAA+C,QAIzD;CACJ;gDAvD+C,uCAAuC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BinaryClassSerializationAdapter } from "../BinaryClassSerializationAdapter.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Convenience base class for a hand-written {@link BinaryClassSerializationAdapter} whose class nests other objects
|
|
5
|
+
* that should be serialized through the object-graph system (so they share its reference de-duplication, class table
|
|
6
|
+
* and shape table).
|
|
7
|
+
*
|
|
8
|
+
* Before every use, the driving context passes itself to {@link initialize}: a {@link BinaryObjectSerializer} while
|
|
9
|
+
* writing, a {@link BinaryObjectDeSerializer} while reading. Both expose `writeValue`/`readValue` respectively, so a
|
|
10
|
+
* subclass recurses with `this.context.writeValue(buffer, child)` / `this.context.readValue(buffer)`.
|
|
11
|
+
*
|
|
12
|
+
* Leaf adapters that only read/write primitives do not need this base class — extend
|
|
13
|
+
* {@link BinaryClassSerializationAdapter} directly and ignore the context.
|
|
14
|
+
*
|
|
15
|
+
* Lifecycle note: the object-graph driver calls {@link initialize} before *every* object it (de)serializes (to
|
|
16
|
+
* re-bind the current context) and never calls `finalize()`. Adapters used on this path must therefore not rely on
|
|
17
|
+
* the once-per-run acquire/`finalize`-release lifecycle that the ECS collection path provides.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* class InventoryAdapter extends ObjectSerializationAdapter {
|
|
21
|
+
* klass = Inventory;
|
|
22
|
+
* version = 0;
|
|
23
|
+
*
|
|
24
|
+
* serialize(buffer, inventory) {
|
|
25
|
+
* buffer.writeUintVar(inventory.items.length);
|
|
26
|
+
* for (const item of inventory.items) {
|
|
27
|
+
* this.context.writeValue(buffer, item); // any registered type, plain object, or null
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* deserialize(buffer, inventory) {
|
|
32
|
+
* const n = buffer.readUintVar();
|
|
33
|
+
* for (let i = 0; i < n; i++) {
|
|
34
|
+
* inventory.items.push(this.context.readValue(buffer));
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* @author Alex Goldring
|
|
40
|
+
* @copyright Company Named Limited (c) 2026
|
|
41
|
+
*/
|
|
42
|
+
export class ObjectSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The context driving the current (de)serialization, used to recurse into nested values.
|
|
46
|
+
* @type {BinaryObjectSerializer|BinaryObjectDeSerializer}
|
|
47
|
+
*/
|
|
48
|
+
context = null;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {BinaryObjectSerializer|BinaryObjectDeSerializer} context
|
|
52
|
+
*/
|
|
53
|
+
initialize(context) {
|
|
54
|
+
this.context = context;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# object-v2 — general object-graph binary serialization
|
|
2
|
+
|
|
3
|
+
Serialize an arbitrary JavaScript object graph to a `BinaryBuffer` and back. Classes are serialized by **reflection by
|
|
4
|
+
default** — no per-class code required — and a hand-written adapter is an optional override for classes that want a
|
|
5
|
+
compact or custom encoding. Shared references and cycles are preserved; class names and field-name sets are interned so
|
|
6
|
+
repeated types are cheap.
|
|
7
|
+
|
|
8
|
+
See [DESIGN.md](./DESIGN.md) for the wire format and rationale.
|
|
9
|
+
|
|
10
|
+
## Quick start (reflection — no adapter)
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
import { BinaryBuffer } from "../../../../../core/binary/BinaryBuffer.js";
|
|
14
|
+
import { ModuleRegistry } from "../../../../../core/model/ModuleRegistry.js";
|
|
15
|
+
import { BinarySerializationRegistry } from "../BinarySerializationRegistry.js";
|
|
16
|
+
import { BinaryObjectSerializer } from "./BinaryObjectSerializer.js";
|
|
17
|
+
import { BinaryObjectDeSerializer } from "./BinaryObjectDeSerializer.js";
|
|
18
|
+
|
|
19
|
+
class Monster {
|
|
20
|
+
name = "";
|
|
21
|
+
hp = 0;
|
|
22
|
+
loot = [];
|
|
23
|
+
}
|
|
24
|
+
Monster.typeName = "Monster"; // stable identity (survives minification)
|
|
25
|
+
|
|
26
|
+
const registry = new BinarySerializationRegistry(); // no adapter needed
|
|
27
|
+
const modules = new ModuleRegistry();
|
|
28
|
+
modules.add("Monster", Monster); // so the reader can reconstruct it
|
|
29
|
+
|
|
30
|
+
const buffer = new BinaryBuffer();
|
|
31
|
+
new BinaryObjectSerializer(registry).serialize(buffer, someMonster);
|
|
32
|
+
|
|
33
|
+
buffer.position = 0;
|
|
34
|
+
const restored = new BinaryObjectDeSerializer(registry, modules).deserialize(buffer);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Plain objects and arrays need no registration at all:
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
new BinaryObjectSerializer(registry).serialize(buffer, { a: 1, tags: ["x", "y"], nested: { z: true } });
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Custom adapter (the override)
|
|
44
|
+
|
|
45
|
+
Register a `BinaryClassSerializationAdapter` and it takes over that class's encoding — used automatically wherever the
|
|
46
|
+
class appears in the graph:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
class Vector3Adapter extends BinaryClassSerializationAdapter {
|
|
50
|
+
klass = Vector3;
|
|
51
|
+
version = 0;
|
|
52
|
+
serialize(buffer, v) { buffer.writeFloat64(v.x); buffer.writeFloat64(v.y); buffer.writeFloat64(v.z); }
|
|
53
|
+
deserialize(buffer, v) { v.x = buffer.readFloat64(); v.y = buffer.readFloat64(); v.z = buffer.readFloat64(); }
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
registry.registerAdapter(new Vector3Adapter()); // Vector3 now uses this everywhere
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
A class that nests other objects extends `ObjectSerializationAdapter` and recurses through `this.context`:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
import { ObjectSerializationAdapter } from "./ObjectSerializationAdapter.js";
|
|
63
|
+
|
|
64
|
+
class BagAdapter extends ObjectSerializationAdapter {
|
|
65
|
+
klass = Bag;
|
|
66
|
+
version = 0;
|
|
67
|
+
serialize(buffer, bag) {
|
|
68
|
+
buffer.writeUintVar(bag.items.length);
|
|
69
|
+
for (const item of bag.items) this.context.writeValue(buffer, item); // any type, or null
|
|
70
|
+
}
|
|
71
|
+
deserialize(buffer, bag) {
|
|
72
|
+
const n = buffer.readUintVar();
|
|
73
|
+
for (let i = 0; i < n; i++) bag.items.push(this.context.readValue(buffer));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## References & cycles
|
|
79
|
+
|
|
80
|
+
Shared and cyclic references are preserved automatically:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
const shared = { id: 1 };
|
|
84
|
+
const restored = /* round trip */ { a: shared, b: shared };
|
|
85
|
+
restored.a === restored.b; // true
|
|
86
|
+
|
|
87
|
+
const node = {}; node.self = node;
|
|
88
|
+
/* round trip */ node.self === node; // true
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Versioning
|
|
92
|
+
|
|
93
|
+
Bump an adapter's `version` when its layout changes and register a migrator. Migration runs in **either** direction —
|
|
94
|
+
reading older *or* newer data works as long as a path exists:
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
class WidgetMigrator_0_1 extends BinaryClassUpgrader {
|
|
98
|
+
__startVersion = 0;
|
|
99
|
+
__targetVersion = 1;
|
|
100
|
+
upgrade(source, target) { /* read v0 bytes from source, write v1 bytes to target */ }
|
|
101
|
+
}
|
|
102
|
+
registry.registerUpgrader("Widget", new WidgetMigrator_0_1());
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## What it does not do
|
|
106
|
+
|
|
107
|
+
- **No native `Date`/`Map`/`Set`/typed arrays** — register an adapter for them.
|
|
108
|
+
- **No functions or symbols** (serialization throws; symbol/non-enumerable keys are ignored).
|
|
109
|
+
- **Reconstruction uses `new Klass()`** — classes need a no-argument constructor and must be registered (adapter or
|
|
110
|
+
module registry) so the reader can build them; only registered/plain types are ever instantiated.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write a string as `uvar(byteLength)` + raw UTF-8 bytes.
|
|
3
|
+
* @param {BinaryBuffer} buffer
|
|
4
|
+
* @param {string} value
|
|
5
|
+
*/
|
|
6
|
+
export function writeObjectString(buffer: BinaryBuffer, value: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Read a string written by {@link writeObjectString}.
|
|
9
|
+
* @param {BinaryBuffer} buffer
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
export function readObjectString(buffer: BinaryBuffer): string;
|
|
13
|
+
//# sourceMappingURL=objectStringCodec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectStringCodec.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/storage/binary/object-v2/objectStringCodec.js"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,+DAFW,MAAM,QAOhB;AAED;;;;GAIG;AACH,wDAFa,MAAM,CASlB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NUL-safe string codec for the object-graph serializer.
|
|
3
|
+
*
|
|
4
|
+
* The engine's {@link BinaryBuffer.writeUTF8String}/{@link BinaryBuffer.readUTF8String} pair is intentionally
|
|
5
|
+
* NUL-terminated on read (an in-band `0x00` byte ends the string), so it cannot round-trip strings — or object keys —
|
|
6
|
+
* that contain `U+0000`. Because this serializer must handle *arbitrary* strings and field names by reflection, it
|
|
7
|
+
* uses this byte-length-prefixed encoding instead: `uvar(byteLength)` followed by the raw UTF-8 bytes. There is no
|
|
8
|
+
* terminator, so every code point (including `U+0000`) round-trips, and a following value never desynchronizes.
|
|
9
|
+
*
|
|
10
|
+
* @author Alex Goldring
|
|
11
|
+
* @copyright Company Named Limited (c) 2026
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @type {TextEncoder}
|
|
16
|
+
*/
|
|
17
|
+
const ENCODER = new TextEncoder();
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @type {TextDecoder}
|
|
21
|
+
*/
|
|
22
|
+
const DECODER = new TextDecoder();
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Write a string as `uvar(byteLength)` + raw UTF-8 bytes.
|
|
26
|
+
* @param {BinaryBuffer} buffer
|
|
27
|
+
* @param {string} value
|
|
28
|
+
*/
|
|
29
|
+
export function writeObjectString(buffer, value) {
|
|
30
|
+
const bytes = ENCODER.encode(value);
|
|
31
|
+
|
|
32
|
+
buffer.writeUintVar(bytes.length);
|
|
33
|
+
buffer.writeBytes(bytes, 0, bytes.length);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Read a string written by {@link writeObjectString}.
|
|
38
|
+
* @param {BinaryBuffer} buffer
|
|
39
|
+
* @returns {string}
|
|
40
|
+
*/
|
|
41
|
+
export function readObjectString(buffer) {
|
|
42
|
+
const length = buffer.readUintVar();
|
|
43
|
+
|
|
44
|
+
const bytes = new Uint8Array(length);
|
|
45
|
+
buffer.readBytes(bytes, 0, length);
|
|
46
|
+
|
|
47
|
+
return DECODER.decode(bytes);
|
|
48
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialize `value` with a serializer built on `registry`, then deserialize it with a deserializer built on
|
|
3
|
+
* `registry` + `modules`. Shared by the object-graph specs.
|
|
4
|
+
*
|
|
5
|
+
* @template T
|
|
6
|
+
* @param {T} value
|
|
7
|
+
* @param {{registry?: BinarySerializationRegistry, modules?: ModuleRegistry}} [options]
|
|
8
|
+
* @returns {T}
|
|
9
|
+
*/
|
|
10
|
+
export function roundTrip<T>(value: T, { registry, modules }?: {
|
|
11
|
+
registry?: BinarySerializationRegistry;
|
|
12
|
+
modules?: ModuleRegistry;
|
|
13
|
+
}): T;
|
|
14
|
+
/**
|
|
15
|
+
* @param {*} value
|
|
16
|
+
* @param {BinarySerializationRegistry} [registry]
|
|
17
|
+
* @returns {BinaryBuffer} rewound to position 0
|
|
18
|
+
*/
|
|
19
|
+
export function serialize(value: any, registry?: BinarySerializationRegistry): BinaryBuffer;
|
|
20
|
+
/**
|
|
21
|
+
* @param {*} value
|
|
22
|
+
* @param {BinarySerializationRegistry} [registry]
|
|
23
|
+
* @returns {number} byte length of the serialized form
|
|
24
|
+
*/
|
|
25
|
+
export function serializedSize(value: any, registry?: BinarySerializationRegistry): number;
|
|
26
|
+
import { BinarySerializationRegistry } from "../BinarySerializationRegistry.js";
|
|
27
|
+
import { ModuleRegistry } from "../../../../../core/model/ModuleRegistry.js";
|
|
28
|
+
import { BinaryBuffer } from "../../../../../core/binary/BinaryBuffer.js";
|
|
29
|
+
//# sourceMappingURL=serializerTestHarness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializerTestHarness.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,+DAHW;IAAC,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAC,KAS5E;AAED;;;;GAIG;AACH,iDAHW,2BAA2B,GACzB,YAAY,CAQxB;AAED;;;;GAIG;AACH,sDAHW,2BAA2B,GACzB,MAAM,CAIlB;4CAzC2C,mCAAmC;+BADhD,6CAA6C;6BAD/C,4CAA4C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BinaryBuffer } from "../../../../../core/binary/BinaryBuffer.js";
|
|
2
|
+
import { ModuleRegistry } from "../../../../../core/model/ModuleRegistry.js";
|
|
3
|
+
import { BinarySerializationRegistry } from "../BinarySerializationRegistry.js";
|
|
4
|
+
import { BinaryObjectDeSerializer } from "./BinaryObjectDeSerializer.js";
|
|
5
|
+
import { BinaryObjectSerializer } from "./BinaryObjectSerializer.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Serialize `value` with a serializer built on `registry`, then deserialize it with a deserializer built on
|
|
9
|
+
* `registry` + `modules`. Shared by the object-graph specs.
|
|
10
|
+
*
|
|
11
|
+
* @template T
|
|
12
|
+
* @param {T} value
|
|
13
|
+
* @param {{registry?: BinarySerializationRegistry, modules?: ModuleRegistry}} [options]
|
|
14
|
+
* @returns {T}
|
|
15
|
+
*/
|
|
16
|
+
export function roundTrip(value, { registry = new BinarySerializationRegistry(), modules = new ModuleRegistry() } = {}) {
|
|
17
|
+
const buffer = serialize(value, registry);
|
|
18
|
+
|
|
19
|
+
buffer.position = 0;
|
|
20
|
+
|
|
21
|
+
return new BinaryObjectDeSerializer(registry, modules).deserialize(buffer);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {*} value
|
|
26
|
+
* @param {BinarySerializationRegistry} [registry]
|
|
27
|
+
* @returns {BinaryBuffer} rewound to position 0
|
|
28
|
+
*/
|
|
29
|
+
export function serialize(value, registry = new BinarySerializationRegistry()) {
|
|
30
|
+
const buffer = new BinaryBuffer();
|
|
31
|
+
|
|
32
|
+
new BinaryObjectSerializer(registry).serialize(buffer, value);
|
|
33
|
+
|
|
34
|
+
return buffer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {*} value
|
|
39
|
+
* @param {BinarySerializationRegistry} [registry]
|
|
40
|
+
* @returns {number} byte length of the serialized form
|
|
41
|
+
*/
|
|
42
|
+
export function serializedSize(value, registry = new BinarySerializationRegistry()) {
|
|
43
|
+
return serialize(value, registry).position;
|
|
44
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Terrain.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/ecs/Terrain.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Terrain.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/ecs/Terrain.js"],"names":[],"mappings":";AA8CA;IACI;;;OAGG;IACH,aAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,cAAU;IAEV;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,eAFU,sBAAsB,CAEa;IAE7C;;;OAGG;IACH,mBAFU,MAAM,CAE6B;IAE7C;;;;OAIG;IACH,YAFU,MAAM,CAED;IAEf;;;OAGG;IACH,eAFU,OAAO,CAEQ;IACzB;;;OAGG;IACH,SAFU,cAAc,CAEO;IAC/B;;;OAGG;IACH,gBAFU,YAAY,CAEK;IAE3B;;;OAGG;IACH,iBAFU,aAAa,CAEM;IAE7B;;;OAGG;IACH,oCAAyC;IAEzC;;;OAGG;IACH,cAFU,SAAS,CAEG;IAIlB;;;OAGG;IACH,QAFU,MAAM,CAEU;IAG1B;;;OAGG;IACH,aAFU,MAAM,CAEI;IAGpB;;;OAGG;IACH,eAFU,SAAS,CAE4B;IAE/C;;;OAGG;IACH,eAFU,WAAW,CAE4G;IAejI;;OAEG;IACH,yBAAqC;IAErC;;;;;;;;;OASG;IACH,0CAA+C;IAE/C;;;OAGG;IACH,eAFU,OAAO,CAEQ;IAEzB;;;;OAIG;IACH,2BAAuC;IAGvC;;;OAGG;IACH,SAFU,cAAc,CAEoB;IAE5C;;;;OAIG;IACH,gBAIE;IAMF;;;;OAIG;IACH,uBAA0B;IAE1B;;;OAGG;IACH,oBAAuB;IAEvB;;;;OAIG;IACH,6BAAgC;IAKpC;;;;OAIG;IACH,cAHW,MAAM,GAAC,YAAY,GACjB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,YAAY,GACjB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,YAAY,SACnB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,YAAY,GACjB,OAAO,CAInB;IAoBD,4BAEC;IApBD;;;;;;;;;;;;;OAaG;IACH,yBAEC;IAMD;;;OAGG;IACH,qCA0BC;IAED;;OAEG;IACH,eAyBC;IAED,gBAIC;IAED,mBAmBC;IAED,iCA4BC;IAED,6BAEC;IAED;;;;;;OAMG;IACH,gBANW,MAAM,KACN,MAAM,6EAiBhB;IAED;;;;;;;;;;OAUG;IACH,yBATW,aAAa,WACb,MAAM,WACN,MAAM,WACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,OAAO,CAQnB;IAED;;;;;;OAMG;IACH,kCALW,aAAa,KACb,MAAM,KACN,MAAM,GACL,OAAO,CAIlB;IAED;;;;;OAKG;IACH,gCAJW,cAAe,qDAmDzB;IAED;;;;;;OAMG;IACH,wBALW,MAAO,OAAO,CAAC,UACf,SAAS,qDAkBnB;IAED;;;;;OAKG;IACH,sBAJW,MAAM,KACN,MAAM,yBAiBhB;IAED;;;;OAIG;IACH,wCAFW,OAAO,QASjB;IAED;;;OAGG;IACH,gCAsBC;IAED,uBAmCC;IAED;;;OAGG;IACH,iCAIC;IAED;;;OAGG;IACH,8BAEC;IAED;;;OAGG;IACH,sCAyBC;IAED;;;OAGG;IACH,iBAFa,QAAQ,IAAI,CAAC,CAKzB;IAED,4BAiBC;IAED,0BAGC;IAED,oCAUC;IAED,yBAEC;IAED,2BAeC;IAED,uBAkBC;IAED;;;OAGG;IACH,wCAkDC;IArBG;;;;OAIG;IACH,WAHU,uBAAuB,CAGc;IAE/C;;;;OAIG;IACH,QAHU,QAAQ,kBAAkB,CAAC,CAGM;IAW/C;;;OAGG;IACH,gCAEC;IAED;;;OAGG;IACH,iBAYC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACL,QAAQ,WAAW,CAAC,CAqD/B;IAED;;;;OAIG;IACH;;;;;;;;;;6BAiDC;IAxBG,kBAA4B;IA0BhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAeC;CACJ;;;;uCAp8BsC,6BAA6B;oBAjBhD,kCAAkC;+BAUvB,sBAAsB;6BAQxB,yBAAyB;8BAHxB,2BAA2B;0BAlB/B,yCAAyC;mBAYhD,qBAAqB;0BAJd,gDAAgD;4BAVnE,OAAO;+BAYiB,8BAA8B;6BAYhC,mBAAmB;8BApBlB,2CAA2C;+BAa1C,gCAAgC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m4_allocate } from "../../../../core/geom/3d/mat4/m4_allocate.js";
|
|
2
|
+
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
2
3
|
import {
|
|
3
4
|
ClampToEdgeWrapping,
|
|
4
5
|
DataTexture,
|
|
@@ -184,7 +185,7 @@ class Terrain {
|
|
|
184
185
|
* @private
|
|
185
186
|
* @type {Float32Array}
|
|
186
187
|
*/
|
|
187
|
-
this.__transform_matrix =
|
|
188
|
+
this.__transform_matrix = m4_allocate();
|
|
188
189
|
|
|
189
190
|
|
|
190
191
|
/**
|
|
@@ -651,7 +652,7 @@ class Terrain {
|
|
|
651
652
|
* @param {mat4|Float32Array|number[]} m4
|
|
652
653
|
*/
|
|
653
654
|
set transform(m4) {
|
|
654
|
-
|
|
655
|
+
array_copy(m4, 0, this.__transform_matrix, 0, 16);
|
|
655
656
|
|
|
656
657
|
this.__tiles.transform = m4;
|
|
657
658
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m4_invert } from "../../../../core/geom/3d/mat4/m4_invert.js";
|
|
2
2
|
import {
|
|
3
3
|
Box3 as ThreeBox3,
|
|
4
4
|
BufferAttribute as ThreeBufferAttribute,
|
|
@@ -170,7 +170,7 @@ class TerrainTile {
|
|
|
170
170
|
|
|
171
171
|
const m4 = this.transform;
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
m4_invert(m4_tmp, m4);
|
|
174
174
|
|
|
175
175
|
ray3_compose_array(
|
|
176
176
|
ray_tmp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainTileManager.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/tiles/TerrainTileManager.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TerrainTileManager.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/tiles/TerrainTileManager.js"],"names":[],"mappings":";AA6BA;IA6DI;;;;;;;;OAQG;IACH,uDAPW,OAAO,EA2CjB;IAzGD;;;OAGG;IACH,OAFU,WAAW,EAAE,CAEZ;IAEX;;;MAGE;IAEF;;;OAGG;IACH,UAFU,OAAO,CAEc;IAE/B;;;OAGG;IACH,WAFU,OAAO,CAEa;IAC9B;;;OAGG;IACH,YAFU,eAAe,CAEW;IAEpC;;;OAGG;IACH,OAFU,OAAO,CAES;IAG1B;;;;OAIG;IACH,oBAAmC;IAEnC;;;OAGG;IACH,cAFU,GAAG,CAEG;IAEhB;;;OAGG;IACH,aAFU,eAAe,CAEe;IAExC;;;OAGG;IACH,yBAFU,OAAO,CAEe;IAyB5B,wBAA2C;IAE3C;;;;;;OAMG;IACH,eAFU,WAAS,IAAI,CAEW;IAGlC;;;OAGG;IACH,yBAA8B;IAQlC,iCAWC;IAED,8BAEC;IAED;;;;OAIG;IACH,2BAHW,MAAM,cACN,MAAM,QAiChB;IAED,mBAIC;IAED;;;OAGG;IACH,yBAFW,WAAW,QAuBrB;IAED;;;;OAIG;IACH,6CASC;IAED,qBAqBC;IAED;;OAEG;IACH,gBAIC;IAED;;;;;;OAMG;IACH,qBALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAuBhB;IAGD;;;;;;;OAOG;IACH,oCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,WAAW,EAAE,CAgCzB;IAED,wBAgDC;IAED;;;;;OAKG;IACH,oBAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAYlB;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,GACJ,WAAW,GAAC,SAAS,CAiBjC;IAED;;;;;OAKG;IACH,wBAJW,MAAM,KACN,MAAM,GACJ,WAAW,CAavB;IAED;;;;;OAKG;IACH,4BAJW,MAAM,KACN,MAAM,GACL,WAAW,GAAC,SAAS,CAahC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,KACN,MAAM,GACJ,QAAQ,WAAW,CAAC,CAYhC;IAED;;;;;;OAMG;IACH,UALW,MAAM,KACN,MAAM,GACJ,QAAQ,WAAW,CAAC,CA4BhC;IAED;;;OAGG;IACH,cAFW,WAAW,QAcrB;IAED,gBASC;IAED;;;;;;OAMG;IACH,cAJW,MAAM,KACN,MAAM,QACN,WAAW,QAsCrB;IAED;;;;;;;;;;OAUG;IACH,yBATW,aAAa,WACb,MAAM,WACN,MAAM,WACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,OAAO,CAuDnB;IAED;;;;;;OAMG;IACH,kCALW,aAAa,KACb,MAAM,KACN,MAAM,GACL,OAAO,CAOlB;IAED;;;;;;OAMG;IACH,SALW,MAAM,KACN,MAAM,mCAuFhB;CACJ;wBA9uBuB,kBAAkB;mBAVvB,0CAA0C;oBAGzC,kCAAkC;4BAG1B,2CAA2C;oBAVnD,mCAAmC;gCAQvB,mDAAmD;0BAGzD,yCAAyC;8BALrC,2CAA2C"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { mat4, vec3 } from "gl-matrix";
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
import { MeshPhongMaterial } from 'three';
|
|
2
|
+
import { m4_allocate } from "../../../../core/geom/3d/mat4/m4_allocate.js";
|
|
3
|
+
import { m4_invert } from "../../../../core/geom/3d/mat4/m4_invert.js";
|
|
4
|
+
import { v3_matrix4_multiply } from "../../../../core/geom/vec3/v3_matrix4_multiply.js";
|
|
5
|
+
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
5
6
|
import { assert } from "../../../../core/assert.js";
|
|
6
7
|
import { BVH } from "../../../../core/bvh2/bvh3/BVH.js";
|
|
7
8
|
import { bvh_query_leaves_ray } from "../../../../core/bvh2/bvh3/query/bvh_query_leaves_ray.js";
|
|
@@ -140,7 +141,7 @@ class TerrainTileManager {
|
|
|
140
141
|
return;
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
|
|
144
|
+
array_copy(m4, 0, this.__transform, 0, 16);
|
|
144
145
|
|
|
145
146
|
this.traverse(t => {
|
|
146
147
|
t.transform = m4;
|
|
@@ -458,14 +459,14 @@ class TerrainTileManager {
|
|
|
458
459
|
* @return {TerrainTile|undefined}
|
|
459
460
|
*/
|
|
460
461
|
getTileByWorldPosition2D(x, y) {
|
|
461
|
-
const v3 =
|
|
462
|
+
const v3 = Float32Array.of(x, 0, y);
|
|
462
463
|
|
|
463
|
-
const world_inverse =
|
|
464
|
+
const world_inverse = m4_allocate();
|
|
464
465
|
|
|
465
|
-
|
|
466
|
+
m4_invert(world_inverse, this.transform);
|
|
466
467
|
|
|
467
468
|
|
|
468
|
-
|
|
469
|
+
v3_matrix4_multiply(v3, 0, v3, 0, world_inverse);
|
|
469
470
|
|
|
470
471
|
return this.getRawTileByPosition(v3[0], v3[1]);
|
|
471
472
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphicsEngine.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics/GraphicsEngine.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GraphicsEngine.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics/GraphicsEngine.js"],"names":[],"mappings":"AAiEA;IAOI;;;;;OAKG;IACH,+BAJW,MAAM,EAgLhB;IAtLD,gCAEC;IAgBG;;;;OAIG;IACH,2BAA+C;IAK/C;;;;;QAOI;;WAEG;;QAEH;;WAEG;;;;;MAMN;IAED;;OAEG;IACH,YAFU,OAAO,CAEe;IAEhC;;;;;;OAMG;IACH,4BAFU,OAAO,CAEyB;IAE1C;;;OAGG;IACH,QAFU,kBAAkB,CAEU;IAWtC;;;OAGG;IACH,aAAkB;IAGlB;;;OAGG;IACH,cAFU,KAAK,CAEgB;IAK/B;;;OAGG;IACH,QAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,UAFU,aAAa,CAEH;IAGpB,+BAA0C;IAU1C;;OAEG;IACH,eAA+B;IAI/B;;;OAGG;IACH,uBAFU,kBAAkB,CAEgB;IAE5C;;;OAGG;IACH,oBAFU,iBAAiB,CAEsB;IAEjD;;;OAGG;IACH,gBAFU,iBAAiB,CAES;IAEpC;;;OAGG;IACH,sBAAoC;IAGpC;;;;OAIG;IACH,UAFU,OAAO,CAEG;IAEpB;;;OAGG;IACH,UAFU,OAAO,CAEG;IAEpB;;;OAGG;IACH,YAFU,MAAM,CAEG;IACnB,kKAcI;IAGR;;;OAGG;IACH,sBAFa,eAAe,CAI3B;IAED;;;OAGG;IACH,eAFa,aAAa,CAIzB;IAED;;;;;;;;;;;;;OAaG;IACH,iCAHW,MAAM,OAAO,eACb,4BAA4B,QAkCtC;IAED,mBA8BC;IAED;;;;OAIG;IACH,iCAEC;IAED;;;OAGG;IACH,0BAFa,MAAM,CAIlB;IAED,+BAcC;IAED,cAgEC;IAzBsB,8BAA0C;IA2BjE;;;OAGG;IACH,cAFa,MAAM,CAYlB;IAED;;OAEG;IACH,aAQC;IAED;;OAEG;IACH,yBAQC;IAED;;;;;;OAMG;IACH,yBALW,MAAM,KACN,MAAM,6CAMhB;IAED;;;;OAIG;IACH,8BAHW,OAAO,UAAQ,UACf,OAAO,UAAQ,QAczB;IAED;;;;;OAKG;IACH,8BAQC;IAED,0BAEC;IAED;;;OAGG;IACH,4BAFW,cAAc,QA8BxB;IAED;;OAEG;IACH,qBAqBC;IAED;;OAEG;IACH,0BAeC;IAED;;OAEG;IACH,eA8CC;;CACJ;mBA7oBkB,oCAAoC;oBACnC,4BAA4B;wBACxB,4BAA4B;mCAajB,uCAAuC;sBAlBnE,OAAO;uBAaS,wBAAwB;8BAbxC,OAAO;4BAYc,+BAA+B;mCAKxB,uCAAuC;kCAKxC,gCAAgC;kCADhC,oCAAoC;gCAPtC,uCAAuC;6CAW1B,2CAA2C;+BANzD,4BAA4B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ACESFilmicToneMapping,
|
|
2
3
|
CubeReflectionMapping,
|
|
3
4
|
EquirectangularReflectionMapping,
|
|
4
5
|
Group,
|
|
@@ -46,7 +47,7 @@ function configureThreeRenderer(webGLRenderer) {
|
|
|
46
47
|
webGLRenderer.autoClear = false;
|
|
47
48
|
webGLRenderer.setClearColor(0xBBBBFF, 0.0);
|
|
48
49
|
webGLRenderer.outputEncoding = LinearEncoding;
|
|
49
|
-
webGLRenderer.toneMapping =
|
|
50
|
+
webGLRenderer.toneMapping = ACESFilmicToneMapping;
|
|
50
51
|
webGLRenderer.toneMappingExposure = 1;
|
|
51
52
|
|
|
52
53
|
webGLRenderer.state.setFlipSided(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeScreenScissorFrustum.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/camera/makeScreenScissorFrustum.js"],"names":[],"mappings":"AAcA;;;;;GAKG;AACH,8EAFW,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"makeScreenScissorFrustum.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/camera/makeScreenScissorFrustum.js"],"names":[],"mappings":"AAcA;;;;;GAKG;AACH,8EAFW,MAAM,MAAM,QA0CtB"}
|
|
@@ -25,15 +25,17 @@ export function makeScreenScissorFrustum(output, box, camera) {
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
//convert box from view space into world space
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
//AABB2 y0 is the lower (bottom) bound and y1 the upper (top) bound in NDC,
|
|
29
|
+
//so top corners take y1 and bottom corners take y0
|
|
30
|
+
farTL.set(box.x0, box.y1, 1);
|
|
31
|
+
farTR.set(box.x1, box.y1, 1);
|
|
32
|
+
farBL.set(box.x0, box.y0, 1);
|
|
33
|
+
farBR.set(box.x1, box.y0, 1);
|
|
34
|
+
|
|
35
|
+
nearTL.set(box.x0, box.y1, -1);
|
|
36
|
+
nearTR.set(box.x1, box.y1, -1);
|
|
37
|
+
nearBL.set(box.x0, box.y0, -1);
|
|
38
|
+
nearBR.set(box.x1, box.y0, -1);
|
|
37
39
|
|
|
38
40
|
farTL.unproject(camera);
|
|
39
41
|
farTR.unproject(camera);
|
|
@@ -56,5 +58,4 @@ export function makeScreenScissorFrustum(output, box, camera) {
|
|
|
56
58
|
planes[4].setFromCoplanarPoints(nearTR, nearBR, nearBL);
|
|
57
59
|
|
|
58
60
|
planes[5].setFromCoplanarPoints(farBR, farTR, farTL);
|
|
59
|
-
planes[5].normal.multiplyScalar(-1);
|
|
60
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas2d_draw_linear_scale.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/canvas/canvas2d_draw_linear_scale.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,0IAVW,wBAAwB,
|
|
1
|
+
{"version":3,"file":"canvas2d_draw_linear_scale.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/canvas/canvas2d_draw_linear_scale.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,0IAVW,wBAAwB,QA2DlC"}
|
|
@@ -41,7 +41,9 @@ export function canvas2d_draw_linear_scale({
|
|
|
41
41
|
const direction_x = delta_x / distance;
|
|
42
42
|
const direction_y = delta_y / distance;
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
// largest multiple of `spacing` that still lands on or before the axis end;
|
|
45
|
+
// using ceil would place a final tick past position_1 with an extrapolated value
|
|
46
|
+
const mark_count = Math.floor(distance / spacing);
|
|
45
47
|
|
|
46
48
|
for (let i = 0; i <= mark_count; i++) {
|
|
47
49
|
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @returns {AnimationGraphDefinition}
|
|
10
10
|
*/
|
|
11
|
-
export function readAnimationGraphDefinitionFromJSON({ states, transitions, clips, notifications,
|
|
11
|
+
export function readAnimationGraphDefinitionFromJSON({ states, transitions, clips, notifications, startingSate }: any[]): AnimationGraphDefinition;
|
|
12
12
|
import { AnimationGraphDefinition } from "../AnimationGraphDefinition.js";
|
|
13
13
|
//# sourceMappingURL=readAnimationGraphDefinitionFromJSON.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readAnimationGraphDefinitionFromJSON.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,
|
|
1
|
+
{"version":3,"file":"readAnimationGraphDefinitionFromJSON.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,0HAFa,wBAAwB,CAsHpC;yCAhIwC,gCAAgC"}
|
|
@@ -22,7 +22,7 @@ export function readAnimationGraphDefinitionFromJSON(
|
|
|
22
22
|
transitions = [],
|
|
23
23
|
clips = [],
|
|
24
24
|
notifications = [],
|
|
25
|
-
|
|
25
|
+
startingSate = 0
|
|
26
26
|
}
|
|
27
27
|
) {
|
|
28
28
|
/**
|
|
@@ -127,7 +127,7 @@ export function readAnimationGraphDefinitionFromJSON(
|
|
|
127
127
|
|
|
128
128
|
graph.transitions = __transitions;
|
|
129
129
|
graph.states = __states;
|
|
130
|
-
graph.startingSate = __states[
|
|
130
|
+
graph.startingSate = __states[startingSate];
|
|
131
131
|
|
|
132
132
|
graph.build();
|
|
133
133
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeAnimationGraphDefinitionToJSON.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"writeAnimationGraphDefinitionToJSON.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,0FAgGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/camera/Camera.js"],"names":[],"mappings":"AAaA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"Camera.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/camera/Camera.js"],"names":[],"mappings":"AAaA;;GAEG;AACH;IAgJI;;;;;;;OAOG;IACH,0BANW,MAAM,GAAC,MAAM,iBAAiB,GAAC,MAAM,kBAAkB,KACvD,MAAM,KACN,MAAM,cACN,OAAO,iBACP,OAAO,QA+CjB;IAnMG;;;OAGG;IACH,UAFU,OAAO,CAEI;IAErB;;;OAGG;IACH,oBAFU,MAAM,CAEc;IAE9B,YAAkB;IAElB;;;OAGG;IACH,KAFU,OAAO,CAES;IAE1B;;;OAGG;IACH,gBAFU,aAAa,cAAc,CAAC,CAE4C;IAElF;;;OAGG;IACH,QAFU,eAAe,CAEc;IAEvC;;;;OAIG;IACH,mBAAqB;IAErB;;;;OAIG;IACH,oBAAsB;IAG1B;;;;OAIG;IACH,mEAEC;IAMD,0BAMC;IAVD,uBAEC;IAcD,2BAMC;IAVD,wBAEC;IAUD,uBAaC;IAED,2DAEC;IAED;;;OAGG;IACH,YAFW,MAAM,QAUhB;IAED;;;OAGG;IACH,SAFa,MAAM,CAQlB;IAED;;;MAKC;IAED,0BAQC;IAyDD;;;OAGG;IACH,kDAUC;IAED;;;;;;;;;;OAUG;IACH,0BATW,OAAO,YACP,MAAM,YACN,MAAM,YACN,MAAM,eACN,MAAM,eACN,MAAM,eACN,MAAM,eACN,MAAM,QAyBhB;IAED;;;;;;OAMG;IACH,kCALW,MAAM,KACN,MAAM,KACN,MAAM,UACN,OAAO,QAqBjB;CACJ;;;;;oBAlSmB,kCAAkC;yBAG7B,wCAAwC;+BAElC,qBAAqB;4BAHxB,2CAA2C;oBADnD,kCAAkC"}
|
|
@@ -123,6 +123,10 @@ export class Camera {
|
|
|
123
123
|
this.active.copy(other.active);
|
|
124
124
|
this.projectionType.copy(other.projectionType);
|
|
125
125
|
this.autoClip = other.autoClip;
|
|
126
|
+
this.autoClipHysteresis = other.autoClipHysteresis;
|
|
127
|
+
this.fov.copy(other.fov);
|
|
128
|
+
this.clip_near = other.clip_near;
|
|
129
|
+
this.clip_far = other.clip_far;
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto_set_camera_clipping_planes.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"auto_set_camera_clipping_planes.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js"],"names":[],"mappings":"AAyBA;;;;;;;GAOG;AACH,6FA2FC"}
|