@woosh/meep-engine 2.155.0 → 2.156.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/view/ecs/ComponentControlView.d.ts +0 -9
- package/editor/view/ecs/ComponentControlView.js +2 -98
- package/package.json +1 -1
- package/src/core/binary/32BitEncoder.js +1 -1
- package/src/core/binary/to_half_float_uint16.js +3 -3
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy_radix.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy_radix.js +275 -253
- package/src/core/cache/Cache.d.ts.map +1 -1
- package/src/core/cache/Cache.js +7 -0
- package/src/core/cache/FrequencySketch.d.ts.map +1 -1
- package/src/core/cache/FrequencySketch.js +8 -4
- package/src/core/clipboard/obtainClipBoard.d.ts +6 -0
- package/src/core/clipboard/obtainClipBoard.d.ts.map +1 -0
- package/src/core/clipboard/obtainClipBoard.js +29 -0
- package/src/core/clipboard/safeClipboardReadText.d.ts +6 -0
- package/src/core/clipboard/safeClipboardReadText.d.ts.map +1 -0
- package/src/core/clipboard/safeClipboardReadText.js +55 -0
- package/src/core/clipboard/safeClipboardWriteText.d.ts +8 -0
- package/src/core/clipboard/safeClipboardWriteText.d.ts.map +1 -0
- package/src/core/clipboard/safeClipboardWriteText.js +23 -0
- package/src/core/collection/array/array_quick_sort_by_lookup_map.js +1 -1
- package/src/core/collection/array/array_set_diff_sorting.d.ts.map +1 -1
- package/src/core/collection/array/array_set_diff_sorting.js +4 -1
- package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
- package/src/core/collection/array/array_shuffle.js +30 -27
- package/src/core/collection/array/binarySearchLowIndex.d.ts.map +1 -1
- package/src/core/collection/array/binarySearchLowIndex.js +4 -3
- package/src/core/collection/array/typed/array_buffer_hash.js +1 -1
- package/src/core/collection/array/typed/is_typed_array_equals.d.ts.map +1 -1
- package/src/core/collection/array/typed/is_typed_array_equals.js +12 -2
- package/src/core/collection/heap/BinaryHeap.d.ts.map +1 -1
- package/src/core/collection/heap/BinaryHeap.js +12 -2
- package/src/core/collection/queue/Deque.d.ts.map +1 -1
- package/src/core/collection/queue/Deque.js +10 -8
- package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTable.js +4 -2
- package/src/core/collection/table/RowFirstTableSpec.js +2 -2
- package/src/core/color/operations/color_lerp.d.ts.map +1 -1
- package/src/core/color/operations/color_lerp.js +10 -3
- package/src/core/color/rgb2uint32.js +1 -1
- package/src/core/color/rgbe9995_to_rgb.js +1 -1
- package/src/core/function/objectsEqual.d.ts.map +1 -1
- package/src/core/function/objectsEqual.js +2 -1
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +12 -11
- package/src/core/geom/2d/convex-hull/convex_hull_jarvis_2d.d.ts.map +1 -1
- package/src/core/geom/2d/convex-hull/convex_hull_jarvis_2d.js +30 -4
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts.map +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +6 -2
- package/src/core/geom/2d/hash-grid/SpatialHashGrid.d.ts.map +1 -1
- package/src/core/geom/2d/hash-grid/SpatialHashGrid.js +388 -386
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.d.ts.map +1 -1
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.js +8 -3
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +9 -1
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts +3 -1
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts.map +1 -1
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.js +3 -1
- package/src/core/geom/2d/quad-tree-binary/QuadTree.js +714 -714
- package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -1
- package/src/core/geom/2d/r-tree/StaticR2Tree.js +5 -4
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +33 -29
- package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.js +3 -1
- package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.js +10 -7
- package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.js +30 -9
- package/src/core/geom/3d/aabb/compute_aabb_from_points.js +3 -3
- package/src/core/geom/3d/box/box3_raycast.d.ts +37 -0
- package/src/core/geom/3d/box/box3_raycast.d.ts.map +1 -0
- package/src/core/geom/3d/box/box3_raycast.js +81 -0
- package/src/core/geom/3d/capsule/capsule_raycast.d.ts +35 -0
- package/src/core/geom/3d/capsule/capsule_raycast.d.ts.map +1 -0
- package/src/core/geom/3d/capsule/capsule_raycast.js +93 -0
- package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.d.ts.map +1 -1
- package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.js +4 -0
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +1 -1
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.d.ts.map +1 -1
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.js +3 -2
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.js +12 -2
- package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.js +2 -2
- package/src/core/geom/3d/mat4/m4_multiply_alphatensor.d.ts +1 -1
- package/src/core/geom/3d/mat4/m4_multiply_alphatensor.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/m4_multiply_alphatensor.js +19 -13
- package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.d.ts.map +1 -1
- package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.js +3 -2
- package/src/core/geom/3d/plane/plane3_compute_plane_intersection.js +3 -2
- package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/MeshShape3D.js +7 -0
- package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnionShape3D.js +3 -2
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -1
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +153 -148
- 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 +7 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.js +13 -10
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.d.ts +1 -1
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.js +2 -2
- package/src/core/geom/3d/sphere/sphere_raycast.d.ts +33 -0
- package/src/core/geom/3d/sphere/sphere_raycast.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_raycast.js +47 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts +24 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.js +39 -0
- package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.js +4 -2
- package/src/core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.js +3 -3
- package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +1 -1
- package/src/core/geom/3d/topology/tm_vertex_compute_normal.d.ts.map +1 -1
- package/src/core/geom/3d/topology/tm_vertex_compute_normal.js +4 -2
- package/src/core/geom/3d/util/make_justified_point_grid.d.ts.map +1 -1
- package/src/core/geom/3d/util/make_justified_point_grid.js +18 -10
- package/src/core/geom/ConicRay.d.ts.map +1 -1
- package/src/core/geom/ConicRay.js +11 -13
- package/src/core/geom/packing/max-rect/removeRedundantBoxes.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/removeRedundantBoxes.js +19 -4
- package/src/core/geom/vec3/v3_orthonormal_matrix_from_normal.d.ts.map +1 -0
- package/src/{engine/graphics/sh3/path_tracer/sampling → core/geom/vec3}/v3_orthonormal_matrix_from_normal.js +1 -1
- package/src/core/graph/coloring/colorizeGraph.js +2 -2
- package/src/core/graph/csr/CSRGraph.d.ts.map +1 -1
- package/src/core/graph/csr/CSRGraph.js +325 -319
- package/src/core/graph/layout/CircleLayout.d.ts.map +1 -1
- package/src/core/graph/layout/CircleLayout.js +8 -6
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -1
- package/src/core/graph/metis/native/refine/compute_kway_params.js +139 -138
- package/src/core/graph/mn_graph_coarsen.d.ts.map +1 -1
- package/src/core/graph/mn_graph_coarsen.js +4 -2
- package/src/core/graph/v2/NodeContainer.js +7 -7
- package/src/core/localization/LocalizationEngine.js +1 -1
- package/src/core/math/bell_membership_function.d.ts.map +1 -1
- package/src/core/math/bell_membership_function.js +3 -1
- package/src/core/math/complex/complex_add.d.ts +4 -4
- package/src/core/math/complex/complex_add.d.ts.map +1 -1
- package/src/core/math/complex/complex_add.js +3 -3
- package/src/core/math/complex/complex_div.d.ts +4 -4
- package/src/core/math/complex/complex_div.d.ts.map +1 -1
- package/src/core/math/complex/complex_div.js +3 -3
- package/src/core/math/complex/complex_mul.d.ts +4 -4
- package/src/core/math/complex/complex_mul.d.ts.map +1 -1
- package/src/core/math/complex/complex_mul.js +3 -3
- package/src/core/math/complex/complex_sub.d.ts +4 -4
- package/src/core/math/complex/complex_sub.d.ts.map +1 -1
- package/src/core/math/complex/complex_sub.js +3 -3
- package/src/core/math/idct_1d.d.ts +4 -4
- package/src/core/math/idct_1d.d.ts.map +1 -1
- package/src/core/math/idct_1d.js +3 -3
- package/src/core/math/noise/create_simplex_noise_2d.d.ts.map +1 -1
- package/src/core/math/noise/create_simplex_noise_2d.js +4 -2
- package/src/core/math/noise/sdnoise.d.ts.map +1 -1
- package/src/core/math/noise/sdnoise.js +12 -9
- package/src/core/math/physics/mie/compute_bhmie_optical_properties.d.ts.map +1 -1
- package/src/core/math/physics/mie/compute_bhmie_optical_properties.js +94 -50
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +3 -6
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.js +180 -157
- package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts +3 -4
- package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts.map +1 -1
- package/src/core/math/physics/mie/mie_ab_to_optical_properties.js +47 -21
- package/src/core/math/random/randomIntegerBetween.d.ts.map +1 -1
- package/src/core/math/random/randomIntegerBetween.js +4 -1
- package/src/core/math/solveCubic.d.ts.map +1 -1
- package/src/core/math/solveCubic.js +95 -82
- package/src/core/math/spline/computeCatmullRomSplineUniformDistance.d.ts.map +1 -1
- package/src/core/math/spline/computeCatmullRomSplineUniformDistance.js +13 -0
- package/src/core/math/statistics/softmax.js +1 -1
- package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts +1 -0
- package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/NodeGraphVisualData.js +2 -1
- package/src/core/model/node-graph/visual/NodeVisualData.js +1 -1
- package/src/core/model/object/ImmutableObjectPool.d.ts +7 -0
- package/src/core/model/object/ImmutableObjectPool.d.ts.map +1 -1
- package/src/core/model/object/ImmutableObjectPool.js +20 -10
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts.map +1 -1
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +39 -2
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -0
- package/src/core/parser/simple/readHexToken.d.ts.map +1 -1
- package/src/core/parser/simple/readHexToken.js +6 -0
- package/src/core/primitives/numbers/number_pretty_print.d.ts.map +1 -1
- package/src/core/primitives/numbers/number_pretty_print.js +4 -1
- package/src/core/primitives/strings/string_jaro_winkler.js +1 -1
- package/src/core/process/CompositeProcess.js +1 -1
- package/src/core/process/action/AsynchronousDelayAction.d.ts.map +1 -1
- package/src/core/process/action/AsynchronousDelayAction.js +3 -0
- package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
- package/src/core/process/executor/ConcurrentExecutor.js +3 -2
- package/src/core/process/task/util/randomCountTask.d.ts.map +1 -1
- package/src/core/process/task/util/randomCountTask.js +3 -1
- package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
- package/src/core/process/undo/ActionProcessor.js +5 -3
- package/src/core/process/worker/WorkerBuilder.js +3 -3
- package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +4 -2
- package/src/engine/control/first-person/DESIGN.md +1 -1
- package/src/engine/control/first-person/FirstPersonMotionPhase.d.ts +55 -0
- package/src/engine/control/first-person/FirstPersonMotionPhase.d.ts.map +1 -0
- package/src/engine/control/first-person/FirstPersonMotionPhase.js +134 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +23 -2
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +168 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +115 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +71 -0
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +255 -55
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +82 -43
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/LedgeGrab.js +405 -213
- package/src/engine/control/first-person/abilities/Mantle.d.ts +6 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/Mantle.js +104 -45
- package/src/engine/control/first-person/abilities/ScrambleUp.d.ts +61 -0
- package/src/engine/control/first-person/abilities/ScrambleUp.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/ScrambleUp.js +182 -0
- package/src/engine/control/first-person/math/jumpDynamics.d.ts +84 -0
- package/src/engine/control/first-person/math/jumpDynamics.d.ts.map +1 -0
- package/src/engine/control/first-person/math/jumpDynamics.js +108 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +45 -1
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -1
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +1 -1
- package/src/engine/graphics/shadows/testShadowMapRendering.js +1 -1
- package/src/engine/physics/CONSTRAINT_SOLVER_BENCH_LOG.md +208 -0
- package/src/engine/physics/CONSTRAINT_SOLVER_IMPROVEMENTS_PLAN.md +364 -0
- package/src/engine/physics/PLAN.md +6 -5
- package/src/engine/physics/constraint/solve_constraints.d.ts +4 -1
- package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
- package/src/engine/physics/constraint/solve_constraints.js +147 -33
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +1750 -1747
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
- package/src/engine/physics/gjk/gjk_epa_penetration.d.ts.map +1 -1
- package/src/engine/physics/gjk/gjk_epa_penetration.js +5 -9
- package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/convex_convex_manifold.js +22 -25
- package/src/engine/physics/narrowphase/convex_decomposition.d.ts +32 -13
- package/src/engine/physics/narrowphase/convex_decomposition.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/convex_decomposition.js +61 -65
- package/src/engine/physics/narrowphase/mesh_convex_hull.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/mesh_convex_hull.js +13 -8
- package/src/engine/physics/narrowphase/refine_ray_concave.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/refine_ray_concave.js +5 -3
- package/src/engine/physics/narrowphase/refine_ray_hit.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/refine_ray_hit.js +81 -78
- package/src/engine/sound/SoundEngine.d.ts.map +1 -1
- package/src/engine/sound/SoundEngine.js +28 -0
- package/src/engine/sound/dB2Volume.d.ts +1 -1
- package/src/engine/sound/dB2Volume.d.ts.map +1 -1
- package/src/engine/sound/dB2Volume.js +1 -1
- package/src/engine/sound/ecs/SoundController.d.ts +4 -0
- package/src/engine/sound/ecs/SoundController.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundController.js +4 -0
- package/src/engine/sound/ecs/SoundControllerSystem.d.ts +5 -0
- package/src/engine/sound/ecs/SoundControllerSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundControllerSystem.js +5 -0
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +69 -0
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/AudioEmitter.js +83 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +97 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +238 -0
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +90 -0
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/LiveEmitterSet.js +324 -0
- package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts +59 -0
- package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/SpatialAudioIndex.js +140 -0
- package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts +16 -65
- package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitter.js +19 -224
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts +26 -29
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +168 -135
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts +36 -59
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +154 -390
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts +20 -23
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundTrack.js +34 -152
- package/src/engine/sound/sopra/IMPLEMENTATION_PLAN.md +993 -0
- package/src/engine/sound/sopra/README.md +643 -7
- package/src/engine/sound/sopra/SopraEngine.d.ts +229 -0
- package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -0
- package/src/engine/sound/sopra/SopraEngine.js +423 -0
- package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.d.ts +26 -0
- package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.d.ts.map +1 -0
- package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.js +71 -0
- package/src/engine/sound/sopra/asset/BufferProvider.d.ts +24 -0
- package/src/engine/sound/sopra/asset/BufferProvider.d.ts.map +1 -0
- package/src/engine/sound/sopra/asset/BufferProvider.js +29 -0
- package/src/engine/sound/sopra/asset/StubBufferProvider.d.ts +31 -0
- package/src/engine/sound/sopra/asset/StubBufferProvider.d.ts.map +1 -0
- package/src/engine/sound/sopra/asset/StubBufferProvider.js +58 -0
- package/src/engine/sound/sopra/definition/BusDefinition.d.ts +83 -0
- package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/BusDefinition.js +142 -0
- package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts +17 -0
- package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.js +54 -0
- package/src/engine/sound/sopra/definition/DuckingRule.d.ts +71 -0
- package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/DuckingRule.js +106 -0
- package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.js +31 -0
- package/src/engine/sound/sopra/definition/EventDescription.d.ts +132 -0
- package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/EventDescription.js +259 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +17 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +71 -0
- package/src/engine/sound/sopra/definition/MixerSnapshot.d.ts +51 -0
- package/src/engine/sound/sopra/definition/MixerSnapshot.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/MixerSnapshot.js +83 -0
- package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.js +39 -0
- package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts +72 -0
- package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/ParameterDefinition.js +117 -0
- package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.js +31 -0
- package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts +14 -0
- package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/SopraPanningModel.js +20 -0
- package/src/engine/sound/sopra/definition/VoiceStealMode.d.ts +10 -0
- package/src/engine/sound/sopra/definition/VoiceStealMode.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/VoiceStealMode.js +18 -0
- package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.d.ts +93 -0
- package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +109 -0
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts +80 -0
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +181 -0
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts +17 -0
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.js +74 -0
- package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.d.ts +34 -0
- package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +100 -0
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts +101 -0
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +230 -0
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts +17 -0
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.js +54 -0
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts +103 -0
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +191 -0
- package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.js +39 -0
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.d.ts +40 -0
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.js +91 -0
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts +17 -0
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.js +42 -0
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.d.ts +44 -0
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +77 -0
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.js +27 -0
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +65 -0
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +131 -0
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts +17 -0
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.js +41 -0
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +24 -0
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +24 -0
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +70 -0
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +120 -0
- package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.js +31 -0
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +74 -0
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/effect/EqEffect.js +128 -0
- package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.js +29 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +49 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +101 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts +18 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.js +25 -0
- package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts +31 -0
- package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts.map +1 -0
- package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.js +106 -0
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts +79 -0
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/BusGraph.js +227 -0
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +144 -0
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/EventInstance.js +579 -0
- package/src/engine/sound/sopra/runtime/ParameterStore.d.ts +42 -0
- package/src/engine/sound/sopra/runtime/ParameterStore.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/ParameterStore.js +98 -0
- package/src/engine/sound/sopra/runtime/SopraPlaybackContext.d.ts +42 -0
- package/src/engine/sound/sopra/runtime/SopraPlaybackContext.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/SopraPlaybackContext.js +68 -0
- package/src/engine/sound/sopra/runtime/Voice.d.ts +67 -0
- package/src/engine/sound/sopra/runtime/Voice.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/Voice.js +145 -0
- package/src/engine/sound/sopra/runtime/VoiceManager.d.ts +38 -0
- package/src/engine/sound/sopra/runtime/VoiceManager.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/VoiceManager.js +136 -0
- package/src/engine/sound/sopra/runtime/VoicePool.d.ts +12 -0
- package/src/engine/sound/sopra/runtime/VoicePool.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/VoicePool.js +17 -0
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +11 -0
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -0
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +42 -0
- package/src/engine/sound/sopra/serialization/sopraJSON.d.ts +33 -0
- package/src/engine/sound/sopra/serialization/sopraJSON.d.ts.map +1 -0
- package/src/engine/sound/sopra/serialization/sopraJSON.js +99 -0
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +27 -0
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -0
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +49 -0
- package/src/engine/sound/sopra/util/MockAudioContext.d.ts +74 -0
- package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -0
- package/src/engine/sound/sopra/util/MockAudioContext.js +215 -0
- package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts +15 -0
- package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts.map +1 -0
- package/src/engine/sound/sopra/util/buildAttenuationCurve.js +40 -0
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +34 -0
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -0
- package/src/engine/sound/sopra/util/fadeOutAndStop.js +60 -0
- package/src/engine/sound/volume2dB.d.ts +1 -1
- package/src/engine/sound/volume2dB.d.ts.map +1 -1
- package/src/engine/sound/volume2dB.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/sampling/v3_orthonormal_matrix_from_normal.d.ts.map +0 -1
- package/src/engine/physics/narrowphase/ray_shapes.d.ts +0 -66
- package/src/engine/physics/narrowphase/ray_shapes.d.ts.map +0 -1
- package/src/engine/physics/narrowphase/ray_shapes.js +0 -187
- package/src/engine/sound/ecs/emitter/SoundEmitterChannel.d.ts +0 -23
- package/src/engine/sound/ecs/emitter/SoundEmitterChannel.d.ts.map +0 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterChannel.js +0 -32
- package/src/engine/sound/ecs/emitter/SoundTrackNodes.d.ts +0 -18
- package/src/engine/sound/ecs/emitter/SoundTrackNodes.d.ts.map +0 -1
- package/src/engine/sound/ecs/emitter/SoundTrackNodes.js +0 -18
- package/src/engine/sound/sopra/AbstractAudioClip.d.ts +0 -26
- package/src/engine/sound/sopra/AbstractAudioClip.d.ts.map +0 -1
- package/src/engine/sound/sopra/AbstractAudioClip.js +0 -29
- package/src/engine/sound/sopra/ContainerAudioClip.d.ts +0 -12
- package/src/engine/sound/sopra/ContainerAudioClip.d.ts.map +0 -1
- package/src/engine/sound/sopra/ContainerAudioClip.js +0 -13
- package/src/engine/sound/sopra/RandomContainerAudioClip.d.ts +0 -12
- package/src/engine/sound/sopra/RandomContainerAudioClip.d.ts.map +0 -1
- package/src/engine/sound/sopra/RandomContainerAudioClip.js +0 -15
- package/src/engine/sound/sopra/SequenceContainerAudioClip.d.ts +0 -7
- package/src/engine/sound/sopra/SequenceContainerAudioClip.d.ts.map +0 -1
- package/src/engine/sound/sopra/SequenceContainerAudioClip.js +0 -8
- package/src/engine/sound/sopra/SilenceAudioClip.d.ts +0 -13
- package/src/engine/sound/sopra/SilenceAudioClip.d.ts.map +0 -1
- package/src/engine/sound/sopra/SilenceAudioClip.js +0 -15
- /package/src/{engine/graphics/sh3/path_tracer/sampling → core/geom/vec3}/v3_orthonormal_matrix_from_normal.d.ts +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ray ↔ sphere intersection in the sphere's LOCAL frame: the sphere is centred
|
|
3
|
+
* at the origin with radius `r`, and the ray is expressed in that frame. Returns
|
|
4
|
+
* the hit distance `t` along the ray and writes the outward unit surface normal
|
|
5
|
+
* into `outNormal[outOffset .. outOffset+2]`.
|
|
6
|
+
*
|
|
7
|
+
* Conventions (shared with {@link box3_raycast} / {@link capsule_raycast}):
|
|
8
|
+
* - the ray direction is assumed UNIT length, so `t` is a true distance;
|
|
9
|
+
* - the first surface crossing at or after the origin within `tMax` is
|
|
10
|
+
* returned; a ray starting INSIDE the sphere returns its exit crossing;
|
|
11
|
+
* - on a miss the function returns `Infinity` and leaves `outNormal` untouched.
|
|
12
|
+
*
|
|
13
|
+
* Distinct from {@link sphere_intersects_ray}, which is a boolean predicate;
|
|
14
|
+
* this yields the distance and the surface normal — what a raycast query /
|
|
15
|
+
* narrowphase needs.
|
|
16
|
+
*
|
|
17
|
+
* @param {Float64Array|number[]} outNormal destination for the unit normal
|
|
18
|
+
* @param {number} outOffset offset into `outNormal` (3 floats are written)
|
|
19
|
+
* @param {number} ox ray origin x (local)
|
|
20
|
+
* @param {number} oy ray origin y (local)
|
|
21
|
+
* @param {number} oz ray origin z (local)
|
|
22
|
+
* @param {number} dx ray direction x (local, unit)
|
|
23
|
+
* @param {number} dy ray direction y (local, unit)
|
|
24
|
+
* @param {number} dz ray direction z (local, unit)
|
|
25
|
+
* @param {number} tMax maximum ray distance
|
|
26
|
+
* @param {number} r sphere radius
|
|
27
|
+
* @returns {number} hit distance `t`, or `Infinity` on a miss
|
|
28
|
+
*
|
|
29
|
+
* @author Alex Goldring
|
|
30
|
+
* @copyright Company Named Limited (c) 2026
|
|
31
|
+
*/
|
|
32
|
+
export function sphere_raycast(outNormal, outOffset, ox, oy, oz, dx, dy, dz, tMax, r) {
|
|
33
|
+
// |o + t·d|² = r², d unit → t² + 2(o·d)t + (|o|² − r²) = 0.
|
|
34
|
+
const b = ox * dx + oy * dy + oz * dz;
|
|
35
|
+
const c = ox * ox + oy * oy + oz * oz - r * r;
|
|
36
|
+
const disc = b * b - c;
|
|
37
|
+
if (disc < 0) return Infinity;
|
|
38
|
+
const sq = Math.sqrt(disc);
|
|
39
|
+
let t = -b - sq; // near root (entry)
|
|
40
|
+
if (t < 0) t = -b + sq; // origin inside the sphere → far root (exit)
|
|
41
|
+
if (t < 0 || t > tMax) return Infinity;
|
|
42
|
+
const inv = 1 / r;
|
|
43
|
+
outNormal[outOffset] = (ox + dx * t) * inv;
|
|
44
|
+
outNormal[outOffset + 1] = (oy + dy * t) * inv;
|
|
45
|
+
outNormal[outOffset + 2] = (oz + dz * t) * inv;
|
|
46
|
+
return t;
|
|
47
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write the face-adjacent neighbour tetrahedra of `tet_id` into `out`,
|
|
3
|
+
* non-allocating, and return how many were written.
|
|
4
|
+
*
|
|
5
|
+
* A tetrahedron has up to four neighbours — one across each face — and a face on
|
|
6
|
+
* the mesh surface has none. {@link TetrahedralMesh} stores this adjacency
|
|
7
|
+
* directly: neighbour slot `i` is the tet across the face opposite vertex `i`,
|
|
8
|
+
* encoded as `[tet_id:30][opposite_corner:2]` (or {@link INVALID_NEIGHBOUR} for a
|
|
9
|
+
* surface face). This decodes the tet ids (`encoded >>> 2`, an UNSIGNED shift so
|
|
10
|
+
* 30-bit ids near the top of the range survive) and skips surface faces, packing
|
|
11
|
+
* the survivors contiguously from `out_offset`.
|
|
12
|
+
*
|
|
13
|
+
* @param {TetrahedralMesh} mesh
|
|
14
|
+
* @param {Int32Array|Uint32Array|number[]} out destination for neighbour tet ids
|
|
15
|
+
* (needs room for up to 4 entries from `out_offset`)
|
|
16
|
+
* @param {number} out_offset offset into `out` at which to start writing
|
|
17
|
+
* @param {number} tet_id tetrahedron whose neighbours to read
|
|
18
|
+
* @returns {number} number of neighbours written (0..4); surface faces are skipped
|
|
19
|
+
*
|
|
20
|
+
* @author Alex Goldring
|
|
21
|
+
* @copyright Company Named Limited (c) 2026
|
|
22
|
+
*/
|
|
23
|
+
export function tetrahedral_mesh_tet_get_neighbours(mesh: TetrahedralMesh, out: Int32Array | Uint32Array | number[], out_offset: number, tet_id: number): number;
|
|
24
|
+
//# sourceMappingURL=tetrahedral_mesh_tet_get_neighbours.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedral_mesh_tet_get_neighbours.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,gFATW,UAAU,GAAC,WAAW,GAAC,MAAM,EAAE,cAE/B,MAAM,UACN,MAAM,GACJ,MAAM,CAkBlB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { assert } from "../../../assert.js";
|
|
2
|
+
import { INVALID_NEIGHBOUR } from "./TetrahedralMesh.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Write the face-adjacent neighbour tetrahedra of `tet_id` into `out`,
|
|
6
|
+
* non-allocating, and return how many were written.
|
|
7
|
+
*
|
|
8
|
+
* A tetrahedron has up to four neighbours — one across each face — and a face on
|
|
9
|
+
* the mesh surface has none. {@link TetrahedralMesh} stores this adjacency
|
|
10
|
+
* directly: neighbour slot `i` is the tet across the face opposite vertex `i`,
|
|
11
|
+
* encoded as `[tet_id:30][opposite_corner:2]` (or {@link INVALID_NEIGHBOUR} for a
|
|
12
|
+
* surface face). This decodes the tet ids (`encoded >>> 2`, an UNSIGNED shift so
|
|
13
|
+
* 30-bit ids near the top of the range survive) and skips surface faces, packing
|
|
14
|
+
* the survivors contiguously from `out_offset`.
|
|
15
|
+
*
|
|
16
|
+
* @param {TetrahedralMesh} mesh
|
|
17
|
+
* @param {Int32Array|Uint32Array|number[]} out destination for neighbour tet ids
|
|
18
|
+
* (needs room for up to 4 entries from `out_offset`)
|
|
19
|
+
* @param {number} out_offset offset into `out` at which to start writing
|
|
20
|
+
* @param {number} tet_id tetrahedron whose neighbours to read
|
|
21
|
+
* @returns {number} number of neighbours written (0..4); surface faces are skipped
|
|
22
|
+
*
|
|
23
|
+
* @author Alex Goldring
|
|
24
|
+
* @copyright Company Named Limited (c) 2026
|
|
25
|
+
*/
|
|
26
|
+
export function tetrahedral_mesh_tet_get_neighbours(mesh, out, out_offset, tet_id) {
|
|
27
|
+
assert.defined(mesh, 'mesh');
|
|
28
|
+
assert.equal(mesh.isTetrahedralMesh, true, 'mesh.isTetrahedralMesh !== true');
|
|
29
|
+
|
|
30
|
+
let count = 0;
|
|
31
|
+
for (let f = 0; f < 4; f++) {
|
|
32
|
+
const encoded = mesh.getNeighbour(tet_id, f);
|
|
33
|
+
if (encoded !== INVALID_NEIGHBOUR) {
|
|
34
|
+
out[out_offset + count] = encoded >>> 2;
|
|
35
|
+
count++;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return count;
|
|
39
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace_triangular_depth_map.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.js"],"names":[],"mappings":"AAOA;;;;;;;;;;GAUG;AACH,mDATW,WAAW,iBACX,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,UACrB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,
|
|
1
|
+
{"version":3,"file":"trace_triangular_depth_map.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.js"],"names":[],"mappings":"AAOA;;;;;;;;;;GAUG;AACH,mDATW,WAAW,iBACX,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,UACrB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,gCA6GhB"}
|
|
@@ -112,8 +112,10 @@ export function trace_triangular_depth_map(
|
|
|
112
112
|
|
|
113
113
|
const depth_normalized = depth / distance_to_target;
|
|
114
114
|
|
|
115
|
-
// depth is quantized to
|
|
116
|
-
|
|
115
|
+
// depth (normalized to [0,1]) is quantized to an 8-bit value, flooring to stay conservative (bias
|
|
116
|
+
// toward the closer occluder). Multiply by 255 to map into the [0,255] byte range, and clamp to guard
|
|
117
|
+
// against floating-point overshoot of 1.0 which would otherwise spill bits into the adjacent byte.
|
|
118
|
+
const depth_quantized = Math.min(255, Math.max(0, Math.floor(depth_normalized * 255)));
|
|
117
119
|
|
|
118
120
|
result[result_offset + encoded_index_0] |= depth_quantized << (encoded_index_1 * 8);
|
|
119
121
|
}
|
|
@@ -19,7 +19,7 @@ export function computeTriangleClusterNormalBoundingCone(result, faces) {
|
|
|
19
19
|
for (let face of faces) {
|
|
20
20
|
|
|
21
21
|
const face_normal = face.normal;
|
|
22
|
-
if (face_normal[0] === 0 && face_normal[1] === 0 && face_normal[
|
|
22
|
+
if (face_normal[0] === 0 && face_normal[1] === 0 && face_normal[2] === 0) {
|
|
23
23
|
// skip
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
@@ -70,8 +70,8 @@ export function computeTriangleClusterNormalBoundingCone(result, faces) {
|
|
|
70
70
|
const i3 = i * 3;
|
|
71
71
|
|
|
72
72
|
const normal_x = normal_data[i3];
|
|
73
|
-
const normal_y = normal_data[i3];
|
|
74
|
-
const normal_z = normal_data[i3];
|
|
73
|
+
const normal_y = normal_data[i3 + 1];
|
|
74
|
+
const normal_z = normal_data[i3 + 2];
|
|
75
75
|
|
|
76
76
|
const angle = v3_angle_between(
|
|
77
77
|
normal_x, normal_y, normal_z,
|
|
@@ -244,7 +244,7 @@ export function decimate_edge_collapse_snap(
|
|
|
244
244
|
|
|
245
245
|
const topoEdge = edges[j];
|
|
246
246
|
|
|
247
|
-
if (array_get_index_in_range(scratch_edges, topoEdge, 0, dirty_edge_count) === -1) {
|
|
247
|
+
if (array_get_index_in_range(scratch_edges, topoEdge, 0, dirty_edge_count - 1) === -1) {
|
|
248
248
|
scratch_edges[dirty_edge_count++] = topoEdge;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tm_vertex_compute_normal.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/topology/tm_vertex_compute_normal.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,iDAJW,MAAM,EAAE,iBACR,MAAM,
|
|
1
|
+
{"version":3,"file":"tm_vertex_compute_normal.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/topology/tm_vertex_compute_normal.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,iDAJW,MAAM,EAAE,iBACR,MAAM,4BAkChB"}
|
|
@@ -30,8 +30,10 @@ export function tm_vertex_compute_normal(result, result_offset, vertex) {
|
|
|
30
30
|
_z += scratch_v3_0[2];
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// re-normalize
|
|
34
|
-
|
|
33
|
+
// re-normalize: divide by length (multiply by its reciprocal), not by the length itself.
|
|
34
|
+
// Guard the fully-cancelling case (sum of face normals == 0) to avoid NaN.
|
|
35
|
+
const len = v3_length(_x, _y, _z);
|
|
36
|
+
const len_inv = len !== 0 ? 1 / len : 0;
|
|
35
37
|
|
|
36
38
|
_x *= len_inv;
|
|
37
39
|
_y *= len_inv;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make_justified_point_grid.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/util/make_justified_point_grid.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,iEAJW,MAAM,kBAEJ,MAAM,
|
|
1
|
+
{"version":3,"file":"make_justified_point_grid.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/util/make_justified_point_grid.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,iEAJW,MAAM,kBAEJ,MAAM,CAiClB"}
|
|
@@ -10,17 +10,25 @@ import { max2 } from "../../../math/max2.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export function make_justified_point_grid(aabb3, spacing, callback) {
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
// `ceil(extent / spacing)` is the number of INTERVALS needed for the actual spacing to stay <= the
|
|
14
|
+
// requested upper-bound spacing. We then place intervals + 1 points and divide the extent by the interval
|
|
15
|
+
// count. The old code treated this value as a point count and divided by (count - 1), which made the actual
|
|
16
|
+
// spacing exceed the requested upper bound (e.g. extent/spacing = 3.2 -> spacing of 1.067*spacing).
|
|
17
|
+
const intervals_x = max2(1, Math.ceil(aabb3.getExtentsX() / spacing));
|
|
18
|
+
const intervals_y = max2(1, Math.ceil(aabb3.getExtentsY() / spacing));
|
|
19
|
+
const intervals_z = max2(1, Math.ceil(aabb3.getExtentsZ() / spacing));
|
|
16
20
|
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
21
|
+
const points_x = intervals_x + 1;
|
|
22
|
+
const points_y = intervals_y + 1;
|
|
23
|
+
const points_z = intervals_z + 1;
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
const spacing_x = aabb3.getExtentsX() / intervals_x;
|
|
26
|
+
const spacing_y = aabb3.getExtentsY() / intervals_y;
|
|
27
|
+
const spacing_z = aabb3.getExtentsZ() / intervals_z;
|
|
28
|
+
|
|
29
|
+
for (let i = 0; i < points_x; i++) {
|
|
30
|
+
for (let j = 0; j < points_y; j++) {
|
|
31
|
+
for (let k = 0; k < points_z; k++) {
|
|
24
32
|
const x = i * spacing_x + aabb3.x0;
|
|
25
33
|
const y = j * spacing_y + aabb3.y0;
|
|
26
34
|
const z = k * spacing_z + aabb3.z0;
|
|
@@ -30,5 +38,5 @@ export function make_justified_point_grid(aabb3, spacing, callback) {
|
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
40
|
|
|
33
|
-
return
|
|
41
|
+
return points_x * points_y * points_z;
|
|
34
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConicRay.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/ConicRay.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH;
|
|
1
|
+
{"version":3,"file":"ConicRay.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/ConicRay.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH;IAgLI;;;;;;;OAOG;IACH,sBANW,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,GACJ,QAAQ,CAkBpB;IAtMD;;;;OAIG;IACH,oBAFU,OAAO,CAEgB;IAEjC;;;;OAIG;IACH,OAFU,MAAM,CAEN;IAEV;;;;;;;MAKC;IAED,0BAGC;IAED;;;OAGG;IACH,2CAGC;IAED;;;OAGG;IACH,6CAMC;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAMnB;IAED;;;;;OAKG;IACH,qBAJW,QAAQ,cACR,MAAM,GACJ,OAAO,CAKnB;IAED;;;OAGG;IACH,QAFY,MAAM,CAOjB;IAED;;;OAGG;IACH,YAFW,QAAQ,QAKlB;IAED;;;;OAIG;IACH,4BAHW,OAAO,GACL,OAAO,CAMnB;IAED;;;;;OAKG;IACH,gDAFW,OAAO,QAoEjB;IA6BL;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAN5B;;kBAUS,MAAM;;oBA7NI,cAAc"}
|
|
@@ -161,27 +161,25 @@ export class ConicRay {
|
|
|
161
161
|
const dY = direction.y;
|
|
162
162
|
const dZ = direction.z;
|
|
163
163
|
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
// Convert rotation axis and angle to 3x3 rotation matrix [2]
|
|
170
|
-
// [2] See https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle
|
|
164
|
+
// Build the rotation that maps the north pole (0,0,1) onto `direction`, expressed as a 3x3 matrix.
|
|
165
|
+
// This uses the k = 1/(1+dZ) form of that rotation. The previous code used t = 1 - dZ together with
|
|
166
|
+
// spurious sin() factors on the off-diagonal terms, producing a non-orthonormal matrix that did not
|
|
167
|
+
// actually rotate (0,0,1) to `direction`.
|
|
171
168
|
|
|
172
169
|
//write matrix
|
|
173
170
|
const c = dZ;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
const
|
|
171
|
+
// NOTE: singular at dZ === -1 (the antipode). The (0,0,1) case is handled by the early return above and
|
|
172
|
+
// cone sampling here keeps dZ > -1.
|
|
173
|
+
const k = 1 / (1 + dZ);
|
|
174
|
+
const tx = -k * dY;
|
|
175
|
+
const ty = k * dX;
|
|
178
176
|
|
|
179
177
|
//build relevant terms of the matrix
|
|
180
178
|
const n11 = c - tx * dY;
|
|
181
179
|
const n12 = tx * dX;
|
|
182
180
|
const n22 = ty * dX + c;
|
|
183
|
-
const n13 =
|
|
184
|
-
const n32 = -
|
|
181
|
+
const n13 = dX;
|
|
182
|
+
const n32 = -dY;
|
|
185
183
|
|
|
186
184
|
|
|
187
185
|
// Rotate [x; y; z] from north pole to `coneDir`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeRedundantBoxes.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/removeRedundantBoxes.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"removeRedundantBoxes.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/removeRedundantBoxes.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,gEA+EC"}
|
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export function removeRedundantBoxes(boxes) {
|
|
6
6
|
const removals = [];
|
|
7
|
+
const removalSet = new Set();
|
|
7
8
|
|
|
9
|
+
function scheduleRemoval(box) {
|
|
10
|
+
if (!removalSet.has(box)) {
|
|
11
|
+
removalSet.add(box);
|
|
12
|
+
removals.push(box);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
|
|
9
16
|
let datum;
|
|
10
17
|
|
|
@@ -18,6 +25,14 @@ export function removeRedundantBoxes(boxes) {
|
|
|
18
25
|
return;
|
|
19
26
|
}
|
|
20
27
|
|
|
28
|
+
// A box already scheduled for removal must not, in turn, cause other boxes to be removed. This is what
|
|
29
|
+
// makes two IDENTICAL boxes resolve to exactly one survivor: whichever is seen first schedules the
|
|
30
|
+
// other for removal, and when the removed one is later visited as `datum` we bail here instead of
|
|
31
|
+
// scheduling its (equal) container too — otherwise both equal boxes would be removed.
|
|
32
|
+
if (removalSet.has(datum)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
const ax0 = intersection.x0;
|
|
22
37
|
const ay0 = intersection.y0;
|
|
23
38
|
const ax1 = intersection.x1;
|
|
@@ -30,11 +45,11 @@ export function removeRedundantBoxes(boxes) {
|
|
|
30
45
|
|
|
31
46
|
//question is now whether it is containment
|
|
32
47
|
if (ax0 >= bx0 && ax1 <= bx1 && ay0 >= by0 && ay1 <= by1) {
|
|
33
|
-
//b contains a
|
|
34
|
-
|
|
48
|
+
//b (datum) contains a (intersection)
|
|
49
|
+
scheduleRemoval(intersection);
|
|
35
50
|
} else if (bx0 >= ax0 && bx1 <= ax1 && by0 >= ay0 && by1 <= ay1) {
|
|
36
|
-
//a contains b
|
|
37
|
-
|
|
51
|
+
//a (intersection) contains b (datum)
|
|
52
|
+
scheduleRemoval(datum);
|
|
38
53
|
|
|
39
54
|
//scheduled removal of the datum, prevent further traversal
|
|
40
55
|
return false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_orthonormal_matrix_from_normal.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_orthonormal_matrix_from_normal.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,uDANW,MAAM,EAAE,cACR,MAAM,SACN,MAAM,SACN,MAAM,SACN,MAAM,QAsChB"}
|
|
@@ -26,9 +26,9 @@ function graphToMatrix(graph) {
|
|
|
26
26
|
for (let i = 0; i < vertexCount; i++) {
|
|
27
27
|
const node = nodes[i];
|
|
28
28
|
|
|
29
|
-
const attachedEdges =
|
|
29
|
+
const attachedEdges = [];
|
|
30
30
|
|
|
31
|
-
const nAttachedEdges = attachedEdges
|
|
31
|
+
const nAttachedEdges = graph.getAttachedEdges(attachedEdges, node);
|
|
32
32
|
|
|
33
33
|
for (let j = 0; j < nAttachedEdges; j++) {
|
|
34
34
|
const edge = attachedEdges[j];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSRGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/csr/CSRGraph.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;
|
|
1
|
+
{"version":3,"file":"CSRGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/csr/CSRGraph.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IA4PI;;;;;;;;;;;;;OAaG;IACH,gCAPW,MAAM,kBACN,UAAU,MAAM,CAAC,aACjB,UAAU,MAAM,CAAC,gBACjB,UAAU,MAAM,CAAC,mBACjB,UAAU,MAAM,CAAC,GACf,QAAQ,CAgBpB;IAvRD;;;;OAIG;IACH,0BAJW,MAAM,oBACN,MAAM,EA8DhB;IAvDG,qBAAqB;IACrB,cADW,MAAM,CACe;IAChC,qBAAqB;IACrB,kBADW,MAAM,CACuB;IAOxC;;;;OAIG;IACH,sBAA4D;IAI5D;;;;OAIG;IACH,gBAFU,WAAW,CAEmE;IAGxF;;;OAGG;IACH,WAFU,WAAW,CAE8D;IAGnF;;;OAGG;IACH,cAFU,WAAW,CAEiE;IAGtF;;;;;OAKG;IACH,gBAFU,WAAW,CAE+D;IAGpF;;;OAGG;IACH,qBAFU,MAAM,CAEuB;IAG3C;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,uBAFa,MAAM,CAUlB;IAED;;OAEG;IACH,oCAQC;IAED;;;;;;;;;;;;;;;OAeG;IACH,yCAFW,MAAM,QA6ChB;IAED;;;;;;;;;OASG;IACH,YAFW,QAAQ,QASlB;IAED;;;OAGG;IACH,SAFa,QAAQ,CAMpB;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAyBnB;IAED;;;;;OAKG;IACH,QAFa,MAAM,CAalB;IAiCL;;;;;OAKG;IACH,qBAFU,OAAO,CAEY;CAR5B"}
|