@7h3laughingman/foundry-types 13.351.0
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.md +21 -0
- package/README.md +3 -0
- package/package.json +76 -0
- package/src/client/_module.d.mts +103 -0
- package/src/client/_types.d.mts +900 -0
- package/src/client/applications/_module.d.mts +27 -0
- package/src/client/applications/_types.d.mts +192 -0
- package/src/client/applications/api/_module.d.mts +8 -0
- package/src/client/applications/api/application.d.mts +456 -0
- package/src/client/applications/api/category-browser.d.mts +78 -0
- package/src/client/applications/api/dialog.d.mts +213 -0
- package/src/client/applications/api/document-sheet.d.mts +148 -0
- package/src/client/applications/api/handlebars-application.d.mts +120 -0
- package/src/client/applications/apps/_module.d.mts +10 -0
- package/src/client/applications/apps/av/_module.d.mts +2 -0
- package/src/client/applications/apps/av/camera-popout.d.mts +53 -0
- package/src/client/applications/apps/av/cameras.d.mts +235 -0
- package/src/client/applications/apps/combat-tracker-config.d.mts +27 -0
- package/src/client/applications/apps/compendium-art-config.d.mts +17 -0
- package/src/client/applications/apps/document-ownership.d.mts +17 -0
- package/src/client/applications/apps/document-sheet-config.d.mts +144 -0
- package/src/client/applications/apps/file-picker.d.mts +321 -0
- package/src/client/applications/apps/grid-config.d.mts +33 -0
- package/src/client/applications/apps/image-popout.d.mts +92 -0
- package/src/client/applications/apps/permission-config.d.mts +24 -0
- package/src/client/applications/dice/_module.d.mts +1 -0
- package/src/client/applications/dice/roll-resolver.d.mts +92 -0
- package/src/client/applications/elements/_module.d.mts +19 -0
- package/src/client/applications/elements/codemirror/element.d.mts +73 -0
- package/src/client/applications/elements/color-picker.d.mts +14 -0
- package/src/client/applications/elements/document-embed.d.mts +14 -0
- package/src/client/applications/elements/document-tags.d.mts +50 -0
- package/src/client/applications/elements/enriched-content.d.mts +31 -0
- package/src/client/applications/elements/file-picker.d.mts +59 -0
- package/src/client/applications/elements/form-element.d.mts +105 -0
- package/src/client/applications/elements/hue-slider.d.mts +35 -0
- package/src/client/applications/elements/multi-select.d.mts +89 -0
- package/src/client/applications/elements/prosemirror-editor.d.mts +32 -0
- package/src/client/applications/elements/range-picker.d.mts +23 -0
- package/src/client/applications/elements/secret-block.d.mts +28 -0
- package/src/client/applications/elements/string-tags.d.mts +50 -0
- package/src/client/applications/forms/fields.d.mts +132 -0
- package/src/client/applications/handlebars.d.mts +303 -0
- package/src/client/applications/hud/_module.d.mts +5 -0
- package/src/client/applications/hud/container.d.mts +38 -0
- package/src/client/applications/hud/drawing-hud.d.mts +14 -0
- package/src/client/applications/hud/placeable-hud.d.mts +72 -0
- package/src/client/applications/hud/tile-hud.d.mts +21 -0
- package/src/client/applications/hud/token-hud.d.mts +69 -0
- package/src/client/applications/settings/_module.d.mts +2 -0
- package/src/client/applications/settings/config.d.mts +38 -0
- package/src/client/applications/settings/menus/_module.d.mts +6 -0
- package/src/client/applications/settings/menus/av-config.d.mts +37 -0
- package/src/client/applications/settings/menus/default-sheets-config.d.mts +23 -0
- package/src/client/applications/settings/menus/dice-config.d.mts +23 -0
- package/src/client/applications/settings/menus/font-config.d.mts +145 -0
- package/src/client/applications/settings/menus/prototype-overrides.d.mts +20 -0
- package/src/client/applications/settings/menus/ui-config.d.mts +40 -0
- package/src/client/applications/sheets/_module.d.mts +9 -0
- package/src/client/applications/sheets/combatant-config.d.mts +21 -0
- package/src/client/applications/sheets/item-sheet.d.mts +13 -0
- package/src/client/applications/sheets/scene-config.d.mts +50 -0
- package/src/client/applications/sheets/template-config.d.mts +19 -0
- package/src/client/applications/sheets/token/mixin.mts +182 -0
- package/src/client/applications/sheets/token/prototype-config.d.mts +75 -0
- package/src/client/applications/sheets/token/token-config.d.mts +62 -0
- package/src/client/applications/sheets/user-config.d.mts +27 -0
- package/src/client/applications/sidebar/_module.d.mts +5 -0
- package/src/client/applications/sidebar/apps/_module.d.mts +9 -0
- package/src/client/applications/sidebar/apps/chat-popout.d.mts +45 -0
- package/src/client/applications/sidebar/apps/compendium.d.mts +65 -0
- package/src/client/applications/sidebar/apps/controls-config.d.mts +29 -0
- package/src/client/applications/sidebar/apps/folder-export.d.mts +11 -0
- package/src/client/applications/sidebar/apps/invitation-links.d.mts +10 -0
- package/src/client/applications/sidebar/apps/module-management.d.mts +65 -0
- package/src/client/applications/sidebar/apps/support-details.d.mts +72 -0
- package/src/client/applications/sidebar/apps/tours-management.d.mts +16 -0
- package/src/client/applications/sidebar/apps/world-config.d.mts +38 -0
- package/src/client/applications/sidebar/document-directory.d.mts +327 -0
- package/src/client/applications/sidebar/sidebar-tab.d.mts +89 -0
- package/src/client/applications/sidebar/sidebar.d.mts +93 -0
- package/src/client/applications/sidebar/tabs/_module.d.mts +14 -0
- package/src/client/applications/sidebar/tabs/actor-directory.d.mts +26 -0
- package/src/client/applications/sidebar/tabs/cards-directory.d.mts +19 -0
- package/src/client/applications/sidebar/tabs/chat.d.mts +271 -0
- package/src/client/applications/sidebar/tabs/combat-tracker.d.mts +198 -0
- package/src/client/applications/sidebar/tabs/compendium-directory.d.mts +289 -0
- package/src/client/applications/sidebar/tabs/item-directory.d.mts +24 -0
- package/src/client/applications/sidebar/tabs/journal-directory.d.mts +19 -0
- package/src/client/applications/sidebar/tabs/macro-directory.d.mts +12 -0
- package/src/client/applications/sidebar/tabs/playlist-directory.d.mts +267 -0
- package/src/client/applications/sidebar/tabs/roll-table-directory.d.mts +19 -0
- package/src/client/applications/sidebar/tabs/scene-directory.d.mts +26 -0
- package/src/client/applications/sidebar/tabs/settings.d.mts +16 -0
- package/src/client/applications/ui/_module.d.mts +9 -0
- package/src/client/applications/ui/game-pause.d.mts +15 -0
- package/src/client/applications/ui/hotbar.d.mts +86 -0
- package/src/client/applications/ui/main-menu.d.mts +48 -0
- package/src/client/applications/ui/notifications.d.mts +168 -0
- package/src/client/applications/ui/players.d.mts +92 -0
- package/src/client/applications/ui/region-legend.d.mts +47 -0
- package/src/client/applications/ui/scene-controls.d.mts +138 -0
- package/src/client/applications/ui/scene-navigation.d.mts +61 -0
- package/src/client/applications/ux/_module.d.mts +11 -0
- package/src/client/applications/ux/context-menu.d.mts +202 -0
- package/src/client/applications/ux/drag-drop.d.mts +131 -0
- package/src/client/applications/ux/draggable.d.mts +108 -0
- package/src/client/applications/ux/form-data-extended.d.mts +76 -0
- package/src/client/applications/ux/html-secret.d.mts +61 -0
- package/src/client/applications/ux/prosemirror-editor.d.mts +173 -0
- package/src/client/applications/ux/search-filter.d.mts +119 -0
- package/src/client/applications/ux/tabs.d.mts +94 -0
- package/src/client/applications/ux/text-editor.d.mts +329 -0
- package/src/client/appv1/_module.d.mts +2 -0
- package/src/client/appv1/api/_module.d.mts +8 -0
- package/src/client/appv1/api/application-v1.d.mts +388 -0
- package/src/client/appv1/api/dialog-v1.d.mts +191 -0
- package/src/client/appv1/api/document-sheet-v1.d.mts +96 -0
- package/src/client/appv1/api/form-application-v1.d.mts +203 -0
- package/src/client/appv1/sheets/_module.d.mts +9 -0
- package/src/client/appv1/sheets/actor-sheet.d.mts +129 -0
- package/src/client/appv1/sheets/adventure-importer.d.mts +43 -0
- package/src/client/appv1/sheets/item-sheet.d.mts +42 -0
- package/src/client/appv1/sheets/journal-page-sheet.d.mts +100 -0
- package/src/client/appv1/sheets/journal-sheet.d.mts +262 -0
- package/src/client/audio/_module.d.mts +9 -0
- package/src/client/audio/_types.d.mts +121 -0
- package/src/client/audio/biquad.d.mts +29 -0
- package/src/client/audio/cache.d.mts +58 -0
- package/src/client/audio/convolver.d.mts +50 -0
- package/src/client/audio/helper.d.mts +306 -0
- package/src/client/audio/sound.d.mts +289 -0
- package/src/client/audio/timeout.d.mts +71 -0
- package/src/client/av/_module.d.mts +7 -0
- package/src/client/av/client.d.mts +167 -0
- package/src/client/av/clients/_module.d.mts +1 -0
- package/src/client/av/clients/simplepeer.d.mts +123 -0
- package/src/client/av/master.d.mts +128 -0
- package/src/client/av/settings.d.mts +100 -0
- package/src/client/canvas/_module.d.mts +20 -0
- package/src/client/canvas/animation/_module.d.mts +5 -0
- package/src/client/canvas/animation/_types.d.mts +73 -0
- package/src/client/canvas/animation/canvas-animation.d.mts +114 -0
- package/src/client/canvas/animation/chat-bubbles.d.mts +58 -0
- package/src/client/canvas/animation/smooth-noise.d.mts +34 -0
- package/src/client/canvas/board.d.mts +413 -0
- package/src/client/canvas/containers/_module.d.mts +20 -0
- package/src/client/canvas/containers/_types.d.mts +21 -0
- package/src/client/canvas/containers/advanced/cached-container.d.mts +108 -0
- package/src/client/canvas/containers/advanced/full-canvas-mixin.d.mts +12 -0
- package/src/client/canvas/containers/advanced/full-container-mixin.d.mts +12 -0
- package/src/client/canvas/containers/advanced/unbound-container.d.mts +12 -0
- package/src/client/canvas/containers/elements/control-icon.d.mts +40 -0
- package/src/client/canvas/containers/elements/cursor.d.mts +37 -0
- package/src/client/canvas/containers/elements/door-control.d.mts +66 -0
- package/src/client/canvas/containers/elements/door-mesh.d.mts +127 -0
- package/src/client/canvas/containers/elements/grid-highlight.d.mts +25 -0
- package/src/client/canvas/containers/elements/grid-mesh.d.mts +34 -0
- package/src/client/canvas/containers/elements/particles/leaves.d.mts +15 -0
- package/src/client/canvas/containers/elements/particles/particle-effect.d.mts +45 -0
- package/src/client/canvas/containers/elements/point-source-mesh.d.mts +29 -0
- package/src/client/canvas/containers/elements/precise-text.d.mts +18 -0
- package/src/client/canvas/containers/elements/quad-mesh.d.mts +41 -0
- package/src/client/canvas/containers/elements/resize-handle.d.mts +61 -0
- package/src/client/canvas/containers/elements/sprite-mesh.d.mts +319 -0
- package/src/client/canvas/extensions/_module.d.mts +4 -0
- package/src/client/canvas/extensions/circle-extension.d.mts +4 -0
- package/src/client/canvas/extensions/graphics-extension.d.mts +5 -0
- package/src/client/canvas/extensions/polygon-extension.d.mts +4 -0
- package/src/client/canvas/extensions/rectangle-extension.d.mts +4 -0
- package/src/client/canvas/framebuffer-snapshot.d.mts +20 -0
- package/src/client/canvas/geometry/_module.d.mts +12 -0
- package/src/client/canvas/geometry/_types.d.mts +90 -0
- package/src/client/canvas/geometry/clockwise-sweep.d.mts +129 -0
- package/src/client/canvas/geometry/edges/_module.d.mts +5 -0
- package/src/client/canvas/geometry/edges/collision.d.mts +58 -0
- package/src/client/canvas/geometry/edges/edge.d.mts +144 -0
- package/src/client/canvas/geometry/edges/edges.d.mts +14 -0
- package/src/client/canvas/geometry/edges/vertex.d.mts +85 -0
- package/src/client/canvas/geometry/observable-transform.d.mts +28 -0
- package/src/client/canvas/geometry/quad-tree.d.mts +150 -0
- package/src/client/canvas/geometry/shapes/limited-angle-polygon.d.mts +69 -0
- package/src/client/canvas/geometry/shapes/polygon-mesher.d.mts +50 -0
- package/src/client/canvas/geometry/shapes/ray.d.mts +126 -0
- package/src/client/canvas/geometry/shapes/source-polygon.d.mts +161 -0
- package/src/client/canvas/geometry/unbound-transform.d.mts +9 -0
- package/src/client/canvas/geometry/weiler-atherton-clipping.d.mts +120 -0
- package/src/client/canvas/groups/_module.d.mts +10 -0
- package/src/client/canvas/groups/canvas-group-mixin.mts +95 -0
- package/src/client/canvas/groups/effects.d.mts +118 -0
- package/src/client/canvas/groups/environment.d.mts +79 -0
- package/src/client/canvas/groups/hidden.d.mts +42 -0
- package/src/client/canvas/groups/interface.d.mts +31 -0
- package/src/client/canvas/groups/overlay.d.mts +11 -0
- package/src/client/canvas/groups/primary.d.mts +223 -0
- package/src/client/canvas/groups/rendered.d.mts +7 -0
- package/src/client/canvas/groups/visibility.d.mts +154 -0
- package/src/client/canvas/interaction/_module.d.mts +15 -0
- package/src/client/canvas/interaction/_types.d.mts +67 -0
- package/src/client/canvas/interaction/mouse-handler.d.mts +231 -0
- package/src/client/canvas/interaction/ping/alert.d.mts +16 -0
- package/src/client/canvas/interaction/ping/arrow.d.mts +16 -0
- package/src/client/canvas/interaction/ping/chevron.d.mts +25 -0
- package/src/client/canvas/interaction/ping/ping.d.mts +35 -0
- package/src/client/canvas/interaction/ping/pulse.d.mts +28 -0
- package/src/client/canvas/interaction/render-flags.d.mts +69 -0
- package/src/client/canvas/interaction/ruler/base-ruler.d.mts +179 -0
- package/src/client/canvas/interaction/ruler/ruler.d.mts +56 -0
- package/src/client/canvas/layers/_module.d.mts +31 -0
- package/src/client/canvas/layers/_types.d.mts +89 -0
- package/src/client/canvas/layers/base/canvas-layer.d.mts +71 -0
- package/src/client/canvas/layers/base/interaction-layer.d.mts +176 -0
- package/src/client/canvas/layers/base/placeables-layer.d.mts +410 -0
- package/src/client/canvas/layers/controls.d.mts +181 -0
- package/src/client/canvas/layers/drawings.d.mts +75 -0
- package/src/client/canvas/layers/effects/background-effects.d.mts +32 -0
- package/src/client/canvas/layers/effects/coloration-effects.d.mts +23 -0
- package/src/client/canvas/layers/effects/darkness-effects.d.mts +14 -0
- package/src/client/canvas/layers/effects/illumination-effects.d.mts +72 -0
- package/src/client/canvas/layers/effects/weather-effects.d.mts +137 -0
- package/src/client/canvas/layers/grid.d.mts +112 -0
- package/src/client/canvas/layers/lighting.d.mts +59 -0
- package/src/client/canvas/layers/masks/depth.d.mts +53 -0
- package/src/client/canvas/layers/masks/occlusion.d.mts +84 -0
- package/src/client/canvas/layers/masks/vision.d.mts +44 -0
- package/src/client/canvas/layers/notes.d.mts +59 -0
- package/src/client/canvas/layers/regions.d.mts +70 -0
- package/src/client/canvas/layers/sounds.d.mts +190 -0
- package/src/client/canvas/layers/templates.d.mts +41 -0
- package/src/client/canvas/layers/tiles.d.mts +66 -0
- package/src/client/canvas/layers/tokens.d.mts +171 -0
- package/src/client/canvas/layers/walls.d.mts +99 -0
- package/src/client/canvas/loader.d.mts +135 -0
- package/src/client/canvas/perception/_module.d.mts +13 -0
- package/src/client/canvas/perception/_types.d.mts +61 -0
- package/src/client/canvas/perception/detection-mode.d.mts +122 -0
- package/src/client/canvas/perception/detection-modes/darkvision.d.mts +11 -0
- package/src/client/canvas/perception/detection-modes/invisibility-perception.d.mts +15 -0
- package/src/client/canvas/perception/detection-modes/light-perception.d.mts +18 -0
- package/src/client/canvas/perception/detection-modes/super-perception.d.mts +13 -0
- package/src/client/canvas/perception/detection-modes/tremor-perception.d.mts +13 -0
- package/src/client/canvas/perception/fog.d.mts +65 -0
- package/src/client/canvas/perception/perception-manager.d.mts +72 -0
- package/src/client/canvas/perception/vision-mode.d.mts +133 -0
- package/src/client/canvas/placeables/_module.d.mts +15 -0
- package/src/client/canvas/placeables/_types.d.mts +29 -0
- package/src/client/canvas/placeables/drawing.d.mts +106 -0
- package/src/client/canvas/placeables/light.d.mts +155 -0
- package/src/client/canvas/placeables/note.d.mts +61 -0
- package/src/client/canvas/placeables/placeable-object.d.mts +415 -0
- package/src/client/canvas/placeables/region.d.mts +129 -0
- package/src/client/canvas/placeables/regions/_module.d.mts +2 -0
- package/src/client/canvas/placeables/regions/geometry.d.mts +19 -0
- package/src/client/canvas/placeables/regions/mesh.d.mts +72 -0
- package/src/client/canvas/placeables/sound.d.mts +93 -0
- package/src/client/canvas/placeables/template.d.mts +164 -0
- package/src/client/canvas/placeables/tile.d.mts +189 -0
- package/src/client/canvas/placeables/token.d.mts +675 -0
- package/src/client/canvas/placeables/tokens/_module.d.mts +8 -0
- package/src/client/canvas/placeables/tokens/base-ruler.d.mts +68 -0
- package/src/client/canvas/placeables/tokens/ring-config.d.mts +201 -0
- package/src/client/canvas/placeables/tokens/ring-data.d.mts +56 -0
- package/src/client/canvas/placeables/tokens/ring.d.mts +194 -0
- package/src/client/canvas/placeables/tokens/ruler.d.mts +96 -0
- package/src/client/canvas/placeables/tokens/targets.d.mts +22 -0
- package/src/client/canvas/placeables/tokens/turn-marker-data.d.mts +52 -0
- package/src/client/canvas/placeables/tokens/turn-marker.d.mts +45 -0
- package/src/client/canvas/placeables/wall.d.mts +155 -0
- package/src/client/canvas/primary/_module.d.mts +7 -0
- package/src/client/canvas/primary/primary-canvas-container.d.mts +40 -0
- package/src/client/canvas/primary/primary-canvas-object.mts +215 -0
- package/src/client/canvas/primary/primary-graphics.d.mts +22 -0
- package/src/client/canvas/primary/primary-occludable-object.mts +139 -0
- package/src/client/canvas/primary/primary-particle-effect.d.mts +50 -0
- package/src/client/canvas/primary/primary-sprite-mesh.d.mts +127 -0
- package/src/client/canvas/rendering/_module.d.mts +5 -0
- package/src/client/canvas/rendering/batching/_module.d.mts +2 -0
- package/src/client/canvas/rendering/batching/batch-renderer.d.mts +71 -0
- package/src/client/canvas/rendering/batching/batch-shader-generator.d.mts +13 -0
- package/src/client/canvas/rendering/blend-modes.d.mts +37 -0
- package/src/client/canvas/rendering/filters/_module.d.mts +13 -0
- package/src/client/canvas/rendering/filters/base-filter.d.mts +28 -0
- package/src/client/canvas/rendering/filters/base-mask-filter.d.mts +14 -0
- package/src/client/canvas/rendering/filters/blur.d.mts +152 -0
- package/src/client/canvas/rendering/filters/effects-masking.d.mts +84 -0
- package/src/client/canvas/rendering/filters/environment.d.mts +22 -0
- package/src/client/canvas/rendering/filters/glow-overlay.d.mts +41 -0
- package/src/client/canvas/rendering/filters/invisibility.d.mts +11 -0
- package/src/client/canvas/rendering/filters/outline-overlay.d.mts +43 -0
- package/src/client/canvas/rendering/filters/smaa/_module.d.mts +4 -0
- package/src/client/canvas/rendering/filters/smaa/blend.d.mts +6 -0
- package/src/client/canvas/rendering/filters/smaa/edges.d.mts +11 -0
- package/src/client/canvas/rendering/filters/smaa/smaa.d.mts +102 -0
- package/src/client/canvas/rendering/filters/smaa/weights.d.mts +11 -0
- package/src/client/canvas/rendering/filters/transition.d.mts +97 -0
- package/src/client/canvas/rendering/filters/visibility.d.mts +46 -0
- package/src/client/canvas/rendering/filters/vision-mask-filter.d.mts +15 -0
- package/src/client/canvas/rendering/filters/void.d.mts +6 -0
- package/src/client/canvas/rendering/filters/weather-occlusion-mask.d.mts +30 -0
- package/src/client/canvas/rendering/mixins/_module.d.mts +2 -0
- package/src/client/canvas/rendering/mixins/base-shader-mixin.d.mts +118 -0
- package/src/client/canvas/rendering/mixins/fragment-channel-mixin.d.mts +21 -0
- package/src/client/canvas/rendering/shaders/_module.d.mts +80 -0
- package/src/client/canvas/rendering/shaders/_types.d.mts +98 -0
- package/src/client/canvas/rendering/shaders/base-shader.d.mts +58 -0
- package/src/client/canvas/rendering/shaders/graphics/dash-line.d.mts +13 -0
- package/src/client/canvas/rendering/shaders/grid/grid.d.mts +99 -0
- package/src/client/canvas/rendering/shaders/lighting/background-lighting.d.mts +50 -0
- package/src/client/canvas/rendering/shaders/lighting/base-lighting.d.mts +164 -0
- package/src/client/canvas/rendering/shaders/lighting/coloration-lighting.d.mts +48 -0
- package/src/client/canvas/rendering/shaders/lighting/darkness-lighting.d.mts +45 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/bewitching-wave.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/black-hole.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/chroma.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/emanation.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/energy-field.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/fairy-light.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/flame.d.mts +75 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/fog.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/force-grid.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/ghost-light.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/hexa-dome.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/light-dome.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/magical-gloom.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/pulse.d.mts +41 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/radial-rainbow.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/revolving-light.d.mts +38 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/roiling-mass.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/siren-light.d.mts +80 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/smoke-patch.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/star-light.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/sunburst.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/swirling-rainbow.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/torch.d.mts +41 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/vortex.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/wave.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/illumination-lighting.d.mts +51 -0
- package/src/client/canvas/rendering/shaders/region/adjust-darkness-level.d.mts +58 -0
- package/src/client/canvas/rendering/shaders/region/base.d.mts +20 -0
- package/src/client/canvas/rendering/shaders/region/highlight.d.mts +18 -0
- package/src/client/canvas/rendering/shaders/samplers/amplification.d.mts +30 -0
- package/src/client/canvas/rendering/shaders/samplers/base-sampler.d.mts +141 -0
- package/src/client/canvas/rendering/shaders/samplers/baseline-illumination.d.mts +15 -0
- package/src/client/canvas/rendering/shaders/samplers/color-adjustments.d.mts +36 -0
- package/src/client/canvas/rendering/shaders/samplers/colorize-brightness.d.mts +17 -0
- package/src/client/canvas/rendering/shaders/samplers/fog-of-war.d.mts +9 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/depth.d.mts +66 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/occlusion.d.mts +77 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/primary.d.mts +28 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/token-ring.d.mts +33 -0
- package/src/client/canvas/rendering/shaders/vision/background-vision.d.mts +47 -0
- package/src/client/canvas/rendering/shaders/vision/base-vision.d.mts +11 -0
- package/src/client/canvas/rendering/shaders/vision/coloration-vision.d.mts +43 -0
- package/src/client/canvas/rendering/shaders/vision/effects/amplification.d.mts +35 -0
- package/src/client/canvas/rendering/shaders/vision/effects/wave.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/vision/illumination-vision.d.mts +45 -0
- package/src/client/canvas/rendering/shaders/weather/base-weather.d.mts +87 -0
- package/src/client/canvas/rendering/shaders/weather/effect.d.mts +27 -0
- package/src/client/canvas/rendering/shaders/weather/fog.d.mts +26 -0
- package/src/client/canvas/rendering/shaders/weather/rain.d.mts +16 -0
- package/src/client/canvas/rendering/shaders/weather/snow.d.mts +12 -0
- package/src/client/canvas/scene-manager.d.mts +101 -0
- package/src/client/canvas/sources/_module.d.mts +10 -0
- package/src/client/canvas/sources/base-effect-source.d.mts +179 -0
- package/src/client/canvas/sources/base-light-source.d.mts +141 -0
- package/src/client/canvas/sources/global-light-source.d.mts +36 -0
- package/src/client/canvas/sources/point-darkness-source.d.mts +87 -0
- package/src/client/canvas/sources/point-effect-source.d.mts +105 -0
- package/src/client/canvas/sources/point-light-source.d.mts +54 -0
- package/src/client/canvas/sources/point-movement-source.d.mts +10 -0
- package/src/client/canvas/sources/point-sound-source.d.mts +29 -0
- package/src/client/canvas/sources/point-vision-source.d.mts +151 -0
- package/src/client/canvas/sources/rendered-effect-source.d.mts +214 -0
- package/src/client/canvas/texture-extractor.d.mts +98 -0
- package/src/client/canvas/workers/_module.d.mts +1 -0
- package/src/client/canvas/workers/texture-worker.d.mts +73 -0
- package/src/client/client.d.mts +15 -0
- package/src/client/config.d.mts +868 -0
- package/src/client/data/_module.d.mts +11 -0
- package/src/client/data/_types.d.mts +97 -0
- package/src/client/data/calendar.d.mts +175 -0
- package/src/client/data/client-backend.d.mts +82 -0
- package/src/client/data/combat-config.d.mts +84 -0
- package/src/client/data/region-behaviors/_module.d.mts +9 -0
- package/src/client/data/region-behaviors/adjust-darkness-level.d.mts +29 -0
- package/src/client/data/region-behaviors/base.d.mts +70 -0
- package/src/client/data/region-behaviors/execute-macro.d.mts +17 -0
- package/src/client/data/region-behaviors/execute-script.d.mts +15 -0
- package/src/client/data/region-behaviors/increase-movement-cost.d.mts +36 -0
- package/src/client/data/region-behaviors/pause-game.d.mts +15 -0
- package/src/client/data/region-behaviors/suppress-weather.d.mts +13 -0
- package/src/client/data/region-behaviors/teleport-token.d.mts +27 -0
- package/src/client/data/region-behaviors/toggle-behavior.d.mts +19 -0
- package/src/client/data/region-shapes/_module.d.mts +2 -0
- package/src/client/data/region-shapes/polygon-tree.d.mts +101 -0
- package/src/client/data/region-shapes/shape.d.mts +97 -0
- package/src/client/data/terrain-data.d.mts +70 -0
- package/src/client/dice/_module.d.mts +14 -0
- package/src/client/dice/_types.d.mts +89 -0
- package/src/client/dice/parser.d.mts +83 -0
- package/src/client/dice/roll.d.mts +542 -0
- package/src/client/dice/terms/_module.d.mts +16 -0
- package/src/client/dice/terms/_types.d.mts +10 -0
- package/src/client/dice/terms/coin.d.mts +35 -0
- package/src/client/dice/terms/dice.d.mts +263 -0
- package/src/client/dice/terms/die.d.mts +199 -0
- package/src/client/dice/terms/fate.d.mts +22 -0
- package/src/client/dice/terms/function.d.mts +60 -0
- package/src/client/dice/terms/numeric.d.mts +39 -0
- package/src/client/dice/terms/operator.d.mts +28 -0
- package/src/client/dice/terms/parenthetical.d.mts +70 -0
- package/src/client/dice/terms/pool.d.mts +170 -0
- package/src/client/dice/terms/string.d.mts +23 -0
- package/src/client/dice/terms/term.d.mts +135 -0
- package/src/client/dice/twister.d.mts +87 -0
- package/src/client/documents/_module.d.mts +70 -0
- package/src/client/documents/_types.d.mts +736 -0
- package/src/client/documents/abstract/_module.d.mts +6 -0
- package/src/client/documents/abstract/canvas-document.d.mts +65 -0
- package/src/client/documents/abstract/client-document.d.mts +545 -0
- package/src/client/documents/abstract/directory-collection-mixin.d.mts +79 -0
- package/src/client/documents/abstract/document-collection.d.mts +124 -0
- package/src/client/documents/abstract/world-collection.d.mts +157 -0
- package/src/client/documents/active-effect.d.mts +203 -0
- package/src/client/documents/actor-delta.d.mts +76 -0
- package/src/client/documents/actor.d.mts +269 -0
- package/src/client/documents/adventure.d.mts +38 -0
- package/src/client/documents/ambient-light.d.mts +34 -0
- package/src/client/documents/ambient-sound.d.mts +16 -0
- package/src/client/documents/card.d.mts +102 -0
- package/src/client/documents/cards.d.mts +38 -0
- package/src/client/documents/chat-message.d.mts +190 -0
- package/src/client/documents/collections/_module.d.mts +19 -0
- package/src/client/documents/collections/actors.d.mts +28 -0
- package/src/client/documents/collections/card-stacks.d.mts +14 -0
- package/src/client/documents/collections/chat-messages.d.mts +29 -0
- package/src/client/documents/collections/combat-encounters.d.mts +32 -0
- package/src/client/documents/collections/compendium-collection.d.mts +170 -0
- package/src/client/documents/collections/compendium-folders.d.mts +30 -0
- package/src/client/documents/collections/compendium-packs.d.mts +23 -0
- package/src/client/documents/collections/fog-explorations.d.mts +19 -0
- package/src/client/documents/collections/folders.d.mts +20 -0
- package/src/client/documents/collections/items.d.mts +13 -0
- package/src/client/documents/collections/journal.d.mts +24 -0
- package/src/client/documents/collections/macros.d.mts +15 -0
- package/src/client/documents/collections/playlists.d.mts +28 -0
- package/src/client/documents/collections/roll-tables.d.mts +20 -0
- package/src/client/documents/collections/scenes.d.mts +60 -0
- package/src/client/documents/collections/users.d.mts +57 -0
- package/src/client/documents/collections/world-settings.d.mts +34 -0
- package/src/client/documents/combat.d.mts +371 -0
- package/src/client/documents/combatant-group.d.mts +42 -0
- package/src/client/documents/combatant.d.mts +125 -0
- package/src/client/documents/drawing.d.mts +27 -0
- package/src/client/documents/fog-exploration.d.mts +30 -0
- package/src/client/documents/folder.d.mts +124 -0
- package/src/client/documents/item.d.mts +73 -0
- package/src/client/documents/journal-entry-category.d.mts +15 -0
- package/src/client/documents/journal-entry-page.d.mts +77 -0
- package/src/client/documents/journal-entry.d.mts +78 -0
- package/src/client/documents/macro.d.mts +56 -0
- package/src/client/documents/measured-template.d.mts +41 -0
- package/src/client/documents/note.d.mts +28 -0
- package/src/client/documents/playlist-sound.d.mts +107 -0
- package/src/client/documents/playlist.d.mts +163 -0
- package/src/client/documents/region-behavior.d.mts +55 -0
- package/src/client/documents/region.d.mts +98 -0
- package/src/client/documents/roll-table.d.mts +172 -0
- package/src/client/documents/scene.d.mts +282 -0
- package/src/client/documents/setting.d.mts +35 -0
- package/src/client/documents/table-result.d.mts +35 -0
- package/src/client/documents/tile.d.mts +22 -0
- package/src/client/documents/token.d.mts +621 -0
- package/src/client/documents/user.d.mts +148 -0
- package/src/client/documents/wall.d.mts +20 -0
- package/src/client/game.d.mts +231 -0
- package/src/client/global.d.mts +28 -0
- package/src/client/helpers/_module.d.mts +13 -0
- package/src/client/helpers/_types.d.mts +26 -0
- package/src/client/helpers/client-issues.d.mts +90 -0
- package/src/client/helpers/client-settings.d.mts +191 -0
- package/src/client/helpers/document-index.d.mts +81 -0
- package/src/client/helpers/hooks.d.mts +210 -0
- package/src/client/helpers/interaction/_module.d.mts +6 -0
- package/src/client/helpers/interaction/client-keybindings.d.mts +143 -0
- package/src/client/helpers/interaction/clipboard-helper.d.mts +14 -0
- package/src/client/helpers/interaction/gamepad-manager.d.mts +15 -0
- package/src/client/helpers/interaction/keyboard-manager.d.mts +189 -0
- package/src/client/helpers/interaction/mouse-manager.d.mts +20 -0
- package/src/client/helpers/interaction/tooltip-manager.d.mts +227 -0
- package/src/client/helpers/localization.d.mts +143 -0
- package/src/client/helpers/media/_module.d.mts +3 -0
- package/src/client/helpers/media/compendium-art.d.mts +29 -0
- package/src/client/helpers/media/image-helper.d.mts +116 -0
- package/src/client/helpers/media/video-helper.d.mts +113 -0
- package/src/client/helpers/socket-interface.d.mts +14 -0
- package/src/client/helpers/time.d.mts +92 -0
- package/src/client/helpers/workers.d.mts +92 -0
- package/src/client/nue/_module.d.mts +13 -0
- package/src/client/nue/nue-manager.d.mts +13 -0
- package/src/client/nue/tour.d.mts +283 -0
- package/src/client/nue/tours/_module.d.mts +1 -0
- package/src/client/nue/tours-collection.d.mts +23 -0
- package/src/client/packages/_module.d.mts +19 -0
- package/src/client/packages/_types.d.mts +12 -0
- package/src/client/packages/client-package.mts +145 -0
- package/src/client/packages/module.d.mts +12 -0
- package/src/client/packages/system.d.mts +9 -0
- package/src/client/packages/world.d.mts +28 -0
- package/src/client/ui.d.mts +86 -0
- package/src/client/utils/_module.d.mts +4 -0
- package/src/client/utils/helpers.d.mts +148 -0
- package/src/common/_types.d.mts +151 -0
- package/src/common/abstract/_module.d.mts +8 -0
- package/src/common/abstract/_types.d.mts +187 -0
- package/src/common/abstract/backend.d.mts +159 -0
- package/src/common/abstract/data.d.mts +213 -0
- package/src/common/abstract/document.d.mts +700 -0
- package/src/common/abstract/embedded-collection.d.mts +141 -0
- package/src/common/abstract/socket.d.mts +35 -0
- package/src/common/abstract/type-data.d.mts +163 -0
- package/src/common/config.d.mts +147 -0
- package/src/common/constants.d.mts +2184 -0
- package/src/common/data/_module.d.mts +6 -0
- package/src/common/data/_types.d.mts +329 -0
- package/src/common/data/data.d.mts +390 -0
- package/src/common/data/fields.d.mts +1377 -0
- package/src/common/data/validation-failure.d.mts +127 -0
- package/src/common/data/validators.d.mts +35 -0
- package/src/common/documents/_module.d.mts +64 -0
- package/src/common/documents/_types.d.mts +1 -0
- package/src/common/documents/active-effect.d.mts +87 -0
- package/src/common/documents/actor-delta.d.mts +81 -0
- package/src/common/documents/actor.d.mts +105 -0
- package/src/common/documents/adventure.d.mts +105 -0
- package/src/common/documents/ambient-light.d.mts +49 -0
- package/src/common/documents/ambient-sound.d.mts +72 -0
- package/src/common/documents/card.d.mts +98 -0
- package/src/common/documents/cards.d.mts +89 -0
- package/src/common/documents/chat-message.d.mts +107 -0
- package/src/common/documents/combat.d.mts +55 -0
- package/src/common/documents/combatant-group.d.mts +45 -0
- package/src/common/documents/combatant.d.mts +48 -0
- package/src/common/documents/drawing.d.mts +101 -0
- package/src/common/documents/fog-exploration.d.mts +50 -0
- package/src/common/documents/folder.d.mts +65 -0
- package/src/common/documents/item.d.mts +86 -0
- package/src/common/documents/journal-entry-category.d.mts +32 -0
- package/src/common/documents/journal-entry-page.d.mts +76 -0
- package/src/common/documents/journal-entry.d.mts +50 -0
- package/src/common/documents/macro.d.mts +87 -0
- package/src/common/documents/measured-template.d.mts +72 -0
- package/src/common/documents/note.d.mts +82 -0
- package/src/common/documents/playlist-sound.d.mts +53 -0
- package/src/common/documents/playlist.d.mts +48 -0
- package/src/common/documents/region-behavior.d.mts +49 -0
- package/src/common/documents/region.d.mts +61 -0
- package/src/common/documents/roll-table.d.mts +70 -0
- package/src/common/documents/scene.d.mts +237 -0
- package/src/common/documents/setting.d.mts +49 -0
- package/src/common/documents/table-result.d.mts +61 -0
- package/src/common/documents/tile.d.mts +88 -0
- package/src/common/documents/token.d.mts +213 -0
- package/src/common/documents/user.d.mts +82 -0
- package/src/common/documents/wall.d.mts +72 -0
- package/src/common/grid/_module.d.mts +6 -0
- package/src/common/grid/_types.d.mts +250 -0
- package/src/common/grid/base.d.mts +266 -0
- package/src/common/grid/grid-hex.d.mts +53 -0
- package/src/common/grid/gridless.d.mts +85 -0
- package/src/common/grid/hexagonal.d.mts +191 -0
- package/src/common/grid/square.d.mts +90 -0
- package/src/common/packages/_module.d.mts +6 -0
- package/src/common/packages/_types.d.mts +7 -0
- package/src/common/packages/base-module.d.mts +32 -0
- package/src/common/packages/base-package.d.mts +297 -0
- package/src/common/packages/base-system.d.mts +42 -0
- package/src/common/packages/base-world.d.mts +51 -0
- package/src/common/packages/sub-types.d.mts +12 -0
- package/src/common/primitives/_module.d.mts +10 -0
- package/src/common/primitives/array.d.mts +58 -0
- package/src/common/primitives/date.d.mts +24 -0
- package/src/common/primitives/math.d.mts +70 -0
- package/src/common/primitives/number.d.mts +79 -0
- package/src/common/primitives/regexp.d.mts +12 -0
- package/src/common/primitives/set.d.mts +129 -0
- package/src/common/primitives/string.d.mts +24 -0
- package/src/common/primitives/url.d.mts +12 -0
- package/src/common/prosemirror/_module.d.mts +77 -0
- package/src/common/prosemirror/_types.d.mts +75 -0
- package/src/common/prosemirror/click-handler.d.mts +24 -0
- package/src/common/prosemirror/content-link-plugin.d.mts +34 -0
- package/src/common/prosemirror/dirty-plugin.d.mts +10 -0
- package/src/common/prosemirror/dom-parser.d.mts +7 -0
- package/src/common/prosemirror/dropdown.d.mts +50 -0
- package/src/common/prosemirror/highlight-matches-plugin.d.mts +38 -0
- package/src/common/prosemirror/image-plugin.d.mts +70 -0
- package/src/common/prosemirror/input-rules.d.mts +24 -0
- package/src/common/prosemirror/keymaps.d.mts +27 -0
- package/src/common/prosemirror/menu.d.mts +206 -0
- package/src/common/prosemirror/paste-transformer.d.mts +10 -0
- package/src/common/prosemirror/plugin.d.mts +21 -0
- package/src/common/prosemirror/schema/_types.d.mts +15 -0
- package/src/common/prosemirror/schema/attribute-capture.d.mts +13 -0
- package/src/common/prosemirror/schema/core.d.mts +58 -0
- package/src/common/prosemirror/schema/image-link-node.d.mts +27 -0
- package/src/common/prosemirror/schema/image-node.d.mts +17 -0
- package/src/common/prosemirror/schema/link-mark.d.mts +29 -0
- package/src/common/prosemirror/schema/lists.d.mts +71 -0
- package/src/common/prosemirror/schema/marks.d.mts +49 -0
- package/src/common/prosemirror/schema/other.d.mts +161 -0
- package/src/common/prosemirror/schema/schema-definition.d.mts +43 -0
- package/src/common/prosemirror/schema/secret-node.d.mts +25 -0
- package/src/common/prosemirror/schema/tables.d.mts +161 -0
- package/src/common/prosemirror/schema/utils.d.mts +37 -0
- package/src/common/prosemirror/schema.d.mts +7 -0
- package/src/common/prosemirror/string-serializer.d.mts +84 -0
- package/src/common/prosemirror/util.d.mts +32 -0
- package/src/common/utils/_module.d.mts +19 -0
- package/src/common/utils/_types.d.mts +83 -0
- package/src/common/utils/bitmask.d.mts +122 -0
- package/src/common/utils/collection.d.mts +148 -0
- package/src/common/utils/color.d.mts +308 -0
- package/src/common/utils/event-emitter.d.mts +36 -0
- package/src/common/utils/geometry.d.mts +94 -0
- package/src/common/utils/helpers.d.mts +396 -0
- package/src/common/utils/http.d.mts +40 -0
- package/src/common/utils/iterable-weak-map.d.mts +26 -0
- package/src/common/utils/iterable-weak-set.d.mts +1 -0
- package/src/common/utils/logging.d.mts +25 -0
- package/src/common/utils/semaphore.d.mts +59 -0
- package/src/common/utils/string-tree.d.mts +60 -0
- package/src/common/utils/word-tree.d.mts +34 -0
- package/src/global-external.d.mts +48 -0
- package/src/index.d.ts +87 -0
- package/src/public/scripts/clipper.d.mts +920 -0
- package/src/tinymce-stub.d.mts +123 -0
- package/src/util.d.mts +67 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Point } from "#common/_types.mjs";
|
|
2
|
+
import { LineIntersection } from "#common/utils/_types.mjs";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A ray for the purposes of computing sight and collision
|
|
6
|
+
* Given points A[x,y] and B[x,y]
|
|
7
|
+
*
|
|
8
|
+
* Slope-Intercept form:
|
|
9
|
+
* y = a + bx
|
|
10
|
+
* y = A.y + ((B.y - A.Y) / (B.x - A.x))x
|
|
11
|
+
*
|
|
12
|
+
* Parametric form:
|
|
13
|
+
* R(t) = (1-t)A + tB
|
|
14
|
+
*/
|
|
15
|
+
export default class Ray {
|
|
16
|
+
constructor(A: Point, B: Point);
|
|
17
|
+
|
|
18
|
+
/** The origin point, {x, y} */
|
|
19
|
+
A: Point;
|
|
20
|
+
|
|
21
|
+
/** The destination point, {x, y} */
|
|
22
|
+
B: Point;
|
|
23
|
+
|
|
24
|
+
/** The origin y-coordinate */
|
|
25
|
+
y0: number;
|
|
26
|
+
|
|
27
|
+
/** The origin x-coordinate */
|
|
28
|
+
x0: number;
|
|
29
|
+
|
|
30
|
+
/** The horizontal distance of the ray, x1 - x0 */
|
|
31
|
+
dx: number;
|
|
32
|
+
|
|
33
|
+
/** The vertical distance of the ray, y1 - y0 */
|
|
34
|
+
dy: number;
|
|
35
|
+
|
|
36
|
+
/** The slope of the ray, dy over dx */
|
|
37
|
+
slope: number;
|
|
38
|
+
|
|
39
|
+
/* -------------------------------------------- */
|
|
40
|
+
/* Attributes */
|
|
41
|
+
/* -------------------------------------------- */
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The normalized angle of the ray in radians on the range (-PI, PI).
|
|
45
|
+
* The angle is computed lazily (only if required) and cached.
|
|
46
|
+
*/
|
|
47
|
+
get angle(): number;
|
|
48
|
+
|
|
49
|
+
set angle(value: number);
|
|
50
|
+
|
|
51
|
+
/** A normalized bounding rectangle that encompasses the Ray */
|
|
52
|
+
get bounds(): PIXI.Rectangle;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The distance (length) of the Ray in pixels.
|
|
56
|
+
* The distance is computed lazily (only if required) and cached.
|
|
57
|
+
*/
|
|
58
|
+
get distance(): number;
|
|
59
|
+
|
|
60
|
+
set distance(value: number);
|
|
61
|
+
|
|
62
|
+
/* -------------------------------------------- */
|
|
63
|
+
/* Methods */
|
|
64
|
+
/* -------------------------------------------- */
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A factory method to construct a Ray from an origin point, an angle, and a distance
|
|
68
|
+
* @param x The origin x-coordinate
|
|
69
|
+
* @param y The origin y-coordinate
|
|
70
|
+
* @param radians The ray angle in radians
|
|
71
|
+
* @param distance The distance of the ray in pixels
|
|
72
|
+
* @returns The constructed Ray instance
|
|
73
|
+
*/
|
|
74
|
+
static fromAngle(x: number, y: number, radians: number, distance: number): Ray;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A factory method to construct a Ray from points in array format.
|
|
78
|
+
* @param A The origin point [x,y]
|
|
79
|
+
* @param B The destination point [x,y]
|
|
80
|
+
* @returns The constructed Ray instance
|
|
81
|
+
*/
|
|
82
|
+
static fromArrays(A: [number, number], B: [number, number]): Ray;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Project the Array by some proportion of it's initial distance.
|
|
86
|
+
* Return the coordinates of that point along the path.
|
|
87
|
+
* @param t The distance along the Ray
|
|
88
|
+
* @return The coordinates of the projected point
|
|
89
|
+
*/
|
|
90
|
+
project(t: number): Point;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Create a Ray by projecting a certain distance towards a known point.
|
|
94
|
+
* @param origin The origin of the Ray
|
|
95
|
+
* @param point The point towards which to project
|
|
96
|
+
* @param distance The distance of projection
|
|
97
|
+
*/
|
|
98
|
+
static towardsPoint(origin: Point, point: Point, distance: number): Ray;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Create a Ray by projecting a certain squared-distance towards a known point.
|
|
102
|
+
* @param origin The origin of the Ray
|
|
103
|
+
* @param point The point towards which to project
|
|
104
|
+
* @param distance2 The squared distance of projection
|
|
105
|
+
*/
|
|
106
|
+
static towardsPointSquared(origin: Point, point: Point, distance2: number): Ray;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Reverse the direction of the Ray, returning a second Ray
|
|
110
|
+
*/
|
|
111
|
+
reverse(): Ray;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Create a new ray which uses the same origin point, but a slightly offset angle and distance
|
|
115
|
+
* @param offset An offset in radians which modifies the angle of the original Ray
|
|
116
|
+
* @param distance A distance the new ray should project, otherwise uses the same distance.
|
|
117
|
+
* @return A new Ray with an offset angle
|
|
118
|
+
*/
|
|
119
|
+
shiftAngle(angleOffset: number, distance?: number): Ray;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Find the point I[x,y] and distance t* on ray R(t) which intersects another ray
|
|
123
|
+
* http://paulbourke.net/geometry/pointlineplane/
|
|
124
|
+
*/
|
|
125
|
+
intersectSegment(coords: [number]): LineIntersection | null;
|
|
126
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { PointSourcePolygonConfig } from "../_types.mjs";
|
|
2
|
+
import PolygonVertex from "../edges/vertex.mjs";
|
|
3
|
+
import { ElevatedPoint, Point } from "./../../../../common/_types.mjs";
|
|
4
|
+
import Ray from "./ray.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An extension of Polygon which is used to represent the line of sight for a point source.
|
|
8
|
+
*/
|
|
9
|
+
export default abstract class PointSourcePolygon<TConfig extends PointSourcePolygonConfig = PointSourcePolygonConfig> extends PIXI.Polygon {
|
|
10
|
+
/**
|
|
11
|
+
* Customize how wall direction of one-way walls is applied
|
|
12
|
+
*/
|
|
13
|
+
static WALL_DIRECTION_MODES: Readonly<{
|
|
14
|
+
NORMAL: 0;
|
|
15
|
+
REVERSED: 1;
|
|
16
|
+
BOTH: 2;
|
|
17
|
+
}>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The rectangular bounds of this polygon
|
|
21
|
+
*/
|
|
22
|
+
bounds: PIXI.Rectangle;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The origin point of the source polygon.
|
|
26
|
+
*/
|
|
27
|
+
origin: ElevatedPoint;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The configuration of this polygon.
|
|
31
|
+
*/
|
|
32
|
+
config: TConfig;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* An indicator for whether this polygon is constrained by some boundary shape?
|
|
36
|
+
*/
|
|
37
|
+
get isConstrained(): boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Benchmark the performance of polygon computation for this source
|
|
41
|
+
* @param iterations The number of test iterations to perform
|
|
42
|
+
* @param origin The origin point to benchmark
|
|
43
|
+
* @param config The polygon configuration to benchmark
|
|
44
|
+
*/
|
|
45
|
+
static benchmark(iterations: number, origin: Point, config: PointSourcePolygonConfig): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Compute the polygon given a point origin and radius
|
|
49
|
+
* @param origin The origin source point. The elevation defaults to
|
|
50
|
+
* the elevation of config.source if passed and otherwise 0.
|
|
51
|
+
* @param config Configuration options which customize the polygon computation
|
|
52
|
+
* @returns The computed polygon instance
|
|
53
|
+
*/
|
|
54
|
+
static create<C extends PointSourcePolygonConfig, T extends PointSourcePolygon<C>>(this: ConstructorOf<T>, origin: Point, config?: C): T;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Create a clone of this polygon.
|
|
58
|
+
* This overrides the default PIXI.Polygon#clone behavior.
|
|
59
|
+
* @returns A cloned instance
|
|
60
|
+
*/
|
|
61
|
+
override clone(): this;
|
|
62
|
+
|
|
63
|
+
/* -------------------------------------------- */
|
|
64
|
+
/* Polygon Computation */
|
|
65
|
+
/* -------------------------------------------- */
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Compute the polygon using the origin and configuration options.
|
|
69
|
+
* @returns The computed polygon
|
|
70
|
+
*/
|
|
71
|
+
compute(): this;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Perform the implementation-specific computation
|
|
75
|
+
*/
|
|
76
|
+
protected abstract _compute(): void;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Customize the provided configuration object for this polygon type.
|
|
80
|
+
* @param origin The provided polygon origin
|
|
81
|
+
* @param config The provided configuration object
|
|
82
|
+
*/
|
|
83
|
+
initialize(origin: Point, config: TConfig): void;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Apply a constraining boundary shape to an existing PointSourcePolygon.
|
|
87
|
+
* Return a new instance of the polygon with the constraint applied.
|
|
88
|
+
* The new instance is only a "shallow clone", as it shares references to component properties with the original.
|
|
89
|
+
* @param constraint The constraining boundary shape
|
|
90
|
+
* @param [intersectionOptions] Options passed to the shape intersection method
|
|
91
|
+
* @returns A new constrained polygon
|
|
92
|
+
*/
|
|
93
|
+
applyConstraint(constraint?: PIXI.Circle | PIXI.Rectangle | PIXI.Polygon, intersectionOptions?: object): this;
|
|
94
|
+
|
|
95
|
+
override contains(x: number, y: number): boolean;
|
|
96
|
+
|
|
97
|
+
/* -------------------------------------------- */
|
|
98
|
+
/* Polygon Boundary Constraints */
|
|
99
|
+
/* -------------------------------------------- */
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Constrain polygon points by applying boundary shapes.
|
|
103
|
+
*/
|
|
104
|
+
protected _constrainBoundaryShapes(): void;
|
|
105
|
+
|
|
106
|
+
/* -------------------------------------------- */
|
|
107
|
+
/* Collision Testing */
|
|
108
|
+
/* -------------------------------------------- */
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Test whether a Ray between the origin and destination points would collide with a boundary of this Polygon
|
|
112
|
+
* @param origin An origin point
|
|
113
|
+
* @param destination A destination point
|
|
114
|
+
* @param config The configuration that defines a certain Polygon type
|
|
115
|
+
* @param [config.mode] The collision mode to test: "any", "all", or "closest"
|
|
116
|
+
* @returns The collision result depends on the mode of the test:
|
|
117
|
+
* * any: returns a boolean for whether any collision occurred
|
|
118
|
+
* * all: returns a sorted array of PolygonVertex instances
|
|
119
|
+
* * closest: returns a PolygonVertex instance or null
|
|
120
|
+
*/
|
|
121
|
+
static testCollision(origin: Point, destination: Point, config?: PointSourcePolygonConfig & { mode: "closest" }): PolygonVertex | null;
|
|
122
|
+
static testCollision(origin: Point, destination: Point, config?: PointSourcePolygonConfig & { mode: "any" }): boolean;
|
|
123
|
+
static testCollision(origin: Point, destination: Point, config?: PointSourcePolygonConfig & { mode: "all" }): PolygonVertex[];
|
|
124
|
+
static testCollision(
|
|
125
|
+
origin: Point,
|
|
126
|
+
destination: Point,
|
|
127
|
+
config?: PointSourcePolygonConfig & { mode?: "any" | "all" | "closest" },
|
|
128
|
+
): boolean | PolygonVertex | PolygonVertex[] | null;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Determine the set of collisions which occurs for a Ray.
|
|
132
|
+
* @param ray The Ray to test
|
|
133
|
+
* @param mode The collision mode being tested
|
|
134
|
+
* @returns The collision test result
|
|
135
|
+
*/
|
|
136
|
+
protected abstract _testCollision(ray: Ray, mode: string): boolean | PolygonVertex | PolygonVertex[] | null;
|
|
137
|
+
|
|
138
|
+
/* -------------------------------------------- */
|
|
139
|
+
/* Visualization and Debugging */
|
|
140
|
+
/* -------------------------------------------- */
|
|
141
|
+
|
|
142
|
+
/** Visualize the polygon, displaying its computed area, rays, and collision points */
|
|
143
|
+
visualize(): void;
|
|
144
|
+
|
|
145
|
+
/* -------------------------------------------- */
|
|
146
|
+
/* Threshold Polygons */
|
|
147
|
+
/* -------------------------------------------- */
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Augment a PointSourcePolygon by adding additional coverage for shapes permitted by threshold walls.
|
|
151
|
+
* @param {PointSourcePolygon} polygon The computed polygon
|
|
152
|
+
* @returns {PointSourcePolygon} The augmented polygon
|
|
153
|
+
*/
|
|
154
|
+
static applyThresholdAttenuation<TPolygon extends PointSourcePolygon>(polygon: TPolygon): TPolygon;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Determine if the shape is a complete circle.
|
|
158
|
+
* The config object must have an angle and a radius properties.
|
|
159
|
+
*/
|
|
160
|
+
isCompleteCircle(): boolean;
|
|
161
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom Transform class which is not bound to the parent worldTransform.
|
|
3
|
+
* localTransform are working as usual.
|
|
4
|
+
*/
|
|
5
|
+
export default class UnboundTransform extends PIXI.Transform {
|
|
6
|
+
static override IDENTITY: UnboundTransform;
|
|
7
|
+
|
|
8
|
+
override updateTransform(parentTransform: PIXI.Transform): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An implementation of the Weiler Atherton algorithm for clipping polygons.
|
|
3
|
+
* This currently only handles combinations that will not result in any holes.
|
|
4
|
+
* Support may be added for holes in the future.
|
|
5
|
+
*
|
|
6
|
+
* This algorithm is faster than the Clipper library for this task because it relies on the unique properties of the
|
|
7
|
+
* circle, ellipse, or convex simple clip object.
|
|
8
|
+
* It is also more precise in that it uses the actual intersection points between the circle/ellipse and polygon,
|
|
9
|
+
* instead of relying on the polygon approximation of the circle/ellipse to find the intersection points.
|
|
10
|
+
*
|
|
11
|
+
* For more explanation of the underlying algorithm, see:
|
|
12
|
+
* https://en.wikipedia.org/wiki/Weiler%E2%80%93Atherton_clipping_algorithm
|
|
13
|
+
* https://www.geeksforgeeks.org/weiler-atherton-polygon-clipping-algorithm
|
|
14
|
+
* https://h-educate.in/weiler-atherton-polygon-clipping-algorithm/
|
|
15
|
+
*/
|
|
16
|
+
export default class WeilerAthertonClipper {
|
|
17
|
+
/**
|
|
18
|
+
* Construct a WeilerAthertonClipper instance used to perform the calculation.
|
|
19
|
+
* @param polygon Polygon to clip
|
|
20
|
+
* @param clipObject Object used to clip the polygon
|
|
21
|
+
* @param clipType Type of clip to use
|
|
22
|
+
* @param clipOpts Object passed to the clippingObject methods toPolygon and pointsBetween
|
|
23
|
+
*/
|
|
24
|
+
constructor(polygon: PIXI.Polygon, clipObject: PIXI.Rectangle | PIXI.Circle, clipType: number, clipOpts: object);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The supported clip types.
|
|
28
|
+
* Values are equivalent to those in ClipperLib.ClipType.
|
|
29
|
+
*/
|
|
30
|
+
static CLIP_TYPES: Readonly<{ INTERSECT: 0; UNION: 1 }>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The supported intersection types.
|
|
34
|
+
*/
|
|
35
|
+
static INTERSECTION_TYPES: Readonly<{ OUT_IN: -1; IN_OUT: 1; TANGENT: 0 }>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Test if one shape envelops the other. Assumes the shapes do not intersect.
|
|
39
|
+
* 1. Polygon is contained within the clip object. Union: clip object; Intersect: polygon
|
|
40
|
+
* 2. Clip object is contained with polygon. Union: polygon; Intersect: clip object
|
|
41
|
+
* 3. Polygon and clip object are outside one another. Union: both; Intersect: null
|
|
42
|
+
* @param polygon Polygon to clip
|
|
43
|
+
* @param clipObject Object to clip against the polygon
|
|
44
|
+
* @param clipType One of CLIP_TYPES
|
|
45
|
+
* @param clipOpts Clip options which are forwarded to toPolygon methods
|
|
46
|
+
* @returns Returns the polygon, the clipObject.toPolygon(), both, or neither.
|
|
47
|
+
*/
|
|
48
|
+
static testForEnvelopment(
|
|
49
|
+
polygon: PIXI.Polygon,
|
|
50
|
+
clipObject: PIXI.Rectangle | PIXI.Circle,
|
|
51
|
+
clipType: Readonly<{
|
|
52
|
+
INTERSECT: 0;
|
|
53
|
+
UNION: 1;
|
|
54
|
+
}>,
|
|
55
|
+
clipOpts: object,
|
|
56
|
+
): PIXI.Polygon[];
|
|
57
|
+
|
|
58
|
+
polygon: PIXI.Polygon;
|
|
59
|
+
|
|
60
|
+
clipObject: PIXI.Rectangle | PIXI.Circle;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Configuration settings
|
|
64
|
+
*/
|
|
65
|
+
config?: {
|
|
66
|
+
/** One of CLIP_TYPES */
|
|
67
|
+
clipType?: WAClipperType;
|
|
68
|
+
/** Object passed to the clippingObject methods toPolygon and pointsBetween */
|
|
69
|
+
clipOpts?: object;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Union a polygon and clipObject using the Weiler Atherton algorithm.
|
|
74
|
+
* @param polygon Polygon to clip
|
|
75
|
+
* @param clipObject Object to clip against the polygon
|
|
76
|
+
* @param clipOpts Options passed to the clipping object methods toPolygon and pointsBetween
|
|
77
|
+
*/
|
|
78
|
+
static union(polygon: PIXI.Polygon, clipObject: PIXI.Rectangle | PIXI.Circle, clipOpts?: object): PIXI.Polygon[];
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Intersect a polygon and clipObject using the Weiler Atherton algorithm.
|
|
82
|
+
* @param polygon Polygon to clip
|
|
83
|
+
* @param clipObject Object to clip against the polygon
|
|
84
|
+
* @param clipOpts Options passed to the clipping object methods toPolygon and pointsBetween
|
|
85
|
+
*/
|
|
86
|
+
static intersect(polygon: PIXI.Polygon, clipObject: PIXI.Rectangle | PIXI.Circle, clipOpts?: object): PIXI.Polygon[];
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Clip a given clipObject using the Weiler-Atherton algorithm.
|
|
90
|
+
*
|
|
91
|
+
* At the moment, this will return a single PIXI.Polygon in the array unless clipType is a union and the polygon
|
|
92
|
+
* and clipObject do not overlap, in which case the [polygon, clipObject.toPolygon()] array will be returned.
|
|
93
|
+
* If this algorithm is expanded in the future to handle holes, an array of polygons may be returned.
|
|
94
|
+
*
|
|
95
|
+
* @param polygon Polygon to clip
|
|
96
|
+
* @param clipObject Object to clip against the polygon
|
|
97
|
+
* @param options Options which configure how the union or intersection is computed
|
|
98
|
+
* @param options.clipType One of {@link foundry.canvas.geometry.WeilerAthertonClipper.CLIP_TYPES}
|
|
99
|
+
* @param options.canMutate If the WeilerAtherton constructor could mutate or not the subject polygon points
|
|
100
|
+
*
|
|
101
|
+
* - Any additional properties in `options` (besides clipType and canMutate)
|
|
102
|
+
* are captured by the rest operator (`...clipOpts`) and passed to the WeilerAthertonClipper constructor.
|
|
103
|
+
*
|
|
104
|
+
* @returns Array of polygons and clipObjects
|
|
105
|
+
*/
|
|
106
|
+
static combine(
|
|
107
|
+
polygon: PIXI.Polygon,
|
|
108
|
+
clipObject: PIXI.Rectangle | PIXI.Circle,
|
|
109
|
+
{
|
|
110
|
+
clipType,
|
|
111
|
+
canMutate,
|
|
112
|
+
...clipOpts
|
|
113
|
+
}?: {
|
|
114
|
+
clipType: number;
|
|
115
|
+
canMutate?: boolean;
|
|
116
|
+
},
|
|
117
|
+
): PIXI.Polygon[];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
type WAClipperType = (typeof WeilerAthertonClipper)[keyof typeof WeilerAthertonClipper];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as CanvasGroupMixin } from "./canvas-group-mixin.mjs";
|
|
2
|
+
export { default as EffectsCanvasGroup } from "./effects.mjs";
|
|
3
|
+
export * from "./environment.mjs";
|
|
4
|
+
export { default as EnvironmentCanvasGroup } from "./environment.mjs";
|
|
5
|
+
export { default as HiddenCanvasGroup } from "./hidden.mjs";
|
|
6
|
+
export { default as InterfaceCanvasGroup } from "./interface.mjs";
|
|
7
|
+
export { default as OverlayCanvasGroup } from "./overlay.mjs";
|
|
8
|
+
export { default as PrimaryCanvasGroup } from "./primary.mjs";
|
|
9
|
+
export { default as RenderedCanvasGroup } from "./rendered.mjs";
|
|
10
|
+
export { default as CanvasVisibility } from "./visibility.mjs";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
2
|
+
import CanvasLayer from "../layers/base/canvas-layer.mjs";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A mixin which decorates any container with base canvas common properties.
|
|
6
|
+
* @param {typeof PIXI.Container} ContainerClass The parent Container class being mixed.
|
|
7
|
+
* @returns A ContainerClass subclass mixed with CanvasGroupMixin features.
|
|
8
|
+
*/
|
|
9
|
+
export default function CanvasGroupMixin<TBase extends ConstructorOf<PIXI.Container>>(ContainerClass: TBase) {
|
|
10
|
+
class CanvasGroup extends ContainerClass {
|
|
11
|
+
constructor(...args: any[]) {
|
|
12
|
+
super(...args);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The name of this canvas group.
|
|
17
|
+
*/
|
|
18
|
+
static groupName: string | undefined;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* If this canvas group should teardown non-layers children.
|
|
22
|
+
*/
|
|
23
|
+
static tearDownChildren: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The canonical name of the canvas group is the name of the constructor that is the immediate child of the
|
|
27
|
+
* defined base class.
|
|
28
|
+
*/
|
|
29
|
+
override get name(): string {
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The name used by hooks to construct their hook string.
|
|
35
|
+
* Note: You should override this getter if hookName should not return the class constructor name.
|
|
36
|
+
*/
|
|
37
|
+
get hookName(): string {
|
|
38
|
+
return "";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A mapping of CanvasLayer classes which belong to this group.
|
|
43
|
+
*/
|
|
44
|
+
declare layers: Record<string, CanvasLayer>;
|
|
45
|
+
|
|
46
|
+
/* -------------------------------------------- */
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Create CanvasLayer instances which belong to the canvas group.
|
|
50
|
+
*/
|
|
51
|
+
protected _createLayers(): Record<string, CanvasLayer> {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* -------------------------------------------- */
|
|
56
|
+
/* Rendering */
|
|
57
|
+
/* -------------------------------------------- */
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Draw the canvas group and all its components.
|
|
61
|
+
* @returns A Promise which resolves once the group is fully drawn
|
|
62
|
+
*/
|
|
63
|
+
async draw(options?: object): Promise<this> {
|
|
64
|
+
options;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Draw the canvas group and all its component layers.
|
|
70
|
+
*/
|
|
71
|
+
protected async _draw(options?: object): Promise<void> {
|
|
72
|
+
options;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* -------------------------------------------- */
|
|
76
|
+
/* Tear-Down */
|
|
77
|
+
/* -------------------------------------------- */
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Remove and destroy all layers from the base canvas.
|
|
81
|
+
*/
|
|
82
|
+
async tearDown(options?: object): Promise<this> {
|
|
83
|
+
options;
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Remove and destroy all layers from the base canvas.
|
|
89
|
+
*/
|
|
90
|
+
protected async _tearDown(options: object): Promise<void> {
|
|
91
|
+
options;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return CanvasGroup;
|
|
95
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import CanvasLayer from "../layers/base/canvas-layer.mjs";
|
|
2
|
+
import { AmbientLight, Token } from "../placeables/_module.mjs";
|
|
3
|
+
import type { GlobalLightSource, PointLightSource, PointVisionSource } from "../sources/_module.mjs";
|
|
4
|
+
import { Point } from "./../../../common/_types.mjs";
|
|
5
|
+
import Collection from "./../../../common/utils/collection.mjs";
|
|
6
|
+
import CanvasGroupMixin from "./canvas-group-mixin.mjs";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A container group which contains visual effects rendered above the primary group.
|
|
10
|
+
*
|
|
11
|
+
* ### Hook Events
|
|
12
|
+
* - {@link hookEvents.drawEffectsCanvasGroup}
|
|
13
|
+
* - {@link hookEvents.createEffectsCanvasGroup}
|
|
14
|
+
* - {@link hookEvents.lightingRefresh}
|
|
15
|
+
*/
|
|
16
|
+
export default class EffectsCanvasGroup extends CanvasGroupMixin(PIXI.Container) {
|
|
17
|
+
constructor();
|
|
18
|
+
|
|
19
|
+
/** The current global light source */
|
|
20
|
+
globalLightSource: GlobalLightSource;
|
|
21
|
+
|
|
22
|
+
/** Whether to currently animate light sources. */
|
|
23
|
+
animateLightSources: boolean;
|
|
24
|
+
|
|
25
|
+
/** Whether to currently animate vision sources. */
|
|
26
|
+
animateVisionSources: boolean;
|
|
27
|
+
|
|
28
|
+
/** A mapping of light sources which are active within the rendered Scene. */
|
|
29
|
+
lightSources: Collection<string, PointLightSource<AmbientLight | Token>>;
|
|
30
|
+
|
|
31
|
+
/** A Collection of vision sources which are currently active within the rendered Scene. */
|
|
32
|
+
visionSources: Collection<string, PointVisionSource<Token>>;
|
|
33
|
+
|
|
34
|
+
/** A set of vision mask filters used in visual effects group */
|
|
35
|
+
visualEffectsMaskingFilters: Set<PIXI.Filter>;
|
|
36
|
+
|
|
37
|
+
/** A layer of background alteration effects which change the appearance of the primary group render texture. */
|
|
38
|
+
background: CanvasLayer;
|
|
39
|
+
|
|
40
|
+
/** A layer which adds illumination-based effects to the scene. */
|
|
41
|
+
illumination: CanvasLayer;
|
|
42
|
+
|
|
43
|
+
/** A layer which adds color-based effects to the scene. */
|
|
44
|
+
coloration: CanvasLayer;
|
|
45
|
+
|
|
46
|
+
/** A layer which adds darkness effects to the scene */
|
|
47
|
+
darkness: CanvasLayer;
|
|
48
|
+
|
|
49
|
+
/** Clear all effects containers and animated sources. */
|
|
50
|
+
clearEffects(): void;
|
|
51
|
+
|
|
52
|
+
/** Initialize LightSource objects for all AmbientLightDocument instances that exist within the active Scene. */
|
|
53
|
+
initializeLightSources(): void;
|
|
54
|
+
|
|
55
|
+
/** Update the global light source which provide global illumination to the Scene. */
|
|
56
|
+
protected _updateGlobalLightSource(): GlobalLightSource;
|
|
57
|
+
|
|
58
|
+
/** Refresh the state and uniforms of all LightSource objects. */
|
|
59
|
+
refreshLightSources(): void;
|
|
60
|
+
|
|
61
|
+
/** Refresh the state and uniforms of all LightSource objects. */
|
|
62
|
+
refreshVisionSources(): void;
|
|
63
|
+
|
|
64
|
+
/** Refresh the active display of lighting. */
|
|
65
|
+
refreshLighting(): void;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Test whether the point is inside light.
|
|
69
|
+
* @param position The point.
|
|
70
|
+
* @param elevation The elevation of the point.
|
|
71
|
+
* @returns Is inside light?
|
|
72
|
+
*/
|
|
73
|
+
testInsideLight(position: Point, elevation: number): boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Test whether the point is inside darkness.
|
|
77
|
+
* @param position The point.
|
|
78
|
+
* @param elevation The elevation of the point.
|
|
79
|
+
* @returns Is inside a darkness?
|
|
80
|
+
*/
|
|
81
|
+
testInsideDarkness(position: Point, elevation: number): boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Activate vision masking for visual effects
|
|
85
|
+
* @param [enabled=true] Whether to enable or disable vision masking
|
|
86
|
+
*/
|
|
87
|
+
toggleMaskingFilters(enabled?: boolean): void;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Activate post-processing effects for a certain effects channel.
|
|
91
|
+
* @param filterMode The filter mode to target.
|
|
92
|
+
* @param [postProcessingModes=[]] The post-processing modes to apply to this filter.
|
|
93
|
+
* @param [uniforms={}] The uniforms to update.
|
|
94
|
+
*/
|
|
95
|
+
activatePostProcessingFilters(filterMode: string, postProcessingModes?: string[], uniforms?: object): void;
|
|
96
|
+
|
|
97
|
+
/** Reset post-processing modes on all Visual Effects masking filters. */
|
|
98
|
+
resetPostProcessingFilters(): void;
|
|
99
|
+
|
|
100
|
+
/* -------------------------------------------- */
|
|
101
|
+
/* Animation Management */
|
|
102
|
+
/* -------------------------------------------- */
|
|
103
|
+
|
|
104
|
+
/** Activate light source animation for AmbientLight objects within this layer */
|
|
105
|
+
activateAnimation(): void;
|
|
106
|
+
|
|
107
|
+
/** Deactivate light source animation for AmbientLight objects within this layer */
|
|
108
|
+
deactivateAnimation(): void;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Animate a smooth transition of the darkness overlay to a target value.
|
|
112
|
+
* Only begin animating if another animation is not already in progress.
|
|
113
|
+
* @param target The target darkness level between 0 and 1
|
|
114
|
+
* @param duration The desired animation time in milliseconds. Default is 10 seconds
|
|
115
|
+
* @returns A Promise which resolves once the animation is complete
|
|
116
|
+
*/
|
|
117
|
+
animateDarkness(target?: number, { duration }?: { duration?: number }): Promise<void>;
|
|
118
|
+
}
|