@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,1317 @@
|
|
|
1
|
+
import { CommittedObstacles2D } from "./obstacles.js";
|
|
2
|
+
import { boundsOfShape2D } from "../../../2d-geometry.js";
|
|
3
|
+
import { createShape2D } from "../shape-records.js";
|
|
4
|
+
import { RapierSimulation2D } from "../world/rapier.js";
|
|
5
|
+
import { signal } from "@pibbl/core";
|
|
6
|
+
import {
|
|
7
|
+
pibblInternalOnSimulationRenderTransactionFinish,
|
|
8
|
+
pibblInternalCreateSignalConsumer,
|
|
9
|
+
pibblInternalCurrentRenderOwner,
|
|
10
|
+
pibblInternalQueueSimulationBegin,
|
|
11
|
+
pibblInternalQueueSimulationCommitAcknowledgement,
|
|
12
|
+
pibblInternalQueueSimulationComplete,
|
|
13
|
+
pibblInternalRegisterSimulationAdvance,
|
|
14
|
+
pibblInternalRequestSimulationRender
|
|
15
|
+
} from "@pibbl/core/internal";
|
|
16
|
+
import { BODY_CCD_2D } from "../world/ccd.js";
|
|
17
|
+
import { COLLIDER_SENSOR_2D } from "../world/contact-cache.js";
|
|
18
|
+
import {
|
|
19
|
+
BODY_FIXED_ROTATION_2D,
|
|
20
|
+
BODY_TYPE_DYNAMIC_2D,
|
|
21
|
+
BODY_TYPE_KINEMATIC_2D
|
|
22
|
+
} from "../world/integrator.js";
|
|
23
|
+
import { BODY_SLEEP_DISABLED_2D, BODY_SLEEPING_2D } from "../world/solver.js";
|
|
24
|
+
import {
|
|
25
|
+
copyFiniteVector2,
|
|
26
|
+
requireFiniteNumber
|
|
27
|
+
} from "../../shared/validation.js";
|
|
28
|
+
import {
|
|
29
|
+
normalizePhysicsWorld2DConfiguration,
|
|
30
|
+
PhysicsWorld2DKernel
|
|
31
|
+
} from "../world/world.js";
|
|
32
|
+
import { CommittedWorldQueries2D } from "../world/queries.js";
|
|
33
|
+
import {
|
|
34
|
+
bindPhysicsBodyHandle2D,
|
|
35
|
+
createPhysicsBodyHandle2D,
|
|
36
|
+
physicsBodyHandleBinding2D,
|
|
37
|
+
stagePhysicsBodyHandle2D,
|
|
38
|
+
unbindPhysicsBodyHandle2D
|
|
39
|
+
} from "./body-handle.js";
|
|
40
|
+
import {
|
|
41
|
+
createPhysicsColliderHandle2D,
|
|
42
|
+
isPhysicsBodyEventDelivery2D,
|
|
43
|
+
materializePhysicsBodyEvent2D,
|
|
44
|
+
materializePhysicsContactEvent2D,
|
|
45
|
+
physicsColliderHandleIdentity2D,
|
|
46
|
+
sortPhysicsEventDeliveries2D
|
|
47
|
+
} from "./events.js";
|
|
48
|
+
const worldController2DSymbol = /* @__PURE__ */ Symbol("PhysicsWorld2DController");
|
|
49
|
+
class PhysicsWorld2DController {
|
|
50
|
+
constructor(owner, initialProps) {
|
|
51
|
+
this.owner = owner;
|
|
52
|
+
this.space = initialProps.space ?? "root";
|
|
53
|
+
if (this.space !== "root" && this.space !== "local")
|
|
54
|
+
throw new TypeError('PhysicsWorld2D space must be "root" or "local".');
|
|
55
|
+
this.targetConsumer = pibblInternalCreateSignalConsumer({
|
|
56
|
+
owner: pibblInternalCurrentRenderOwner(),
|
|
57
|
+
debugName: "PhysicsWorld2D kinematic targets",
|
|
58
|
+
invalidate: () => {
|
|
59
|
+
if (this.active) this.ensureAdvance();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const configuration = normalizeWorldConfiguration(initialProps);
|
|
63
|
+
this.kernel = new PhysicsWorld2DKernel(
|
|
64
|
+
denormalizeWorldConfiguration(configuration),
|
|
65
|
+
new RapierSimulation2D()
|
|
66
|
+
);
|
|
67
|
+
this.releasePassiveAdvance = pibblInternalRegisterSimulationAdvance(
|
|
68
|
+
this.owner,
|
|
69
|
+
"physics",
|
|
70
|
+
(frame, batch) => {
|
|
71
|
+
if (this.releaseAdvance !== void 0) return;
|
|
72
|
+
const targets = this.readKinematicTargets(batch);
|
|
73
|
+
for (const [id, target2] of targets) {
|
|
74
|
+
if (this.kernel.bodyIdentity(id) === void 0) continue;
|
|
75
|
+
const pose = this.kernel.authoritativePose(id);
|
|
76
|
+
if (target2.position[0] !== pose.position[0] || target2.position[1] !== pose.position[1] || target2.rotationDegrees !== pose.rotationDegrees) {
|
|
77
|
+
this.ensureAdvance();
|
|
78
|
+
this.advance(frame.frameId, frame.logicalTime, batch);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
false
|
|
84
|
+
);
|
|
85
|
+
this.queries = new CommittedWorldQueries2D({
|
|
86
|
+
generation: 1,
|
|
87
|
+
bodies: this.kernel.bodies,
|
|
88
|
+
colliders: this.kernel.colliders,
|
|
89
|
+
broadPhase: this.kernel.broadPhase,
|
|
90
|
+
materializeBody: (index, generation) => this.materializeBodyHandle(index, generation),
|
|
91
|
+
materializeCollider: (index, generation) => this.materializeColliderHandle(index, generation),
|
|
92
|
+
resolveBody: (handle) => this.resolveBodyHandle(handle),
|
|
93
|
+
resolveCollider: (handle) => this.resolveColliderHandle(handle)
|
|
94
|
+
});
|
|
95
|
+
this.acceptedConfiguration = configuration;
|
|
96
|
+
const target = {
|
|
97
|
+
[worldController2DSymbol]: this
|
|
98
|
+
};
|
|
99
|
+
Object.defineProperty(target, "revision", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: () => this.materializeRevision().asReadonly()
|
|
102
|
+
});
|
|
103
|
+
this.handle = Object.freeze(target);
|
|
104
|
+
}
|
|
105
|
+
owner;
|
|
106
|
+
handle;
|
|
107
|
+
revision;
|
|
108
|
+
committedRevision = 0;
|
|
109
|
+
obstacles;
|
|
110
|
+
obstacleSource;
|
|
111
|
+
getObstacleSource() {
|
|
112
|
+
this.assertActive();
|
|
113
|
+
if (!this.obstacleSource) {
|
|
114
|
+
if (this.liveCandidate) throw new Error("Create physics obstacles before simulation Advance.");
|
|
115
|
+
this.obstacles = new CommittedObstacles2D();
|
|
116
|
+
this.obstacles.publish(this.kernel, this.acceptedColliders, this.committedRevision);
|
|
117
|
+
this.obstacleSource = Object.freeze({ read: () => {
|
|
118
|
+
this.assertActive();
|
|
119
|
+
return this.obstacles.read();
|
|
120
|
+
} });
|
|
121
|
+
}
|
|
122
|
+
return this.obstacleSource;
|
|
123
|
+
}
|
|
124
|
+
failedFrames = 0;
|
|
125
|
+
lastFailure = null;
|
|
126
|
+
kernel;
|
|
127
|
+
ids = /* @__PURE__ */ new WeakMap();
|
|
128
|
+
nextId = 0;
|
|
129
|
+
draft;
|
|
130
|
+
acceptedTopology = Object.freeze(
|
|
131
|
+
[]
|
|
132
|
+
);
|
|
133
|
+
acceptedBodies = Object.freeze([]);
|
|
134
|
+
acceptedColliders = Object.freeze([]);
|
|
135
|
+
acceptedConfiguration;
|
|
136
|
+
acceptedProps = Object.freeze({});
|
|
137
|
+
suspendedVelocities = /* @__PURE__ */ new Map();
|
|
138
|
+
materializedBodyHandles = /* @__PURE__ */ new Map();
|
|
139
|
+
materializedColliderHandles = /* @__PURE__ */ new Map();
|
|
140
|
+
materializedHandleTopologyPending = false;
|
|
141
|
+
queries;
|
|
142
|
+
queuedBegin;
|
|
143
|
+
releaseAdvance;
|
|
144
|
+
releasePassiveAdvance;
|
|
145
|
+
liveCandidate;
|
|
146
|
+
active = true;
|
|
147
|
+
space;
|
|
148
|
+
simulationToRoot = new DOMMatrix();
|
|
149
|
+
targetConsumer;
|
|
150
|
+
beginRender(props, rootTransform = new DOMMatrix()) {
|
|
151
|
+
if ((props.space ?? "root") !== this.space)
|
|
152
|
+
throw new Error(
|
|
153
|
+
"PhysicsWorld2D space is creation-only; remount the world with a new key to change it."
|
|
154
|
+
);
|
|
155
|
+
const simulationToRoot = this.space === "local" ? rootTransform : new DOMMatrix();
|
|
156
|
+
const { a, b, c, d, e, f } = simulationToRoot;
|
|
157
|
+
if (![a, b, c, d, e, f].every(Number.isFinite) || Math.abs(a * d - b * c) < 1e-10)
|
|
158
|
+
throw new Error(
|
|
159
|
+
"PhysicsWorld2D viewport transform must be finite and invertible."
|
|
160
|
+
);
|
|
161
|
+
this.assertActive();
|
|
162
|
+
if (this.draft !== void 0) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
"PhysicsWorld2D began a second render before finishing the first."
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
this.draft = {
|
|
168
|
+
simulationToRoot,
|
|
169
|
+
configuration: normalizeWorldConfiguration(props),
|
|
170
|
+
props,
|
|
171
|
+
bodies: /* @__PURE__ */ new Map(),
|
|
172
|
+
colliders: /* @__PURE__ */ new Map()
|
|
173
|
+
};
|
|
174
|
+
pibblInternalOnSimulationRenderTransactionFinish(
|
|
175
|
+
this.owner,
|
|
176
|
+
(success) => this.finishRender(success)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
simulationTransform(root) {
|
|
180
|
+
return (this.draft?.simulationToRoot ?? this.simulationToRoot).inverse().multiply(root);
|
|
181
|
+
}
|
|
182
|
+
rootTransform(local) {
|
|
183
|
+
return (this.draft?.simulationToRoot ?? this.simulationToRoot).multiply(
|
|
184
|
+
local
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
convertPoint(point, toRoot) {
|
|
188
|
+
this.assertActive();
|
|
189
|
+
const value = copyFiniteVector2(point, "point");
|
|
190
|
+
const matrix = toRoot ? this.simulationToRoot : this.simulationToRoot.inverse();
|
|
191
|
+
return Object.freeze([
|
|
192
|
+
matrix.a * value[0] + matrix.c * value[1] + matrix.e,
|
|
193
|
+
matrix.b * value[0] + matrix.d * value[1] + matrix.f
|
|
194
|
+
]);
|
|
195
|
+
}
|
|
196
|
+
bodyIdFor(attachment) {
|
|
197
|
+
let ids = this.ids.get(attachment);
|
|
198
|
+
if (!ids) {
|
|
199
|
+
ids = {};
|
|
200
|
+
this.ids.set(attachment, ids);
|
|
201
|
+
}
|
|
202
|
+
return ids.bodyId ??= this.allocateId();
|
|
203
|
+
}
|
|
204
|
+
colliderIdFor(attachment) {
|
|
205
|
+
let ids = this.ids.get(attachment);
|
|
206
|
+
if (!ids) {
|
|
207
|
+
ids = {};
|
|
208
|
+
this.ids.set(attachment, ids);
|
|
209
|
+
}
|
|
210
|
+
return ids.colliderId ??= this.allocateId();
|
|
211
|
+
}
|
|
212
|
+
collectBody(attachment, bodyId, descriptor, initialPose = ZERO_POSE_2D) {
|
|
213
|
+
const draft = this.requireDraft();
|
|
214
|
+
draft.bodies.set(bodyId, {
|
|
215
|
+
id: bodyId,
|
|
216
|
+
attachment,
|
|
217
|
+
descriptor,
|
|
218
|
+
initialPose: copyPhysicsPose2D(initialPose)
|
|
219
|
+
});
|
|
220
|
+
const collider = descriptor.options.collider;
|
|
221
|
+
if (collider !== false && collider.shape !== "self" && descriptor.options.enabled) {
|
|
222
|
+
const colliderId = this.colliderIdFor(attachment);
|
|
223
|
+
draft.colliders.set(colliderId, {
|
|
224
|
+
id: colliderId,
|
|
225
|
+
bodyId,
|
|
226
|
+
attachment,
|
|
227
|
+
options: collider,
|
|
228
|
+
shape: attachment.resolveShape(collider)
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
collectCollider(attachment, bodyId, options) {
|
|
233
|
+
if (options.shape === "self") return;
|
|
234
|
+
const draft = this.requireDraft();
|
|
235
|
+
if (draft.bodies.get(bodyId)?.descriptor.options.enabled === false) return;
|
|
236
|
+
const colliderId = this.colliderIdFor(attachment);
|
|
237
|
+
draft.colliders.set(colliderId, {
|
|
238
|
+
id: colliderId,
|
|
239
|
+
bodyId,
|
|
240
|
+
attachment,
|
|
241
|
+
options,
|
|
242
|
+
shape: attachment.resolveShape(options)
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
queueCommands(commands) {
|
|
246
|
+
this.assertActive();
|
|
247
|
+
if (commands.length === 0) return;
|
|
248
|
+
pibblInternalQueueSimulationBegin(this.owner, () => {
|
|
249
|
+
this.kernel.applyBegin(commands);
|
|
250
|
+
});
|
|
251
|
+
this.ensureAdvance();
|
|
252
|
+
}
|
|
253
|
+
acceptBodyHandleCommand(handle, bindingGeneration, command) {
|
|
254
|
+
if (!this.active) return false;
|
|
255
|
+
const binding = physicsBodyHandleBinding2D(handle);
|
|
256
|
+
const accepted = this.acceptedBodies.find(
|
|
257
|
+
(body) => body.id === command.bodyId && body.descriptor.options.handle === handle && body.handleBindingGeneration === bindingGeneration
|
|
258
|
+
);
|
|
259
|
+
const identity = this.kernel.bodyIdentity(command.bodyId);
|
|
260
|
+
const materialized = identity === void 0 ? void 0 : this.materializedBodyHandles.get(
|
|
261
|
+
`${String(identity.index)}:${String(identity.generation)}`
|
|
262
|
+
);
|
|
263
|
+
if (binding?.controller !== this || binding.bindingGeneration !== bindingGeneration || accepted === void 0 && materialized !== handle) {
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
this.kernel.applyBegin([command]);
|
|
267
|
+
this.ensureAdvance();
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
presentationPose(bodyId) {
|
|
271
|
+
return this.kernel.bodyIdentity(bodyId) !== void 0 ? this.kernel.presentationPose(bodyId) : void 0;
|
|
272
|
+
}
|
|
273
|
+
raycast(ray, options) {
|
|
274
|
+
this.assertActive();
|
|
275
|
+
return this.queries.raycast(1, ray, options);
|
|
276
|
+
}
|
|
277
|
+
shapeCast(shape, from, translation, options) {
|
|
278
|
+
this.assertActive();
|
|
279
|
+
return this.queries.shapeCast(1, shape, from, translation, options);
|
|
280
|
+
}
|
|
281
|
+
overlapShape(shape, pose, options) {
|
|
282
|
+
this.assertActive();
|
|
283
|
+
return this.queries.overlapShape(1, shape, pose, options);
|
|
284
|
+
}
|
|
285
|
+
queryAabb(bounds, options) {
|
|
286
|
+
this.assertActive();
|
|
287
|
+
return this.queries.queryAabb(1, bounds, options);
|
|
288
|
+
}
|
|
289
|
+
queryPoint(point, options) {
|
|
290
|
+
this.assertActive();
|
|
291
|
+
return this.queries.queryPoint(1, point, options);
|
|
292
|
+
}
|
|
293
|
+
bodyHandleValues(bodyId) {
|
|
294
|
+
if (!this.active) return void 0;
|
|
295
|
+
const identity = this.kernel.bodyIdentity(bodyId);
|
|
296
|
+
if (identity === void 0) return void 0;
|
|
297
|
+
const index = identity.index;
|
|
298
|
+
const bodies = this.kernel.bodies;
|
|
299
|
+
const state = {
|
|
300
|
+
linearVelocityX: bodies.linearVelocityX[index],
|
|
301
|
+
linearVelocityY: bodies.linearVelocityY[index],
|
|
302
|
+
angularVelocity: bodies.angularVelocity[index],
|
|
303
|
+
flags: bodies.flags[index],
|
|
304
|
+
generation: identity.generation
|
|
305
|
+
};
|
|
306
|
+
const pose = this.kernel.authoritativePose(bodyId);
|
|
307
|
+
return Object.freeze({
|
|
308
|
+
position: pose.position,
|
|
309
|
+
rotationDegrees: pose.rotationDegrees,
|
|
310
|
+
linearVelocity: Object.freeze([
|
|
311
|
+
state.linearVelocityX,
|
|
312
|
+
state.linearVelocityY
|
|
313
|
+
]),
|
|
314
|
+
angularVelocityDegreesPerSecond: state.angularVelocity * 180 / Math.PI,
|
|
315
|
+
sleeping: (state.flags & BODY_SLEEPING_2D) !== 0,
|
|
316
|
+
enabled: this.kernel.isBodyEnabled(bodyId),
|
|
317
|
+
generation: state.generation
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
inspectBody(bodyId) {
|
|
321
|
+
if (!this.active) return void 0;
|
|
322
|
+
const identity = this.kernel.bodyIdentity(bodyId);
|
|
323
|
+
const declared = this.acceptedBodies.find((body) => body.id === bodyId);
|
|
324
|
+
if (identity === void 0 || declared === void 0) return void 0;
|
|
325
|
+
const index = identity.index;
|
|
326
|
+
const bodies = this.kernel.bodies;
|
|
327
|
+
const flags = bodies.flags[index];
|
|
328
|
+
return Object.freeze({
|
|
329
|
+
id: bodyId,
|
|
330
|
+
generation: identity.generation,
|
|
331
|
+
type: declared.descriptor.bodyType,
|
|
332
|
+
enabled: this.kernel.isBodyEnabled(bodyId),
|
|
333
|
+
sleeping: !!(flags & BODY_SLEEPING_2D),
|
|
334
|
+
pose: this.kernel.authoritativePose(bodyId),
|
|
335
|
+
presentationPose: this.kernel.presentationPose(bodyId),
|
|
336
|
+
centerOfMass: Object.freeze([
|
|
337
|
+
bodies.positionX[index],
|
|
338
|
+
bodies.positionY[index]
|
|
339
|
+
]),
|
|
340
|
+
linearVelocity: Object.freeze([
|
|
341
|
+
bodies.linearVelocityX[index],
|
|
342
|
+
bodies.linearVelocityY[index]
|
|
343
|
+
]),
|
|
344
|
+
angularVelocityDegreesPerSecond: bodies.angularVelocity[index] * 180 / Math.PI,
|
|
345
|
+
mass: bodies.inverseMass[index] > 0 ? 1 / bodies.inverseMass[index] : null
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
dispose() {
|
|
349
|
+
if (!this.active) return;
|
|
350
|
+
this.active = false;
|
|
351
|
+
this.targetConsumer.dispose();
|
|
352
|
+
this.releasePassiveAdvance();
|
|
353
|
+
this.queuedBegin?.cancel();
|
|
354
|
+
this.queuedBegin = void 0;
|
|
355
|
+
this.releaseAdvance?.();
|
|
356
|
+
this.releaseAdvance = void 0;
|
|
357
|
+
if (this.liveCandidate !== void 0) {
|
|
358
|
+
this.kernel.discard(this.liveCandidate);
|
|
359
|
+
this.liveCandidate = void 0;
|
|
360
|
+
}
|
|
361
|
+
for (const body of this.acceptedBodies) this.unbindBodyHandle(body);
|
|
362
|
+
for (const handle of this.materializedBodyHandles.values()) {
|
|
363
|
+
const binding = physicsBodyHandleBinding2D(handle);
|
|
364
|
+
if (binding?.controller === this) {
|
|
365
|
+
unbindPhysicsBodyHandle2D(
|
|
366
|
+
handle,
|
|
367
|
+
this,
|
|
368
|
+
binding.bodyId,
|
|
369
|
+
binding.bindingGeneration
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
this.materializedBodyHandles.clear();
|
|
374
|
+
this.materializedColliderHandles.clear();
|
|
375
|
+
this.materializedHandleTopologyPending = false;
|
|
376
|
+
this.obstacles = void 0;
|
|
377
|
+
this.obstacleSource = void 0;
|
|
378
|
+
this.kernel.dispose();
|
|
379
|
+
this.queries.invalidate();
|
|
380
|
+
this.acceptedBodies = Object.freeze([]);
|
|
381
|
+
this.acceptedColliders = Object.freeze([]);
|
|
382
|
+
this.draft = void 0;
|
|
383
|
+
this.suspendedVelocities.clear();
|
|
384
|
+
}
|
|
385
|
+
inspect() {
|
|
386
|
+
this.assertActive();
|
|
387
|
+
const snapshot = this.kernel.snapshot();
|
|
388
|
+
const vector = (x, y) => Object.freeze([x, y]);
|
|
389
|
+
const contacts = this.kernel.contacts;
|
|
390
|
+
const declaredTypes = new Map(
|
|
391
|
+
this.acceptedBodies.map((body) => [body.id, body.descriptor.bodyType])
|
|
392
|
+
);
|
|
393
|
+
return Object.freeze({
|
|
394
|
+
engine: "rapier-2d@0.21.0",
|
|
395
|
+
space: this.space,
|
|
396
|
+
revision: this.committedRevision,
|
|
397
|
+
tick: snapshot.tick,
|
|
398
|
+
advancing: this.releaseAdvance !== void 0,
|
|
399
|
+
failedFrames: this.failedFrames,
|
|
400
|
+
lastFailure: this.lastFailure,
|
|
401
|
+
bodies: Object.freeze(
|
|
402
|
+
snapshot.bodies.map(
|
|
403
|
+
(body) => Object.freeze({
|
|
404
|
+
id: body.id,
|
|
405
|
+
generation: body.generation,
|
|
406
|
+
type: declaredTypes.get(body.id),
|
|
407
|
+
enabled: this.kernel.isBodyEnabled(body.id),
|
|
408
|
+
sleeping: !!(body.flags & BODY_SLEEPING_2D),
|
|
409
|
+
pose: this.kernel.authoritativePose(body.id),
|
|
410
|
+
presentationPose: this.kernel.presentationPose(body.id),
|
|
411
|
+
centerOfMass: vector(body.positionX, body.positionY),
|
|
412
|
+
linearVelocity: vector(body.linearVelocityX, body.linearVelocityY),
|
|
413
|
+
angularVelocityDegreesPerSecond: body.angularVelocity * 180 / Math.PI,
|
|
414
|
+
mass: body.inverseMass > 0 ? 1 / body.inverseMass : null
|
|
415
|
+
})
|
|
416
|
+
)
|
|
417
|
+
),
|
|
418
|
+
colliders: Object.freeze(
|
|
419
|
+
this.acceptedColliders.flatMap((collider) => {
|
|
420
|
+
const identity = this.kernel.colliderIdentity(collider.id);
|
|
421
|
+
if (!identity) return [];
|
|
422
|
+
const shape = this.kernel.colliders.shapes[identity.index];
|
|
423
|
+
return [
|
|
424
|
+
Object.freeze({
|
|
425
|
+
id: collider.id,
|
|
426
|
+
generation: identity.generation,
|
|
427
|
+
bodyId: collider.bodyId,
|
|
428
|
+
sensor: !!(this.kernel.colliders.flags[identity.index] & COLLIDER_SENSOR_2D),
|
|
429
|
+
label: typeof collider.options.tag === "string" ? collider.options.tag : null,
|
|
430
|
+
shapeKinds: Object.freeze(shape.leaves.map((leaf) => leaf.kind)),
|
|
431
|
+
bounds: boundsOfShape2D(
|
|
432
|
+
createShape2D(shape),
|
|
433
|
+
this.kernel.authoritativePose(collider.bodyId)
|
|
434
|
+
)
|
|
435
|
+
})
|
|
436
|
+
];
|
|
437
|
+
})
|
|
438
|
+
),
|
|
439
|
+
contacts: Object.freeze(
|
|
440
|
+
Array.from(
|
|
441
|
+
{ length: contacts.contactCount },
|
|
442
|
+
(_, index) => index
|
|
443
|
+
).flatMap((index) => {
|
|
444
|
+
const firstColliderId = this.kernel.colliderIdForIdentity(
|
|
445
|
+
contacts.firstColliderIndices[index],
|
|
446
|
+
contacts.firstColliderGenerations[index]
|
|
447
|
+
);
|
|
448
|
+
const secondColliderId = this.kernel.colliderIdForIdentity(
|
|
449
|
+
contacts.secondColliderIndices[index],
|
|
450
|
+
contacts.secondColliderGenerations[index]
|
|
451
|
+
);
|
|
452
|
+
if (firstColliderId === void 0 || secondColliderId === void 0)
|
|
453
|
+
return [];
|
|
454
|
+
return [
|
|
455
|
+
Object.freeze({
|
|
456
|
+
firstColliderId,
|
|
457
|
+
secondColliderId,
|
|
458
|
+
sensor: contacts.sensorFlags[index] !== 0,
|
|
459
|
+
normal: vector(
|
|
460
|
+
contacts.normalX[index],
|
|
461
|
+
contacts.normalY[index]
|
|
462
|
+
),
|
|
463
|
+
normalImpulse: contacts.pointNormalImpulses[index * 2] + (contacts.pointCounts[index] > 1 ? contacts.pointNormalImpulses[index * 2 + 1] : 0),
|
|
464
|
+
points: Object.freeze(
|
|
465
|
+
Array.from(
|
|
466
|
+
{ length: contacts.pointCounts[index] },
|
|
467
|
+
(_, point) => {
|
|
468
|
+
const offset = index * 2 + point;
|
|
469
|
+
return Object.freeze({
|
|
470
|
+
pointOnFirst: vector(
|
|
471
|
+
contacts.pointFirstX[offset],
|
|
472
|
+
contacts.pointFirstY[offset]
|
|
473
|
+
),
|
|
474
|
+
pointOnSecond: vector(
|
|
475
|
+
contacts.pointSecondX[offset],
|
|
476
|
+
contacts.pointSecondY[offset]
|
|
477
|
+
),
|
|
478
|
+
separation: contacts.pointSeparations[offset]
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
)
|
|
482
|
+
)
|
|
483
|
+
})
|
|
484
|
+
];
|
|
485
|
+
})
|
|
486
|
+
)
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
snapshot() {
|
|
490
|
+
return Object.freeze({
|
|
491
|
+
revision: this.committedRevision,
|
|
492
|
+
revisionMaterialized: this.revision !== void 0,
|
|
493
|
+
materializedBodyHandles: this.materializedBodyHandles.size,
|
|
494
|
+
materializedColliderHandles: this.materializedColliderHandles.size,
|
|
495
|
+
advanceRegistered: this.releaseAdvance !== void 0,
|
|
496
|
+
bodyIds: Object.freeze(
|
|
497
|
+
this.acceptedTopology.filter(
|
|
498
|
+
(record) => record.kind === "body"
|
|
499
|
+
).map((record) => record.id)
|
|
500
|
+
),
|
|
501
|
+
colliderIds: Object.freeze(
|
|
502
|
+
this.acceptedTopology.filter(
|
|
503
|
+
(record) => record.kind === "collider"
|
|
504
|
+
).map((record) => record.id)
|
|
505
|
+
),
|
|
506
|
+
kernel: this.kernel.snapshot()
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
finishRender(success) {
|
|
510
|
+
const draft = this.draft;
|
|
511
|
+
this.draft = void 0;
|
|
512
|
+
if (!success || draft === void 0 || !this.active) return;
|
|
513
|
+
validateAutomaticMass(draft);
|
|
514
|
+
const reenableVelocities = this.resolveReenableVelocities(draft);
|
|
515
|
+
const previousBodyDefinitions = new Map(
|
|
516
|
+
this.acceptedTopology.filter(
|
|
517
|
+
(record) => record.kind === "body"
|
|
518
|
+
).map((record) => [record.id, record.definition])
|
|
519
|
+
);
|
|
520
|
+
const topology = materializeTopology(
|
|
521
|
+
draft,
|
|
522
|
+
reenableVelocities,
|
|
523
|
+
previousBodyDefinitions
|
|
524
|
+
);
|
|
525
|
+
const topologyChanged = !sameTopology(this.acceptedTopology, topology);
|
|
526
|
+
const configurationChanged = !sameConfiguration(
|
|
527
|
+
this.acceptedConfiguration,
|
|
528
|
+
draft.configuration
|
|
529
|
+
);
|
|
530
|
+
const nextBodies = [...draft.bodies.values()].sort(
|
|
531
|
+
(left, right) => left.id - right.id
|
|
532
|
+
);
|
|
533
|
+
validateUniqueBodyHandles(nextBodies);
|
|
534
|
+
const nextBodiesById = new Map(nextBodies.map((body) => [body.id, body]));
|
|
535
|
+
for (const body of this.acceptedBodies) {
|
|
536
|
+
const next = nextBodiesById.get(body.id);
|
|
537
|
+
const retained = next !== void 0 && next.descriptor.options.handle === body.descriptor.options.handle;
|
|
538
|
+
if (!retained) this.unbindBodyHandle(body);
|
|
539
|
+
}
|
|
540
|
+
this.simulationToRoot = draft.simulationToRoot;
|
|
541
|
+
this.acceptedProps = draft.props;
|
|
542
|
+
this.acceptedBodies = Object.freeze(
|
|
543
|
+
nextBodies.map(
|
|
544
|
+
({ id, attachment, descriptor, initialPose }) => Object.freeze({
|
|
545
|
+
id,
|
|
546
|
+
attachment,
|
|
547
|
+
descriptor,
|
|
548
|
+
initialPose,
|
|
549
|
+
handleBindingGeneration: descriptor.options.handle === void 0 ? void 0 : bindPhysicsBodyHandle2D(descriptor.options.handle, this, id)
|
|
550
|
+
})
|
|
551
|
+
)
|
|
552
|
+
);
|
|
553
|
+
this.acceptedColliders = Object.freeze(
|
|
554
|
+
[...draft.colliders.values()].sort((left, right) => left.id - right.id).map(
|
|
555
|
+
({ id, bodyId, attachment, options }) => Object.freeze({ id, bodyId, attachment, options })
|
|
556
|
+
)
|
|
557
|
+
);
|
|
558
|
+
this.targetConsumer.collect(() => {
|
|
559
|
+
for (const body of this.acceptedBodies) {
|
|
560
|
+
if (body.descriptor.bodyType !== "kinematic" || !body.descriptor.options.enabled)
|
|
561
|
+
continue;
|
|
562
|
+
body.descriptor.options.target.position?.get();
|
|
563
|
+
body.descriptor.options.target.rotationDegrees?.get();
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
this.targetConsumer.markClean();
|
|
567
|
+
this.acceptedTopology = topology;
|
|
568
|
+
this.kernel.updateColliderMetadata(topology);
|
|
569
|
+
if (topologyChanged) this.materializedHandleTopologyPending = true;
|
|
570
|
+
if (!topologyChanged && !configurationChanged) return;
|
|
571
|
+
this.acceptedConfiguration = draft.configuration;
|
|
572
|
+
this.queuedBegin?.cancel();
|
|
573
|
+
this.queuedBegin = pibblInternalQueueSimulationBegin(this.owner, () => {
|
|
574
|
+
this.queuedBegin = void 0;
|
|
575
|
+
if (topologyChanged) this.kernel.proposeTopology(this.acceptedTopology);
|
|
576
|
+
if (configurationChanged) {
|
|
577
|
+
this.kernel.applyBegin([
|
|
578
|
+
{
|
|
579
|
+
kind: "configure",
|
|
580
|
+
configuration: denormalizeWorldConfiguration(draft.configuration)
|
|
581
|
+
}
|
|
582
|
+
]);
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
this.ensureAdvance();
|
|
586
|
+
}
|
|
587
|
+
ensureAdvance() {
|
|
588
|
+
if (this.releaseAdvance !== void 0) return;
|
|
589
|
+
this.releaseAdvance = pibblInternalRegisterSimulationAdvance(
|
|
590
|
+
this.owner,
|
|
591
|
+
"physics",
|
|
592
|
+
(frame, batch) => this.advance(frame.frameId, frame.logicalTime, batch)
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
resolveReenableVelocities(draft) {
|
|
596
|
+
const previousById = new Map(
|
|
597
|
+
this.acceptedBodies.map((body) => [body.id, body])
|
|
598
|
+
);
|
|
599
|
+
const overrides = /* @__PURE__ */ new Map();
|
|
600
|
+
for (const body of draft.bodies.values()) {
|
|
601
|
+
const previous = previousById.get(body.id);
|
|
602
|
+
const currentDynamic = body.descriptor.bodyType === "dynamic" ? body.descriptor : void 0;
|
|
603
|
+
const previousDynamic = previous?.descriptor.bodyType === "dynamic" ? previous.descriptor : void 0;
|
|
604
|
+
if (currentDynamic !== void 0 && !currentDynamic.options.enabled && previousDynamic?.options.enabled) {
|
|
605
|
+
const identity = this.kernel.bodyIdentity(body.id);
|
|
606
|
+
if (identity !== void 0) {
|
|
607
|
+
const bodies = this.kernel.bodies;
|
|
608
|
+
this.suspendedVelocities.set(
|
|
609
|
+
body.id,
|
|
610
|
+
Object.freeze({
|
|
611
|
+
linearVelocityX: bodies.linearVelocityX[identity.index],
|
|
612
|
+
linearVelocityY: bodies.linearVelocityY[identity.index],
|
|
613
|
+
angularVelocity: bodies.angularVelocity[identity.index]
|
|
614
|
+
})
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
if (currentDynamic?.options.enabled && previousDynamic !== void 0 && !previousDynamic.options.enabled) {
|
|
619
|
+
const preserved = this.suspendedVelocities.get(body.id);
|
|
620
|
+
overrides.set(
|
|
621
|
+
body.id,
|
|
622
|
+
currentDynamic.options.reenableVelocity === "preserve" && preserved ? preserved : ZERO_VELOCITY_2D
|
|
623
|
+
);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
const retained = new Set(draft.bodies.keys());
|
|
627
|
+
for (const id of this.suspendedVelocities.keys()) {
|
|
628
|
+
if (!retained.has(id)) this.suspendedVelocities.delete(id);
|
|
629
|
+
}
|
|
630
|
+
return overrides;
|
|
631
|
+
}
|
|
632
|
+
advance(frameId, logicalTime, batch) {
|
|
633
|
+
let candidate;
|
|
634
|
+
try {
|
|
635
|
+
candidate = this.kernel.advance({
|
|
636
|
+
frameId,
|
|
637
|
+
logicalTime,
|
|
638
|
+
stagedKinematicTargets: this.readKinematicTargets(batch)
|
|
639
|
+
});
|
|
640
|
+
if (candidate === void 0) return;
|
|
641
|
+
this.liveCandidate = candidate;
|
|
642
|
+
const nextRevision = this.committedRevision + 1;
|
|
643
|
+
this.stagePublicSignals(batch, nextRevision);
|
|
644
|
+
const events = this.copyEventDeliveries(candidate);
|
|
645
|
+
let adopted = false;
|
|
646
|
+
if (events.length > 0) {
|
|
647
|
+
pibblInternalQueueSimulationComplete(this.owner, () => {
|
|
648
|
+
if (adopted) this.deliverEvents(events);
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
pibblInternalQueueSimulationCommitAcknowledgement(
|
|
652
|
+
this.owner,
|
|
653
|
+
(_frame, outcome) => {
|
|
654
|
+
if (this.liveCandidate !== candidate) return;
|
|
655
|
+
this.liveCandidate = void 0;
|
|
656
|
+
if (!outcome.applied) {
|
|
657
|
+
this.kernel.discard(candidate);
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
this.kernel.adopt(candidate);
|
|
661
|
+
if (this.materializedHandleTopologyPending) {
|
|
662
|
+
this.evictRetiredMaterializedHandles();
|
|
663
|
+
this.materializedHandleTopologyPending = false;
|
|
664
|
+
}
|
|
665
|
+
this.committedRevision = nextRevision;
|
|
666
|
+
this.obstacles?.publish(this.kernel, this.acceptedColliders, nextRevision);
|
|
667
|
+
adopted = true;
|
|
668
|
+
pibblInternalRequestSimulationRender(this.owner);
|
|
669
|
+
if (!this.hasAwakeBodies() && (candidate.stepCount > 0 || !this.acceptedBodies.some(
|
|
670
|
+
(body) => body.descriptor.bodyType === "kinematic"
|
|
671
|
+
))) {
|
|
672
|
+
this.releaseAdvance?.();
|
|
673
|
+
this.releaseAdvance = void 0;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
);
|
|
677
|
+
} catch (error) {
|
|
678
|
+
this.failedFrames++;
|
|
679
|
+
this.lastFailure = error instanceof Error ? error.message : String(error);
|
|
680
|
+
if (candidate?.lifecycle === "live") this.kernel.discard(candidate);
|
|
681
|
+
if (this.liveCandidate === candidate) this.liveCandidate = void 0;
|
|
682
|
+
const onError = this.acceptedProps.onError;
|
|
683
|
+
if (onError) {
|
|
684
|
+
pibblInternalQueueSimulationComplete(this.owner, () => onError(error));
|
|
685
|
+
}
|
|
686
|
+
throw error;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
readKinematicTargets(batch) {
|
|
690
|
+
const targets = /* @__PURE__ */ new Map();
|
|
691
|
+
for (const body of this.acceptedBodies) {
|
|
692
|
+
if (body.descriptor.bodyType !== "kinematic" || !body.descriptor.options.enabled)
|
|
693
|
+
continue;
|
|
694
|
+
const target = body.descriptor.options.target;
|
|
695
|
+
if (target.position === void 0 && target.rotationDegrees === void 0) {
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
const position = target.position === void 0 ? body.initialPose.position : batch.read(
|
|
699
|
+
target.position
|
|
700
|
+
);
|
|
701
|
+
const rotationDegrees = target.rotationDegrees === void 0 ? body.initialPose.rotationDegrees : batch.read(target.rotationDegrees);
|
|
702
|
+
targets.set(
|
|
703
|
+
body.id,
|
|
704
|
+
Object.freeze({
|
|
705
|
+
position: Object.freeze([position[0], position[1]]),
|
|
706
|
+
rotationDegrees
|
|
707
|
+
})
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
return targets;
|
|
711
|
+
}
|
|
712
|
+
stagePublicSignals(batch, nextRevision) {
|
|
713
|
+
if (this.revision !== void 0) {
|
|
714
|
+
batch.stage(this.revision, nextRevision, this);
|
|
715
|
+
}
|
|
716
|
+
const bodies = this.kernel.bodies;
|
|
717
|
+
for (const body of this.acceptedBodies) {
|
|
718
|
+
const identity = this.kernel.bodyIdentity(body.id);
|
|
719
|
+
if (identity === void 0) continue;
|
|
720
|
+
const explicit = body.descriptor.options.handle;
|
|
721
|
+
const materialized = this.materializedBodyHandles.get(
|
|
722
|
+
`${String(identity.index)}:${String(identity.generation)}`
|
|
723
|
+
);
|
|
724
|
+
if (explicit === void 0 && materialized === void 0) continue;
|
|
725
|
+
const pose = this.kernel.authoritativePose(body.id);
|
|
726
|
+
const values = {
|
|
727
|
+
position: pose.position,
|
|
728
|
+
rotationDegrees: pose.rotationDegrees,
|
|
729
|
+
linearVelocity: Object.freeze([
|
|
730
|
+
bodies.linearVelocityX[identity.index],
|
|
731
|
+
bodies.linearVelocityY[identity.index]
|
|
732
|
+
]),
|
|
733
|
+
angularVelocityDegreesPerSecond: bodies.angularVelocity[identity.index] * 180 / Math.PI,
|
|
734
|
+
sleeping: (bodies.flags[identity.index] & BODY_SLEEPING_2D) !== 0,
|
|
735
|
+
enabled: this.kernel.isBodyEnabled(body.id),
|
|
736
|
+
generation: identity.generation
|
|
737
|
+
};
|
|
738
|
+
if (explicit !== void 0) {
|
|
739
|
+
stagePhysicsBodyHandle2D(batch, explicit, values, this);
|
|
740
|
+
}
|
|
741
|
+
if (materialized !== void 0 && materialized !== explicit) {
|
|
742
|
+
stagePhysicsBodyHandle2D(batch, materialized, values, this);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
copyEventDeliveries(candidate) {
|
|
747
|
+
const events = [];
|
|
748
|
+
for (let offset = 0; offset < candidate.eventCount; offset += 1) {
|
|
749
|
+
const eventIndex = candidate.eventOffset + offset;
|
|
750
|
+
const kind = candidate.eventKinds[eventIndex];
|
|
751
|
+
if (kind === 5 || kind === 6) {
|
|
752
|
+
const handler = kind === 6 ? this.acceptedProps.onSleep : this.acceptedProps.onWake;
|
|
753
|
+
if (handler === void 0) continue;
|
|
754
|
+
const bodyIndex = candidate.eventFirstColliderIndices[eventIndex];
|
|
755
|
+
const bodyGeneration = this.kernel.bodies.generations[bodyIndex];
|
|
756
|
+
const bodyId = this.kernel.bodyIdForIdentity(bodyIndex, bodyGeneration);
|
|
757
|
+
if (bodyId === void 0) continue;
|
|
758
|
+
events.push(
|
|
759
|
+
Object.freeze({
|
|
760
|
+
kind,
|
|
761
|
+
tick: candidate.eventTicks[eventIndex],
|
|
762
|
+
bodyIndex,
|
|
763
|
+
bodyGeneration,
|
|
764
|
+
bodyId,
|
|
765
|
+
handler
|
|
766
|
+
})
|
|
767
|
+
);
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
if (kind !== 1 && kind !== 2 && kind !== 3 && kind !== 4 && kind !== 7) {
|
|
771
|
+
continue;
|
|
772
|
+
}
|
|
773
|
+
this.copyContactEventDeliveries(candidate, eventIndex, kind, events);
|
|
774
|
+
}
|
|
775
|
+
return sortPhysicsEventDeliveries2D(events);
|
|
776
|
+
}
|
|
777
|
+
copyContactEventDeliveries(candidate, eventIndex, kind, events) {
|
|
778
|
+
const firstColliderIndex = candidate.eventFirstColliderIndices[eventIndex];
|
|
779
|
+
const firstColliderGeneration = candidate.eventFirstColliderGenerations[eventIndex];
|
|
780
|
+
const secondColliderIndex = candidate.eventSecondColliderIndices[eventIndex];
|
|
781
|
+
const secondColliderGeneration = candidate.eventSecondColliderGenerations[eventIndex];
|
|
782
|
+
const first = this.acceptedColliderForIdentity(
|
|
783
|
+
firstColliderIndex,
|
|
784
|
+
firstColliderGeneration
|
|
785
|
+
);
|
|
786
|
+
const second = this.acceptedColliderForIdentity(
|
|
787
|
+
secondColliderIndex,
|
|
788
|
+
secondColliderGeneration
|
|
789
|
+
);
|
|
790
|
+
if (first === void 0 || second === void 0) return;
|
|
791
|
+
const handlerName = eventHandlerName(kind);
|
|
792
|
+
const firstHandler = first.options.handlers[handlerName];
|
|
793
|
+
const secondHandler = second.options.handlers[handlerName];
|
|
794
|
+
if (firstHandler === void 0 && secondHandler === void 0) return;
|
|
795
|
+
const firstBodyIdentity = this.kernel.bodyIdentity(first.bodyId);
|
|
796
|
+
const secondBodyIdentity = this.kernel.bodyIdentity(second.bodyId);
|
|
797
|
+
if (firstBodyIdentity === void 0 || secondBodyIdentity === void 0)
|
|
798
|
+
return;
|
|
799
|
+
const points = [];
|
|
800
|
+
const pointBase = eventIndex * 2;
|
|
801
|
+
for (let point = 0; point < candidate.eventPointCounts[eventIndex]; point += 1) {
|
|
802
|
+
points.push(
|
|
803
|
+
Object.freeze({
|
|
804
|
+
firstX: candidate.eventPointFirstX[pointBase + point],
|
|
805
|
+
firstY: candidate.eventPointFirstY[pointBase + point],
|
|
806
|
+
secondX: candidate.eventPointSecondX[pointBase + point],
|
|
807
|
+
secondY: candidate.eventPointSecondY[pointBase + point],
|
|
808
|
+
separation: candidate.eventPointSeparations[pointBase + point]
|
|
809
|
+
})
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
const common = {
|
|
813
|
+
kind,
|
|
814
|
+
tick: candidate.eventTicks[eventIndex],
|
|
815
|
+
firstColliderIndex,
|
|
816
|
+
firstColliderGeneration,
|
|
817
|
+
secondColliderIndex,
|
|
818
|
+
secondColliderGeneration,
|
|
819
|
+
firstBodyIndex: firstBodyIdentity.index,
|
|
820
|
+
firstBodyGeneration: firstBodyIdentity.generation,
|
|
821
|
+
secondBodyIndex: secondBodyIdentity.index,
|
|
822
|
+
secondBodyGeneration: secondBodyIdentity.generation,
|
|
823
|
+
normalX: candidate.eventNormalX[eventIndex],
|
|
824
|
+
normalY: candidate.eventNormalY[eventIndex],
|
|
825
|
+
points: Object.freeze(points),
|
|
826
|
+
totalNormalImpulse: candidate.eventTotalNormalImpulses[eventIndex]
|
|
827
|
+
};
|
|
828
|
+
if (firstHandler !== void 0) {
|
|
829
|
+
events.push(
|
|
830
|
+
Object.freeze({
|
|
831
|
+
...common,
|
|
832
|
+
receiver: "first",
|
|
833
|
+
receiverColliderId: first.id,
|
|
834
|
+
receiverBodyId: first.bodyId,
|
|
835
|
+
handler: firstHandler,
|
|
836
|
+
selfTag: first.options.tag,
|
|
837
|
+
otherTag: second.options.tag
|
|
838
|
+
})
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
if (secondHandler !== void 0) {
|
|
842
|
+
events.push(
|
|
843
|
+
Object.freeze({
|
|
844
|
+
...common,
|
|
845
|
+
receiver: "second",
|
|
846
|
+
receiverColliderId: second.id,
|
|
847
|
+
receiverBodyId: second.bodyId,
|
|
848
|
+
handler: secondHandler,
|
|
849
|
+
selfTag: second.options.tag,
|
|
850
|
+
otherTag: first.options.tag
|
|
851
|
+
})
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
deliverEvents(events) {
|
|
856
|
+
if (!this.active) return;
|
|
857
|
+
const errors = [];
|
|
858
|
+
for (const fact of events) {
|
|
859
|
+
try {
|
|
860
|
+
if (isPhysicsBodyEventDelivery2D(fact)) {
|
|
861
|
+
const handler2 = this.bodyEventHandler(fact);
|
|
862
|
+
if (!handler2) continue;
|
|
863
|
+
handler2(
|
|
864
|
+
materializePhysicsBodyEvent2D(
|
|
865
|
+
fact,
|
|
866
|
+
this.materializeBodyHandle(fact.bodyIndex, fact.bodyGeneration)
|
|
867
|
+
)
|
|
868
|
+
);
|
|
869
|
+
continue;
|
|
870
|
+
}
|
|
871
|
+
const handler = this.contactEventHandler(fact);
|
|
872
|
+
if (!handler) continue;
|
|
873
|
+
handler(
|
|
874
|
+
materializePhysicsContactEvent2D(fact, {
|
|
875
|
+
body: (index, generation) => this.materializeBodyHandle(index, generation),
|
|
876
|
+
collider: (index, generation) => this.materializeColliderHandle(index, generation)
|
|
877
|
+
})
|
|
878
|
+
);
|
|
879
|
+
} catch (error) {
|
|
880
|
+
errors.push(error);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
if (errors.length === 1) throw errors[0];
|
|
884
|
+
if (errors.length > 1) {
|
|
885
|
+
throw new AggregateError(
|
|
886
|
+
errors,
|
|
887
|
+
"Multiple physics 2D event callbacks failed."
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
bodyEventHandler(fact) {
|
|
892
|
+
const handler = fact.kind === 6 ? this.acceptedProps.onSleep : this.acceptedProps.onWake;
|
|
893
|
+
const identity = this.kernel.bodyIdentity(fact.bodyId);
|
|
894
|
+
return identity?.index === fact.bodyIndex && identity.generation === fact.bodyGeneration ? handler : void 0;
|
|
895
|
+
}
|
|
896
|
+
contactEventHandler(fact) {
|
|
897
|
+
const receiver = this.acceptedColliders.find(
|
|
898
|
+
(collider) => collider.id === fact.receiverColliderId
|
|
899
|
+
);
|
|
900
|
+
if (receiver === void 0 || receiver.bodyId !== fact.receiverBodyId)
|
|
901
|
+
return void 0;
|
|
902
|
+
const handler = receiver.options.handlers[eventHandlerName(fact.kind)];
|
|
903
|
+
const colliderIdentity = this.kernel.colliderIdentity(receiver.id);
|
|
904
|
+
const expectedIndex = fact.receiver === "first" ? fact.firstColliderIndex : fact.secondColliderIndex;
|
|
905
|
+
const expectedGeneration = fact.receiver === "first" ? fact.firstColliderGeneration : fact.secondColliderGeneration;
|
|
906
|
+
return colliderIdentity?.index === expectedIndex && colliderIdentity.generation === expectedGeneration ? handler : void 0;
|
|
907
|
+
}
|
|
908
|
+
acceptedColliderForIdentity(index, generation) {
|
|
909
|
+
return this.acceptedColliders.find((collider) => {
|
|
910
|
+
const identity = this.kernel.colliderIdentity(collider.id);
|
|
911
|
+
return identity?.index === index && identity.generation === generation;
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
hasAwakeBodies() {
|
|
915
|
+
for (const body of this.acceptedBodies) {
|
|
916
|
+
if (body.descriptor.bodyType !== "kinematic" || !body.descriptor.options.enabled || this.kernel.bodyIdentity(body.id) === void 0)
|
|
917
|
+
continue;
|
|
918
|
+
const pose = this.kernel.authoritativePose(body.id);
|
|
919
|
+
const target = body.descriptor.options.target;
|
|
920
|
+
const position = target.position?.get() ?? body.initialPose.position;
|
|
921
|
+
const rotation = target.rotationDegrees?.get() ?? body.initialPose.rotationDegrees;
|
|
922
|
+
if (position && (position[0] !== pose.position[0] || position[1] !== pose.position[1]) || rotation !== void 0 && rotation !== pose.rotationDegrees)
|
|
923
|
+
return true;
|
|
924
|
+
}
|
|
925
|
+
const bodies = this.kernel.bodies;
|
|
926
|
+
for (const body of this.acceptedBodies) {
|
|
927
|
+
const identity = this.kernel.bodyIdentity(body.id);
|
|
928
|
+
if (identity === void 0) continue;
|
|
929
|
+
const index = identity.index;
|
|
930
|
+
const flags = bodies.flags[index];
|
|
931
|
+
if ((flags & BODY_TYPE_KINEMATIC_2D) !== 0 && (bodies.linearVelocityX[index] !== 0 || bodies.linearVelocityY[index] !== 0 || bodies.angularVelocity[index] !== 0))
|
|
932
|
+
return true;
|
|
933
|
+
if ((flags & BODY_TYPE_DYNAMIC_2D) !== 0 && (flags & BODY_SLEEPING_2D) === 0)
|
|
934
|
+
return true;
|
|
935
|
+
}
|
|
936
|
+
return false;
|
|
937
|
+
}
|
|
938
|
+
requireDraft() {
|
|
939
|
+
const draft = this.draft;
|
|
940
|
+
if (draft === void 0) {
|
|
941
|
+
throw new Error(
|
|
942
|
+
"A physics attachment requires an active PhysicsWorld2D render draft."
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
return draft;
|
|
946
|
+
}
|
|
947
|
+
allocateId() {
|
|
948
|
+
if (this.nextId === Number.MAX_SAFE_INTEGER) {
|
|
949
|
+
throw new Error("PhysicsWorld2D exhausted stable attachment identities.");
|
|
950
|
+
}
|
|
951
|
+
return this.nextId++;
|
|
952
|
+
}
|
|
953
|
+
assertActive() {
|
|
954
|
+
if (!this.active) {
|
|
955
|
+
throw new TypeError("Expected a live Pibbl physics 2D world handle.");
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
materializeRevision() {
|
|
959
|
+
return this.revision ??= signal(this.committedRevision, {
|
|
960
|
+
debugName: "PhysicsWorld2D.revision"
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
/** Query handles are cached only while their kernel identity remains live. */
|
|
964
|
+
evictRetiredMaterializedHandles() {
|
|
965
|
+
for (const [key, handle] of this.materializedBodyHandles) {
|
|
966
|
+
const separator = key.indexOf(":");
|
|
967
|
+
const index = Number(key.slice(0, separator));
|
|
968
|
+
const generation = Number(key.slice(separator + 1));
|
|
969
|
+
if (this.kernel.bodyIdForIdentity(index, generation) !== void 0)
|
|
970
|
+
continue;
|
|
971
|
+
const binding = physicsBodyHandleBinding2D(handle);
|
|
972
|
+
if (binding?.controller === this) {
|
|
973
|
+
unbindPhysicsBodyHandle2D(
|
|
974
|
+
handle,
|
|
975
|
+
this,
|
|
976
|
+
binding.bodyId,
|
|
977
|
+
binding.bindingGeneration
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
this.materializedBodyHandles.delete(key);
|
|
981
|
+
}
|
|
982
|
+
for (const [key, handle] of this.materializedColliderHandles) {
|
|
983
|
+
const identity = physicsColliderHandleIdentity2D(handle);
|
|
984
|
+
if (identity?.controller === this && this.kernel.colliderIdForIdentity(
|
|
985
|
+
identity.index,
|
|
986
|
+
identity.generation
|
|
987
|
+
) !== void 0)
|
|
988
|
+
continue;
|
|
989
|
+
this.materializedColliderHandles.delete(key);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
materializeBodyHandle(index, generation) {
|
|
993
|
+
const bodyId = this.kernel.bodyIdForIdentity(index, generation);
|
|
994
|
+
if (bodyId === void 0) {
|
|
995
|
+
throw new Error(
|
|
996
|
+
"Cannot materialize a stale physics 2D body query result."
|
|
997
|
+
);
|
|
998
|
+
}
|
|
999
|
+
const accepted = this.acceptedBodies.find((body) => body.id === bodyId);
|
|
1000
|
+
const explicit = accepted?.descriptor.options.handle;
|
|
1001
|
+
if (explicit !== void 0) return explicit;
|
|
1002
|
+
const key = `${String(index)}:${String(generation)}`;
|
|
1003
|
+
let handle = this.materializedBodyHandles.get(key);
|
|
1004
|
+
if (handle === void 0) {
|
|
1005
|
+
handle = createPhysicsBodyHandle2D(this.owner);
|
|
1006
|
+
bindPhysicsBodyHandle2D(handle, this, bodyId);
|
|
1007
|
+
this.materializedBodyHandles.set(key, handle);
|
|
1008
|
+
}
|
|
1009
|
+
return handle;
|
|
1010
|
+
}
|
|
1011
|
+
materializeColliderHandle(index, generation) {
|
|
1012
|
+
if (this.kernel.colliderIdForIdentity(index, generation) === void 0) {
|
|
1013
|
+
throw new Error(
|
|
1014
|
+
"Cannot materialize a stale physics 2D collider query result."
|
|
1015
|
+
);
|
|
1016
|
+
}
|
|
1017
|
+
const key = `${String(index)}:${String(generation)}`;
|
|
1018
|
+
let handle = this.materializedColliderHandles.get(key);
|
|
1019
|
+
if (handle === void 0) {
|
|
1020
|
+
handle = createPhysicsColliderHandle2D(this, index, generation);
|
|
1021
|
+
this.materializedColliderHandles.set(key, handle);
|
|
1022
|
+
}
|
|
1023
|
+
return handle;
|
|
1024
|
+
}
|
|
1025
|
+
resolveBodyHandle(handle) {
|
|
1026
|
+
const binding = physicsBodyHandleBinding2D(handle);
|
|
1027
|
+
if (binding?.controller !== this) return null;
|
|
1028
|
+
return this.kernel.bodyIdentity(binding.bodyId) ?? null;
|
|
1029
|
+
}
|
|
1030
|
+
resolveColliderHandle(handle) {
|
|
1031
|
+
const identity = physicsColliderHandleIdentity2D(handle);
|
|
1032
|
+
if (identity?.controller !== this) return null;
|
|
1033
|
+
return this.kernel.colliderIdForIdentity(
|
|
1034
|
+
identity.index,
|
|
1035
|
+
identity.generation
|
|
1036
|
+
) === void 0 ? null : identity;
|
|
1037
|
+
}
|
|
1038
|
+
unbindBodyHandle(body) {
|
|
1039
|
+
const handle = body.descriptor.options.handle;
|
|
1040
|
+
const generation = body.handleBindingGeneration;
|
|
1041
|
+
if (handle !== void 0 && generation !== void 0) {
|
|
1042
|
+
unbindPhysicsBodyHandle2D(handle, this, body.id, generation);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
function requirePhysicsWorld2DController(handle) {
|
|
1047
|
+
const controller = handle[worldController2DSymbol];
|
|
1048
|
+
if (!(controller instanceof PhysicsWorld2DController)) {
|
|
1049
|
+
throw new TypeError("Expected a live Pibbl physics 2D world handle.");
|
|
1050
|
+
}
|
|
1051
|
+
return controller;
|
|
1052
|
+
}
|
|
1053
|
+
function snapshotPhysicsWorld2DControllerForTest(controller) {
|
|
1054
|
+
return controller.snapshot();
|
|
1055
|
+
}
|
|
1056
|
+
function normalizeWorldConfiguration(props) {
|
|
1057
|
+
return normalizePhysicsWorld2DConfiguration({
|
|
1058
|
+
gravity: props.gravity,
|
|
1059
|
+
fixedStepMilliseconds: props.fixedStepMilliseconds,
|
|
1060
|
+
maxCatchUpSteps: props.maxCatchUpSteps,
|
|
1061
|
+
interpolation: props.interpolation,
|
|
1062
|
+
sleeping: props.sleeping,
|
|
1063
|
+
solver: props.solver
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
function denormalizeWorldConfiguration(configuration) {
|
|
1067
|
+
return Object.freeze({
|
|
1068
|
+
gravity: Object.freeze([
|
|
1069
|
+
configuration.gravityX,
|
|
1070
|
+
configuration.gravityY
|
|
1071
|
+
]),
|
|
1072
|
+
fixedStepMilliseconds: configuration.fixedStepMilliseconds,
|
|
1073
|
+
maxCatchUpSteps: configuration.maxCatchUpSteps,
|
|
1074
|
+
interpolation: configuration.interpolation,
|
|
1075
|
+
sleeping: configuration.sleeping,
|
|
1076
|
+
solver: Object.freeze({
|
|
1077
|
+
velocityIterations: configuration.velocityIterations,
|
|
1078
|
+
positionIterations: configuration.positionIterations
|
|
1079
|
+
})
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
function materializeTopology(draft, reenableVelocities, previousBodyDefinitions) {
|
|
1083
|
+
const collidersByBody = /* @__PURE__ */ new Map();
|
|
1084
|
+
for (const collider of draft.colliders.values()) {
|
|
1085
|
+
const entries = collidersByBody.get(collider.bodyId) ?? [];
|
|
1086
|
+
entries.push(collider);
|
|
1087
|
+
collidersByBody.set(collider.bodyId, entries);
|
|
1088
|
+
}
|
|
1089
|
+
const bodies = [...draft.bodies.values()].sort((left, right) => left.id - right.id).map(
|
|
1090
|
+
(body) => Object.freeze({
|
|
1091
|
+
kind: "body",
|
|
1092
|
+
id: body.id,
|
|
1093
|
+
definition: bodyDefinition(
|
|
1094
|
+
body,
|
|
1095
|
+
collidersByBody.get(body.id) ?? [],
|
|
1096
|
+
reenableVelocities.get(body.id),
|
|
1097
|
+
previousBodyDefinitions.get(body.id)
|
|
1098
|
+
)
|
|
1099
|
+
})
|
|
1100
|
+
);
|
|
1101
|
+
const colliders = [...draft.colliders.values()].sort((left, right) => left.id - right.id).map(
|
|
1102
|
+
(collider) => Object.freeze({
|
|
1103
|
+
kind: "collider",
|
|
1104
|
+
id: collider.id,
|
|
1105
|
+
bodyId: collider.bodyId,
|
|
1106
|
+
definition: Object.freeze({
|
|
1107
|
+
shape: collider.shape,
|
|
1108
|
+
material: Object.freeze({
|
|
1109
|
+
friction: collider.options.friction,
|
|
1110
|
+
restitution: collider.options.restitution
|
|
1111
|
+
}),
|
|
1112
|
+
filter: collider.options.collisionFilter,
|
|
1113
|
+
tag: collider.options.tag,
|
|
1114
|
+
handlers: collider.options.handlers,
|
|
1115
|
+
owner: collider.attachment,
|
|
1116
|
+
flags: collider.options.sensor ? COLLIDER_SENSOR_2D : 0
|
|
1117
|
+
})
|
|
1118
|
+
})
|
|
1119
|
+
);
|
|
1120
|
+
return Object.freeze([...bodies, ...colliders]);
|
|
1121
|
+
}
|
|
1122
|
+
function validateAutomaticMass(draft) {
|
|
1123
|
+
const massByBody = /* @__PURE__ */ new Map();
|
|
1124
|
+
for (const collider of draft.colliders.values()) {
|
|
1125
|
+
if (!collider.options.contributesToMass) continue;
|
|
1126
|
+
massByBody.set(
|
|
1127
|
+
collider.bodyId,
|
|
1128
|
+
(massByBody.get(collider.bodyId) ?? 0) + collider.shape.area * collider.options.density
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1131
|
+
for (const body of draft.bodies.values()) {
|
|
1132
|
+
if (body.descriptor.bodyType !== "dynamic" || !body.descriptor.options.enabled || body.descriptor.options.mass !== "auto") {
|
|
1133
|
+
continue;
|
|
1134
|
+
}
|
|
1135
|
+
if ((massByBody.get(body.id) ?? 0) <= 0) {
|
|
1136
|
+
throw new RangeError(
|
|
1137
|
+
"A dynamic body with automatic mass requires positive derived area from at least one active mass-contributing collider."
|
|
1138
|
+
);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
function bodyDefinition(body, colliders, reenableVelocity, previous) {
|
|
1143
|
+
const descriptor = body.descriptor;
|
|
1144
|
+
const enabled = descriptor.options.enabled;
|
|
1145
|
+
const massData = compoundMassData(colliders);
|
|
1146
|
+
let flags = 0;
|
|
1147
|
+
let linearVelocityX = 0;
|
|
1148
|
+
let linearVelocityY = 0;
|
|
1149
|
+
let angularVelocity = 0;
|
|
1150
|
+
let linearDamping = 0;
|
|
1151
|
+
let angularDamping = 0;
|
|
1152
|
+
let gravityScale = 0;
|
|
1153
|
+
let inverseMass = 0;
|
|
1154
|
+
let inverseInertia = 0;
|
|
1155
|
+
let localCenterX = 0;
|
|
1156
|
+
let localCenterY = 0;
|
|
1157
|
+
if (enabled && descriptor.bodyType === "dynamic") {
|
|
1158
|
+
flags |= BODY_TYPE_DYNAMIC_2D;
|
|
1159
|
+
if (descriptor.options.fixedRotation) flags |= BODY_FIXED_ROTATION_2D;
|
|
1160
|
+
if (!descriptor.options.allowSleep) flags |= BODY_SLEEP_DISABLED_2D;
|
|
1161
|
+
if (descriptor.options.ccd) flags |= BODY_CCD_2D;
|
|
1162
|
+
linearVelocityX = reenableVelocity?.linearVelocityX ?? descriptor.options.linearVelocity[0];
|
|
1163
|
+
linearVelocityY = reenableVelocity?.linearVelocityY ?? descriptor.options.linearVelocity[1];
|
|
1164
|
+
angularVelocity = reenableVelocity?.angularVelocity ?? descriptor.options.angularVelocityDegreesPerSecond * Math.PI / 180;
|
|
1165
|
+
linearDamping = descriptor.options.linearDamping;
|
|
1166
|
+
angularDamping = descriptor.options.angularDamping;
|
|
1167
|
+
gravityScale = descriptor.options.gravityScale;
|
|
1168
|
+
const mass = descriptor.options.mass === "auto" ? massData.mass : descriptor.options.mass;
|
|
1169
|
+
inverseMass = mass > 0 ? 1 / mass : 1;
|
|
1170
|
+
localCenterX = massData.centerX;
|
|
1171
|
+
localCenterY = massData.centerY;
|
|
1172
|
+
const inertia = massData.mass > 0 ? massData.inertia * (mass / massData.mass) : 0;
|
|
1173
|
+
inverseInertia = descriptor.options.fixedRotation ? 0 : inertia > 0 ? 1 / inertia : inverseMass;
|
|
1174
|
+
} else if (enabled && descriptor.bodyType === "kinematic") {
|
|
1175
|
+
flags |= BODY_TYPE_KINEMATIC_2D;
|
|
1176
|
+
if (!descriptor.options.allowSleep) flags |= BODY_SLEEP_DISABLED_2D;
|
|
1177
|
+
}
|
|
1178
|
+
const authoredRotationRadians = body.initialPose.rotationDegrees * Math.PI / 180;
|
|
1179
|
+
const previousKinematic = previous !== void 0 && (previous.flags & BODY_TYPE_KINEMATIC_2D) !== 0 ? previous : void 0;
|
|
1180
|
+
const preserveTargetBoundKinematicPose = descriptor.bodyType === "kinematic" && (descriptor.options.target.position !== void 0 || descriptor.options.target.rotationDegrees !== void 0) && previousKinematic !== void 0;
|
|
1181
|
+
const previousRotationRadians = previousKinematic?.rotationRadians ?? 0;
|
|
1182
|
+
const previousCosine = Math.cos(previousRotationRadians);
|
|
1183
|
+
const previousSine = Math.sin(previousRotationRadians);
|
|
1184
|
+
const previousOriginX = previousKinematic === void 0 ? 0 : previousKinematic.positionX - previousCosine * (previousKinematic.localCenterX ?? 0) + previousSine * (previousKinematic.localCenterY ?? 0);
|
|
1185
|
+
const previousOriginY = previousKinematic === void 0 ? 0 : previousKinematic.positionY - previousSine * (previousKinematic.localCenterX ?? 0) - previousCosine * (previousKinematic.localCenterY ?? 0);
|
|
1186
|
+
const positionX = preserveTargetBoundKinematicPose ? previousOriginX : body.initialPose.position[0];
|
|
1187
|
+
const positionY = preserveTargetBoundKinematicPose ? previousOriginY : body.initialPose.position[1];
|
|
1188
|
+
const effectiveRotationRadians = preserveTargetBoundKinematicPose ? previousKinematic.rotationRadians : authoredRotationRadians;
|
|
1189
|
+
const cosine = Math.cos(effectiveRotationRadians);
|
|
1190
|
+
const sine = Math.sin(effectiveRotationRadians);
|
|
1191
|
+
return Object.freeze({
|
|
1192
|
+
positionX: positionX + cosine * localCenterX - sine * localCenterY,
|
|
1193
|
+
positionY: positionY + sine * localCenterX + cosine * localCenterY,
|
|
1194
|
+
rotationRadians: effectiveRotationRadians,
|
|
1195
|
+
localCenterX,
|
|
1196
|
+
localCenterY,
|
|
1197
|
+
linearVelocityX,
|
|
1198
|
+
linearVelocityY,
|
|
1199
|
+
angularVelocity,
|
|
1200
|
+
forceX: 0,
|
|
1201
|
+
forceY: 0,
|
|
1202
|
+
torque: 0,
|
|
1203
|
+
inverseMass,
|
|
1204
|
+
inverseInertia,
|
|
1205
|
+
linearDamping,
|
|
1206
|
+
angularDamping,
|
|
1207
|
+
gravityScale,
|
|
1208
|
+
sleepTime: 0,
|
|
1209
|
+
flags,
|
|
1210
|
+
owner: body.attachment
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
const ZERO_VELOCITY_2D = Object.freeze({
|
|
1214
|
+
linearVelocityX: 0,
|
|
1215
|
+
linearVelocityY: 0,
|
|
1216
|
+
angularVelocity: 0
|
|
1217
|
+
});
|
|
1218
|
+
function compoundMassData(colliders) {
|
|
1219
|
+
const entries = colliders.filter((collider) => collider.options.contributesToMass).map((collider) => {
|
|
1220
|
+
const shape = collider.shape;
|
|
1221
|
+
const cosine = Math.cos(shape.localPose.rotationRadians);
|
|
1222
|
+
const sine = Math.sin(shape.localPose.rotationRadians);
|
|
1223
|
+
const centerX2 = shape.localPose.x + cosine * shape.centroidX - sine * shape.centroidY;
|
|
1224
|
+
const centerY2 = shape.localPose.y + sine * shape.centroidX + cosine * shape.centroidY;
|
|
1225
|
+
return {
|
|
1226
|
+
mass: shape.area * collider.options.density,
|
|
1227
|
+
centerX: centerX2,
|
|
1228
|
+
centerY: centerY2,
|
|
1229
|
+
centroidInertia: shape.unitInertia * collider.options.density
|
|
1230
|
+
};
|
|
1231
|
+
});
|
|
1232
|
+
const mass = entries.reduce((sum, entry) => sum + entry.mass, 0);
|
|
1233
|
+
if (mass <= 0) {
|
|
1234
|
+
return { mass: 0, centerX: 0, centerY: 0, inertia: 0 };
|
|
1235
|
+
}
|
|
1236
|
+
const centerX = entries.reduce((sum, entry) => sum + entry.mass * entry.centerX, 0) / mass;
|
|
1237
|
+
const centerY = entries.reduce((sum, entry) => sum + entry.mass * entry.centerY, 0) / mass;
|
|
1238
|
+
const inertia = entries.reduce((sum, entry) => {
|
|
1239
|
+
const offsetX = entry.centerX - centerX;
|
|
1240
|
+
const offsetY = entry.centerY - centerY;
|
|
1241
|
+
return sum + entry.centroidInertia + entry.mass * (offsetX * offsetX + offsetY * offsetY);
|
|
1242
|
+
}, 0);
|
|
1243
|
+
return { mass, centerX, centerY, inertia };
|
|
1244
|
+
}
|
|
1245
|
+
function sameConfiguration(left, right) {
|
|
1246
|
+
return left.gravityX === right.gravityX && left.gravityY === right.gravityY && left.fixedStepMilliseconds === right.fixedStepMilliseconds && left.maxCatchUpSteps === right.maxCatchUpSteps && left.interpolation === right.interpolation && left.sleeping === right.sleeping && left.velocityIterations === right.velocityIterations && left.positionIterations === right.positionIterations;
|
|
1247
|
+
}
|
|
1248
|
+
function copyPhysicsPose2D(pose) {
|
|
1249
|
+
return Object.freeze({
|
|
1250
|
+
position: copyFiniteVector2(pose.position, "initial physics pose.position"),
|
|
1251
|
+
rotationDegrees: requireFiniteNumber(
|
|
1252
|
+
pose.rotationDegrees,
|
|
1253
|
+
"initial physics pose.rotationDegrees"
|
|
1254
|
+
)
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
function sameTopology(left, right) {
|
|
1258
|
+
if (left.length !== right.length) return false;
|
|
1259
|
+
return left.every((first, index) => {
|
|
1260
|
+
const second = right[index];
|
|
1261
|
+
if (!second || first.kind !== second.kind || first.id !== second.id)
|
|
1262
|
+
return false;
|
|
1263
|
+
if (first.kind === "body" && second.kind === "body") {
|
|
1264
|
+
return sameRecord(first.definition, second.definition);
|
|
1265
|
+
}
|
|
1266
|
+
if (first.kind === "collider" && second.kind === "collider") {
|
|
1267
|
+
return first.bodyId === second.bodyId && first.definition.shape === second.definition.shape && first.definition.flags === second.definition.flags && sameRecord(first.definition.material, second.definition.material) && sameRecord(first.definition.filter, second.definition.filter);
|
|
1268
|
+
}
|
|
1269
|
+
return false;
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
function sameRecord(left, right) {
|
|
1273
|
+
if (left === right) return true;
|
|
1274
|
+
if (typeof left !== "object" || left === null || typeof right !== "object" || right === null)
|
|
1275
|
+
return false;
|
|
1276
|
+
const leftEntries = Object.entries(left);
|
|
1277
|
+
const rightRecord = right;
|
|
1278
|
+
return leftEntries.length === Object.keys(rightRecord).length && leftEntries.every(([key, value]) => rightRecord[key] === value);
|
|
1279
|
+
}
|
|
1280
|
+
function validateUniqueBodyHandles(bodies) {
|
|
1281
|
+
const ids = /* @__PURE__ */ new Map();
|
|
1282
|
+
for (const body of bodies) {
|
|
1283
|
+
const handle = body.descriptor.options.handle;
|
|
1284
|
+
if (handle === void 0) continue;
|
|
1285
|
+
const previous = ids.get(handle);
|
|
1286
|
+
if (previous !== void 0 && previous !== body.id) {
|
|
1287
|
+
throw new Error(
|
|
1288
|
+
"A Pibbl physics 2D body handle may bind to at most one live body."
|
|
1289
|
+
);
|
|
1290
|
+
}
|
|
1291
|
+
ids.set(handle, body.id);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
function eventHandlerName(kind) {
|
|
1295
|
+
switch (kind) {
|
|
1296
|
+
case 1:
|
|
1297
|
+
return "onCollisionStart";
|
|
1298
|
+
case 2:
|
|
1299
|
+
return "onCollisionEnd";
|
|
1300
|
+
case 3:
|
|
1301
|
+
return "onOverlapStart";
|
|
1302
|
+
case 4:
|
|
1303
|
+
return "onOverlapEnd";
|
|
1304
|
+
case 7:
|
|
1305
|
+
return "onHit";
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
const ZERO_POSE_2D = Object.freeze({
|
|
1309
|
+
position: Object.freeze([0, 0]),
|
|
1310
|
+
rotationDegrees: 0
|
|
1311
|
+
});
|
|
1312
|
+
export {
|
|
1313
|
+
PhysicsWorld2DController,
|
|
1314
|
+
requirePhysicsWorld2DController,
|
|
1315
|
+
snapshotPhysicsWorld2DControllerForTest
|
|
1316
|
+
};
|
|
1317
|
+
//# sourceMappingURL=controller.js.map
|