@woosh/meep-engine 2.165.6 → 2.166.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/build/bundle-worker-image-decoder.js +1 -1
- package/editor/tools/v2/GizmoNode.d.ts +21 -0
- package/editor/tools/v2/GizmoNode.d.ts.map +1 -0
- package/editor/tools/v2/TransformControls.d.ts +87 -20
- package/editor/tools/v2/TransformControls.d.ts.map +1 -0
- package/editor/tools/v2/TransformControlsGizmo.d.ts +22 -0
- package/editor/tools/v2/TransformControlsGizmo.d.ts.map +1 -0
- package/editor/tools/v2/TransformControlsPlane.d.ts +6 -0
- package/editor/tools/v2/TransformControlsPlane.d.ts.map +1 -0
- package/editor/tools/v2/TranslateHelperGeometry.d.ts +6 -0
- package/editor/tools/v2/TranslateHelperGeometry.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/CORRECTNESS_HUNT_2026_07_24.md +142 -0
- package/src/core/binary/BinaryBuffer.js +1 -1
- package/src/core/binary/EncodingBinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/EncodingBinaryBuffer.js +3 -1
- package/src/core/binary/data_view/DataType2DataViewReaders.d.ts +8 -12
- package/src/core/binary/data_view/DataType2DataViewReaders.d.ts.map +1 -1
- package/src/core/binary/data_view/DataType2DataViewWriters.d.ts +8 -12
- package/src/core/binary/data_view/DataType2DataViewWriters.d.ts.map +1 -1
- package/src/core/binary/data_view/DataViewStructAccessor.d.ts +39 -18
- package/src/core/binary/type/BinaryDataType.d.ts +15 -15
- package/src/core/binary/type/DataType2TypedArrayConstructorMapping.d.ts +7 -11
- package/src/core/binary/type/DataType2TypedArrayConstructorMapping.d.ts.map +1 -1
- package/src/core/binary/type/DataTypeByteSizes.d.ts +7 -13
- package/src/core/binary/type/DataTypeByteSizes.d.ts.map +1 -1
- package/src/core/binary/type/DataTypeIndices.d.ts +8 -11
- package/src/core/binary/type/DataTypeIndices.d.ts.map +1 -1
- package/src/core/cache/Cache.d.ts +226 -56
- package/src/core/cache/Cache.d.ts.map +1 -1
- package/src/core/cache/Cache.js +0 -4
- package/src/core/cache/CacheElement.d.ts.map +1 -1
- package/src/core/cache/CacheElement.js +4 -0
- package/src/core/cache/FrequencySketch.d.ts +0 -21
- package/src/core/cache/FrequencySketch.d.ts.map +1 -1
- package/src/core/cache/FrequencySketch.js +66 -65
- package/src/core/cache/LoadingCache.d.ts +72 -23
- package/src/core/cache/wtinylfu/CacheElementWTinylfu.d.ts +17 -0
- package/src/core/cache/wtinylfu/CacheElementWTinylfu.d.ts.map +1 -0
- package/src/core/cache/wtinylfu/CacheElementWTinylfu.js +18 -0
- package/src/core/cache/wtinylfu/CacheRegionType.d.ts +10 -0
- package/src/core/cache/wtinylfu/CacheRegionType.d.ts.map +1 -0
- package/src/core/cache/wtinylfu/CacheRegionType.js +10 -0
- package/src/core/cache/wtinylfu/CacheRegionWTinylfu.d.ts +66 -0
- package/src/core/cache/wtinylfu/CacheRegionWTinylfu.d.ts.map +1 -0
- package/src/core/cache/wtinylfu/CacheRegionWTinylfu.js +183 -0
- package/src/core/cache/wtinylfu/CacheWTinylfu.d.ts +279 -0
- package/src/core/cache/wtinylfu/CacheWTinylfu.d.ts.map +1 -0
- package/src/core/cache/wtinylfu/CacheWTinylfu.js +807 -0
- package/src/core/cache/wtinylfu/benchmark/CacheWTinylfu.bench.md +243 -0
- package/src/core/cache/wtinylfu/wtinylfuDecisions.d.ts +80 -0
- package/src/core/cache/wtinylfu/wtinylfuDecisions.d.ts.map +1 -0
- package/src/core/cache/wtinylfu/wtinylfuDecisions.js +102 -0
- package/src/core/collection/RingBuffer.d.ts.map +1 -1
- package/src/core/collection/RingBuffer.js +15 -3
- package/src/core/collection/Stack.d.ts +2 -2
- package/src/core/collection/array/array_copy.d.ts +12 -7
- package/src/core/collection/array/computeHashArray.d.ts +9 -1
- package/src/core/collection/array/isArrayEqualStrict.d.ts +8 -1
- package/src/core/collection/array/isArraysEqualWithComparator.d.ts +10 -1
- package/src/core/collection/array/iterator/ArrayIteratorRandom.d.ts +3 -1
- package/src/core/collection/array/iterator/ArrayIteratorRandom.d.ts.map +1 -1
- package/src/core/collection/list/List.d.ts +334 -45
- package/src/core/collection/list/List.d.ts.map +1 -1
- package/src/core/collection/list/ListForwarder.d.ts +37 -18
- package/src/core/collection/map/HashMap.d.ts +199 -40
- package/src/core/collection/map/HashMap.d.ts.map +1 -1
- package/src/core/collection/map/HashMap.js +5 -17
- package/src/core/collection/queue/Deque.d.ts +113 -37
- package/src/core/collection/set/ArraySet.d.ts +87 -26
- package/src/core/collection/set/HashSet.d.ts +66 -33
- package/src/core/collection/set/HashSet.d.ts.map +1 -1
- package/src/core/collection/table/bind/TableRecord.d.ts +21 -20
- package/src/core/color/Color.d.ts +1 -2
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/events/signal/Signal.d.ts +210 -57
- package/src/core/events/signal/signal_filter.d.ts +1 -1
- package/src/core/fsm/simple/SimpleStateMachine.d.ts +83 -27
- package/src/core/fsm/simple/SimpleStateMachineDescription.d.ts +90 -21
- package/src/core/geom/2d/aabb/AABB2.d.ts +335 -51
- package/src/core/geom/2d/line/line2_compute_segment_point_distance_sqr.d.ts.map +1 -1
- package/src/core/geom/2d/line/line2_compute_segment_point_distance_sqr.js +5 -0
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts +1 -6
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeNode.d.ts +1 -2
- package/src/core/geom/2d/quad-tree/QuadTreeNode.d.ts.map +1 -1
- package/src/core/geom/3d/SurfacePoint3.d.ts +62 -17
- package/src/core/geom/3d/aabb/aabb3_build_corners.d.ts +13 -1
- package/src/core/geom/3d/frustum/read_three_planes_to_array.d.ts +7 -3
- package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.d.ts +7 -6
- package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.d.ts +16 -6
- package/src/core/geom/ConicRay.d.ts.map +1 -1
- package/src/core/geom/ConicRay.js +9 -2
- package/src/core/geom/Quaternion.d.ts +1 -2
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +7 -3
- package/src/core/geom/Vector1.d.ts +1 -2
- package/src/core/geom/Vector1.d.ts.map +1 -1
- package/src/core/geom/Vector2.d.ts +1 -2
- package/src/core/geom/Vector2.d.ts.map +1 -1
- package/src/core/geom/Vector3.d.ts +1 -2
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector4.d.ts +1 -1
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/graph/v2/Graph.d.ts +4 -4
- package/src/core/graph/v2/Graph.d.ts.map +1 -1
- package/src/core/json/resolvePathByArray.d.ts +10 -1
- package/src/core/math/build_gaussian_kernel_1d.d.ts +2 -2
- package/src/core/math/build_gaussian_kernel_1d.d.ts.map +1 -1
- package/src/core/math/build_gaussian_kernel_1d.js +4 -2
- package/src/core/math/build_gaussian_kernel_2d.d.ts +2 -2
- package/src/core/math/build_gaussian_kernel_2d.d.ts.map +1 -1
- package/src/core/math/build_gaussian_kernel_2d.js +4 -2
- package/src/core/math/clamp.d.ts +9 -1
- package/src/core/math/epsilonEquals.d.ts +9 -1
- package/src/core/math/gaussian.d.ts +2 -2
- package/src/core/math/gaussian.js +2 -2
- package/src/core/math/interval/NumericInterval.d.ts +1 -2
- package/src/core/math/interval/NumericInterval.d.ts.map +1 -1
- package/src/core/math/noise/create_simplex_noise_2d.d.ts +7 -1
- package/src/core/math/random/seededRandom.d.ts +3 -1
- package/src/core/math/remap.d.ts +12 -5
- package/src/core/math/sign.d.ts +10 -1
- package/src/core/math/spline/spline3_bezier_bounds.d.ts.map +1 -1
- package/src/core/math/spline/spline3_bezier_bounds.js +10 -3
- package/src/core/math/spline/spline3_bezier_to_hermite.d.ts +8 -7
- package/src/core/math/spline/spline3_bezier_to_hermite.d.ts.map +1 -1
- package/src/core/math/spline/spline3_bezier_to_hermite.js +13 -12
- package/src/core/math/spline/spline3_hermite_bounds.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_bounds.js +10 -3
- package/src/core/math/spline/spline3_hermite_bounds_t.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_bounds_t.js +115 -109
- package/src/core/math/spline/spline3_hermite_to_bezier.d.ts +2 -0
- package/src/core/math/spline/spline3_hermite_to_bezier.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_to_bezier.js +2 -0
- package/src/core/math/statistics/computeStatisticalMean.js +1 -1
- package/src/core/math/statistics/gaussian_amplitude.d.ts.map +1 -1
- package/src/core/math/statistics/gaussian_amplitude.js +3 -1
- package/src/core/model/BooleanVector3.d.ts +77 -28
- package/src/core/model/BooleanVector3.d.ts.map +1 -1
- package/src/core/model/BoundedValue.d.ts +5 -5
- package/src/core/model/BoundedValue.d.ts.map +1 -1
- package/src/core/model/ModuleRegistry.d.ts +45 -3
- package/src/core/model/ObservedBoolean.d.ts +1 -2
- package/src/core/model/ObservedBoolean.d.ts.map +1 -1
- package/src/core/model/ObservedEnum.d.ts +91 -7
- package/src/core/model/ObservedEnum.d.ts.map +1 -1
- package/src/core/model/ObservedString.d.ts +1 -2
- package/src/core/model/ObservedString.d.ts.map +1 -1
- package/src/core/model/ObservedValue.d.ts +1 -1
- package/src/core/model/ObservedValue.d.ts.map +1 -1
- package/src/core/model/node-graph/Connection.d.ts +57 -12
- package/src/core/model/node-graph/NodeGraph.d.ts +2 -2
- package/src/core/model/node-graph/node/NodeDescription.d.ts +166 -15
- package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstance.d.ts +181 -22
- package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts +82 -3
- package/src/core/model/node-graph/node/Port.d.ts +72 -3
- package/src/core/model/node-graph/node/Port.d.ts.map +1 -1
- package/src/core/model/node-graph/node/PortDirection.d.ts +7 -5
- package/src/core/model/node-graph/type/DataType.d.ts +61 -4
- package/src/core/model/node-graph/type/ParametricDataType.d.ts +0 -1
- package/src/core/model/node-graph/type/ParametricDataType.d.ts.map +1 -1
- package/src/core/model/object/ImmutableObjectPool.d.ts +1 -2
- package/src/core/model/object/ImmutableObjectPool.d.ts.map +1 -1
- package/src/core/model/object/invokeObjectEquals.d.ts +9 -5
- package/src/core/model/object/invokeObjectHash.d.ts +7 -5
- package/src/core/model/object/objectDeepEquals.d.ts +10 -1
- package/src/core/model/object/objectKeyByValue.d.ts +10 -1
- package/src/core/model/object/read_property.d.ts +11 -1
- package/src/core/model/object/write_property.d.ts +10 -1
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts +6 -0
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts.map +1 -1
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +12 -12
- package/src/core/model/reactive/js/compileReactiveToJS.d.ts.map +1 -1
- package/src/core/model/reactive/js/compileReactiveToJS.js +35 -1
- package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts +1 -3
- package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts.map +1 -1
- package/src/core/model/reactive/model/ReactiveExpression.d.ts +63 -10
- package/src/core/model/reactive/model/ReactiveExpression.d.ts.map +1 -1
- package/src/core/model/reactive/model/ReactiveUnaryExpression.d.ts +0 -12
- package/src/core/model/reactive/model/ReactiveUnaryExpression.d.ts.map +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveAdd.d.ts +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveAdd.d.ts.map +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveDivide.d.ts +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveDivide.d.ts.map +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveMultiply.d.ts +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveMultiply.d.ts.map +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveNegate.d.ts +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveNegate.d.ts.map +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveSubtract.d.ts +1 -1
- package/src/core/model/reactive/model/arithmetic/ReactiveSubtract.d.ts.map +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveEquals.d.ts +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveEquals.d.ts.map +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveGreaterThan.d.ts +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveGreaterThan.d.ts.map +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveGreaterThanOrEqual.d.ts +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveGreaterThanOrEqual.d.ts.map +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveLessThan.d.ts +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveLessThan.d.ts.map +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveLessThanOrEqual.d.ts +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveLessThanOrEqual.d.ts.map +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveNotEquals.d.ts +1 -1
- package/src/core/model/reactive/model/comparative/ReactiveNotEquals.d.ts.map +1 -1
- package/src/core/model/reactive/model/logic/ReactiveAnd.d.ts +41 -5
- package/src/core/model/reactive/model/logic/ReactiveAnd.d.ts.map +1 -1
- package/src/core/model/reactive/model/logic/ReactiveNot.d.ts +1 -1
- package/src/core/model/reactive/model/logic/ReactiveNot.d.ts.map +1 -1
- package/src/core/model/reactive/model/logic/ReactiveOr.d.ts +2 -1
- package/src/core/model/reactive/model/logic/ReactiveOr.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveLiteralBoolean.d.ts +2 -1
- package/src/core/model/reactive/model/terminal/ReactiveLiteralBoolean.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveLiteralNumber.d.ts +2 -3
- package/src/core/model/reactive/model/terminal/ReactiveLiteralNumber.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveLiteralString.d.ts +2 -4
- package/src/core/model/reactive/model/terminal/ReactiveLiteralString.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts +68 -11
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
- package/src/core/model/stat/LinearModifier.d.ts +79 -24
- package/src/core/parser/simple/DataType.d.ts +13 -5
- package/src/core/parser/simple/Token.d.ts +52 -13
- package/src/core/parser/simple/readArrayLiteral.d.ts +1 -0
- package/src/core/parser/simple/readArrayLiteral.d.ts.map +1 -1
- package/src/core/parser/simple/readBooleanToken.d.ts +1 -0
- package/src/core/parser/simple/readBooleanToken.d.ts.map +1 -1
- package/src/core/parser/simple/readHexToken.d.ts +1 -0
- package/src/core/parser/simple/readHexToken.d.ts.map +1 -1
- package/src/core/parser/simple/readIdentifierToken.d.ts +1 -0
- package/src/core/parser/simple/readIdentifierToken.d.ts.map +1 -1
- package/src/core/parser/simple/readNumberToken.d.ts +1 -0
- package/src/core/parser/simple/readNumberToken.d.ts.map +1 -1
- package/src/core/parser/simple/readReferenceToken.d.ts +1 -0
- package/src/core/parser/simple/readReferenceToken.d.ts.map +1 -1
- package/src/core/parser/simple/readStringToken.d.ts +1 -0
- package/src/core/parser/simple/readStringToken.d.ts.map +1 -1
- package/src/core/parser/simple/readUnsignedIntegerToken.d.ts +1 -0
- package/src/core/parser/simple/readUnsignedIntegerToken.d.ts.map +1 -1
- package/src/core/process/BaseProcess.d.ts +17 -5
- package/src/core/process/BaseProcess.d.ts.map +1 -1
- package/src/core/process/CompositeProcess.d.ts +0 -1
- package/src/core/process/CompositeProcess.d.ts.map +1 -1
- package/src/core/process/action/AsynchronousAction.d.ts +3 -3
- package/src/core/process/executor/ConcurrentExecutor.d.ts +3 -3
- package/src/core/process/filter/MutableFilter.d.ts +1 -1
- package/src/core/process/filter/MutableFilter.d.ts.map +1 -1
- package/src/core/process/task/Task.d.ts +1 -1
- package/src/core/process/task/Task.d.ts.map +1 -1
- package/src/core/process/task/TaskGroup.d.ts +3 -3
- package/src/core/process/task/TaskSignal.d.ts +8 -6
- package/src/core/process/undo/Action.d.ts +31 -9
- package/src/core/process/undo/ActionGroup.d.ts +20 -5
- package/src/core/process/undo/ActionProcessor.d.ts +163 -27
- package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
- package/src/engine/Engine.d.ts +178 -42
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/EngineConfiguration.d.ts +74 -20
- package/src/engine/achievements/AchievementGateway.d.ts +17 -5
- package/src/engine/achievements/AchievementManager.d.ts +0 -1
- package/src/engine/achievements/AchievementManager.d.ts.map +1 -1
- package/src/engine/animation/Tween.d.ts +1 -1
- package/src/engine/animation/clip/AnimationClip.d.ts +24 -4
- package/src/engine/animation/clip/AnimationClipBinding.d.ts +35 -14
- package/src/engine/animation/clip/ecd_bind_animation_curve.d.ts.map +1 -1
- package/src/engine/animation/clip/ecd_bind_animation_curve.js +10 -1
- package/src/engine/animation/clip/hemisphere_align_quaternion_values.d.ts +20 -0
- package/src/engine/animation/clip/hemisphere_align_quaternion_values.d.ts.map +1 -0
- package/src/engine/animation/clip/hemisphere_align_quaternion_values.js +37 -0
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts +2 -2
- package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -1
- package/src/engine/animation/curve/editor/createKeyframeMarker.d.ts +1 -1
- package/src/engine/animation/curve/editor/createKeyframeMarker.d.ts.map +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.js +5 -1
- package/src/engine/animation/keyed2/behavior/AnimationBehavior.d.ts +0 -1
- package/src/engine/animation/keyed2/behavior/AnimationBehavior.d.ts.map +1 -1
- package/src/engine/asset/Asset.d.ts +47 -7
- package/src/engine/asset/AssetManager.d.ts +258 -60
- package/src/engine/asset/AssetRequestScope.d.ts +27 -3
- package/src/engine/asset/AssetTransformer.d.ts +16 -5
- package/src/engine/asset/CORS/CrossOriginConfig.d.ts +8 -5
- package/src/engine/asset/CORS/CrossOriginConfig.d.ts.map +1 -1
- package/src/engine/asset/CORS/CrossOriginKind.d.ts +5 -4
- package/src/engine/asset/loaders/AssetLoader.d.ts +50 -12
- package/src/engine/asset/loaders/GLTFAssetLoader.d.ts +71 -6
- package/src/engine/asset/loaders/image/ImageRGBADataAsset.d.ts +0 -1
- package/src/engine/asset/loaders/image/ImageRGBADataAsset.d.ts.map +1 -1
- package/src/engine/asset/loaders/material/StaticMaterialCache.d.ts +30 -7
- package/src/engine/asset/loaders/material/computeMaterialEquality.d.ts +8 -3
- package/src/engine/asset/loaders/material/computeMaterialHash.d.ts +7 -3
- package/src/engine/asset/loaders/material/traverseMaterialTextures.d.ts +8 -3
- package/src/engine/asset/loaders/texture/TextureAssetLoader.d.ts +6 -6
- package/src/engine/asset/preloader/AssetPreloader.d.ts +6 -15
- package/src/engine/asset/preloader/AssetPreloader.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +13 -13
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +14 -4
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +1 -1
- package/src/engine/ecs/Entity.d.ts +228 -41
- package/src/engine/ecs/EntityBlueprint.d.ts +43 -17
- package/src/engine/ecs/EntityComponentDataset.d.ts +580 -60
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +5 -21
- package/src/engine/ecs/EntityManager.d.ts +10 -9
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityObserver.d.ts +80 -13
- package/src/engine/ecs/System.d.ts +162 -33
- package/src/engine/ecs/animation/AnimationSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/animation/AnimationSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/attachment/AttachmentSystem.d.ts +1 -1
- package/src/engine/ecs/attachment/AttachmentSystem.d.ts.map +1 -1
- package/src/engine/ecs/components/PropertySetSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/components/PropertySetSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/components/SerializationMetadataSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/components/SerializationMetadataSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/components/TagSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/components/TagSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.d.ts +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWar.d.ts +10 -1
- package/src/engine/ecs/fow/FogOfWar.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWar.js +133 -54
- package/src/engine/ecs/fow/FogOfWarRevealerSystem.d.ts +1 -1
- package/src/engine/ecs/fow/FogOfWarSystem.d.ts +1 -6
- package/src/engine/ecs/fow/FogOfWarSystem.d.ts.map +1 -1
- package/src/engine/ecs/fow/serialization/FogOfWarRevealerSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/fow/serialization/FogOfWarRevealerSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.js +3 -0
- package/src/engine/ecs/gui/GUIElement.d.ts +115 -5
- package/src/engine/ecs/gui/GUIElementSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/gui/GUIElementSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/gui/GUIElementSystem.d.ts +59 -8
- package/src/engine/ecs/gui/GUIElementSystem.d.ts.map +1 -1
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.d.ts +42 -6
- package/src/engine/ecs/gui/menu/radial/RadialContextMenu.d.ts +23 -22
- package/src/engine/ecs/gui/parallax/GuiElementParallaxSystem.d.ts +1 -1
- package/src/engine/ecs/gui/position/ViewportPositionSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/gui/position/ViewportPositionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts +1 -1
- package/src/engine/ecs/gui/view/ViewEntity.d.ts +1 -2
- package/src/engine/ecs/gui/view/ViewEntity.d.ts.map +1 -1
- package/src/engine/ecs/guid/UUIDSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/guid/UUIDSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts +1 -1
- package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts.map +1 -1
- package/src/engine/ecs/name/NameSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/name/NameSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/parent/ChildEntities.d.ts +23 -3
- package/src/engine/ecs/parent/EntityNode.d.ts +157 -25
- package/src/engine/ecs/parent/ParentEntity.d.ts +31 -11
- package/src/engine/ecs/parent/ParentEntitySystem.d.ts +44 -11
- package/src/engine/ecs/renderable/RenderSystem.d.ts +65 -7
- package/src/engine/ecs/renderable/Renderable.d.ts +95 -25
- package/src/engine/ecs/speaker/VoiceSystem.d.ts +3 -3
- package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.d.ts +86 -21
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +3 -1
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +1 -1
- package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +1 -1
- package/src/engine/ecs/system/AbstractContextSystem.d.ts +1 -1
- package/src/engine/ecs/system_validate_class.d.ts +1 -1
- package/src/engine/ecs/system_validate_class.d.ts.map +1 -1
- package/src/engine/ecs/systems/AnimationSystem.d.ts +41 -6
- package/src/engine/ecs/systems/AnimationSystem.d.ts.map +1 -1
- package/src/engine/ecs/systems/ScriptSystem.d.ts +9 -5
- package/src/engine/ecs/systems/ScriptSystem.d.ts.map +1 -1
- package/src/engine/ecs/systems/TimerSystem.d.ts +1 -1
- package/src/engine/ecs/systems/TimerSystem.d.ts.map +1 -1
- package/src/engine/ecs/team/TeamSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/team/TeamSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/OffsetScaleTransform2D.d.ts +7 -6
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts +389 -17
- package/src/engine/ecs/terrain/ecs/TerrainSystem.d.ts +65 -8
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
- package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts +2 -2
- package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts +2 -2
- package/src/engine/ecs/tooltip/TooltipComponentSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/tooltip/TooltipComponentSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/tooltip/TooltipComponentSystem.d.ts +1 -1
- package/src/engine/ecs/transform/TransformSerializationAdapter.d.ts +0 -1
- package/src/engine/ecs/transform/TransformSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/transform-attachment/TransformAttachment.d.ts +116 -19
- package/src/engine/ecs/transform-attachment/TransformAttachmentSystem.d.ts +58 -6
- package/src/engine/graphics/GraphicsEngine.d.ts +224 -41
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +14 -3
- package/src/engine/graphics/camera/CameraShake.d.ts +6 -6
- package/src/engine/graphics/camera/CameraShake.d.ts.map +1 -1
- package/src/engine/graphics/camera/CameraShakeBehavior.d.ts +1 -2
- package/src/engine/graphics/camera/CameraShakeBehavior.d.ts.map +1 -1
- package/src/engine/graphics/camera/CameraShakeTraumaBehavior.d.ts +1 -2
- package/src/engine/graphics/camera/CameraShakeTraumaBehavior.d.ts.map +1 -1
- package/src/engine/graphics/camera/camera_compute_distance_to_fit_length.d.ts +8 -1
- package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts +8 -4
- package/src/engine/graphics/composit/CompositLayer.d.ts +1 -1
- package/src/engine/graphics/composit/CompositLayer.d.ts.map +1 -1
- package/src/engine/graphics/composit/CompositLayer.js +258 -255
- package/src/engine/graphics/composit/LayerCompositer.d.ts +12 -0
- package/src/engine/graphics/composit/LayerCompositer.d.ts.map +1 -1
- package/src/engine/graphics/composit/LayerCompositer.js +19 -10
- package/src/engine/graphics/ecs/animation/AnimationControllerSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/animation/AnimationControllerSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/AnimationControllerSystem.d.ts +1 -2
- package/src/engine/graphics/ecs/animation/AnimationControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationGraphSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraphSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraphSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/Camera.d.ts +113 -18
- package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts +74 -10
- package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.d.ts +90 -33
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts +34 -5
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.d.ts +0 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.d.ts +52 -15
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.d.ts +70 -24
- package/src/engine/graphics/ecs/highlight/Highlight.d.ts +61 -16
- package/src/engine/graphics/ecs/highlight/HighlightDefinition.d.ts +57 -19
- package/src/engine/graphics/ecs/highlight/HighlightSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/highlight/HighlightSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.d.ts +1 -2
- package/src/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.js +10 -4
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.d.ts +6 -0
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +21 -0
- package/src/engine/graphics/ecs/highlight/system/MeshHighlightSystem.d.ts +57 -8
- package/src/engine/graphics/ecs/highlight/system/MeshHighlightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/system/RenderableHighlightSystem.d.ts +62 -8
- package/src/engine/graphics/ecs/highlight/system/RenderableHighlightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts +68 -8
- package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/Light.d.ts +79 -19
- package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/LightSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/light/LightSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/LightSystem.d.ts +123 -11
- package/src/engine/graphics/ecs/light/LightType.d.ts +8 -6
- package/src/engine/graphics/ecs/mesh/Mesh.d.ts +176 -30
- package/src/engine/graphics/ecs/mesh/MeshEvents.d.ts +6 -12
- package/src/engine/graphics/ecs/mesh/MeshSystem.d.ts +99 -7
- package/src/engine/graphics/ecs/mesh/serialization/MeshSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/mesh/serialization/MeshSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/DrawMode.d.ts +8 -6
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +147 -32
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +37 -0
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGAnimationPlayback.d.ts +6 -5
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts +162 -25
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.d.ts +40 -12
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts +31 -11
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshEvents.d.ts +5 -12
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshHighlightSystem.d.ts +36 -7
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.d.ts +63 -8
- package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.d.ts +9 -4
- package/src/engine/graphics/ecs/path/PathDisplay.d.ts +21 -9
- package/src/engine/graphics/ecs/path/PathDisplayEvents.d.ts +6 -3
- package/src/engine/graphics/ecs/path/PathDisplaySpec.d.ts +28 -11
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts +55 -10
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/PathDisplayType.d.ts +8 -6
- package/src/engine/graphics/ecs/path/entity/EntityPathMarkerDefinition.d.ts +39 -8
- package/src/engine/graphics/ecs/path/entity/EntityPathStyle.d.ts +38 -12
- package/src/engine/graphics/ecs/path/highlight/PathDisplayHighlightSystem.d.ts +31 -7
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.js +5 -23
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathStyle.d.ts +24 -7
- package/src/engine/graphics/ecs/path/tube/BasicMaterialDefinition.d.ts +4 -3
- package/src/engine/graphics/ecs/path/tube/CapType.d.ts +7 -5
- package/src/engine/graphics/ecs/path/tube/MatcapMaterialDefinition.d.ts +11 -3
- package/src/engine/graphics/ecs/path/tube/PathNormalType.d.ts +6 -4
- package/src/engine/graphics/ecs/path/tube/StandardMaterialDefinition.d.ts +9 -4
- package/src/engine/graphics/ecs/path/tube/TubeMaterialType.d.ts +7 -6
- package/src/engine/graphics/ecs/path/tube/TubePathStyle.d.ts +114 -35
- package/src/engine/graphics/ecs/path/tube/TubePathStyle.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/build/estimatePathViaIterativeIntegral.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/build/estimatePathViaIterativeIntegral.js +6 -4
- package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +85 -6
- package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/water/WaterSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/ecs/water/WaterSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.js +9 -3
- package/src/engine/graphics/geometry/AttributeGroupSpec.d.ts +75 -25
- package/src/engine/graphics/geometry/AttributeSpec.d.ts +85 -12
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.d.ts +1 -2
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.d.ts +6 -4
- package/src/engine/graphics/material/manager/MaterialManager.d.ts +12 -0
- package/src/engine/graphics/material/manager/MaterialManager.d.ts.map +1 -1
- package/src/engine/graphics/material/manager/MaterialManager.js +78 -41
- package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.d.ts +67 -7
- package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.js +46 -9
- package/src/engine/graphics/particles/node-based/codegen/glsl/getTypeByteSize.d.ts +9 -9
- package/src/engine/graphics/particles/node-based/editor/ParticleSpecificationEditorView.d.ts +1 -2
- package/src/engine/graphics/particles/node-based/editor/ParticleSpecificationEditorView.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/FloatConstant.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/FloatConstant.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/ParticleDataTypes.d.ts +10 -9
- package/src/engine/graphics/particles/node-based/nodes/ParticleDataTypes.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/ReadFloatUniform.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/ReadFloatUniform.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/ReadVelocity.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/ReadVelocity.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/Vector3Constant.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/Vector3Constant.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/Vector3Merge.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/Vector3Merge.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/Vector3Split.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/Vector3Split.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/WriteVelocity.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/WriteVelocity.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/attribute/ReadVector3Attribute.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/attribute/ReadVector3Attribute.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/attribute/WriteVector3Attribute.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/attribute/WriteVector3Attribute.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/math/AddFloatNode.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/math/AddFloatNode.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Add.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Add.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Divide.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Divide.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Multiply.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Multiply.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Subtract.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/math/Vector3Subtract.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/nodes/noise/CurlNoiseNode.d.ts +0 -1
- package/src/engine/graphics/particles/node-based/nodes/noise/CurlNoiseNode.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/particle/ParticleAttributeSpecification.d.ts +18 -18
- package/src/engine/graphics/particles/particular/engine/ParticularEngine.d.ts +5 -0
- package/src/engine/graphics/particles/particular/engine/ParticularEngine.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/ParticularEngine.js +8 -0
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +252 -2
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts +2 -15
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts +5 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.d.ts +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts +5 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/shader/MaterialRecord.d.ts +7 -0
- package/src/engine/graphics/particles/particular/engine/shader/MaterialRecord.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/shader/MaterialRecord.js +8 -0
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.d.ts +10 -2
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.js +42 -10
- package/src/engine/graphics/particles/particular/engine/utils/volume/AttributeValue.d.ts +76 -16
- package/src/engine/graphics/particles/particular/engine/utils/volume/SamplingFunctionKind.d.ts +6 -4
- package/src/engine/graphics/render/buffer/FrameBuffer.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/FrameBuffer.js +5 -2
- package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.d.ts +104 -8
- package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js +40 -7
- package/src/engine/graphics/render/buffer/simple-fx/ao/SAOUpscaleShader.js +78 -37
- package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.d.ts +0 -3
- package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.js +10 -4
- package/src/engine/graphics/render/forward_plus/LightManager.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/LightManager.js +1235 -1232
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +1 -1
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.d.ts +32 -5
- package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +11 -10
- package/src/engine/graphics/render/forward_plus/plugin/MaterialTransformer.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/plugin/MaterialTransformer.js +4 -9
- package/src/engine/graphics/render/forward_plus/plugin/forwardPlusMaterialMarker.d.ts +16 -0
- package/src/engine/graphics/render/forward_plus/plugin/forwardPlusMaterialMarker.d.ts.map +1 -0
- package/src/engine/graphics/render/forward_plus/plugin/forwardPlusMaterialMarker.js +18 -0
- package/src/engine/graphics/render/forward_plus/plugin/isForwardPlusLightingSkipped.d.ts +16 -0
- package/src/engine/graphics/render/forward_plus/plugin/isForwardPlusLightingSkipped.d.ts.map +1 -0
- package/src/engine/graphics/render/forward_plus/plugin/isForwardPlusLightingSkipped.js +31 -0
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +1 -1
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts +1 -1
- package/src/engine/graphics/render/gizmo/Gizmo.d.ts +7 -3
- package/src/engine/graphics/render/gizmo/GizmoRenderingPlugin.d.ts +5 -5
- package/src/engine/graphics/render/gizmo/GizmoRenderingPlugin.d.ts.map +1 -1
- package/src/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.d.ts +72 -13
- package/src/engine/graphics/render/layers/RenderLayer.d.ts +78 -22
- package/src/engine/graphics/render/layers/RenderLayerManager.d.ts +72 -17
- package/src/engine/graphics/render/layers/RenderLayerState.d.ts +18 -3
- package/src/engine/graphics/render/view/CameraView.d.ts +3 -3
- package/src/engine/graphics/render/view/CameraViewManager.d.ts +2 -2
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.d.ts +143 -24
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts +3 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/serialization/LightProbeVolumeSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/sh3/lpv/serialization/LightProbeVolumeSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts +1 -2
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts +3 -3
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/cubemap/load_environment_map.d.ts +13 -8
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +1 -1
- package/src/engine/graphics/texture/sampler/serialization/Sampler2DSerializationAdapter.d.ts +0 -1
- package/src/engine/graphics/texture/sampler/serialization/Sampler2DSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts +1 -3
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts.map +1 -1
- package/src/engine/graphics/three/cloneObject3D.d.ts +7 -3
- package/src/engine/graphics/trail/tube/TubeX.d.ts.map +1 -1
- package/src/engine/graphics/trail/tube/TubeX.js +557 -555
- package/src/engine/graphics/trail/tube/TubeXPlugin.d.ts +0 -1
- package/src/engine/graphics/trail/tube/TubeXPlugin.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXMaterialSpec.d.ts +13 -3
- package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts +12 -4
- package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXPlugin.js +15 -8
- package/src/engine/graphics/util/promiseMaterialLoaded.d.ts +7 -3
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.d.ts +0 -1
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.d.ts.map +1 -1
- package/src/engine/grid/grid2transform/GridPosition2TransformSystem.d.ts +1 -1
- package/src/engine/grid/obstacle/GridObstacleSerializationAdapter.d.ts +0 -1
- package/src/engine/grid/obstacle/GridObstacleSerializationAdapter.d.ts.map +1 -1
- package/src/engine/grid/position/GridPositionSerializationAdapter.d.ts +0 -1
- package/src/engine/grid/position/GridPositionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/grid/position/GridPositionSystem.d.ts +1 -1
- package/src/engine/grid/transform2grid/Transform2GridPositionSystem.d.ts +1 -1
- package/src/engine/input/GAMEPAD_API_PROPOSAL.md +717 -0
- package/src/engine/input/analog/apply_radial_dead_zone.d.ts +23 -0
- package/src/engine/input/analog/apply_radial_dead_zone.d.ts.map +1 -0
- package/src/engine/input/analog/apply_radial_dead_zone.js +38 -0
- package/src/engine/input/devices/GamepadDevice.d.ts +140 -23
- package/src/engine/input/devices/GamepadDevice.d.ts.map +1 -1
- package/src/engine/input/devices/GamepadDevice.js +202 -16
- package/src/engine/input/devices/InputDeviceSwitch.d.ts +44 -11
- package/src/engine/input/devices/InputDeviceSwitch.d.ts.map +1 -1
- package/src/engine/input/devices/KeyCodes.d.ts +112 -1
- package/src/engine/input/devices/KeyboardDevice.d.ts +2 -3
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/PointerDevice.d.ts +96 -31
- package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
- package/src/engine/input/devices/events/KeyboardEvents.d.ts +5 -4
- package/src/engine/input/devices/events/MouseEvents.d.ts +18 -12
- package/src/engine/input/devices/events/TouchEvents.d.ts +12 -6
- package/src/engine/input/devices/gamepad/GamepadAxes.d.ts +5 -1
- package/src/engine/input/devices/gamepad/GamepadAxes.d.ts.map +1 -1
- package/src/engine/input/devices/gamepad/GamepadAxes.js +5 -1
- package/src/engine/input/devices/gamepad/GamepadHandle.d.ts +130 -26
- package/src/engine/input/devices/gamepad/GamepadHandle.d.ts.map +1 -1
- package/src/engine/input/devices/gamepad/GamepadHandle.js +60 -34
- package/src/engine/input/devices/gamepad/GamepadStandardMapping.d.ts +20 -0
- package/src/engine/input/devices/gamepad/GamepadStandardMapping.d.ts.map +1 -0
- package/src/engine/input/devices/gamepad/GamepadStandardMapping.js +20 -0
- package/src/engine/input/devices/gamepad/GamepadStick.d.ts +93 -0
- package/src/engine/input/devices/gamepad/GamepadStick.d.ts.map +1 -0
- package/src/engine/input/devices/gamepad/GamepadStick.js +165 -0
- package/src/engine/input/devices/gamepad/GamepadStickCalibration.d.ts +84 -0
- package/src/engine/input/devices/gamepad/GamepadStickCalibration.d.ts.map +1 -0
- package/src/engine/input/devices/gamepad/GamepadStickCalibration.js +119 -0
- package/src/engine/input/devices/gamepad/GamepadStickCalibrator.d.ts +92 -0
- package/src/engine/input/devices/gamepad/GamepadStickCalibrator.d.ts.map +1 -0
- package/src/engine/input/devices/gamepad/GamepadStickCalibrator.js +250 -0
- package/src/engine/input/devices/gamepad/gamepad_write_dpad_vector.d.ts +17 -0
- package/src/engine/input/devices/gamepad/gamepad_write_dpad_vector.d.ts.map +1 -0
- package/src/engine/input/devices/gamepad/gamepad_write_dpad_vector.js +30 -0
- package/src/engine/input/devices/touch/TouchDevice.d.ts +3 -3
- package/src/engine/input/ecs/components/Input.d.ts +49 -6
- package/src/engine/input/ecs/components/InputController.d.ts +33 -3
- package/src/engine/input/ecs/ism/InputBinding.d.ts +40 -4
- package/src/engine/input/ecs/systems/InputControllerSystem.d.ts +28 -6
- package/src/engine/input/ecs/systems/InputControllerSystem.d.ts.map +1 -1
- package/src/engine/input/ecs/systems/InputControllerSystem.js +9 -6
- package/src/engine/input/ecs/systems/InputSystem.d.ts +59 -6
- package/src/engine/intelligence/behavior/Behavior.d.ts +58 -16
- package/src/engine/intelligence/behavior/Behavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/BehaviorStatus.d.ts +10 -8
- package/src/engine/intelligence/behavior/SelectorBehavior.d.ts +0 -1
- package/src/engine/intelligence/behavior/SelectorBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts +0 -8
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts +0 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehaviorSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts +0 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehaviorSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +1 -1
- package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts +0 -1
- package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/OrbitingBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/ecs/OrbitingBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts +1 -3
- package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts +2 -4
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +1 -3
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehaviorSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts +1 -3
- package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/util/ConditionBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/util/ConditionBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts +1 -3
- package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts +4 -4
- package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/util/RotationBehavior.d.ts +1 -2
- package/src/engine/intelligence/behavior/util/RotationBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/AbstractBlackboard.d.ts +58 -15
- package/src/engine/intelligence/blackboard/AbstractBlackboard.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/Blackboard.d.ts +79 -11
- package/src/engine/intelligence/blackboard/Blackboard.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/BlackboardSerializationAdapter.d.ts +0 -1
- package/src/engine/intelligence/blackboard/BlackboardSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/BlackboardValue.d.ts +1 -0
- package/src/engine/intelligence/blackboard/BlackboardValue.d.ts.map +1 -1
- package/src/engine/intelligence/controller/graph/StateGraphSystem.d.ts +1 -3
- package/src/engine/intelligence/controller/graph/StateGraphSystem.d.ts.map +1 -1
- package/src/engine/interpolation/InterpolationSystem.d.ts +1 -5
- package/src/engine/interpolation/InterpolationSystem.d.ts.map +1 -1
- package/src/engine/interpolation/TransformPoseSerializationAdapter.d.ts +0 -1
- package/src/engine/interpolation/TransformPoseSerializationAdapter.d.ts.map +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDataTable.d.ts +140 -9
- package/src/engine/knowledge/database/StaticKnowledgeDataTableDescriptor.d.ts +26 -7
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts +2 -3
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
- package/src/engine/navigation/ecs/components/InterpolationType.d.ts +8 -4
- package/src/engine/navigation/ecs/components/Path.d.ts +170 -47
- package/src/engine/navigation/ecs/components/Path.d.ts.map +1 -1
- package/src/engine/navigation/ecs/components/Path.js +10 -4
- package/src/engine/navigation/ecs/components/PathEvents.d.ts +8 -6
- package/src/engine/navigation/ecs/components/PathSerializationAdapter.d.ts +0 -1
- package/src/engine/navigation/ecs/components/PathSerializationAdapter.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollower.d.ts +85 -45
- package/src/engine/navigation/ecs/path_following/PathFollowerEventType.d.ts +5 -3
- package/src/engine/navigation/ecs/path_following/PathFollowerFlags.d.ts +14 -20
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.d.ts +0 -1
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts +31 -6
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +1 -1
- package/src/engine/network/adapters/TransformReplicationAdapter.d.ts +0 -1
- package/src/engine/network/adapters/TransformReplicationAdapter.d.ts.map +1 -1
- package/src/engine/network/ecs/NetworkSystem.d.ts +1 -1
- package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts +0 -1
- package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts.map +1 -1
- package/src/engine/options/Option.d.ts +3 -3
- package/src/engine/options/OptionsView.d.ts +1 -2
- package/src/engine/options/OptionsView.d.ts.map +1 -1
- package/src/engine/physics/body/SolverBodyState.d.ts.map +1 -1
- package/src/engine/physics/body/SolverBodyState.js +10 -1
- package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
- package/src/engine/physics/constraint/solve_constraints.js +840 -830
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +3 -3
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +0 -1
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -1
- package/src/engine/physics/ecs/JointSerializationAdapter.d.ts +0 -1
- package/src/engine/physics/ecs/JointSerializationAdapter.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +14 -2
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +2246 -2172
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +0 -1
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +12 -8
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +8 -4
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -1
- package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -1
- package/src/engine/physics/integration/integrate_velocity.js +25 -2
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/capsule_contacts.js +622 -617
- package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/convex_convex_manifold.js +632 -568
- package/src/engine/physics/solver/solve_contacts.d.ts +6 -5
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
- package/src/engine/physics/solver/solve_contacts.js +1506 -1482
- package/src/engine/platform/EnginePlatform.d.ts +24 -14
- package/src/engine/platform/WebEnginePlatform.d.ts +20 -5
- package/src/engine/platform/WebEnginePlatform.d.ts.map +1 -1
- package/src/engine/plugin/EnginePlugin.d.ts +36 -3
- package/src/engine/plugin/EnginePlugin.d.ts.map +1 -1
- package/src/engine/plugin/EnginePluginManager.d.ts +85 -16
- package/src/engine/plugin/EnginePluginManager.d.ts.map +1 -1
- package/src/engine/plugin/PluginReferenceContext.d.ts +1 -1
- package/src/engine/reference/v2/Reference.d.ts +55 -17
- package/src/engine/reference/v2/Reference.d.ts.map +1 -1
- package/src/engine/save/GameStateLoader.d.ts +0 -1
- package/src/engine/save/GameStateLoader.d.ts.map +1 -1
- package/src/engine/save/Storage.d.ts +75 -15
- package/src/engine/save/storage/InMemoryStorage.d.ts +0 -1
- package/src/engine/save/storage/InMemoryStorage.d.ts.map +1 -1
- package/src/engine/save/storage/IndexedDBStorage.d.ts +0 -2
- package/src/engine/save/storage/IndexedDBStorage.d.ts.map +1 -1
- package/src/engine/scene/Scene.d.ts +65 -7
- package/src/engine/scene/SceneManager.d.ts +125 -25
- package/src/engine/simulation/Ticker.d.ts +1 -2
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/sound/SoundEngine.d.ts +46 -3
- package/src/engine/sound/ecs/SoundController.d.ts +0 -1
- package/src/engine/sound/ecs/SoundController.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundControllerSystem.d.ts +1 -2
- package/src/engine/sound/ecs/SoundControllerSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundListener.d.ts +0 -1
- package/src/engine/sound/ecs/SoundListener.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundListenerSystem.d.ts +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts +1 -1
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts +1 -2
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/simulation/core/AcousticMediumSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/simulation/core/AcousticMediumSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/simulation/definition/AcousticDirectivitySerializationAdapter.d.ts +0 -1
- package/src/engine/sound/simulation/definition/AcousticDirectivitySerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/simulation/definition/AcousticMaterialSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/simulation/definition/AcousticMaterialSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/simulation/ecs/AcousticBodySerializationAdapter.d.ts +0 -1
- package/src/engine/sound/simulation/ecs/AcousticBodySerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/simulation/ecs/AcousticProbeFieldSystem.d.ts +1 -1
- package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.d.ts +1 -1
- package/src/engine/sound/simulation/ecs/AcousticVolumeSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/simulation/ecs/AcousticVolumeSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/simulation/ecs/AcousticVolumeSystem.d.ts +1 -1
- package/src/engine/sound/simulation/probe/AcousticProbeFieldSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/simulation/probe/AcousticProbeFieldSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts +0 -1
- package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +1 -2
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/ParameterStore.d.ts +1 -2
- package/src/engine/sound/sopra/runtime/ParameterStore.d.ts.map +1 -1
- package/src/engine/ui/bindings/DomElementProcessorManager.d.ts +0 -3
- package/src/engine/ui/bindings/DomElementProcessorManager.d.ts.map +1 -1
- package/src/engine/ui/modal/ModalStack.d.ts +3 -3
- package/src/engine/ui/notification/AnimatedObjectEmitter.d.ts +2 -2
- package/src/engine/ui/notification/ViewEmitter.d.ts +2 -2
- package/src/generation/filtering/CellFilter.d.ts +1 -1
- package/src/generation/filtering/CellFilter.d.ts.map +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts +3 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts.map +1 -1
- package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.d.ts +3 -1
- package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformRotateRandom.d.ts +3 -1
- package/src/generation/markers/transform/MarkerNodeTransformRotateRandom.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformerRecordPropertyClosure.d.ts +3 -1
- package/src/generation/markers/transform/MarkerNodeTransformerRecordPropertyClosure.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.d.ts +3 -1
- package/src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.d.ts.map +1 -1
- package/src/generation/placement/action/util/CellMatcherWithinAABB.d.ts +1 -1
- package/src/generation/placement/action/util/CellMatcherWithinAABB.d.ts.map +1 -1
- package/src/misc/makeMatcapSelectionOption.d.ts +11 -13
- package/src/view/View.d.ts +313 -30
- package/src/view/asset/AssetLoaderStatusView.d.ts +1 -1
- package/src/view/asset/PreloaderView.d.ts +1 -1
- package/src/view/common/LabelView.d.ts +2 -1
- package/src/view/common/LabelView.d.ts.map +1 -1
- package/src/view/common/ListView.d.ts +2 -2
- package/src/view/common/ListView.d.ts.map +1 -1
- package/src/view/common/TabbedView.d.ts +1 -1
- package/src/view/common/VirtualListView.d.ts +3 -3
- package/src/view/common/VirtualListView.d.ts.map +1 -1
- package/src/view/common/dnd/Draggable.d.ts +2 -2
- package/src/view/common/dnd/DropTarget.d.ts +6 -6
- package/src/view/controller/GuiController.d.ts +1 -2
- package/src/view/controller/GuiController.d.ts.map +1 -1
- package/src/view/controller/controls/BooleanVector3Control.d.ts +1 -2
- package/src/view/controller/controls/BooleanVector3Control.d.ts.map +1 -1
- package/src/view/controller/controls/NativeListController.d.ts +1 -1
- package/src/view/controller/controls/Vector1Control.d.ts +1 -1
- package/src/view/currency/CompositeCurrencyLabelView.d.ts +1 -1
- package/src/view/currency/CurrencyDenominationLabelView.d.ts +1 -1
- package/src/view/elements/BottomLeftResizeHandleView.d.ts +1 -1
- package/src/view/elements/CanvasView.d.ts +1 -2
- package/src/view/elements/CanvasView.d.ts.map +1 -1
- package/src/view/elements/CheckboxView.d.ts +1 -1
- package/src/view/elements/CompassArrowView.d.ts +1 -2
- package/src/view/elements/CompassArrowView.d.ts.map +1 -1
- package/src/view/elements/ConfirmationDialogView.d.ts +1 -1
- package/src/view/elements/DropDownSelectionView.d.ts +1 -1
- package/src/view/elements/EmptyView.d.ts +1 -2
- package/src/view/elements/EmptyView.d.ts.map +1 -1
- package/src/view/elements/Group.d.ts +1 -2
- package/src/view/elements/Group.d.ts.map +1 -1
- package/src/view/elements/MeshPreview.d.ts +1 -1
- package/src/view/elements/SimpleWindow.d.ts +1 -1
- package/src/view/elements/button/ButtonView.d.ts +1 -1
- package/src/view/elements/image/ImageView.d.ts +1 -2
- package/src/view/elements/image/ImageView.d.ts.map +1 -1
- package/src/view/elements/image/SvgImageView.d.ts +1 -1
- package/src/view/elements/label/LabeledValueView.d.ts +1 -1
- package/src/view/elements/navigation/ViewStack.d.ts +1 -8
- package/src/view/elements/navigation/ViewStack.d.ts.map +1 -1
- package/src/view/elements/notify/ToastLogView.d.ts +1 -1
- package/src/view/elements/progress/RectangularPieProgressView.d.ts +1 -1
- package/src/view/elements/progress/SmoothProgressBar.d.ts +1 -1
- package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +1 -1
- package/src/view/elements/radial/RadialMenu.d.ts +1 -1
- package/src/view/elements/radial/RadialMenuElement.d.ts +1 -1
- package/src/view/elements/radial/RadialMenuElementDefinition.d.ts +125 -39
- package/src/view/elements/radial/RadialProgressView.d.ts +1 -1
- package/src/view/elements/radial/RadialText.d.ts +1 -1
- package/src/view/elements/tiles2d/Tile.d.ts +1 -1
- package/src/view/elements/tiles2d/TileGrid.d.ts +4 -5
- package/src/view/elements/tiles2d/TileGrid.d.ts.map +1 -1
- package/src/view/elements/video/VideoView.d.ts +2 -2
- package/src/view/elements/video/VideoView.d.ts.map +1 -1
- package/src/view/elements/windrose/WindRoseDiagram.d.ts +1 -1
- package/src/view/game/achievements/AchievementNotificationView.d.ts +1 -1
- package/src/view/math/FunctionGraphView.d.ts +1 -1
- package/src/view/minimap/Minimap.d.ts +1 -1
- package/src/view/minimap/dom/MinimapCameraView.d.ts +1 -1
- package/src/view/minimap/dom/MinimapMarkerView.d.ts +1 -1
- package/src/view/minimap/dom/MinimapTerrainView.d.ts +1 -1
- package/src/view/task/TaskProgressView.d.ts +1 -1
- package/src/view/tooltip/DomTooltipObserver.d.ts +2 -2
- package/src/view/tooltip/TooltipView.d.ts +1 -1
- package/src/view/tooltip/gml/parser/parseTooltipString.d.ts +1 -0
- package/src/view/tooltip/gml/parser/parseTooltipString.d.ts.map +1 -1
- package/src/view/tooltip/gml/parser/readReferenceToken.d.ts +1 -0
- package/src/view/tooltip/gml/parser/readReferenceToken.d.ts.map +1 -1
- package/src/view/tooltip/gml/parser/readReferenceValueToken.d.ts +2 -1
- package/src/view/tooltip/gml/parser/readReferenceValueToken.d.ts.map +1 -1
- package/src/view/tooltip/gml/parser/readStyleToken.d.ts +1 -0
- package/src/view/tooltip/gml/parser/readStyleToken.d.ts.map +1 -1
- package/editor/ecs/component/TypeSchema.d.ts +0 -38
- package/editor/tools/v2/BlenderCameraOrientationGizmo.d.ts +0 -50
|
@@ -1,617 +1,622 @@
|
|
|
1
|
-
import { line3_compute_segment_segment_closest_points } from "../../../core/geom/3d/line/line3_compute_segment_segment_closest_points.js";
|
|
2
|
-
import { line3_compute_segment_closest_point_t } from "../../../core/geom/3d/line/line3_compute_segment_closest_point_t.js";
|
|
3
|
-
import { line3_compute_segment_closest_point_to_aabb3_t } from "../../../core/geom/3d/line/line3_compute_segment_closest_point_to_aabb3_t.js";
|
|
4
|
-
import { v3_quaternion_apply } from "../../../core/geom/vec3/v3_quaternion_apply.js";
|
|
5
|
-
import { v3_quaternion_apply_inverse } from "../../../core/geom/vec3/v3_quaternion_apply_inverse.js";
|
|
6
|
-
import { sphere_box_contact } from "./sphere_box_contact.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Closed-form narrowphase helpers for the capsule family. A capsule is the
|
|
10
|
-
* Minkowski sum of a line segment and a sphere of radius `r`, so contact
|
|
11
|
-
* resolution reduces to:
|
|
12
|
-
* - capsule-sphere → point-on-segment distance, then sphere-style normal
|
|
13
|
-
* - capsule-capsule → segment-segment closest pair
|
|
14
|
-
* - capsule-box → segment-vs-OBB closest point (iterative)
|
|
15
|
-
*
|
|
16
|
-
* Output convention (matches the rest of the narrowphase family):
|
|
17
|
-
* out[0..2] : normal pointing from B toward A
|
|
18
|
-
* out[3] : penetration depth (positive)
|
|
19
|
-
* out[4..6] : world contact on A's surface
|
|
20
|
-
* out[7..9] : world contact on B's surface
|
|
21
|
-
*
|
|
22
|
-
* @author Alex Goldring
|
|
23
|
-
* @copyright Company Named Limited (c) 2026
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
const scratch_st = new Float64Array(2);
|
|
27
|
-
|
|
28
|
-
const scratch_seg = new Float64Array(6);
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Compute the two world endpoints of a capsule's central segment given its
|
|
32
|
-
* pose. The capsule is Y-aligned in body frame; the segment runs from
|
|
33
|
-
* `(0, -h/2, 0)` to `(0, +h/2, 0)`. Writes endpoints into `out` as
|
|
34
|
-
* `[ax, ay, az, bx, by, bz]`.
|
|
35
|
-
*
|
|
36
|
-
* @param {number[]|Float64Array} out length >= 6
|
|
37
|
-
* @param {number} cx capsule centre x
|
|
38
|
-
* @param {number} cy
|
|
39
|
-
* @param {number} cz
|
|
40
|
-
* @param {number} qx quaternion x
|
|
41
|
-
* @param {number} qy
|
|
42
|
-
* @param {number} qz
|
|
43
|
-
* @param {number} qw
|
|
44
|
-
* @param {number} half_height
|
|
45
|
-
*/
|
|
46
|
-
export function capsule_world_segment(out, cx, cy, cz, qx, qy, qz, qw, half_height) {
|
|
47
|
-
v3_quaternion_apply(out, 0, 0, -half_height, 0, qx, qy, qz, qw);
|
|
48
|
-
v3_quaternion_apply(out, 3, 0, half_height, 0, qx, qy, qz, qw);
|
|
49
|
-
out[0] += cx; out[1] += cy; out[2] += cz;
|
|
50
|
-
out[3] += cx; out[4] += cy; out[5] += cz;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// --- capsule vs sphere ------------------------------------------------------
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Capsule (A) vs sphere (B) contact, closed-form via point-segment distance.
|
|
57
|
-
*
|
|
58
|
-
* @param {number[]|Float64Array} out length >= 10
|
|
59
|
-
* @param {number} a_cx capsule centre x
|
|
60
|
-
* @param {number} a_cy
|
|
61
|
-
* @param {number} a_cz
|
|
62
|
-
* @param {number} a_qx capsule rotation
|
|
63
|
-
* @param {number} a_qy
|
|
64
|
-
* @param {number} a_qz
|
|
65
|
-
* @param {number} a_qw
|
|
66
|
-
* @param {number} a_radius
|
|
67
|
-
* @param {number} a_half_h capsule half-height (not including caps)
|
|
68
|
-
* @param {number} b_cx sphere centre x
|
|
69
|
-
* @param {number} b_cy
|
|
70
|
-
* @param {number} b_cz
|
|
71
|
-
* @param {number} b_radius
|
|
72
|
-
* @returns {boolean} true on overlap
|
|
73
|
-
*/
|
|
74
|
-
export function capsule_sphere_contact(
|
|
75
|
-
out,
|
|
76
|
-
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
77
|
-
b_cx, b_cy, b_cz, b_radius
|
|
78
|
-
) {
|
|
79
|
-
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
80
|
-
const sax = scratch_seg[0], say = scratch_seg[1], saz = scratch_seg[2];
|
|
81
|
-
const sbx = scratch_seg[3], sby = scratch_seg[4], sbz = scratch_seg[5];
|
|
82
|
-
|
|
83
|
-
const t = line3_compute_segment_closest_point_t(sax, say, saz, sbx, sby, sbz, b_cx, b_cy, b_cz);
|
|
84
|
-
|
|
85
|
-
const px = sax + (sbx - sax) * t;
|
|
86
|
-
const py = say + (sby - say) * t;
|
|
87
|
-
const pz = saz + (sbz - saz) * t;
|
|
88
|
-
|
|
89
|
-
const dx = px - b_cx;
|
|
90
|
-
const dy = py - b_cy;
|
|
91
|
-
const dz = pz - b_cz;
|
|
92
|
-
const dist_sqr = dx * dx + dy * dy + dz * dz;
|
|
93
|
-
const sum = a_radius + b_radius;
|
|
94
|
-
if (dist_sqr >= sum * sum) return false;
|
|
95
|
-
|
|
96
|
-
const dist = Math.sqrt(dist_sqr);
|
|
97
|
-
let nx, ny, nz;
|
|
98
|
-
if (dist > 0) {
|
|
99
|
-
const inv = 1 / dist;
|
|
100
|
-
nx = dx * inv; ny = dy * inv; nz = dz * inv;
|
|
101
|
-
} else {
|
|
102
|
-
// Sphere centre exactly on the capsule segment — pick a deterministic tie-break.
|
|
103
|
-
nx = 1; ny = 0; nz = 0;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
out[0] = nx; out[1] = ny; out[2] = nz; // normal from B to A
|
|
107
|
-
out[3] = sum - dist;
|
|
108
|
-
// World contact on A (capsule): segment point pushed back by capsule radius along -normal
|
|
109
|
-
out[4] = px - nx * a_radius;
|
|
110
|
-
out[5] = py - ny * a_radius;
|
|
111
|
-
out[6] = pz - nz * a_radius;
|
|
112
|
-
// World contact on B (sphere): sphere centre pushed along +normal by sphere radius
|
|
113
|
-
out[7] = b_cx + nx * b_radius;
|
|
114
|
-
out[8] = b_cy + ny * b_radius;
|
|
115
|
-
out[9] = b_cz + nz * b_radius;
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// --- capsule vs capsule -----------------------------------------------------
|
|
120
|
-
|
|
121
|
-
const scratch_seg_b = new Float64Array(6);
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Two capsules (A and B). Reduces to segment-segment closest pair + radius.
|
|
125
|
-
*
|
|
126
|
-
* @param {number[]|Float64Array} out length >= 10
|
|
127
|
-
* @returns {boolean} true on overlap
|
|
128
|
-
*/
|
|
129
|
-
export function capsule_capsule_contact(
|
|
130
|
-
out,
|
|
131
|
-
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
132
|
-
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_radius, b_half_h
|
|
133
|
-
) {
|
|
134
|
-
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
135
|
-
capsule_world_segment(scratch_seg_b, b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_half_h);
|
|
136
|
-
|
|
137
|
-
const a0x = scratch_seg[0], a0y = scratch_seg[1], a0z = scratch_seg[2];
|
|
138
|
-
const a1x = scratch_seg[3], a1y = scratch_seg[4], a1z = scratch_seg[5];
|
|
139
|
-
const b0x = scratch_seg_b[0], b0y = scratch_seg_b[1], b0z = scratch_seg_b[2];
|
|
140
|
-
const b1x = scratch_seg_b[3], b1y = scratch_seg_b[4], b1z = scratch_seg_b[5];
|
|
141
|
-
|
|
142
|
-
line3_compute_segment_segment_closest_points(
|
|
143
|
-
scratch_st,
|
|
144
|
-
a0x, a0y, a0z, a1x, a1y, a1z,
|
|
145
|
-
b0x, b0y, b0z, b1x, b1y, b1z
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
const s = scratch_st[0];
|
|
149
|
-
const t = scratch_st[1];
|
|
150
|
-
|
|
151
|
-
const pax = a0x + (a1x - a0x) * s;
|
|
152
|
-
const pay = a0y + (a1y - a0y) * s;
|
|
153
|
-
const paz = a0z + (a1z - a0z) * s;
|
|
154
|
-
const pbx = b0x + (b1x - b0x) * t;
|
|
155
|
-
const pby = b0y + (b1y - b0y) * t;
|
|
156
|
-
const pbz = b0z + (b1z - b0z) * t;
|
|
157
|
-
|
|
158
|
-
const dx = pax - pbx;
|
|
159
|
-
const dy = pay - pby;
|
|
160
|
-
const dz = paz - pbz;
|
|
161
|
-
const dist_sqr = dx * dx + dy * dy + dz * dz;
|
|
162
|
-
const sum = a_radius + b_radius;
|
|
163
|
-
if (dist_sqr >= sum * sum) return false;
|
|
164
|
-
|
|
165
|
-
const dist = Math.sqrt(dist_sqr);
|
|
166
|
-
let nx, ny, nz;
|
|
167
|
-
if (dist > 0) {
|
|
168
|
-
const inv = 1 / dist;
|
|
169
|
-
nx = dx * inv; ny = dy * inv; nz = dz * inv;
|
|
170
|
-
} else {
|
|
171
|
-
// Segments touch — fall back to the world-frame direction from B's
|
|
172
|
-
// segment centre toward A's segment centre as a tie-break.
|
|
173
|
-
const acx = (a0x + a1x) * 0.5;
|
|
174
|
-
const acy = (a0y + a1y) * 0.5;
|
|
175
|
-
const acz = (a0z + a1z) * 0.5;
|
|
176
|
-
const bcx = (b0x + b1x) * 0.5;
|
|
177
|
-
const bcy = (b0y + b1y) * 0.5;
|
|
178
|
-
const bcz = (b0z + b1z) * 0.5;
|
|
179
|
-
const ddx = acx - bcx, ddy = acy - bcy, ddz = acz - bcz;
|
|
180
|
-
const dd_sqr = ddx * ddx + ddy * ddy + ddz * ddz;
|
|
181
|
-
if (dd_sqr > 0) {
|
|
182
|
-
const inv2 = 1 / Math.sqrt(dd_sqr);
|
|
183
|
-
nx = ddx * inv2; ny = ddy * inv2; nz = ddz * inv2;
|
|
184
|
-
} else {
|
|
185
|
-
nx = 1; ny = 0; nz = 0;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
out[0] = nx; out[1] = ny; out[2] = nz;
|
|
190
|
-
out[3] = sum - dist;
|
|
191
|
-
out[4] = pax - nx * a_radius;
|
|
192
|
-
out[5] = pay - ny * a_radius;
|
|
193
|
-
out[6] = paz - nz * a_radius;
|
|
194
|
-
out[7] = pbx + nx * b_radius;
|
|
195
|
-
out[8] = pby + ny * b_radius;
|
|
196
|
-
out[9] = pbz + nz * b_radius;
|
|
197
|
-
return true;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Output stride per contact in {@link capsule_capsule_multi_contacts} —
|
|
202
|
-
* matches {@link CAPSULE_BOX_CONTACT_STRIDE}:
|
|
203
|
-
* 0..2 : world contact on capsule A side
|
|
204
|
-
* 3..5 : world contact on capsule B side
|
|
205
|
-
* 6..8 : normal from B toward A
|
|
206
|
-
* 9 : depth (positive = penetration)
|
|
207
|
-
* @type {number}
|
|
208
|
-
*/
|
|
209
|
-
export const CAPSULE_CAPSULE_CONTACT_STRIDE = 10;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Maximum contacts {@link capsule_capsule_multi_contacts} can emit (the two
|
|
213
|
-
* ends of the parallel-overlap interval).
|
|
214
|
-
* @type {number}
|
|
215
|
-
*/
|
|
216
|
-
export const CAPSULE_CAPSULE_MAX_CONTACTS = 2;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Squared-sine threshold for treating two capsule axes as parallel: below
|
|
220
|
-
* ~2.5 degrees the single closest-point contact is ambiguous along the
|
|
221
|
-
* overlap interval (the solver sees a point contact with a bogus lever arm
|
|
222
|
-
* and stacked capsules wobble), so the manifold switches to two contacts at
|
|
223
|
-
* the interval ends.
|
|
224
|
-
* @type {number}
|
|
225
|
-
*/
|
|
226
|
-
const CAPSULE_PARALLEL_SIN_SQR = 0.002;
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Capsule-vs-capsule with a parallel-aware multi-point manifold: NEAR-PARALLEL
|
|
230
|
-
* overlapping capsules emit one contact at each end of their axial overlap
|
|
231
|
-
* interval (the two-point support a resting capsule physically has); every
|
|
232
|
-
* other configuration emits the single closest-point contact of
|
|
233
|
-
* {@link capsule_capsule_contact}.
|
|
234
|
-
*
|
|
235
|
-
* @param {number[]|Float64Array} out length >= 2 * CAPSULE_CAPSULE_CONTACT_STRIDE
|
|
236
|
-
* @returns {number} number of contacts written (0 = no overlap)
|
|
237
|
-
*/
|
|
238
|
-
export function capsule_capsule_multi_contacts(
|
|
239
|
-
out,
|
|
240
|
-
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
241
|
-
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_radius, b_half_h
|
|
242
|
-
) {
|
|
243
|
-
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
244
|
-
capsule_world_segment(scratch_seg_b, b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_half_h);
|
|
245
|
-
|
|
246
|
-
const a0x = scratch_seg[0], a0y = scratch_seg[1], a0z = scratch_seg[2];
|
|
247
|
-
const a1x = scratch_seg[3], a1y = scratch_seg[4], a1z = scratch_seg[5];
|
|
248
|
-
const b0x = scratch_seg_b[0], b0y = scratch_seg_b[1], b0z = scratch_seg_b[2];
|
|
249
|
-
const b1x = scratch_seg_b[3], b1y = scratch_seg_b[4], b1z = scratch_seg_b[5];
|
|
250
|
-
|
|
251
|
-
const d1x = a1x - a0x, d1y = a1y - a0y, d1z = a1z - a0z;
|
|
252
|
-
const d2x = b1x - b0x, d2y = b1y - b0y, d2z = b1z - b0z;
|
|
253
|
-
const len1_sqr = d1x * d1x + d1y * d1y + d1z * d1z;
|
|
254
|
-
const len2_sqr = d2x * d2x + d2y * d2y + d2z * d2z;
|
|
255
|
-
|
|
256
|
-
const cx = d1y * d2z - d1z * d2y;
|
|
257
|
-
const cy = d1z * d2x - d1x * d2z;
|
|
258
|
-
const cz = d1x * d2y - d1y * d2x;
|
|
259
|
-
const cross_sqr = cx * cx + cy * cy + cz * cz;
|
|
260
|
-
|
|
261
|
-
const sum = a_radius + b_radius;
|
|
262
|
-
|
|
263
|
-
// Near-parallel with real segments: try the two-end manifold.
|
|
264
|
-
if (len1_sqr > 0 && len2_sqr > 0
|
|
265
|
-
&& cross_sqr < CAPSULE_PARALLEL_SIN_SQR * len1_sqr * len2_sqr) {
|
|
266
|
-
|
|
267
|
-
const inv_len1 = 1 / Math.sqrt(len1_sqr);
|
|
268
|
-
const ux = d1x * inv_len1, uy = d1y * inv_len1, uz = d1z * inv_len1;
|
|
269
|
-
|
|
270
|
-
// B's endpoints parameterised along A's axis (origin a0).
|
|
271
|
-
const t0 = (b0x - a0x) * ux + (b0y - a0y) * uy + (b0z - a0z) * uz;
|
|
272
|
-
const t1 = (b1x - a0x) * ux + (b1y - a0y) * uy + (b1z - a0z) * uz;
|
|
273
|
-
const len1 = Math.sqrt(len1_sqr);
|
|
274
|
-
const lo = Math.max(0, Math.min(t0, t1));
|
|
275
|
-
const hi = Math.min(len1, Math.max(t0, t1));
|
|
276
|
-
|
|
277
|
-
if (hi > lo) {
|
|
278
|
-
// Direction along B for projecting A-axis points onto B.
|
|
279
|
-
const inv_len2_sqr = 1 / len2_sqr;
|
|
280
|
-
let n_written = 0;
|
|
281
|
-
for (let e = 0; e < 2; e++) {
|
|
282
|
-
const sA = e === 0 ? lo : hi;
|
|
283
|
-
const pax = a0x + ux * sA;
|
|
284
|
-
const pay = a0y + uy * sA;
|
|
285
|
-
const paz = a0z + uz * sA;
|
|
286
|
-
// Closest point on segment B to pa.
|
|
287
|
-
let tB = ((pax - b0x) * d2x + (pay - b0y) * d2y + (paz - b0z) * d2z) * inv_len2_sqr;
|
|
288
|
-
tB = tB < 0 ? 0 : (tB > 1 ? 1 : tB);
|
|
289
|
-
const pbx = b0x + d2x * tB;
|
|
290
|
-
const pby = b0y + d2y * tB;
|
|
291
|
-
const pbz = b0z + d2z * tB;
|
|
292
|
-
|
|
293
|
-
const dx = pax - pbx, dy = pay - pby, dz = paz - pbz;
|
|
294
|
-
const dist_sqr = dx * dx + dy * dy + dz * dz;
|
|
295
|
-
if (dist_sqr >= sum * sum) continue;
|
|
296
|
-
const dist = Math.sqrt(dist_sqr);
|
|
297
|
-
|
|
298
|
-
let nx, ny, nz;
|
|
299
|
-
if (dist > 0) {
|
|
300
|
-
const inv = 1 / dist;
|
|
301
|
-
nx = dx * inv; ny = dy * inv; nz = dz * inv;
|
|
302
|
-
} else {
|
|
303
|
-
// Axes coincide at this point - centre tie-break.
|
|
304
|
-
const ddx = a_cx - b_cx, ddy = a_cy - b_cy, ddz = a_cz - b_cz;
|
|
305
|
-
const dd = ddx * ddx + ddy * ddy + ddz * ddz;
|
|
306
|
-
if (dd > 0) {
|
|
307
|
-
const inv2 = 1 / Math.sqrt(dd);
|
|
308
|
-
nx = ddx * inv2; ny = ddy * inv2; nz = ddz * inv2;
|
|
309
|
-
} else {
|
|
310
|
-
nx = 1; ny = 0; nz = 0;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
const off = n_written * CAPSULE_CAPSULE_CONTACT_STRIDE;
|
|
315
|
-
out[off] = pax - nx * a_radius;
|
|
316
|
-
out[off + 1] = pay - ny * a_radius;
|
|
317
|
-
out[off + 2] = paz - nz * a_radius;
|
|
318
|
-
out[off + 3] = pbx + nx * b_radius;
|
|
319
|
-
out[off + 4] = pby + ny * b_radius;
|
|
320
|
-
out[off + 5] = pbz + nz * b_radius;
|
|
321
|
-
out[off + 6] = nx;
|
|
322
|
-
out[off + 7] = ny;
|
|
323
|
-
out[off + 8] = nz;
|
|
324
|
-
out[off + 9] = sum - dist;
|
|
325
|
-
n_written++;
|
|
326
|
-
}
|
|
327
|
-
if (n_written > 0) return n_written;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
out[
|
|
347
|
-
out[
|
|
348
|
-
out[
|
|
349
|
-
out[
|
|
350
|
-
out[
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
)
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
let
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
//
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
//
|
|
454
|
-
v3_quaternion_apply(out,
|
|
455
|
-
out[
|
|
456
|
-
out[
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
out[
|
|
462
|
-
out[
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
*
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
*
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
* @param {
|
|
533
|
-
* @param {number}
|
|
534
|
-
* @param {number}
|
|
535
|
-
* @param {number}
|
|
536
|
-
* @param {number}
|
|
537
|
-
* @param {number}
|
|
538
|
-
* @param {number}
|
|
539
|
-
* @param {number}
|
|
540
|
-
* @param {number}
|
|
541
|
-
* @param {number}
|
|
542
|
-
* @param {number}
|
|
543
|
-
* @param {number}
|
|
544
|
-
* @param {number}
|
|
545
|
-
* @param {number}
|
|
546
|
-
* @param {number}
|
|
547
|
-
* @
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
count
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
1
|
+
import { line3_compute_segment_segment_closest_points } from "../../../core/geom/3d/line/line3_compute_segment_segment_closest_points.js";
|
|
2
|
+
import { line3_compute_segment_closest_point_t } from "../../../core/geom/3d/line/line3_compute_segment_closest_point_t.js";
|
|
3
|
+
import { line3_compute_segment_closest_point_to_aabb3_t } from "../../../core/geom/3d/line/line3_compute_segment_closest_point_to_aabb3_t.js";
|
|
4
|
+
import { v3_quaternion_apply } from "../../../core/geom/vec3/v3_quaternion_apply.js";
|
|
5
|
+
import { v3_quaternion_apply_inverse } from "../../../core/geom/vec3/v3_quaternion_apply_inverse.js";
|
|
6
|
+
import { sphere_box_contact } from "./sphere_box_contact.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Closed-form narrowphase helpers for the capsule family. A capsule is the
|
|
10
|
+
* Minkowski sum of a line segment and a sphere of radius `r`, so contact
|
|
11
|
+
* resolution reduces to:
|
|
12
|
+
* - capsule-sphere → point-on-segment distance, then sphere-style normal
|
|
13
|
+
* - capsule-capsule → segment-segment closest pair
|
|
14
|
+
* - capsule-box → segment-vs-OBB closest point (iterative)
|
|
15
|
+
*
|
|
16
|
+
* Output convention (matches the rest of the narrowphase family):
|
|
17
|
+
* out[0..2] : normal pointing from B toward A
|
|
18
|
+
* out[3] : penetration depth (positive)
|
|
19
|
+
* out[4..6] : world contact on A's surface
|
|
20
|
+
* out[7..9] : world contact on B's surface
|
|
21
|
+
*
|
|
22
|
+
* @author Alex Goldring
|
|
23
|
+
* @copyright Company Named Limited (c) 2026
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const scratch_st = new Float64Array(2);
|
|
27
|
+
|
|
28
|
+
const scratch_seg = new Float64Array(6);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Compute the two world endpoints of a capsule's central segment given its
|
|
32
|
+
* pose. The capsule is Y-aligned in body frame; the segment runs from
|
|
33
|
+
* `(0, -h/2, 0)` to `(0, +h/2, 0)`. Writes endpoints into `out` as
|
|
34
|
+
* `[ax, ay, az, bx, by, bz]`.
|
|
35
|
+
*
|
|
36
|
+
* @param {number[]|Float64Array} out length >= 6
|
|
37
|
+
* @param {number} cx capsule centre x
|
|
38
|
+
* @param {number} cy
|
|
39
|
+
* @param {number} cz
|
|
40
|
+
* @param {number} qx quaternion x
|
|
41
|
+
* @param {number} qy
|
|
42
|
+
* @param {number} qz
|
|
43
|
+
* @param {number} qw
|
|
44
|
+
* @param {number} half_height
|
|
45
|
+
*/
|
|
46
|
+
export function capsule_world_segment(out, cx, cy, cz, qx, qy, qz, qw, half_height) {
|
|
47
|
+
v3_quaternion_apply(out, 0, 0, -half_height, 0, qx, qy, qz, qw);
|
|
48
|
+
v3_quaternion_apply(out, 3, 0, half_height, 0, qx, qy, qz, qw);
|
|
49
|
+
out[0] += cx; out[1] += cy; out[2] += cz;
|
|
50
|
+
out[3] += cx; out[4] += cy; out[5] += cz;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// --- capsule vs sphere ------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Capsule (A) vs sphere (B) contact, closed-form via point-segment distance.
|
|
57
|
+
*
|
|
58
|
+
* @param {number[]|Float64Array} out length >= 10
|
|
59
|
+
* @param {number} a_cx capsule centre x
|
|
60
|
+
* @param {number} a_cy
|
|
61
|
+
* @param {number} a_cz
|
|
62
|
+
* @param {number} a_qx capsule rotation
|
|
63
|
+
* @param {number} a_qy
|
|
64
|
+
* @param {number} a_qz
|
|
65
|
+
* @param {number} a_qw
|
|
66
|
+
* @param {number} a_radius
|
|
67
|
+
* @param {number} a_half_h capsule half-height (not including caps)
|
|
68
|
+
* @param {number} b_cx sphere centre x
|
|
69
|
+
* @param {number} b_cy
|
|
70
|
+
* @param {number} b_cz
|
|
71
|
+
* @param {number} b_radius
|
|
72
|
+
* @returns {boolean} true on overlap
|
|
73
|
+
*/
|
|
74
|
+
export function capsule_sphere_contact(
|
|
75
|
+
out,
|
|
76
|
+
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
77
|
+
b_cx, b_cy, b_cz, b_radius
|
|
78
|
+
) {
|
|
79
|
+
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
80
|
+
const sax = scratch_seg[0], say = scratch_seg[1], saz = scratch_seg[2];
|
|
81
|
+
const sbx = scratch_seg[3], sby = scratch_seg[4], sbz = scratch_seg[5];
|
|
82
|
+
|
|
83
|
+
const t = line3_compute_segment_closest_point_t(sax, say, saz, sbx, sby, sbz, b_cx, b_cy, b_cz);
|
|
84
|
+
|
|
85
|
+
const px = sax + (sbx - sax) * t;
|
|
86
|
+
const py = say + (sby - say) * t;
|
|
87
|
+
const pz = saz + (sbz - saz) * t;
|
|
88
|
+
|
|
89
|
+
const dx = px - b_cx;
|
|
90
|
+
const dy = py - b_cy;
|
|
91
|
+
const dz = pz - b_cz;
|
|
92
|
+
const dist_sqr = dx * dx + dy * dy + dz * dz;
|
|
93
|
+
const sum = a_radius + b_radius;
|
|
94
|
+
if (dist_sqr >= sum * sum) return false;
|
|
95
|
+
|
|
96
|
+
const dist = Math.sqrt(dist_sqr);
|
|
97
|
+
let nx, ny, nz;
|
|
98
|
+
if (dist > 0) {
|
|
99
|
+
const inv = 1 / dist;
|
|
100
|
+
nx = dx * inv; ny = dy * inv; nz = dz * inv;
|
|
101
|
+
} else {
|
|
102
|
+
// Sphere centre exactly on the capsule segment — pick a deterministic tie-break.
|
|
103
|
+
nx = 1; ny = 0; nz = 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
out[0] = nx; out[1] = ny; out[2] = nz; // normal from B to A
|
|
107
|
+
out[3] = sum - dist;
|
|
108
|
+
// World contact on A (capsule): segment point pushed back by capsule radius along -normal
|
|
109
|
+
out[4] = px - nx * a_radius;
|
|
110
|
+
out[5] = py - ny * a_radius;
|
|
111
|
+
out[6] = pz - nz * a_radius;
|
|
112
|
+
// World contact on B (sphere): sphere centre pushed along +normal by sphere radius
|
|
113
|
+
out[7] = b_cx + nx * b_radius;
|
|
114
|
+
out[8] = b_cy + ny * b_radius;
|
|
115
|
+
out[9] = b_cz + nz * b_radius;
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// --- capsule vs capsule -----------------------------------------------------
|
|
120
|
+
|
|
121
|
+
const scratch_seg_b = new Float64Array(6);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Two capsules (A and B). Reduces to segment-segment closest pair + radius.
|
|
125
|
+
*
|
|
126
|
+
* @param {number[]|Float64Array} out length >= 10
|
|
127
|
+
* @returns {boolean} true on overlap
|
|
128
|
+
*/
|
|
129
|
+
export function capsule_capsule_contact(
|
|
130
|
+
out,
|
|
131
|
+
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
132
|
+
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_radius, b_half_h
|
|
133
|
+
) {
|
|
134
|
+
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
135
|
+
capsule_world_segment(scratch_seg_b, b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_half_h);
|
|
136
|
+
|
|
137
|
+
const a0x = scratch_seg[0], a0y = scratch_seg[1], a0z = scratch_seg[2];
|
|
138
|
+
const a1x = scratch_seg[3], a1y = scratch_seg[4], a1z = scratch_seg[5];
|
|
139
|
+
const b0x = scratch_seg_b[0], b0y = scratch_seg_b[1], b0z = scratch_seg_b[2];
|
|
140
|
+
const b1x = scratch_seg_b[3], b1y = scratch_seg_b[4], b1z = scratch_seg_b[5];
|
|
141
|
+
|
|
142
|
+
line3_compute_segment_segment_closest_points(
|
|
143
|
+
scratch_st,
|
|
144
|
+
a0x, a0y, a0z, a1x, a1y, a1z,
|
|
145
|
+
b0x, b0y, b0z, b1x, b1y, b1z
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const s = scratch_st[0];
|
|
149
|
+
const t = scratch_st[1];
|
|
150
|
+
|
|
151
|
+
const pax = a0x + (a1x - a0x) * s;
|
|
152
|
+
const pay = a0y + (a1y - a0y) * s;
|
|
153
|
+
const paz = a0z + (a1z - a0z) * s;
|
|
154
|
+
const pbx = b0x + (b1x - b0x) * t;
|
|
155
|
+
const pby = b0y + (b1y - b0y) * t;
|
|
156
|
+
const pbz = b0z + (b1z - b0z) * t;
|
|
157
|
+
|
|
158
|
+
const dx = pax - pbx;
|
|
159
|
+
const dy = pay - pby;
|
|
160
|
+
const dz = paz - pbz;
|
|
161
|
+
const dist_sqr = dx * dx + dy * dy + dz * dz;
|
|
162
|
+
const sum = a_radius + b_radius;
|
|
163
|
+
if (dist_sqr >= sum * sum) return false;
|
|
164
|
+
|
|
165
|
+
const dist = Math.sqrt(dist_sqr);
|
|
166
|
+
let nx, ny, nz;
|
|
167
|
+
if (dist > 0) {
|
|
168
|
+
const inv = 1 / dist;
|
|
169
|
+
nx = dx * inv; ny = dy * inv; nz = dz * inv;
|
|
170
|
+
} else {
|
|
171
|
+
// Segments touch — fall back to the world-frame direction from B's
|
|
172
|
+
// segment centre toward A's segment centre as a tie-break.
|
|
173
|
+
const acx = (a0x + a1x) * 0.5;
|
|
174
|
+
const acy = (a0y + a1y) * 0.5;
|
|
175
|
+
const acz = (a0z + a1z) * 0.5;
|
|
176
|
+
const bcx = (b0x + b1x) * 0.5;
|
|
177
|
+
const bcy = (b0y + b1y) * 0.5;
|
|
178
|
+
const bcz = (b0z + b1z) * 0.5;
|
|
179
|
+
const ddx = acx - bcx, ddy = acy - bcy, ddz = acz - bcz;
|
|
180
|
+
const dd_sqr = ddx * ddx + ddy * ddy + ddz * ddz;
|
|
181
|
+
if (dd_sqr > 0) {
|
|
182
|
+
const inv2 = 1 / Math.sqrt(dd_sqr);
|
|
183
|
+
nx = ddx * inv2; ny = ddy * inv2; nz = ddz * inv2;
|
|
184
|
+
} else {
|
|
185
|
+
nx = 1; ny = 0; nz = 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
out[0] = nx; out[1] = ny; out[2] = nz;
|
|
190
|
+
out[3] = sum - dist;
|
|
191
|
+
out[4] = pax - nx * a_radius;
|
|
192
|
+
out[5] = pay - ny * a_radius;
|
|
193
|
+
out[6] = paz - nz * a_radius;
|
|
194
|
+
out[7] = pbx + nx * b_radius;
|
|
195
|
+
out[8] = pby + ny * b_radius;
|
|
196
|
+
out[9] = pbz + nz * b_radius;
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Output stride per contact in {@link capsule_capsule_multi_contacts} —
|
|
202
|
+
* matches {@link CAPSULE_BOX_CONTACT_STRIDE}:
|
|
203
|
+
* 0..2 : world contact on capsule A side
|
|
204
|
+
* 3..5 : world contact on capsule B side
|
|
205
|
+
* 6..8 : normal from B toward A
|
|
206
|
+
* 9 : depth (positive = penetration)
|
|
207
|
+
* @type {number}
|
|
208
|
+
*/
|
|
209
|
+
export const CAPSULE_CAPSULE_CONTACT_STRIDE = 10;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Maximum contacts {@link capsule_capsule_multi_contacts} can emit (the two
|
|
213
|
+
* ends of the parallel-overlap interval).
|
|
214
|
+
* @type {number}
|
|
215
|
+
*/
|
|
216
|
+
export const CAPSULE_CAPSULE_MAX_CONTACTS = 2;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Squared-sine threshold for treating two capsule axes as parallel: below
|
|
220
|
+
* ~2.5 degrees the single closest-point contact is ambiguous along the
|
|
221
|
+
* overlap interval (the solver sees a point contact with a bogus lever arm
|
|
222
|
+
* and stacked capsules wobble), so the manifold switches to two contacts at
|
|
223
|
+
* the interval ends.
|
|
224
|
+
* @type {number}
|
|
225
|
+
*/
|
|
226
|
+
const CAPSULE_PARALLEL_SIN_SQR = 0.002;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Capsule-vs-capsule with a parallel-aware multi-point manifold: NEAR-PARALLEL
|
|
230
|
+
* overlapping capsules emit one contact at each end of their axial overlap
|
|
231
|
+
* interval (the two-point support a resting capsule physically has); every
|
|
232
|
+
* other configuration emits the single closest-point contact of
|
|
233
|
+
* {@link capsule_capsule_contact}.
|
|
234
|
+
*
|
|
235
|
+
* @param {number[]|Float64Array} out length >= 2 * CAPSULE_CAPSULE_CONTACT_STRIDE
|
|
236
|
+
* @returns {number} number of contacts written (0 = no overlap)
|
|
237
|
+
*/
|
|
238
|
+
export function capsule_capsule_multi_contacts(
|
|
239
|
+
out,
|
|
240
|
+
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
241
|
+
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_radius, b_half_h
|
|
242
|
+
) {
|
|
243
|
+
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
244
|
+
capsule_world_segment(scratch_seg_b, b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_half_h);
|
|
245
|
+
|
|
246
|
+
const a0x = scratch_seg[0], a0y = scratch_seg[1], a0z = scratch_seg[2];
|
|
247
|
+
const a1x = scratch_seg[3], a1y = scratch_seg[4], a1z = scratch_seg[5];
|
|
248
|
+
const b0x = scratch_seg_b[0], b0y = scratch_seg_b[1], b0z = scratch_seg_b[2];
|
|
249
|
+
const b1x = scratch_seg_b[3], b1y = scratch_seg_b[4], b1z = scratch_seg_b[5];
|
|
250
|
+
|
|
251
|
+
const d1x = a1x - a0x, d1y = a1y - a0y, d1z = a1z - a0z;
|
|
252
|
+
const d2x = b1x - b0x, d2y = b1y - b0y, d2z = b1z - b0z;
|
|
253
|
+
const len1_sqr = d1x * d1x + d1y * d1y + d1z * d1z;
|
|
254
|
+
const len2_sqr = d2x * d2x + d2y * d2y + d2z * d2z;
|
|
255
|
+
|
|
256
|
+
const cx = d1y * d2z - d1z * d2y;
|
|
257
|
+
const cy = d1z * d2x - d1x * d2z;
|
|
258
|
+
const cz = d1x * d2y - d1y * d2x;
|
|
259
|
+
const cross_sqr = cx * cx + cy * cy + cz * cz;
|
|
260
|
+
|
|
261
|
+
const sum = a_radius + b_radius;
|
|
262
|
+
|
|
263
|
+
// Near-parallel with real segments: try the two-end manifold.
|
|
264
|
+
if (len1_sqr > 0 && len2_sqr > 0
|
|
265
|
+
&& cross_sqr < CAPSULE_PARALLEL_SIN_SQR * len1_sqr * len2_sqr) {
|
|
266
|
+
|
|
267
|
+
const inv_len1 = 1 / Math.sqrt(len1_sqr);
|
|
268
|
+
const ux = d1x * inv_len1, uy = d1y * inv_len1, uz = d1z * inv_len1;
|
|
269
|
+
|
|
270
|
+
// B's endpoints parameterised along A's axis (origin a0).
|
|
271
|
+
const t0 = (b0x - a0x) * ux + (b0y - a0y) * uy + (b0z - a0z) * uz;
|
|
272
|
+
const t1 = (b1x - a0x) * ux + (b1y - a0y) * uy + (b1z - a0z) * uz;
|
|
273
|
+
const len1 = Math.sqrt(len1_sqr);
|
|
274
|
+
const lo = Math.max(0, Math.min(t0, t1));
|
|
275
|
+
const hi = Math.min(len1, Math.max(t0, t1));
|
|
276
|
+
|
|
277
|
+
if (hi > lo) {
|
|
278
|
+
// Direction along B for projecting A-axis points onto B.
|
|
279
|
+
const inv_len2_sqr = 1 / len2_sqr;
|
|
280
|
+
let n_written = 0;
|
|
281
|
+
for (let e = 0; e < 2; e++) {
|
|
282
|
+
const sA = e === 0 ? lo : hi;
|
|
283
|
+
const pax = a0x + ux * sA;
|
|
284
|
+
const pay = a0y + uy * sA;
|
|
285
|
+
const paz = a0z + uz * sA;
|
|
286
|
+
// Closest point on segment B to pa.
|
|
287
|
+
let tB = ((pax - b0x) * d2x + (pay - b0y) * d2y + (paz - b0z) * d2z) * inv_len2_sqr;
|
|
288
|
+
tB = tB < 0 ? 0 : (tB > 1 ? 1 : tB);
|
|
289
|
+
const pbx = b0x + d2x * tB;
|
|
290
|
+
const pby = b0y + d2y * tB;
|
|
291
|
+
const pbz = b0z + d2z * tB;
|
|
292
|
+
|
|
293
|
+
const dx = pax - pbx, dy = pay - pby, dz = paz - pbz;
|
|
294
|
+
const dist_sqr = dx * dx + dy * dy + dz * dz;
|
|
295
|
+
if (dist_sqr >= sum * sum) continue;
|
|
296
|
+
const dist = Math.sqrt(dist_sqr);
|
|
297
|
+
|
|
298
|
+
let nx, ny, nz;
|
|
299
|
+
if (dist > 0) {
|
|
300
|
+
const inv = 1 / dist;
|
|
301
|
+
nx = dx * inv; ny = dy * inv; nz = dz * inv;
|
|
302
|
+
} else {
|
|
303
|
+
// Axes coincide at this point - centre tie-break.
|
|
304
|
+
const ddx = a_cx - b_cx, ddy = a_cy - b_cy, ddz = a_cz - b_cz;
|
|
305
|
+
const dd = ddx * ddx + ddy * ddy + ddz * ddz;
|
|
306
|
+
if (dd > 0) {
|
|
307
|
+
const inv2 = 1 / Math.sqrt(dd);
|
|
308
|
+
nx = ddx * inv2; ny = ddy * inv2; nz = ddz * inv2;
|
|
309
|
+
} else {
|
|
310
|
+
nx = 1; ny = 0; nz = 0;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const off = n_written * CAPSULE_CAPSULE_CONTACT_STRIDE;
|
|
315
|
+
out[off] = pax - nx * a_radius;
|
|
316
|
+
out[off + 1] = pay - ny * a_radius;
|
|
317
|
+
out[off + 2] = paz - nz * a_radius;
|
|
318
|
+
out[off + 3] = pbx + nx * b_radius;
|
|
319
|
+
out[off + 4] = pby + ny * b_radius;
|
|
320
|
+
out[off + 5] = pbz + nz * b_radius;
|
|
321
|
+
out[off + 6] = nx;
|
|
322
|
+
out[off + 7] = ny;
|
|
323
|
+
out[off + 8] = nz;
|
|
324
|
+
out[off + 9] = sum - dist;
|
|
325
|
+
n_written++;
|
|
326
|
+
}
|
|
327
|
+
if (n_written > 0) return n_written;
|
|
328
|
+
// Both interval ends are out of reach — but the two-end sampling is a REFINEMENT,
|
|
329
|
+
// not a detection gate. For a non-zero inter-axis angle the segment-segment distance
|
|
330
|
+
// is strictly convex along the interval with its minimum in the INTERIOR, so the ends
|
|
331
|
+
// being out of reach does not imply the whole interval is. Fall through to the exact
|
|
332
|
+
// single-closest-point path below (which correctly returns no contact for genuinely
|
|
333
|
+
// parallel axes, where the distance is constant).
|
|
334
|
+
}
|
|
335
|
+
// Degenerate interval (axially offset end-to-end) - single contact below.
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// General case: single closest-point contact.
|
|
339
|
+
if (!capsule_capsule_contact(
|
|
340
|
+
scratch_single,
|
|
341
|
+
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
342
|
+
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_radius, b_half_h
|
|
343
|
+
)) {
|
|
344
|
+
return 0;
|
|
345
|
+
}
|
|
346
|
+
out[0] = scratch_single[4];
|
|
347
|
+
out[1] = scratch_single[5];
|
|
348
|
+
out[2] = scratch_single[6];
|
|
349
|
+
out[3] = scratch_single[7];
|
|
350
|
+
out[4] = scratch_single[8];
|
|
351
|
+
out[5] = scratch_single[9];
|
|
352
|
+
out[6] = scratch_single[0];
|
|
353
|
+
out[7] = scratch_single[1];
|
|
354
|
+
out[8] = scratch_single[2];
|
|
355
|
+
out[9] = scratch_single[3];
|
|
356
|
+
return 1;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const scratch_single = new Float64Array(10);
|
|
360
|
+
|
|
361
|
+
// --- capsule vs oriented box ------------------------------------------------
|
|
362
|
+
|
|
363
|
+
const scratch_a0_local = new Float64Array(3);
|
|
364
|
+
const scratch_a1_local = new Float64Array(3);
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Capsule (A) vs oriented box (B). Brings the capsule segment into box-local
|
|
368
|
+
* space, then refines via 2 fixed-point iterations between:
|
|
369
|
+
* - closest point on the segment to the current box-side candidate
|
|
370
|
+
* - clamped point on the box closest to the current segment-side candidate
|
|
371
|
+
*
|
|
372
|
+
* Two iterations suffice for the cases this engine targets (sphere-like cap
|
|
373
|
+
* geometry against axis-aligned-in-local box). When the segment passes
|
|
374
|
+
* through the box, the "inside" branch picks the smallest-overlap face
|
|
375
|
+
* deterministically, mirroring {@link sphere_box_contact}.
|
|
376
|
+
*
|
|
377
|
+
* @param {number[]|Float64Array} out length >= 10
|
|
378
|
+
* @returns {boolean}
|
|
379
|
+
*/
|
|
380
|
+
export function capsule_box_contact(
|
|
381
|
+
out,
|
|
382
|
+
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
383
|
+
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_hx, b_hy, b_hz
|
|
384
|
+
) {
|
|
385
|
+
// Bring the capsule's segment endpoints into box-local space: build them in
|
|
386
|
+
// world first (from the capsule centre + rotated half-height axis), then map
|
|
387
|
+
// world → box-local below.
|
|
388
|
+
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
389
|
+
// World → box-local: subtract box centre, then rotate by conjugate of box quat.
|
|
390
|
+
const w_a0x = scratch_seg[0] - b_cx, w_a0y = scratch_seg[1] - b_cy, w_a0z = scratch_seg[2] - b_cz;
|
|
391
|
+
const w_a1x = scratch_seg[3] - b_cx, w_a1y = scratch_seg[4] - b_cy, w_a1z = scratch_seg[5] - b_cz;
|
|
392
|
+
v3_quaternion_apply_inverse(scratch_a0_local, 0, w_a0x, w_a0y, w_a0z, b_qx, b_qy, b_qz, b_qw);
|
|
393
|
+
v3_quaternion_apply_inverse(scratch_a1_local, 0, w_a1x, w_a1y, w_a1z, b_qx, b_qy, b_qz, b_qw);
|
|
394
|
+
|
|
395
|
+
const a0lx = scratch_a0_local[0], a0ly = scratch_a0_local[1], a0lz = scratch_a0_local[2];
|
|
396
|
+
const a1lx = scratch_a1_local[0], a1ly = scratch_a1_local[1], a1lz = scratch_a1_local[2];
|
|
397
|
+
|
|
398
|
+
// Exact closest point on the capsule segment to the box-local AABB [−h, h].
|
|
399
|
+
// Replaces a 2-iteration alternating projection (project onto segment, clamp
|
|
400
|
+
// into box, repeat) that converged too slowly for capsules near-parallel to
|
|
401
|
+
// a box face/edge — overestimating the segment-vs-box distance, which
|
|
402
|
+
// under-detected contacts (~0.85% of random configs missed) and mis-placed
|
|
403
|
+
// depth/normal on many more. See core/geom/3d/gjk/GJK_REVIEW_NOTES.md.
|
|
404
|
+
const t = line3_compute_segment_closest_point_to_aabb3_t(
|
|
405
|
+
a0lx, a0ly, a0lz, a1lx, a1ly, a1lz,
|
|
406
|
+
-b_hx, -b_hy, -b_hz, b_hx, b_hy, b_hz
|
|
407
|
+
);
|
|
408
|
+
const plx = a0lx + (a1lx - a0lx) * t;
|
|
409
|
+
const ply = a0ly + (a1ly - a0ly) * t;
|
|
410
|
+
const plz = a0lz + (a1lz - a0lz) * t;
|
|
411
|
+
|
|
412
|
+
// Final box-side point. `let` because the interior branch snaps it onto
|
|
413
|
+
// the chosen face — for an inside segment point the clamp is an identity.
|
|
414
|
+
let qlx = plx < -b_hx ? -b_hx : (plx > b_hx ? b_hx : plx);
|
|
415
|
+
let qly = ply < -b_hy ? -b_hy : (ply > b_hy ? b_hy : ply);
|
|
416
|
+
let qlz = plz < -b_hz ? -b_hz : (plz > b_hz ? b_hz : plz);
|
|
417
|
+
const inside = qlx === plx && qly === ply && qlz === plz;
|
|
418
|
+
|
|
419
|
+
let nlx, nly, nlz, dist;
|
|
420
|
+
if (!inside) {
|
|
421
|
+
const ex = plx - qlx, ey = ply - qly, ez = plz - qlz;
|
|
422
|
+
const d_sqr = ex * ex + ey * ey + ez * ez;
|
|
423
|
+
if (d_sqr >= a_radius * a_radius) return false;
|
|
424
|
+
dist = Math.sqrt(d_sqr);
|
|
425
|
+
if (dist > 0) {
|
|
426
|
+
const inv = 1 / dist;
|
|
427
|
+
nlx = ex * inv; nly = ey * inv; nlz = ez * inv;
|
|
428
|
+
} else {
|
|
429
|
+
nlx = 1; nly = 0; nlz = 0;
|
|
430
|
+
}
|
|
431
|
+
} else {
|
|
432
|
+
// Segment point is inside the box. Pick the smallest-overlap face and
|
|
433
|
+
// snap the box witness onto it, so the reported box contact lies on
|
|
434
|
+
// the SURFACE and is consistent with the normal/depth — not left at
|
|
435
|
+
// the interior segment point, which hands the solver a wrong lever
|
|
436
|
+
// arm exactly in deep penetration. Mirrors sphere_box_contact's
|
|
437
|
+
// interior branch.
|
|
438
|
+
const dxf = b_hx - Math.abs(plx);
|
|
439
|
+
const dyf = b_hy - Math.abs(ply);
|
|
440
|
+
const dzf = b_hz - Math.abs(plz);
|
|
441
|
+
if (dxf <= dyf && dxf <= dzf) {
|
|
442
|
+
nlx = plx >= 0 ? 1 : -1; nly = 0; nlz = 0; dist = -dxf;
|
|
443
|
+
qlx = plx >= 0 ? b_hx : -b_hx;
|
|
444
|
+
} else if (dyf <= dzf) {
|
|
445
|
+
nlx = 0; nly = ply >= 0 ? 1 : -1; nlz = 0; dist = -dyf;
|
|
446
|
+
qly = ply >= 0 ? b_hy : -b_hy;
|
|
447
|
+
} else {
|
|
448
|
+
nlx = 0; nly = 0; nlz = plz >= 0 ? 1 : -1; dist = -dzf;
|
|
449
|
+
qlz = plz >= 0 ? b_hz : -b_hz;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// Normal (box → capsule axis point) into world.
|
|
454
|
+
v3_quaternion_apply(out, 0, nlx, nly, nlz, b_qx, b_qy, b_qz, b_qw);
|
|
455
|
+
const nx = out[0], ny = out[1], nz = out[2];
|
|
456
|
+
out[3] = a_radius - dist;
|
|
457
|
+
|
|
458
|
+
// Capsule-side contact: world segment point pushed back by radius.
|
|
459
|
+
v3_quaternion_apply(out, 4, plx, ply, plz, b_qx, b_qy, b_qz, b_qw);
|
|
460
|
+
out[4] += b_cx - nx * a_radius;
|
|
461
|
+
out[5] += b_cy - ny * a_radius;
|
|
462
|
+
out[6] += b_cz - nz * a_radius;
|
|
463
|
+
|
|
464
|
+
// Box-side contact: world projection of the box-surface point.
|
|
465
|
+
v3_quaternion_apply(out, 7, qlx, qly, qlz, b_qx, b_qy, b_qz, b_qw);
|
|
466
|
+
out[7] += b_cx;
|
|
467
|
+
out[8] += b_cy;
|
|
468
|
+
out[9] += b_cz;
|
|
469
|
+
|
|
470
|
+
return true;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// --- capsule vs oriented box, multi-point manifold --------------------------
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Output stride per contact in {@link capsule_box_multi_contacts}.
|
|
477
|
+
* Matches the candidate-buffer layout used by `narrowphase_step`.
|
|
478
|
+
*
|
|
479
|
+
* 0..2 : world contact on capsule side
|
|
480
|
+
* 3..5 : world contact on box side
|
|
481
|
+
* 6..8 : normal from box (B) toward capsule (A)
|
|
482
|
+
* 9 : depth (positive = penetration)
|
|
483
|
+
*
|
|
484
|
+
* @type {number}
|
|
485
|
+
*/
|
|
486
|
+
export const CAPSULE_BOX_CONTACT_STRIDE = 10;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Maximum contact points {@link capsule_box_multi_contacts} can emit.
|
|
490
|
+
* - 1 from the closest-point-on-segment vs OBB query (primary)
|
|
491
|
+
* - up to 2 from the cap-centre sphere-vs-OBB queries (one per endpoint)
|
|
492
|
+
* @type {number}
|
|
493
|
+
*/
|
|
494
|
+
export const CAPSULE_BOX_MAX_CONTACTS = 3;
|
|
495
|
+
|
|
496
|
+
const scratch_primary = new Float64Array(10);
|
|
497
|
+
const scratch_endpoint = new Float64Array(10);
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Two world positions are treated as the same contact when their squared
|
|
501
|
+
* distance is below this threshold. Picked so that a capsule resting flat
|
|
502
|
+
* doesn't double up the primary closest-segment-point contact with whichever
|
|
503
|
+
* endpoint it happens to coincide with.
|
|
504
|
+
*
|
|
505
|
+
* Looser than the manifold's warm-start match tolerance (≈0.02) because we
|
|
506
|
+
* specifically want to dedupe contacts at the *same* point; small lateral
|
|
507
|
+
* shifts of the capsule produce distinct contacts that should both be kept.
|
|
508
|
+
* @type {number}
|
|
509
|
+
*/
|
|
510
|
+
const DEDUPE_DIST_SQR = 1e-6;
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Multi-point capsule-vs-OBB contact generation. Emits up to
|
|
514
|
+
* {@link CAPSULE_BOX_MAX_CONTACTS} contacts into `out` in the
|
|
515
|
+
* `(wax, way, waz, wbx, wby, wbz, nx, ny, nz, depth)` stride layout.
|
|
516
|
+
*
|
|
517
|
+
* The motivation: a capsule lying flat on a face needs more than one
|
|
518
|
+
* contact to rest stably — a single contact at the segment's closest point
|
|
519
|
+
* is positionally ambiguous (every interior segment point is equidistant
|
|
520
|
+
* from the face), and the body wobbles around whichever point the
|
|
521
|
+
* iterative closest-point solver happened to converge on. Two contacts at
|
|
522
|
+
* the cap centres pin the capsule's rotation about its long axis.
|
|
523
|
+
*
|
|
524
|
+
* Algorithm:
|
|
525
|
+
* 1. Closest-point-on-segment vs OBB → primary contact (same as
|
|
526
|
+
* {@link capsule_box_contact}).
|
|
527
|
+
* 2. Treat each cap centre as a sphere of cap-radius and run
|
|
528
|
+
* {@link sphere_box_contact} → up to two additional contacts.
|
|
529
|
+
* 3. Dedupe spatially against the primary so a capsule touching with one
|
|
530
|
+
* cap doesn't emit two contacts at the same point.
|
|
531
|
+
*
|
|
532
|
+
* @param {Float64Array} out length >= CAPSULE_BOX_MAX_CONTACTS * CAPSULE_BOX_CONTACT_STRIDE
|
|
533
|
+
* @param {number} a_cx capsule centre x
|
|
534
|
+
* @param {number} a_cy
|
|
535
|
+
* @param {number} a_cz
|
|
536
|
+
* @param {number} a_qx capsule rotation
|
|
537
|
+
* @param {number} a_qy
|
|
538
|
+
* @param {number} a_qz
|
|
539
|
+
* @param {number} a_qw
|
|
540
|
+
* @param {number} a_radius
|
|
541
|
+
* @param {number} a_half_h
|
|
542
|
+
* @param {number} b_cx box centre x
|
|
543
|
+
* @param {number} b_cy
|
|
544
|
+
* @param {number} b_cz
|
|
545
|
+
* @param {number} b_qx
|
|
546
|
+
* @param {number} b_qy
|
|
547
|
+
* @param {number} b_qz
|
|
548
|
+
* @param {number} b_qw
|
|
549
|
+
* @param {number} b_hx
|
|
550
|
+
* @param {number} b_hy
|
|
551
|
+
* @param {number} b_hz
|
|
552
|
+
* @returns {number} number of contacts emitted, in `[0, CAPSULE_BOX_MAX_CONTACTS]`
|
|
553
|
+
*/
|
|
554
|
+
export function capsule_box_multi_contacts(
|
|
555
|
+
out,
|
|
556
|
+
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
557
|
+
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_hx, b_hy, b_hz
|
|
558
|
+
) {
|
|
559
|
+
// 1. Primary contact: closest segment point vs OBB.
|
|
560
|
+
const primary_ok = capsule_box_contact(
|
|
561
|
+
scratch_primary,
|
|
562
|
+
a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_radius, a_half_h,
|
|
563
|
+
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw, b_hx, b_hy, b_hz
|
|
564
|
+
);
|
|
565
|
+
if (!primary_ok) return 0;
|
|
566
|
+
|
|
567
|
+
// Repack scratch_primary (normal, depth, A, B) into the candidate stride
|
|
568
|
+
// (A, B, normal, depth) at out[0..10).
|
|
569
|
+
const p_nx = scratch_primary[0], p_ny = scratch_primary[1], p_nz = scratch_primary[2];
|
|
570
|
+
const p_depth = scratch_primary[3];
|
|
571
|
+
const p_ax = scratch_primary[4], p_ay = scratch_primary[5], p_az = scratch_primary[6];
|
|
572
|
+
const p_bx = scratch_primary[7], p_by = scratch_primary[8], p_bz = scratch_primary[9];
|
|
573
|
+
out[0] = p_ax; out[1] = p_ay; out[2] = p_az;
|
|
574
|
+
out[3] = p_bx; out[4] = p_by; out[5] = p_bz;
|
|
575
|
+
out[6] = p_nx; out[7] = p_ny; out[8] = p_nz;
|
|
576
|
+
out[9] = p_depth;
|
|
577
|
+
let count = 1;
|
|
578
|
+
|
|
579
|
+
// 2. Endpoint contacts: treat each cap centre as a sphere of cap-radius.
|
|
580
|
+
capsule_world_segment(scratch_seg, a_cx, a_cy, a_cz, a_qx, a_qy, a_qz, a_qw, a_half_h);
|
|
581
|
+
|
|
582
|
+
for (let i = 0; i < 2; i++) {
|
|
583
|
+
// Endpoint i lives at scratch_seg[i*3 .. i*3+2] — index directly rather
|
|
584
|
+
// than allocating three throwaway arrays per call (hot narrowphase path).
|
|
585
|
+
const ok = sphere_box_contact(
|
|
586
|
+
scratch_endpoint,
|
|
587
|
+
scratch_seg[i * 3], scratch_seg[i * 3 + 1], scratch_seg[i * 3 + 2], a_radius,
|
|
588
|
+
b_cx, b_cy, b_cz, b_qx, b_qy, b_qz, b_qw,
|
|
589
|
+
b_hx, b_hy, b_hz
|
|
590
|
+
);
|
|
591
|
+
if (!ok) continue;
|
|
592
|
+
|
|
593
|
+
const e_nx = scratch_endpoint[0], e_ny = scratch_endpoint[1], e_nz = scratch_endpoint[2];
|
|
594
|
+
const e_depth = scratch_endpoint[3];
|
|
595
|
+
const e_ax = scratch_endpoint[4], e_ay = scratch_endpoint[5], e_az = scratch_endpoint[6];
|
|
596
|
+
const e_bx = scratch_endpoint[7], e_by = scratch_endpoint[8], e_bz = scratch_endpoint[9];
|
|
597
|
+
|
|
598
|
+
// Dedupe against every already-emitted contact (primary, then any
|
|
599
|
+
// prior endpoint we've already accepted). The capsule-side world
|
|
600
|
+
// point uniquely identifies a contact for this purpose — two distinct
|
|
601
|
+
// box-surface points always have distinct capsule-side projections
|
|
602
|
+
// along the local-A axis.
|
|
603
|
+
let duplicate = false;
|
|
604
|
+
for (let k = 0; k < count; k++) {
|
|
605
|
+
const ko = k * CAPSULE_BOX_CONTACT_STRIDE;
|
|
606
|
+
const dx = e_ax - out[ko];
|
|
607
|
+
const dy = e_ay - out[ko + 1];
|
|
608
|
+
const dz = e_az - out[ko + 2];
|
|
609
|
+
if (dx * dx + dy * dy + dz * dz < DEDUPE_DIST_SQR) { duplicate = true; break; }
|
|
610
|
+
}
|
|
611
|
+
if (duplicate) continue;
|
|
612
|
+
|
|
613
|
+
const o = count * CAPSULE_BOX_CONTACT_STRIDE;
|
|
614
|
+
out[o] = e_ax; out[o + 1] = e_ay; out[o + 2] = e_az;
|
|
615
|
+
out[o + 3] = e_bx; out[o + 4] = e_by; out[o + 5] = e_bz;
|
|
616
|
+
out[o + 6] = e_nx; out[o + 7] = e_ny; out[o + 8] = e_nz;
|
|
617
|
+
out[o + 9] = e_depth;
|
|
618
|
+
count++;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
return count;
|
|
622
|
+
}
|