@league-of-foundry-developers/foundry-vtt-types 9.238.0 → 9.249.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/README.md +3 -3
- package/package.json +1 -1
- package/src/foundry/common/constants.mjs.d.ts +1 -0
- package/src/foundry/common/data/data.mjs/adventureData.d.ts +21 -21
- package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -3
- package/src/foundry/common/data/data.mjs/userData.d.ts +10 -3
- package/src/foundry/common/documents.mjs/baseCombatant.d.ts +2 -4
- package/src/foundry/common/utils/geometry.mjs.d.ts +148 -0
- package/src/foundry/common/utils/helpers.mjs.d.ts +37 -37
- package/src/foundry/common/utils/module.mjs.d.ts +1 -0
- package/src/foundry/common/utils/primitives.mjs.d.ts +7 -0
- package/src/foundry/foundry.js/application.d.ts +138 -110
- package/src/foundry/foundry.js/applications/basePlaceableHUD.d.ts +2 -2
- package/src/foundry/foundry.js/applications/basePlaceableHUDs/drawingHUD.d.ts +2 -2
- package/src/foundry/foundry.js/applications/basePlaceableHUDs/tileHUD.d.ts +2 -2
- package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +3 -3
- package/src/foundry/foundry.js/applications/cameraViews.d.ts +2 -2
- package/src/foundry/foundry.js/applications/chatPopout.d.ts +3 -3
- package/src/foundry/foundry.js/applications/compendium.d.ts +2 -2
- package/src/foundry/foundry.js/applications/dialog.d.ts +1 -1
- package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplication.d.ts +45 -14
- package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +20 -31
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +7 -7
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/frameViewer.d.ts +1 -1
- package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +2 -2
- package/src/foundry/foundry.js/applications/hotbar.d.ts +2 -2
- package/src/foundry/foundry.js/applications/mainMenu.d.ts +2 -2
- package/src/foundry/foundry.js/applications/notifications.d.ts +7 -4
- package/src/foundry/foundry.js/applications/pause.d.ts +2 -2
- package/src/foundry/foundry.js/applications/playerList.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sceneControls.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +3 -3
- package/src/foundry/foundry.js/applications/sidebar.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTab.d.ts +4 -7
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +3 -3
- package/src/foundry/foundry.js/applications/sidebarTabs/combatTracker.d.ts +26 -28
- package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +1 -1
- package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
- package/src/foundry/foundry.js/canvas.d.ts +5 -0
- package/src/foundry/foundry.js/canvasAnimation.d.ts +30 -7
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -1
- package/src/foundry/foundry.js/clientDocuments/card.d.ts +2 -1
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -18
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +2 -2
- package/src/foundry/foundry.js/clientDocuments/combat.d.ts +46 -44
- package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +14 -17
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +15 -9
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +2 -2
- package/src/foundry/foundry.js/clientKeybindings.d.ts +12 -2
- package/src/foundry/foundry.js/clientSettings.d.ts +2 -2
- package/src/foundry/foundry.js/collections/documentCollection.d.ts +1 -1
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/folders.d.ts +1 -1
- package/src/foundry/foundry.js/collisionResult.d.ts +60 -0
- package/src/foundry/foundry.js/config.d.ts +38 -36
- package/src/foundry/foundry.js/dragDrop.d.ts +27 -34
- package/src/foundry/foundry.js/game.d.ts +89 -43
- package/src/foundry/foundry.js/hooks.d.ts +154 -85
- package/src/foundry/foundry.js/imageHelper.d.ts +26 -2
- package/src/foundry/foundry.js/keyboardManager.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/index.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/meshes/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/meshes/samplerMesh.d.ts +22 -0
- package/src/foundry/foundry.js/pixi/points/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +92 -0
- package/src/foundry/foundry.js/pixi/polygons/index.d.ts +2 -1
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +98 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +396 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/rectangles/normalizedRectangle.d.ts +7 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +11 -37
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShader.d.ts +114 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveBackgroundShader.d.ts +57 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShader.d.ts +47 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/bewitchingWaveColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/chromaColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/emanationColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/energyFieldColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fairyLightColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fogColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/ghostLightColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/hexaDomeColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/index.d.ts +5 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/lightDomeColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/pulseColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/radialRainbowColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/sunburstColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/swirlingRainbowColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/torchColorationShader.d.ts +3 -2
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/vortexColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/waveColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShader.d.ts +63 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/bewitchingWaveIlluminationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/blackHoleIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/fairyLightIlluminationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/ghostLightIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/index.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/pulseIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/roilingIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/sunburstIlluminationShader.d.ts +1 -2
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/torchIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/vortexIlluminationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/waveIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/index.d.ts +5 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/baseSamplerShader.d.ts +22 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/index.d.ts +3 -4
- package/src/foundry/foundry.js/pixi/texts/preciseText.d.ts +10 -2
- package/src/foundry/foundry.js/pixi/transforms/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/transforms/synchronizedTransform.d.ts +38 -0
- package/src/foundry/foundry.js/pointSource.d.ts +59 -328
- package/src/foundry/foundry.js/pointSources/index.d.ts +3 -0
- package/src/foundry/foundry.js/pointSources/lightSource.d.ts +417 -0
- package/src/foundry/foundry.js/pointSources/soundSource.d.ts +46 -0
- package/src/foundry/foundry.js/pointSources/visionSource.d.ts +125 -0
- package/src/foundry/foundry.js/polygonEdge.d.ts +26 -0
- package/src/foundry/foundry.js/polygonVertex.d.ts +89 -0
- package/src/foundry/foundry.js/quadtree.d.ts +2 -2
- package/src/foundry/foundry.js/quadtreeCulling.d.ts +11 -0
- package/src/foundry/foundry.js/ray.d.ts +156 -162
- package/src/foundry/foundry.js/rays/index.d.ts +1 -0
- package/src/foundry/foundry.js/rays/sightRay.d.ts +34 -0
- package/src/foundry/foundry.js/roll.d.ts +40 -43
- package/src/foundry/foundry.js/screenCulling.d.ts +19 -0
- package/src/foundry/foundry.js/searchFilter.d.ts +37 -33
- package/src/foundry/foundry.js/specialEffect.d.ts +1 -1
- package/src/foundry/foundry.js/textureLoader.d.ts +28 -18
- package/src/foundry/foundry.js/textureUtils.d.ts +5 -8
- package/src/foundry/foundry.js/videoHelper.d.ts +2 -1
- package/src/foundry/index.d.ts +26 -27
- package/src/foundry/foundry.js/pixi/polygons/sourcePolygon.d.ts +0 -25
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts +0 -21
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/chromaColorationShader.d.ts +0 -18
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/emanationColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/energyFieldColorationShader.d.ts +0 -18
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/fogColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/hexaDomeColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/lightDomeColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardIlluminationShader.d.ts +0 -22
@@ -0,0 +1,92 @@
|
|
1
|
+
import type { ConfiguredObjectClassForName } from '../../../../types/helperTypes.js';
|
2
|
+
|
3
|
+
declare global {
|
4
|
+
/**
|
5
|
+
* A special subclass of PIXI.Point which is used for modeling Wall endpoints.
|
6
|
+
* A wall endpoint must have integer coordinates.
|
7
|
+
*
|
8
|
+
* This was used for the RadialSweepPolygon but can now be deleted once that is
|
9
|
+
* @deprecated since v9d2
|
10
|
+
*/
|
11
|
+
class WallEndpoint extends PIXI.Point {
|
12
|
+
/**
|
13
|
+
* @param x - The integer x-coordinate
|
14
|
+
* @param y - The integer y-coordinate
|
15
|
+
*/
|
16
|
+
constructor(x: number, y: number);
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Express the point as a 32-bit integer with 16 bits allocated to x and 16 bits allocated to y
|
20
|
+
*/
|
21
|
+
key: number;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* The angle between this point and the polygon origin
|
25
|
+
* @defaultValue `undefined`
|
26
|
+
*/
|
27
|
+
angle: number | undefined;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Record the set of walls which connect to this Endpoint
|
31
|
+
*/
|
32
|
+
walls: Set<ConfiguredObjectClassForName<'Wall'>>;
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Record whether this point is the endpoint of any Wall
|
36
|
+
* @defaultValue `false`
|
37
|
+
*/
|
38
|
+
isEndpoint: boolean;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Record whether this point is a midpoint of any wall?
|
42
|
+
* @defaultValue `false`
|
43
|
+
*/
|
44
|
+
isMidpoint: boolean;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Record whether this point is the termination of the Ray
|
48
|
+
* @defaultValue `false`
|
49
|
+
*/
|
50
|
+
isTerminal: boolean;
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Aggregate the maximum of each wall restriction type
|
54
|
+
*/
|
55
|
+
types: Record<foundry.CONST.WALL_RESTRICTION_TYPES, number>;
|
56
|
+
|
57
|
+
/**
|
58
|
+
* An intermediate variable used to store the proportional distance of this point from a SightRay origin
|
59
|
+
* @defaultValue `undefined`
|
60
|
+
*/
|
61
|
+
protected _r: number | undefined;
|
62
|
+
|
63
|
+
/**
|
64
|
+
* An intermediate variable used to cache the continuation attributes for a certain point
|
65
|
+
* @defaultValue `undefined`
|
66
|
+
*/
|
67
|
+
protected _c: { left: boolean; right: boolean } | undefined;
|
68
|
+
|
69
|
+
attachWall(wall: ConfiguredObjectClassForName<'Wall'>): this;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Does this endpoint equal some other endpoint?
|
73
|
+
* @param other - Some other point with x and y coordinates
|
74
|
+
* @returns Are the points equal?
|
75
|
+
*/
|
76
|
+
equals(other: Point): boolean;
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Is this point one that provides only limited perspective?
|
80
|
+
* @param type - The perspective type being tested
|
81
|
+
* @returns Is perspective limited?
|
82
|
+
*/
|
83
|
+
isLimited(type: foundry.CONST.WALL_RESTRICTION_TYPES): boolean;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Encode a x/y coordinate as a 32-bit integer
|
87
|
+
* @param x - The x-coordinate
|
88
|
+
* @param y - The y-coordinate
|
89
|
+
*/
|
90
|
+
static getKey(x: number, y: number): number;
|
91
|
+
}
|
92
|
+
}
|
@@ -1 +1,2 @@
|
|
1
|
-
import './
|
1
|
+
import './pointSourcePolygon';
|
2
|
+
import './pointSourcePolygons';
|
@@ -0,0 +1,98 @@
|
|
1
|
+
interface PointSourcePolygonConfig {
|
2
|
+
/** The type of polygon being computed */
|
3
|
+
type?: foundry.CONST.WALL_RESTRICTION_TYPES;
|
4
|
+
|
5
|
+
/** The angle of emission, if limited */
|
6
|
+
angle?: number;
|
7
|
+
|
8
|
+
/** The desired density of padding rays, a number per PI */
|
9
|
+
density?: number;
|
10
|
+
|
11
|
+
/** A limited radius of the resulting polygon */
|
12
|
+
radius?: number;
|
13
|
+
|
14
|
+
/** The direction of facing, required if the angle is limited */
|
15
|
+
rotation?: number;
|
16
|
+
|
17
|
+
/** Display debugging visualization and logging for the polygon */
|
18
|
+
debug?: boolean;
|
19
|
+
|
20
|
+
/** Is this polygon constrained by any walls? */
|
21
|
+
walls?: boolean;
|
22
|
+
|
23
|
+
/** The object (if any) that spawned this polygon. */
|
24
|
+
source?: PointSource;
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* An extension of the default PIXI.Polygon which is used to represent the line of sight for a point source.
|
29
|
+
*/
|
30
|
+
declare abstract class PointSourcePolygon extends PIXI.Polygon {
|
31
|
+
/**
|
32
|
+
* The origin point of the source polygon.
|
33
|
+
*/
|
34
|
+
origin: Point;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The configuration of this polygon.
|
38
|
+
* @defaultValue `{}`
|
39
|
+
*/
|
40
|
+
config: PointSourcePolygonConfig;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* A cached array of SightRay objects used to compute the polygon.
|
44
|
+
* @defaultValue `[]`
|
45
|
+
*/
|
46
|
+
rays: SightRay[];
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Compute the rectangular bounds for the Polygon.
|
50
|
+
* @param points - The initially provided array of coordinates
|
51
|
+
* @returns The computed Rectangular bounds
|
52
|
+
*/
|
53
|
+
protected _getBounds(points: number[]): PIXI.Rectangle;
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Benchmark the performance of polygon computation for this source
|
57
|
+
* @param iterations - The number of test iterations to perform
|
58
|
+
* @param args - Arguments passed to the compute method
|
59
|
+
*/
|
60
|
+
static benchmark(
|
61
|
+
iterations: number,
|
62
|
+
...args: Parameters<typeof PointSourcePolygon['create']>
|
63
|
+
): ReturnType<typeof foundry.utils.benchmark>;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Compute the polygon given a point origin and radius
|
67
|
+
* @param origin - The origin source point
|
68
|
+
* @param config - Configuration options which customize the polygon computation
|
69
|
+
* @returns The computed polygon instance
|
70
|
+
*/
|
71
|
+
static create(
|
72
|
+
origin: Point,
|
73
|
+
config: Parameters<PointSourcePolygon['initialize']>[1]
|
74
|
+
): ReturnType<PointSourcePolygon['compute']>;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Compute the polygon using the origin and configuration options.
|
78
|
+
* @returns The computed polygon
|
79
|
+
*/
|
80
|
+
compute(): this;
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Perform the implementation-specific computation
|
84
|
+
*/
|
85
|
+
protected abstract _compute(): void;
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Customize the provided configuration object for this polygon type.
|
89
|
+
* @param origin - The provided polygon origin
|
90
|
+
* @param config - The provided configuration object
|
91
|
+
*/
|
92
|
+
initialize(origin: Point, config: PointSourcePolygonConfig): void;
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Visualize the polygon, displaying its computed area, rays, and collision points
|
96
|
+
*/
|
97
|
+
visualize(): void;
|
98
|
+
}
|
@@ -0,0 +1,396 @@
|
|
1
|
+
import type { ConfiguredObjectClassForName } from '../../../../../types/helperTypes.js';
|
2
|
+
|
3
|
+
declare global {
|
4
|
+
type VertexMap = Map<number, PolygonVertex>;
|
5
|
+
|
6
|
+
type EdgeSet = Set<PolygonEdge>;
|
7
|
+
|
8
|
+
interface ClockwiseSweepPolygonConfig extends PointSourcePolygonConfig {
|
9
|
+
/** @defaultValue `canvas.dimensions.maxR` */
|
10
|
+
radius?: number;
|
11
|
+
|
12
|
+
/** @defaultValue `360` */
|
13
|
+
angle?: number;
|
14
|
+
|
15
|
+
/** @defaultValue `0` */
|
16
|
+
rotation?: number;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* The desired density of padding rays, a number per PI
|
20
|
+
* @defaultValue `12`
|
21
|
+
*/
|
22
|
+
density?: number;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* The minimum angle of emission
|
26
|
+
* @defaultValue `config.hasLimitedAngle ? Math.normalizeRadians(Math.toRadians(config.rotation + 90 - (config.angle / 2))) : -Math.PI`
|
27
|
+
*/
|
28
|
+
aMin?: number;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The maximum angle of emission
|
32
|
+
* @defaultValue `config.hasLimitedAngle ? config.aMin + Math.toRadians(config.angle) : Math.PI`
|
33
|
+
*/
|
34
|
+
aMax?: number;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The minimum ray of emission
|
38
|
+
* @defaultValue `Ray.fromAngle(origin.x, origin.y, config.aMin, config.radius)`
|
39
|
+
*/
|
40
|
+
rMin?: Ray;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* The maximum ray of emission
|
44
|
+
* @defaultValue `config.hasLimitedAngle && Ray.fromAngle(origin.x, origin.y, config.aMax, config.radius)`
|
45
|
+
*/
|
46
|
+
rMax?: Ray;
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Does this polygon have a limited radius?
|
50
|
+
* @defaultValue `config.radius > 0`
|
51
|
+
*/
|
52
|
+
hasLimitedRadius?: boolean;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Does this polygon have a limited angle?
|
56
|
+
* @defaultValue `config.angle !== 0`
|
57
|
+
*/
|
58
|
+
hasLimitedAngle?: boolean;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* The squared radius of the polygon, for faster computation later
|
62
|
+
* @defaultValue `Math.pow(config.radius, 2)`
|
63
|
+
*/
|
64
|
+
radius2?: number;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* A small epsilon used for avoiding floating point precision issues
|
68
|
+
* @defaultValue `0.5 / config.radius`
|
69
|
+
*/
|
70
|
+
radiusE?: number;
|
71
|
+
}
|
72
|
+
|
73
|
+
/**
|
74
|
+
* A PointSourcePolygon implementation that uses CCW (counter-clockwise) geometry orientation.
|
75
|
+
* Sweep around the origin, accumulating collision points based on the set of active walls.
|
76
|
+
* This algorithm was created with valuable contributions from https://github.com/caewok
|
77
|
+
*/
|
78
|
+
class ClockwiseSweepPolygon extends PointSourcePolygon {
|
79
|
+
/**
|
80
|
+
* The configuration of this polygon.
|
81
|
+
*/
|
82
|
+
config:
|
83
|
+
| ClockwiseSweepPolygonConfig
|
84
|
+
| ClockwiseSweepPolygon.InitializedConfig
|
85
|
+
| ClockwiseSweepPolygon.LimitedAngleConfig;
|
86
|
+
|
87
|
+
/**
|
88
|
+
* A mapping of vertices which define potential collision points
|
89
|
+
*/
|
90
|
+
vertices: VertexMap;
|
91
|
+
|
92
|
+
/**
|
93
|
+
* The set of edges which define potential boundaries of the polygon
|
94
|
+
*/
|
95
|
+
edges: EdgeSet;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* A collection of rays which are fired at vertices
|
99
|
+
*/
|
100
|
+
rays: SightRay[];
|
101
|
+
|
102
|
+
static benchmark(
|
103
|
+
iterations: number,
|
104
|
+
...args: Parameters<typeof ClockwiseSweepPolygon['create']>
|
105
|
+
): ReturnType<typeof foundry.utils.benchmark>;
|
106
|
+
|
107
|
+
static create(
|
108
|
+
origin: Point,
|
109
|
+
config: Parameters<ClockwiseSweepPolygon['initialize']>[1]
|
110
|
+
): ReturnType<ClockwiseSweepPolygon['compute']>;
|
111
|
+
|
112
|
+
/**
|
113
|
+
* @override
|
114
|
+
* @param origin - The provided polygon origin
|
115
|
+
* @param config - The provided configuration object
|
116
|
+
*/
|
117
|
+
initialize(origin: Point, config: ClockwiseSweepPolygon.InitConfig): void;
|
118
|
+
|
119
|
+
/** @override */
|
120
|
+
protected _compute(): void;
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Round vertices of a ray segment
|
124
|
+
* @param ray - The provided ray
|
125
|
+
* @returns The ray with rounded vertices
|
126
|
+
* @internal
|
127
|
+
*/
|
128
|
+
protected _roundRayVertices(ray: Ray): Ray;
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Translate walls and other obstacles into edges which limit visibility
|
132
|
+
* @internal
|
133
|
+
*/
|
134
|
+
protected _identifyEdges(): void;
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Get the super-set of walls which could potentially apply to this polygon.
|
138
|
+
* @internal
|
139
|
+
*/
|
140
|
+
protected _getWalls(): ConfiguredObjectClassForName<'Wall'>[];
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Restrict the set of candidate edges to those which appear within the limited angle of emission.
|
144
|
+
* @internal
|
145
|
+
*/
|
146
|
+
protected _restrictEdgesByAngle(): void;
|
147
|
+
|
148
|
+
/**
|
149
|
+
* Process the candidate edges to further constrain them using a circular radius of effect.
|
150
|
+
* @internal
|
151
|
+
*/
|
152
|
+
protected _constrainEdgesByRadius(): void;
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Consolidate all vertices from identified edges and register them as part of the vertex mapping.
|
156
|
+
* @internal
|
157
|
+
*/
|
158
|
+
protected _identifyVertices(): void;
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Add additional vertices for intersections between edges.
|
162
|
+
* @param wallEdgeMap - A mapping of wall IDs to PolygonEdge instances
|
163
|
+
* @internal
|
164
|
+
*/
|
165
|
+
protected _identifyIntersections(wallEdgeMap: Map<string, PolygonEdge>): void;
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Execute the sweep over wall vertices
|
169
|
+
* @internal
|
170
|
+
*/
|
171
|
+
protected _executeSweep(): void;
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Determine the initial set of active edges as those which intersect with the initial ray
|
175
|
+
* @returns A set of initially active edges
|
176
|
+
* @internal
|
177
|
+
*/
|
178
|
+
protected _initializeActiveEdges(): EdgeSet;
|
179
|
+
|
180
|
+
/**
|
181
|
+
* Sort vertices clockwise from the initial ray (due west).
|
182
|
+
* @returns The array of sorted vertices
|
183
|
+
* @internal
|
184
|
+
*/
|
185
|
+
protected _sortVertices(): PolygonVertex[];
|
186
|
+
|
187
|
+
/**
|
188
|
+
* Test whether a target vertex is behind some closer active edge
|
189
|
+
* @param ray - The ray being evaluated
|
190
|
+
* (unused)
|
191
|
+
* @param vertex - The target vertex
|
192
|
+
* @param activeEdges - The set of active edges
|
193
|
+
* @returns Is the target vertex behind some closer edge?
|
194
|
+
* @internal
|
195
|
+
*/
|
196
|
+
protected _isVertexBehindActiveEdges(
|
197
|
+
ray: Ray,
|
198
|
+
vertex: PolygonVertex,
|
199
|
+
activeEdges: EdgeSet
|
200
|
+
): { isBehind: boolean; wasLimited: boolean };
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Determine the final result of a candidate ray.
|
204
|
+
* @param ray - The candidate ray being tested
|
205
|
+
* @param vertex - The target vertex
|
206
|
+
* @param result - The result being prepared
|
207
|
+
* @param activeEdges - The set of active edges
|
208
|
+
* @internal
|
209
|
+
*/
|
210
|
+
protected _determineRayResult(ray: Ray, vertex: PolygonVertex, result: CollisionResult, activeEdges: EdgeSet): void;
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Jump to a new closest active edge.
|
214
|
+
* In this case, our target vertex will be the primary collision.
|
215
|
+
* We may have a secondary collision if other active edges exist or if the vertex is prior to the ray endpoint.
|
216
|
+
* @internal
|
217
|
+
*
|
218
|
+
* @param ray - The ray being emitted
|
219
|
+
* @param result - The pending collision result
|
220
|
+
* @param activeEdges - The set of currently active edges
|
221
|
+
* @param isBinding - Is the target vertex a binding collision point?
|
222
|
+
* @param secondaryBefore - Whether to add secondary collision points before ("unshift") or after ("push")
|
223
|
+
* (default: `true`)
|
224
|
+
*/
|
225
|
+
protected _beginNewEdge(
|
226
|
+
ray: Ray,
|
227
|
+
result: CollisionResult,
|
228
|
+
activeEdges: EdgeSet,
|
229
|
+
isBinding: boolean,
|
230
|
+
secondaryBefore?: boolean
|
231
|
+
): void;
|
232
|
+
|
233
|
+
/**
|
234
|
+
* If the target vertex is connected to a currently active edge, we are terminating that edge.
|
235
|
+
* We know the target vertex is not behind another edge, so the target is our initial collision.
|
236
|
+
* There may be a second collision afterwards if no connected walls continue clockwise.
|
237
|
+
* @internal
|
238
|
+
*
|
239
|
+
* @param ray - The ray being emitted
|
240
|
+
* @param result - The pending collision result
|
241
|
+
* @param activeEdges - The set of currently active edges
|
242
|
+
* @param isBinding - Is the target vertex a binding collision point?
|
243
|
+
*/
|
244
|
+
protected _completeCurrentEdge(ray: Ray, result: CollisionResult, activeEdges: EdgeSet, isBinding: boolean): void;
|
245
|
+
|
246
|
+
/**
|
247
|
+
* Augment a CollisionResult with an additional secondary collision.
|
248
|
+
* Require secondary collisions to be a greater distance than the target vertex.
|
249
|
+
* @param ray - The ray being evaluated
|
250
|
+
* @param result - The collision result
|
251
|
+
* @param edges - The subset of active edges which are candidates for collision
|
252
|
+
* @internal
|
253
|
+
*/
|
254
|
+
protected _getSecondaryCollisions(ray: Ray, result: CollisionResult, edges: EdgeSet): PolygonVertex[];
|
255
|
+
|
256
|
+
/**
|
257
|
+
* Identify collision points for a required terminal ray.
|
258
|
+
* @internal
|
259
|
+
*
|
260
|
+
* @param ray - The ray being emitted
|
261
|
+
* @param result - The pending collision result
|
262
|
+
* @param activeEdges - The set of currently active edges
|
263
|
+
*/
|
264
|
+
protected _findRequiredCollision(ray: Ray, result: CollisionResult, activeEdges: EdgeSet): void;
|
265
|
+
|
266
|
+
/**
|
267
|
+
* Identify the collision points between an emitted Ray and a set of active edges.
|
268
|
+
* @param ray - The candidate ray to test
|
269
|
+
* @param activeEdges - The set of active edges
|
270
|
+
* @returns A sorted array of collision points
|
271
|
+
* @internal
|
272
|
+
*/
|
273
|
+
protected _getRayCollisions(
|
274
|
+
ray: Ray,
|
275
|
+
activeEdges: EdgeSet,
|
276
|
+
{
|
277
|
+
minimumDistance
|
278
|
+
}?: {
|
279
|
+
/**
|
280
|
+
* Require collisions to exceed some minimum distance
|
281
|
+
* @defaultValue `0`
|
282
|
+
*/
|
283
|
+
minimumDistance?: number;
|
284
|
+
}
|
285
|
+
): PolygonVertex[];
|
286
|
+
|
287
|
+
/**
|
288
|
+
* Update the set of active edges given the result of an emitted ray.
|
289
|
+
* @param result - The collision result
|
290
|
+
* @param activeEdges - The set of currently active edges
|
291
|
+
* @internal
|
292
|
+
*/
|
293
|
+
protected _updateActiveEdges(result: CollisionResult, activeEdges: EdgeSet): void;
|
294
|
+
|
295
|
+
/**
|
296
|
+
* Construct the polygon from ray collision points
|
297
|
+
* @internal
|
298
|
+
*/
|
299
|
+
protected _constructPolygonPoints(): void;
|
300
|
+
|
301
|
+
/**
|
302
|
+
* Add additional points to limited-radius polygons to approximate the curvature of a circle
|
303
|
+
* @param r0 - The prior ray that collided with some vertex
|
304
|
+
* @param r1 - The next ray that collides with some vertex
|
305
|
+
* @internal
|
306
|
+
*/
|
307
|
+
protected _getPaddingPoints(r0: Ray, r1: Ray): Point[];
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Test whether a wall should be included in the computed polygon for a given origin and type
|
311
|
+
* @param wall - The Wall being considered
|
312
|
+
* @param origin - The origin point for the ray or polygon
|
313
|
+
* @param type - The type of perception or movement restriction being imposed
|
314
|
+
* @returns Should the wall be included?
|
315
|
+
*
|
316
|
+
*/
|
317
|
+
static testWallInclusion(
|
318
|
+
wall: ConfiguredObjectClassForName<'Wall'>,
|
319
|
+
origin: Point,
|
320
|
+
type: foundry.CONST.WALL_RESTRICTION_TYPES
|
321
|
+
): boolean;
|
322
|
+
|
323
|
+
/**
|
324
|
+
* Test whether a vertex lies between two boundary rays
|
325
|
+
* @param vertex - The target vertex
|
326
|
+
* @param rMin - The counter-clockwise bounding ray
|
327
|
+
* @param rMax - The clockwise bounding ray
|
328
|
+
* @param angle - The angle being tested, in degrees
|
329
|
+
* @returns Is the vertex between the two rays?
|
330
|
+
*/
|
331
|
+
static pointBetweenRays(vertex: PolygonVertex, rMin: Ray, rMax: Ray, angle: number): boolean;
|
332
|
+
|
333
|
+
/** @override */
|
334
|
+
visualize(): void;
|
335
|
+
|
336
|
+
/**
|
337
|
+
* Check whether a given ray intersects with walls.
|
338
|
+
* @param ray - The Ray being tested
|
339
|
+
* @param options - Options which customize how collision is tested
|
340
|
+
* @returns Whether any collision occurred if mode is "any"
|
341
|
+
* An array of collisions, if mode is "all"
|
342
|
+
* The closest collision, if mode is "closest"
|
343
|
+
*/
|
344
|
+
static getRayCollisions<Mode extends 'any' | 'closest' | 'all'>(
|
345
|
+
ray: Ray,
|
346
|
+
options?: {
|
347
|
+
/**
|
348
|
+
* Which collision type to check, a value in CONST.WALL_RESTRICTION_TYPES
|
349
|
+
* @defaultValue `"move"`
|
350
|
+
*/
|
351
|
+
type?: foundry.CONST.WALL_RESTRICTION_TYPES;
|
352
|
+
|
353
|
+
/**
|
354
|
+
* Which type of collisions are returned: any, closest, all
|
355
|
+
* @defaultValue `"all"`
|
356
|
+
*/
|
357
|
+
mode?: Mode;
|
358
|
+
|
359
|
+
/**
|
360
|
+
* Visualize some debugging data to help understand the collision test
|
361
|
+
* @defaultValue `false`
|
362
|
+
*/
|
363
|
+
debug?: boolean;
|
364
|
+
}
|
365
|
+
): Mode extends 'any' ? boolean : Mode extends 'closest' ? PolygonVertex : PolygonVertex[];
|
366
|
+
|
367
|
+
/**
|
368
|
+
* Visualize the polygon, displaying its computed area, rays, and collision points
|
369
|
+
* @internal
|
370
|
+
*/
|
371
|
+
protected static _visualizeCollision(ray: Ray, edges: EdgeSet, collisions: PolygonVertex[]): void;
|
372
|
+
}
|
373
|
+
|
374
|
+
namespace ClockwiseSweepPolygon {
|
375
|
+
type InitConfig = Partial<Pick<ClockwiseSweepPolygonConfig, 'radius' | 'angle' | 'rotation' | 'density'>>;
|
376
|
+
|
377
|
+
interface InitializedConfig extends ClockwiseSweepPolygonConfig {
|
378
|
+
hasLimitedRadius: boolean;
|
379
|
+
radius: number;
|
380
|
+
radius2: number;
|
381
|
+
radiusE: number;
|
382
|
+
aMin: number;
|
383
|
+
aMax: number;
|
384
|
+
angle: number;
|
385
|
+
rotation: number;
|
386
|
+
hasLimitedAngle: boolean;
|
387
|
+
density: number;
|
388
|
+
rMin: Ray;
|
389
|
+
}
|
390
|
+
|
391
|
+
interface LimitedAngleConfig extends InitializedConfig {
|
392
|
+
hasLimitedAngle: true;
|
393
|
+
rMax: Ray;
|
394
|
+
}
|
395
|
+
}
|
396
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
import './clockwiseSweepPolygon';
|
@@ -4,6 +4,13 @@
|
|
4
4
|
declare class NormalizedRectangle extends PIXI.Rectangle {
|
5
5
|
constructor(x: number, y: number, width: number, height: number);
|
6
6
|
|
7
|
+
/**
|
8
|
+
* Determine whether some other Rectangle intersects with this one.
|
9
|
+
* @param other - Some other rectangle against which to compare
|
10
|
+
* @returns Do the rectangles intersect?
|
11
|
+
*/
|
12
|
+
intersects(other: PIXI.Rectangle): boolean;
|
13
|
+
|
7
14
|
/**
|
8
15
|
* Generate a new rectangle by rotating this one clockwise about its center by a certain number of radians
|
9
16
|
* @param radians - The angle of rotation
|
@@ -2,6 +2,9 @@
|
|
2
2
|
* This class defines an interface which all shaders utilize
|
3
3
|
*/
|
4
4
|
declare abstract class AbstractBaseShader extends PIXI.Shader {
|
5
|
+
/** The current uniforms of the Shader */
|
6
|
+
uniforms: AbstractBaseShader.Uniforms;
|
7
|
+
|
5
8
|
constructor(program: PIXI.Program, uniforms: AbstractBaseShader.Uniforms);
|
6
9
|
|
7
10
|
/**
|
@@ -10,12 +13,16 @@ declare abstract class AbstractBaseShader extends PIXI.Shader {
|
|
10
13
|
protected _defaults: AbstractBaseShader.Uniforms;
|
11
14
|
|
12
15
|
/**
|
13
|
-
* The
|
16
|
+
* The raw vertex shader used by this class.
|
17
|
+
* A subclass of AbstractBaseShader must implement the vertexShader static field.
|
18
|
+
* @defaultValue `""`
|
19
|
+
*
|
20
|
+
* @remarks This is abstract, subclasses must implement it.
|
14
21
|
*/
|
15
22
|
static vertexShader: string;
|
16
23
|
|
17
24
|
/**
|
18
|
-
* The fragment shader
|
25
|
+
* The raw fragment shader used by this class.
|
19
26
|
* A subclass of AbstractBaseShader must implement the fragmentShader static field.
|
20
27
|
* @defaultValue `""`
|
21
28
|
*
|
@@ -39,42 +46,9 @@ declare abstract class AbstractBaseShader extends PIXI.Shader {
|
|
39
46
|
|
40
47
|
/**
|
41
48
|
* Reset the shader uniforms back to their provided default values
|
49
|
+
* @internal
|
42
50
|
*/
|
43
51
|
protected reset(): void;
|
44
|
-
|
45
|
-
/**
|
46
|
-
* A Vec3 pseudo-random generator, based on uv position
|
47
|
-
*/
|
48
|
-
static PRNG3D: string;
|
49
|
-
|
50
|
-
/**
|
51
|
-
* A conventional pseudo-random number generator with the "golden" numbers, based on uv position
|
52
|
-
*/
|
53
|
-
static PRNG: string;
|
54
|
-
|
55
|
-
/**
|
56
|
-
* A conventional noise generator
|
57
|
-
*/
|
58
|
-
static NOISE: string;
|
59
|
-
|
60
|
-
/**
|
61
|
-
* Fractional Brownian Motion for a given number of octaves
|
62
|
-
* @param octaves - (default: `4`)
|
63
|
-
* @param amp - (default: `1.0`)
|
64
|
-
*/
|
65
|
-
static FBM(octaves?: number, amp?: number): string;
|
66
|
-
|
67
|
-
/**
|
68
|
-
* Fade easing to use with distance in interval [0,1]
|
69
|
-
* @param amp - (default: `3`)
|
70
|
-
* @param coef - (default: `0.80`)
|
71
|
-
*/
|
72
|
-
static FADE(amp?: number, coef?: number): string;
|
73
|
-
|
74
|
-
/**
|
75
|
-
* Convert a Hue-Saturation-Brightness color to RGB - useful to convert polar coordinates to RGB
|
76
|
-
*/
|
77
|
-
static HSB2RGB: string;
|
78
52
|
}
|
79
53
|
|
80
54
|
declare namespace AbstractBaseShader {
|
@@ -91,5 +65,5 @@ declare namespace AbstractBaseShader {
|
|
91
65
|
| { x: number; y: number; z: number; w: number }[]
|
92
66
|
| PIXI.Texture;
|
93
67
|
|
94
|
-
type Uniforms =
|
68
|
+
type Uniforms = Record<string, AbstractBaseShader.UniformValue>;
|
95
69
|
}
|