@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,165 @@
|
|
|
1
|
+
import type { PibblPhysicsAabb2D, PibblPhysicsPose2D, PibblPhysicsRay2D, PibblPhysicsShape2D, PibblPhysicsVector2 } from "./2d-geometry.js";
|
|
2
|
+
import type { PibblPhysicsQueryHit2D, PibblPhysicsQueryMatch2D, PibblPhysicsQueryMode, PibblPhysicsQueryOptions2D, PibblPhysicsQueryResult2D, PibblPhysicsBodyHandle2D, PibblPhysicsWorldHandle2D } from "./lib/2d/types.js";
|
|
3
|
+
import { collider2D, dynamicBody2D, kinematicBody2D, staticBody2D } from "./lib/2d/runtime/descriptors.js";
|
|
4
|
+
import { PhysicsWorld2D, pibblPhysicsWorld2D } from "./lib/2d/runtime/world-component.js";
|
|
5
|
+
import { Capsule2D, Chain2D, PhysicsShape2D, Segment2D } from "./lib/2d/canvas/components.js";
|
|
6
|
+
import { withPhysicsShape2D } from "./lib/2d/canvas/custom.js";
|
|
7
|
+
import { applyForce2D, applyImpulse2D, applyTorque2D, pibblPhysicsBody2D, disableBody2D, enableBody2D, setAngularVelocity2D, setLinearVelocity2D, sleepBody2D, teleportBody2D, wakeBody2D } from "./lib/2d/runtime/body-handle.js";
|
|
8
|
+
export * from "./2d-geometry.js";
|
|
9
|
+
export { raycastShape2D, shapeCastAgainstShape2D, } from "./lib/2d/collision/casts.js";
|
|
10
|
+
export * from "./lib/2d/types.js";
|
|
11
|
+
export { PhysicsWorld2D };
|
|
12
|
+
export { PhysicsShape2D, Capsule2D, Segment2D, Chain2D };
|
|
13
|
+
export { collider2D, dynamicBody2D, kinematicBody2D, staticBody2D };
|
|
14
|
+
export { withPhysicsShape2D };
|
|
15
|
+
export { pibblPhysicsBody2D };
|
|
16
|
+
export { pibblPhysicsWorld2D };
|
|
17
|
+
export { applyForce2D, applyImpulse2D, applyTorque2D, disableBody2D, enableBody2D, setAngularVelocity2D, setLinearVelocity2D, sleepBody2D, teleportBody2D, wakeBody2D, };
|
|
18
|
+
/**
|
|
19
|
+
* Queries the committed world with a ray using the selected result mode and filters.
|
|
20
|
+
*
|
|
21
|
+
* @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.
|
|
22
|
+
* @param ray - Ray origin, direction, and travel limit. See {@link PibblPhysicsRay2D}.
|
|
23
|
+
* @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.
|
|
24
|
+
* @returns A boolean for any mode, one hit or null for closest mode, or ordered hits for all mode.
|
|
25
|
+
* See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryHit2D} .
|
|
26
|
+
*
|
|
27
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
28
|
+
* @see {@link PibblPhysicsRay2D}
|
|
29
|
+
* @see {@link PibblPhysicsQueryOptions2D}
|
|
30
|
+
* @see {@link PibblPhysicsQueryResult2D}
|
|
31
|
+
* @see {@link PibblPhysicsQueryHit2D}
|
|
32
|
+
* @see {@link PibblPhysicsQueryMode}
|
|
33
|
+
*/
|
|
34
|
+
export declare function raycast2D<Mode extends PibblPhysicsQueryMode = "closest">(world: PibblPhysicsWorldHandle2D, ray: PibblPhysicsRay2D, options?: PibblPhysicsQueryOptions2D<Mode>): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryHit2D>;
|
|
35
|
+
/**
|
|
36
|
+
* Sweeps a shape through the committed world using the selected result mode and filters.
|
|
37
|
+
*
|
|
38
|
+
* @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.
|
|
39
|
+
* @param shape - Shape to sweep. See {@link PibblPhysicsShape2D}.
|
|
40
|
+
* @param from - Initial shape pose. See {@link PibblPhysicsPose2D}.
|
|
41
|
+
* @param translation - Translation vector for the sweep. See {@link PibblPhysicsVector2}.
|
|
42
|
+
* @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.
|
|
43
|
+
* @returns A boolean for any mode, one hit or null for closest mode, or ordered hits for all mode.
|
|
44
|
+
* See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryHit2D} .
|
|
45
|
+
*
|
|
46
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
47
|
+
* @see {@link PibblPhysicsShape2D}
|
|
48
|
+
* @see {@link PibblPhysicsPose2D}
|
|
49
|
+
* @see {@link PibblPhysicsVector2}
|
|
50
|
+
* @see {@link PibblPhysicsQueryOptions2D}
|
|
51
|
+
* @see {@link PibblPhysicsQueryResult2D}
|
|
52
|
+
* @see {@link PibblPhysicsQueryHit2D}
|
|
53
|
+
* @see {@link PibblPhysicsQueryMode}
|
|
54
|
+
*/
|
|
55
|
+
export declare function shapeCast2D<Mode extends PibblPhysicsQueryMode = "closest">(world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, from: PibblPhysicsPose2D, translation: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D<Mode>): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryHit2D>;
|
|
56
|
+
/**
|
|
57
|
+
* Queries committed world colliders overlapping a posed shape.
|
|
58
|
+
*
|
|
59
|
+
* @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.
|
|
60
|
+
* @param shape - Shape to test for overlaps. See {@link PibblPhysicsShape2D}.
|
|
61
|
+
* @param pose - Shape pose. See {@link PibblPhysicsPose2D}.
|
|
62
|
+
* @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.
|
|
63
|
+
* @returns A boolean for any mode, one match or null for closest mode, or matches for all mode.
|
|
64
|
+
* See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryMatch2D} .
|
|
65
|
+
*
|
|
66
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
67
|
+
* @see {@link PibblPhysicsShape2D}
|
|
68
|
+
* @see {@link PibblPhysicsPose2D}
|
|
69
|
+
* @see {@link PibblPhysicsQueryOptions2D}
|
|
70
|
+
* @see {@link PibblPhysicsQueryResult2D}
|
|
71
|
+
* @see {@link PibblPhysicsQueryMatch2D}
|
|
72
|
+
* @see {@link PibblPhysicsQueryMode}
|
|
73
|
+
*/
|
|
74
|
+
export declare function overlapShape2D<Mode extends PibblPhysicsQueryMode = "closest">(world: PibblPhysicsWorldHandle2D, shape: PibblPhysicsShape2D, pose: PibblPhysicsPose2D, options?: PibblPhysicsQueryOptions2D<Mode>): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryMatch2D>;
|
|
75
|
+
/**
|
|
76
|
+
* Queries committed world colliders intersecting an axis-aligned region.
|
|
77
|
+
*
|
|
78
|
+
* @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.
|
|
79
|
+
* @param bounds - Axis-aligned query bounds in public coordinates. See {@link PibblPhysicsAabb2D}.
|
|
80
|
+
* @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.
|
|
81
|
+
* @returns A boolean for any mode, one match or null for closest mode, or matches for all mode.
|
|
82
|
+
* See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryMatch2D} .
|
|
83
|
+
*
|
|
84
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
85
|
+
* @see {@link PibblPhysicsAabb2D}
|
|
86
|
+
* @see {@link PibblPhysicsQueryOptions2D}
|
|
87
|
+
* @see {@link PibblPhysicsQueryResult2D}
|
|
88
|
+
* @see {@link PibblPhysicsQueryMatch2D}
|
|
89
|
+
* @see {@link PibblPhysicsQueryMode}
|
|
90
|
+
*/
|
|
91
|
+
export declare function queryAabb2D<Mode extends PibblPhysicsQueryMode = "closest">(world: PibblPhysicsWorldHandle2D, bounds: PibblPhysicsAabb2D, options?: PibblPhysicsQueryOptions2D<Mode>): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryMatch2D>;
|
|
92
|
+
/**
|
|
93
|
+
* Queries committed world colliders containing a point.
|
|
94
|
+
*
|
|
95
|
+
* @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.
|
|
96
|
+
* @param point - Point in public coordinates. See {@link PibblPhysicsVector2}.
|
|
97
|
+
* @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.
|
|
98
|
+
* @returns A boolean for any mode, one match or null for closest mode, or matches for all mode.
|
|
99
|
+
* See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryMatch2D} .
|
|
100
|
+
*
|
|
101
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
102
|
+
* @see {@link PibblPhysicsVector2}
|
|
103
|
+
* @see {@link PibblPhysicsQueryOptions2D}
|
|
104
|
+
* @see {@link PibblPhysicsQueryResult2D}
|
|
105
|
+
* @see {@link PibblPhysicsQueryMatch2D}
|
|
106
|
+
* @see {@link PibblPhysicsQueryMode}
|
|
107
|
+
*/
|
|
108
|
+
export declare function queryPoint2D<Mode extends PibblPhysicsQueryMode = "closest">(world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2, options?: PibblPhysicsQueryOptions2D<Mode>): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryMatch2D>;
|
|
109
|
+
/**
|
|
110
|
+
* Converts root-logical pointer coordinates to this world's simulation space.
|
|
111
|
+
*
|
|
112
|
+
* @param world - World providing unit and coordinate conversion. See
|
|
113
|
+
* {@link PibblPhysicsWorldHandle2D} .
|
|
114
|
+
* @param point - Point in public Canvas coordinates. See {@link PibblPhysicsVector2}.
|
|
115
|
+
* @returns The equivalent point in this world's local simulation space. See
|
|
116
|
+
* {@link PibblPhysicsVector2} .
|
|
117
|
+
*
|
|
118
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
119
|
+
* @see {@link PibblPhysicsVector2}
|
|
120
|
+
*/
|
|
121
|
+
export declare function toPhysicsPoint2D(world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2): PibblPhysicsVector2;
|
|
122
|
+
/**
|
|
123
|
+
* Converts a simulation-space point to root-logical Canvas coordinates.
|
|
124
|
+
*
|
|
125
|
+
* @param world - World providing unit and coordinate conversion. See
|
|
126
|
+
* {@link PibblPhysicsWorldHandle2D} .
|
|
127
|
+
* @param point - Point in this world's local simulation space. See {@link PibblPhysicsVector2}.
|
|
128
|
+
* @returns The equivalent point in public Canvas coordinates. See {@link PibblPhysicsVector2}.
|
|
129
|
+
*
|
|
130
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
131
|
+
* @see {@link PibblPhysicsVector2}
|
|
132
|
+
*/
|
|
133
|
+
export declare function fromPhysicsPoint2D(world: PibblPhysicsWorldHandle2D, point: PibblPhysicsVector2): PibblPhysicsVector2;
|
|
134
|
+
export type { PibblPhysicsInspection2D, PibblPhysicsBodyInspection2D, PibblPhysicsColliderInspection2D, PibblPhysicsContactInspection2D, } from "./lib/2d/inspection-types.js";
|
|
135
|
+
/**
|
|
136
|
+
* Returns immutable JSON-safe observations without advancing the simulation. See
|
|
137
|
+
* {@link PibblPhysicsWorldHandle2D}.
|
|
138
|
+
* @param world - World to inspect. See {@link PibblPhysicsWorldHandle2D}.
|
|
139
|
+
* @returns Current world simulation and ownership diagnostics.
|
|
140
|
+
*/
|
|
141
|
+
export declare function inspectPhysics2D(world: PibblPhysicsWorldHandle2D): import("./lib/2d/inspection-types.js").PibblPhysicsInspection2D;
|
|
142
|
+
/**
|
|
143
|
+
* Returns the immutable observation for this currently bound body, if any. See
|
|
144
|
+
* {@link PibblPhysicsBodyHandle2D}.
|
|
145
|
+
* @param body - Body to inspect. See {@link PibblPhysicsBodyHandle2D}.
|
|
146
|
+
* @returns Current body diagnostics, or undefined when the handle has no live body.
|
|
147
|
+
*/
|
|
148
|
+
export declare function inspectPhysics2D(body: PibblPhysicsBodyHandle2D): import("./lib/2d/inspection-types.js").PibblPhysicsBodyInspection2D | undefined;
|
|
149
|
+
export { PhysicsDebug2D, type PibblPhysicsDebug2DProps, } from "./lib/2d/canvas/debug.js";
|
|
150
|
+
/**
|
|
151
|
+
* A borrowed committed solid batch, structurally compatible with a flow obstacle source.
|
|
152
|
+
*
|
|
153
|
+
* @param world - World supplying collider geometry. See {@link PibblPhysicsWorldHandle2D}.
|
|
154
|
+
* @returns An obstacle source whose read method returns the current revision and packed geometry.
|
|
155
|
+
*
|
|
156
|
+
* @see {@link PibblPhysicsWorldHandle2D}
|
|
157
|
+
*/
|
|
158
|
+
export declare function physicsObstacles2D(world: PibblPhysicsWorldHandle2D): Readonly<{
|
|
159
|
+
read(): Readonly<{
|
|
160
|
+
revision: number;
|
|
161
|
+
boxes: Float64Array;
|
|
162
|
+
ellipses: Float64Array;
|
|
163
|
+
polygons: Float64Array;
|
|
164
|
+
}>;
|
|
165
|
+
}>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collider2D,
|
|
3
|
+
dynamicBody2D,
|
|
4
|
+
kinematicBody2D,
|
|
5
|
+
staticBody2D
|
|
6
|
+
} from "./lib/2d/runtime/descriptors.js";
|
|
7
|
+
import {
|
|
8
|
+
PhysicsWorld2D,
|
|
9
|
+
pibblPhysicsWorld2D
|
|
10
|
+
} from "./lib/2d/runtime/world-component.js";
|
|
11
|
+
import {
|
|
12
|
+
Capsule2D,
|
|
13
|
+
Chain2D,
|
|
14
|
+
PhysicsShape2D,
|
|
15
|
+
Segment2D
|
|
16
|
+
} from "./lib/2d/canvas/components.js";
|
|
17
|
+
import { withPhysicsShape2D } from "./lib/2d/canvas/custom.js";
|
|
18
|
+
import {
|
|
19
|
+
applyForce2D,
|
|
20
|
+
applyImpulse2D,
|
|
21
|
+
applyTorque2D,
|
|
22
|
+
pibblPhysicsBody2D,
|
|
23
|
+
disableBody2D,
|
|
24
|
+
enableBody2D,
|
|
25
|
+
isPhysicsBodyHandle2D,
|
|
26
|
+
physicsBodyHandleBinding2D,
|
|
27
|
+
setAngularVelocity2D,
|
|
28
|
+
setLinearVelocity2D,
|
|
29
|
+
sleepBody2D,
|
|
30
|
+
teleportBody2D,
|
|
31
|
+
wakeBody2D
|
|
32
|
+
} from "./lib/2d/runtime/body-handle.js";
|
|
33
|
+
import { requirePhysicsWorld2DController } from "./lib/2d/runtime/controller.js";
|
|
34
|
+
export * from "./2d-geometry.js";
|
|
35
|
+
import {
|
|
36
|
+
raycastShape2D,
|
|
37
|
+
shapeCastAgainstShape2D
|
|
38
|
+
} from "./lib/2d/collision/casts.js";
|
|
39
|
+
export * from "./lib/2d/types.js";
|
|
40
|
+
function raycast2D(world, ray, options) {
|
|
41
|
+
return requirePhysicsWorld2DController(world).raycast(ray, options);
|
|
42
|
+
}
|
|
43
|
+
function shapeCast2D(world, shape, from, translation, options) {
|
|
44
|
+
return requirePhysicsWorld2DController(world).shapeCast(
|
|
45
|
+
shape,
|
|
46
|
+
from,
|
|
47
|
+
translation,
|
|
48
|
+
options
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function overlapShape2D(world, shape, pose, options) {
|
|
52
|
+
return requirePhysicsWorld2DController(world).overlapShape(
|
|
53
|
+
shape,
|
|
54
|
+
pose,
|
|
55
|
+
options
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function queryAabb2D(world, bounds, options) {
|
|
59
|
+
return requirePhysicsWorld2DController(world).queryAabb(bounds, options);
|
|
60
|
+
}
|
|
61
|
+
function queryPoint2D(world, point, options) {
|
|
62
|
+
return requirePhysicsWorld2DController(world).queryPoint(point, options);
|
|
63
|
+
}
|
|
64
|
+
function toPhysicsPoint2D(world, point) {
|
|
65
|
+
return requirePhysicsWorld2DController(world).convertPoint(point, false);
|
|
66
|
+
}
|
|
67
|
+
function fromPhysicsPoint2D(world, point) {
|
|
68
|
+
return requirePhysicsWorld2DController(world).convertPoint(point, true);
|
|
69
|
+
}
|
|
70
|
+
function inspectPhysics2D(target) {
|
|
71
|
+
if (isPhysicsBodyHandle2D(target)) {
|
|
72
|
+
const binding = physicsBodyHandleBinding2D(target);
|
|
73
|
+
return binding?.controller.inspectBody(binding.bodyId);
|
|
74
|
+
}
|
|
75
|
+
return requirePhysicsWorld2DController(target).inspect();
|
|
76
|
+
}
|
|
77
|
+
import {
|
|
78
|
+
PhysicsDebug2D
|
|
79
|
+
} from "./lib/2d/canvas/debug.js";
|
|
80
|
+
function physicsObstacles2D(world) {
|
|
81
|
+
return requirePhysicsWorld2DController(world).getObstacleSource();
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
Capsule2D,
|
|
85
|
+
Chain2D,
|
|
86
|
+
PhysicsDebug2D,
|
|
87
|
+
PhysicsShape2D,
|
|
88
|
+
PhysicsWorld2D,
|
|
89
|
+
Segment2D,
|
|
90
|
+
applyForce2D,
|
|
91
|
+
applyImpulse2D,
|
|
92
|
+
applyTorque2D,
|
|
93
|
+
collider2D,
|
|
94
|
+
disableBody2D,
|
|
95
|
+
dynamicBody2D,
|
|
96
|
+
enableBody2D,
|
|
97
|
+
fromPhysicsPoint2D,
|
|
98
|
+
inspectPhysics2D,
|
|
99
|
+
kinematicBody2D,
|
|
100
|
+
overlapShape2D,
|
|
101
|
+
physicsObstacles2D,
|
|
102
|
+
pibblPhysicsBody2D,
|
|
103
|
+
pibblPhysicsWorld2D,
|
|
104
|
+
queryAabb2D,
|
|
105
|
+
queryPoint2D,
|
|
106
|
+
raycast2D,
|
|
107
|
+
raycastShape2D,
|
|
108
|
+
setAngularVelocity2D,
|
|
109
|
+
setLinearVelocity2D,
|
|
110
|
+
shapeCast2D,
|
|
111
|
+
shapeCastAgainstShape2D,
|
|
112
|
+
sleepBody2D,
|
|
113
|
+
staticBody2D,
|
|
114
|
+
teleportBody2D,
|
|
115
|
+
toPhysicsPoint2D,
|
|
116
|
+
wakeBody2D,
|
|
117
|
+
withPhysicsShape2D
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=2d.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/features/physics/2d.ts"],
|
|
4
|
+
"sourcesContent": ["import type { PibblPhysicsInspection2D, PibblPhysicsBodyInspection2D } from \"./lib/2d/inspection-types.js\";\nimport type {\n PibblPhysicsAabb2D,\n PibblPhysicsPose2D,\n PibblPhysicsRay2D,\n PibblPhysicsShape2D,\n PibblPhysicsVector2,\n} from \"./2d-geometry.js\";\nimport type {\n PibblPhysicsQueryHit2D,\n PibblPhysicsQueryMatch2D,\n PibblPhysicsQueryMode,\n PibblPhysicsQueryOptions2D,\n PibblPhysicsQueryResult2D,\n PibblPhysicsBodyHandle2D,\n PibblPhysicsWorldHandle2D,\n} from \"./lib/2d/types.js\";\nimport {\n collider2D,\n dynamicBody2D,\n kinematicBody2D,\n staticBody2D,\n} from \"./lib/2d/runtime/descriptors.js\";\nimport {\n PhysicsWorld2D,\n pibblPhysicsWorld2D,\n} from \"./lib/2d/runtime/world-component.js\";\nimport {\n Capsule2D,\n Chain2D,\n PhysicsShape2D,\n Segment2D,\n} from \"./lib/2d/canvas/components.js\";\nimport { withPhysicsShape2D } from \"./lib/2d/canvas/custom.js\";\nimport {\n applyForce2D,\n applyImpulse2D,\n applyTorque2D,\n pibblPhysicsBody2D,\n disableBody2D,\n enableBody2D,\n isPhysicsBodyHandle2D,\n physicsBodyHandleBinding2D,\n setAngularVelocity2D,\n setLinearVelocity2D,\n sleepBody2D,\n teleportBody2D,\n wakeBody2D,\n} from \"./lib/2d/runtime/body-handle.js\";\nimport { requirePhysicsWorld2DController } from \"./lib/2d/runtime/controller.js\";\n\nexport * from \"./2d-geometry.js\";\nexport {\n raycastShape2D,\n shapeCastAgainstShape2D,\n} from \"./lib/2d/collision/casts.js\";\nexport * from \"./lib/2d/types.js\";\n\nexport { PhysicsWorld2D };\nexport { PhysicsShape2D, Capsule2D, Segment2D, Chain2D };\n\nexport { collider2D, dynamicBody2D, kinematicBody2D, staticBody2D };\nexport { withPhysicsShape2D };\n\nexport { pibblPhysicsBody2D };\n\nexport { pibblPhysicsWorld2D };\n\nexport {\n applyForce2D,\n applyImpulse2D,\n applyTorque2D,\n disableBody2D,\n enableBody2D,\n setAngularVelocity2D,\n setLinearVelocity2D,\n sleepBody2D,\n teleportBody2D,\n wakeBody2D,\n};\n\n/**\n * Queries the committed world with a ray using the selected result mode and filters.\n *\n * @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.\n * @param ray - Ray origin, direction, and travel limit. See {@link PibblPhysicsRay2D}.\n * @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.\n * @returns A boolean for any mode, one hit or null for closest mode, or ordered hits for all mode.\n * See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryHit2D} .\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsRay2D}\n * @see {@link PibblPhysicsQueryOptions2D}\n * @see {@link PibblPhysicsQueryResult2D}\n * @see {@link PibblPhysicsQueryHit2D}\n * @see {@link PibblPhysicsQueryMode}\n */\nexport function raycast2D<Mode extends PibblPhysicsQueryMode = \"closest\">(\n world: PibblPhysicsWorldHandle2D,\n ray: PibblPhysicsRay2D,\n options?: PibblPhysicsQueryOptions2D<Mode>,\n): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryHit2D> {\n return requirePhysicsWorld2DController(world).raycast(ray, options);\n}\n\n/**\n * Sweeps a shape through the committed world using the selected result mode and filters.\n *\n * @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.\n * @param shape - Shape to sweep. See {@link PibblPhysicsShape2D}.\n * @param from - Initial shape pose. See {@link PibblPhysicsPose2D}.\n * @param translation - Translation vector for the sweep. See {@link PibblPhysicsVector2}.\n * @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.\n * @returns A boolean for any mode, one hit or null for closest mode, or ordered hits for all mode.\n * See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryHit2D} .\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsShape2D}\n * @see {@link PibblPhysicsPose2D}\n * @see {@link PibblPhysicsVector2}\n * @see {@link PibblPhysicsQueryOptions2D}\n * @see {@link PibblPhysicsQueryResult2D}\n * @see {@link PibblPhysicsQueryHit2D}\n * @see {@link PibblPhysicsQueryMode}\n */\nexport function shapeCast2D<Mode extends PibblPhysicsQueryMode = \"closest\">(\n world: PibblPhysicsWorldHandle2D,\n shape: PibblPhysicsShape2D,\n from: PibblPhysicsPose2D,\n translation: PibblPhysicsVector2,\n options?: PibblPhysicsQueryOptions2D<Mode>,\n): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryHit2D> {\n return requirePhysicsWorld2DController(world).shapeCast(\n shape,\n from,\n translation,\n options,\n );\n}\n\n/**\n * Queries committed world colliders overlapping a posed shape.\n *\n * @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.\n * @param shape - Shape to test for overlaps. See {@link PibblPhysicsShape2D}.\n * @param pose - Shape pose. See {@link PibblPhysicsPose2D}.\n * @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.\n * @returns A boolean for any mode, one match or null for closest mode, or matches for all mode.\n * See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryMatch2D} .\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsShape2D}\n * @see {@link PibblPhysicsPose2D}\n * @see {@link PibblPhysicsQueryOptions2D}\n * @see {@link PibblPhysicsQueryResult2D}\n * @see {@link PibblPhysicsQueryMatch2D}\n * @see {@link PibblPhysicsQueryMode}\n */\nexport function overlapShape2D<Mode extends PibblPhysicsQueryMode = \"closest\">(\n world: PibblPhysicsWorldHandle2D,\n shape: PibblPhysicsShape2D,\n pose: PibblPhysicsPose2D,\n options?: PibblPhysicsQueryOptions2D<Mode>,\n): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryMatch2D> {\n return requirePhysicsWorld2DController(world).overlapShape(\n shape,\n pose,\n options,\n );\n}\n\n/**\n * Queries committed world colliders intersecting an axis-aligned region.\n *\n * @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.\n * @param bounds - Axis-aligned query bounds in public coordinates. See {@link PibblPhysicsAabb2D}.\n * @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.\n * @returns A boolean for any mode, one match or null for closest mode, or matches for all mode.\n * See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryMatch2D} .\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsAabb2D}\n * @see {@link PibblPhysicsQueryOptions2D}\n * @see {@link PibblPhysicsQueryResult2D}\n * @see {@link PibblPhysicsQueryMatch2D}\n * @see {@link PibblPhysicsQueryMode}\n */\nexport function queryAabb2D<Mode extends PibblPhysicsQueryMode = \"closest\">(\n world: PibblPhysicsWorldHandle2D,\n bounds: PibblPhysicsAabb2D,\n options?: PibblPhysicsQueryOptions2D<Mode>,\n): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryMatch2D> {\n return requirePhysicsWorld2DController(world).queryAabb(bounds, options);\n}\n\n/**\n * Queries committed world colliders containing a point.\n *\n * @param world - World to query. See {@link PibblPhysicsWorldHandle2D}.\n * @param point - Point in public coordinates. See {@link PibblPhysicsVector2}.\n * @param options - Result mode and collider filtering. See {@link PibblPhysicsQueryOptions2D}.\n * @returns A boolean for any mode, one match or null for closest mode, or matches for all mode.\n * See {@link PibblPhysicsQueryResult2D} , {@link PibblPhysicsQueryMatch2D} .\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsVector2}\n * @see {@link PibblPhysicsQueryOptions2D}\n * @see {@link PibblPhysicsQueryResult2D}\n * @see {@link PibblPhysicsQueryMatch2D}\n * @see {@link PibblPhysicsQueryMode}\n */\nexport function queryPoint2D<Mode extends PibblPhysicsQueryMode = \"closest\">(\n world: PibblPhysicsWorldHandle2D,\n point: PibblPhysicsVector2,\n options?: PibblPhysicsQueryOptions2D<Mode>,\n): PibblPhysicsQueryResult2D<Mode, PibblPhysicsQueryMatch2D> {\n return requirePhysicsWorld2DController(world).queryPoint(point, options);\n}\n\n/**\n * Converts root-logical pointer coordinates to this world's simulation space.\n *\n * @param world - World providing unit and coordinate conversion. See\n * {@link PibblPhysicsWorldHandle2D} .\n * @param point - Point in public Canvas coordinates. See {@link PibblPhysicsVector2}.\n * @returns The equivalent point in this world's local simulation space. See\n * {@link PibblPhysicsVector2} .\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsVector2}\n */\nexport function toPhysicsPoint2D(\n world: PibblPhysicsWorldHandle2D,\n point: PibblPhysicsVector2,\n): PibblPhysicsVector2 {\n return requirePhysicsWorld2DController(world).convertPoint(point, false);\n}\n\n/**\n * Converts a simulation-space point to root-logical Canvas coordinates.\n *\n * @param world - World providing unit and coordinate conversion. See\n * {@link PibblPhysicsWorldHandle2D} .\n * @param point - Point in this world's local simulation space. See {@link PibblPhysicsVector2}.\n * @returns The equivalent point in public Canvas coordinates. See {@link PibblPhysicsVector2}.\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsVector2}\n */\nexport function fromPhysicsPoint2D(\n world: PibblPhysicsWorldHandle2D,\n point: PibblPhysicsVector2,\n): PibblPhysicsVector2 {\n return requirePhysicsWorld2DController(world).convertPoint(point, true);\n}\n\nexport type {\n PibblPhysicsInspection2D,\n PibblPhysicsBodyInspection2D,\n PibblPhysicsColliderInspection2D,\n PibblPhysicsContactInspection2D,\n} from \"./lib/2d/inspection-types.js\";\n\n/**\n * Returns immutable JSON-safe observations without advancing the simulation. See\n * {@link PibblPhysicsWorldHandle2D}.\n * @param world - World to inspect. See {@link PibblPhysicsWorldHandle2D}.\n * @returns Current world simulation and ownership diagnostics.\n */\nexport function inspectPhysics2D(\n world: PibblPhysicsWorldHandle2D,\n): import(\"./lib/2d/inspection-types.js\").PibblPhysicsInspection2D;\n\n/**\n * Returns the immutable observation for this currently bound body, if any. See\n * {@link PibblPhysicsBodyHandle2D}.\n * @param body - Body to inspect. See {@link PibblPhysicsBodyHandle2D}.\n * @returns Current body diagnostics, or undefined when the handle has no live body.\n */\nexport function inspectPhysics2D(\n body: PibblPhysicsBodyHandle2D,\n): import(\"./lib/2d/inspection-types.js\").PibblPhysicsBodyInspection2D | undefined;\n/**\n * Returns a diagnostic snapshot of a live world or body, or undefined when unavailable.\n *\n * @param target - World or body handle to inspect. See {@link PibblPhysicsWorldHandle2D} ,\n * {@link PibblPhysicsBodyHandle2D} .\n * @returns The corresponding diagnostics, or undefined for an unmounted body.\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n * @see {@link PibblPhysicsBodyHandle2D}\n * @see {@link PibblPhysicsInspection2D}\n * @see {@link PibblPhysicsBodyInspection2D}\n */\nexport function inspectPhysics2D(\n target: PibblPhysicsWorldHandle2D | PibblPhysicsBodyHandle2D,\n):\n | import(\"./lib/2d/inspection-types.js\").PibblPhysicsInspection2D\n | import(\"./lib/2d/inspection-types.js\").PibblPhysicsBodyInspection2D\n | undefined {\n if (isPhysicsBodyHandle2D(target)) {\n const binding = physicsBodyHandleBinding2D(target);\n return binding?.controller.inspectBody(binding.bodyId);\n }\n return requirePhysicsWorld2DController(target).inspect();\n}\n\nexport {\n PhysicsDebug2D,\n type PibblPhysicsDebug2DProps,\n} from \"./lib/2d/canvas/debug.js\";\n\n/**\n * A borrowed committed solid batch, structurally compatible with a flow obstacle source.\n *\n * @param world - World supplying collider geometry. See {@link PibblPhysicsWorldHandle2D}.\n * @returns An obstacle source whose read method returns the current revision and packed geometry.\n *\n * @see {@link PibblPhysicsWorldHandle2D}\n */\nexport function physicsObstacles2D(world: PibblPhysicsWorldHandle2D): Readonly<{\n read(): Readonly<{ revision: number; boxes: Float64Array; ellipses: Float64Array; polygons: Float64Array }>;\n}> {\n return requirePhysicsWorld2DController(world).getObstacleSource();\n}\n"],
|
|
5
|
+
"mappings": "AAiBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AA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AmB,OAEhC;AACD,SAAO,gCAAgC,KAAK,EAAE,kBAAkB;AAClE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './2d.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Capsule2DProps, Capsule2DStyle, Chain2DProps, Chain2DStyle, PhysicsShape2DProps, PhysicsShape2DStyle, Segment2DProps, Segment2DStyle } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Draws an immutable physics shape as a Canvas primitive with optional body or collider
|
|
4
|
+
* attachment.
|
|
5
|
+
*
|
|
6
|
+
* @param props - Authored component inputs, supplied through JSX or createElement. See the linked
|
|
7
|
+
* props and style types.
|
|
8
|
+
* @throws When called directly; Pibbl mounts this component through JSX or createElement.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link PhysicsShape2DProps}
|
|
11
|
+
* @see {@link PhysicsShape2DStyle}
|
|
12
|
+
*/
|
|
13
|
+
export declare const PhysicsShape2D: import("@pibbl/core").PibblPrimitiveComponent<PhysicsShape2DProps, import("@pibbl/core").PrimitiveInput<PhysicsShape2DProps, PhysicsShape2DStyle>>;
|
|
14
|
+
/**
|
|
15
|
+
* Draws a capsule between two endpoints with optional physics attachment.
|
|
16
|
+
*
|
|
17
|
+
* @param props - Authored component inputs, supplied through JSX or createElement. See the linked
|
|
18
|
+
* props and style types.
|
|
19
|
+
* @throws When called directly; Pibbl mounts this component through JSX or createElement.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link Capsule2DProps}
|
|
22
|
+
* @see {@link Capsule2DStyle}
|
|
23
|
+
*/
|
|
24
|
+
export declare const Capsule2D: import("@pibbl/core").PibblPrimitiveComponent<Capsule2DProps, import("@pibbl/core").PrimitiveInput<Capsule2DProps, Capsule2DStyle>>;
|
|
25
|
+
/**
|
|
26
|
+
* Draws a line segment with optional physics attachment.
|
|
27
|
+
*
|
|
28
|
+
* @param props - Authored component inputs, supplied through JSX or createElement. See the linked
|
|
29
|
+
* props and style types.
|
|
30
|
+
* @throws When called directly; Pibbl mounts this component through JSX or createElement.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link Segment2DProps}
|
|
33
|
+
* @see {@link Segment2DStyle}
|
|
34
|
+
*/
|
|
35
|
+
export declare const Segment2D: import("@pibbl/core").PibblPrimitiveComponent<Segment2DProps, import("@pibbl/core").PrimitiveInput<Segment2DProps, Segment2DStyle>>;
|
|
36
|
+
/**
|
|
37
|
+
* Draws an open or closed point chain with optional physics attachment.
|
|
38
|
+
*
|
|
39
|
+
* @param props - Authored component inputs, supplied through JSX or createElement. See the linked
|
|
40
|
+
* props and style types.
|
|
41
|
+
* @throws When called directly; Pibbl mounts this component through JSX or createElement.
|
|
42
|
+
*
|
|
43
|
+
* @see {@link Chain2DProps}
|
|
44
|
+
* @see {@link Chain2DStyle}
|
|
45
|
+
*/
|
|
46
|
+
export declare const Chain2D: import("@pibbl/core").PibblPrimitiveComponent<Chain2DProps, import("@pibbl/core").PrimitiveInput<Chain2DProps, Chain2DStyle>>;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { resolveTexturePaint } from "@pibbl/core/internal";
|
|
2
|
+
import {
|
|
3
|
+
useEventTarget,
|
|
4
|
+
definePrimitive
|
|
5
|
+
} from "@pibbl/core";
|
|
6
|
+
import { boundsOfShape2D, capsuleShape2D, chainShape2D, segmentShape2D } from "../shapes.js";
|
|
7
|
+
import { requireShapeRecord2D } from "../shape-records.js";
|
|
8
|
+
import { installCustomShapeResolver2D } from "./inference.js";
|
|
9
|
+
function renderPhysicsShape2D(props, style, context) {
|
|
10
|
+
renderShape(props, style, style.shape, context);
|
|
11
|
+
}
|
|
12
|
+
function renderCapsule2D(props, style, context) {
|
|
13
|
+
renderShape(props, style, capsuleShape2D(style), context);
|
|
14
|
+
}
|
|
15
|
+
function renderSegment2D(props, style, context) {
|
|
16
|
+
renderShape(props, style, segmentShape2D(style), context);
|
|
17
|
+
}
|
|
18
|
+
function renderChain2D(props, style, context) {
|
|
19
|
+
renderShape(props, style, chainShape2D(style), context);
|
|
20
|
+
}
|
|
21
|
+
const PhysicsShape2D = definePrimitive(renderPhysicsShape2D, { resolveStyle: resolvePhysicsShapeStyle });
|
|
22
|
+
const Capsule2D = definePrimitive(renderCapsule2D, { resolveStyle: (style) => ({
|
|
23
|
+
...stripLayout(style),
|
|
24
|
+
start: copyPoint(style.start, "Capsule2D.start"),
|
|
25
|
+
end: copyPoint(style.end, "Capsule2D.end"),
|
|
26
|
+
radius: positive(style.radius, "Capsule2D.radius")
|
|
27
|
+
}) });
|
|
28
|
+
const Segment2D = definePrimitive(renderSegment2D, { resolveStyle: (style) => ({
|
|
29
|
+
...stripLayout(style),
|
|
30
|
+
start: copyPoint(style.start, "Segment2D.start"),
|
|
31
|
+
end: copyPoint(style.end, "Segment2D.end")
|
|
32
|
+
}) });
|
|
33
|
+
const Chain2D = definePrimitive(renderChain2D, { resolveStyle: (style) => ({
|
|
34
|
+
...stripLayout(style),
|
|
35
|
+
points: Object.freeze(style.points.map((point, index) => copyPoint(point, `Chain2D.points[${index}]`))),
|
|
36
|
+
closed: style.closed ?? false,
|
|
37
|
+
radius: nonnegative(style.radius ?? 0, "Chain2D.radius")
|
|
38
|
+
}) });
|
|
39
|
+
installCustomShapeResolver2D(PhysicsShape2D, (style) => requireShape(style.shape, "PhysicsShape2D.shape"));
|
|
40
|
+
installCustomShapeResolver2D(Capsule2D, (style) => capsuleShape2D({
|
|
41
|
+
start: copyPoint(style.start, "Capsule2D.start"),
|
|
42
|
+
end: copyPoint(style.end, "Capsule2D.end"),
|
|
43
|
+
radius: positive(style.radius, "Capsule2D.radius")
|
|
44
|
+
}));
|
|
45
|
+
installCustomShapeResolver2D(Segment2D, (style) => segmentShape2D({
|
|
46
|
+
start: copyPoint(style.start, "Segment2D.start"),
|
|
47
|
+
end: copyPoint(style.end, "Segment2D.end")
|
|
48
|
+
}));
|
|
49
|
+
installCustomShapeResolver2D(Chain2D, (style) => chainShape2D({
|
|
50
|
+
points: copyPoints(style.points, "Chain2D.points"),
|
|
51
|
+
closed: style.closed === true,
|
|
52
|
+
radius: nonnegative(style.radius ?? 0, "Chain2D.radius")
|
|
53
|
+
}));
|
|
54
|
+
function resolvePhysicsShapeStyle(style) {
|
|
55
|
+
requireShape(style.shape, "PhysicsShape2D.shape");
|
|
56
|
+
return stripLayout(style);
|
|
57
|
+
}
|
|
58
|
+
function renderShape(props, style, shape, context) {
|
|
59
|
+
const record = requireShapeRecord2D(shape);
|
|
60
|
+
const path = pathForShape(shape);
|
|
61
|
+
const opacity = style.opacity ?? 1;
|
|
62
|
+
if (!Number.isFinite(opacity) || opacity < 0 || opacity > 1) {
|
|
63
|
+
throw new RangeError("Physics shape opacity must be finite from zero through one.");
|
|
64
|
+
}
|
|
65
|
+
const bounds = boundsOfShape2D(shape);
|
|
66
|
+
const paintBounds = { x: bounds.min[0], y: bounds.min[1], width: bounds.max[0] - bounds.min[0], height: bounds.max[1] - bounds.min[1] };
|
|
67
|
+
context.globalAlpha *= opacity;
|
|
68
|
+
if (style.fill !== void 0) {
|
|
69
|
+
context.fillStyle = resolveTexturePaint(style.fill, context, paintBounds);
|
|
70
|
+
context.fill(path);
|
|
71
|
+
}
|
|
72
|
+
const strokeWidth = nonnegative(style.strokeWidth ?? 0, "Physics shape strokeWidth");
|
|
73
|
+
if (style.stroke !== void 0 && strokeWidth > 0) {
|
|
74
|
+
context.strokeStyle = resolveTexturePaint(style.stroke, context, paintBounds);
|
|
75
|
+
context.lineWidth = strokeWidth;
|
|
76
|
+
context.stroke(path);
|
|
77
|
+
}
|
|
78
|
+
const interactivePath = props.pointerEvents === "none" ? new Path2D() : path;
|
|
79
|
+
useEventTarget(props, {
|
|
80
|
+
path: interactivePath,
|
|
81
|
+
fill: style.fill !== void 0 && record.area > 0,
|
|
82
|
+
lineInteractionWidth: style.lineInteractionWidth ?? strokeWidth,
|
|
83
|
+
cursor: style.cursor,
|
|
84
|
+
keyboardFocusable: props.keyboardFocusable,
|
|
85
|
+
keyboardNavigationBounds: props.keyboardNavigationBounds ?? {
|
|
86
|
+
x: bounds.min[0],
|
|
87
|
+
y: bounds.min[1],
|
|
88
|
+
width: bounds.max[0] - bounds.min[0],
|
|
89
|
+
height: bounds.max[1] - bounds.min[1]
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function pathForShape(shape) {
|
|
94
|
+
const record = requireShapeRecord2D(shape);
|
|
95
|
+
const local = new Path2D();
|
|
96
|
+
for (const leaf of record.leaves) appendLeaf(local, leaf);
|
|
97
|
+
if (record.localPose.x === 0 && record.localPose.y === 0 && record.localPose.rotationRadians === 0) return local;
|
|
98
|
+
const result = new Path2D();
|
|
99
|
+
result.addPath(local, new DOMMatrix().translate(record.localPose.x, record.localPose.y).rotate(record.localPose.rotationRadians * 180 / Math.PI));
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
function appendLeaf(path, leaf) {
|
|
103
|
+
switch (leaf.kind) {
|
|
104
|
+
case "circle":
|
|
105
|
+
path.moveTo(leaf.center[0] + leaf.radius, leaf.center[1]);
|
|
106
|
+
path.arc(leaf.center[0], leaf.center[1], leaf.radius, 0, Math.PI * 2);
|
|
107
|
+
path.closePath();
|
|
108
|
+
return;
|
|
109
|
+
case "ellipse":
|
|
110
|
+
path.moveTo(leaf.center[0] + leaf.radiusX, leaf.center[1]);
|
|
111
|
+
path.ellipse(leaf.center[0], leaf.center[1], leaf.radiusX, leaf.radiusY, leaf.rotationRadians, 0, Math.PI * 2);
|
|
112
|
+
path.closePath();
|
|
113
|
+
return;
|
|
114
|
+
case "box":
|
|
115
|
+
path.rect(leaf.center[0] - leaf.halfWidth, leaf.center[1] - leaf.halfHeight, leaf.halfWidth * 2, leaf.halfHeight * 2);
|
|
116
|
+
return;
|
|
117
|
+
case "rounded-box":
|
|
118
|
+
path.roundRect(
|
|
119
|
+
leaf.center[0] - leaf.halfWidth,
|
|
120
|
+
leaf.center[1] - leaf.halfHeight,
|
|
121
|
+
leaf.halfWidth * 2,
|
|
122
|
+
leaf.halfHeight * 2,
|
|
123
|
+
Array.from(leaf.radii)
|
|
124
|
+
);
|
|
125
|
+
return;
|
|
126
|
+
case "capsule":
|
|
127
|
+
appendCapsule(path, leaf.start, leaf.end, leaf.radius);
|
|
128
|
+
return;
|
|
129
|
+
case "segment":
|
|
130
|
+
path.moveTo(leaf.start[0], leaf.start[1]);
|
|
131
|
+
path.lineTo(leaf.end[0], leaf.end[1]);
|
|
132
|
+
return;
|
|
133
|
+
case "polygon":
|
|
134
|
+
path.moveTo(leaf.vertices[0], leaf.vertices[1]);
|
|
135
|
+
for (let index = 2; index < leaf.vertices.length; index += 2) path.lineTo(leaf.vertices[index], leaf.vertices[index + 1]);
|
|
136
|
+
path.closePath();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function appendCapsule(path, start, end, radius) {
|
|
140
|
+
const dx = end[0] - start[0], dy = end[1] - start[1], length = Math.hypot(dx, dy);
|
|
141
|
+
if (length === 0) {
|
|
142
|
+
path.moveTo(start[0] + radius, start[1]);
|
|
143
|
+
path.arc(start[0], start[1], radius, 0, Math.PI * 2);
|
|
144
|
+
path.closePath();
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const normal = Math.atan2(dy, dx) - Math.PI / 2;
|
|
148
|
+
path.moveTo(start[0] + Math.cos(normal) * radius, start[1] + Math.sin(normal) * radius);
|
|
149
|
+
path.lineTo(end[0] + Math.cos(normal) * radius, end[1] + Math.sin(normal) * radius);
|
|
150
|
+
path.arc(end[0], end[1], radius, normal, normal + Math.PI);
|
|
151
|
+
path.lineTo(start[0] - Math.cos(normal) * radius, start[1] - Math.sin(normal) * radius);
|
|
152
|
+
path.arc(start[0], start[1], radius, normal + Math.PI, normal + Math.PI * 2);
|
|
153
|
+
path.closePath();
|
|
154
|
+
}
|
|
155
|
+
function stripLayout(style) {
|
|
156
|
+
const result = { ...style };
|
|
157
|
+
for (const key of [
|
|
158
|
+
"width",
|
|
159
|
+
"height",
|
|
160
|
+
"minWidth",
|
|
161
|
+
"maxWidth",
|
|
162
|
+
"minHeight",
|
|
163
|
+
"maxHeight",
|
|
164
|
+
"padding",
|
|
165
|
+
"overflow",
|
|
166
|
+
"left",
|
|
167
|
+
"top",
|
|
168
|
+
"alignSelf",
|
|
169
|
+
"justifySelf",
|
|
170
|
+
"flexBasis",
|
|
171
|
+
"flexGrow",
|
|
172
|
+
"flexShrink",
|
|
173
|
+
"gridColumnStart",
|
|
174
|
+
"gridColumnSpan",
|
|
175
|
+
"gridRowStart",
|
|
176
|
+
"gridRowSpan"
|
|
177
|
+
]) delete result[key];
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
function copyPoints(value, path) {
|
|
181
|
+
if (!Array.isArray(value)) throw new TypeError(`${path} must be an array.`);
|
|
182
|
+
return Object.freeze(value.map((point, index) => copyPoint(point, `${path}[${index}]`)));
|
|
183
|
+
}
|
|
184
|
+
function copyPoint(value, path) {
|
|
185
|
+
if (!Array.isArray(value) || value.length !== 2 || value.some((entry) => typeof entry !== "number" || !Number.isFinite(entry))) {
|
|
186
|
+
throw new TypeError(`${path} must be a finite two-dimensional point.`);
|
|
187
|
+
}
|
|
188
|
+
return Object.freeze([value[0], value[1]]);
|
|
189
|
+
}
|
|
190
|
+
function positive(value, path) {
|
|
191
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) throw new RangeError(`${path} must be finite and greater than zero.`);
|
|
192
|
+
return value;
|
|
193
|
+
}
|
|
194
|
+
function nonnegative(value, path) {
|
|
195
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) throw new RangeError(`${path} must be finite and nonnegative.`);
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
198
|
+
function requireShape(value, path) {
|
|
199
|
+
try {
|
|
200
|
+
requireShapeRecord2D(value);
|
|
201
|
+
return value;
|
|
202
|
+
} catch {
|
|
203
|
+
throw new TypeError(`${path} must be a Pibbl physics 2D shape.`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
Capsule2D,
|
|
208
|
+
Chain2D,
|
|
209
|
+
PhysicsShape2D,
|
|
210
|
+
Segment2D
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/features/physics/lib/2d/canvas/components.ts"],
|
|
4
|
+
"sourcesContent": ["import { resolveTexturePaint } from '@pibbl/core/internal';\nimport type { FillStyle, StrokeStyle } from '@pibbl/core';\nimport {\n useEventTarget,\n definePrimitive,\n type RenderingContext2D,\n} from '@pibbl/core';\nimport type {\n Capsule2DProps,\n Capsule2DStyle,\n Chain2DProps,\n Chain2DStyle,\n PhysicsShape2DProps,\n PhysicsShape2DStyle,\n Segment2DProps,\n Segment2DStyle,\n} from '../types.js';\nimport type { PibblPhysicsShape2D, PibblPhysicsVector2 } from '../../../2d-geometry.js';\nimport { boundsOfShape2D, capsuleShape2D, chainShape2D, segmentShape2D } from '../shapes.js';\nimport { requireShapeRecord2D, type ConvexLeaf2D } from '../shape-records.js';\nimport { installCustomShapeResolver2D } from './inference.js';\n\ntype ResolvedPhysicsShapeStyle2D = Readonly<PhysicsShape2DStyle>;\ntype ResolvedCapsuleStyle2D = Omit<Readonly<Capsule2DStyle>, 'start' | 'end'> & {\n readonly start: PibblPhysicsVector2;\n readonly end: PibblPhysicsVector2;\n};\ntype ResolvedSegmentStyle2D = Omit<Readonly<Segment2DStyle>, 'start' | 'end'> & {\n readonly start: PibblPhysicsVector2;\n readonly end: PibblPhysicsVector2;\n};\ntype ResolvedChainStyle2D = Omit<Readonly<Chain2DStyle>, 'points'> & {\n readonly points: readonly PibblPhysicsVector2[];\n};\n\nfunction renderPhysicsShape2D(\n props: PhysicsShape2DProps,\n style: ResolvedPhysicsShapeStyle2D,\n context: RenderingContext2D,\n): void {\n renderShape(props, style, style.shape, context);\n}\n\nfunction renderCapsule2D(\n props: Capsule2DProps,\n style: Readonly<ResolvedCapsuleStyle2D>,\n context: RenderingContext2D,\n): void {\n renderShape(props, style, capsuleShape2D(style), context);\n}\n\nfunction renderSegment2D(\n props: Segment2DProps,\n style: Readonly<ResolvedSegmentStyle2D>,\n context: RenderingContext2D,\n): void {\n renderShape(props, style, segmentShape2D(style), context);\n}\n\nfunction renderChain2D(\n props: Chain2DProps,\n style: Readonly<ResolvedChainStyle2D>,\n context: RenderingContext2D,\n): void {\n renderShape(props, style, chainShape2D(style), context);\n}\n\n/**\n * Draws an immutable physics shape as a Canvas primitive with optional body or collider\n * attachment.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link PhysicsShape2DProps}\n * @see {@link PhysicsShape2DStyle}\n */\nexport const PhysicsShape2D = definePrimitive<\n PhysicsShape2DProps,\n PhysicsShape2DStyle,\n PhysicsShape2DStyle,\n PhysicsShape2DStyle\n>(renderPhysicsShape2D, { resolveStyle: resolvePhysicsShapeStyle });\n\n/**\n * Draws a capsule between two endpoints with optional physics attachment.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link Capsule2DProps}\n * @see {@link Capsule2DStyle}\n */\nexport const Capsule2D = definePrimitive<\n Capsule2DProps,\n Capsule2DStyle,\n Capsule2DStyle,\n ResolvedCapsuleStyle2D\n>(renderCapsule2D, { resolveStyle: style => ({\n ...stripLayout(style),\n start: copyPoint(style.start, 'Capsule2D.start'),\n end: copyPoint(style.end, 'Capsule2D.end'),\n radius: positive(style.radius, 'Capsule2D.radius'),\n}) });\n\n/**\n * Draws a line segment with optional physics attachment.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link Segment2DProps}\n * @see {@link Segment2DStyle}\n */\nexport const Segment2D = definePrimitive<\n Segment2DProps,\n Segment2DStyle,\n Segment2DStyle,\n ResolvedSegmentStyle2D\n>(renderSegment2D, { resolveStyle: style => ({\n ...stripLayout(style),\n start: copyPoint(style.start, 'Segment2D.start'),\n end: copyPoint(style.end, 'Segment2D.end'),\n}) });\n\n/**\n * Draws an open or closed point chain with optional physics attachment.\n *\n * @param props - Authored component inputs, supplied through JSX or createElement. See the linked\n * props and style types.\n * @throws When called directly; Pibbl mounts this component through JSX or createElement.\n *\n * @see {@link Chain2DProps}\n * @see {@link Chain2DStyle}\n */\nexport const Chain2D = definePrimitive<\n Chain2DProps,\n Chain2DStyle,\n Chain2DStyle,\n ResolvedChainStyle2D\n>(renderChain2D, { resolveStyle: style => ({\n ...stripLayout(style),\n points: Object.freeze(style.points.map((point, index) => copyPoint(point, `Chain2D.points[${index}]`))),\n closed: style.closed ?? false,\n radius: nonnegative(style.radius ?? 0, 'Chain2D.radius'),\n}) });\n\ninstallCustomShapeResolver2D(PhysicsShape2D, style => requireShape(style.shape, 'PhysicsShape2D.shape'));\ninstallCustomShapeResolver2D(Capsule2D, style => capsuleShape2D({\n start: copyPoint(style.start, 'Capsule2D.start'),\n end: copyPoint(style.end, 'Capsule2D.end'),\n radius: positive(style.radius, 'Capsule2D.radius'),\n}));\ninstallCustomShapeResolver2D(Segment2D, style => segmentShape2D({\n start: copyPoint(style.start, 'Segment2D.start'),\n end: copyPoint(style.end, 'Segment2D.end'),\n}));\ninstallCustomShapeResolver2D(Chain2D, style => chainShape2D({\n points: copyPoints(style.points, 'Chain2D.points'),\n closed: style.closed === true,\n radius: nonnegative(style.radius ?? 0, 'Chain2D.radius'),\n}));\n\nfunction resolvePhysicsShapeStyle(style: Readonly<PhysicsShape2DStyle>): ResolvedPhysicsShapeStyle2D {\n requireShape(style.shape, 'PhysicsShape2D.shape');\n return stripLayout(style) as ResolvedPhysicsShapeStyle2D;\n}\n\nfunction renderShape(\n props: PhysicsShape2DProps,\n style: Readonly<{\n readonly fill?: FillStyle;\n readonly stroke?: StrokeStyle;\n readonly strokeWidth?: number;\n readonly opacity?: number;\n readonly cursor?: string;\n readonly lineInteractionWidth?: number;\n }>,\n shape: PibblPhysicsShape2D,\n context: RenderingContext2D,\n): void {\n const record = requireShapeRecord2D(shape);\n const path = pathForShape(shape);\n const opacity = style.opacity ?? 1;\n if (!Number.isFinite(opacity) || opacity < 0 || opacity > 1) {\n throw new RangeError('Physics shape opacity must be finite from zero through one.');\n }\n const bounds = boundsOfShape2D(shape);\n const paintBounds = {x: bounds.min[0], y: bounds.min[1], width: bounds.max[0]-bounds.min[0], height: bounds.max[1]-bounds.min[1]};\n context.globalAlpha *= opacity;\n if (style.fill !== undefined) {\n context.fillStyle = resolveTexturePaint(style.fill, context, paintBounds);\n context.fill(path);\n }\n const strokeWidth = nonnegative(style.strokeWidth ?? 0, 'Physics shape strokeWidth');\n if (style.stroke !== undefined && strokeWidth > 0) {\n context.strokeStyle = resolveTexturePaint(style.stroke, context, paintBounds);\n context.lineWidth = strokeWidth;\n context.stroke(path);\n }\n const interactivePath = props.pointerEvents === 'none' ? new Path2D() : path;\n useEventTarget(props, {\n path: interactivePath,\n fill: style.fill !== undefined && record.area > 0,\n lineInteractionWidth: style.lineInteractionWidth ?? strokeWidth,\n cursor: style.cursor,\n keyboardFocusable: props.keyboardFocusable,\n keyboardNavigationBounds: props.keyboardNavigationBounds ?? {\n x: bounds.min[0], y: bounds.min[1],\n width: bounds.max[0] - bounds.min[0], height: bounds.max[1] - bounds.min[1],\n },\n });\n}\n\nfunction pathForShape(shape: PibblPhysicsShape2D): Path2D {\n const record = requireShapeRecord2D(shape);\n const local = new Path2D();\n for (const leaf of record.leaves) appendLeaf(local, leaf);\n if (record.localPose.x === 0 && record.localPose.y === 0 && record.localPose.rotationRadians === 0) return local;\n const result = new Path2D();\n result.addPath(local, new DOMMatrix()\n .translate(record.localPose.x, record.localPose.y)\n .rotate(record.localPose.rotationRadians * 180 / Math.PI));\n return result;\n}\n\nfunction appendLeaf(path: Path2D, leaf: ConvexLeaf2D): void {\n switch (leaf.kind) {\n case 'circle':\n path.moveTo(leaf.center[0]! + leaf.radius, leaf.center[1]!);\n path.arc(leaf.center[0]!, leaf.center[1]!, leaf.radius, 0, Math.PI * 2);\n path.closePath();\n return;\n case 'ellipse':\n path.moveTo(leaf.center[0]! + leaf.radiusX, leaf.center[1]!);\n path.ellipse(leaf.center[0]!, leaf.center[1]!, leaf.radiusX, leaf.radiusY, leaf.rotationRadians, 0, Math.PI * 2);\n path.closePath();\n return;\n case 'box':\n path.rect(leaf.center[0]! - leaf.halfWidth, leaf.center[1]! - leaf.halfHeight, leaf.halfWidth * 2, leaf.halfHeight * 2);\n return;\n case 'rounded-box':\n path.roundRect(\n leaf.center[0]! - leaf.halfWidth,\n leaf.center[1]! - leaf.halfHeight,\n leaf.halfWidth * 2,\n leaf.halfHeight * 2,\n Array.from(leaf.radii),\n );\n return;\n case 'capsule':\n appendCapsule(path, leaf.start, leaf.end, leaf.radius);\n return;\n case 'segment':\n path.moveTo(leaf.start[0]!, leaf.start[1]!);\n path.lineTo(leaf.end[0]!, leaf.end[1]!);\n return;\n case 'polygon':\n path.moveTo(leaf.vertices[0]!, leaf.vertices[1]!);\n for (let index = 2; index < leaf.vertices.length; index += 2) path.lineTo(leaf.vertices[index]!, leaf.vertices[index + 1]!);\n path.closePath();\n }\n}\n\nfunction appendCapsule(path: Path2D, start: Float64Array, end: Float64Array, radius: number): void {\n const dx = end[0]! - start[0]!, dy = end[1]! - start[1]!, length = Math.hypot(dx, dy);\n if (length === 0) {\n path.moveTo(start[0]! + radius, start[1]!);\n path.arc(start[0]!, start[1]!, radius, 0, Math.PI * 2);\n path.closePath();\n return;\n }\n const normal = Math.atan2(dy, dx) - Math.PI / 2;\n path.moveTo(start[0]! + Math.cos(normal) * radius, start[1]! + Math.sin(normal) * radius);\n path.lineTo(end[0]! + Math.cos(normal) * radius, end[1]! + Math.sin(normal) * radius);\n path.arc(end[0]!, end[1]!, radius, normal, normal + Math.PI);\n path.lineTo(start[0]! - Math.cos(normal) * radius, start[1]! - Math.sin(normal) * radius);\n path.arc(start[0]!, start[1]!, radius, normal + Math.PI, normal + Math.PI * 2);\n path.closePath();\n}\n\nfunction stripLayout<T extends Readonly<Record<PropertyKey, unknown>>>(style: T): T {\n const result = { ...style } as Record<PropertyKey, unknown>;\n for (const key of [\n 'width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'padding', 'overflow',\n 'left', 'top', 'alignSelf', 'justifySelf', 'flexBasis', 'flexGrow', 'flexShrink',\n 'gridColumnStart', 'gridColumnSpan', 'gridRowStart', 'gridRowSpan',\n ]) delete result[key];\n return result as T;\n}\n\nfunction copyPoints(value: unknown, path: string): readonly PibblPhysicsVector2[] {\n if (!Array.isArray(value)) throw new TypeError(`${path} must be an array.`);\n return Object.freeze(value.map((point, index) => copyPoint(point, `${path}[${index}]`)));\n}\n\nfunction copyPoint(value: unknown, path: string): PibblPhysicsVector2 {\n if (!Array.isArray(value) || value.length !== 2 || value.some(entry => typeof entry !== 'number' || !Number.isFinite(entry))) {\n throw new TypeError(`${path} must be a finite two-dimensional point.`);\n }\n return Object.freeze([value[0] as number, value[1] as number] as const);\n}\n\nfunction positive(value: unknown, path: string): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) throw new RangeError(`${path} must be finite and greater than zero.`);\n return value;\n}\n\nfunction nonnegative(value: unknown, path: string): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) throw new RangeError(`${path} must be finite and nonnegative.`);\n return value;\n}\n\nfunction requireShape(value: unknown, path: string): PibblPhysicsShape2D {\n try {\n requireShapeRecord2D(value as PibblPhysicsShape2D);\n return value as PibblPhysicsShape2D;\n } catch {\n throw new TypeError(`${path} must be a Pibbl physics 2D shape.`);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,2BAA2B;AAEpC;AAAA,EACE;AAAA,EACA;AAAA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 -0,0 +1,24 @@
|
|
|
1
|
+
import type { PibblPrimitiveComponent } from '@pibbl/core';
|
|
2
|
+
import type { PibblPhysicsShape2D } from '../../../2d-geometry.js';
|
|
3
|
+
import type { PibblPhysicsAttachment2D, PibblPhysicsPrimitiveProps2D } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Adds physics-attachment support to a custom primitive using its resolved-style shape callback.
|
|
6
|
+
*
|
|
7
|
+
* @param component - Primitive whose rendered style determines its collision shape. See
|
|
8
|
+
* {@link PibblPrimitiveComponent} .
|
|
9
|
+
* @param options - Pure resolver deriving collision geometry from resolved style. See
|
|
10
|
+
* {@link PibblPhysicsShape2D} .
|
|
11
|
+
* @returns A derived primitive accepting the public physics attachment prop. See
|
|
12
|
+
* {@link PibblPrimitiveComponent} , {@link PibblPhysicsPrimitiveProps2D} ,
|
|
13
|
+
* {@link PibblPhysicsAttachment2D} .
|
|
14
|
+
*
|
|
15
|
+
* @see {@link PibblPrimitiveComponent}
|
|
16
|
+
* @see {@link PibblPhysicsShape2D}
|
|
17
|
+
* @see {@link PibblPhysicsPrimitiveProps2D}
|
|
18
|
+
* @see {@link PibblPhysicsAttachment2D}
|
|
19
|
+
*/
|
|
20
|
+
export declare function withPhysicsShape2D<P, I, ResolvedStyle>(component: PibblPrimitiveComponent<P, I>, options: Readonly<{
|
|
21
|
+
resolveShape(style: Readonly<ResolvedStyle>): PibblPhysicsShape2D;
|
|
22
|
+
}>): PibblPrimitiveComponent<P & PibblPhysicsPrimitiveProps2D, I & {
|
|
23
|
+
readonly physics?: PibblPhysicsAttachment2D;
|
|
24
|
+
}>;
|