@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,585 @@
|
|
|
1
|
+
const EMPTY_GEOMETRY = new Float64Array(0);
|
|
2
|
+
const NO_SOURCES = Object.freeze([]);
|
|
3
|
+
class FlowFieldKernel2D {
|
|
4
|
+
constructor(columns, rows, width, height) {
|
|
5
|
+
this.columns = columns;
|
|
6
|
+
this.rows = rows;
|
|
7
|
+
this.width = width;
|
|
8
|
+
this.height = height;
|
|
9
|
+
if (!Number.isInteger(columns) || !Number.isInteger(rows) || columns < 4 || rows < 4 || columns * rows > 1048576 || !Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
|
|
10
|
+
throw new RangeError(
|
|
11
|
+
"Flow grid requires finite positive bounds and 4+ cells per axis (at most 1048576 cells)."
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
this.dx = width / columns;
|
|
15
|
+
this.dy = height / rows;
|
|
16
|
+
const cells = columns * rows;
|
|
17
|
+
this.u = new Float32Array((columns + 1) * rows);
|
|
18
|
+
this.v = new Float32Array(columns * (rows + 1));
|
|
19
|
+
this.nextU = new Float32Array(this.u.length);
|
|
20
|
+
this.nextV = new Float32Array(this.v.length);
|
|
21
|
+
this.wallU = new Float32Array(this.u.length);
|
|
22
|
+
this.wallV = new Float32Array(this.v.length);
|
|
23
|
+
this.fixedU = new Uint8Array(this.u.length);
|
|
24
|
+
this.fixedV = new Uint8Array(this.v.length);
|
|
25
|
+
this.solid = new Uint8Array(cells);
|
|
26
|
+
this.pressure = new Float32Array(cells + 1);
|
|
27
|
+
this.neighbors = new Uint32Array(cells * 4);
|
|
28
|
+
this.inverseWeight = new Float64Array(cells);
|
|
29
|
+
this.solveOrder = new Uint32Array(cells);
|
|
30
|
+
this.divergence = new Float32Array(cells);
|
|
31
|
+
this.cellVX = new Float32Array(cells);
|
|
32
|
+
this.cellVY = new Float32Array(cells);
|
|
33
|
+
this.temperature = new Float32Array(cells);
|
|
34
|
+
this.nextTemperature = new Float32Array(cells);
|
|
35
|
+
this.rebuildStencil();
|
|
36
|
+
}
|
|
37
|
+
columns;
|
|
38
|
+
rows;
|
|
39
|
+
width;
|
|
40
|
+
height;
|
|
41
|
+
u;
|
|
42
|
+
v;
|
|
43
|
+
nextU;
|
|
44
|
+
nextV;
|
|
45
|
+
solid;
|
|
46
|
+
wallU;
|
|
47
|
+
wallV;
|
|
48
|
+
fixedU;
|
|
49
|
+
fixedV;
|
|
50
|
+
pressure;
|
|
51
|
+
divergence;
|
|
52
|
+
neighbors;
|
|
53
|
+
inverseWeight;
|
|
54
|
+
solveOrder;
|
|
55
|
+
solveCount = 0;
|
|
56
|
+
cellVX;
|
|
57
|
+
cellVY;
|
|
58
|
+
temperature;
|
|
59
|
+
nextTemperature;
|
|
60
|
+
dx;
|
|
61
|
+
dy;
|
|
62
|
+
projectionIterations = 0;
|
|
63
|
+
projectionResidual = 0;
|
|
64
|
+
/** Copy committed state into a reusable candidate before a transactional frame. */
|
|
65
|
+
copyFrom(other) {
|
|
66
|
+
if (this.columns !== other.columns || this.rows !== other.rows || this.width !== other.width || this.height !== other.height) {
|
|
67
|
+
throw new RangeError("Cannot copy differently sized flow fields.");
|
|
68
|
+
}
|
|
69
|
+
this.u.set(other.u);
|
|
70
|
+
this.v.set(other.v);
|
|
71
|
+
this.solid.set(other.solid);
|
|
72
|
+
this.wallU.set(other.wallU);
|
|
73
|
+
this.wallV.set(other.wallV);
|
|
74
|
+
this.fixedU.set(other.fixedU);
|
|
75
|
+
this.fixedV.set(other.fixedV);
|
|
76
|
+
this.pressure.set(other.pressure);
|
|
77
|
+
this.neighbors.set(other.neighbors);
|
|
78
|
+
this.inverseWeight.set(other.inverseWeight);
|
|
79
|
+
this.solveOrder.set(other.solveOrder);
|
|
80
|
+
this.solveCount = other.solveCount;
|
|
81
|
+
this.cellVX.set(other.cellVX);
|
|
82
|
+
this.cellVY.set(other.cellVY);
|
|
83
|
+
this.temperature.set(other.temperature);
|
|
84
|
+
this.projectionIterations = other.projectionIterations;
|
|
85
|
+
this.projectionResidual = other.projectionResidual;
|
|
86
|
+
}
|
|
87
|
+
get byteLength() {
|
|
88
|
+
return this.u.byteLength + this.v.byteLength + this.nextU.byteLength + this.nextV.byteLength + this.wallU.byteLength + this.wallV.byteLength + this.fixedU.byteLength + this.fixedV.byteLength + this.solid.byteLength + this.pressure.byteLength + this.divergence.byteLength + this.neighbors.byteLength + this.inverseWeight.byteLength + this.solveOrder.byteLength + this.cellVX.byteLength + this.cellVY.byteLength + this.temperature.byteLength + this.nextTemperature.byteLength;
|
|
89
|
+
}
|
|
90
|
+
/** Packed boxes: cx, cy, hx, hy, angle radians, vx, vy, omega, COM x, COM y.
|
|
91
|
+
* Copies into grid storage; the caller retains and may reuse its own buffer.
|
|
92
|
+
* Overlapping solids resolve in batch order, with the last solid owning motion.
|
|
93
|
+
*/
|
|
94
|
+
setBoxes(boxes) {
|
|
95
|
+
this.setObstacles({ boxes });
|
|
96
|
+
}
|
|
97
|
+
setObstacles(geometry) {
|
|
98
|
+
const boxes = geometry.boxes ?? EMPTY_GEOMETRY;
|
|
99
|
+
const ellipses = geometry.ellipses ?? EMPTY_GEOMETRY;
|
|
100
|
+
const polygons = geometry.polygons ?? EMPTY_GEOMETRY;
|
|
101
|
+
for (let kind = 0; kind < 2; kind++) {
|
|
102
|
+
const packed = kind === 0 ? boxes : ellipses;
|
|
103
|
+
if (packed.length % 10 !== 0)
|
|
104
|
+
throw new RangeError("Malformed flow obstacle batch.");
|
|
105
|
+
for (let i = 0; i < packed.length; i++) {
|
|
106
|
+
if (!Number.isFinite(packed[i]))
|
|
107
|
+
throw new RangeError("Flow obstacle values must be finite.");
|
|
108
|
+
if ((i % 10 === 2 || i % 10 === 3) && packed[i] <= 0)
|
|
109
|
+
throw new RangeError("Flow obstacle extents must be positive.");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (let at = 0; at < polygons.length; ) {
|
|
113
|
+
const count = polygons[at];
|
|
114
|
+
const end = at + 6 + count * 2;
|
|
115
|
+
if (!Number.isInteger(count) || count < 3 || end > polygons.length)
|
|
116
|
+
throw new RangeError("Malformed flow polygon batch.");
|
|
117
|
+
for (let i = at; i < end; i++)
|
|
118
|
+
if (!Number.isFinite(polygons[i]))
|
|
119
|
+
throw new RangeError("Flow polygon values must be finite.");
|
|
120
|
+
at = end;
|
|
121
|
+
}
|
|
122
|
+
const { columns: nx, rows: ny, dx, dy } = this;
|
|
123
|
+
this.solid.fill(0);
|
|
124
|
+
this.cellVX.fill(0);
|
|
125
|
+
this.cellVY.fill(0);
|
|
126
|
+
for (let kind = 0; kind < 2; kind++) {
|
|
127
|
+
const packed = kind === 0 ? boxes : ellipses;
|
|
128
|
+
for (let b = 0; b < packed.length; b += 10) {
|
|
129
|
+
const cx = packed[b], cy = packed[b + 1];
|
|
130
|
+
const hx = packed[b + 2], hy = packed[b + 3];
|
|
131
|
+
const c = Math.cos(packed[b + 4]), s = Math.sin(packed[b + 4]);
|
|
132
|
+
const ex = Math.abs(c) * hx + Math.abs(s) * hy;
|
|
133
|
+
const ey = Math.abs(s) * hx + Math.abs(c) * hy;
|
|
134
|
+
const x0 = Math.max(0, Math.floor((cx - ex) / dx));
|
|
135
|
+
const x1 = Math.min(nx - 1, Math.floor((cx + ex) / dx));
|
|
136
|
+
const y0 = Math.max(0, Math.floor((cy - ey) / dy));
|
|
137
|
+
const y1 = Math.min(ny - 1, Math.floor((cy + ey) / dy));
|
|
138
|
+
for (let y = y0; y <= y1; y++) {
|
|
139
|
+
for (let x = x0; x <= x1; x++) {
|
|
140
|
+
const px = (x + 0.5) * dx, py = (y + 0.5) * dy;
|
|
141
|
+
const rx = px - cx, ry = py - cy;
|
|
142
|
+
const localX = (c * rx + s * ry) / hx, localY = (-s * rx + c * ry) / hy;
|
|
143
|
+
if (kind === 0 ? Math.abs(localX) > 1 || Math.abs(localY) > 1 : localX * localX + localY * localY > 1)
|
|
144
|
+
continue;
|
|
145
|
+
const i = y * nx + x;
|
|
146
|
+
this.solid[i] = 1;
|
|
147
|
+
this.cellVX[i] = packed[b + 5] - packed[b + 7] * (py - packed[b + 9]);
|
|
148
|
+
this.cellVY[i] = packed[b + 6] + packed[b + 7] * (px - packed[b + 8]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
for (let at = 0; at < polygons.length; ) {
|
|
154
|
+
const count = polygons[at], first = at + 6, end = first + count * 2;
|
|
155
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
156
|
+
for (let v = first; v < end; v += 2) {
|
|
157
|
+
minX = Math.min(minX, polygons[v]);
|
|
158
|
+
maxX = Math.max(maxX, polygons[v]);
|
|
159
|
+
minY = Math.min(minY, polygons[v + 1]);
|
|
160
|
+
maxY = Math.max(maxY, polygons[v + 1]);
|
|
161
|
+
}
|
|
162
|
+
const x0 = Math.max(0, Math.floor(minX / dx)), x1 = Math.min(nx - 1, Math.floor(maxX / dx));
|
|
163
|
+
const y0 = Math.max(0, Math.floor(minY / dy)), y1 = Math.min(ny - 1, Math.floor(maxY / dy));
|
|
164
|
+
for (let y = y0; y <= y1; y++)
|
|
165
|
+
for (let x = x0; x <= x1; x++) {
|
|
166
|
+
const px = (x + 0.5) * dx, py = (y + 0.5) * dy;
|
|
167
|
+
let inside = false;
|
|
168
|
+
for (let v = first, previous = end - 2; v < end; previous = v, v += 2) {
|
|
169
|
+
const ax = polygons[v], ay = polygons[v + 1], bx = polygons[previous], by = polygons[previous + 1];
|
|
170
|
+
if (ay > py !== by > py && px < (bx - ax) * (py - ay) / (by - ay) + ax)
|
|
171
|
+
inside = !inside;
|
|
172
|
+
}
|
|
173
|
+
if (!inside) continue;
|
|
174
|
+
const i = y * nx + x;
|
|
175
|
+
this.solid[i] = 1;
|
|
176
|
+
this.cellVX[i] = polygons[at + 1] - polygons[at + 3] * (py - polygons[at + 5]);
|
|
177
|
+
this.cellVY[i] = polygons[at + 2] + polygons[at + 3] * (px - polygons[at + 4]);
|
|
178
|
+
}
|
|
179
|
+
at = end;
|
|
180
|
+
}
|
|
181
|
+
for (let y = 0; y < ny; y++) {
|
|
182
|
+
for (let x = 0; x <= nx; x++) {
|
|
183
|
+
const face = y * (nx + 1) + x;
|
|
184
|
+
const left = y * nx + x - 1, right = left + 1;
|
|
185
|
+
const cell = x > 0 && this.solid[left] ? left : x < nx && this.solid[right] ? right : -1;
|
|
186
|
+
this.fixedU[face] = cell >= 0 ? 1 : 0;
|
|
187
|
+
this.wallU[face] = cell >= 0 ? this.cellVX[cell] : 0;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
for (let y = 0; y <= ny; y++) {
|
|
191
|
+
for (let x = 0; x < nx; x++) {
|
|
192
|
+
const face = y * nx + x;
|
|
193
|
+
const above = face - nx, below = face;
|
|
194
|
+
const cell = y > 0 && this.solid[above] ? above : y < ny && this.solid[below] ? below : -1;
|
|
195
|
+
this.fixedV[face] = cell >= 0 ? 1 : 0;
|
|
196
|
+
this.wallV[face] = cell >= 0 ? this.cellVY[cell] : 0;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
this.enforceWalls();
|
|
200
|
+
this.rebuildStencil();
|
|
201
|
+
this.pressure.fill(0);
|
|
202
|
+
}
|
|
203
|
+
isSolid(x, y) {
|
|
204
|
+
const ix = Math.floor(x / this.dx), iy = Math.floor(y / this.dy);
|
|
205
|
+
return ix >= 0 && ix < this.columns && iy >= 0 && iy < this.rows && this.solid[iy * this.columns + ix] === 1;
|
|
206
|
+
}
|
|
207
|
+
interpolate(data, nx, ny, x, y) {
|
|
208
|
+
x = Math.max(0, Math.min(nx - 1, x));
|
|
209
|
+
y = Math.max(0, Math.min(ny - 1, y));
|
|
210
|
+
const ix = Math.floor(x), iy = Math.floor(y);
|
|
211
|
+
const jx = Math.min(nx - 1, ix + 1), jy = Math.min(ny - 1, iy + 1);
|
|
212
|
+
const fx = x - ix, fy = y - iy;
|
|
213
|
+
const a = data[iy * nx + ix], b = data[iy * nx + jx];
|
|
214
|
+
const c = data[jy * nx + ix], d = data[jy * nx + jx];
|
|
215
|
+
return (a + (b - a) * fx) * (1 - fy) + (c + (d - c) * fx) * fy;
|
|
216
|
+
}
|
|
217
|
+
velocityX(x, y) {
|
|
218
|
+
return this.interpolate(
|
|
219
|
+
this.u,
|
|
220
|
+
this.columns + 1,
|
|
221
|
+
this.rows,
|
|
222
|
+
x / this.dx,
|
|
223
|
+
y / this.dy - 0.5
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
velocityY(x, y) {
|
|
227
|
+
return this.interpolate(
|
|
228
|
+
this.v,
|
|
229
|
+
this.columns,
|
|
230
|
+
this.rows + 1,
|
|
231
|
+
x / this.dx - 0.5,
|
|
232
|
+
y / this.dy
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
sampleBatch(positions, velocities, count) {
|
|
236
|
+
if (!Number.isInteger(count) || count < 0 || count * 2 > positions.length || count * 2 > velocities.length) {
|
|
237
|
+
throw new RangeError("Flow sample batch exceeds buffer bounds.");
|
|
238
|
+
}
|
|
239
|
+
for (let i = 0; i < count * 2; i += 2) {
|
|
240
|
+
const x = positions[i], y = positions[i + 1];
|
|
241
|
+
velocities[i] = this.velocityX(x, y);
|
|
242
|
+
velocities[i + 1] = this.velocityY(x, y);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/** Swept grid traversal, O(cells crossed), independent of obstacle count.
|
|
246
|
+
* A particle already covered by a moved solid is left for the population's
|
|
247
|
+
* explicit retire/reseed policy. Domain edges are open.
|
|
248
|
+
*/
|
|
249
|
+
moveBatch(positions, velocities, count, seconds) {
|
|
250
|
+
if (!Number.isInteger(count) || count < 0 || count * 2 > positions.length || count * 2 > velocities.length || !Number.isFinite(seconds) || seconds < 0) {
|
|
251
|
+
throw new RangeError("Invalid flow movement batch.");
|
|
252
|
+
}
|
|
253
|
+
for (let i = 0; i < count * 2; i += 2) {
|
|
254
|
+
const x = positions[i], y = positions[i + 1];
|
|
255
|
+
const sx = velocities[i] * seconds, sy = velocities[i + 1] * seconds;
|
|
256
|
+
const fraction = this.sweepFraction(x, y, sx, sy);
|
|
257
|
+
positions[i] = x + sx * fraction;
|
|
258
|
+
positions[i + 1] = y + sy * fraction;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
sweepFraction(x, y, sx, sy) {
|
|
262
|
+
if (sx === 0 && sy === 0) return 1;
|
|
263
|
+
let enter = 0, exit = 1;
|
|
264
|
+
if (sx === 0) {
|
|
265
|
+
if (x < 0 || x >= this.width) return 1;
|
|
266
|
+
} else {
|
|
267
|
+
const a = -x / sx, b = (this.width - x) / sx;
|
|
268
|
+
enter = Math.max(enter, Math.min(a, b));
|
|
269
|
+
exit = Math.min(exit, Math.max(a, b));
|
|
270
|
+
}
|
|
271
|
+
if (sy === 0) {
|
|
272
|
+
if (y < 0 || y >= this.height) return 1;
|
|
273
|
+
} else {
|
|
274
|
+
const a = -y / sy, b = (this.height - y) / sy;
|
|
275
|
+
enter = Math.max(enter, Math.min(a, b));
|
|
276
|
+
exit = Math.min(exit, Math.max(a, b));
|
|
277
|
+
}
|
|
278
|
+
if (enter > exit) return 1;
|
|
279
|
+
const nx = this.columns, ny = this.rows;
|
|
280
|
+
const stepX = sx > 0 ? 1 : -1, stepY = sy > 0 ? 1 : -1;
|
|
281
|
+
let cx = Math.min(
|
|
282
|
+
nx - 1,
|
|
283
|
+
Math.max(0, Math.floor((x + sx * enter) / this.dx))
|
|
284
|
+
);
|
|
285
|
+
let cy = Math.min(
|
|
286
|
+
ny - 1,
|
|
287
|
+
Math.max(0, Math.floor((y + sy * enter) / this.dy))
|
|
288
|
+
);
|
|
289
|
+
if (this.solid[cy * nx + cx]) return enter;
|
|
290
|
+
let tx = sx === 0 ? Infinity : ((cx + (sx > 0 ? 1 : 0)) * this.dx - x) / sx;
|
|
291
|
+
let ty = sy === 0 ? Infinity : ((cy + (sy > 0 ? 1 : 0)) * this.dy - y) / sy;
|
|
292
|
+
const deltaX = sx === 0 ? Infinity : this.dx / Math.abs(sx);
|
|
293
|
+
const deltaY = sy === 0 ? Infinity : this.dy / Math.abs(sy);
|
|
294
|
+
const clearance = Math.min(this.dx, this.dy) * 1e-4 / Math.max(Math.abs(sx), Math.abs(sy));
|
|
295
|
+
while (Math.min(tx, ty) <= exit) {
|
|
296
|
+
const t = Math.min(tx, ty);
|
|
297
|
+
const crossX = tx <= ty, crossY = ty <= tx;
|
|
298
|
+
if (crossX) {
|
|
299
|
+
const neighbor = cx + stepX;
|
|
300
|
+
if (neighbor >= 0 && neighbor < nx && this.solid[cy * nx + neighbor])
|
|
301
|
+
return Math.max(0, t - clearance);
|
|
302
|
+
}
|
|
303
|
+
if (crossY) {
|
|
304
|
+
const neighbor = cy + stepY;
|
|
305
|
+
if (neighbor >= 0 && neighbor < ny && this.solid[neighbor * nx + cx])
|
|
306
|
+
return Math.max(0, t - clearance);
|
|
307
|
+
}
|
|
308
|
+
if (crossX) {
|
|
309
|
+
cx += stepX;
|
|
310
|
+
tx += deltaX;
|
|
311
|
+
}
|
|
312
|
+
if (crossY) {
|
|
313
|
+
cy += stepY;
|
|
314
|
+
ty += deltaY;
|
|
315
|
+
}
|
|
316
|
+
if (cx < 0 || cx >= nx || cy < 0 || cy >= ny) return 1;
|
|
317
|
+
if (this.solid[cy * nx + cx]) return Math.max(0, t - clearance);
|
|
318
|
+
}
|
|
319
|
+
return 1;
|
|
320
|
+
}
|
|
321
|
+
/** One accepted fixed step. Sources touch only their bounded footprints. */
|
|
322
|
+
advance(seconds, sources = NO_SOURCES, buoyancy = -300) {
|
|
323
|
+
if (!Number.isFinite(seconds) || seconds <= 0 || seconds > 0.1 || !Number.isFinite(buoyancy)) {
|
|
324
|
+
throw new RangeError(
|
|
325
|
+
"Flow step and buoyancy must be finite and bounded."
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
for (const source of sources) {
|
|
329
|
+
if (!Number.isFinite(source.x) || !Number.isFinite(source.y) || !Number.isFinite(source.radius) || source.radius <= 0 || !Number.isFinite(source.acceleration?.[0] ?? 0) || !Number.isFinite(source.acceleration?.[1] ?? 0) || !Number.isFinite(source.heat ?? 0) || (source.heat ?? 0) < 0) {
|
|
330
|
+
throw new RangeError(
|
|
331
|
+
"Flow source must have finite coordinates, positive radius and nonnegative heat."
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const { columns: nx, rows: ny, dx, dy } = this;
|
|
336
|
+
const damping = Math.exp(-0.15 * seconds);
|
|
337
|
+
const cooling = Math.exp(-0.3 * seconds);
|
|
338
|
+
for (let y = 0; y < ny; y++) {
|
|
339
|
+
for (let x = 0; x < nx; x++) {
|
|
340
|
+
const i = y * nx + x;
|
|
341
|
+
if (this.solid[i]) {
|
|
342
|
+
this.nextTemperature[i] = 0;
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
const px = (x + 0.5) * dx, py = (y + 0.5) * dy;
|
|
346
|
+
const bx = px - seconds * this.velocityX(px, py);
|
|
347
|
+
const by = py - seconds * this.velocityY(px, py);
|
|
348
|
+
this.nextTemperature[i] = bx < 0 || by < 0 || bx >= this.width || by >= this.height || this.isSolid(bx, by) ? 0 : this.interpolate(
|
|
349
|
+
this.temperature,
|
|
350
|
+
nx,
|
|
351
|
+
ny,
|
|
352
|
+
bx / dx - 0.5,
|
|
353
|
+
by / dy - 0.5
|
|
354
|
+
) * cooling;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
for (const source of sources) {
|
|
358
|
+
if (!source.heat) continue;
|
|
359
|
+
const inverseRadiusSquared = 1 / (source.radius * source.radius);
|
|
360
|
+
const x0 = Math.max(0, Math.floor((source.x - source.radius) / dx));
|
|
361
|
+
const x1 = Math.min(nx - 1, Math.floor((source.x + source.radius) / dx));
|
|
362
|
+
const y0 = Math.max(0, Math.floor((source.y - source.radius) / dy));
|
|
363
|
+
const y1 = Math.min(ny - 1, Math.floor((source.y + source.radius) / dy));
|
|
364
|
+
for (let y = y0; y <= y1; y++) {
|
|
365
|
+
for (let x = x0; x <= x1; x++) {
|
|
366
|
+
const i = y * nx + x;
|
|
367
|
+
if (this.solid[i]) continue;
|
|
368
|
+
const rx = (x + 0.5) * dx - source.x, ry = (y + 0.5) * dy - source.y;
|
|
369
|
+
const falloff = Math.max(
|
|
370
|
+
0,
|
|
371
|
+
1 - (rx * rx + ry * ry) * inverseRadiusSquared
|
|
372
|
+
);
|
|
373
|
+
this.nextTemperature[i] = Math.min(
|
|
374
|
+
1,
|
|
375
|
+
this.nextTemperature[i] + source.heat * seconds * falloff * falloff
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
const oldTemperature = this.temperature;
|
|
381
|
+
this.temperature = this.nextTemperature;
|
|
382
|
+
this.nextTemperature = oldTemperature;
|
|
383
|
+
for (let y = 0; y < ny; y++) {
|
|
384
|
+
for (let x = 0; x <= nx; x++) {
|
|
385
|
+
const i = y * (nx + 1) + x;
|
|
386
|
+
if (this.fixedU[i]) {
|
|
387
|
+
this.nextU[i] = this.wallU[i];
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
const px = x * dx, py = (y + 0.5) * dy;
|
|
391
|
+
const vx = this.u[i], vy = this.velocityY(px, py);
|
|
392
|
+
const bx = px - seconds * vx, by = py - seconds * vy;
|
|
393
|
+
this.nextU[i] = (this.isSolid(bx, by) ? vx : this.velocityX(bx, by)) * damping;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
for (let y = 0; y <= ny; y++) {
|
|
397
|
+
for (let x = 0; x < nx; x++) {
|
|
398
|
+
const i = y * nx + x;
|
|
399
|
+
if (this.fixedV[i]) {
|
|
400
|
+
this.nextV[i] = this.wallV[i];
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
const px = (x + 0.5) * dx, py = y * dy;
|
|
404
|
+
const vx = this.velocityX(px, py), vy = this.v[i];
|
|
405
|
+
const bx = px - seconds * vx, by = py - seconds * vy;
|
|
406
|
+
const above = y > 0 && !this.solid[i - nx] ? this.temperature[i - nx] : 0;
|
|
407
|
+
const below = y < ny && !this.solid[i] ? this.temperature[i] : 0;
|
|
408
|
+
this.nextV[i] = (this.isSolid(bx, by) ? vy : this.velocityY(bx, by)) * damping + seconds * buoyancy * (above + below) * 0.5;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
for (const source of sources) {
|
|
412
|
+
const ax = source.acceleration?.[0] ?? 0, ay = source.acceleration?.[1] ?? 0;
|
|
413
|
+
if (ax === 0 && ay === 0) continue;
|
|
414
|
+
const inverseRadiusSquared = 1 / (source.radius * source.radius);
|
|
415
|
+
const x0 = Math.max(0, Math.floor((source.x - source.radius) / dx));
|
|
416
|
+
const x1 = Math.min(nx, Math.ceil((source.x + source.radius) / dx));
|
|
417
|
+
const y0 = Math.max(0, Math.floor((source.y - source.radius) / dy));
|
|
418
|
+
const y1 = Math.min(ny, Math.ceil((source.y + source.radius) / dy));
|
|
419
|
+
for (let y = y0; y <= y1; y++) {
|
|
420
|
+
for (let x = x0; x <= x1; x++) {
|
|
421
|
+
if (ax !== 0 && y < ny) {
|
|
422
|
+
const i = y * (nx + 1) + x;
|
|
423
|
+
if (!this.fixedU[i]) {
|
|
424
|
+
const rx = x * dx - source.x, ry = (y + 0.5) * dy - source.y;
|
|
425
|
+
const falloff = Math.max(
|
|
426
|
+
0,
|
|
427
|
+
1 - (rx * rx + ry * ry) * inverseRadiusSquared
|
|
428
|
+
);
|
|
429
|
+
this.nextU[i] += seconds * ax * falloff * falloff;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (ay !== 0 && x < nx) {
|
|
433
|
+
const i = y * nx + x;
|
|
434
|
+
if (!this.fixedV[i]) {
|
|
435
|
+
const rx = (x + 0.5) * dx - source.x, ry = y * dy - source.y;
|
|
436
|
+
const falloff = Math.max(
|
|
437
|
+
0,
|
|
438
|
+
1 - (rx * rx + ry * ry) * inverseRadiusSquared
|
|
439
|
+
);
|
|
440
|
+
this.nextV[i] += seconds * ay * falloff * falloff;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
const oldU = this.u, oldV = this.v;
|
|
447
|
+
this.u = this.nextU;
|
|
448
|
+
this.v = this.nextV;
|
|
449
|
+
this.nextU = oldU;
|
|
450
|
+
this.nextV = oldV;
|
|
451
|
+
this.project();
|
|
452
|
+
}
|
|
453
|
+
enforceWalls() {
|
|
454
|
+
for (let i = 0; i < this.u.length; i++)
|
|
455
|
+
if (this.fixedU[i]) this.u[i] = this.wallU[i];
|
|
456
|
+
for (let i = 0; i < this.v.length; i++)
|
|
457
|
+
if (this.fixedV[i]) this.v[i] = this.wallV[i];
|
|
458
|
+
}
|
|
459
|
+
/** Cache the Poisson stencil in red/black order once per obstacle update. */
|
|
460
|
+
rebuildStencil() {
|
|
461
|
+
const {
|
|
462
|
+
columns: nx,
|
|
463
|
+
rows: ny,
|
|
464
|
+
solid,
|
|
465
|
+
neighbors,
|
|
466
|
+
inverseWeight,
|
|
467
|
+
solveOrder
|
|
468
|
+
} = this;
|
|
469
|
+
const sentinel = nx * ny, wx = 1 / (this.dx * this.dx), wy = 1 / (this.dy * this.dy);
|
|
470
|
+
let count = 0;
|
|
471
|
+
for (let parity = 0; parity < 2; parity++) {
|
|
472
|
+
for (let y = 0; y < ny; y++) {
|
|
473
|
+
for (let x = y + parity & 1; x < nx; x += 2) {
|
|
474
|
+
const i = y * nx + x;
|
|
475
|
+
if (solid[i]) continue;
|
|
476
|
+
let weight = 0;
|
|
477
|
+
const left = x > 0 && !solid[i - 1];
|
|
478
|
+
const right = x < nx - 1 && !solid[i + 1];
|
|
479
|
+
const above = y > 0 && !solid[i - nx];
|
|
480
|
+
const below = y < ny - 1 && !solid[i + nx];
|
|
481
|
+
if (x === 0 || left) weight += wx;
|
|
482
|
+
if (x === nx - 1 || right) weight += wx;
|
|
483
|
+
if (y === 0 || above) weight += wy;
|
|
484
|
+
if (y === ny - 1 || below) weight += wy;
|
|
485
|
+
if (weight === 0) continue;
|
|
486
|
+
neighbors[i * 4] = left ? i - 1 : sentinel;
|
|
487
|
+
neighbors[i * 4 + 1] = right ? i + 1 : sentinel;
|
|
488
|
+
neighbors[i * 4 + 2] = above ? i - nx : sentinel;
|
|
489
|
+
neighbors[i * 4 + 3] = below ? i + nx : sentinel;
|
|
490
|
+
inverseWeight[i] = 1 / weight;
|
|
491
|
+
solveOrder[count++] = i;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
this.solveCount = count;
|
|
496
|
+
}
|
|
497
|
+
project() {
|
|
498
|
+
const { columns: nx, rows: ny, dx, dy, pressure: p } = this;
|
|
499
|
+
const wx = 1 / (dx * dx), wy = 1 / (dy * dy);
|
|
500
|
+
for (let y = 0; y < ny; y++) {
|
|
501
|
+
for (let x = 0; x < nx; x++) {
|
|
502
|
+
const i = y * nx + x;
|
|
503
|
+
this.divergence[i] = (this.u[y * (nx + 1) + x + 1] - this.u[y * (nx + 1) + x]) / dx + (this.v[i + nx] - this.v[i]) / dy;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
this.projectionIterations = 0;
|
|
507
|
+
for (let iteration = 0; iteration < 80; iteration++) {
|
|
508
|
+
for (let entry = 0; entry < this.solveCount; entry++) {
|
|
509
|
+
const i = this.solveOrder[entry], offset = i * 4;
|
|
510
|
+
const sum = wx * p[this.neighbors[offset]] + wx * p[this.neighbors[offset + 1]] + wy * p[this.neighbors[offset + 2]] + wy * p[this.neighbors[offset + 3]];
|
|
511
|
+
p[i] += 1.7 * ((sum - this.divergence[i]) * this.inverseWeight[i] - p[i]);
|
|
512
|
+
}
|
|
513
|
+
this.projectionIterations = iteration + 1;
|
|
514
|
+
if ((iteration & 7) === 7) {
|
|
515
|
+
this.projectionResidual = this.pressureResidual();
|
|
516
|
+
if (this.projectionResidual <= 1e-3) break;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
for (let y = 0; y < ny; y++) {
|
|
520
|
+
for (let x = 0; x <= nx; x++) {
|
|
521
|
+
const i = y * (nx + 1) + x;
|
|
522
|
+
if (this.fixedU[i]) continue;
|
|
523
|
+
this.u[i] -= ((x < nx ? p[y * nx + x] : 0) - (x > 0 ? p[y * nx + x - 1] : 0)) / dx;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
for (let y = 0; y <= ny; y++) {
|
|
527
|
+
for (let x = 0; x < nx; x++) {
|
|
528
|
+
const i = y * nx + x;
|
|
529
|
+
if (this.fixedV[i]) continue;
|
|
530
|
+
this.v[i] -= ((y < ny ? p[i] : 0) - (y > 0 ? p[i - nx] : 0)) / dy;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
pressureResidual() {
|
|
535
|
+
const { columns: nx, rows: ny, pressure: p, solid } = this;
|
|
536
|
+
const wx = 1 / (this.dx * this.dx), wy = 1 / (this.dy * this.dy);
|
|
537
|
+
let maximum = 0;
|
|
538
|
+
for (let y = 0; y < ny; y++) {
|
|
539
|
+
for (let x = 0; x < nx; x++) {
|
|
540
|
+
const i = y * nx + x;
|
|
541
|
+
if (solid[i]) continue;
|
|
542
|
+
const center = p[i];
|
|
543
|
+
let laplacian = 0;
|
|
544
|
+
if (x === 0) laplacian -= wx * center;
|
|
545
|
+
else if (!solid[i - 1]) laplacian += wx * (p[i - 1] - center);
|
|
546
|
+
if (x === nx - 1) laplacian -= wx * center;
|
|
547
|
+
else if (!solid[i + 1]) laplacian += wx * (p[i + 1] - center);
|
|
548
|
+
if (y === 0) laplacian -= wy * center;
|
|
549
|
+
else if (!solid[i - nx]) laplacian += wy * (p[i - nx] - center);
|
|
550
|
+
if (y === ny - 1) laplacian -= wy * center;
|
|
551
|
+
else if (!solid[i + nx]) laplacian += wy * (p[i + nx] - center);
|
|
552
|
+
maximum = Math.max(maximum, Math.abs(laplacian - this.divergence[i]));
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return maximum;
|
|
556
|
+
}
|
|
557
|
+
/** Diagnostic scans; not used by normal advancement. */
|
|
558
|
+
maximumSolidFluxError() {
|
|
559
|
+
let error = 0;
|
|
560
|
+
for (let i = 0; i < this.u.length; i++)
|
|
561
|
+
if (this.fixedU[i])
|
|
562
|
+
error = Math.max(error, Math.abs(this.u[i] - this.wallU[i]));
|
|
563
|
+
for (let i = 0; i < this.v.length; i++)
|
|
564
|
+
if (this.fixedV[i])
|
|
565
|
+
error = Math.max(error, Math.abs(this.v[i] - this.wallV[i]));
|
|
566
|
+
return error;
|
|
567
|
+
}
|
|
568
|
+
maximumDivergence() {
|
|
569
|
+
let maximum = 0;
|
|
570
|
+
const nx = this.columns;
|
|
571
|
+
for (let y = 0; y < this.rows; y++) {
|
|
572
|
+
for (let x = 0; x < nx; x++) {
|
|
573
|
+
const i = y * nx + x;
|
|
574
|
+
if (this.solid[i]) continue;
|
|
575
|
+
const d = (this.u[y * (nx + 1) + x + 1] - this.u[y * (nx + 1) + x]) / this.dx + (this.v[i + nx] - this.v[i]) / this.dy;
|
|
576
|
+
maximum = Math.max(maximum, Math.abs(d));
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
return maximum;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
export {
|
|
583
|
+
FlowFieldKernel2D
|
|
584
|
+
};
|
|
585
|
+
//# sourceMappingURL=field.js.map
|