@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,155 @@
|
|
|
1
|
+
import { transformPointInto } from "../math.js";
|
|
2
|
+
import { GEOMETRY_EPSILON } from "../numeric-policy.js";
|
|
3
|
+
function supportMinkowski2D(first, firstPose, second, secondPose, directionX, directionY) {
|
|
4
|
+
const points = new Float64Array(4);
|
|
5
|
+
const firstFeature = supportLeaf2D(points, 0, first, firstPose, directionX, directionY);
|
|
6
|
+
const secondFeature = supportLeaf2D(points, 2, second, secondPose, -directionX, -directionY);
|
|
7
|
+
return {
|
|
8
|
+
x: points[0] - points[2],
|
|
9
|
+
y: points[1] - points[3],
|
|
10
|
+
firstX: points[0],
|
|
11
|
+
firstY: points[1],
|
|
12
|
+
secondX: points[2],
|
|
13
|
+
secondY: points[3],
|
|
14
|
+
firstFeature,
|
|
15
|
+
secondFeature
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function supportLeaf2D(output, outputOffset, leaf, pose, directionX, directionY) {
|
|
19
|
+
const cosine = Math.cos(pose.rotationRadians);
|
|
20
|
+
const sine = Math.sin(pose.rotationRadians);
|
|
21
|
+
const localDirectionX = cosine * directionX + sine * directionY;
|
|
22
|
+
const localDirectionY = -sine * directionX + cosine * directionY;
|
|
23
|
+
const local = localSupport(leaf, localDirectionX, localDirectionY);
|
|
24
|
+
transformPointInto(output, outputOffset, local.x, local.y, pose);
|
|
25
|
+
return local.feature;
|
|
26
|
+
}
|
|
27
|
+
function centerOfLeaf2D(output, outputOffset, leaf, pose) {
|
|
28
|
+
let x;
|
|
29
|
+
let y;
|
|
30
|
+
switch (leaf.kind) {
|
|
31
|
+
case "circle":
|
|
32
|
+
case "ellipse":
|
|
33
|
+
case "box":
|
|
34
|
+
case "rounded-box":
|
|
35
|
+
x = leaf.center[0];
|
|
36
|
+
y = leaf.center[1];
|
|
37
|
+
break;
|
|
38
|
+
case "capsule":
|
|
39
|
+
case "segment":
|
|
40
|
+
x = (leaf.start[0] + leaf.end[0]) / 2;
|
|
41
|
+
y = (leaf.start[1] + leaf.end[1]) / 2;
|
|
42
|
+
break;
|
|
43
|
+
case "polygon": {
|
|
44
|
+
x = 0;
|
|
45
|
+
y = 0;
|
|
46
|
+
const count = leaf.vertices.length / 2;
|
|
47
|
+
for (let index = 0; index < count; index += 1) {
|
|
48
|
+
x += leaf.vertices[index * 2];
|
|
49
|
+
y += leaf.vertices[index * 2 + 1];
|
|
50
|
+
}
|
|
51
|
+
x /= count;
|
|
52
|
+
y /= count;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
transformPointInto(output, outputOffset, x, y, pose);
|
|
57
|
+
}
|
|
58
|
+
function localSupport(leaf, directionX, directionY) {
|
|
59
|
+
const length = Math.hypot(directionX, directionY);
|
|
60
|
+
const unitX = length > GEOMETRY_EPSILON ? directionX / length : 1;
|
|
61
|
+
const unitY = length > GEOMETRY_EPSILON ? directionY / length : 0;
|
|
62
|
+
switch (leaf.kind) {
|
|
63
|
+
case "circle":
|
|
64
|
+
return { x: leaf.center[0] + unitX * leaf.radius, y: leaf.center[1] + unitY * leaf.radius, feature: 0 };
|
|
65
|
+
case "ellipse": {
|
|
66
|
+
const cosine = Math.cos(leaf.rotationRadians);
|
|
67
|
+
const sine = Math.sin(leaf.rotationRadians);
|
|
68
|
+
const dx = cosine * directionX + sine * directionY;
|
|
69
|
+
const dy = -sine * directionX + cosine * directionY;
|
|
70
|
+
const denominator = Math.hypot(leaf.radiusX * dx, leaf.radiusY * dy);
|
|
71
|
+
const ellipseX = denominator > GEOMETRY_EPSILON ? leaf.radiusX * leaf.radiusX * dx / denominator : leaf.radiusX;
|
|
72
|
+
const ellipseY = denominator > GEOMETRY_EPSILON ? leaf.radiusY * leaf.radiusY * dy / denominator : 0;
|
|
73
|
+
return {
|
|
74
|
+
x: leaf.center[0] + cosine * ellipseX - sine * ellipseY,
|
|
75
|
+
y: leaf.center[1] + sine * ellipseX + cosine * ellipseY,
|
|
76
|
+
feature: 0
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
case "box": {
|
|
80
|
+
const vertices = [
|
|
81
|
+
[-leaf.halfWidth, -leaf.halfHeight],
|
|
82
|
+
[leaf.halfWidth, -leaf.halfHeight],
|
|
83
|
+
[leaf.halfWidth, leaf.halfHeight],
|
|
84
|
+
[-leaf.halfWidth, leaf.halfHeight]
|
|
85
|
+
];
|
|
86
|
+
let best = 0;
|
|
87
|
+
let bestProjection = Number.NEGATIVE_INFINITY;
|
|
88
|
+
for (let index = 0; index < vertices.length; index += 1) {
|
|
89
|
+
const vertex2 = vertices[index];
|
|
90
|
+
const projection = vertex2[0] * directionX + vertex2[1] * directionY;
|
|
91
|
+
if (projection > bestProjection) {
|
|
92
|
+
best = index;
|
|
93
|
+
bestProjection = projection;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const vertex = vertices[best];
|
|
97
|
+
return { x: leaf.center[0] + vertex[0], y: leaf.center[1] + vertex[1], feature: best };
|
|
98
|
+
}
|
|
99
|
+
case "rounded-box": {
|
|
100
|
+
let bestX = 0;
|
|
101
|
+
let bestY = 0;
|
|
102
|
+
let bestProjection = Number.NEGATIVE_INFINITY;
|
|
103
|
+
let bestFeature = 0;
|
|
104
|
+
for (let feature = 0; feature < 4; feature += 1) {
|
|
105
|
+
const radius = leaf.radii[feature];
|
|
106
|
+
const right = feature === 1 || feature === 2;
|
|
107
|
+
const bottom = feature >= 2;
|
|
108
|
+
const x = leaf.center[0] + (right ? leaf.halfWidth - radius : -leaf.halfWidth + radius) + unitX * radius;
|
|
109
|
+
const y = leaf.center[1] + (bottom ? leaf.halfHeight - radius : -leaf.halfHeight + radius) + unitY * radius;
|
|
110
|
+
const projection = x * directionX + y * directionY;
|
|
111
|
+
if (projection > bestProjection + GEOMETRY_EPSILON) {
|
|
112
|
+
bestX = x;
|
|
113
|
+
bestY = y;
|
|
114
|
+
bestProjection = projection;
|
|
115
|
+
bestFeature = feature;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return { x: bestX, y: bestY, feature: bestFeature };
|
|
119
|
+
}
|
|
120
|
+
case "capsule": {
|
|
121
|
+
const startProjection = leaf.start[0] * directionX + leaf.start[1] * directionY;
|
|
122
|
+
const endProjection = leaf.end[0] * directionX + leaf.end[1] * directionY;
|
|
123
|
+
const feature = endProjection > startProjection ? 1 : 0;
|
|
124
|
+
const endpoint = feature === 0 ? leaf.start : leaf.end;
|
|
125
|
+
return { x: endpoint[0] + unitX * leaf.radius, y: endpoint[1] + unitY * leaf.radius, feature };
|
|
126
|
+
}
|
|
127
|
+
case "segment": {
|
|
128
|
+
const startProjection = leaf.start[0] * directionX + leaf.start[1] * directionY;
|
|
129
|
+
const endProjection = leaf.end[0] * directionX + leaf.end[1] * directionY;
|
|
130
|
+
const feature = endProjection > startProjection ? 1 : 0;
|
|
131
|
+
const endpoint = feature === 0 ? leaf.start : leaf.end;
|
|
132
|
+
return { x: endpoint[0], y: endpoint[1], feature };
|
|
133
|
+
}
|
|
134
|
+
case "polygon": {
|
|
135
|
+
let best = 0;
|
|
136
|
+
let bestProjection = Number.NEGATIVE_INFINITY;
|
|
137
|
+
for (let index = 0; index < leaf.vertices.length / 2; index += 1) {
|
|
138
|
+
const x = leaf.vertices[index * 2];
|
|
139
|
+
const y = leaf.vertices[index * 2 + 1];
|
|
140
|
+
const projection = x * directionX + y * directionY;
|
|
141
|
+
if (projection > bestProjection) {
|
|
142
|
+
best = index;
|
|
143
|
+
bestProjection = projection;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return { x: leaf.vertices[best * 2], y: leaf.vertices[best * 2 + 1], feature: best };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export {
|
|
151
|
+
centerOfLeaf2D,
|
|
152
|
+
supportLeaf2D,
|
|
153
|
+
supportMinkowski2D
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=support.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/features/physics/lib/2d/collision/support.ts"],
|
|
4
|
+
"sourcesContent": ["import { transformPointInto, type InternalPose2D } from '../math.js';\nimport { GEOMETRY_EPSILON } from '../numeric-policy.js';\nimport type { ConvexLeaf2D } from '../shape-records.js';\n\nexport interface SupportPoint2D {\n readonly x: number;\n readonly y: number;\n readonly feature: number;\n}\n\nexport interface MinkowskiVertex2D {\n readonly x: number;\n readonly y: number;\n readonly firstX: number;\n readonly firstY: number;\n readonly secondX: number;\n readonly secondY: number;\n readonly firstFeature: number;\n readonly secondFeature: number;\n}\n\nexport function supportMinkowski2D(\n first: ConvexLeaf2D,\n firstPose: InternalPose2D,\n second: ConvexLeaf2D,\n secondPose: InternalPose2D,\n directionX: number,\n directionY: number,\n): MinkowskiVertex2D {\n const points = new Float64Array(4);\n const firstFeature = supportLeaf2D(points, 0, first, firstPose, directionX, directionY);\n const secondFeature = supportLeaf2D(points, 2, second, secondPose, -directionX, -directionY);\n return {\n x: points[0]! - points[2]!,\n y: points[1]! - points[3]!,\n firstX: points[0]!,\n firstY: points[1]!,\n secondX: points[2]!,\n secondY: points[3]!,\n firstFeature,\n secondFeature,\n };\n}\n\nexport function supportLeaf2D(\n output: Float64Array,\n outputOffset: number,\n leaf: ConvexLeaf2D,\n pose: InternalPose2D,\n directionX: number,\n directionY: number,\n): number {\n const cosine = Math.cos(pose.rotationRadians);\n const sine = Math.sin(pose.rotationRadians);\n const localDirectionX = cosine * directionX + sine * directionY;\n const localDirectionY = -sine * directionX + cosine * directionY;\n const local = localSupport(leaf, localDirectionX, localDirectionY);\n transformPointInto(output, outputOffset, local.x, local.y, pose);\n return local.feature;\n}\n\nexport function centerOfLeaf2D(\n output: Float64Array,\n outputOffset: number,\n leaf: ConvexLeaf2D,\n pose: InternalPose2D,\n): void {\n let x: number;\n let y: number;\n switch (leaf.kind) {\n case 'circle':\n case 'ellipse':\n case 'box':\n case 'rounded-box':\n x = leaf.center[0]!;\n y = leaf.center[1]!;\n break;\n case 'capsule':\n case 'segment':\n x = (leaf.start[0]! + leaf.end[0]!) / 2;\n y = (leaf.start[1]! + leaf.end[1]!) / 2;\n break;\n case 'polygon': {\n x = 0;\n y = 0;\n const count = leaf.vertices.length / 2;\n for (let index = 0; index < count; index += 1) {\n x += leaf.vertices[index * 2]!;\n y += leaf.vertices[index * 2 + 1]!;\n }\n x /= count;\n y /= count;\n break;\n }\n }\n transformPointInto(output, outputOffset, x, y, pose);\n}\n\nfunction localSupport(\n leaf: ConvexLeaf2D,\n directionX: number,\n directionY: number,\n): SupportPoint2D {\n const length = Math.hypot(directionX, directionY);\n const unitX = length > GEOMETRY_EPSILON ? directionX / length : 1;\n const unitY = length > GEOMETRY_EPSILON ? directionY / length : 0;\n switch (leaf.kind) {\n case 'circle':\n return { x: leaf.center[0]! + unitX * leaf.radius, y: leaf.center[1]! + unitY * leaf.radius, feature: 0 };\n case 'ellipse': {\n const cosine = Math.cos(leaf.rotationRadians);\n const sine = Math.sin(leaf.rotationRadians);\n const dx = cosine * directionX + sine * directionY;\n const dy = -sine * directionX + cosine * directionY;\n const denominator = Math.hypot(leaf.radiusX * dx, leaf.radiusY * dy);\n const ellipseX = denominator > GEOMETRY_EPSILON\n ? leaf.radiusX * leaf.radiusX * dx / denominator\n : leaf.radiusX;\n const ellipseY = denominator > GEOMETRY_EPSILON\n ? leaf.radiusY * leaf.radiusY * dy / denominator\n : 0;\n return {\n x: leaf.center[0]! + cosine * ellipseX - sine * ellipseY,\n y: leaf.center[1]! + sine * ellipseX + cosine * ellipseY,\n feature: 0,\n };\n }\n case 'box': {\n const vertices = [\n [-leaf.halfWidth, -leaf.halfHeight],\n [leaf.halfWidth, -leaf.halfHeight],\n [leaf.halfWidth, leaf.halfHeight],\n [-leaf.halfWidth, leaf.halfHeight],\n ] as const;\n let best = 0;\n let bestProjection = Number.NEGATIVE_INFINITY;\n for (let index = 0; index < vertices.length; index += 1) {\n const vertex = vertices[index]!;\n const projection = vertex[0] * directionX + vertex[1] * directionY;\n if (projection > bestProjection) {\n best = index;\n bestProjection = projection;\n }\n }\n const vertex = vertices[best]!;\n return { x: leaf.center[0]! + vertex[0], y: leaf.center[1]! + vertex[1], feature: best };\n }\n case 'rounded-box': {\n let bestX = 0;\n let bestY = 0;\n let bestProjection = Number.NEGATIVE_INFINITY;\n let bestFeature = 0;\n for (let feature = 0; feature < 4; feature += 1) {\n const radius = leaf.radii[feature]!;\n const right = feature === 1 || feature === 2;\n const bottom = feature >= 2;\n const x = leaf.center[0]! + (right ? leaf.halfWidth - radius : -leaf.halfWidth + radius) + unitX * radius;\n const y = leaf.center[1]! + (bottom ? leaf.halfHeight - radius : -leaf.halfHeight + radius) + unitY * radius;\n const projection = x * directionX + y * directionY;\n if (projection > bestProjection + GEOMETRY_EPSILON) {\n bestX = x;\n bestY = y;\n bestProjection = projection;\n bestFeature = feature;\n }\n }\n return { x: bestX, y: bestY, feature: bestFeature };\n }\n case 'capsule': {\n const startProjection = leaf.start[0]! * directionX + leaf.start[1]! * directionY;\n const endProjection = leaf.end[0]! * directionX + leaf.end[1]! * directionY;\n const feature = endProjection > startProjection ? 1 : 0;\n const endpoint = feature === 0 ? leaf.start : leaf.end;\n return { x: endpoint[0]! + unitX * leaf.radius, y: endpoint[1]! + unitY * leaf.radius, feature };\n }\n case 'segment': {\n const startProjection = leaf.start[0]! * directionX + leaf.start[1]! * directionY;\n const endProjection = leaf.end[0]! * directionX + leaf.end[1]! * directionY;\n const feature = endProjection > startProjection ? 1 : 0;\n const endpoint = feature === 0 ? leaf.start : leaf.end;\n return { x: endpoint[0]!, y: endpoint[1]!, feature };\n }\n case 'polygon': {\n let best = 0;\n let bestProjection = Number.NEGATIVE_INFINITY;\n for (let index = 0; index < leaf.vertices.length / 2; index += 1) {\n const x = leaf.vertices[index * 2]!;\n const y = leaf.vertices[index * 2 + 1]!;\n const projection = x * directionX + y * directionY;\n if (projection > bestProjection) {\n best = index;\n bestProjection = projection;\n }\n }\n return { x: leaf.vertices[best * 2]!, y: leaf.vertices[best * 2 + 1]!, feature: best };\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["vertex"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { PibblPhysicsAabb2D, PibblPhysicsContactPoint2D, PibblPhysicsPose2D, PibblPhysicsVector2 } from "../../2d-geometry.js";
|
|
2
|
+
/**
|
|
3
|
+
* Diagnostic body identity, committed and presented poses, motion, sleeping state, and mass.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link PibblPhysicsPose2D}
|
|
6
|
+
* @see {@link PibblPhysicsVector2}
|
|
7
|
+
* @see {@link PibblPhysicsInspection2D}
|
|
8
|
+
*/
|
|
9
|
+
export interface PibblPhysicsBodyInspection2D {
|
|
10
|
+
/** Stable identifier of this resource or connection. See {@link PibblPhysicsBodyInspection2D}. */
|
|
11
|
+
readonly id: number;
|
|
12
|
+
/**
|
|
13
|
+
* Generation counter distinguishing successive bindings of a stable identity. See
|
|
14
|
+
* {@link PibblPhysicsBodyInspection2D}.
|
|
15
|
+
*/
|
|
16
|
+
readonly generation: number;
|
|
17
|
+
/**
|
|
18
|
+
* Selects `"dynamic"` , `"kinematic"` , `"static"` for type. See
|
|
19
|
+
* {@link PibblPhysicsBodyInspection2D}.
|
|
20
|
+
*/
|
|
21
|
+
readonly type: "dynamic" | "kinematic" | "static";
|
|
22
|
+
/**
|
|
23
|
+
* Whether this operation or resource participates in updates. See
|
|
24
|
+
* {@link PibblPhysicsBodyInspection2D}.
|
|
25
|
+
*/
|
|
26
|
+
readonly enabled: boolean;
|
|
27
|
+
/** Whether the body is currently sleeping. See {@link PibblPhysicsBodyInspection2D}. */
|
|
28
|
+
readonly sleeping: boolean;
|
|
29
|
+
/** Committed physical position and rotation. See {@link PibblPhysicsPose2D}. */
|
|
30
|
+
readonly pose: PibblPhysicsPose2D;
|
|
31
|
+
/** Interpolated pose currently used for drawing. See {@link PibblPhysicsPose2D}. */
|
|
32
|
+
readonly presentationPose: PibblPhysicsPose2D;
|
|
33
|
+
/** Center of mass in the reported physics coordinate system. See {@link PibblPhysicsVector2}. */
|
|
34
|
+
readonly centerOfMass: PibblPhysicsVector2;
|
|
35
|
+
/**
|
|
36
|
+
* Linear velocity in the simulation coordinate system per second. See {@link PibblPhysicsVector2}
|
|
37
|
+
* .
|
|
38
|
+
*/
|
|
39
|
+
readonly linearVelocity: PibblPhysicsVector2;
|
|
40
|
+
/** Angular velocity in degrees per second. See {@link PibblPhysicsBodyInspection2D}. */
|
|
41
|
+
readonly angularVelocityDegreesPerSecond: number;
|
|
42
|
+
/** Mass used by the spring or physics calculation. See {@link PibblPhysicsBodyInspection2D}. */
|
|
43
|
+
readonly mass: number | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Serializable collider identity, shape kinds, bounds, sensor state, and string label.
|
|
47
|
+
*
|
|
48
|
+
* @see {@link PibblPhysicsAabb2D}
|
|
49
|
+
* @see {@link PibblPhysicsInspection2D}
|
|
50
|
+
*/
|
|
51
|
+
export interface PibblPhysicsColliderInspection2D {
|
|
52
|
+
/**
|
|
53
|
+
* Stable identifier of this resource or connection. See {@link PibblPhysicsColliderInspection2D}.
|
|
54
|
+
*/
|
|
55
|
+
readonly id: number;
|
|
56
|
+
/**
|
|
57
|
+
* Generation counter distinguishing successive bindings of a stable identity. See
|
|
58
|
+
* {@link PibblPhysicsColliderInspection2D}.
|
|
59
|
+
*/
|
|
60
|
+
readonly generation: number;
|
|
61
|
+
/** Identifier of the collider's owning body. See {@link PibblPhysicsColliderInspection2D}. */
|
|
62
|
+
readonly bodyId: number;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the collider reports overlaps instead of producing contact response. See
|
|
65
|
+
* {@link PibblPhysicsColliderInspection2D}.
|
|
66
|
+
*/
|
|
67
|
+
readonly sensor: boolean;
|
|
68
|
+
/** String tags only. Arbitrary application objects are never serialized. */
|
|
69
|
+
readonly label: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Kinds of shape geometry represented by the collider. See
|
|
72
|
+
* {@link PibblPhysicsColliderInspection2D}.
|
|
73
|
+
*/
|
|
74
|
+
readonly shapeKinds: readonly string[];
|
|
75
|
+
/** Logical region constraining the content or query. See {@link PibblPhysicsAabb2D}. */
|
|
76
|
+
readonly bounds: PibblPhysicsAabb2D;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Diagnostic contact geometry and impulse between two collider identities.
|
|
80
|
+
*
|
|
81
|
+
* @see {@link PibblPhysicsVector2}
|
|
82
|
+
* @see {@link PibblPhysicsContactPoint2D}
|
|
83
|
+
* @see {@link PibblPhysicsInspection2D}
|
|
84
|
+
*/
|
|
85
|
+
export interface PibblPhysicsContactInspection2D {
|
|
86
|
+
/**
|
|
87
|
+
* Identifier of the first collider in the contact pair. See
|
|
88
|
+
* {@link PibblPhysicsContactInspection2D}.
|
|
89
|
+
*/
|
|
90
|
+
readonly firstColliderId: number;
|
|
91
|
+
/**
|
|
92
|
+
* Identifier of the second collider in the contact pair. See
|
|
93
|
+
* {@link PibblPhysicsContactInspection2D}.
|
|
94
|
+
*/
|
|
95
|
+
readonly secondColliderId: number;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the collider reports overlaps instead of producing contact response. See
|
|
98
|
+
* {@link PibblPhysicsContactInspection2D}.
|
|
99
|
+
*/
|
|
100
|
+
readonly sensor: boolean;
|
|
101
|
+
/** Contact or surface normal returned by this query. See {@link PibblPhysicsVector2}. */
|
|
102
|
+
readonly normal: PibblPhysicsVector2;
|
|
103
|
+
/**
|
|
104
|
+
* Points defining the geometry or reported by the contact query. See
|
|
105
|
+
* {@link PibblPhysicsContactPoint2D}.
|
|
106
|
+
*/
|
|
107
|
+
readonly points: readonly PibblPhysicsContactPoint2D[];
|
|
108
|
+
/** Normal contact impulse reported by the solver. See {@link PibblPhysicsContactInspection2D}. */
|
|
109
|
+
readonly normalImpulse: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Read-only observations, not an engine serialization/restore format.
|
|
113
|
+
*
|
|
114
|
+
* @see {@link PibblPhysicsBodyInspection2D}
|
|
115
|
+
* @see {@link PibblPhysicsColliderInspection2D}
|
|
116
|
+
* @see {@link PibblPhysicsContactInspection2D}
|
|
117
|
+
*/
|
|
118
|
+
export interface PibblPhysicsInspection2D {
|
|
119
|
+
/**
|
|
120
|
+
* The literal "rapier-2d@0.21.0" identifying this variant. See {@link PibblPhysicsInspection2D}.
|
|
121
|
+
*/
|
|
122
|
+
readonly engine: "rapier-2d@0.21.0";
|
|
123
|
+
/** Selects `"root"`, `"local"` for space. See {@link PibblPhysicsInspection2D}. */
|
|
124
|
+
readonly space: "root" | "local";
|
|
125
|
+
/**
|
|
126
|
+
* Revision used to detect changes to the underlying state or geometry. See
|
|
127
|
+
* {@link PibblPhysicsInspection2D}.
|
|
128
|
+
*/
|
|
129
|
+
readonly revision: number;
|
|
130
|
+
/** Simulation tick associated with this observation. See {@link PibblPhysicsInspection2D}. */
|
|
131
|
+
readonly tick: number;
|
|
132
|
+
/**
|
|
133
|
+
* Whether the inspected world is actively advancing simulation. See
|
|
134
|
+
* {@link PibblPhysicsInspection2D}.
|
|
135
|
+
*/
|
|
136
|
+
readonly advancing: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Number of scheduler frames in which this world failed to advance. See
|
|
139
|
+
* {@link PibblPhysicsInspection2D}.
|
|
140
|
+
*/
|
|
141
|
+
readonly failedFrames: number;
|
|
142
|
+
/**
|
|
143
|
+
* Diagnostic information about the most recent simulation failure. See
|
|
144
|
+
* {@link PibblPhysicsInspection2D}.
|
|
145
|
+
*/
|
|
146
|
+
readonly lastFailure: string | null;
|
|
147
|
+
/** Committed body snapshots in the inspected world. See {@link PibblPhysicsBodyInspection2D}. */
|
|
148
|
+
readonly bodies: readonly PibblPhysicsBodyInspection2D[];
|
|
149
|
+
/**
|
|
150
|
+
* Committed collider snapshots in the inspected world. See
|
|
151
|
+
* {@link PibblPhysicsColliderInspection2D}.
|
|
152
|
+
*/
|
|
153
|
+
readonly colliders: readonly PibblPhysicsColliderInspection2D[];
|
|
154
|
+
/**
|
|
155
|
+
* Committed contact snapshots in the inspected world. See {@link PibblPhysicsContactInspection2D}
|
|
156
|
+
* .
|
|
157
|
+
*/
|
|
158
|
+
readonly contacts: readonly PibblPhysicsContactInspection2D[];
|
|
159
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PibblPhysicsAabb2D, PibblPhysicsPose2D, PibblPhysicsVector2 } from '../../2d-geometry.js';
|
|
2
|
+
export declare const CURVE_FLATTENING_TOLERANCE = 0.05;
|
|
3
|
+
export declare const CURVE_FLATTENING_MAX_DEPTH = 12;
|
|
4
|
+
export interface InternalPose2D {
|
|
5
|
+
readonly x: number;
|
|
6
|
+
readonly y: number;
|
|
7
|
+
readonly rotationRadians: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDENTITY_POSE_2D: InternalPose2D;
|
|
10
|
+
export declare function copyPose2D(pose: PibblPhysicsPose2D | undefined, path: string): InternalPose2D;
|
|
11
|
+
/** Returns outer(inner(point)). */
|
|
12
|
+
export declare function composePose2D(outer: InternalPose2D, inner: InternalPose2D): InternalPose2D;
|
|
13
|
+
export declare function transformPointInto(output: Float64Array, outputOffset: number, x: number, y: number, pose: InternalPose2D): void;
|
|
14
|
+
export declare function cross2D(ax: number, ay: number, bx: number, by: number, cx: number, cy: number): number;
|
|
15
|
+
export declare function canonicalizeContour2D(source: readonly PibblPhysicsVector2[], options: Readonly<{
|
|
16
|
+
strictlyConvex: boolean;
|
|
17
|
+
path: string;
|
|
18
|
+
}>): Float64Array;
|
|
19
|
+
export declare function triangulateContour2D(vertices: Float64Array): readonly Float64Array[];
|
|
20
|
+
export declare function polygonMassData2D(vertices: Float64Array): Readonly<{
|
|
21
|
+
area: number;
|
|
22
|
+
centroidX: number;
|
|
23
|
+
centroidY: number;
|
|
24
|
+
unitInertia: number;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function freezeBounds2D(minX: number, minY: number, maxX: number, maxY: number): PibblPhysicsAabb2D;
|
|
27
|
+
export declare function cleanZero(value: number): number;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { copyFiniteVector2, requireFiniteNumber } from "../shared/validation.js";
|
|
2
|
+
import { DEGREES_TO_RADIANS, GEOMETRY_EPSILON } from "./numeric-policy.js";
|
|
3
|
+
const CURVE_FLATTENING_TOLERANCE = 0.05;
|
|
4
|
+
const CURVE_FLATTENING_MAX_DEPTH = 12;
|
|
5
|
+
const IDENTITY_POSE_2D = Object.freeze({
|
|
6
|
+
x: 0,
|
|
7
|
+
y: 0,
|
|
8
|
+
rotationRadians: 0
|
|
9
|
+
});
|
|
10
|
+
function copyPose2D(pose, path) {
|
|
11
|
+
if (pose === void 0) {
|
|
12
|
+
return IDENTITY_POSE_2D;
|
|
13
|
+
}
|
|
14
|
+
const position = copyFiniteVector2(pose.position, `${path}.position`);
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
x: position[0],
|
|
17
|
+
y: position[1],
|
|
18
|
+
rotationRadians: requireFiniteNumber(pose.rotationDegrees, `${path}.rotationDegrees`) * DEGREES_TO_RADIANS
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function composePose2D(outer, inner) {
|
|
22
|
+
const cosine = Math.cos(outer.rotationRadians);
|
|
23
|
+
const sine = Math.sin(outer.rotationRadians);
|
|
24
|
+
return Object.freeze({
|
|
25
|
+
x: outer.x + cosine * inner.x - sine * inner.y,
|
|
26
|
+
y: outer.y + sine * inner.x + cosine * inner.y,
|
|
27
|
+
rotationRadians: outer.rotationRadians + inner.rotationRadians
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function transformPointInto(output, outputOffset, x, y, pose) {
|
|
31
|
+
const cosine = Math.cos(pose.rotationRadians);
|
|
32
|
+
const sine = Math.sin(pose.rotationRadians);
|
|
33
|
+
output[outputOffset] = pose.x + cosine * x - sine * y;
|
|
34
|
+
output[outputOffset + 1] = pose.y + sine * x + cosine * y;
|
|
35
|
+
}
|
|
36
|
+
function cross2D(ax, ay, bx, by, cx, cy) {
|
|
37
|
+
return (bx - ax) * (cy - ay) - (by - ay) * (cx - ax);
|
|
38
|
+
}
|
|
39
|
+
function canonicalizeContour2D(source, options) {
|
|
40
|
+
const copied = source.map((point, index) => {
|
|
41
|
+
const owned = copyFiniteVector2(point, `${options.path}[${index}]`);
|
|
42
|
+
return [owned[0], owned[1]];
|
|
43
|
+
});
|
|
44
|
+
if (copied.length > 1 && copied[0][0] === copied.at(-1)[0] && copied[0][1] === copied.at(-1)[1]) {
|
|
45
|
+
copied.pop();
|
|
46
|
+
}
|
|
47
|
+
if (copied.length < 3) {
|
|
48
|
+
throw new RangeError(`${options.path} must contain at least three vertices.`);
|
|
49
|
+
}
|
|
50
|
+
const cleaned = options.strictlyConvex ? copied : removeCollinearAndAdjacentDuplicates(copied);
|
|
51
|
+
for (let first = 0; first < cleaned.length; first += 1) {
|
|
52
|
+
for (let second = first + 1; second < cleaned.length; second += 1) {
|
|
53
|
+
if (cleaned[first][0] === cleaned[second][0] && cleaned[first][1] === cleaned[second][1]) {
|
|
54
|
+
throw new RangeError(`${options.path} must not contain duplicate vertices.`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (cleaned.length < 3) {
|
|
59
|
+
throw new RangeError(`${options.path} must enclose a nonzero area.`);
|
|
60
|
+
}
|
|
61
|
+
if (hasSelfIntersection(cleaned)) {
|
|
62
|
+
throw new RangeError(`${options.path} must describe a simple polygon.`);
|
|
63
|
+
}
|
|
64
|
+
let signedTwiceArea = 0;
|
|
65
|
+
for (let index = 0; index < cleaned.length; index += 1) {
|
|
66
|
+
const current = cleaned[index];
|
|
67
|
+
const next = cleaned[(index + 1) % cleaned.length];
|
|
68
|
+
signedTwiceArea += current[0] * next[1] - next[0] * current[1];
|
|
69
|
+
}
|
|
70
|
+
if (Math.abs(signedTwiceArea) <= GEOMETRY_EPSILON) {
|
|
71
|
+
throw new RangeError(`${options.path} must enclose a nonzero area.`);
|
|
72
|
+
}
|
|
73
|
+
if (signedTwiceArea < 0) {
|
|
74
|
+
cleaned.reverse();
|
|
75
|
+
}
|
|
76
|
+
if (options.strictlyConvex) {
|
|
77
|
+
for (let index = 0; index < cleaned.length; index += 1) {
|
|
78
|
+
const previous = cleaned[(index + cleaned.length - 1) % cleaned.length];
|
|
79
|
+
const current = cleaned[index];
|
|
80
|
+
const next = cleaned[(index + 1) % cleaned.length];
|
|
81
|
+
if (cross2D(
|
|
82
|
+
previous[0],
|
|
83
|
+
previous[1],
|
|
84
|
+
current[0],
|
|
85
|
+
current[1],
|
|
86
|
+
next[0],
|
|
87
|
+
next[1]
|
|
88
|
+
) <= GEOMETRY_EPSILON) {
|
|
89
|
+
throw new RangeError(
|
|
90
|
+
`${options.path} must describe a strictly convex polygon without collinear vertices.`
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
let start = 0;
|
|
96
|
+
for (let index = 1; index < cleaned.length; index += 1) {
|
|
97
|
+
const candidate = cleaned[index];
|
|
98
|
+
const selected = cleaned[start];
|
|
99
|
+
if (candidate[0] < selected[0] || candidate[0] === selected[0] && candidate[1] < selected[1]) {
|
|
100
|
+
start = index;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const result = new Float64Array(cleaned.length * 2);
|
|
104
|
+
for (let index = 0; index < cleaned.length; index += 1) {
|
|
105
|
+
const point = cleaned[(start + index) % cleaned.length];
|
|
106
|
+
result[index * 2] = point[0];
|
|
107
|
+
result[index * 2 + 1] = point[1];
|
|
108
|
+
}
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
function triangulateContour2D(vertices) {
|
|
112
|
+
const count = vertices.length / 2;
|
|
113
|
+
const remaining = Array.from({ length: count }, (_, index) => index);
|
|
114
|
+
const triangles = [];
|
|
115
|
+
while (remaining.length > 3) {
|
|
116
|
+
let selectedPosition = -1;
|
|
117
|
+
let selectedCanonicalIndex = Number.POSITIVE_INFINITY;
|
|
118
|
+
for (let position = 0; position < remaining.length; position += 1) {
|
|
119
|
+
const previous2 = remaining[(position + remaining.length - 1) % remaining.length];
|
|
120
|
+
const current2 = remaining[position];
|
|
121
|
+
const next2 = remaining[(position + 1) % remaining.length];
|
|
122
|
+
const turn = cross2D(
|
|
123
|
+
vertices[previous2 * 2],
|
|
124
|
+
vertices[previous2 * 2 + 1],
|
|
125
|
+
vertices[current2 * 2],
|
|
126
|
+
vertices[current2 * 2 + 1],
|
|
127
|
+
vertices[next2 * 2],
|
|
128
|
+
vertices[next2 * 2 + 1]
|
|
129
|
+
);
|
|
130
|
+
if (turn <= GEOMETRY_EPSILON) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
let containsVertex = false;
|
|
134
|
+
for (const candidate of remaining) {
|
|
135
|
+
if (candidate === previous2 || candidate === current2 || candidate === next2) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (pointInTriangle(vertices, candidate, previous2, current2, next2)) {
|
|
139
|
+
containsVertex = true;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (!containsVertex && current2 < selectedCanonicalIndex) {
|
|
144
|
+
selectedPosition = position;
|
|
145
|
+
selectedCanonicalIndex = current2;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (selectedPosition < 0) {
|
|
149
|
+
throw new RangeError("contour could not be triangulated deterministically.");
|
|
150
|
+
}
|
|
151
|
+
const previous = remaining[(selectedPosition + remaining.length - 1) % remaining.length];
|
|
152
|
+
const current = remaining[selectedPosition];
|
|
153
|
+
const next = remaining[(selectedPosition + 1) % remaining.length];
|
|
154
|
+
triangles.push(copyTriangle(vertices, previous, current, next));
|
|
155
|
+
remaining.splice(selectedPosition, 1);
|
|
156
|
+
}
|
|
157
|
+
triangles.push(copyTriangle(vertices, remaining[0], remaining[1], remaining[2]));
|
|
158
|
+
return Object.freeze(triangles);
|
|
159
|
+
}
|
|
160
|
+
function polygonMassData2D(vertices) {
|
|
161
|
+
let twiceArea = 0;
|
|
162
|
+
let centroidXTimesSixArea = 0;
|
|
163
|
+
let centroidYTimesSixArea = 0;
|
|
164
|
+
let inertiaTimesTwelve = 0;
|
|
165
|
+
for (let offset = 0; offset < vertices.length; offset += 2) {
|
|
166
|
+
const nextOffset = (offset + 2) % vertices.length;
|
|
167
|
+
const x1 = vertices[offset];
|
|
168
|
+
const y1 = vertices[offset + 1];
|
|
169
|
+
const x2 = vertices[nextOffset];
|
|
170
|
+
const y2 = vertices[nextOffset + 1];
|
|
171
|
+
const cross = x1 * y2 - x2 * y1;
|
|
172
|
+
twiceArea += cross;
|
|
173
|
+
centroidXTimesSixArea += (x1 + x2) * cross;
|
|
174
|
+
centroidYTimesSixArea += (y1 + y2) * cross;
|
|
175
|
+
inertiaTimesTwelve += cross * (x1 * x1 + x1 * x2 + x2 * x2 + y1 * y1 + y1 * y2 + y2 * y2);
|
|
176
|
+
}
|
|
177
|
+
const area = twiceArea / 2;
|
|
178
|
+
const centroidX = centroidXTimesSixArea / (3 * twiceArea);
|
|
179
|
+
const centroidY = centroidYTimesSixArea / (3 * twiceArea);
|
|
180
|
+
const inertiaAboutOrigin = inertiaTimesTwelve / 12;
|
|
181
|
+
return Object.freeze({
|
|
182
|
+
area,
|
|
183
|
+
centroidX,
|
|
184
|
+
centroidY,
|
|
185
|
+
unitInertia: inertiaAboutOrigin - area * (centroidX * centroidX + centroidY * centroidY)
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function freezeBounds2D(minX, minY, maxX, maxY) {
|
|
189
|
+
return Object.freeze({
|
|
190
|
+
min: Object.freeze([cleanZero(minX), cleanZero(minY)]),
|
|
191
|
+
max: Object.freeze([cleanZero(maxX), cleanZero(maxY)])
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function cleanZero(value) {
|
|
195
|
+
return Object.is(value, -0) ? 0 : value;
|
|
196
|
+
}
|
|
197
|
+
function removeCollinearAndAdjacentDuplicates(source) {
|
|
198
|
+
const points = source.filter((point, index) => {
|
|
199
|
+
const previous = source[(index + source.length - 1) % source.length];
|
|
200
|
+
return point[0] !== previous[0] || point[1] !== previous[1];
|
|
201
|
+
});
|
|
202
|
+
let removed = true;
|
|
203
|
+
while (removed && points.length >= 3) {
|
|
204
|
+
removed = false;
|
|
205
|
+
for (let index = 0; index < points.length; index += 1) {
|
|
206
|
+
const previous = points[(index + points.length - 1) % points.length];
|
|
207
|
+
const current = points[index];
|
|
208
|
+
const next = points[(index + 1) % points.length];
|
|
209
|
+
if (Math.abs(
|
|
210
|
+
cross2D(
|
|
211
|
+
previous[0],
|
|
212
|
+
previous[1],
|
|
213
|
+
current[0],
|
|
214
|
+
current[1],
|
|
215
|
+
next[0],
|
|
216
|
+
next[1]
|
|
217
|
+
)
|
|
218
|
+
) <= GEOMETRY_EPSILON) {
|
|
219
|
+
points.splice(index, 1);
|
|
220
|
+
removed = true;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return points;
|
|
226
|
+
}
|
|
227
|
+
function hasSelfIntersection(points) {
|
|
228
|
+
for (let first = 0; first < points.length; first += 1) {
|
|
229
|
+
const firstNext = (first + 1) % points.length;
|
|
230
|
+
for (let second = first + 1; second < points.length; second += 1) {
|
|
231
|
+
const secondNext = (second + 1) % points.length;
|
|
232
|
+
if (first === second || firstNext === second || secondNext === first) {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if (segmentsIntersect(
|
|
236
|
+
points[first],
|
|
237
|
+
points[firstNext],
|
|
238
|
+
points[second],
|
|
239
|
+
points[secondNext]
|
|
240
|
+
)) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
function segmentsIntersect(firstStart, firstEnd, secondStart, secondEnd) {
|
|
248
|
+
const firstSide = cross2D(
|
|
249
|
+
firstStart[0],
|
|
250
|
+
firstStart[1],
|
|
251
|
+
firstEnd[0],
|
|
252
|
+
firstEnd[1],
|
|
253
|
+
secondStart[0],
|
|
254
|
+
secondStart[1]
|
|
255
|
+
);
|
|
256
|
+
const secondSide = cross2D(
|
|
257
|
+
firstStart[0],
|
|
258
|
+
firstStart[1],
|
|
259
|
+
firstEnd[0],
|
|
260
|
+
firstEnd[1],
|
|
261
|
+
secondEnd[0],
|
|
262
|
+
secondEnd[1]
|
|
263
|
+
);
|
|
264
|
+
const thirdSide = cross2D(
|
|
265
|
+
secondStart[0],
|
|
266
|
+
secondStart[1],
|
|
267
|
+
secondEnd[0],
|
|
268
|
+
secondEnd[1],
|
|
269
|
+
firstStart[0],
|
|
270
|
+
firstStart[1]
|
|
271
|
+
);
|
|
272
|
+
const fourthSide = cross2D(
|
|
273
|
+
secondStart[0],
|
|
274
|
+
secondStart[1],
|
|
275
|
+
secondEnd[0],
|
|
276
|
+
secondEnd[1],
|
|
277
|
+
firstEnd[0],
|
|
278
|
+
firstEnd[1]
|
|
279
|
+
);
|
|
280
|
+
return Math.sign(firstSide) !== Math.sign(secondSide) && Math.sign(thirdSide) !== Math.sign(fourthSide);
|
|
281
|
+
}
|
|
282
|
+
function pointInTriangle(vertices, point, first, second, third) {
|
|
283
|
+
const px = vertices[point * 2];
|
|
284
|
+
const py = vertices[point * 2 + 1];
|
|
285
|
+
const firstCross = cross2D(vertices[first * 2], vertices[first * 2 + 1], vertices[second * 2], vertices[second * 2 + 1], px, py);
|
|
286
|
+
const secondCross = cross2D(vertices[second * 2], vertices[second * 2 + 1], vertices[third * 2], vertices[third * 2 + 1], px, py);
|
|
287
|
+
const thirdCross = cross2D(vertices[third * 2], vertices[third * 2 + 1], vertices[first * 2], vertices[first * 2 + 1], px, py);
|
|
288
|
+
return firstCross >= -GEOMETRY_EPSILON && secondCross >= -GEOMETRY_EPSILON && thirdCross >= -GEOMETRY_EPSILON;
|
|
289
|
+
}
|
|
290
|
+
function copyTriangle(vertices, first, second, third) {
|
|
291
|
+
return new Float64Array([
|
|
292
|
+
vertices[first * 2],
|
|
293
|
+
vertices[first * 2 + 1],
|
|
294
|
+
vertices[second * 2],
|
|
295
|
+
vertices[second * 2 + 1],
|
|
296
|
+
vertices[third * 2],
|
|
297
|
+
vertices[third * 2 + 1]
|
|
298
|
+
]);
|
|
299
|
+
}
|
|
300
|
+
export {
|
|
301
|
+
CURVE_FLATTENING_MAX_DEPTH,
|
|
302
|
+
CURVE_FLATTENING_TOLERANCE,
|
|
303
|
+
IDENTITY_POSE_2D,
|
|
304
|
+
canonicalizeContour2D,
|
|
305
|
+
cleanZero,
|
|
306
|
+
composePose2D,
|
|
307
|
+
copyPose2D,
|
|
308
|
+
cross2D,
|
|
309
|
+
freezeBounds2D,
|
|
310
|
+
polygonMassData2D,
|
|
311
|
+
transformPointInto,
|
|
312
|
+
triangulateContour2D
|
|
313
|
+
};
|
|
314
|
+
//# sourceMappingURL=math.js.map
|