@pibbl/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +19 -0
- package/README.md +76 -0
- package/THIRD_PARTY_NOTICES.txt +205 -0
- package/dist/features/particles/index.d.ts +7 -0
- package/dist/features/particles/index.js +26 -0
- package/dist/features/particles/index.js.map +7 -0
- package/dist/features/particles/index.mjs +1 -0
- package/dist/features/particles/lib/canvas/birth-ledger.d.ts +69 -0
- package/dist/features/particles/lib/canvas/birth-ledger.js +752 -0
- package/dist/features/particles/lib/canvas/birth-ledger.js.map +7 -0
- package/dist/features/particles/lib/canvas/component.d.ts +14 -0
- package/dist/features/particles/lib/canvas/component.js +249 -0
- package/dist/features/particles/lib/canvas/component.js.map +7 -0
- package/dist/features/particles/lib/canvas/executor.d.ts +31 -0
- package/dist/features/particles/lib/canvas/executor.js +537 -0
- package/dist/features/particles/lib/canvas/executor.js.map +7 -0
- package/dist/features/particles/lib/canvas/primitive.d.ts +14 -0
- package/dist/features/particles/lib/canvas/primitive.js +50 -0
- package/dist/features/particles/lib/canvas/primitive.js.map +7 -0
- package/dist/features/particles/lib/canvas/raster-cache.d.ts +13 -0
- package/dist/features/particles/lib/canvas/raster-cache.js +106 -0
- package/dist/features/particles/lib/canvas/raster-cache.js.map +7 -0
- package/dist/features/particles/lib/color.d.ts +7 -0
- package/dist/features/particles/lib/color.js +159 -0
- package/dist/features/particles/lib/color.js.map +7 -0
- package/dist/features/particles/lib/compiler.d.ts +134 -0
- package/dist/features/particles/lib/compiler.js +443 -0
- package/dist/features/particles/lib/compiler.js.map +7 -0
- package/dist/features/particles/lib/curve.d.ts +19 -0
- package/dist/features/particles/lib/curve.js +129 -0
- package/dist/features/particles/lib/curve.js.map +7 -0
- package/dist/features/particles/lib/definition-records.d.ts +58 -0
- package/dist/features/particles/lib/definition-records.js +500 -0
- package/dist/features/particles/lib/definition-records.js.map +7 -0
- package/dist/features/particles/lib/definition.d.ts +18 -0
- package/dist/features/particles/lib/definition.js +602 -0
- package/dist/features/particles/lib/definition.js.map +7 -0
- package/dist/features/particles/lib/emission.d.ts +54 -0
- package/dist/features/particles/lib/emission.js +184 -0
- package/dist/features/particles/lib/emission.js.map +7 -0
- package/dist/features/particles/lib/flow/field.d.ts +81 -0
- package/dist/features/particles/lib/flow/field.js +585 -0
- package/dist/features/particles/lib/flow/field.js.map +7 -0
- package/dist/features/particles/lib/flow/hook.d.ts +158 -0
- package/dist/features/particles/lib/flow/hook.js +215 -0
- package/dist/features/particles/lib/flow/hook.js.map +7 -0
- package/dist/features/particles/lib/flow/population.d.ts +25 -0
- package/dist/features/particles/lib/flow/population.js +104 -0
- package/dist/features/particles/lib/flow/population.js.map +7 -0
- package/dist/features/particles/lib/particle.d.ts +113 -0
- package/dist/features/particles/lib/particle.js +192 -0
- package/dist/features/particles/lib/particle.js.map +7 -0
- package/dist/features/particles/lib/random.d.ts +16 -0
- package/dist/features/particles/lib/random.js +61 -0
- package/dist/features/particles/lib/random.js.map +7 -0
- package/dist/features/particles/lib/sample.d.ts +32 -0
- package/dist/features/particles/lib/sample.js +397 -0
- package/dist/features/particles/lib/sample.js.map +7 -0
- package/dist/features/particles/lib/signal-inputs.d.ts +6 -0
- package/dist/features/particles/lib/signal-inputs.js +41 -0
- package/dist/features/particles/lib/signal-inputs.js.map +7 -0
- package/dist/features/particles/lib/system/binding.d.ts +59 -0
- package/dist/features/particles/lib/system/binding.js +122 -0
- package/dist/features/particles/lib/system/binding.js.map +7 -0
- package/dist/features/particles/lib/system/controller.d.ts +58 -0
- package/dist/features/particles/lib/system/controller.js +1446 -0
- package/dist/features/particles/lib/system/controller.js.map +7 -0
- package/dist/features/particles/lib/system/hook.d.ts +13 -0
- package/dist/features/particles/lib/system/hook.js +52 -0
- package/dist/features/particles/lib/system/hook.js.map +7 -0
- package/dist/features/particles/lib/system/ownership.d.ts +26 -0
- package/dist/features/particles/lib/system/ownership.js +128 -0
- package/dist/features/particles/lib/system/ownership.js.map +7 -0
- package/dist/features/particles/lib/types.d.ts +983 -0
- package/dist/features/physics/2d-geometry.d.ts +216 -0
- package/dist/features/physics/2d-geometry.js +59 -0
- package/dist/features/physics/2d-geometry.js.map +7 -0
- package/dist/features/physics/2d-geometry.mjs +1 -0
- package/dist/features/physics/2d-testing.d.ts +80 -0
- package/dist/features/physics/2d-testing.js +141 -0
- package/dist/features/physics/2d-testing.js.map +7 -0
- package/dist/features/physics/2d-testing.mjs +1 -0
- package/dist/features/physics/2d.d.ts +165 -0
- package/dist/features/physics/2d.js +119 -0
- package/dist/features/physics/2d.js.map +7 -0
- package/dist/features/physics/2d.mjs +1 -0
- package/dist/features/physics/lib/2d/canvas/components.d.ts +46 -0
- package/dist/features/physics/lib/2d/canvas/components.js +212 -0
- package/dist/features/physics/lib/2d/canvas/components.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/custom.d.ts +24 -0
- package/dist/features/physics/lib/2d/canvas/custom.js +45 -0
- package/dist/features/physics/lib/2d/canvas/custom.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/debug.d.ts +23 -0
- package/dist/features/physics/lib/2d/canvas/debug.js +53 -0
- package/dist/features/physics/lib/2d/canvas/debug.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/inference.d.ts +9 -0
- package/dist/features/physics/lib/2d/canvas/inference.js +704 -0
- package/dist/features/physics/lib/2d/canvas/inference.js.map +7 -0
- package/dist/features/physics/lib/2d/canvas/presentation.d.ts +11 -0
- package/dist/features/physics/lib/2d/canvas/presentation.js +169 -0
- package/dist/features/physics/lib/2d/canvas/presentation.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/analytic.d.ts +15 -0
- package/dist/features/physics/lib/2d/collision/analytic.js +151 -0
- package/dist/features/physics/lib/2d/collision/analytic.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/casts.d.ts +37 -0
- package/dist/features/physics/lib/2d/collision/casts.js +631 -0
- package/dist/features/physics/lib/2d/collision/casts.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/epa.d.ts +21 -0
- package/dist/features/physics/lib/2d/collision/epa.js +102 -0
- package/dist/features/physics/lib/2d/collision/epa.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/gjk.d.ts +28 -0
- package/dist/features/physics/lib/2d/collision/gjk.js +233 -0
- package/dist/features/physics/lib/2d/collision/gjk.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/manifold.d.ts +35 -0
- package/dist/features/physics/lib/2d/collision/manifold.js +238 -0
- package/dist/features/physics/lib/2d/collision/manifold.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/pairs.d.ts +10 -0
- package/dist/features/physics/lib/2d/collision/pairs.js +285 -0
- package/dist/features/physics/lib/2d/collision/pairs.js.map +7 -0
- package/dist/features/physics/lib/2d/collision/support.d.ts +20 -0
- package/dist/features/physics/lib/2d/collision/support.js +155 -0
- package/dist/features/physics/lib/2d/collision/support.js.map +7 -0
- package/dist/features/physics/lib/2d/inspection-types.d.ts +159 -0
- package/dist/features/physics/lib/2d/math.d.ts +27 -0
- package/dist/features/physics/lib/2d/math.js +314 -0
- package/dist/features/physics/lib/2d/math.js.map +7 -0
- package/dist/features/physics/lib/2d/numeric-policy.d.ts +24 -0
- package/dist/features/physics/lib/2d/numeric-policy.js +51 -0
- package/dist/features/physics/lib/2d/numeric-policy.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.d.ts +148 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.js +305 -0
- package/dist/features/physics/lib/2d/runtime/body-handle.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/context.d.ts +9 -0
- package/dist/features/physics/lib/2d/runtime/context.js +57 -0
- package/dist/features/physics/lib/2d/runtime/context.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/controller.d.ts +106 -0
- package/dist/features/physics/lib/2d/runtime/controller.js +1317 -0
- package/dist/features/physics/lib/2d/runtime/controller.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.d.ts +153 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.js +526 -0
- package/dist/features/physics/lib/2d/runtime/descriptors.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/events.d.ts +56 -0
- package/dist/features/physics/lib/2d/runtime/events.js +153 -0
- package/dist/features/physics/lib/2d/runtime/events.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.d.ts +22 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.js +192 -0
- package/dist/features/physics/lib/2d/runtime/obstacles.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/ownership.d.ts +41 -0
- package/dist/features/physics/lib/2d/runtime/ownership.js +46 -0
- package/dist/features/physics/lib/2d/runtime/ownership.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/trace.d.ts +32 -0
- package/dist/features/physics/lib/2d/runtime/trace.js +22 -0
- package/dist/features/physics/lib/2d/runtime/trace.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/world-component.d.ts +18 -0
- package/dist/features/physics/lib/2d/runtime/world-component.js +41 -0
- package/dist/features/physics/lib/2d/runtime/world-component.js.map +7 -0
- package/dist/features/physics/lib/2d/runtime/world-props.d.ts +16 -0
- package/dist/features/physics/lib/2d/shape-records.d.ts +60 -0
- package/dist/features/physics/lib/2d/shape-records.js +26 -0
- package/dist/features/physics/lib/2d/shape-records.js.map +7 -0
- package/dist/features/physics/lib/2d/shapes.d.ts +191 -0
- package/dist/features/physics/lib/2d/shapes.js +543 -0
- package/dist/features/physics/lib/2d/shapes.js.map +7 -0
- package/dist/features/physics/lib/2d/types.d.ts +713 -0
- package/dist/features/physics/lib/2d/types.js +1 -0
- package/dist/features/physics/lib/2d/types.js.map +7 -0
- package/dist/features/physics/lib/2d/world/broad-phase.d.ts +77 -0
- package/dist/features/physics/lib/2d/world/broad-phase.js +762 -0
- package/dist/features/physics/lib/2d/world/broad-phase.js.map +7 -0
- package/dist/features/physics/lib/2d/world/ccd.d.ts +19 -0
- package/dist/features/physics/lib/2d/world/ccd.js +265 -0
- package/dist/features/physics/lib/2d/world/ccd.js.map +7 -0
- package/dist/features/physics/lib/2d/world/contact-cache.d.ts +81 -0
- package/dist/features/physics/lib/2d/world/contact-cache.js +497 -0
- package/dist/features/physics/lib/2d/world/contact-cache.js.map +7 -0
- package/dist/features/physics/lib/2d/world/integrator.d.ts +11 -0
- package/dist/features/physics/lib/2d/world/integrator.js +99 -0
- package/dist/features/physics/lib/2d/world/integrator.js.map +7 -0
- package/dist/features/physics/lib/2d/world/queries.d.ts +62 -0
- package/dist/features/physics/lib/2d/world/queries.js +424 -0
- package/dist/features/physics/lib/2d/world/queries.js.map +7 -0
- package/dist/features/physics/lib/2d/world/rapier-engine.js +7054 -0
- package/dist/features/physics/lib/2d/world/rapier-engine.js.map +7 -0
- package/dist/features/physics/lib/2d/world/rapier.d.ts +50 -0
- package/dist/features/physics/lib/2d/world/rapier.js +655 -0
- package/dist/features/physics/lib/2d/world/rapier.js.map +7 -0
- package/dist/features/physics/lib/2d/world/solver.d.ts +58 -0
- package/dist/features/physics/lib/2d/world/solver.js +660 -0
- package/dist/features/physics/lib/2d/world/solver.js.map +7 -0
- package/dist/features/physics/lib/2d/world/storage.d.ts +96 -0
- package/dist/features/physics/lib/2d/world/storage.js +371 -0
- package/dist/features/physics/lib/2d/world/storage.js.map +7 -0
- package/dist/features/physics/lib/2d/world/world.d.ts +265 -0
- package/dist/features/physics/lib/2d/world/world.js +1713 -0
- package/dist/features/physics/lib/2d/world/world.js.map +7 -0
- package/dist/features/physics/lib/shared/signal-inputs.d.ts +5 -0
- package/dist/features/physics/lib/shared/signal-inputs.js +20 -0
- package/dist/features/physics/lib/shared/signal-inputs.js.map +7 -0
- package/dist/features/physics/lib/shared/validation.d.ts +5 -0
- package/dist/features/physics/lib/shared/validation.js +48 -0
- package/dist/features/physics/lib/shared/validation.js.map +7 -0
- package/dist/features/sprites/formats/aseprite.js +23 -0
- package/dist/features/sprites/formats/aseprite.js.map +7 -0
- package/dist/features/sprites/formats/aseprite.mjs +1 -0
- package/dist/features/sprites/formats/texture-packer.js +14 -0
- package/dist/features/sprites/formats/texture-packer.js.map +7 -0
- package/dist/features/sprites/formats/texture-packer.mjs +1 -0
- package/dist/features/sprites/index.js +9 -0
- package/dist/features/sprites/index.js.map +7 -0
- package/dist/features/sprites/index.mjs +1 -0
- package/dist/features/sprites/loader.js +63 -0
- package/dist/features/sprites/loader.js.map +7 -0
- package/dist/features/sprites/model.js +64 -0
- package/dist/features/sprites/model.js.map +7 -0
- package/dist/features/sprites/sprite.js +31 -0
- package/dist/features/sprites/sprite.js.map +7 -0
- package/dist/features/textures/index.d.ts +22 -0
- package/dist/features/textures/index.js +31 -0
- package/dist/features/textures/index.js.map +7 -0
- package/dist/features/textures/index.mjs +1 -0
- package/dist/features/textures/lib/definitions.d.ts +117 -0
- package/dist/features/textures/lib/definitions.js +179 -0
- package/dist/features/textures/lib/definitions.js.map +7 -0
- package/dist/features/textures/lib/electric-boundary.d.ts +3 -0
- package/dist/features/textures/lib/electric-boundary.js +11 -0
- package/dist/features/textures/lib/electric-boundary.js.map +7 -0
- package/dist/features/textures/lib/electric-shared.d.ts +69 -0
- package/dist/features/textures/lib/electric-shared.js +43 -0
- package/dist/features/textures/lib/electric-shared.js.map +7 -0
- package/dist/features/textures/lib/electric-sources.d.ts +50 -0
- package/dist/features/textures/lib/electric-sources.js +43 -0
- package/dist/features/textures/lib/electric-sources.js.map +7 -0
- package/dist/features/textures/lib/lightning.d.ts +72 -0
- package/dist/features/textures/lib/lightning.js +139 -0
- package/dist/features/textures/lib/lightning.js.map +7 -0
- package/dist/features/textures/lib/material-field.d.ts +12 -0
- package/dist/features/textures/lib/material-field.js +31 -0
- package/dist/features/textures/lib/material-field.js.map +7 -0
- package/dist/features/textures/lib/palette.d.ts +45 -0
- package/dist/features/textures/lib/palette.js +52 -0
- package/dist/features/textures/lib/palette.js.map +7 -0
- package/dist/features/textures/lib/presentation.d.ts +54 -0
- package/dist/features/textures/lib/presentation.js +83 -0
- package/dist/features/textures/lib/presentation.js.map +7 -0
- package/dist/features/textures/lib/procedural-texture.d.ts +44 -0
- package/dist/features/textures/lib/procedural-texture.js +110 -0
- package/dist/features/textures/lib/procedural-texture.js.map +7 -0
- package/dist/features/textures/lib/rain-drops.d.ts +96 -0
- package/dist/features/textures/lib/rain-drops.js +322 -0
- package/dist/features/textures/lib/rain-drops.js.map +7 -0
- package/dist/features/textures/lib/reaction-diffusion.d.ts +67 -0
- package/dist/features/textures/lib/reaction-diffusion.js +210 -0
- package/dist/features/textures/lib/reaction-diffusion.js.map +7 -0
- package/dist/features/textures/lib/simulation.d.ts +16 -0
- package/dist/features/textures/lib/simulation.js +85 -0
- package/dist/features/textures/lib/simulation.js.map +7 -0
- package/dist/features/textures/lib/tendrils.d.ts +57 -0
- package/dist/features/textures/lib/tendrils.js +216 -0
- package/dist/features/textures/lib/tendrils.js.map +7 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/cellular-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/electric.d.ts +88 -0
- package/dist/features/textures/lib/wasm/electric.js +299 -0
- package/dist/features/textures/lib/wasm/electric.js.map +7 -0
- package/dist/features/textures/lib/wasm/ink-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/ink-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/ink-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/lightning-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/marble-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/marble-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/marble-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/memory.d.ts +31 -0
- package/dist/features/textures/lib/wasm/memory.js +103 -0
- package/dist/features/textures/lib/wasm/memory.js.map +7 -0
- package/dist/features/textures/lib/wasm/paper-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/paper-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/paper-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/tendrils-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/water-surface-bytes.js.map +7 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.d.ts +1 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.js +5 -0
- package/dist/features/textures/lib/wasm/water-waves-bytes.js.map +7 -0
- package/dist/features/textures/lib/water-surface.d.ts +92 -0
- package/dist/features/textures/lib/water-surface.js +378 -0
- package/dist/features/textures/lib/water-surface.js.map +7 -0
- package/dist/features/textures/lib/water-waves.d.ts +60 -0
- package/dist/features/textures/lib/water-waves.js +154 -0
- package/dist/features/textures/lib/water-waves.js.map +7 -0
- package/dist/features/viz/index.d.ts +28 -0
- package/dist/features/viz/index.js +45 -0
- package/dist/features/viz/index.js.map +7 -0
- package/dist/features/viz/index.mjs +1 -0
- package/dist/features/viz/lib/anchored-layout.d.ts +104 -0
- package/dist/features/viz/lib/anchored-layout.js +166 -0
- package/dist/features/viz/lib/anchored-layout.js.map +7 -0
- package/dist/features/viz/lib/axis.d.ts +10 -0
- package/dist/features/viz/lib/axis.js +116 -0
- package/dist/features/viz/lib/axis.js.map +7 -0
- package/dist/features/viz/lib/band-scale.d.ts +3 -0
- package/dist/features/viz/lib/band-scale.js +57 -0
- package/dist/features/viz/lib/band-scale.js.map +7 -0
- package/dist/features/viz/lib/bar-fill.d.ts +16 -0
- package/dist/features/viz/lib/bar-fill.js +53 -0
- package/dist/features/viz/lib/bar-fill.js.map +7 -0
- package/dist/features/viz/lib/bar-series.d.ts +150 -0
- package/dist/features/viz/lib/bar-series.js +152 -0
- package/dist/features/viz/lib/bar-series.js.map +7 -0
- package/dist/features/viz/lib/hover-card.d.ts +92 -0
- package/dist/features/viz/lib/hover-card.js +146 -0
- package/dist/features/viz/lib/hover-card.js.map +7 -0
- package/dist/features/viz/lib/hover-data.d.ts +12 -0
- package/dist/features/viz/lib/hover-data.js +50 -0
- package/dist/features/viz/lib/hover-data.js.map +7 -0
- package/dist/features/viz/lib/hover-placement.d.ts +46 -0
- package/dist/features/viz/lib/hover-placement.js +51 -0
- package/dist/features/viz/lib/hover-placement.js.map +7 -0
- package/dist/features/viz/lib/hover-queries.d.ts +60 -0
- package/dist/features/viz/lib/hover-queries.js +185 -0
- package/dist/features/viz/lib/hover-queries.js.map +7 -0
- package/dist/features/viz/lib/hover-types.d.ts +277 -0
- package/dist/features/viz/lib/layout-pie.d.ts +13 -0
- package/dist/features/viz/lib/layout-pie.js +159 -0
- package/dist/features/viz/lib/layout-pie.js.map +7 -0
- package/dist/features/viz/lib/line-series.d.ts +11 -0
- package/dist/features/viz/lib/line-series.js +89 -0
- package/dist/features/viz/lib/line-series.js.map +7 -0
- package/dist/features/viz/lib/linear-scale.d.ts +3 -0
- package/dist/features/viz/lib/linear-scale.js +70 -0
- package/dist/features/viz/lib/linear-scale.js.map +7 -0
- package/dist/features/viz/lib/nearest.d.ts +82 -0
- package/dist/features/viz/lib/nearest.js +51 -0
- package/dist/features/viz/lib/nearest.js.map +7 -0
- package/dist/features/viz/lib/paint.d.ts +2 -0
- package/dist/features/viz/lib/paint.js +17 -0
- package/dist/features/viz/lib/paint.js.map +7 -0
- package/dist/features/viz/lib/pie-layout.d.ts +31 -0
- package/dist/features/viz/lib/pie-layout.js +324 -0
- package/dist/features/viz/lib/pie-layout.js.map +7 -0
- package/dist/features/viz/lib/pie-slices.d.ts +51 -0
- package/dist/features/viz/lib/pie-slices.js +50 -0
- package/dist/features/viz/lib/pie-slices.js.map +7 -0
- package/dist/features/viz/lib/pie-types.d.ts +215 -0
- package/dist/features/viz/lib/plot-series.d.ts +13 -0
- package/dist/features/viz/lib/plot-series.js +53 -0
- package/dist/features/viz/lib/plot-series.js.map +7 -0
- package/dist/features/viz/lib/plot-types.d.ts +63 -0
- package/dist/features/viz/lib/point-data.d.ts +5 -0
- package/dist/features/viz/lib/point-data.js +17 -0
- package/dist/features/viz/lib/point-data.js.map +7 -0
- package/dist/features/viz/lib/point-geometry.d.ts +2 -0
- package/dist/features/viz/lib/point-geometry.js +24 -0
- package/dist/features/viz/lib/point-geometry.js.map +7 -0
- package/dist/features/viz/lib/point-series.d.ts +11 -0
- package/dist/features/viz/lib/point-series.js +118 -0
- package/dist/features/viz/lib/point-series.js.map +7 -0
- package/dist/features/viz/lib/point-types.d.ts +94 -0
- package/dist/features/viz/lib/scale-adjust.d.ts +11 -0
- package/dist/features/viz/lib/scale-adjust.js +25 -0
- package/dist/features/viz/lib/scale-adjust.js.map +7 -0
- package/dist/features/viz/lib/scale-context.d.ts +8 -0
- package/dist/features/viz/lib/scale-context.js +61 -0
- package/dist/features/viz/lib/scale-context.js.map +7 -0
- package/dist/features/viz/lib/scale.d.ts +11 -0
- package/dist/features/viz/lib/scale.js +80 -0
- package/dist/features/viz/lib/scale.js.map +7 -0
- package/dist/features/viz/lib/types.d.ts +414 -0
- package/dist/features/viz/lib/use-scale.d.ts +20 -0
- package/dist/features/viz/lib/use-scale.js +10 -0
- package/dist/features/viz/lib/use-scale.js.map +7 -0
- package/dist/filters/displacement-gpu.d.ts +38 -0
- package/dist/filters/displacement-gpu.js +243 -0
- package/dist/filters/displacement-gpu.js.map +7 -0
- package/dist/filters/displacement-math.d.ts +5 -0
- package/dist/filters/displacement-math.js +22 -0
- package/dist/filters/displacement-math.js.map +7 -0
- package/dist/filters/displacement.d.ts +13 -0
- package/dist/filters/displacement.js +65 -0
- package/dist/filters/displacement.js.map +7 -0
- package/dist/filters/filter-executor.d.ts +21 -0
- package/dist/filters/filter-executor.js +120 -0
- package/dist/filters/filter-executor.js.map +7 -0
- package/dist/filters/native-canvas-filter.d.ts +4 -0
- package/dist/filters/native-canvas-filter.js +105 -0
- package/dist/filters/native-canvas-filter.js.map +7 -0
- package/dist/filters/native-color.d.ts +2 -0
- package/dist/filters/native-color.js +200 -0
- package/dist/filters/native-color.js.map +7 -0
- package/dist/filters/native-operations.d.ts +8 -0
- package/dist/filters/native-operations.js +7 -0
- package/dist/filters/native-operations.js.map +7 -0
- package/dist/filters/native.d.ts +113 -0
- package/dist/filters/native.js +115 -0
- package/dist/filters/native.js.map +7 -0
- package/dist/filters/reflected-light.d.ts +12 -0
- package/dist/filters/reflected-light.js +93 -0
- package/dist/filters/reflected-light.js.map +7 -0
- package/dist/filters/reflection-gpu.d.ts +58 -0
- package/dist/filters/reflection-gpu.js +266 -0
- package/dist/filters/reflection-gpu.js.map +7 -0
- package/dist/filters/render-displacement-boundary.d.ts +12 -0
- package/dist/filters/render-displacement-boundary.js +116 -0
- package/dist/filters/render-displacement-boundary.js.map +7 -0
- package/dist/filters/render-reflection-boundary.d.ts +15 -0
- package/dist/filters/render-reflection-boundary.js +127 -0
- package/dist/filters/render-reflection-boundary.js.map +7 -0
- package/dist/filters.d.ts +5 -0
- package/dist/filters.js +29 -0
- package/dist/filters.js.map +7 -0
- package/dist/filters.mjs +1 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +300 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +1 -0
- package/dist/internal.d.ts +160 -0
- package/dist/internal.js +320 -0
- package/dist/internal.js.map +7 -0
- package/dist/internal.mjs +1 -0
- package/dist/jsx-dev-runtime.d.ts +35 -0
- package/dist/jsx-dev-runtime.js +6 -0
- package/dist/jsx-dev-runtime.js.map +7 -0
- package/dist/jsx-dev-runtime.mjs +1 -0
- package/dist/jsx-runtime.d.ts +35 -0
- package/dist/jsx-runtime.js +7 -0
- package/dist/jsx-runtime.js.map +7 -0
- package/dist/jsx-runtime.mjs +1 -0
- package/dist/lib/animation/definition.d.ts +140 -0
- package/dist/lib/animation/definition.js +605 -0
- package/dist/lib/animation/definition.js.map +7 -0
- package/dist/lib/animation/easing.d.ts +55 -0
- package/dist/lib/animation/easing.js +112 -0
- package/dist/lib/animation/easing.js.map +7 -0
- package/dist/lib/animation/evaluate.d.ts +118 -0
- package/dist/lib/animation/evaluate.js +2398 -0
- package/dist/lib/animation/evaluate.js.map +7 -0
- package/dist/lib/animation/playback.d.ts +30 -0
- package/dist/lib/animation/playback.js +932 -0
- package/dist/lib/animation/playback.js.map +7 -0
- package/dist/lib/animation/program.d.ts +145 -0
- package/dist/lib/animation/program.js +741 -0
- package/dist/lib/animation/program.js.map +7 -0
- package/dist/lib/animation/spring.d.ts +30 -0
- package/dist/lib/animation/spring.js +324 -0
- package/dist/lib/animation/spring.js.map +7 -0
- package/dist/lib/animation/types.d.ts +418 -0
- package/dist/lib/animation/writer-leases.d.ts +47 -0
- package/dist/lib/animation/writer-leases.js +314 -0
- package/dist/lib/animation/writer-leases.js.map +7 -0
- package/dist/lib/backend/canvas-2d-backend.d.ts +4 -0
- package/dist/lib/backend/canvas-2d-backend.js +97 -0
- package/dist/lib/backend/canvas-2d-backend.js.map +7 -0
- package/dist/lib/backend/types.d.ts +309 -0
- package/dist/lib/backend/types.js +26 -0
- package/dist/lib/backend/types.js.map +7 -0
- package/dist/lib/components/arc-geometry.d.ts +4 -0
- package/dist/lib/components/arc-geometry.js +46 -0
- package/dist/lib/components/arc-geometry.js.map +7 -0
- package/dist/lib/components/arc.d.ts +55 -0
- package/dist/lib/components/arc.js +91 -0
- package/dist/lib/components/arc.js.map +7 -0
- package/dist/lib/components/circle.d.ts +49 -0
- package/dist/lib/components/circle.js +46 -0
- package/dist/lib/components/circle.js.map +7 -0
- package/dist/lib/components/clip.d.ts +43 -0
- package/dist/lib/components/clip.js +24 -0
- package/dist/lib/components/clip.js.map +7 -0
- package/dist/lib/components/ellipse.d.ts +53 -0
- package/dist/lib/components/ellipse.js +59 -0
- package/dist/lib/components/ellipse.js.map +7 -0
- package/dist/lib/components/g.d.ts +56 -0
- package/dist/lib/components/g.js +24 -0
- package/dist/lib/components/g.js.map +7 -0
- package/dist/lib/components/horizontal-line.d.ts +56 -0
- package/dist/lib/components/horizontal-line.js +71 -0
- package/dist/lib/components/horizontal-line.js.map +7 -0
- package/dist/lib/components/html-box.d.ts +16 -0
- package/dist/lib/components/html-box.js +57 -0
- package/dist/lib/components/html-box.js.map +7 -0
- package/dist/lib/components/img.d.ts +24 -0
- package/dist/lib/components/img.js +150 -0
- package/dist/lib/components/img.js.map +7 -0
- package/dist/lib/components/layer-node-equality.d.ts +65 -0
- package/dist/lib/components/layer-node-equality.js +91 -0
- package/dist/lib/components/layer-node-equality.js.map +7 -0
- package/dist/lib/components/layer.d.ts +34 -0
- package/dist/lib/components/layer.js +172 -0
- package/dist/lib/components/layer.js.map +7 -0
- package/dist/lib/components/line.d.ts +51 -0
- package/dist/lib/components/line.js +76 -0
- package/dist/lib/components/line.js.map +7 -0
- package/dist/lib/components/path.d.ts +28 -0
- package/dist/lib/components/path.js +47 -0
- package/dist/lib/components/path.js.map +7 -0
- package/dist/lib/components/polygon.d.ts +45 -0
- package/dist/lib/components/polygon.js +93 -0
- package/dist/lib/components/polygon.js.map +7 -0
- package/dist/lib/components/rect.d.ts +24 -0
- package/dist/lib/components/rect.js +83 -0
- package/dist/lib/components/rect.js.map +7 -0
- package/dist/lib/components/regular-polygon.d.ts +102 -0
- package/dist/lib/components/regular-polygon.js +112 -0
- package/dist/lib/components/regular-polygon.js.map +7 -0
- package/dist/lib/components/rounded-corner-style.d.ts +7 -0
- package/dist/lib/components/rounded-corner-style.js +40 -0
- package/dist/lib/components/rounded-corner-style.js.map +7 -0
- package/dist/lib/components/shape-style.d.ts +7 -0
- package/dist/lib/components/shape-style.js +52 -0
- package/dist/lib/components/shape-style.js.map +7 -0
- package/dist/lib/components/star.d.ts +56 -0
- package/dist/lib/components/star.js +98 -0
- package/dist/lib/components/star.js.map +7 -0
- package/dist/lib/components/structural-events.d.ts +10 -0
- package/dist/lib/components/structural-events.js +8 -0
- package/dist/lib/components/structural-events.js.map +7 -0
- package/dist/lib/components/svg-path.d.ts +23 -0
- package/dist/lib/components/svg-path.js +25 -0
- package/dist/lib/components/svg-path.js.map +7 -0
- package/dist/lib/components/text-layout.d.ts +31 -0
- package/dist/lib/components/text-layout.js +139 -0
- package/dist/lib/components/text-layout.js.map +7 -0
- package/dist/lib/components/text.d.ts +29 -0
- package/dist/lib/components/text.js +174 -0
- package/dist/lib/components/text.js.map +7 -0
- package/dist/lib/components/vertical-line.d.ts +57 -0
- package/dist/lib/components/vertical-line.js +71 -0
- package/dist/lib/components/vertical-line.js.map +7 -0
- package/dist/lib/components/wedge.d.ts +55 -0
- package/dist/lib/components/wedge.js +93 -0
- package/dist/lib/components/wedge.js.map +7 -0
- package/dist/lib/define-primitive.d.ts +82 -0
- package/dist/lib/define-primitive.js +85 -0
- package/dist/lib/define-primitive.js.map +7 -0
- package/dist/lib/development.d.ts +2 -0
- package/dist/lib/development.js +5 -0
- package/dist/lib/development.js.map +7 -0
- package/dist/lib/element/children.d.ts +16 -0
- package/dist/lib/element/children.js +333 -0
- package/dist/lib/element/children.js.map +7 -0
- package/dist/lib/element/create-element.d.ts +34 -0
- package/dist/lib/element/create-element.js +75 -0
- package/dist/lib/element/create-element.js.map +7 -0
- package/dist/lib/element/fragment.d.ts +15 -0
- package/dist/lib/element/fragment.js +11 -0
- package/dist/lib/element/fragment.js.map +7 -0
- package/dist/lib/element/jsx-runtime.d.ts +48 -0
- package/dist/lib/element/jsx-runtime.js +16 -0
- package/dist/lib/element/jsx-runtime.js.map +7 -0
- package/dist/lib/element/metadata.d.ts +96 -0
- package/dist/lib/element/metadata.js +160 -0
- package/dist/lib/element/metadata.js.map +7 -0
- package/dist/lib/element/resolve-primitive-inputs.d.ts +12 -0
- package/dist/lib/element/resolve-primitive-inputs.js +83 -0
- package/dist/lib/element/resolve-primitive-inputs.js.map +7 -0
- package/dist/lib/element/types.d.ts +123 -0
- package/dist/lib/element-enhancers.d.ts +134 -0
- package/dist/lib/element-enhancers.js +193 -0
- package/dist/lib/element-enhancers.js.map +7 -0
- package/dist/lib/events/adapters/clipboard.d.ts +9 -0
- package/dist/lib/events/adapters/clipboard.js +23 -0
- package/dist/lib/events/adapters/clipboard.js.map +7 -0
- package/dist/lib/events/adapters/drag.d.ts +12 -0
- package/dist/lib/events/adapters/drag.js +29 -0
- package/dist/lib/events/adapters/drag.js.map +7 -0
- package/dist/lib/events/adapters/editing.d.ts +15 -0
- package/dist/lib/events/adapters/editing.js +41 -0
- package/dist/lib/events/adapters/editing.js.map +7 -0
- package/dist/lib/events/adapters/keyboard-focus.d.ts +12 -0
- package/dist/lib/events/adapters/keyboard-focus.js +36 -0
- package/dist/lib/events/adapters/keyboard-focus.js.map +7 -0
- package/dist/lib/events/adapters/mouse.d.ts +17 -0
- package/dist/lib/events/adapters/mouse.js +32 -0
- package/dist/lib/events/adapters/mouse.js.map +7 -0
- package/dist/lib/events/adapters/pointer.d.ts +19 -0
- package/dist/lib/events/adapters/pointer.js +40 -0
- package/dist/lib/events/adapters/pointer.js.map +7 -0
- package/dist/lib/events/adapters/touch.d.ts +16 -0
- package/dist/lib/events/adapters/touch.js +36 -0
- package/dist/lib/events/adapters/touch.js.map +7 -0
- package/dist/lib/events/adapters/wheel.d.ts +10 -0
- package/dist/lib/events/adapters/wheel.js +16 -0
- package/dist/lib/events/adapters/wheel.js.map +7 -0
- package/dist/lib/events/boundary-transitions.d.ts +9 -0
- package/dist/lib/events/boundary-transitions.js +16 -0
- package/dist/lib/events/boundary-transitions.js.map +7 -0
- package/dist/lib/events/dispatch.d.ts +21 -0
- package/dist/lib/events/dispatch.js +1078 -0
- package/dist/lib/events/dispatch.js.map +7 -0
- package/dist/lib/events/event-definitions.d.ts +23 -0
- package/dist/lib/events/event-definitions.js +74 -0
- package/dist/lib/events/event-definitions.js.map +7 -0
- package/dist/lib/events/event-facade.d.ts +19 -0
- package/dist/lib/events/event-facade.js +188 -0
- package/dist/lib/events/event-facade.js.map +7 -0
- package/dist/lib/events/event-path.d.ts +3 -0
- package/dist/lib/events/event-path.js +43 -0
- package/dist/lib/events/event-path.js.map +7 -0
- package/dist/lib/events/hit-test.d.ts +13 -0
- package/dist/lib/events/hit-test.js +135 -0
- package/dist/lib/events/hit-test.js.map +7 -0
- package/dist/lib/events/native-listener-hub.d.ts +10 -0
- package/dist/lib/events/native-listener-hub.js +72 -0
- package/dist/lib/events/native-listener-hub.js.map +7 -0
- package/dist/lib/events/paint-entry.d.ts +66 -0
- package/dist/lib/events/paint-entry.js +30 -0
- package/dist/lib/events/paint-entry.js.map +7 -0
- package/dist/lib/events/pointer-capture.d.ts +23 -0
- package/dist/lib/events/pointer-capture.js +339 -0
- package/dist/lib/events/pointer-capture.js.map +7 -0
- package/dist/lib/events/propagation.d.ts +7 -0
- package/dist/lib/events/propagation.js +56 -0
- package/dist/lib/events/propagation.js.map +7 -0
- package/dist/lib/events/registrations.d.ts +120 -0
- package/dist/lib/events/registrations.js +397 -0
- package/dist/lib/events/registrations.js.map +7 -0
- package/dist/lib/events/resolver-input.d.ts +25 -0
- package/dist/lib/events/resolver-input.js +62 -0
- package/dist/lib/events/resolver-input.js.map +7 -0
- package/dist/lib/events/types.d.ts +596 -0
- package/dist/lib/execute-render.d.ts +9 -0
- package/dist/lib/execute-render.js +195 -0
- package/dist/lib/execute-render.js.map +7 -0
- package/dist/lib/filter/canvas-state.d.ts +2 -0
- package/dist/lib/filter/canvas-state.js +31 -0
- package/dist/lib/filter/canvas-state.js.map +7 -0
- package/dist/lib/filter/filter-region.d.ts +33 -0
- package/dist/lib/filter/filter-region.js +291 -0
- package/dist/lib/filter/filter-region.js.map +7 -0
- package/dist/lib/filter/filter-surface-pool.d.ts +38 -0
- package/dist/lib/filter/filter-surface-pool.js +252 -0
- package/dist/lib/filter/filter-surface-pool.js.map +7 -0
- package/dist/lib/filter/render-filter-boundary.d.ts +14 -0
- package/dist/lib/filter/render-filter-boundary.js +211 -0
- package/dist/lib/filter/render-filter-boundary.js.map +7 -0
- package/dist/lib/focus/directional-navigation.d.ts +12 -0
- package/dist/lib/focus/directional-navigation.js +86 -0
- package/dist/lib/focus/directional-navigation.js.map +7 -0
- package/dist/lib/focus/dom-focus-host.d.ts +13 -0
- package/dist/lib/focus/dom-focus-host.js +352 -0
- package/dist/lib/focus/dom-focus-host.js.map +7 -0
- package/dist/lib/focus/dom-tab-stops.d.ts +3 -0
- package/dist/lib/focus/dom-tab-stops.js +71 -0
- package/dist/lib/focus/dom-tab-stops.js.map +7 -0
- package/dist/lib/focus/focus-events.d.ts +4 -0
- package/dist/lib/focus/focus-events.js +78 -0
- package/dist/lib/focus/focus-events.js.map +7 -0
- package/dist/lib/focus/focus-manager.d.ts +121 -0
- package/dist/lib/focus/focus-manager.js +1131 -0
- package/dist/lib/focus/focus-manager.js.map +7 -0
- package/dist/lib/focus/geometry.d.ts +4 -0
- package/dist/lib/focus/geometry.js +64 -0
- package/dist/lib/focus/geometry.js.map +7 -0
- package/dist/lib/focus/html-focus-region.d.ts +27 -0
- package/dist/lib/focus/keyboard-defaults.d.ts +7 -0
- package/dist/lib/focus/keyboard-defaults.js +110 -0
- package/dist/lib/focus/keyboard-defaults.js.map +7 -0
- package/dist/lib/focus/policy-components.d.ts +45 -0
- package/dist/lib/focus/policy-components.js +94 -0
- package/dist/lib/focus/policy-components.js.map +7 -0
- package/dist/lib/focus/types.d.ts +37 -0
- package/dist/lib/focus/types.js +7 -0
- package/dist/lib/focus/types.js.map +7 -0
- package/dist/lib/geometry/circle.d.ts +22 -0
- package/dist/lib/geometry/circle.js +13 -0
- package/dist/lib/geometry/circle.js.map +7 -0
- package/dist/lib/geometry/circular-sweep.d.ts +54 -0
- package/dist/lib/geometry/circular-sweep.js +95 -0
- package/dist/lib/geometry/circular-sweep.js.map +7 -0
- package/dist/lib/geometry/ellipse.d.ts +26 -0
- package/dist/lib/geometry/ellipse.js +17 -0
- package/dist/lib/geometry/ellipse.js.map +7 -0
- package/dist/lib/geometry/line.d.ts +20 -0
- package/dist/lib/geometry/line.js +15 -0
- package/dist/lib/geometry/line.js.map +7 -0
- package/dist/lib/geometry/path-arc.d.ts +25 -0
- package/dist/lib/geometry/path-arc.js +57 -0
- package/dist/lib/geometry/path-arc.js.map +7 -0
- package/dist/lib/geometry/path-bend-guide.d.ts +31 -0
- package/dist/lib/geometry/path-bend-guide.js +282 -0
- package/dist/lib/geometry/path-bend-guide.js.map +7 -0
- package/dist/lib/geometry/path-bend-spans.d.ts +31 -0
- package/dist/lib/geometry/path-bend-spans.js +109 -0
- package/dist/lib/geometry/path-bend-spans.js.map +7 -0
- package/dist/lib/geometry/path-bending.d.ts +90 -0
- package/dist/lib/geometry/path-bending.js +202 -0
- package/dist/lib/geometry/path-bending.js.map +7 -0
- package/dist/lib/geometry/path-conversion.d.ts +19 -0
- package/dist/lib/geometry/path-conversion.js +114 -0
- package/dist/lib/geometry/path-conversion.js.map +7 -0
- package/dist/lib/geometry/path-geometry.d.ts +218 -0
- package/dist/lib/geometry/path-geometry.js +557 -0
- package/dist/lib/geometry/path-geometry.js.map +7 -0
- package/dist/lib/geometry/path-radial.d.ts +15 -0
- package/dist/lib/geometry/path-radial.js +107 -0
- package/dist/lib/geometry/path-radial.js.map +7 -0
- package/dist/lib/geometry/path-transforms.d.ts +233 -0
- package/dist/lib/geometry/path-transforms.js +478 -0
- package/dist/lib/geometry/path-transforms.js.map +7 -0
- package/dist/lib/geometry/path-utilities.d.ts +78 -0
- package/dist/lib/geometry/path-utilities.js +341 -0
- package/dist/lib/geometry/path-utilities.js.map +7 -0
- package/dist/lib/geometry/path-wang.d.ts +18 -0
- package/dist/lib/geometry/path-wang.js +136 -0
- package/dist/lib/geometry/path-wang.js.map +7 -0
- package/dist/lib/geometry/path-warp-bezier.d.ts +17 -0
- package/dist/lib/geometry/path-warp-bezier.js +109 -0
- package/dist/lib/geometry/path-warp-bezier.js.map +7 -0
- package/dist/lib/geometry/path-warp.d.ts +27 -0
- package/dist/lib/geometry/path-warp.js +165 -0
- package/dist/lib/geometry/path-warp.js.map +7 -0
- package/dist/lib/geometry/polygon.d.ts +21 -0
- package/dist/lib/geometry/polygon.js +12 -0
- package/dist/lib/geometry/polygon.js.map +7 -0
- package/dist/lib/geometry/rectangle.d.ts +38 -0
- package/dist/lib/geometry/rectangle.js +22 -0
- package/dist/lib/geometry/rectangle.js.map +7 -0
- package/dist/lib/geometry/regular-polygon.d.ts +88 -0
- package/dist/lib/geometry/regular-polygon.js +67 -0
- package/dist/lib/geometry/regular-polygon.js.map +7 -0
- package/dist/lib/geometry/resolve-path.d.ts +4 -0
- package/dist/lib/geometry/resolve-path.js +16 -0
- package/dist/lib/geometry/resolve-path.js.map +7 -0
- package/dist/lib/geometry/rounded-corners.d.ts +28 -0
- package/dist/lib/geometry/rounded-corners.js +118 -0
- package/dist/lib/geometry/rounded-corners.js.map +7 -0
- package/dist/lib/geometry/star.d.ts +39 -0
- package/dist/lib/geometry/star.js +90 -0
- package/dist/lib/geometry/star.js.map +7 -0
- package/dist/lib/geometry/svg-path.d.ts +21 -0
- package/dist/lib/geometry/svg-path.js +7 -0
- package/dist/lib/geometry/svg-path.js.map +7 -0
- package/dist/lib/geometry/transform-bend.d.ts +46 -0
- package/dist/lib/geometry/transform-bend.js +219 -0
- package/dist/lib/geometry/transform-bend.js.map +7 -0
- package/dist/lib/geometry/transform-guide.d.ts +57 -0
- package/dist/lib/geometry/transform-guide.js +157 -0
- package/dist/lib/geometry/transform-guide.js.map +7 -0
- package/dist/lib/geometry/transform-math.d.ts +21 -0
- package/dist/lib/geometry/transform-math.js +91 -0
- package/dist/lib/geometry/transform-math.js.map +7 -0
- package/dist/lib/geometry/transform-mesh.d.ts +39 -0
- package/dist/lib/geometry/transform-mesh.js +129 -0
- package/dist/lib/geometry/transform-mesh.js.map +7 -0
- package/dist/lib/geometry/validation.d.ts +6 -0
- package/dist/lib/geometry/validation.js +42 -0
- package/dist/lib/geometry/validation.js.map +7 -0
- package/dist/lib/global-state.d.ts +63 -0
- package/dist/lib/global-state.js +176 -0
- package/dist/lib/global-state.js.map +7 -0
- package/dist/lib/hooks/hook-slot.d.ts +30 -0
- package/dist/lib/hooks/hook-slot.js +66 -0
- package/dist/lib/hooks/hook-slot.js.map +7 -0
- package/dist/lib/hooks/use-animated-value.d.ts +24 -0
- package/dist/lib/hooks/use-animated-value.js +169 -0
- package/dist/lib/hooks/use-animated-value.js.map +7 -0
- package/dist/lib/hooks/use-canvas-context.d.ts +10 -0
- package/dist/lib/hooks/use-canvas-context.js +13 -0
- package/dist/lib/hooks/use-canvas-context.js.map +7 -0
- package/dist/lib/hooks/use-computed.d.ts +13 -0
- package/dist/lib/hooks/use-computed.js +91 -0
- package/dist/lib/hooks/use-computed.js.map +7 -0
- package/dist/lib/hooks/use-const.d.ts +10 -0
- package/dist/lib/hooks/use-const.js +15 -0
- package/dist/lib/hooks/use-const.js.map +7 -0
- package/dist/lib/hooks/use-cursor.d.ts +16 -0
- package/dist/lib/hooks/use-cursor.js +51 -0
- package/dist/lib/hooks/use-cursor.js.map +7 -0
- package/dist/lib/hooks/use-event-listener.d.ts +10 -0
- package/dist/lib/hooks/use-event-listener.js +24 -0
- package/dist/lib/hooks/use-event-listener.js.map +7 -0
- package/dist/lib/hooks/use-event-target.d.ts +14 -0
- package/dist/lib/hooks/use-event-target.js +30 -0
- package/dist/lib/hooks/use-event-target.js.map +7 -0
- package/dist/lib/hooks/use-layout-box.d.ts +9 -0
- package/dist/lib/hooks/use-layout-box.js +8 -0
- package/dist/lib/hooks/use-layout-box.js.map +7 -0
- package/dist/lib/hooks/use-line-path.d.ts +14 -0
- package/dist/lib/hooks/use-line-path.js +13 -0
- package/dist/lib/hooks/use-line-path.js.map +7 -0
- package/dist/lib/hooks/use-paint-target.d.ts +3 -0
- package/dist/lib/hooks/use-paint-target.js +34 -0
- package/dist/lib/hooks/use-paint-target.js.map +7 -0
- package/dist/lib/hooks/use-playback.d.ts +21 -0
- package/dist/lib/hooks/use-playback.js +87 -0
- package/dist/lib/hooks/use-playback.js.map +7 -0
- package/dist/lib/hooks/use-reaction.d.ts +19 -0
- package/dist/lib/hooks/use-reaction.js +245 -0
- package/dist/lib/hooks/use-reaction.js.map +7 -0
- package/dist/lib/hooks/use-rect-path.d.ts +20 -0
- package/dist/lib/hooks/use-rect-path.js +25 -0
- package/dist/lib/hooks/use-rect-path.js.map +7 -0
- package/dist/lib/hooks/use-ref.d.ts +17 -0
- package/dist/lib/hooks/use-ref.js +8 -0
- package/dist/lib/hooks/use-ref.js.map +7 -0
- package/dist/lib/hooks/use-region.d.ts +11 -0
- package/dist/lib/hooks/use-region.js +34 -0
- package/dist/lib/hooks/use-region.js.map +7 -0
- package/dist/lib/hooks/use-signal.d.ts +12 -0
- package/dist/lib/hooks/use-signal.js +12 -0
- package/dist/lib/hooks/use-signal.js.map +7 -0
- package/dist/lib/hooks/use-svg-path.d.ts +11 -0
- package/dist/lib/hooks/use-svg-path.js +13 -0
- package/dist/lib/hooks/use-svg-path.js.map +7 -0
- package/dist/lib/hooks/use-value-memo-slot.d.ts +12 -0
- package/dist/lib/hooks/use-value-memo-slot.js +45 -0
- package/dist/lib/hooks/use-value-memo-slot.js.map +7 -0
- package/dist/lib/hooks/use-visibility-transition.d.ts +103 -0
- package/dist/lib/hooks/use-visibility-transition.js +195 -0
- package/dist/lib/hooks/use-visibility-transition.js.map +7 -0
- package/dist/lib/html/html-service.d.ts +30 -0
- package/dist/lib/html/html-service.js +281 -0
- package/dist/lib/html/html-service.js.map +7 -0
- package/dist/lib/html/overlay-config.d.ts +3 -0
- package/dist/lib/html/overlay-config.js +37 -0
- package/dist/lib/html/overlay-config.js.map +7 -0
- package/dist/lib/html/portable-clips.d.ts +4 -0
- package/dist/lib/html/portable-clips.js +20 -0
- package/dist/lib/html/portable-clips.js.map +7 -0
- package/dist/lib/html/types.d.ts +110 -0
- package/dist/lib/layout/absolute.d.ts +57 -0
- package/dist/lib/layout/absolute.js +348 -0
- package/dist/lib/layout/absolute.js.map +7 -0
- package/dist/lib/layout/box.d.ts +19 -0
- package/dist/lib/layout/box.js +209 -0
- package/dist/lib/layout/box.js.map +7 -0
- package/dist/lib/layout/context.d.ts +13 -0
- package/dist/lib/layout/context.js +42 -0
- package/dist/lib/layout/context.js.map +7 -0
- package/dist/lib/layout/diagnostics.d.ts +15 -0
- package/dist/lib/layout/diagnostics.js +30 -0
- package/dist/lib/layout/diagnostics.js.map +7 -0
- package/dist/lib/layout/flex.d.ts +64 -0
- package/dist/lib/layout/flex.js +803 -0
- package/dist/lib/layout/flex.js.map +7 -0
- package/dist/lib/layout/flow.d.ts +53 -0
- package/dist/lib/layout/flow.js +400 -0
- package/dist/lib/layout/flow.js.map +7 -0
- package/dist/lib/layout/grid.d.ts +64 -0
- package/dist/lib/layout/grid.js +597 -0
- package/dist/lib/layout/grid.js.map +7 -0
- package/dist/lib/layout/measure.d.ts +19 -0
- package/dist/lib/layout/measure.js +144 -0
- package/dist/lib/layout/measure.js.map +7 -0
- package/dist/lib/layout/overlay.d.ts +42 -0
- package/dist/lib/layout/overlay.js +151 -0
- package/dist/lib/layout/overlay.js.map +7 -0
- package/dist/lib/layout/place-child.d.ts +12 -0
- package/dist/lib/layout/place-child.js +72 -0
- package/dist/lib/layout/place-child.js.map +7 -0
- package/dist/lib/layout/positioning-diagnostics.d.ts +3 -0
- package/dist/lib/layout/positioning-diagnostics.js +15 -0
- package/dist/lib/layout/positioning-diagnostics.js.map +7 -0
- package/dist/lib/layout/types.d.ts +78 -0
- package/dist/lib/manipulation/controller-types.d.ts +299 -0
- package/dist/lib/manipulation/controller.d.ts +57 -0
- package/dist/lib/manipulation/controller.js +464 -0
- package/dist/lib/manipulation/controller.js.map +7 -0
- package/dist/lib/manipulation/coordinates.d.ts +9 -0
- package/dist/lib/manipulation/coordinates.js +55 -0
- package/dist/lib/manipulation/coordinates.js.map +7 -0
- package/dist/lib/manipulation/degrees.d.ts +10 -0
- package/dist/lib/manipulation/degrees.js +9 -0
- package/dist/lib/manipulation/degrees.js.map +7 -0
- package/dist/lib/manipulation/frame.d.ts +24 -0
- package/dist/lib/manipulation/frame.js +101 -0
- package/dist/lib/manipulation/frame.js.map +7 -0
- package/dist/lib/manipulation/geometry.d.ts +4 -0
- package/dist/lib/manipulation/geometry.js +26 -0
- package/dist/lib/manipulation/geometry.js.map +7 -0
- package/dist/lib/manipulation/handles.d.ts +298 -0
- package/dist/lib/manipulation/handles.js +598 -0
- package/dist/lib/manipulation/handles.js.map +7 -0
- package/dist/lib/manipulation/manipulable.d.ts +65 -0
- package/dist/lib/manipulation/manipulable.js +47 -0
- package/dist/lib/manipulation/manipulable.js.map +7 -0
- package/dist/lib/manipulation/ownership.d.ts +15 -0
- package/dist/lib/manipulation/ownership.js +80 -0
- package/dist/lib/manipulation/ownership.js.map +7 -0
- package/dist/lib/manipulation/snap.d.ts +6 -0
- package/dist/lib/manipulation/snap.js +40 -0
- package/dist/lib/manipulation/snap.js.map +7 -0
- package/dist/lib/manipulation/solve.d.ts +2 -0
- package/dist/lib/manipulation/solve.js +563 -0
- package/dist/lib/manipulation/solve.js.map +7 -0
- package/dist/lib/manipulation/types.d.ts +178 -0
- package/dist/lib/mount-pibbl.d.ts +25 -0
- package/dist/lib/mount-pibbl.js +278 -0
- package/dist/lib/mount-pibbl.js.map +7 -0
- package/dist/lib/optional-services.d.ts +8 -0
- package/dist/lib/optional-services.js +11 -0
- package/dist/lib/optional-services.js.map +7 -0
- package/dist/lib/pibbl.d.ts +17 -0
- package/dist/lib/pibbl.js +21 -0
- package/dist/lib/pibbl.js.map +7 -0
- package/dist/lib/primitive-presentation.d.ts +24 -0
- package/dist/lib/primitive-presentation.js +102 -0
- package/dist/lib/primitive-presentation.js.map +7 -0
- package/dist/lib/render-layer/controller.d.ts +67 -0
- package/dist/lib/render-layer/controller.js +603 -0
- package/dist/lib/render-layer/controller.js.map +7 -0
- package/dist/lib/render-layer/define-render-layer.d.ts +17 -0
- package/dist/lib/render-layer/define-render-layer.js +90 -0
- package/dist/lib/render-layer/define-render-layer.js.map +7 -0
- package/dist/lib/render-layer/types.d.ts +315 -0
- package/dist/lib/render-target.d.ts +27 -0
- package/dist/lib/render-target.js +118 -0
- package/dist/lib/render-target.js.map +7 -0
- package/dist/lib/render-transaction.d.ts +10 -0
- package/dist/lib/render-transaction.js +46 -0
- package/dist/lib/render-transaction.js.map +7 -0
- package/dist/lib/render.d.ts +3 -0
- package/dist/lib/render.js +385 -0
- package/dist/lib/render.js.map +7 -0
- package/dist/lib/scheduler/realm-scheduler.d.ts +52 -0
- package/dist/lib/scheduler/realm-scheduler.js +964 -0
- package/dist/lib/scheduler/realm-scheduler.js.map +7 -0
- package/dist/lib/scheduler/renderer-participant.d.ts +257 -0
- package/dist/lib/scheduler/renderer-participant.js +216 -0
- package/dist/lib/scheduler/renderer-participant.js.map +7 -0
- package/dist/lib/scheduler/simulation-participant.d.ts +103 -0
- package/dist/lib/scheduler/simulation-participant.js +229 -0
- package/dist/lib/scheduler/simulation-participant.js.map +7 -0
- package/dist/lib/scheduler/testing.d.ts +56 -0
- package/dist/lib/scheduler/testing.js +71 -0
- package/dist/lib/scheduler/testing.js.map +7 -0
- package/dist/lib/scheduler/types.d.ts +103 -0
- package/dist/lib/signals/edge.d.ts +44 -0
- package/dist/lib/signals/edge.js +245 -0
- package/dist/lib/signals/edge.js.map +7 -0
- package/dist/lib/signals/graph.d.ts +220 -0
- package/dist/lib/signals/graph.js +1035 -0
- package/dist/lib/signals/graph.js.map +7 -0
- package/dist/lib/signals/input-provision.d.ts +3 -0
- package/dist/lib/signals/input-provision.js +67 -0
- package/dist/lib/signals/input-provision.js.map +7 -0
- package/dist/lib/signals/render-consumer.d.ts +21 -0
- package/dist/lib/signals/render-consumer.js +218 -0
- package/dist/lib/signals/render-consumer.js.map +7 -0
- package/dist/lib/signals/resolve-signal-value.d.ts +10 -0
- package/dist/lib/signals/resolve-signal-value.js +17 -0
- package/dist/lib/signals/resolve-signal-value.js.map +7 -0
- package/dist/lib/signals/types.d.ts +80 -0
- package/dist/lib/style/diagnostics.d.ts +83 -0
- package/dist/lib/style/diagnostics.js +63 -0
- package/dist/lib/style/diagnostics.js.map +7 -0
- package/dist/lib/style/empty-style.d.ts +3 -0
- package/dist/lib/style/empty-style.js +5 -0
- package/dist/lib/style/empty-style.js.map +7 -0
- package/dist/lib/style/filter-types.d.ts +243 -0
- package/dist/lib/style/filter-types.js +5 -0
- package/dist/lib/style/filter-types.js.map +7 -0
- package/dist/lib/style/filter.d.ts +7 -0
- package/dist/lib/style/filter.js +50 -0
- package/dist/lib/style/filter.js.map +7 -0
- package/dist/lib/style/normalize.d.ts +18 -0
- package/dist/lib/style/normalize.js +50 -0
- package/dist/lib/style/normalize.js.map +7 -0
- package/dist/lib/style/positioning.d.ts +32 -0
- package/dist/lib/style/positioning.js +81 -0
- package/dist/lib/style/positioning.js.map +7 -0
- package/dist/lib/style/resolve-built-in.d.ts +6 -0
- package/dist/lib/style/resolve-built-in.js +58 -0
- package/dist/lib/style/resolve-built-in.js.map +7 -0
- package/dist/lib/style/resolve-dispatch.d.ts +20 -0
- package/dist/lib/style/resolve-dispatch.js +167 -0
- package/dist/lib/style/resolve-dispatch.js.map +7 -0
- package/dist/lib/style/resolve-length.d.ts +16 -0
- package/dist/lib/style/resolve-length.js +54 -0
- package/dist/lib/style/resolve-length.js.map +7 -0
- package/dist/lib/style/responsive.d.ts +31 -0
- package/dist/lib/style/responsive.js +172 -0
- package/dist/lib/style/responsive.js.map +7 -0
- package/dist/lib/style/types.d.ts +338 -0
- package/dist/lib/surface/resolve-surface.d.ts +4 -0
- package/dist/lib/surface/resolve-surface.js +184 -0
- package/dist/lib/surface/resolve-surface.js.map +7 -0
- package/dist/lib/surface/root-surface.d.ts +7 -0
- package/dist/lib/surface/root-surface.js +171 -0
- package/dist/lib/surface/root-surface.js.map +7 -0
- package/dist/lib/surface/transform.d.ts +4 -0
- package/dist/lib/surface/transform.js +16 -0
- package/dist/lib/surface/transform.js.map +7 -0
- package/dist/lib/surface/types.d.ts +132 -0
- package/dist/lib/teardowns.d.ts +14 -0
- package/dist/lib/teardowns.js +50 -0
- package/dist/lib/teardowns.js.map +7 -0
- package/dist/lib/textures/texture-protocol.d.ts +124 -0
- package/dist/lib/textures/texture-protocol.js +40 -0
- package/dist/lib/textures/texture-protocol.js.map +7 -0
- package/dist/lib/textures/texture.d.ts +170 -0
- package/dist/lib/textures/texture.js +385 -0
- package/dist/lib/textures/texture.js.map +7 -0
- package/dist/lib/transitions/bifrost.d.ts +47 -0
- package/dist/lib/transitions/bifrost.js +91 -0
- package/dist/lib/transitions/bifrost.js.map +7 -0
- package/dist/lib/transitions/binding.d.ts +14 -0
- package/dist/lib/transitions/binding.js +35 -0
- package/dist/lib/transitions/binding.js.map +7 -0
- package/dist/lib/transitions/capture.d.ts +21 -0
- package/dist/lib/transitions/capture.js +91 -0
- package/dist/lib/transitions/capture.js.map +7 -0
- package/dist/lib/transitions/common.d.ts +130 -0
- package/dist/lib/transitions/common.js +57 -0
- package/dist/lib/transitions/common.js.map +7 -0
- package/dist/lib/transitions/define-transition.d.ts +64 -0
- package/dist/lib/transitions/define-transition.js +31 -0
- package/dist/lib/transitions/define-transition.js.map +7 -0
- package/dist/lib/transitions/embers-physics.d.ts +114 -0
- package/dist/lib/transitions/embers-physics.js +161 -0
- package/dist/lib/transitions/embers-physics.js.map +7 -0
- package/dist/lib/transitions/embers.d.ts +67 -0
- package/dist/lib/transitions/embers.js +196 -0
- package/dist/lib/transitions/embers.js.map +7 -0
- package/dist/lib/transitions/fade.d.ts +41 -0
- package/dist/lib/transitions/fade.js +31 -0
- package/dist/lib/transitions/fade.js.map +7 -0
- package/dist/lib/transitions/hologram.d.ts +47 -0
- package/dist/lib/transitions/hologram.js +94 -0
- package/dist/lib/transitions/hologram.js.map +7 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.js +5 -0
- package/dist/lib/transitions/wasm/bifrost-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.d.ts +1 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.js +27 -0
- package/dist/lib/transitions/wasm/bifrost-kernel.js.map +7 -0
- package/dist/lib/transitions/wasm/embers-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/embers-bytes.js +5 -0
- package/dist/lib/transitions/wasm/embers-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/hologram-bytes.d.ts +1 -0
- package/dist/lib/transitions/wasm/hologram-bytes.js +5 -0
- package/dist/lib/transitions/wasm/hologram-bytes.js.map +7 -0
- package/dist/lib/transitions/wasm/kernel.d.ts +7 -0
- package/dist/lib/transitions/wasm/kernel.js +26 -0
- package/dist/lib/transitions/wasm/kernel.js.map +7 -0
- package/dist/lib/types.d.ts +570 -0
- package/dist/lib/update.d.ts +8 -0
- package/dist/lib/update.js +20 -0
- package/dist/lib/update.js.map +7 -0
- package/dist/lib/util/get-2d-context.d.ts +2 -0
- package/dist/lib/util/get-2d-context.js +11 -0
- package/dist/lib/util/get-2d-context.js.map +7 -0
- package/dist/lib/util/get-mouse-coordinates.d.ts +2 -0
- package/dist/lib/util/get-mouse-coordinates.js +32 -0
- package/dist/lib/util/get-mouse-coordinates.js.map +7 -0
- package/dist/lib/util/is-hit.d.ts +11 -0
- package/dist/lib/util/is-hit.js +52 -0
- package/dist/lib/util/is-hit.js.map +7 -0
- package/dist/lib/util/is-transparent.d.ts +1 -0
- package/dist/lib/util/is-transparent.js +8 -0
- package/dist/lib/util/is-transparent.js.map +7 -0
- package/dist/lib/util/pixel-grid-adjustments.d.ts +8 -0
- package/dist/lib/util/pixel-grid-adjustments.js +28 -0
- package/dist/lib/util/pixel-grid-adjustments.js.map +7 -0
- package/dist/lib/util/push-clipping-path.d.ts +6 -0
- package/dist/lib/util/push-clipping-path.js +28 -0
- package/dist/lib/util/push-clipping-path.js.map +7 -0
- package/dist/lib/util/wire-common-events.d.ts +2 -0
- package/dist/lib/util/wire-common-events.js +15 -0
- package/dist/lib/util/wire-common-events.js.map +7 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +7 -0
- package/dist/types.mjs +1 -0
- package/package.json +149 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { transformPointInto } from "../math.js";
|
|
2
|
+
import { GEOMETRY_EPSILON } from "../numeric-policy.js";
|
|
3
|
+
function createPrivateManifold2D(distance, first, firstPose, second, secondPose) {
|
|
4
|
+
const firstVertices = polygonVertices(
|
|
5
|
+
first,
|
|
6
|
+
firstPose,
|
|
7
|
+
distance.normalX,
|
|
8
|
+
distance.normalY
|
|
9
|
+
);
|
|
10
|
+
const secondVertices = polygonVertices(
|
|
11
|
+
second,
|
|
12
|
+
secondPose,
|
|
13
|
+
distance.normalX,
|
|
14
|
+
distance.normalY
|
|
15
|
+
);
|
|
16
|
+
let points;
|
|
17
|
+
if (firstVertices !== null && secondVertices !== null) {
|
|
18
|
+
points = faceContactPoints(distance, firstVertices, secondVertices);
|
|
19
|
+
} else {
|
|
20
|
+
points = [
|
|
21
|
+
{
|
|
22
|
+
firstX: distance.firstX,
|
|
23
|
+
firstY: distance.firstY,
|
|
24
|
+
secondX: distance.secondX,
|
|
25
|
+
secondY: distance.secondY,
|
|
26
|
+
separation: distance.separation,
|
|
27
|
+
firstFeature: distance.firstFeature,
|
|
28
|
+
secondFeature: distance.secondFeature
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
normalX: distance.normalX,
|
|
34
|
+
normalY: distance.normalY,
|
|
35
|
+
firstLeaf: distance.firstLeaf,
|
|
36
|
+
secondLeaf: distance.secondLeaf,
|
|
37
|
+
points
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function publicContactFromManifold2D(manifold) {
|
|
41
|
+
const normal = freezeVector(manifold.normalX, manifold.normalY);
|
|
42
|
+
const points = manifold.points.map(
|
|
43
|
+
(point) => Object.freeze({
|
|
44
|
+
pointOnFirst: freezeVector(point.firstX, point.firstY),
|
|
45
|
+
pointOnSecond: freezeVector(point.secondX, point.secondY),
|
|
46
|
+
separation: cleanZero(point.separation)
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
return Object.freeze({ normal, points: Object.freeze(points) });
|
|
50
|
+
}
|
|
51
|
+
function faceContactPoints(distance, firstVertices, secondVertices) {
|
|
52
|
+
const firstFace = supportingFace(
|
|
53
|
+
firstVertices,
|
|
54
|
+
-distance.normalX,
|
|
55
|
+
-distance.normalY
|
|
56
|
+
);
|
|
57
|
+
const secondFace = supportingFace(
|
|
58
|
+
secondVertices,
|
|
59
|
+
distance.normalX,
|
|
60
|
+
distance.normalY
|
|
61
|
+
);
|
|
62
|
+
const firstAlignment = -(firstFace.normalX * distance.normalX + firstFace.normalY * distance.normalY);
|
|
63
|
+
const secondAlignment = secondFace.normalX * distance.normalX + secondFace.normalY * distance.normalY;
|
|
64
|
+
const firstIsReference = firstAlignment >= secondAlignment - GEOMETRY_EPSILON;
|
|
65
|
+
const reference = firstIsReference ? firstFace : secondFace;
|
|
66
|
+
const incident = firstIsReference ? secondFace : firstFace;
|
|
67
|
+
const referenceTangentX = reference.endX - reference.startX;
|
|
68
|
+
const referenceTangentY = reference.endY - reference.startY;
|
|
69
|
+
const referenceLength = Math.hypot(referenceTangentX, referenceTangentY);
|
|
70
|
+
if (referenceLength <= GEOMETRY_EPSILON) return fallbackPoint(distance);
|
|
71
|
+
const tangentX = referenceTangentX / referenceLength;
|
|
72
|
+
const tangentY = referenceTangentY / referenceLength;
|
|
73
|
+
const minimum = reference.startX * tangentX + reference.startY * tangentY;
|
|
74
|
+
const maximum = reference.endX * tangentX + reference.endY * tangentY;
|
|
75
|
+
let clipped = clipSegment(
|
|
76
|
+
[incident.startX, incident.startY, incident.endX, incident.endY],
|
|
77
|
+
tangentX,
|
|
78
|
+
tangentY,
|
|
79
|
+
Math.min(minimum, maximum),
|
|
80
|
+
true
|
|
81
|
+
);
|
|
82
|
+
if (clipped === null) return fallbackPoint(distance);
|
|
83
|
+
clipped = clipSegment(
|
|
84
|
+
clipped,
|
|
85
|
+
tangentX,
|
|
86
|
+
tangentY,
|
|
87
|
+
Math.max(minimum, maximum),
|
|
88
|
+
false
|
|
89
|
+
);
|
|
90
|
+
if (clipped === null) return fallbackPoint(distance);
|
|
91
|
+
const referenceNormalX = reference.normalX;
|
|
92
|
+
const referenceNormalY = reference.normalY;
|
|
93
|
+
const points = [];
|
|
94
|
+
for (let index = 0; index < 2; index += 1) {
|
|
95
|
+
const x = clipped[index * 2];
|
|
96
|
+
const y = clipped[index * 2 + 1];
|
|
97
|
+
const separation = (x - reference.startX) * referenceNormalX + (y - reference.startY) * referenceNormalY;
|
|
98
|
+
if (separation > GEOMETRY_EPSILON) continue;
|
|
99
|
+
const projectedX = x - separation * referenceNormalX;
|
|
100
|
+
const projectedY = y - separation * referenceNormalY;
|
|
101
|
+
points.push(
|
|
102
|
+
firstIsReference ? {
|
|
103
|
+
firstX: projectedX,
|
|
104
|
+
firstY: projectedY,
|
|
105
|
+
secondX: x,
|
|
106
|
+
secondY: y,
|
|
107
|
+
separation,
|
|
108
|
+
firstFeature: reference.index,
|
|
109
|
+
secondFeature: incident.index * 2 + index
|
|
110
|
+
} : {
|
|
111
|
+
firstX: x,
|
|
112
|
+
firstY: y,
|
|
113
|
+
secondX: projectedX,
|
|
114
|
+
secondY: projectedY,
|
|
115
|
+
separation,
|
|
116
|
+
firstFeature: incident.index * 2 + index,
|
|
117
|
+
secondFeature: reference.index
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
if (points.length === 0) return fallbackPoint(distance);
|
|
122
|
+
const publicTangentX = -distance.normalY;
|
|
123
|
+
const publicTangentY = distance.normalX;
|
|
124
|
+
points.sort((first, second) => {
|
|
125
|
+
const projectionDifference = first.firstX * publicTangentX + first.firstY * publicTangentY - (second.firstX * publicTangentX + second.firstY * publicTangentY);
|
|
126
|
+
if (Math.abs(projectionDifference) > GEOMETRY_EPSILON)
|
|
127
|
+
return projectionDifference;
|
|
128
|
+
return first.firstFeature - second.firstFeature || first.secondFeature - second.secondFeature;
|
|
129
|
+
});
|
|
130
|
+
return points.slice(0, 2);
|
|
131
|
+
}
|
|
132
|
+
function supportingFace(vertices, directionX, directionY) {
|
|
133
|
+
let selected = null;
|
|
134
|
+
let selectedAlignment = Number.NEGATIVE_INFINITY;
|
|
135
|
+
const count = vertices.length / 2;
|
|
136
|
+
for (let index = 0; index < count; index += 1) {
|
|
137
|
+
const next = (index + 1) % count;
|
|
138
|
+
const startX = vertices[index * 2];
|
|
139
|
+
const startY = vertices[index * 2 + 1];
|
|
140
|
+
const endX = vertices[next * 2];
|
|
141
|
+
const endY = vertices[next * 2 + 1];
|
|
142
|
+
const edgeX = endX - startX;
|
|
143
|
+
const edgeY = endY - startY;
|
|
144
|
+
const length = Math.hypot(edgeX, edgeY);
|
|
145
|
+
if (length <= GEOMETRY_EPSILON) continue;
|
|
146
|
+
const normalX = edgeY / length;
|
|
147
|
+
const normalY = -edgeX / length;
|
|
148
|
+
const alignment = normalX * directionX + normalY * directionY;
|
|
149
|
+
if (alignment > selectedAlignment) {
|
|
150
|
+
selectedAlignment = alignment;
|
|
151
|
+
selected = { startX, startY, endX, endY, normalX, normalY, index };
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return selected;
|
|
155
|
+
}
|
|
156
|
+
function clipSegment(segment, normalX, normalY, offset, keepGreater) {
|
|
157
|
+
const firstDistance = segment[0] * normalX + segment[1] * normalY - offset;
|
|
158
|
+
const secondDistance = segment[2] * normalX + segment[3] * normalY - offset;
|
|
159
|
+
const firstInside = keepGreater ? firstDistance >= -GEOMETRY_EPSILON : firstDistance <= GEOMETRY_EPSILON;
|
|
160
|
+
const secondInside = keepGreater ? secondDistance >= -GEOMETRY_EPSILON : secondDistance <= GEOMETRY_EPSILON;
|
|
161
|
+
if (firstInside && secondInside) return [...segment];
|
|
162
|
+
if (!firstInside && !secondInside) return null;
|
|
163
|
+
const denominator = firstDistance - secondDistance;
|
|
164
|
+
if (Math.abs(denominator) <= GEOMETRY_EPSILON) return null;
|
|
165
|
+
const amount = firstDistance / denominator;
|
|
166
|
+
const x = segment[0] + amount * (segment[2] - segment[0]);
|
|
167
|
+
const y = segment[1] + amount * (segment[3] - segment[1]);
|
|
168
|
+
return firstInside ? [segment[0], segment[1], x, y] : [x, y, segment[2], segment[3]];
|
|
169
|
+
}
|
|
170
|
+
function fallbackPoint(distance) {
|
|
171
|
+
return [
|
|
172
|
+
{
|
|
173
|
+
firstX: distance.firstX,
|
|
174
|
+
firstY: distance.firstY,
|
|
175
|
+
secondX: distance.secondX,
|
|
176
|
+
secondY: distance.secondY,
|
|
177
|
+
separation: distance.separation,
|
|
178
|
+
firstFeature: distance.firstFeature,
|
|
179
|
+
secondFeature: distance.secondFeature
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
function polygonVertices(leaf, pose, normalX, normalY) {
|
|
184
|
+
let local;
|
|
185
|
+
if (leaf.kind === "box") {
|
|
186
|
+
local = [
|
|
187
|
+
leaf.center[0] - leaf.halfWidth,
|
|
188
|
+
leaf.center[1] - leaf.halfHeight,
|
|
189
|
+
leaf.center[0] + leaf.halfWidth,
|
|
190
|
+
leaf.center[1] - leaf.halfHeight,
|
|
191
|
+
leaf.center[0] + leaf.halfWidth,
|
|
192
|
+
leaf.center[1] + leaf.halfHeight,
|
|
193
|
+
leaf.center[0] - leaf.halfWidth,
|
|
194
|
+
leaf.center[1] + leaf.halfHeight
|
|
195
|
+
];
|
|
196
|
+
} else if (leaf.kind === "capsule") {
|
|
197
|
+
const dx = leaf.end[0] - leaf.start[0], dy = leaf.end[1] - leaf.start[1];
|
|
198
|
+
const length = Math.hypot(dx, dy);
|
|
199
|
+
if (length <= GEOMETRY_EPSILON) return null;
|
|
200
|
+
const cosine = Math.cos(pose.rotationRadians), sine = Math.sin(pose.rotationRadians);
|
|
201
|
+
const localNormalX = cosine * normalX + sine * normalY;
|
|
202
|
+
const localNormalY = -sine * normalX + cosine * normalY;
|
|
203
|
+
if (Math.abs(dx * localNormalX + dy * localNormalY) > length * 0.95)
|
|
204
|
+
return null;
|
|
205
|
+
const sign = dx * localNormalY - dy * localNormalX >= 0 ? 1 : -1;
|
|
206
|
+
const nx = sign * localNormalX * leaf.radius, ny = sign * localNormalY * leaf.radius;
|
|
207
|
+
local = [
|
|
208
|
+
leaf.start[0] - nx,
|
|
209
|
+
leaf.start[1] - ny,
|
|
210
|
+
leaf.end[0] - nx,
|
|
211
|
+
leaf.end[1] - ny,
|
|
212
|
+
leaf.end[0] + nx,
|
|
213
|
+
leaf.end[1] + ny,
|
|
214
|
+
leaf.start[0] + nx,
|
|
215
|
+
leaf.start[1] + ny
|
|
216
|
+
];
|
|
217
|
+
} else if (leaf.kind === "polygon") {
|
|
218
|
+
local = leaf.vertices;
|
|
219
|
+
} else {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
const result = new Float64Array(local.length);
|
|
223
|
+
for (let index = 0; index < local.length; index += 2) {
|
|
224
|
+
transformPointInto(result, index, local[index], local[index + 1], pose);
|
|
225
|
+
}
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
function freezeVector(x, y) {
|
|
229
|
+
return Object.freeze([cleanZero(x), cleanZero(y)]);
|
|
230
|
+
}
|
|
231
|
+
function cleanZero(value) {
|
|
232
|
+
return Object.is(value, -0) || Math.abs(value) <= Number.EPSILON ? 0 : value;
|
|
233
|
+
}
|
|
234
|
+
export {
|
|
235
|
+
createPrivateManifold2D,
|
|
236
|
+
publicContactFromManifold2D
|
|
237
|
+
};
|
|
238
|
+
//# sourceMappingURL=manifold.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/features/physics/lib/2d/collision/manifold.ts"],
|
|
4
|
+
"sourcesContent": ["import type { PibblPhysicsShapeContact2D } from \"../../../2d-geometry.js\";\nimport { transformPointInto, type InternalPose2D } from \"../math.js\";\nimport { GEOMETRY_EPSILON } from \"../numeric-policy.js\";\nimport type { ConvexLeaf2D } from \"../shape-records.js\";\n\nexport interface PrivatePairDistance2D {\n readonly separation: number;\n readonly firstX: number;\n readonly firstY: number;\n readonly secondX: number;\n readonly secondY: number;\n readonly normalX: number;\n readonly normalY: number;\n readonly firstFeature: number;\n readonly secondFeature: number;\n readonly firstLeaf: number;\n readonly secondLeaf: number;\n}\n\ninterface PrivateManifoldPoint2D {\n readonly firstX: number;\n readonly firstY: number;\n readonly secondX: number;\n readonly secondY: number;\n readonly separation: number;\n readonly firstFeature: number;\n readonly secondFeature: number;\n}\n\nexport interface PrivateManifold2D {\n readonly normalX: number;\n readonly normalY: number;\n readonly firstLeaf: number;\n readonly secondLeaf: number;\n readonly points: readonly PrivateManifoldPoint2D[];\n}\n\nexport function createPrivateManifold2D(\n distance: PrivatePairDistance2D,\n first: ConvexLeaf2D,\n firstPose: InternalPose2D,\n second: ConvexLeaf2D,\n secondPose: InternalPose2D,\n): PrivateManifold2D {\n const firstVertices = polygonVertices(\n first,\n firstPose,\n distance.normalX,\n distance.normalY,\n );\n const secondVertices = polygonVertices(\n second,\n secondPose,\n distance.normalX,\n distance.normalY,\n );\n let points: readonly PrivateManifoldPoint2D[];\n if (firstVertices !== null && secondVertices !== null) {\n points = faceContactPoints(distance, firstVertices, secondVertices);\n } else {\n points = [\n {\n firstX: distance.firstX,\n firstY: distance.firstY,\n secondX: distance.secondX,\n secondY: distance.secondY,\n separation: distance.separation,\n firstFeature: distance.firstFeature,\n secondFeature: distance.secondFeature,\n },\n ];\n }\n return {\n normalX: distance.normalX,\n normalY: distance.normalY,\n firstLeaf: distance.firstLeaf,\n secondLeaf: distance.secondLeaf,\n points,\n };\n}\n\nexport function publicContactFromManifold2D(\n manifold: PrivateManifold2D,\n): PibblPhysicsShapeContact2D {\n const normal = freezeVector(manifold.normalX, manifold.normalY);\n const points = manifold.points.map((point) =>\n Object.freeze({\n pointOnFirst: freezeVector(point.firstX, point.firstY),\n pointOnSecond: freezeVector(point.secondX, point.secondY),\n separation: cleanZero(point.separation),\n }),\n );\n return Object.freeze({ normal, points: Object.freeze(points) });\n}\n\nfunction faceContactPoints(\n distance: PrivatePairDistance2D,\n firstVertices: Float64Array,\n secondVertices: Float64Array,\n): readonly PrivateManifoldPoint2D[] {\n const firstFace = supportingFace(\n firstVertices,\n -distance.normalX,\n -distance.normalY,\n );\n const secondFace = supportingFace(\n secondVertices,\n distance.normalX,\n distance.normalY,\n );\n const firstAlignment = -(\n firstFace.normalX * distance.normalX +\n firstFace.normalY * distance.normalY\n );\n const secondAlignment =\n secondFace.normalX * distance.normalX +\n secondFace.normalY * distance.normalY;\n const firstIsReference = firstAlignment >= secondAlignment - GEOMETRY_EPSILON;\n const reference = firstIsReference ? firstFace : secondFace;\n const incident = firstIsReference ? secondFace : firstFace;\n const referenceTangentX = reference.endX - reference.startX;\n const referenceTangentY = reference.endY - reference.startY;\n const referenceLength = Math.hypot(referenceTangentX, referenceTangentY);\n if (referenceLength <= GEOMETRY_EPSILON) return fallbackPoint(distance);\n const tangentX = referenceTangentX / referenceLength;\n const tangentY = referenceTangentY / referenceLength;\n const minimum = reference.startX * tangentX + reference.startY * tangentY;\n const maximum = reference.endX * tangentX + reference.endY * tangentY;\n let clipped = clipSegment(\n [incident.startX, incident.startY, incident.endX, incident.endY],\n tangentX,\n tangentY,\n Math.min(minimum, maximum),\n true,\n );\n if (clipped === null) return fallbackPoint(distance);\n clipped = clipSegment(\n clipped,\n tangentX,\n tangentY,\n Math.max(minimum, maximum),\n false,\n );\n if (clipped === null) return fallbackPoint(distance);\n const referenceNormalX = reference.normalX;\n const referenceNormalY = reference.normalY;\n const points: PrivateManifoldPoint2D[] = [];\n for (let index = 0; index < 2; index += 1) {\n const x = clipped[index * 2]!;\n const y = clipped[index * 2 + 1]!;\n const separation =\n (x - reference.startX) * referenceNormalX +\n (y - reference.startY) * referenceNormalY;\n if (separation > GEOMETRY_EPSILON) continue;\n const projectedX = x - separation * referenceNormalX;\n const projectedY = y - separation * referenceNormalY;\n points.push(\n firstIsReference\n ? {\n firstX: projectedX,\n firstY: projectedY,\n secondX: x,\n secondY: y,\n separation,\n firstFeature: reference.index,\n secondFeature: incident.index * 2 + index,\n }\n : {\n firstX: x,\n firstY: y,\n secondX: projectedX,\n secondY: projectedY,\n separation,\n firstFeature: incident.index * 2 + index,\n secondFeature: reference.index,\n },\n );\n }\n if (points.length === 0) return fallbackPoint(distance);\n const publicTangentX = -distance.normalY;\n const publicTangentY = distance.normalX;\n points.sort((first, second) => {\n const projectionDifference =\n first.firstX * publicTangentX +\n first.firstY * publicTangentY -\n (second.firstX * publicTangentX + second.firstY * publicTangentY);\n if (Math.abs(projectionDifference) > GEOMETRY_EPSILON)\n return projectionDifference;\n return (\n first.firstFeature - second.firstFeature ||\n first.secondFeature - second.secondFeature\n );\n });\n return points.slice(0, 2);\n}\n\ninterface Face2D {\n readonly startX: number;\n readonly startY: number;\n readonly endX: number;\n readonly endY: number;\n readonly normalX: number;\n readonly normalY: number;\n readonly index: number;\n}\n\nfunction supportingFace(\n vertices: Float64Array,\n directionX: number,\n directionY: number,\n): Face2D {\n let selected: Face2D | null = null;\n let selectedAlignment = Number.NEGATIVE_INFINITY;\n const count = vertices.length / 2;\n for (let index = 0; index < count; index += 1) {\n const next = (index + 1) % count;\n const startX = vertices[index * 2]!;\n const startY = vertices[index * 2 + 1]!;\n const endX = vertices[next * 2]!;\n const endY = vertices[next * 2 + 1]!;\n const edgeX = endX - startX;\n const edgeY = endY - startY;\n const length = Math.hypot(edgeX, edgeY);\n if (length <= GEOMETRY_EPSILON) continue;\n const normalX = edgeY / length;\n const normalY = -edgeX / length;\n const alignment = normalX * directionX + normalY * directionY;\n if (alignment > selectedAlignment) {\n selectedAlignment = alignment;\n selected = { startX, startY, endX, endY, normalX, normalY, index };\n }\n }\n return selected!;\n}\n\nfunction clipSegment(\n segment: readonly [number, number, number, number],\n normalX: number,\n normalY: number,\n offset: number,\n keepGreater: boolean,\n): [number, number, number, number] | null {\n const firstDistance = segment[0] * normalX + segment[1] * normalY - offset;\n const secondDistance = segment[2] * normalX + segment[3] * normalY - offset;\n const firstInside = keepGreater\n ? firstDistance >= -GEOMETRY_EPSILON\n : firstDistance <= GEOMETRY_EPSILON;\n const secondInside = keepGreater\n ? secondDistance >= -GEOMETRY_EPSILON\n : secondDistance <= GEOMETRY_EPSILON;\n if (firstInside && secondInside) return [...segment];\n if (!firstInside && !secondInside) return null;\n const denominator = firstDistance - secondDistance;\n if (Math.abs(denominator) <= GEOMETRY_EPSILON) return null;\n const amount = firstDistance / denominator;\n const x = segment[0] + amount * (segment[2] - segment[0]);\n const y = segment[1] + amount * (segment[3] - segment[1]);\n return firstInside\n ? [segment[0], segment[1], x, y]\n : [x, y, segment[2], segment[3]];\n}\n\nfunction fallbackPoint(\n distance: PrivatePairDistance2D,\n): readonly PrivateManifoldPoint2D[] {\n return [\n {\n firstX: distance.firstX,\n firstY: distance.firstY,\n secondX: distance.secondX,\n secondY: distance.secondY,\n separation: distance.separation,\n firstFeature: distance.firstFeature,\n secondFeature: distance.secondFeature,\n },\n ];\n}\n\nfunction polygonVertices(\n leaf: ConvexLeaf2D,\n pose: InternalPose2D,\n normalX: number,\n normalY: number,\n): Float64Array | null {\n let local: Float64Array | readonly number[];\n if (leaf.kind === \"box\") {\n local = [\n leaf.center[0]! - leaf.halfWidth,\n leaf.center[1]! - leaf.halfHeight,\n leaf.center[0]! + leaf.halfWidth,\n leaf.center[1]! - leaf.halfHeight,\n leaf.center[0]! + leaf.halfWidth,\n leaf.center[1]! + leaf.halfHeight,\n leaf.center[0]! - leaf.halfWidth,\n leaf.center[1]! + leaf.halfHeight,\n ];\n } else if (leaf.kind === \"capsule\") {\n const dx = leaf.end[0]! - leaf.start[0]!,\n dy = leaf.end[1]! - leaf.start[1]!;\n const length = Math.hypot(dx, dy);\n if (length <= GEOMETRY_EPSILON) return null;\n const cosine = Math.cos(pose.rotationRadians),\n sine = Math.sin(pose.rotationRadians);\n // Keep the two endpoint supports while a capsule rests across a face.\n // Near an axial impact the round end retains its single witness.\n const localNormalX = cosine * normalX + sine * normalY;\n const localNormalY = -sine * normalX + cosine * normalY;\n if (Math.abs(dx * localNormalX + dy * localNormalY) > length * 0.95)\n return null;\n const sign = dx * localNormalY - dy * localNormalX >= 0 ? 1 : -1;\n const nx = sign * localNormalX * leaf.radius,\n ny = sign * localNormalY * leaf.radius;\n local = [\n leaf.start[0]! - nx,\n leaf.start[1]! - ny,\n leaf.end[0]! - nx,\n leaf.end[1]! - ny,\n leaf.end[0]! + nx,\n leaf.end[1]! + ny,\n leaf.start[0]! + nx,\n leaf.start[1]! + ny,\n ];\n } else if (leaf.kind === \"polygon\") {\n local = leaf.vertices;\n } else {\n return null;\n }\n const result = new Float64Array(local.length);\n for (let index = 0; index < local.length; index += 2) {\n transformPointInto(result, index, local[index]!, local[index + 1]!, pose);\n }\n return result;\n}\n\nfunction freezeVector(x: number, y: number): readonly [number, number] {\n return Object.freeze([cleanZero(x), cleanZero(y)] as const);\n}\n\nfunction cleanZero(value: number): number {\n return Object.is(value, -0) || Math.abs(value) <= Number.EPSILON ? 0 : value;\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,0BAA+C;AACxD,SAAS,wBAAwB;AAmC1B,SAAS,wBACd,UACA,OACA,WACA,QACA,YACmB;AACnB,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACA,QAAM,iBAAiB;AAAA,IACrB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACA,MAAI;AACJ,MAAI,kBAAkB,QAAQ,mBAAmB,MAAM;AACrD,aAAS,kBAAkB,UAAU,eAAe,cAAc;A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ACA,QAAM,SAAS,IAAI,aAAa,MAAM,MAAM;AAC5C,WAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG;AACpD,uBAAmB,QAAQ,OAAO,MAAM,KAAK,GAAI,MAAM,QAAQ,CAAC,GAAI,IAAI;AAAA,EAC1E;AACA,SAAO;AACT;AAEA,SAAS,aAAa,GAAW,GAAsC;AACrE,SAAO,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC,CAAU;AAC5D;AAEA,SAAS,UAAU,OAAuB;AACxC,SAAO,OAAO,GAAG,OAAO,EAAE,KAAK,KAAK,IAAI,KAAK,KAAK,OAAO,UAAU,IAAI;AACzE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PibblPhysicsDistance2D, PibblPhysicsPose2D, PibblPhysicsShape2D, PibblPhysicsShapeContact2D, PibblPhysicsVector2 } from '../../../2d-geometry.js';
|
|
2
|
+
import { type InternalPose2D } from '../math.js';
|
|
3
|
+
import { type ShapeRecord2D } from '../shape-records.js';
|
|
4
|
+
import { type PrivateManifold2D } from './manifold.js';
|
|
5
|
+
export declare function containsPointInShape2D(shape: PibblPhysicsShape2D, pose: PibblPhysicsPose2D, point: PibblPhysicsVector2): boolean;
|
|
6
|
+
export declare function distanceBetweenPreparedShapes2D(firstShape: PibblPhysicsShape2D, firstPose: PibblPhysicsPose2D, secondShape: PibblPhysicsShape2D, secondPose: PibblPhysicsPose2D): PibblPhysicsDistance2D;
|
|
7
|
+
export declare function overlapPreparedShapes2D(firstShape: PibblPhysicsShape2D, firstPose: PibblPhysicsPose2D, secondShape: PibblPhysicsShape2D, secondPose: PibblPhysicsPose2D): boolean;
|
|
8
|
+
export declare function contactBetweenPreparedShapes2D(firstShape: PibblPhysicsShape2D, firstPose: PibblPhysicsPose2D, secondShape: PibblPhysicsShape2D, secondPose: PibblPhysicsPose2D): PibblPhysicsShapeContact2D | null;
|
|
9
|
+
/** Package-private world/cache seam. Not exported from a package entry. */
|
|
10
|
+
export declare function manifoldBetweenShapeRecords2D(firstRecord: ShapeRecord2D, firstPose: InternalPose2D, firstOrder: number, secondRecord: ShapeRecord2D, secondPose: InternalPose2D, secondOrder: number): PrivateManifold2D | null;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { copyFiniteVector2 } from "../../shared/validation.js";
|
|
2
|
+
import { composePose2D, copyPose2D, transformPointInto } from "../math.js";
|
|
3
|
+
import { GEOMETRY_EPSILON } from "../numeric-policy.js";
|
|
4
|
+
import { requireShapeRecord2D } from "../shape-records.js";
|
|
5
|
+
import { distanceCapsuleToCapsule2D, distancePointToSegment2D } from "./analytic.js";
|
|
6
|
+
import { epaConvexLeaves2D } from "./epa.js";
|
|
7
|
+
import { gjkConvexLeaves2D } from "./gjk.js";
|
|
8
|
+
import {
|
|
9
|
+
createPrivateManifold2D,
|
|
10
|
+
publicContactFromManifold2D
|
|
11
|
+
} from "./manifold.js";
|
|
12
|
+
import { centerOfLeaf2D } from "./support.js";
|
|
13
|
+
const shapeOrders = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
let nextShapeOrder = 0;
|
|
15
|
+
function containsPointInShape2D(shape, pose, point) {
|
|
16
|
+
const prepared = prepareShape(shape, pose, "shape", "pose");
|
|
17
|
+
const copiedPoint = copyFiniteVector2(point, "point");
|
|
18
|
+
return prepared.record.leaves.some(
|
|
19
|
+
(leaf) => containsPointInLeaf(leaf, prepared.pose, copiedPoint[0], copiedPoint[1])
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function distanceBetweenPreparedShapes2D(firstShape, firstPose, secondShape, secondPose) {
|
|
23
|
+
const result = collidePreparedShapes(firstShape, firstPose, secondShape, secondPose);
|
|
24
|
+
if (result.status === "failed") {
|
|
25
|
+
throw new Error("2D collision distance did not converge within its fixed iteration bounds.");
|
|
26
|
+
}
|
|
27
|
+
return publicDistance(result.distance);
|
|
28
|
+
}
|
|
29
|
+
function overlapPreparedShapes2D(firstShape, firstPose, secondShape, secondPose) {
|
|
30
|
+
const result = collidePreparedShapes(firstShape, firstPose, secondShape, secondPose);
|
|
31
|
+
return result.status === "success" && result.distance.separation <= 0;
|
|
32
|
+
}
|
|
33
|
+
function contactBetweenPreparedShapes2D(firstShape, firstPose, secondShape, secondPose) {
|
|
34
|
+
const result = collidePreparedShapes(firstShape, firstPose, secondShape, secondPose);
|
|
35
|
+
if (result.status === "failed" || result.distance.separation > 0) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return publicContactFromManifold2D(
|
|
39
|
+
createPrivateManifold2D(result.distance, result.first, result.firstPose, result.second, result.secondPose)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
function manifoldBetweenShapeRecords2D(firstRecord, firstPose, firstOrder, secondRecord, secondPose, secondOrder) {
|
|
43
|
+
const result = collideShapeRecords(
|
|
44
|
+
prepareShapeRecord(firstRecord, firstPose, firstOrder),
|
|
45
|
+
prepareShapeRecord(secondRecord, secondPose, secondOrder)
|
|
46
|
+
);
|
|
47
|
+
if (result.status === "failed" || result.distance.separation > 0) return null;
|
|
48
|
+
return createPrivateManifold2D(result.distance, result.first, result.firstPose, result.second, result.secondPose);
|
|
49
|
+
}
|
|
50
|
+
function collidePreparedShapes(firstShape, firstPublicPose, secondShape, secondPublicPose) {
|
|
51
|
+
const first = prepareShape(firstShape, firstPublicPose, "first", "firstPose");
|
|
52
|
+
const second = prepareShape(secondShape, secondPublicPose, "second", "secondPose");
|
|
53
|
+
return collideShapeRecords(first, second);
|
|
54
|
+
}
|
|
55
|
+
function collideShapeRecords(first, second) {
|
|
56
|
+
let selected = null;
|
|
57
|
+
let failures = 0;
|
|
58
|
+
for (const firstLeaf of first.record.leaves) {
|
|
59
|
+
for (const secondLeaf of second.record.leaves) {
|
|
60
|
+
const distance = distanceBetweenLeaves(firstLeaf, first.pose, secondLeaf, second.pose, first, second);
|
|
61
|
+
if (distance === null) {
|
|
62
|
+
failures += 1;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const candidate = {
|
|
66
|
+
status: "success",
|
|
67
|
+
distance,
|
|
68
|
+
first: firstLeaf,
|
|
69
|
+
firstPose: first.pose,
|
|
70
|
+
second: secondLeaf,
|
|
71
|
+
secondPose: second.pose
|
|
72
|
+
};
|
|
73
|
+
if (selected === null || comparePairCandidates(candidate, selected, first.order, second.order) < 0) {
|
|
74
|
+
selected = candidate;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (selected === null || failures > 0 && selected.distance.separation > GEOMETRY_EPSILON) {
|
|
79
|
+
return { status: "failed" };
|
|
80
|
+
}
|
|
81
|
+
return selected;
|
|
82
|
+
}
|
|
83
|
+
function distanceBetweenLeaves(first, firstPose, second, secondPose, firstShape, secondShape) {
|
|
84
|
+
const fallback = preferredNormal(first, firstPose, second, secondPose, firstShape, secondShape);
|
|
85
|
+
const firstRound = roundSpine(first, firstPose);
|
|
86
|
+
const secondRound = roundSpine(second, secondPose);
|
|
87
|
+
if (firstRound !== null && secondRound !== null) {
|
|
88
|
+
const result = distanceCapsuleToCapsule2D(
|
|
89
|
+
firstRound.startX,
|
|
90
|
+
firstRound.startY,
|
|
91
|
+
firstRound.endX,
|
|
92
|
+
firstRound.endY,
|
|
93
|
+
firstRound.radius,
|
|
94
|
+
secondRound.startX,
|
|
95
|
+
secondRound.startY,
|
|
96
|
+
secondRound.endX,
|
|
97
|
+
secondRound.endY,
|
|
98
|
+
secondRound.radius,
|
|
99
|
+
fallback[0],
|
|
100
|
+
fallback[1]
|
|
101
|
+
);
|
|
102
|
+
return {
|
|
103
|
+
...result,
|
|
104
|
+
firstFeature: 0,
|
|
105
|
+
secondFeature: 0,
|
|
106
|
+
firstLeaf: first.canonicalLeafIndex,
|
|
107
|
+
secondLeaf: second.canonicalLeafIndex
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const gjk = gjkConvexLeaves2D(first, firstPose, second, secondPose, fallback[0], fallback[1]);
|
|
111
|
+
if (gjk.status === "failed") return null;
|
|
112
|
+
if (gjk.status === "penetrating") {
|
|
113
|
+
const epa = epaConvexLeaves2D(first, firstPose, second, secondPose, gjk.simplex);
|
|
114
|
+
if (epa.status === "failed") return null;
|
|
115
|
+
return {
|
|
116
|
+
...epa,
|
|
117
|
+
firstLeaf: first.canonicalLeafIndex,
|
|
118
|
+
secondLeaf: second.canonicalLeafIndex
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const normalLength = Math.hypot(gjk.normalX, gjk.normalY);
|
|
122
|
+
return {
|
|
123
|
+
separation: gjk.separation,
|
|
124
|
+
firstX: gjk.firstX,
|
|
125
|
+
firstY: gjk.firstY,
|
|
126
|
+
secondX: gjk.secondX,
|
|
127
|
+
secondY: gjk.secondY,
|
|
128
|
+
normalX: normalLength > GEOMETRY_EPSILON ? gjk.normalX : fallback[0],
|
|
129
|
+
normalY: normalLength > GEOMETRY_EPSILON ? gjk.normalY : fallback[1],
|
|
130
|
+
firstFeature: gjk.firstFeature,
|
|
131
|
+
secondFeature: gjk.secondFeature,
|
|
132
|
+
firstLeaf: first.canonicalLeafIndex,
|
|
133
|
+
secondLeaf: second.canonicalLeafIndex
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function prepareShape(shell, publicPose, shapePath, posePath) {
|
|
137
|
+
const record = requireShapeRecord2D(shell);
|
|
138
|
+
const pose = composePose2D(copyPose2D(publicPose, posePath), record.localPose);
|
|
139
|
+
return { record, pose, order: shapeOrder(shell, shapePath) };
|
|
140
|
+
}
|
|
141
|
+
function prepareShapeRecord(record, outerPose, order) {
|
|
142
|
+
return {
|
|
143
|
+
record,
|
|
144
|
+
pose: composePose2D(outerPose, record.localPose),
|
|
145
|
+
order
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function shapeOrder(shape, _path) {
|
|
149
|
+
const object = shape;
|
|
150
|
+
const existing = shapeOrders.get(object);
|
|
151
|
+
if (existing !== void 0) return existing;
|
|
152
|
+
const order = nextShapeOrder;
|
|
153
|
+
nextShapeOrder += 1;
|
|
154
|
+
shapeOrders.set(object, order);
|
|
155
|
+
return order;
|
|
156
|
+
}
|
|
157
|
+
function preferredNormal(first, firstPose, second, secondPose, firstShape, secondShape) {
|
|
158
|
+
const centers = new Float64Array(4);
|
|
159
|
+
centerOfLeaf2D(centers, 0, first, firstPose);
|
|
160
|
+
centerOfLeaf2D(centers, 2, second, secondPose);
|
|
161
|
+
const dx = centers[0] - centers[2];
|
|
162
|
+
const dy = centers[1] - centers[3];
|
|
163
|
+
const length = Math.hypot(dx, dy);
|
|
164
|
+
if (length > GEOMETRY_EPSILON) return [dx / length, dy / length];
|
|
165
|
+
return firstShape.order <= secondShape.order ? [1, 0] : [-1, 0];
|
|
166
|
+
}
|
|
167
|
+
function containsPointInLeaf(leaf, pose, pointX, pointY) {
|
|
168
|
+
const local = inversePoint(pointX, pointY, pose);
|
|
169
|
+
switch (leaf.kind) {
|
|
170
|
+
case "circle":
|
|
171
|
+
return Math.hypot(local[0] - leaf.center[0], local[1] - leaf.center[1]) <= leaf.radius + GEOMETRY_EPSILON;
|
|
172
|
+
case "ellipse": {
|
|
173
|
+
const dx = local[0] - leaf.center[0];
|
|
174
|
+
const dy = local[1] - leaf.center[1];
|
|
175
|
+
const cosine = Math.cos(leaf.rotationRadians);
|
|
176
|
+
const sine = Math.sin(leaf.rotationRadians);
|
|
177
|
+
const x = cosine * dx + sine * dy;
|
|
178
|
+
const y = -sine * dx + cosine * dy;
|
|
179
|
+
return (x / leaf.radiusX) ** 2 + (y / leaf.radiusY) ** 2 <= 1 + GEOMETRY_EPSILON;
|
|
180
|
+
}
|
|
181
|
+
case "box":
|
|
182
|
+
return Math.abs(local[0] - leaf.center[0]) <= leaf.halfWidth + GEOMETRY_EPSILON && Math.abs(local[1] - leaf.center[1]) <= leaf.halfHeight + GEOMETRY_EPSILON;
|
|
183
|
+
case "rounded-box": {
|
|
184
|
+
const dx = local[0] - leaf.center[0];
|
|
185
|
+
const dy = local[1] - leaf.center[1];
|
|
186
|
+
if (Math.abs(dx) > leaf.halfWidth + GEOMETRY_EPSILON || Math.abs(dy) > leaf.halfHeight + GEOMETRY_EPSILON)
|
|
187
|
+
return false;
|
|
188
|
+
const feature = dy < 0 ? dx < 0 ? 0 : 1 : dx < 0 ? 3 : 2;
|
|
189
|
+
const radius = leaf.radii[feature];
|
|
190
|
+
const cornerDx = Math.max(0, Math.abs(dx) - (leaf.halfWidth - radius));
|
|
191
|
+
const cornerDy = Math.max(0, Math.abs(dy) - (leaf.halfHeight - radius));
|
|
192
|
+
return cornerDx * cornerDx + cornerDy * cornerDy <= radius * radius + GEOMETRY_EPSILON;
|
|
193
|
+
}
|
|
194
|
+
case "capsule":
|
|
195
|
+
return distancePointToSegment2D(local[0], local[1], leaf.start[0], leaf.start[1], leaf.end[0], leaf.end[1]).separation <= leaf.radius + GEOMETRY_EPSILON;
|
|
196
|
+
case "segment":
|
|
197
|
+
return distancePointToSegment2D(local[0], local[1], leaf.start[0], leaf.start[1], leaf.end[0], leaf.end[1]).separation <= GEOMETRY_EPSILON;
|
|
198
|
+
case "polygon": {
|
|
199
|
+
for (let index = 0; index < leaf.vertices.length / 2; index += 1) {
|
|
200
|
+
const next = (index + 1) % (leaf.vertices.length / 2);
|
|
201
|
+
const ax = leaf.vertices[index * 2];
|
|
202
|
+
const ay = leaf.vertices[index * 2 + 1];
|
|
203
|
+
const bx = leaf.vertices[next * 2];
|
|
204
|
+
const by = leaf.vertices[next * 2 + 1];
|
|
205
|
+
if ((bx - ax) * (local[1] - ay) - (by - ay) * (local[0] - ax) < -GEOMETRY_EPSILON) return false;
|
|
206
|
+
}
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function inversePoint(x, y, pose) {
|
|
212
|
+
const dx = x - pose.x;
|
|
213
|
+
const dy = y - pose.y;
|
|
214
|
+
const cosine = Math.cos(pose.rotationRadians);
|
|
215
|
+
const sine = Math.sin(pose.rotationRadians);
|
|
216
|
+
return [cosine * dx + sine * dy, -sine * dx + cosine * dy];
|
|
217
|
+
}
|
|
218
|
+
function roundSpine(leaf, pose) {
|
|
219
|
+
const output = new Float64Array(4);
|
|
220
|
+
switch (leaf.kind) {
|
|
221
|
+
case "circle":
|
|
222
|
+
transformPointInto(output, 0, leaf.center[0], leaf.center[1], pose);
|
|
223
|
+
return {
|
|
224
|
+
startX: output[0],
|
|
225
|
+
startY: output[1],
|
|
226
|
+
endX: output[0],
|
|
227
|
+
endY: output[1],
|
|
228
|
+
radius: leaf.radius
|
|
229
|
+
};
|
|
230
|
+
case "capsule":
|
|
231
|
+
transformPointInto(output, 0, leaf.start[0], leaf.start[1], pose);
|
|
232
|
+
transformPointInto(output, 2, leaf.end[0], leaf.end[1], pose);
|
|
233
|
+
return {
|
|
234
|
+
startX: output[0],
|
|
235
|
+
startY: output[1],
|
|
236
|
+
endX: output[2],
|
|
237
|
+
endY: output[3],
|
|
238
|
+
radius: leaf.radius
|
|
239
|
+
};
|
|
240
|
+
case "segment":
|
|
241
|
+
transformPointInto(output, 0, leaf.start[0], leaf.start[1], pose);
|
|
242
|
+
transformPointInto(output, 2, leaf.end[0], leaf.end[1], pose);
|
|
243
|
+
return {
|
|
244
|
+
startX: output[0],
|
|
245
|
+
startY: output[1],
|
|
246
|
+
endX: output[2],
|
|
247
|
+
endY: output[3],
|
|
248
|
+
radius: 0
|
|
249
|
+
};
|
|
250
|
+
default:
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function comparePairCandidates(first, second, firstShapeOrder, secondShapeOrder) {
|
|
255
|
+
const separationDifference = first.distance.separation - second.distance.separation;
|
|
256
|
+
if (Math.abs(separationDifference) > GEOMETRY_EPSILON) return separationDifference;
|
|
257
|
+
const firstKey = canonicalLeafKey(first.distance, firstShapeOrder, secondShapeOrder);
|
|
258
|
+
const secondKey = canonicalLeafKey(second.distance, firstShapeOrder, secondShapeOrder);
|
|
259
|
+
return firstKey[0] - secondKey[0] || firstKey[1] - secondKey[1] || first.distance.firstFeature - second.distance.firstFeature || first.distance.secondFeature - second.distance.secondFeature;
|
|
260
|
+
}
|
|
261
|
+
function canonicalLeafKey(distance, firstShapeOrder, secondShapeOrder) {
|
|
262
|
+
return firstShapeOrder <= secondShapeOrder ? [distance.firstLeaf, distance.secondLeaf] : [distance.secondLeaf, distance.firstLeaf];
|
|
263
|
+
}
|
|
264
|
+
function publicDistance(distance) {
|
|
265
|
+
return Object.freeze({
|
|
266
|
+
separation: cleanZero(distance.separation),
|
|
267
|
+
pointOnFirst: freezeVector(distance.firstX, distance.firstY),
|
|
268
|
+
pointOnSecond: freezeVector(distance.secondX, distance.secondY),
|
|
269
|
+
normal: freezeVector(distance.normalX, distance.normalY)
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function freezeVector(x, y) {
|
|
273
|
+
return Object.freeze([cleanZero(x), cleanZero(y)]);
|
|
274
|
+
}
|
|
275
|
+
function cleanZero(value) {
|
|
276
|
+
return Object.is(value, -0) || Math.abs(value) <= Number.EPSILON ? 0 : value;
|
|
277
|
+
}
|
|
278
|
+
export {
|
|
279
|
+
contactBetweenPreparedShapes2D,
|
|
280
|
+
containsPointInShape2D,
|
|
281
|
+
distanceBetweenPreparedShapes2D,
|
|
282
|
+
manifoldBetweenShapeRecords2D,
|
|
283
|
+
overlapPreparedShapes2D
|
|
284
|
+
};
|
|
285
|
+
//# sourceMappingURL=pairs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/features/physics/lib/2d/collision/pairs.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n PibblPhysicsDistance2D,\n PibblPhysicsPose2D,\n PibblPhysicsShape2D,\n PibblPhysicsShapeContact2D,\n PibblPhysicsVector2,\n} from '../../../2d-geometry.js';\nimport { copyFiniteVector2 } from '../../shared/validation.js';\nimport { composePose2D, copyPose2D, transformPointInto, type InternalPose2D } from '../math.js';\nimport { GEOMETRY_EPSILON } from '../numeric-policy.js';\nimport { requireShapeRecord2D, type ConvexLeaf2D, type ShapeRecord2D } from '../shape-records.js';\nimport { distanceCapsuleToCapsule2D, distancePointToSegment2D } from './analytic.js';\nimport { epaConvexLeaves2D } from './epa.js';\nimport { gjkConvexLeaves2D } from './gjk.js';\nimport {\n createPrivateManifold2D,\n publicContactFromManifold2D,\n type PrivateManifold2D,\n type PrivatePairDistance2D,\n} from './manifold.js';\nimport { centerOfLeaf2D } from './support.js';\n\ninterface PreparedShape2D {\n readonly record: ShapeRecord2D;\n readonly pose: InternalPose2D;\n readonly order: number;\n}\n\ninterface FailedPair2D {\n readonly status: 'failed';\n}\n\ninterface SuccessfulPair2D {\n readonly status: 'success';\n readonly distance: PrivatePairDistance2D;\n readonly first: ConvexLeaf2D;\n readonly firstPose: InternalPose2D;\n readonly second: ConvexLeaf2D;\n readonly secondPose: InternalPose2D;\n}\n\ntype PairResult2D = FailedPair2D | SuccessfulPair2D;\n\nconst shapeOrders = new WeakMap<object, number>();\nlet nextShapeOrder = 0;\n\nexport function containsPointInShape2D(\n shape: PibblPhysicsShape2D,\n pose: PibblPhysicsPose2D,\n point: PibblPhysicsVector2,\n): boolean {\n const prepared = prepareShape(shape, pose, 'shape', 'pose');\n const copiedPoint = copyFiniteVector2(point, 'point');\n return prepared.record.leaves.some((leaf) =>\n containsPointInLeaf(leaf, prepared.pose, copiedPoint[0], copiedPoint[1]),\n );\n}\n\nexport function distanceBetweenPreparedShapes2D(\n firstShape: PibblPhysicsShape2D,\n firstPose: PibblPhysicsPose2D,\n secondShape: PibblPhysicsShape2D,\n secondPose: PibblPhysicsPose2D,\n): PibblPhysicsDistance2D {\n const result = collidePreparedShapes(firstShape, firstPose, secondShape, secondPose);\n if (result.status === 'failed') {\n throw new Error('2D collision distance did not converge within its fixed iteration bounds.');\n }\n return publicDistance(result.distance);\n}\n\nexport function overlapPreparedShapes2D(\n firstShape: PibblPhysicsShape2D,\n firstPose: PibblPhysicsPose2D,\n secondShape: PibblPhysicsShape2D,\n secondPose: PibblPhysicsPose2D,\n): boolean {\n const result = collidePreparedShapes(firstShape, firstPose, secondShape, secondPose);\n return result.status === 'success' && result.distance.separation <= 0;\n}\n\nexport function contactBetweenPreparedShapes2D(\n firstShape: PibblPhysicsShape2D,\n firstPose: PibblPhysicsPose2D,\n secondShape: PibblPhysicsShape2D,\n secondPose: PibblPhysicsPose2D,\n): PibblPhysicsShapeContact2D | null {\n const result = collidePreparedShapes(firstShape, firstPose, secondShape, secondPose);\n if (result.status === 'failed' || result.distance.separation > 0) {\n return null;\n }\n return publicContactFromManifold2D(\n createPrivateManifold2D(result.distance, result.first, result.firstPose, result.second, result.secondPose),\n );\n}\n\n/** Package-private world/cache seam. Not exported from a package entry. */\nexport function manifoldBetweenShapeRecords2D(\n firstRecord: ShapeRecord2D,\n firstPose: InternalPose2D,\n firstOrder: number,\n secondRecord: ShapeRecord2D,\n secondPose: InternalPose2D,\n secondOrder: number,\n): PrivateManifold2D | null {\n const result = collideShapeRecords(\n prepareShapeRecord(firstRecord, firstPose, firstOrder),\n prepareShapeRecord(secondRecord, secondPose, secondOrder),\n );\n if (result.status === 'failed' || result.distance.separation > 0) return null;\n return createPrivateManifold2D(result.distance, result.first, result.firstPose, result.second, result.secondPose);\n}\n\nfunction collidePreparedShapes(\n firstShape: PibblPhysicsShape2D,\n firstPublicPose: PibblPhysicsPose2D,\n secondShape: PibblPhysicsShape2D,\n secondPublicPose: PibblPhysicsPose2D,\n): PairResult2D {\n const first = prepareShape(firstShape, firstPublicPose, 'first', 'firstPose');\n const second = prepareShape(secondShape, secondPublicPose, 'second', 'secondPose');\n return collideShapeRecords(first, second);\n}\n\nfunction collideShapeRecords(first: PreparedShape2D, second: PreparedShape2D): PairResult2D {\n let selected: SuccessfulPair2D | null = null;\n let failures = 0;\n for (const firstLeaf of first.record.leaves) {\n for (const secondLeaf of second.record.leaves) {\n const distance = distanceBetweenLeaves(firstLeaf, first.pose, secondLeaf, second.pose, first, second);\n if (distance === null) {\n failures += 1;\n continue;\n }\n const candidate: SuccessfulPair2D = {\n status: 'success',\n distance,\n first: firstLeaf,\n firstPose: first.pose,\n second: secondLeaf,\n secondPose: second.pose,\n };\n if (selected === null || comparePairCandidates(candidate, selected, first.order, second.order) < 0) {\n selected = candidate;\n }\n }\n }\n if (selected === null || (failures > 0 && selected.distance.separation > GEOMETRY_EPSILON)) {\n return { status: 'failed' };\n }\n return selected;\n}\n\nfunction distanceBetweenLeaves(\n first: ConvexLeaf2D,\n firstPose: InternalPose2D,\n second: ConvexLeaf2D,\n secondPose: InternalPose2D,\n firstShape: PreparedShape2D,\n secondShape: PreparedShape2D,\n): PrivatePairDistance2D | null {\n const fallback = preferredNormal(first, firstPose, second, secondPose, firstShape, secondShape);\n const firstRound = roundSpine(first, firstPose);\n const secondRound = roundSpine(second, secondPose);\n if (firstRound !== null && secondRound !== null) {\n const result = distanceCapsuleToCapsule2D(\n firstRound.startX,\n firstRound.startY,\n firstRound.endX,\n firstRound.endY,\n firstRound.radius,\n secondRound.startX,\n secondRound.startY,\n secondRound.endX,\n secondRound.endY,\n secondRound.radius,\n fallback[0],\n fallback[1],\n );\n return {\n ...result,\n firstFeature: 0,\n secondFeature: 0,\n firstLeaf: first.canonicalLeafIndex,\n secondLeaf: second.canonicalLeafIndex,\n };\n }\n\n const gjk = gjkConvexLeaves2D(first, firstPose, second, secondPose, fallback[0], fallback[1]);\n if (gjk.status === 'failed') return null;\n if (gjk.status === 'penetrating') {\n const epa = epaConvexLeaves2D(first, firstPose, second, secondPose, gjk.simplex);\n if (epa.status === 'failed') return null;\n return {\n ...epa,\n firstLeaf: first.canonicalLeafIndex,\n secondLeaf: second.canonicalLeafIndex,\n };\n }\n const normalLength = Math.hypot(gjk.normalX, gjk.normalY);\n return {\n separation: gjk.separation,\n firstX: gjk.firstX,\n firstY: gjk.firstY,\n secondX: gjk.secondX,\n secondY: gjk.secondY,\n normalX: normalLength > GEOMETRY_EPSILON ? gjk.normalX : fallback[0],\n normalY: normalLength > GEOMETRY_EPSILON ? gjk.normalY : fallback[1],\n firstFeature: gjk.firstFeature,\n secondFeature: gjk.secondFeature,\n firstLeaf: first.canonicalLeafIndex,\n secondLeaf: second.canonicalLeafIndex,\n };\n}\n\nfunction prepareShape(\n shell: PibblPhysicsShape2D,\n publicPose: PibblPhysicsPose2D,\n shapePath: string,\n posePath: string,\n): PreparedShape2D {\n const record = requireShapeRecord2D(shell);\n const pose = composePose2D(copyPose2D(publicPose, posePath), record.localPose);\n return { record, pose, order: shapeOrder(shell, shapePath) };\n}\n\nfunction prepareShapeRecord(record: ShapeRecord2D, outerPose: InternalPose2D, order: number): PreparedShape2D {\n return {\n record,\n pose: composePose2D(outerPose, record.localPose),\n order,\n };\n}\n\nfunction shapeOrder(shape: PibblPhysicsShape2D, _path: string): number {\n const object = shape as object;\n const existing = shapeOrders.get(object);\n if (existing !== undefined) return existing;\n const order = nextShapeOrder;\n nextShapeOrder += 1;\n shapeOrders.set(object, order);\n return order;\n}\n\nfunction preferredNormal(\n first: ConvexLeaf2D,\n firstPose: InternalPose2D,\n second: ConvexLeaf2D,\n secondPose: InternalPose2D,\n firstShape: PreparedShape2D,\n secondShape: PreparedShape2D,\n): readonly [number, number] {\n const centers = new Float64Array(4);\n centerOfLeaf2D(centers, 0, first, firstPose);\n centerOfLeaf2D(centers, 2, second, secondPose);\n const dx = centers[0]! - centers[2]!;\n const dy = centers[1]! - centers[3]!;\n const length = Math.hypot(dx, dy);\n if (length > GEOMETRY_EPSILON) return [dx / length, dy / length];\n return firstShape.order <= secondShape.order ? [1, 0] : [-1, 0];\n}\n\nfunction containsPointInLeaf(leaf: ConvexLeaf2D, pose: InternalPose2D, pointX: number, pointY: number): boolean {\n const local = inversePoint(pointX, pointY, pose);\n switch (leaf.kind) {\n case 'circle':\n return Math.hypot(local[0] - leaf.center[0]!, local[1] - leaf.center[1]!) <= leaf.radius + GEOMETRY_EPSILON;\n case 'ellipse': {\n const dx = local[0] - leaf.center[0]!;\n const dy = local[1] - leaf.center[1]!;\n const cosine = Math.cos(leaf.rotationRadians);\n const sine = Math.sin(leaf.rotationRadians);\n const x = cosine * dx + sine * dy;\n const y = -sine * dx + cosine * dy;\n return (x / leaf.radiusX) ** 2 + (y / leaf.radiusY) ** 2 <= 1 + GEOMETRY_EPSILON;\n }\n case 'box':\n return (\n Math.abs(local[0] - leaf.center[0]!) <= leaf.halfWidth + GEOMETRY_EPSILON &&\n Math.abs(local[1] - leaf.center[1]!) <= leaf.halfHeight + GEOMETRY_EPSILON\n );\n case 'rounded-box': {\n const dx = local[0] - leaf.center[0]!;\n const dy = local[1] - leaf.center[1]!;\n if (Math.abs(dx) > leaf.halfWidth + GEOMETRY_EPSILON || Math.abs(dy) > leaf.halfHeight + GEOMETRY_EPSILON)\n return false;\n const feature = dy < 0 ? (dx < 0 ? 0 : 1) : dx < 0 ? 3 : 2;\n const radius = leaf.radii[feature]!;\n const cornerDx = Math.max(0, Math.abs(dx) - (leaf.halfWidth - radius));\n const cornerDy = Math.max(0, Math.abs(dy) - (leaf.halfHeight - radius));\n return cornerDx * cornerDx + cornerDy * cornerDy <= radius * radius + GEOMETRY_EPSILON;\n }\n case 'capsule':\n return (\n distancePointToSegment2D(local[0], local[1], leaf.start[0]!, leaf.start[1]!, leaf.end[0]!, leaf.end[1]!)\n .separation <=\n leaf.radius + GEOMETRY_EPSILON\n );\n case 'segment':\n return (\n distancePointToSegment2D(local[0], local[1], leaf.start[0]!, leaf.start[1]!, leaf.end[0]!, leaf.end[1]!)\n .separation <= GEOMETRY_EPSILON\n );\n case 'polygon': {\n for (let index = 0; index < leaf.vertices.length / 2; index += 1) {\n const next = (index + 1) % (leaf.vertices.length / 2);\n const ax = leaf.vertices[index * 2]!;\n const ay = leaf.vertices[index * 2 + 1]!;\n const bx = leaf.vertices[next * 2]!;\n const by = leaf.vertices[next * 2 + 1]!;\n if ((bx - ax) * (local[1] - ay) - (by - ay) * (local[0] - ax) < -GEOMETRY_EPSILON) return false;\n }\n return true;\n }\n }\n}\n\nfunction inversePoint(x: number, y: number, pose: InternalPose2D): readonly [number, number] {\n const dx = x - pose.x;\n const dy = y - pose.y;\n const cosine = Math.cos(pose.rotationRadians);\n const sine = Math.sin(pose.rotationRadians);\n return [cosine * dx + sine * dy, -sine * dx + cosine * dy];\n}\n\nfunction roundSpine(\n leaf: ConvexLeaf2D,\n pose: InternalPose2D,\n): Readonly<{\n startX: number;\n startY: number;\n endX: number;\n endY: number;\n radius: number;\n}> | null {\n const output = new Float64Array(4);\n switch (leaf.kind) {\n case 'circle':\n transformPointInto(output, 0, leaf.center[0]!, leaf.center[1]!, pose);\n return {\n startX: output[0]!,\n startY: output[1]!,\n endX: output[0]!,\n endY: output[1]!,\n radius: leaf.radius,\n };\n case 'capsule':\n transformPointInto(output, 0, leaf.start[0]!, leaf.start[1]!, pose);\n transformPointInto(output, 2, leaf.end[0]!, leaf.end[1]!, pose);\n return {\n startX: output[0]!,\n startY: output[1]!,\n endX: output[2]!,\n endY: output[3]!,\n radius: leaf.radius,\n };\n case 'segment':\n transformPointInto(output, 0, leaf.start[0]!, leaf.start[1]!, pose);\n transformPointInto(output, 2, leaf.end[0]!, leaf.end[1]!, pose);\n return {\n startX: output[0]!,\n startY: output[1]!,\n endX: output[2]!,\n endY: output[3]!,\n radius: 0,\n };\n default:\n return null;\n }\n}\n\nfunction comparePairCandidates(\n first: SuccessfulPair2D,\n second: SuccessfulPair2D,\n firstShapeOrder: number,\n secondShapeOrder: number,\n): number {\n const separationDifference = first.distance.separation - second.distance.separation;\n if (Math.abs(separationDifference) > GEOMETRY_EPSILON) return separationDifference;\n const firstKey = canonicalLeafKey(first.distance, firstShapeOrder, secondShapeOrder);\n const secondKey = canonicalLeafKey(second.distance, firstShapeOrder, secondShapeOrder);\n return (\n firstKey[0] - secondKey[0] ||\n firstKey[1] - secondKey[1] ||\n first.distance.firstFeature - second.distance.firstFeature ||\n first.distance.secondFeature - second.distance.secondFeature\n );\n}\n\nfunction canonicalLeafKey(\n distance: PrivatePairDistance2D,\n firstShapeOrder: number,\n secondShapeOrder: number,\n): readonly [number, number] {\n return firstShapeOrder <= secondShapeOrder\n ? [distance.firstLeaf, distance.secondLeaf]\n : [distance.secondLeaf, distance.firstLeaf];\n}\n\nfunction publicDistance(distance: PrivatePairDistance2D): PibblPhysicsDistance2D {\n return Object.freeze({\n separation: cleanZero(distance.separation),\n pointOnFirst: freezeVector(distance.firstX, distance.firstY),\n pointOnSecond: freezeVector(distance.secondX, distance.secondY),\n normal: freezeVector(distance.normalX, distance.normalY),\n });\n}\n\nfunction freezeVector(x: number, y: number): readonly [number, number] {\n return Object.freeze([cleanZero(x), cleanZero(y)] as const);\n}\n\nfunction cleanZero(value: number): number {\n return Object.is(value, -0) || Math.abs(value) <= Number.EPSILON ? 0 : value;\n}\n"],
|
|
5
|
+
"mappings": "AAOA,SAAS,yBAAyB;AAClC,SAAS,eAAe,YAAY,0BAA+C;AACnF,SAAS,wBAAwB;AACjC,SAAS,4BAAmE;AAC5E,SAAS,4BAA4B,gCAAgC;AACrE,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,sBAAsB;AAuB/B,MAAM,cAAc,oBAAI,QAAwB;AAChD,IAAI,iBAAiB;AAEd,SAAS,uBACd,OACA,MACA,OACS;AACT,QAAM,WAAW,aAAa,OAAO,MAAM,SAAS,MAAM;AAC1D,QAAM,cAAc,kBAAkB,OAAO,OAAO;AACpD,SAAO,SAAS,OAAO,OAAO;AAAA,IAAK,CAAC,SAClC,oBAAoB,MAAM,SAAS,MAAM,YAAY,CAAC,GAAG,YAAY,CAAC,CAAC;AAAA,EACzE;AACF;AAEO,SAAS,gCACd,YACA,WACA,aACA,YACwB;AACxB,QAAM,SAAS,sBAAsB,YAAY,WAAW,aAAa,UAAU;AACnF,MAAI,OAAO,WAAW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AAK,OAAO,UAAU,IAAI;AACzE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type InternalPose2D } from '../math.js';
|
|
2
|
+
import type { ConvexLeaf2D } from '../shape-records.js';
|
|
3
|
+
export interface SupportPoint2D {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly feature: number;
|
|
7
|
+
}
|
|
8
|
+
export interface MinkowskiVertex2D {
|
|
9
|
+
readonly x: number;
|
|
10
|
+
readonly y: number;
|
|
11
|
+
readonly firstX: number;
|
|
12
|
+
readonly firstY: number;
|
|
13
|
+
readonly secondX: number;
|
|
14
|
+
readonly secondY: number;
|
|
15
|
+
readonly firstFeature: number;
|
|
16
|
+
readonly secondFeature: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function supportMinkowski2D(first: ConvexLeaf2D, firstPose: InternalPose2D, second: ConvexLeaf2D, secondPose: InternalPose2D, directionX: number, directionY: number): MinkowskiVertex2D;
|
|
19
|
+
export declare function supportLeaf2D(output: Float64Array, outputOffset: number, leaf: ConvexLeaf2D, pose: InternalPose2D, directionX: number, directionY: number): number;
|
|
20
|
+
export declare function centerOfLeaf2D(output: Float64Array, outputOffset: number, leaf: ConvexLeaf2D, pose: InternalPose2D): void;
|