@league-of-foundry-developers/foundry-vtt-types 9.238.1 → 9.242.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/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/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +2 -2
- package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
- package/src/foundry/foundry.js/canvasAnimation.d.ts +30 -7
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -13
- 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/rollTable.d.ts +2 -2
- package/src/foundry/foundry.js/clientKeybindings.d.ts +12 -2
- package/src/foundry/foundry.js/clientSettings.d.ts +1 -1
- package/src/foundry/foundry.js/collisionResult.d.ts +60 -0
- package/src/foundry/foundry.js/config.d.ts +33 -34
- 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 +1 -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 +388 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -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/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/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 +27 -32
- package/src/foundry/foundry.js/screenCulling.d.ts +19 -0
- package/src/foundry/foundry.js/specialEffect.d.ts +1 -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,11 @@
|
|
1
|
+
/**
|
2
|
+
* An experimental approach to culling using the quadtree mapping rather than the screen rectangle.
|
3
|
+
* @internal
|
4
|
+
*/
|
5
|
+
declare class QuadtreeCulling {
|
6
|
+
constructor();
|
7
|
+
|
8
|
+
cull(screen: Rectangle): void;
|
9
|
+
|
10
|
+
protected _getRect(screen: Rectangle): NormalizedRectangle;
|
11
|
+
}
|
@@ -1,171 +1,165 @@
|
|
1
|
-
|
2
|
-
/** The x-coordinate of intersection */
|
3
|
-
x: number;
|
1
|
+
import type { LineIntersection } from '../common/utils/geometry.mjs.js';
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
declare global {
|
4
|
+
interface RayIntersection {
|
5
|
+
/** The x-coordinate of intersection */
|
6
|
+
x: number;
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
/** The y-coordinate of intersection */
|
9
|
+
y: number;
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
}
|
14
|
-
|
15
|
-
/**
|
16
|
-
* A ray for the purposes of computing sight and collision
|
17
|
-
* Given points A[x,y] and B[x,y]
|
18
|
-
*
|
19
|
-
* Slope-Intercept form:
|
20
|
-
* y = a + bx
|
21
|
-
* y = A.y + ((B.y - A.Y) / (B.x - A.x))x
|
22
|
-
*
|
23
|
-
* Parametric form:
|
24
|
-
* R(t) = (1-t)A + tB
|
25
|
-
*/
|
26
|
-
declare class Ray {
|
27
|
-
/**
|
28
|
-
* @param A - The origin of the Ray
|
29
|
-
* @param B - The destination of the Ray
|
30
|
-
*/
|
31
|
-
constructor(A: Point, B: Point);
|
32
|
-
|
33
|
-
/**
|
34
|
-
* The origin point, `{x, y}`
|
35
|
-
*/
|
36
|
-
A: Point;
|
37
|
-
|
38
|
-
/**
|
39
|
-
* The destination point, `{x, y}`
|
40
|
-
*/
|
41
|
-
B: Point;
|
42
|
-
|
43
|
-
/**
|
44
|
-
* The origin y-coordinate
|
45
|
-
*/
|
46
|
-
y0: number;
|
11
|
+
/** The proximity to the Ray origin, as a ratio of distance */
|
12
|
+
t0: number;
|
47
13
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
x0: number;
|
14
|
+
/** The proximity to the Ray destination, as a ratio of distance */
|
15
|
+
t1: number;
|
16
|
+
}
|
52
17
|
|
53
18
|
/**
|
54
|
-
*
|
55
|
-
|
56
|
-
dx: number;
|
57
|
-
|
58
|
-
/**
|
59
|
-
* The vertical distance of the ray, y1 - y0
|
60
|
-
*/
|
61
|
-
dy: number;
|
62
|
-
|
63
|
-
/**
|
64
|
-
* The slope of the ray, dy over dx
|
65
|
-
*/
|
66
|
-
slope: number;
|
67
|
-
|
68
|
-
/**
|
69
|
-
* The cached angle, computed lazily in Ray#angle
|
70
|
-
* @defaultValue `undefined`
|
71
|
-
* @internal
|
72
|
-
*/
|
73
|
-
protected _angle: number | undefined;
|
74
|
-
|
75
|
-
/**
|
76
|
-
* The cached distance, computed lazily in Ray#distance
|
77
|
-
* @defaultValue `undefined`
|
78
|
-
* @internal
|
79
|
-
*/
|
80
|
-
protected _distance: number | undefined;
|
81
|
-
|
82
|
-
/**
|
83
|
-
* The normalized angle of the ray in radians on the range (-PI, PI).
|
84
|
-
* The angle is computed lazily (only if required) and cached.
|
85
|
-
*/
|
86
|
-
get angle(): number;
|
87
|
-
set angle(value: number);
|
88
|
-
|
89
|
-
/**
|
90
|
-
* A bounding rectangle that encompasses the Ray
|
91
|
-
*/
|
92
|
-
get bounds(): NormalizedRectangle;
|
93
|
-
|
94
|
-
/**
|
95
|
-
* The distance (length) of the Ray in pixels.
|
96
|
-
* The distance is computed lazily (only if required) and cached.
|
97
|
-
*/
|
98
|
-
get distance(): number;
|
99
|
-
set distance(value: number);
|
100
|
-
|
101
|
-
/**
|
102
|
-
* A factory method to construct a Ray from an origin point, an angle, and a distance
|
103
|
-
* @param x - The origin x-coordinate
|
104
|
-
* @param y - The origin y-coordinate
|
105
|
-
* @param radians - The ray angle in radians
|
106
|
-
* @param distance - The distance of the ray in pixels
|
107
|
-
* @returns The constructed Ray instance
|
108
|
-
*/
|
109
|
-
static fromAngle(x: number, y: number, radians: number, distance: number): Ray;
|
110
|
-
|
111
|
-
/**
|
112
|
-
* A factory method to construct a Ray from points in array format.
|
113
|
-
* @param A - The origin point [x,y]
|
114
|
-
* @param B - The destination point [x,y]
|
115
|
-
* @returns The constructed Ray instance
|
116
|
-
*/
|
117
|
-
static fromArrays(A: PointArray, B: PointArray): Ray;
|
118
|
-
|
119
|
-
/**
|
120
|
-
* Project the Array by some proportion of it's initial distance.
|
121
|
-
* Return the coordinates of that point along the path.
|
122
|
-
* @param t - The distance along the Ray
|
123
|
-
* @returns The coordinates of the projected point
|
124
|
-
*/
|
125
|
-
project(t: number): { x: number; y: number };
|
126
|
-
|
127
|
-
/**
|
128
|
-
* Reverse the direction of the Ray, returning a second Ray
|
129
|
-
*/
|
130
|
-
reverse(): Ray;
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Create a new ray which uses the same origin point, but a slightly offset angle and distance
|
134
|
-
* @param offset - An offset in radians which modifies the angle of the original Ray
|
135
|
-
* @param distance - A distance the new ray should project, otherwise uses the same distance.
|
136
|
-
* @returns A new Ray with an offset angle
|
137
|
-
*/
|
138
|
-
shiftAngle(angleOffset: number, distance?: number): Ray;
|
139
|
-
|
140
|
-
/**
|
141
|
-
* Find the point I[x,y] and distance t* on ray R(t) which intersects another ray
|
142
|
-
* http://paulbourke.net/geometry/pointlineplane/
|
19
|
+
* A ray for the purposes of computing sight and collision
|
20
|
+
* Given points A[x,y] and B[x,y]
|
143
21
|
*
|
144
|
-
*
|
22
|
+
* Slope-Intercept form:
|
23
|
+
* y = a + bx
|
24
|
+
* y = A.y + ((B.y - A.Y) / (B.x - A.x))x
|
145
25
|
*
|
146
|
-
*
|
147
|
-
*
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
26
|
+
* Parametric form:
|
27
|
+
* R(t) = (1-t)A + tB
|
28
|
+
*/
|
29
|
+
class Ray {
|
30
|
+
/**
|
31
|
+
* @param A - The origin of the Ray
|
32
|
+
* @param B - The destination of the Ray
|
33
|
+
*/
|
34
|
+
constructor(A: Point, B: Point);
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The origin point, `{x, y}`
|
38
|
+
*/
|
39
|
+
A: Point;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* The destination point, `{x, y}`
|
43
|
+
*/
|
44
|
+
B: Point;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* The origin y-coordinate
|
48
|
+
*/
|
49
|
+
y0: number;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* The origin x-coordinate
|
53
|
+
*/
|
54
|
+
x0: number;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* The horizontal distance of the ray, x1 - x0
|
58
|
+
*/
|
59
|
+
dx: number;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* The vertical distance of the ray, y1 - y0
|
63
|
+
*/
|
64
|
+
dy: number;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* The slope of the ray, dy over dx
|
68
|
+
*/
|
69
|
+
slope: number;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* The cached angle, computed lazily in Ray#angle
|
73
|
+
* @defaultValue `undefined`
|
74
|
+
* @internal
|
75
|
+
*/
|
76
|
+
protected _angle: number | undefined;
|
77
|
+
|
78
|
+
/**
|
79
|
+
* The cached distance, computed lazily in Ray#distance
|
80
|
+
* @defaultValue `undefined`
|
81
|
+
* @internal
|
82
|
+
*/
|
83
|
+
protected _distance: number | undefined;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* The normalized angle of the ray in radians on the range (-PI, PI).
|
87
|
+
* The angle is computed lazily (only if required) and cached.
|
88
|
+
*/
|
89
|
+
get angle(): number;
|
90
|
+
set angle(value: number);
|
91
|
+
|
92
|
+
/**
|
93
|
+
* A bounding rectangle that encompasses the Ray
|
94
|
+
*/
|
95
|
+
get bounds(): NormalizedRectangle;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* The distance (length) of the Ray in pixels.
|
99
|
+
* The distance is computed lazily (only if required) and cached.
|
100
|
+
*/
|
101
|
+
get distance(): number;
|
102
|
+
set distance(value: number);
|
103
|
+
|
104
|
+
/**
|
105
|
+
* A factory method to construct a Ray from an origin point, an angle, and a distance
|
106
|
+
* @param x - The origin x-coordinate
|
107
|
+
* @param y - The origin y-coordinate
|
108
|
+
* @param radians - The ray angle in radians
|
109
|
+
* @param distance - The distance of the ray in pixels
|
110
|
+
* @returns The constructed Ray instance
|
111
|
+
*/
|
112
|
+
static fromAngle(x: number, y: number, radians: number, distance: number): Ray;
|
113
|
+
|
114
|
+
/**
|
115
|
+
* A factory method to construct a Ray from points in array format.
|
116
|
+
* @param A - The origin point [x,y]
|
117
|
+
* @param B - The destination point [x,y]
|
118
|
+
* @returns The constructed Ray instance
|
119
|
+
*/
|
120
|
+
static fromArrays(A: PointArray, B: PointArray): Ray;
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Project the Array by some proportion of it's initial distance.
|
124
|
+
* Return the coordinates of that point along the path.
|
125
|
+
* @param t - The distance along the Ray
|
126
|
+
* @returns The coordinates of the projected point
|
127
|
+
*/
|
128
|
+
project(t: number): { x: number; y: number };
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Create a Ray by projecting a certain distance towards a known point.
|
132
|
+
* @param origin - The origin of the Ray
|
133
|
+
* @param point - The point towards which to project
|
134
|
+
* @param distance - The distance of projection
|
135
|
+
*/
|
136
|
+
static towardsPoint(origin: Point, point: Point, distance: number): Ray;
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Create a Ray by projecting a certain squared-distance towards a known point.
|
140
|
+
* @param origin - The origin of the Ray
|
141
|
+
* @param point - The point towards which to project
|
142
|
+
* @param distance2 - The squared distance of projection
|
143
|
+
*/
|
144
|
+
static towardsPointSquared(origin: Point, point: Point, distance2: number): Ray;
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Reverse the direction of the Ray, returning a second Ray
|
148
|
+
*/
|
149
|
+
reverse(): Ray;
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Create a new ray which uses the same origin point, but a slightly offset angle and distance
|
153
|
+
* @param offset - An offset in radians which modifies the angle of the original Ray
|
154
|
+
* @param distance - A distance the new ray should project, otherwise uses the same distance.
|
155
|
+
* @returns A new Ray with an offset angle
|
156
|
+
*/
|
157
|
+
shiftAngle(angleOffset: number, distance?: number): Ray;
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Find the point I[x,y] and distance t* on ray R(t) which intersects another ray
|
161
|
+
* @see foundry.utils.lineLineIntersection
|
162
|
+
*/
|
163
|
+
intersectSegment(coords: [x0: number, y0: number, x1: number, y1: number]): LineIntersection | null;
|
164
|
+
}
|
171
165
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
import './sightRay';
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* A subclass of Ray that is used specifically for computing source polygons
|
3
|
+
*
|
4
|
+
* This was used for the RadialSweepPolygon but can now be deleted once that is
|
5
|
+
* @deprecated since v9d2
|
6
|
+
*/
|
7
|
+
declare class SightRay extends Ray {
|
8
|
+
/**
|
9
|
+
* The array of sorted collision points which apply for this Ray.
|
10
|
+
*/
|
11
|
+
collisions: WallEndpoint[];
|
12
|
+
|
13
|
+
/**
|
14
|
+
* The target endpoint at which this Ray was fired
|
15
|
+
*/
|
16
|
+
endpoint: WallEndpoint | null;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* The result objects which records the outcome of this Ray
|
20
|
+
*/
|
21
|
+
result: {
|
22
|
+
collisions: unknown[];
|
23
|
+
continuation: unknown | undefined;
|
24
|
+
limitation: number;
|
25
|
+
superfluous: boolean;
|
26
|
+
stopped: boolean;
|
27
|
+
activeWalls: unknown | undefined;
|
28
|
+
};
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The final collision point that this SightRay encountered.
|
32
|
+
*/
|
33
|
+
get lastCollision(): WallEndpoint | null;
|
34
|
+
}
|
@@ -351,11 +351,29 @@ declare global {
|
|
351
351
|
|
352
352
|
/**
|
353
353
|
* Render a Roll instance to HTML
|
354
|
-
* @param
|
355
|
-
*
|
354
|
+
* @param options - Options which affect how the Roll is rendered
|
355
|
+
* (default: `{}`)
|
356
356
|
* @returns The rendered HTML template as a string
|
357
357
|
*/
|
358
|
-
render(
|
358
|
+
render(options?: {
|
359
|
+
/**
|
360
|
+
* Flavor text to include
|
361
|
+
* @defaultValue `undefined`
|
362
|
+
*/
|
363
|
+
flavor?: string;
|
364
|
+
|
365
|
+
/**
|
366
|
+
* A custom HTML template path
|
367
|
+
* @defaultValue `this.constructor.CHAT_TEMPLATE`
|
368
|
+
*/
|
369
|
+
template?: string;
|
370
|
+
|
371
|
+
/**
|
372
|
+
* Is the Roll displayed privately?
|
373
|
+
* @defaultValue `false`
|
374
|
+
*/
|
375
|
+
isPrivate?: boolean;
|
376
|
+
}): Promise<string>;
|
359
377
|
|
360
378
|
/**
|
361
379
|
* Transform a Roll instance into a ChatMessage, displaying the roll result.
|
@@ -374,15 +392,15 @@ declare global {
|
|
374
392
|
*/
|
375
393
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
376
394
|
messageData?: T,
|
377
|
-
{ rollMode, create }?: { rollMode?:
|
395
|
+
{ rollMode, create }?: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create?: true }
|
378
396
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined>;
|
379
397
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
380
398
|
messageData: T,
|
381
|
-
{ rollMode, create }: { rollMode?:
|
399
|
+
{ rollMode, create }: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create: false }
|
382
400
|
): MessageData<T>;
|
383
401
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
384
402
|
messageData: T,
|
385
|
-
{ rollMode, create }: { rollMode?:
|
403
|
+
{ rollMode, create }: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create: boolean }
|
386
404
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined> | MessageData<T>;
|
387
405
|
|
388
406
|
/**
|
@@ -440,37 +458,14 @@ declare global {
|
|
440
458
|
* roll.formula; // 4d8 + 8
|
441
459
|
* ```
|
442
460
|
*/
|
443
|
-
static fromTerms(
|
461
|
+
static fromTerms<T extends ConstructorOf<Roll<any>>>(
|
462
|
+
this: T,
|
444
463
|
terms: RollTerm[],
|
445
464
|
options?: InexactPartial<Options>
|
446
|
-
):
|
465
|
+
): InstanceType<T>;
|
447
466
|
}
|
448
467
|
}
|
449
468
|
|
450
|
-
interface ChatOptions {
|
451
|
-
/**
|
452
|
-
* @defaultValue `false`
|
453
|
-
*/
|
454
|
-
blind?: boolean;
|
455
|
-
|
456
|
-
/**
|
457
|
-
* @defaultValue `null`
|
458
|
-
*/
|
459
|
-
flavor?: any;
|
460
|
-
|
461
|
-
/**
|
462
|
-
* @defaultValue `false`
|
463
|
-
*/
|
464
|
-
isPrivate?: boolean;
|
465
|
-
|
466
|
-
template?: string;
|
467
|
-
|
468
|
-
/**
|
469
|
-
* @defaultValue The id of the current user
|
470
|
-
*/
|
471
|
-
user?: string;
|
472
|
-
}
|
473
|
-
|
474
469
|
type Options = RollTerm.EvaluationOptions;
|
475
470
|
|
476
471
|
interface SplitGroupOptions {
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* A tool for culling the renderable state of objects which are outside the current viewport.
|
3
|
+
*/
|
4
|
+
declare class ScreenCulling {
|
5
|
+
constructor();
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Toggle the renderable state of objects based on the current viewport rectangle
|
9
|
+
*/
|
10
|
+
cull(rect: Rectangle): void;
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Test whether rectangular bounds intersect
|
14
|
+
* @param rect - The target rectangle (the screen)
|
15
|
+
* @param bounds - The reference rectangle (the object)
|
16
|
+
* @returns Do they intersect?
|
17
|
+
*/
|
18
|
+
intersects(rect: Rectangle, bounds: Rectangle): boolean;
|
19
|
+
}
|
package/src/foundry/index.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import './common/module.mjs';
|
2
|
-
|
3
2
|
import './foundry.js/application';
|
3
|
+
import './foundry.js/applications';
|
4
4
|
import './foundry.js/audioContainer';
|
5
5
|
import './foundry.js/audioHelper';
|
6
6
|
import './foundry.js/avClient';
|
7
|
+
import './foundry.js/avClients';
|
7
8
|
import './foundry.js/avMaster';
|
8
9
|
import './foundry.js/avSettings';
|
9
10
|
import './foundry.js/cameraPopoutAppWrapper';
|
@@ -12,10 +13,12 @@ import './foundry.js/canvasAnimation';
|
|
12
13
|
import './foundry.js/canvasDocumentMixin';
|
13
14
|
import './foundry.js/chatBubbles';
|
14
15
|
import './foundry.js/clientDatabaseBackend';
|
15
|
-
import './foundry.js/clientDocuments';
|
16
16
|
import './foundry.js/clientDocumentMixin';
|
17
|
+
import './foundry.js/clientDocuments';
|
17
18
|
import './foundry.js/clientKeybindings';
|
18
19
|
import './foundry.js/clientSettings';
|
20
|
+
import './foundry.js/collections';
|
21
|
+
import './foundry.js/collisionResult';
|
19
22
|
import './foundry.js/config';
|
20
23
|
import './foundry.js/constants';
|
21
24
|
import './foundry.js/contextMenu';
|
@@ -25,8 +28,8 @@ import './foundry.js/features';
|
|
25
28
|
import './foundry.js/fonts';
|
26
29
|
import './foundry.js/formDataExtended';
|
27
30
|
import './foundry.js/game';
|
28
|
-
import './foundry.js/gamepadManager';
|
29
31
|
import './foundry.js/gameTime';
|
32
|
+
import './foundry.js/gamepadManager';
|
30
33
|
import './foundry.js/globalVariables';
|
31
34
|
import './foundry.js/handlebarsHelpers';
|
32
35
|
import './foundry.js/hooks';
|
@@ -38,16 +41,34 @@ import './foundry.js/mouseInteractionManager';
|
|
38
41
|
import './foundry.js/mouseManager';
|
39
42
|
import './foundry.js/newUserExperience';
|
40
43
|
import './foundry.js/perceptionManager';
|
44
|
+
import './foundry.js/pixi';
|
41
45
|
import './foundry.js/pointSource';
|
46
|
+
import './foundry.js/pointSources';
|
47
|
+
import './foundry.js/polygonEdge';
|
48
|
+
import './foundry.js/polygonVertex';
|
42
49
|
import './foundry.js/quadtree';
|
50
|
+
import './foundry.js/quadtreeCulling';
|
43
51
|
import './foundry.js/ray';
|
52
|
+
import './foundry.js/rays';
|
44
53
|
import './foundry.js/roll';
|
54
|
+
import './foundry.js/rollTerm';
|
55
|
+
import './foundry.js/rollTerms/diceTerm';
|
56
|
+
import './foundry.js/rollTerms/diceTerms/coin';
|
57
|
+
import './foundry.js/rollTerms/diceTerms/die';
|
58
|
+
import './foundry.js/rollTerms/diceTerms/fateDie';
|
59
|
+
import './foundry.js/rollTerms/mathTerm';
|
60
|
+
import './foundry.js/rollTerms/numericTerm';
|
61
|
+
import './foundry.js/rollTerms/operatorTerm';
|
62
|
+
import './foundry.js/rollTerms/parentheticalTerm';
|
63
|
+
import './foundry.js/rollTerms/poolTerm';
|
64
|
+
import './foundry.js/rollTerms/stringTerm';
|
65
|
+
import './foundry.js/screenCulling';
|
45
66
|
import './foundry.js/searchFilter';
|
46
|
-
import './foundry.js/specialEffect';
|
47
|
-
import './foundry.js/specialEffects';
|
48
67
|
import './foundry.js/socketInterface';
|
49
68
|
import './foundry.js/sortingHelpers';
|
50
69
|
import './foundry.js/sound';
|
70
|
+
import './foundry.js/specialEffect';
|
71
|
+
import './foundry.js/specialEffects';
|
51
72
|
import './foundry.js/tabs';
|
52
73
|
import './foundry.js/templateUtils';
|
53
74
|
import './foundry.js/textEditor';
|
@@ -57,25 +78,3 @@ import './foundry.js/types';
|
|
57
78
|
import './foundry.js/userTargets';
|
58
79
|
import './foundry.js/utils';
|
59
80
|
import './foundry.js/videoHelper';
|
60
|
-
|
61
|
-
import './foundry.js/applications';
|
62
|
-
|
63
|
-
import './foundry.js/avClients';
|
64
|
-
|
65
|
-
import './foundry.js/collections';
|
66
|
-
|
67
|
-
import './foundry.js/rollTerm';
|
68
|
-
|
69
|
-
import './foundry.js/rollTerms/diceTerm';
|
70
|
-
import './foundry.js/rollTerms/mathTerm';
|
71
|
-
import './foundry.js/rollTerms/numericTerm';
|
72
|
-
import './foundry.js/rollTerms/operatorTerm';
|
73
|
-
import './foundry.js/rollTerms/parentheticalTerm';
|
74
|
-
import './foundry.js/rollTerms/poolTerm';
|
75
|
-
import './foundry.js/rollTerms/stringTerm';
|
76
|
-
|
77
|
-
import './foundry.js/rollTerms/diceTerms/coin';
|
78
|
-
import './foundry.js/rollTerms/diceTerms/die';
|
79
|
-
import './foundry.js/rollTerms/diceTerms/fateDie';
|
80
|
-
|
81
|
-
import './foundry.js/pixi';
|
@@ -1,25 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* An extension of the base PIXI.Polygon class designed for polygons which are constructed as a radius around
|
3
|
-
* some central origin.
|
4
|
-
*/
|
5
|
-
declare class SourcePolygon extends PIXI.Polygon {
|
6
|
-
constructor(x: number, y: number, radius: number, ...points: ({ x: number; y: number }[] | number[])[]);
|
7
|
-
|
8
|
-
x: number;
|
9
|
-
|
10
|
-
y: number;
|
11
|
-
|
12
|
-
radius: number;
|
13
|
-
|
14
|
-
/** @override */
|
15
|
-
clone(): this;
|
16
|
-
|
17
|
-
/**
|
18
|
-
* Optimize Polygon membership test by first checking the hypotenuse of the candidate point against the known origin
|
19
|
-
* @see PIXI.Polygon#contains
|
20
|
-
* @param x - The candidate x-coordinate
|
21
|
-
* @param y - The candidate y-coordinate
|
22
|
-
* @returns Is the provided point contained within the SourcePolygon?
|
23
|
-
*/
|
24
|
-
contains(x: number, y: number): boolean;
|
25
|
-
}
|
package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* The default coloration shader used by standard rendering and animations.
|
3
|
-
* A fragment shader which creates a light source.
|
4
|
-
*/
|
5
|
-
declare class StandardColorationShader extends AbstractBaseShader {
|
6
|
-
static fragmentShader: string;
|
7
|
-
|
8
|
-
/**
|
9
|
-
* @defaultValue
|
10
|
-
* ```typescript
|
11
|
-
* {
|
12
|
-
* alpha: 1.0,
|
13
|
-
* color: [1.0, 1.0, 1.0],
|
14
|
-
* time: 0,
|
15
|
-
* intensity: 5,
|
16
|
-
* darkness: false,
|
17
|
-
* }
|
18
|
-
* ```
|
19
|
-
*/
|
20
|
-
static defaultUniforms: AbstractBaseShader.Uniforms;
|
21
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Chroma animation coloration shader
|
3
|
-
*/
|
4
|
-
declare class ChromaColorationShader extends StandardColorationShader {
|
5
|
-
static fragmentShader: string;
|
6
|
-
|
7
|
-
/**
|
8
|
-
* @override
|
9
|
-
* @defaultValue
|
10
|
-
* ```typescript
|
11
|
-
* Object.assign({}, super.defaultUniforms, {
|
12
|
-
* pulse: 0,
|
13
|
-
* color: PIXI.utils.hex2rgb(0xCEECEE)
|
14
|
-
* })
|
15
|
-
* ```
|
16
|
-
*/
|
17
|
-
static defaultUniforms: AbstractBaseShader.Uniforms;
|
18
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Emanation animation coloration shader
|
3
|
-
*/
|
4
|
-
declare class EmanationColorationShader extends StandardColorationShader {
|
5
|
-
static fragmentShader: string;
|
6
|
-
|
7
|
-
/**
|
8
|
-
* @override
|
9
|
-
* @defaultValue
|
10
|
-
* ```typescript
|
11
|
-
* Object.assign({}, super.defaultUniforms, {
|
12
|
-
* color: PIXI.utils.hex2rgb(0xCEECEE)
|
13
|
-
* })
|
14
|
-
* ```
|
15
|
-
*/
|
16
|
-
static defaultUniforms: AbstractBaseShader.Uniforms;
|
17
|
-
}
|