@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,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single source of motion-phase transition logic: given the current phase
|
|
3
|
+
* and a per-tick input snapshot, return the next phase. Pure — no side effects,
|
|
4
|
+
* no controller/runtime coupling — so it's exhaustively unit-testable.
|
|
5
|
+
*
|
|
6
|
+
* @param {number} phase current {@link MotionPhase}
|
|
7
|
+
* @param {{
|
|
8
|
+
* grounded: boolean, // on a walkable surface this tick (from the mover)
|
|
9
|
+
* ascending: boolean, // velocityY > 0 this tick
|
|
10
|
+
* jumpEdge: boolean, // jump pressed this tick (rising edge)
|
|
11
|
+
* coyote: boolean, // within the post-walk-off coyote window
|
|
12
|
+
* anticipationDone: boolean, // the squash timer elapsed this tick
|
|
13
|
+
* }} input
|
|
14
|
+
* @returns {number} next {@link MotionPhase}
|
|
15
|
+
*/
|
|
16
|
+
export function selectMotionPhase(phase: number, input: {
|
|
17
|
+
grounded: boolean;
|
|
18
|
+
ascending: boolean;
|
|
19
|
+
jumpEdge: boolean;
|
|
20
|
+
coyote: boolean;
|
|
21
|
+
anticipationDone: boolean;
|
|
22
|
+
}): number;
|
|
23
|
+
/**
|
|
24
|
+
* Build the shared {@link SimpleStateMachineDescription} — the declared state
|
|
25
|
+
* graph (states + valid edges). Each controller entity instantiates a
|
|
26
|
+
* {@link SimpleStateMachine} over this one description and registers its own
|
|
27
|
+
* entry/exit handlers. The transition LOGIC lives in {@link selectMotionPhase};
|
|
28
|
+
* the graph here documents and (optionally) validates the reachable edges.
|
|
29
|
+
*
|
|
30
|
+
* @returns {SimpleStateMachineDescription}
|
|
31
|
+
*/
|
|
32
|
+
export function buildMotionPhaseDescription(): SimpleStateMachineDescription;
|
|
33
|
+
/**
|
|
34
|
+
* Drive a {@link SimpleStateMachine} one step by the pure transition logic,
|
|
35
|
+
* transitioning ONLY on an actual change so the machine's entry/exit handlers
|
|
36
|
+
* fire once per real transition (SimpleStateMachine.setState fires them on
|
|
37
|
+
* every call, including same-state — we guard that here).
|
|
38
|
+
*
|
|
39
|
+
* @param {import("../../../core/fsm/simple/SimpleStateMachine.js").SimpleStateMachine} machine
|
|
40
|
+
* @param {object} input see {@link selectMotionPhase}
|
|
41
|
+
* @returns {number} the phase after the step
|
|
42
|
+
*/
|
|
43
|
+
export function advanceMotionPhase(machine: import("../../../core/fsm/simple/SimpleStateMachine.js").SimpleStateMachine, input: object): number;
|
|
44
|
+
export namespace MotionPhase {
|
|
45
|
+
let Grounded: number;
|
|
46
|
+
let Anticipating: number;
|
|
47
|
+
let Rising: number;
|
|
48
|
+
let Falling: number;
|
|
49
|
+
}
|
|
50
|
+
/** Human-readable phase names, indexed by phase id. For diagnostics. */
|
|
51
|
+
export const MOTION_PHASE_NAME: string[];
|
|
52
|
+
/** Shared description instance — stateless, reused by every controller entity. */
|
|
53
|
+
export const MOTION_PHASE_DESCRIPTION: SimpleStateMachineDescription;
|
|
54
|
+
import { SimpleStateMachineDescription } from "../../../core/fsm/simple/SimpleStateMachineDescription.js";
|
|
55
|
+
//# sourceMappingURL=FirstPersonMotionPhase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FirstPersonMotionPhase.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonMotionPhase.js"],"names":[],"mappings":"AAwCA;;;;;;;;;;;;;;GAcG;AACH,yCAVW,MAAM,SACN;IACV,QAAY,EAAE,OAAO,CAAC;IACtB,SAAa,EAAE,OAAO,CAAC;IACvB,QAAY,EAAE,OAAO,CAAC;IACtB,MAAU,EAAE,OAAO,CAAC;IACpB,gBAAoB,EAAE,OAAO,CAAC;CAC3B,GACS,MAAM,CA+BlB;AAED;;;;;;;;GAQG;AACH,+CAFa,6BAA6B,CAkBzC;AAKD;;;;;;;;;GASG;AACH,4CAJW,OAAO,gDAAgD,EAAE,kBAAkB,SAC3E,MAAM,GACJ,MAAM,CASlB;;;;;;;AAhGD,wEAAwE;AACxE,yCAAmF;AA2EnF,kFAAkF;AAClF,qEAAsE;8CAlHxB,2DAA2D"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { SimpleStateMachineDescription } from "../../../core/fsm/simple/SimpleStateMachineDescription.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Explicit ground/air/jump phase for the first-person controller.
|
|
5
|
+
*
|
|
6
|
+
* Today the controller tracks this with a handful of loose booleans
|
|
7
|
+
* (`grounded`, `inJumpAnticipation`, `midJump`, `isAscending`,
|
|
8
|
+
* `isVariableJumpCut`, `apexFired`) written by base locomotion AND by
|
|
9
|
+
* abilities, with no single owner — a fragile implicit state machine. This
|
|
10
|
+
* makes the phase EXPLICIT and the transitions a single, pure, unit-testable
|
|
11
|
+
* function, so a wrong transition (the kind that surfaces as a camera snap a
|
|
12
|
+
* frame or seconds later) is inspectable instead of smeared across the hot
|
|
13
|
+
* path.
|
|
14
|
+
*
|
|
15
|
+
* States:
|
|
16
|
+
* - Grounded — on a walkable surface, not committed to a jump.
|
|
17
|
+
* - Anticipating — grounded squash window after a jump press, before the
|
|
18
|
+
* impulse fires (and the coyote-jump entry from Falling).
|
|
19
|
+
* - Rising — airborne with upward velocity from a jump impulse.
|
|
20
|
+
* - Falling — airborne with non-upward velocity (apex passed, or walked
|
|
21
|
+
* off a ledge without jumping).
|
|
22
|
+
*
|
|
23
|
+
* Drive it with {@link advanceMotionPhase}, which only transitions on an actual
|
|
24
|
+
* change (so a SimpleStateMachine's entry/exit handlers fire once per real
|
|
25
|
+
* transition — the natural home for onLand / onLeaveGround / jump-impulse /
|
|
26
|
+
* apex side effects — rather than every tick).
|
|
27
|
+
*
|
|
28
|
+
* @author Alex Goldring
|
|
29
|
+
* @copyright Company Named Limited (c) 2026
|
|
30
|
+
*/
|
|
31
|
+
export const MotionPhase = {
|
|
32
|
+
Grounded: 0,
|
|
33
|
+
Anticipating: 1,
|
|
34
|
+
Rising: 2,
|
|
35
|
+
Falling: 3,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** Human-readable phase names, indexed by phase id. For diagnostics. */
|
|
39
|
+
export const MOTION_PHASE_NAME = ["Grounded", "Anticipating", "Rising", "Falling"];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The single source of motion-phase transition logic: given the current phase
|
|
43
|
+
* and a per-tick input snapshot, return the next phase. Pure — no side effects,
|
|
44
|
+
* no controller/runtime coupling — so it's exhaustively unit-testable.
|
|
45
|
+
*
|
|
46
|
+
* @param {number} phase current {@link MotionPhase}
|
|
47
|
+
* @param {{
|
|
48
|
+
* grounded: boolean, // on a walkable surface this tick (from the mover)
|
|
49
|
+
* ascending: boolean, // velocityY > 0 this tick
|
|
50
|
+
* jumpEdge: boolean, // jump pressed this tick (rising edge)
|
|
51
|
+
* coyote: boolean, // within the post-walk-off coyote window
|
|
52
|
+
* anticipationDone: boolean, // the squash timer elapsed this tick
|
|
53
|
+
* }} input
|
|
54
|
+
* @returns {number} next {@link MotionPhase}
|
|
55
|
+
*/
|
|
56
|
+
export function selectMotionPhase(phase, input) {
|
|
57
|
+
switch (phase) {
|
|
58
|
+
case MotionPhase.Grounded:
|
|
59
|
+
// Grounded can always commit a jump; otherwise it only leaves the
|
|
60
|
+
// ground by losing contact (walk off a ledge).
|
|
61
|
+
if (input.jumpEdge) return MotionPhase.Anticipating;
|
|
62
|
+
return input.grounded ? MotionPhase.Grounded : MotionPhase.Falling;
|
|
63
|
+
|
|
64
|
+
case MotionPhase.Anticipating:
|
|
65
|
+
// The squash commits to the jump: it holds until the timer elapses
|
|
66
|
+
// (even if the ground slid out — rug-pull / moving platform), then
|
|
67
|
+
// the impulse fires (→ Rising).
|
|
68
|
+
return input.anticipationDone ? MotionPhase.Rising : MotionPhase.Anticipating;
|
|
69
|
+
|
|
70
|
+
case MotionPhase.Rising:
|
|
71
|
+
// A jump that bonks a ceiling or lands instantly re-grounds; else it
|
|
72
|
+
// rises until velocity stops being upward (apex → Falling).
|
|
73
|
+
if (input.grounded) return MotionPhase.Grounded;
|
|
74
|
+
return input.ascending ? MotionPhase.Rising : MotionPhase.Falling;
|
|
75
|
+
|
|
76
|
+
case MotionPhase.Falling:
|
|
77
|
+
// Coyote jump: a jump press shortly after walking off still takes.
|
|
78
|
+
// Otherwise we fall until we land.
|
|
79
|
+
if (input.jumpEdge && input.coyote) return MotionPhase.Anticipating;
|
|
80
|
+
return input.grounded ? MotionPhase.Grounded : MotionPhase.Falling;
|
|
81
|
+
|
|
82
|
+
default:
|
|
83
|
+
return phase;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Build the shared {@link SimpleStateMachineDescription} — the declared state
|
|
89
|
+
* graph (states + valid edges). Each controller entity instantiates a
|
|
90
|
+
* {@link SimpleStateMachine} over this one description and registers its own
|
|
91
|
+
* entry/exit handlers. The transition LOGIC lives in {@link selectMotionPhase};
|
|
92
|
+
* the graph here documents and (optionally) validates the reachable edges.
|
|
93
|
+
*
|
|
94
|
+
* @returns {SimpleStateMachineDescription}
|
|
95
|
+
*/
|
|
96
|
+
export function buildMotionPhaseDescription() {
|
|
97
|
+
const d = new SimpleStateMachineDescription();
|
|
98
|
+
d.createState(MotionPhase.Grounded);
|
|
99
|
+
d.createState(MotionPhase.Anticipating);
|
|
100
|
+
d.createState(MotionPhase.Rising);
|
|
101
|
+
d.createState(MotionPhase.Falling);
|
|
102
|
+
|
|
103
|
+
d.createEdge(MotionPhase.Grounded, MotionPhase.Anticipating);
|
|
104
|
+
d.createEdge(MotionPhase.Grounded, MotionPhase.Falling);
|
|
105
|
+
d.createEdge(MotionPhase.Anticipating, MotionPhase.Rising);
|
|
106
|
+
d.createEdge(MotionPhase.Rising, MotionPhase.Grounded);
|
|
107
|
+
d.createEdge(MotionPhase.Rising, MotionPhase.Falling);
|
|
108
|
+
d.createEdge(MotionPhase.Falling, MotionPhase.Grounded);
|
|
109
|
+
d.createEdge(MotionPhase.Falling, MotionPhase.Anticipating);
|
|
110
|
+
|
|
111
|
+
return d;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Shared description instance — stateless, reused by every controller entity. */
|
|
115
|
+
export const MOTION_PHASE_DESCRIPTION = buildMotionPhaseDescription();
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Drive a {@link SimpleStateMachine} one step by the pure transition logic,
|
|
119
|
+
* transitioning ONLY on an actual change so the machine's entry/exit handlers
|
|
120
|
+
* fire once per real transition (SimpleStateMachine.setState fires them on
|
|
121
|
+
* every call, including same-state — we guard that here).
|
|
122
|
+
*
|
|
123
|
+
* @param {import("../../../core/fsm/simple/SimpleStateMachine.js").SimpleStateMachine} machine
|
|
124
|
+
* @param {object} input see {@link selectMotionPhase}
|
|
125
|
+
* @returns {number} the phase after the step
|
|
126
|
+
*/
|
|
127
|
+
export function advanceMotionPhase(machine, input) {
|
|
128
|
+
const current = machine.getState();
|
|
129
|
+
const next = selectMotionPhase(current, input);
|
|
130
|
+
if (next !== current) {
|
|
131
|
+
machine.setState(next);
|
|
132
|
+
}
|
|
133
|
+
return next;
|
|
134
|
+
}
|
|
@@ -48,12 +48,13 @@ export class FirstPersonPlayerController {
|
|
|
48
48
|
radius: number;
|
|
49
49
|
mass: number;
|
|
50
50
|
referenceMass: number;
|
|
51
|
+
jumpPushoffDistance: number;
|
|
51
52
|
massCouplingStrength: number;
|
|
52
53
|
};
|
|
53
54
|
motion: {
|
|
54
55
|
walkSpeed: number;
|
|
55
56
|
sprintSpeed: number;
|
|
56
|
-
crouchSpeed: number;
|
|
57
|
+
crouchSpeed: number; /** Set true when crouch was released but a ceiling above prevents standing. */
|
|
57
58
|
airControl: number;
|
|
58
59
|
groundAccelHalfLife: number;
|
|
59
60
|
groundDecel: number;
|
|
@@ -95,12 +96,31 @@ export class FirstPersonPlayerController {
|
|
|
95
96
|
exertionRiseRate: number;
|
|
96
97
|
minAirborneTime: number;
|
|
97
98
|
mantleUpUpFactor: number;
|
|
99
|
+
shimmySpeed: number;
|
|
100
|
+
pullUpFacingConeDeg: number;
|
|
101
|
+
moveTowardThreshold: number;
|
|
102
|
+
moveAwayThreshold: number;
|
|
103
|
+
regrabCooldown: number;
|
|
104
|
+
shimmyLateralMin: number;
|
|
105
|
+
shimmyClearanceGap: number;
|
|
106
|
+
shimmyClearanceProbeY: number;
|
|
107
|
+
shimmyEdgeProbeForward: number;
|
|
108
|
+
shimmyContinuityProbeUp: number;
|
|
109
|
+
shimmyContinuityProbeDown: number;
|
|
110
|
+
shimmyContinuityTol: number;
|
|
111
|
+
shimmyExertionFactor: number;
|
|
98
112
|
};
|
|
99
113
|
mantle: {
|
|
100
114
|
minHeight: number;
|
|
101
115
|
maxHeight: number;
|
|
102
116
|
duration: number;
|
|
103
117
|
forwardOffsetOnLand: number;
|
|
118
|
+
pullUpMaxHeight: number;
|
|
119
|
+
vaultDistance: number;
|
|
120
|
+
vaultApexClearance: number;
|
|
121
|
+
vaultDropOnExit: number;
|
|
122
|
+
vaultExitSpeed: number;
|
|
123
|
+
vaultExitDownSpeed: number;
|
|
104
124
|
};
|
|
105
125
|
wallRun: {
|
|
106
126
|
minSpeed: number;
|
|
@@ -185,6 +205,7 @@ export class FirstPersonPlayerController {
|
|
|
185
205
|
pitchMinDeg: number;
|
|
186
206
|
pitchMaxDeg: number;
|
|
187
207
|
invertY: boolean;
|
|
208
|
+
maxFrameDeltaRad: number;
|
|
188
209
|
};
|
|
189
210
|
posture: {
|
|
190
211
|
sprintForwardPitchDeg: number;
|
|
@@ -308,7 +329,7 @@ declare class FirstPersonSignals {
|
|
|
308
329
|
onBreathOut: Signal<any, any, any, any, any, any, any, any>;
|
|
309
330
|
/** {ledgeHeight:number} — fired when LedgeGrab activates. */
|
|
310
331
|
onLedgeGrab: Signal<any, any, any, any, any, any, any, any>;
|
|
311
|
-
/** {reason:"mantle-up"|"drop"|"slip"|"shuffle-off"} */
|
|
332
|
+
/** {reason:"mantle-up"|"vault"|"drop"|"slip"|"shuffle-off"} */
|
|
312
333
|
onLedgeRelease: Signal<any, any, any, any, any, any, any, any>;
|
|
313
334
|
}
|
|
314
335
|
import { MasterySet } from "./mastery/MasterySet.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirstPersonPlayerController.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerController.js"],"names":[],"mappings":"AA8HA;;;;;;;;;;GAUG;AACH;IACI,wBAAgD;IAG5C,0CAAqD;IACrD,0BAAqC;IACrC,wBAAmC;IACnC,sBAAiC;IACjC,4BAAuC;IAEvC;;;;;;OAMG;IACH,SAFU,UAAU,CAEW;IAE/B;;;;;OAKG;IACH,WAFU,UAAU,CAEa;IAEjC;;;;;;OAMG;IACH,WAFU,MAAM,CAEG;IAGvB
|
|
1
|
+
{"version":3,"file":"FirstPersonPlayerController.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerController.js"],"names":[],"mappings":"AA8HA;;;;;;;;;;GAUG;AACH;IACI,wBAAgD;IAG5C,0CAAqD;IACrD,0BAAqC;IACrC,wBAAmC;IACnC,sBAAiC;IACjC,4BAAuC;IAEvC;;;;;;OAMG;IACH,SAFU,UAAU,CAEW;IAE/B;;;;;OAKG;IACH,WAFU,UAAU,CAEa;IAEjC;;;;;;OAMG;IACH,WAFU,MAAM,CAEG;IAGvB;;;;;;;;;;;;;;;qCA/FA,+EAA+E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiG9E;IAED,0BAIC;IAED;;OAEG;IACH,YAFW,2BAA2B,QAKrC;IAED,qCAIC;IAED,4BAGC;IAED,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;0CAA3B,2BAA2B;oBAL1F,+BAA+B;oBAC/B,+BAA+B;mBAFhC,uCAAuC"}
|
|
@@ -120,7 +120,7 @@ class FirstPersonSignals {
|
|
|
120
120
|
onBreathOut = new Signal();
|
|
121
121
|
/** {ledgeHeight:number} — fired when LedgeGrab activates. */
|
|
122
122
|
onLedgeGrab = new Signal();
|
|
123
|
-
/** {reason:"mantle-up"|"drop"|"slip"|"shuffle-off"} */
|
|
123
|
+
/** {reason:"mantle-up"|"vault"|"drop"|"slip"|"shuffle-off"} */
|
|
124
124
|
onLedgeRelease = new Signal();
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -22,6 +22,15 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
22
22
|
mass: number;
|
|
23
23
|
/** Reference mass against which `mass` is normalized (massRatio = mass/refMass). */
|
|
24
24
|
referenceMass: number;
|
|
25
|
+
/**
|
|
26
|
+
* Leg push-off distance, meters — the crouch-to-full-extension travel
|
|
27
|
+
* over which the legs do their launching work. Together with `mass` it
|
|
28
|
+
* turns a jump FORCE (newtons) into a launch velocity via the work-energy
|
|
29
|
+
* model in {@link jumpDynamics} (`v₀ = √(2·F·d/m)`). ~0.45 m matches a
|
|
30
|
+
* ~1.8 m human countermovement jump. See {@link jumpForceForHeight} for
|
|
31
|
+
* the back-calculation from a desired apex height.
|
|
32
|
+
*/
|
|
33
|
+
jumpPushoffDistance: number;
|
|
25
34
|
/**
|
|
26
35
|
* How strongly `mass` couples into derived effects. 0 = mass is
|
|
27
36
|
* cosmetic; 1.0 = full coupling (heavier ⇒ lower jump, lower accel,
|
|
@@ -158,6 +167,38 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
158
167
|
* is allowed (when not already wall-running). */
|
|
159
168
|
nearWallMaxDistance: number;
|
|
160
169
|
};
|
|
170
|
+
/**
|
|
171
|
+
* Scramble-up ability — a short vertical wall-run up a wall the player runs
|
|
172
|
+
* INTO (à la Assassin's Creed), to reach a high ledge to grab or to kick
|
|
173
|
+
* off. Fields here are consumed by the {@link ScrambleUp} ability if
|
|
174
|
+
* registered; ignored otherwise.
|
|
175
|
+
*/
|
|
176
|
+
scrambleUp: {
|
|
177
|
+
/** Standstill push-off force (N) — a scramble jumped with no run-up. At
|
|
178
|
+
* the default 80 kg body + 0.45 m push-off this launches ~5 m/s (~0.9 m
|
|
179
|
+
* up the wall at the default decel). */
|
|
180
|
+
baseJumpForce: number;
|
|
181
|
+
/** Force (N) added per m/s of horizontal approach speed at the jump —
|
|
182
|
+
* the running-start reward, in the same physical currency as the base. */
|
|
183
|
+
momentumForcePerSpeed: number;
|
|
184
|
+
/** Cap on the push-off force (N) — a full sprint run-up tops out here
|
|
185
|
+
* (~9 m/s launch, ~2.9 m climb at the default body + decel). */
|
|
186
|
+
maxJumpForce: number;
|
|
187
|
+
/** Upward deceleration (m/s²) — strong, so the climb is a SHORT burst:
|
|
188
|
+
* apex ≈ launchVy²/(2·decel) m high, reached in launchVy/decel s. */
|
|
189
|
+
decel: number;
|
|
190
|
+
/** Small into-wall speed (m/s) holding the body against the face as it
|
|
191
|
+
* climbs (the mover clips the penetration). */
|
|
192
|
+
hugSpeed: number;
|
|
193
|
+
/** Safety cap on scramble duration (s) — releases even if the apex
|
|
194
|
+
* somehow isn't reached. */
|
|
195
|
+
maxDuration: number;
|
|
196
|
+
/** Wall-kick (jump during the scramble): outward impulse (m/s along the
|
|
197
|
+
* wall normal). The kick's UPWARD launch is not tuned here — it uses the
|
|
198
|
+
* body's full jump push-off force (`runtime.jumpForce`), so a wall-kick
|
|
199
|
+
* rises like a max-height jump. */
|
|
200
|
+
kickOutwardImpulse: number;
|
|
201
|
+
};
|
|
161
202
|
/**
|
|
162
203
|
* Ledge-grab ability — snap to a forward ledge while descending and
|
|
163
204
|
* hang from it until the player releases. Climbing fatigue is
|
|
@@ -186,6 +227,44 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
186
227
|
* ledge so mantle's ledgeAhead probe still resolves correctly
|
|
187
228
|
* on the next tick. */
|
|
188
229
|
mantleUpUpFactor: number;
|
|
230
|
+
/** Shimmy speed along the edge (m/s). */
|
|
231
|
+
shimmySpeed: number;
|
|
232
|
+
/** Pressing jump pulls up only when facing within this half-cone of
|
|
233
|
+
* the wall (degrees); facing further away leaves you hanging. */
|
|
234
|
+
pullUpFacingConeDeg: number;
|
|
235
|
+
/** World-move toward the wall above this (unit move) triggers pull-up. */
|
|
236
|
+
moveTowardThreshold: number;
|
|
237
|
+
/** World-move away from the wall must exceed this AND dominate the
|
|
238
|
+
* lateral component to trigger a drop. Set HIGHER than
|
|
239
|
+
* `moveTowardThreshold` on purpose: dismounting (you fall) is more
|
|
240
|
+
* consequential than a pull-up or a shimmy, so it takes a clearly
|
|
241
|
+
* committed, off-the-wall push — a strafe taken while looking somewhat
|
|
242
|
+
* off the wall reads as a shimmy, not an ejection. */
|
|
243
|
+
moveAwayThreshold: number;
|
|
244
|
+
/** Refractory window (seconds) after ANY ledge release during which the
|
|
245
|
+
* auto-catch can't re-grab. A deliberate dismount drops you straight
|
|
246
|
+
* down the wall face, where the forward/ledge probes keep firing — so
|
|
247
|
+
* without this the auto-catch would immediately re-grab the same lip,
|
|
248
|
+
* snapping the body back onto the wall. ~0.3s lets the body fall clear
|
|
249
|
+
* of the grab window first. (The old forward-intent grab gate hid this;
|
|
250
|
+
* auto-catch needs it explicit.) */
|
|
251
|
+
regrabCooldown: number;
|
|
252
|
+
/** Lateral world-move above this (and dominant) triggers a shimmy step. */
|
|
253
|
+
shimmyLateralMin: number;
|
|
254
|
+
/** Extra gap beyond the capsule radius the lateral clearance ray needs. */
|
|
255
|
+
shimmyClearanceGap: number;
|
|
256
|
+
/** Height (relative to the edge) to cast the lateral clearance ray. */
|
|
257
|
+
shimmyClearanceProbeY: number;
|
|
258
|
+
/** Forward (into-wall) offset of the continuity down-probe past the edge. */
|
|
259
|
+
shimmyEdgeProbeForward: number;
|
|
260
|
+
/** Continuity down-probe starts this far above the edge… */
|
|
261
|
+
shimmyContinuityProbeUp: number;
|
|
262
|
+
/** …and reaches this far below it. */
|
|
263
|
+
shimmyContinuityProbeDown: number;
|
|
264
|
+
/** Continuity hit must be within this of the edge height to count. */
|
|
265
|
+
shimmyContinuityTol: number;
|
|
266
|
+
/** Exertion rises this much faster while actively shimmying. */
|
|
267
|
+
shimmyExertionFactor: number;
|
|
189
268
|
};
|
|
190
269
|
/**
|
|
191
270
|
* Mantle ability — auto-triggers when the player approaches a
|
|
@@ -209,6 +288,19 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
209
288
|
* forward bias so the player ends on top of the surface, not
|
|
210
289
|
* on the edge. */
|
|
211
290
|
forwardOffsetOnLand: number;
|
|
291
|
+
/** Reachable-height ceiling when pulling up from a hang (vs maxHeight
|
|
292
|
+
* for auto-mantle) — the hang sits right at ~maxHeight, so give slack. */
|
|
293
|
+
pullUpMaxHeight: number;
|
|
294
|
+
/** How far past the grab edge the vault carries the body before release. */
|
|
295
|
+
vaultDistance: number;
|
|
296
|
+
/** Apex height above the edge the vault hump rises to. */
|
|
297
|
+
vaultApexClearance: number;
|
|
298
|
+
/** How far below the apex the vault descends before it releases. */
|
|
299
|
+
vaultDropOnExit: number;
|
|
300
|
+
/** Forward speed handed back on a vault release (carries you over). */
|
|
301
|
+
vaultExitSpeed: number;
|
|
302
|
+
/** Downward speed handed back on a vault release (so you commit over). */
|
|
303
|
+
vaultExitDownSpeed: number;
|
|
212
304
|
};
|
|
213
305
|
/**
|
|
214
306
|
* Slide ability — activates from sprint+crouch when grounded. The
|
|
@@ -422,6 +514,14 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
422
514
|
pitchMinDeg: number;
|
|
423
515
|
pitchMaxDeg: number;
|
|
424
516
|
invertY: boolean;
|
|
517
|
+
/** Input-SPIKE rejection. A single render frame whose look delta
|
|
518
|
+
* (radians, after sensitivity) exceeds this is treated as a corrupt
|
|
519
|
+
* mouse/driver `movementX` glitch — NOT a real turn — and dropped. This
|
|
520
|
+
* is what stops the 20–100° camera snap from a high-res mouse under OS
|
|
521
|
+
* pointer acceleration / a browser pointer-lock burst. Even an
|
|
522
|
+
* extremely fast flick stays well under this at render rate (~0.3 rad ≈
|
|
523
|
+
* 17° in one frame would already be ~4000°/s). */
|
|
524
|
+
maxFrameDeltaRad: number;
|
|
425
525
|
};
|
|
426
526
|
/**
|
|
427
527
|
* Postural shifts driven by intent — distinct from look (which is
|
|
@@ -461,6 +561,15 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
461
561
|
mass: number;
|
|
462
562
|
/** Reference mass against which `mass` is normalized (massRatio = mass/refMass). */
|
|
463
563
|
referenceMass: number;
|
|
564
|
+
/**
|
|
565
|
+
* Leg push-off distance, meters — the crouch-to-full-extension travel
|
|
566
|
+
* over which the legs do their launching work. Together with `mass` it
|
|
567
|
+
* turns a jump FORCE (newtons) into a launch velocity via the work-energy
|
|
568
|
+
* model in {@link jumpDynamics} (`v₀ = √(2·F·d/m)`). ~0.45 m matches a
|
|
569
|
+
* ~1.8 m human countermovement jump. See {@link jumpForceForHeight} for
|
|
570
|
+
* the back-calculation from a desired apex height.
|
|
571
|
+
*/
|
|
572
|
+
jumpPushoffDistance: number;
|
|
464
573
|
/**
|
|
465
574
|
* How strongly `mass` couples into derived effects. 0 = mass is
|
|
466
575
|
* cosmetic; 1.0 = full coupling (heavier ⇒ lower jump, lower accel,
|
|
@@ -578,6 +687,44 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
578
687
|
* ledge so mantle's ledgeAhead probe still resolves correctly
|
|
579
688
|
* on the next tick. */
|
|
580
689
|
mantleUpUpFactor: number;
|
|
690
|
+
/** Shimmy speed along the edge (m/s). */
|
|
691
|
+
shimmySpeed: number;
|
|
692
|
+
/** Pressing jump pulls up only when facing within this half-cone of
|
|
693
|
+
* the wall (degrees); facing further away leaves you hanging. */
|
|
694
|
+
pullUpFacingConeDeg: number;
|
|
695
|
+
/** World-move toward the wall above this (unit move) triggers pull-up. */
|
|
696
|
+
moveTowardThreshold: number;
|
|
697
|
+
/** World-move away from the wall must exceed this AND dominate the
|
|
698
|
+
* lateral component to trigger a drop. Set HIGHER than
|
|
699
|
+
* `moveTowardThreshold` on purpose: dismounting (you fall) is more
|
|
700
|
+
* consequential than a pull-up or a shimmy, so it takes a clearly
|
|
701
|
+
* committed, off-the-wall push — a strafe taken while looking somewhat
|
|
702
|
+
* off the wall reads as a shimmy, not an ejection. */
|
|
703
|
+
moveAwayThreshold: number;
|
|
704
|
+
/** Refractory window (seconds) after ANY ledge release during which the
|
|
705
|
+
* auto-catch can't re-grab. A deliberate dismount drops you straight
|
|
706
|
+
* down the wall face, where the forward/ledge probes keep firing — so
|
|
707
|
+
* without this the auto-catch would immediately re-grab the same lip,
|
|
708
|
+
* snapping the body back onto the wall. ~0.3s lets the body fall clear
|
|
709
|
+
* of the grab window first. (The old forward-intent grab gate hid this;
|
|
710
|
+
* auto-catch needs it explicit.) */
|
|
711
|
+
regrabCooldown: number;
|
|
712
|
+
/** Lateral world-move above this (and dominant) triggers a shimmy step. */
|
|
713
|
+
shimmyLateralMin: number;
|
|
714
|
+
/** Extra gap beyond the capsule radius the lateral clearance ray needs. */
|
|
715
|
+
shimmyClearanceGap: number;
|
|
716
|
+
/** Height (relative to the edge) to cast the lateral clearance ray. */
|
|
717
|
+
shimmyClearanceProbeY: number;
|
|
718
|
+
/** Forward (into-wall) offset of the continuity down-probe past the edge. */
|
|
719
|
+
shimmyEdgeProbeForward: number;
|
|
720
|
+
/** Continuity down-probe starts this far above the edge… */
|
|
721
|
+
shimmyContinuityProbeUp: number;
|
|
722
|
+
/** …and reaches this far below it. */
|
|
723
|
+
shimmyContinuityProbeDown: number;
|
|
724
|
+
/** Continuity hit must be within this of the edge height to count. */
|
|
725
|
+
shimmyContinuityTol: number;
|
|
726
|
+
/** Exertion rises this much faster while actively shimmying. */
|
|
727
|
+
shimmyExertionFactor: number;
|
|
581
728
|
};
|
|
582
729
|
mantle: {
|
|
583
730
|
/** Below this height (m above feet), the obstacle is just a step
|
|
@@ -594,6 +741,19 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
594
741
|
* forward bias so the player ends on top of the surface, not
|
|
595
742
|
* on the edge. */
|
|
596
743
|
forwardOffsetOnLand: number;
|
|
744
|
+
/** Reachable-height ceiling when pulling up from a hang (vs maxHeight
|
|
745
|
+
* for auto-mantle) — the hang sits right at ~maxHeight, so give slack. */
|
|
746
|
+
pullUpMaxHeight: number;
|
|
747
|
+
/** How far past the grab edge the vault carries the body before release. */
|
|
748
|
+
vaultDistance: number;
|
|
749
|
+
/** Apex height above the edge the vault hump rises to. */
|
|
750
|
+
vaultApexClearance: number;
|
|
751
|
+
/** How far below the apex the vault descends before it releases. */
|
|
752
|
+
vaultDropOnExit: number;
|
|
753
|
+
/** Forward speed handed back on a vault release (carries you over). */
|
|
754
|
+
vaultExitSpeed: number;
|
|
755
|
+
/** Downward speed handed back on a vault release (so you commit over). */
|
|
756
|
+
vaultExitDownSpeed: number;
|
|
597
757
|
};
|
|
598
758
|
wallRun: {
|
|
599
759
|
/**
|
|
@@ -830,6 +990,14 @@ export class FirstPersonPlayerControllerConfig {
|
|
|
830
990
|
pitchMinDeg: number;
|
|
831
991
|
pitchMaxDeg: number;
|
|
832
992
|
invertY: boolean;
|
|
993
|
+
/** Input-SPIKE rejection. A single render frame whose look delta
|
|
994
|
+
* (radians, after sensitivity) exceeds this is treated as a corrupt
|
|
995
|
+
* mouse/driver `movementX` glitch — NOT a real turn — and dropped. This
|
|
996
|
+
* is what stops the 20–100° camera snap from a high-res mouse under OS
|
|
997
|
+
* pointer acceleration / a browser pointer-lock burst. Even an
|
|
998
|
+
* extremely fast flick stays well under this at render rate (~0.3 rad ≈
|
|
999
|
+
* 17° in one frame would already be ~4000°/s). */
|
|
1000
|
+
maxFrameDeltaRad: number;
|
|
833
1001
|
};
|
|
834
1002
|
posture: {
|
|
835
1003
|
/** Forward pitch (deg) applied to the eye at full sprint. Positive = look-down. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirstPersonPlayerControllerConfig.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerConfig.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;QACI,qDAAqD;;QAErD,2BAA2B;;QAE3B;;yBAEiB;;QAEjB,8CAA8C;;QAE9C,iFAAiF;;QAEjF,oFAAoF;;QAEpF;;;;;;;;;WASG;;MAEL;IAMF;;;;QAII,iEAAiE;;QAEjE;;;;;;;;;;;;;;;;;;;WAmBG;;QAEH,kEAAkE;;QAElE,oDAAoD;;QAEpD;;;;;WAKG;;QAEH;;;;WAIG;;MAEL;IAEF;QACI,2CAA2C;;QAE3C,sEAAsE;;;;QAItE,kDAAkD;;QAElD,iEAAiE;;;;;;MAMnE;IAEF;QACI,yDAAyD;;QAEzD,yDAAyD;;;YAGrD,oDAAoD;;YAEpD,0BAA0B;;;;gBAItB,mEAAmE;;;;MAI7E;IAEF;QACI,gEAAgE;;QAEhE,yBAAyB;;MAE3B;IAEF;;;;;;OAMG;IACH;QACI;;;;;WAKG;;QAEH;+EACuE;;QAEvE,4DAA4D;;QAE5D,0EAA0E;;QAE1E;kEAC0D;;MAE5D;IAEF;;;;OAIG;IACH;QACI,6EAA6E;;QAE7E,oDAAoD;;QAEpD;0DACkD;;MAEpD;IAEF;;;;;;OAMG;IACH;QACI;;qBAEa;;QAEb;;;4DAGoD;;QAEpD;0EACkE;;QAElE;iEACyD;;QAEzD;;;gCAGwB;;
|
|
1
|
+
{"version":3,"file":"FirstPersonPlayerControllerConfig.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerConfig.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;QACI,qDAAqD;;QAErD,2BAA2B;;QAE3B;;yBAEiB;;QAEjB,8CAA8C;;QAE9C,iFAAiF;;QAEjF,oFAAoF;;QAEpF;;;;;;;WAOG;;QAEH;;;;;;;;;WASG;;MAEL;IAMF;;;;QAII,iEAAiE;;QA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