@playcanvas/inspector 0.1.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 +19 -0
- package/README.md +110 -0
- package/package.json +62 -0
- package/src/asset-usage.js +108 -0
- package/src/asset-view.js +370 -0
- package/src/camera-view.js +128 -0
- package/src/debug.js +31 -0
- package/src/describe.js +302 -0
- package/src/entity-inspector-script.js +130 -0
- package/src/frame-graph-view.js +767 -0
- package/src/hierarchy-view.js +475 -0
- package/src/index.js +4 -0
- package/src/input/fly-controller.js +116 -0
- package/src/input/input.js +299 -0
- package/src/input/math.js +8 -0
- package/src/input/orbit-controller.js +158 -0
- package/src/input/pose.js +207 -0
- package/src/inspector.js +3293 -0
- package/src/instance-survey.js +50 -0
- package/src/list-view.js +410 -0
- package/src/material-view.js +197 -0
- package/src/memory-view.js +344 -0
- package/src/mesh-view.js +235 -0
- package/src/model.js +170 -0
- package/src/node-model.js +404 -0
- package/src/physics-debug.js +527 -0
- package/src/physics-view.js +314 -0
- package/src/picker/picker.js +545 -0
- package/src/picker/render-pass-picker.js +206 -0
- package/src/property-view.js +628 -0
- package/src/render-target-view.js +288 -0
- package/src/renderers/texture-renderer-shaders.js +139 -0
- package/src/renderers/texture-renderer.js +430 -0
- package/src/renderers/wire-renderer.js +954 -0
- package/src/script-view.js +288 -0
- package/src/shader-view.js +287 -0
- package/src/styles.js +918 -0
- package/src/texture-view.js +186 -0
- package/src/tooltip.js +72 -0
- package/src/viewport-tools.js +695 -0
- package/types/asset-usage.d.ts +23 -0
- package/types/asset-view.d.ts +94 -0
- package/types/camera-view.d.ts +45 -0
- package/types/debug.d.ts +14 -0
- package/types/describe.d.ts +43 -0
- package/types/entity-inspector-script.d.ts +87 -0
- package/types/frame-graph-view.d.ts +155 -0
- package/types/hierarchy-view.d.ts +172 -0
- package/types/index.d.ts +3 -0
- package/types/input/fly-controller.d.ts +42 -0
- package/types/input/input.d.ts +192 -0
- package/types/input/math.d.ts +1 -0
- package/types/input/orbit-controller.d.ts +63 -0
- package/types/input/pose.d.ts +126 -0
- package/types/inspector.d.ts +1304 -0
- package/types/instance-survey.d.ts +35 -0
- package/types/list-view.d.ts +151 -0
- package/types/material-view.d.ts +63 -0
- package/types/memory-view.d.ts +95 -0
- package/types/mesh-view.d.ts +89 -0
- package/types/model.d.ts +104 -0
- package/types/node-model.d.ts +54 -0
- package/types/physics-debug.d.ts +254 -0
- package/types/physics-view.d.ts +81 -0
- package/types/picker/picker.d.ts +255 -0
- package/types/picker/render-pass-picker.d.ts +47 -0
- package/types/property-view.d.ts +189 -0
- package/types/render-target-view.d.ts +98 -0
- package/types/renderers/texture-renderer-shaders.d.ts +9 -0
- package/types/renderers/texture-renderer.d.ts +231 -0
- package/types/renderers/wire-renderer.d.ts +347 -0
- package/types/script-view.d.ts +56 -0
- package/types/shader-view.d.ts +46 -0
- package/types/styles.d.ts +22 -0
- package/types/texture-view.d.ts +30 -0
- package/types/tooltip.d.ts +17 -0
- package/types/viewport-tools.d.ts +237 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders wireframe shapes for a single frame, for debugging and visualization. Shapes are
|
|
3
|
+
* submitted as line segments to the layer given by {@link WireRenderer#layer}, which defaults to
|
|
4
|
+
* the {@link LAYERID_IMMEDIATE} layer, and are discarded once the frame has been rendered, so
|
|
5
|
+
* they must be issued again on every frame they should be visible.
|
|
6
|
+
*
|
|
7
|
+
* The renderer holds the state used by the shapes it draws - {@link WireRenderer#color},
|
|
8
|
+
* {@link WireRenderer#layer}, {@link WireRenderer#depthTest}, {@link WireRenderer#segments} and
|
|
9
|
+
* {@link WireRenderer#transform}. Fields can be assigned between calls, and drawing many shapes
|
|
10
|
+
* with the same state allocates nothing:
|
|
11
|
+
*
|
|
12
|
+
* ```javascript
|
|
13
|
+
* const wire = new WireRenderer(app);
|
|
14
|
+
* wire.color = Color.RED;
|
|
15
|
+
*
|
|
16
|
+
* app.on('update', () => {
|
|
17
|
+
* for (const item of items) {
|
|
18
|
+
* wire.sphere(item.position, item.radius);
|
|
19
|
+
* }
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* A second set of state is simply a second instance. Instances hold no GPU resources, and those
|
|
24
|
+
* sharing a layer and depth test mode submit into the same batch, so using several has no
|
|
25
|
+
* additional rendering cost:
|
|
26
|
+
*
|
|
27
|
+
* ```javascript
|
|
28
|
+
* const xray = new WireRenderer(app);
|
|
29
|
+
* xray.depthTest = false;
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* These are thin lines, one pixel wide. For thick lines with caps, joins and dashes, intended as
|
|
33
|
+
* part of the rendered scene rather than as a debugging aid, see {@link WideLineRenderer} instead.
|
|
34
|
+
*
|
|
35
|
+
* @category Graphics
|
|
36
|
+
*/
|
|
37
|
+
export class WireRenderer {
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new WireRenderer instance.
|
|
40
|
+
*
|
|
41
|
+
* @param {AppBase} app - The application.
|
|
42
|
+
* @example
|
|
43
|
+
* const wire = new WireRenderer(app);
|
|
44
|
+
*/
|
|
45
|
+
constructor(app: Color);
|
|
46
|
+
/**
|
|
47
|
+
* The color used by shapes, specified in sRGB color space. The alpha component is respected.
|
|
48
|
+
* Defaults to white.
|
|
49
|
+
*
|
|
50
|
+
* @type {Color}
|
|
51
|
+
*/
|
|
52
|
+
color: Color;
|
|
53
|
+
/**
|
|
54
|
+
* The layer shapes are rendered into, or null to use the {@link LAYERID_IMMEDIATE} layer.
|
|
55
|
+
* Defaults to null.
|
|
56
|
+
*
|
|
57
|
+
* @type {Layer|null}
|
|
58
|
+
*/
|
|
59
|
+
layer: Color | null;
|
|
60
|
+
/**
|
|
61
|
+
* Whether shapes are depth tested against the depth buffer. Defaults to true.
|
|
62
|
+
*
|
|
63
|
+
* @type {boolean}
|
|
64
|
+
*/
|
|
65
|
+
depthTest: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The number of line segments used to approximate a full circle. Defaults to 20.
|
|
68
|
+
*
|
|
69
|
+
* @type {number}
|
|
70
|
+
*/
|
|
71
|
+
segments: number;
|
|
72
|
+
/**
|
|
73
|
+
* A matrix applied to every point of every shape, or null for no transform. Assign this to
|
|
74
|
+
* draw a group of shapes in the local space of a node. Defaults to null.
|
|
75
|
+
*
|
|
76
|
+
* @type {Mat4|null}
|
|
77
|
+
*/
|
|
78
|
+
transform: Mat4 | null;
|
|
79
|
+
app: AppBase;
|
|
80
|
+
/** @private */
|
|
81
|
+
private _scene;
|
|
82
|
+
/** @private */
|
|
83
|
+
private _immediate;
|
|
84
|
+
/**
|
|
85
|
+
* Cursor for the shape currently being written, valid only for the duration of one call.
|
|
86
|
+
*
|
|
87
|
+
* @type {LineWriter|null}
|
|
88
|
+
* @private
|
|
89
|
+
*/
|
|
90
|
+
private _writer;
|
|
91
|
+
/**
|
|
92
|
+
* Allocates room for a shape and points the cursor at it. The count must match exactly what
|
|
93
|
+
* the shape goes on to write.
|
|
94
|
+
*
|
|
95
|
+
* @param {number} vertexCount - The number of vertices the shape writes. Two per segment.
|
|
96
|
+
* @ignore
|
|
97
|
+
*/
|
|
98
|
+
_begin(vertexCount: number): void;
|
|
99
|
+
/**
|
|
100
|
+
* @returns {number} The circle segment count, clamped to a usable range.
|
|
101
|
+
* @ignore
|
|
102
|
+
*/
|
|
103
|
+
_steps(): number;
|
|
104
|
+
/**
|
|
105
|
+
* Writes a single segment, applying {@link WireRenderer#transform}.
|
|
106
|
+
*
|
|
107
|
+
* @param {number} x0 - The start x coordinate.
|
|
108
|
+
* @param {number} y0 - The start y coordinate.
|
|
109
|
+
* @param {number} z0 - The start z coordinate.
|
|
110
|
+
* @param {number} x1 - The end x coordinate.
|
|
111
|
+
* @param {number} y1 - The end y coordinate.
|
|
112
|
+
* @param {number} z1 - The end z coordinate.
|
|
113
|
+
* @ignore
|
|
114
|
+
*/
|
|
115
|
+
_segment(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number): void;
|
|
116
|
+
/**
|
|
117
|
+
* Writes a single vertex with its own color, applying {@link WireRenderer#transform}.
|
|
118
|
+
*
|
|
119
|
+
* @param {number} x - The x coordinate.
|
|
120
|
+
* @param {number} y - The y coordinate.
|
|
121
|
+
* @param {number} z - The z coordinate.
|
|
122
|
+
* @param {Color} color - The color of the vertex.
|
|
123
|
+
* @ignore
|
|
124
|
+
*/
|
|
125
|
+
_vertex(x: number, y: number, z: number, color: Color): void;
|
|
126
|
+
/**
|
|
127
|
+
* Appends a circular arc lying in the plane spanned by the two supplied tangents.
|
|
128
|
+
*
|
|
129
|
+
* @param {Vec3} center - The center of the arc.
|
|
130
|
+
* @param {Vec3} u - The first tangent of the arc plane, normalized.
|
|
131
|
+
* @param {Vec3} v - The second tangent of the arc plane, normalized.
|
|
132
|
+
* @param {number} radius - The radius of the arc.
|
|
133
|
+
* @param {number} steps - The number of segments used by the arc.
|
|
134
|
+
* @param {number} [start] - The start angle in radians. Defaults to 0.
|
|
135
|
+
* @param {number} [sweep] - The swept angle in radians. Defaults to a full circle.
|
|
136
|
+
* @ignore
|
|
137
|
+
*/
|
|
138
|
+
_arc(center: Vec3, u: Vec3, v: Vec3, radius: number, steps: number, start?: number, sweep?: number): void;
|
|
139
|
+
/**
|
|
140
|
+
* Writes a list of points, expanding a strip into discrete segments when requested.
|
|
141
|
+
*
|
|
142
|
+
* @param {Vec3[]} positions - The points to write.
|
|
143
|
+
* @param {Color[]|undefined} colors - One color per point, or undefined to use
|
|
144
|
+
* {@link WireRenderer#color}.
|
|
145
|
+
* @param {boolean} strip - True to connect consecutive points, false to treat them as pairs.
|
|
146
|
+
* @param {boolean} closed - True to also connect the last point back to the first. Only used
|
|
147
|
+
* when `strip` is true.
|
|
148
|
+
* @ignore
|
|
149
|
+
*/
|
|
150
|
+
_writePoints(positions: Vec3[], colors: Color[] | undefined, strip: boolean, closed: boolean): void;
|
|
151
|
+
/**
|
|
152
|
+
* Renders a single line segment.
|
|
153
|
+
*
|
|
154
|
+
* @param {Vec3} start - The start of the line, in world space.
|
|
155
|
+
* @param {Vec3} end - The end of the line, in world space.
|
|
156
|
+
* @example
|
|
157
|
+
* wire.line(new Vec3(0, 0, 0), new Vec3(0, 1, 0));
|
|
158
|
+
*/
|
|
159
|
+
line(start: Vec3, end: Vec3): void;
|
|
160
|
+
/**
|
|
161
|
+
* Renders discrete line segments, formed by consecutive pairs of points.
|
|
162
|
+
*
|
|
163
|
+
* @param {Vec3[]} positions - The points to draw lines between. The length must be a multiple
|
|
164
|
+
* of two.
|
|
165
|
+
* @param {Color[]} [colors] - One color per point, or undefined to use
|
|
166
|
+
* {@link WireRenderer#color}. The color of each segment is interpolated between its ends.
|
|
167
|
+
* @example
|
|
168
|
+
* wire.lines([start, end], [Color.RED, Color.WHITE]);
|
|
169
|
+
*/
|
|
170
|
+
lines(positions: Vec3[], colors?: Color[]): void;
|
|
171
|
+
/**
|
|
172
|
+
* Renders discrete line segments from packed arrays of numbers. This is the fastest of the
|
|
173
|
+
* line functions, as it avoids reading individual {@link Vec3} and {@link Color} instances.
|
|
174
|
+
*
|
|
175
|
+
* @param {number[]|Float32Array} positions - Packed xyz coordinates, forming pairs of points.
|
|
176
|
+
* @param {number[]|Float32Array} [colors] - Packed rgba values, one color per point, or
|
|
177
|
+
* undefined to use {@link WireRenderer#color}.
|
|
178
|
+
* @example
|
|
179
|
+
* wire.linesPacked([0, 0, 0, 0, 1, 0]);
|
|
180
|
+
*/
|
|
181
|
+
linesPacked(positions: number[] | Float32Array, colors?: number[] | Float32Array): void;
|
|
182
|
+
/**
|
|
183
|
+
* Renders an open strip of connected line segments.
|
|
184
|
+
*
|
|
185
|
+
* @param {Vec3[]} positions - The points of the strip, in order.
|
|
186
|
+
* @param {Color[]} [colors] - One color per point, or undefined to use
|
|
187
|
+
* {@link WireRenderer#color}.
|
|
188
|
+
* @example
|
|
189
|
+
* wire.polyline(trajectory);
|
|
190
|
+
*/
|
|
191
|
+
polyline(positions: Vec3[], colors?: Color[]): void;
|
|
192
|
+
/**
|
|
193
|
+
* Renders a closed strip of connected line segments, joining the last point back to the first.
|
|
194
|
+
*
|
|
195
|
+
* @param {Vec3[]} positions - The points of the loop, in order.
|
|
196
|
+
* @param {Color[]} [colors] - One color per point, or undefined to use
|
|
197
|
+
* {@link WireRenderer#color}.
|
|
198
|
+
* @example
|
|
199
|
+
* wire.loop(outline);
|
|
200
|
+
*/
|
|
201
|
+
loop(positions: Vec3[], colors?: Color[]): void;
|
|
202
|
+
/**
|
|
203
|
+
* Renders the edges of a box specified by its min and max corners.
|
|
204
|
+
*
|
|
205
|
+
* @param {Vec3} min - The min corner of the box.
|
|
206
|
+
* @param {Vec3} max - The max corner of the box.
|
|
207
|
+
* @example
|
|
208
|
+
* wire.boxMinMax(new Vec3(-1, -1, -1), new Vec3(1, 1, 1));
|
|
209
|
+
*/
|
|
210
|
+
boxMinMax(min: Vec3, max: Vec3): void;
|
|
211
|
+
/**
|
|
212
|
+
* Renders the edges of a bounding box. An {@link OrientedBox} is rendered in its own
|
|
213
|
+
* orientation, composed with {@link WireRenderer#transform}.
|
|
214
|
+
*
|
|
215
|
+
* @param {BoundingBox|OrientedBox} box - The box to render.
|
|
216
|
+
* @example
|
|
217
|
+
* wire.box(meshInstance.aabb);
|
|
218
|
+
*/
|
|
219
|
+
box(box: Color | Color): void;
|
|
220
|
+
/**
|
|
221
|
+
* Renders a sphere as three great circles, one in each of the primary planes.
|
|
222
|
+
*
|
|
223
|
+
* @param {Vec3} center - The center of the sphere.
|
|
224
|
+
* @param {number} radius - The radius of the sphere.
|
|
225
|
+
* @example
|
|
226
|
+
* wire.sphere(new Vec3(0, 1, 0), 0.5);
|
|
227
|
+
*/
|
|
228
|
+
sphere(center: Vec3, radius: number): void;
|
|
229
|
+
/**
|
|
230
|
+
* Renders a circle lying in the plane described by a normal.
|
|
231
|
+
*
|
|
232
|
+
* @param {Vec3} center - The center of the circle.
|
|
233
|
+
* @param {Vec3} normal - The normal of the plane containing the circle. Need not be
|
|
234
|
+
* normalized.
|
|
235
|
+
* @param {number} radius - The radius of the circle.
|
|
236
|
+
* @example
|
|
237
|
+
* wire.circle(Vec3.ZERO, Vec3.UP, 5);
|
|
238
|
+
*/
|
|
239
|
+
circle(center: Vec3, normal: Vec3, radius: number): void;
|
|
240
|
+
/**
|
|
241
|
+
* Renders a cylinder as a ring at each end joined by four side lines.
|
|
242
|
+
*
|
|
243
|
+
* @param {Vec3} start - The center of the start cap.
|
|
244
|
+
* @param {Vec3} end - The center of the end cap.
|
|
245
|
+
* @param {number} radius - The radius of the cylinder.
|
|
246
|
+
* @example
|
|
247
|
+
* wire.cylinder(base, tip, 0.5);
|
|
248
|
+
*/
|
|
249
|
+
cylinder(start: Vec3, end: Vec3, radius: number): void;
|
|
250
|
+
/**
|
|
251
|
+
* Appends the four longitudinal lines joining two rings, using the basis in `_u` and `_v`.
|
|
252
|
+
*
|
|
253
|
+
* @param {Vec3} start - The center of the start ring.
|
|
254
|
+
* @param {Vec3} end - The center of the end ring.
|
|
255
|
+
* @param {number} radius - The radius of both rings.
|
|
256
|
+
* @ignore
|
|
257
|
+
*/
|
|
258
|
+
_sideLines(start: Vec3, end: Vec3, radius: number): void;
|
|
259
|
+
/**
|
|
260
|
+
* Renders a capsule as a ring and hemispherical cap at each end, joined by four side lines.
|
|
261
|
+
*
|
|
262
|
+
* @param {Vec3} start - The center of the start cap sphere.
|
|
263
|
+
* @param {Vec3} end - The center of the end cap sphere.
|
|
264
|
+
* @param {number} radius - The radius of the capsule.
|
|
265
|
+
* @example
|
|
266
|
+
* wire.capsule(feet, head, 0.4);
|
|
267
|
+
*/
|
|
268
|
+
capsule(start: Vec3, end: Vec3, radius: number): void;
|
|
269
|
+
/**
|
|
270
|
+
* Renders a cone as a base ring joined to its apex by four side lines. The parameters match
|
|
271
|
+
* those describing a spot light, so a light's cone can be visualized directly.
|
|
272
|
+
*
|
|
273
|
+
* @param {Vec3} apex - The tip of the cone.
|
|
274
|
+
* @param {Vec3} direction - The direction the cone opens along. Need not be normalized.
|
|
275
|
+
* @param {number} angle - The half-angle of the cone, in degrees, measured from `direction` to
|
|
276
|
+
* the cone edge.
|
|
277
|
+
* @param {number} length - The distance from the apex to the base.
|
|
278
|
+
* @example
|
|
279
|
+
* wire.cone(position, direction, 30, 10);
|
|
280
|
+
*/
|
|
281
|
+
cone(apex: Vec3, direction: Vec3, angle: number, length: number): void;
|
|
282
|
+
/**
|
|
283
|
+
* Renders a square section of a plane, with a short stub along its normal.
|
|
284
|
+
*
|
|
285
|
+
* The rotation of the square within its plane is derived from the normal, and no such
|
|
286
|
+
* derivation is continuous over all directions. An animated normal will therefore make the
|
|
287
|
+
* square appear to jump as it passes the direction where the derivation switches. To rotate a
|
|
288
|
+
* square smoothly, pass a fixed normal and drive {@link WireRenderer#transform} instead.
|
|
289
|
+
*
|
|
290
|
+
* @param {Vec3} center - The center of the square.
|
|
291
|
+
* @param {Vec3} normal - The normal of the plane. Need not be normalized.
|
|
292
|
+
* @param {number} size - The side length of the square.
|
|
293
|
+
* @example
|
|
294
|
+
* wire.plane(Vec3.ZERO, Vec3.UP, 10);
|
|
295
|
+
*/
|
|
296
|
+
plane(center: Vec3, normal: Vec3, size: number): void;
|
|
297
|
+
/**
|
|
298
|
+
* Renders a small axis-aligned cross marking a position.
|
|
299
|
+
*
|
|
300
|
+
* @param {Vec3} position - The position to mark.
|
|
301
|
+
* @param {number} size - The overall length of each arm of the cross.
|
|
302
|
+
* @example
|
|
303
|
+
* wire.point(hit.point, 0.2);
|
|
304
|
+
*/
|
|
305
|
+
point(position: Vec3, size: number): void;
|
|
306
|
+
/**
|
|
307
|
+
* Renders an arrow, as a shaft with four barbs at its tip.
|
|
308
|
+
*
|
|
309
|
+
* @param {Vec3} from - The tail of the arrow.
|
|
310
|
+
* @param {Vec3} to - The tip of the arrow.
|
|
311
|
+
* @example
|
|
312
|
+
* wire.arrow(position, position.clone().add(velocity));
|
|
313
|
+
*/
|
|
314
|
+
arrow(from: Vec3, to: Vec3): void;
|
|
315
|
+
/**
|
|
316
|
+
* Renders the three axes of a matrix, colored red, green and blue for x, y and z respectively.
|
|
317
|
+
* This function ignores {@link WireRenderer#color}.
|
|
318
|
+
*
|
|
319
|
+
* @param {Mat4} matrix - The transform whose axes are rendered.
|
|
320
|
+
* @param {number} size - The length of each axis.
|
|
321
|
+
* @example
|
|
322
|
+
* wire.axes(entity.getWorldTransform(), 1);
|
|
323
|
+
*/
|
|
324
|
+
axes(matrix: Mat4, size: number): void;
|
|
325
|
+
/**
|
|
326
|
+
* Renders the edges of a view frustum. The camera does not need to be enabled or rendering,
|
|
327
|
+
* so the view volume of an inactive camera can be visualized.
|
|
328
|
+
*
|
|
329
|
+
* @param {CameraComponent|Mat4} source - A camera, or a view-projection matrix.
|
|
330
|
+
* @example
|
|
331
|
+
* wire.frustum(otherCamera.camera);
|
|
332
|
+
*/
|
|
333
|
+
frustum(source: Color | Mat4): void;
|
|
334
|
+
/**
|
|
335
|
+
* Renders the shape and extent of a light, using the light's own color. An omni light is drawn
|
|
336
|
+
* as a sphere of its range, a spot light as its cone, and a directional light as an arrow
|
|
337
|
+
* showing the direction it shines in. A light shines along the negative y-axis of its entity,
|
|
338
|
+
* so the shape follows that axis rather than the entity's forward direction.
|
|
339
|
+
*
|
|
340
|
+
* @param {LightComponent} light - The light to render.
|
|
341
|
+
* @param {number} [size] - The length of the arrow used for a directional light, which has no
|
|
342
|
+
* inherent extent. Defaults to 1.
|
|
343
|
+
* @example
|
|
344
|
+
* wire.light(entity.light);
|
|
345
|
+
*/
|
|
346
|
+
light(light: Color, size?: number): void;
|
|
347
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A script class found, with where it was found and the instances of it.
|
|
3
|
+
*/
|
|
4
|
+
export type ScriptEntry = {
|
|
5
|
+
/**
|
|
6
|
+
* - The name the script is known by.
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* - Whether the app's script registry holds it.
|
|
11
|
+
*/
|
|
12
|
+
registered: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* - Its instances, with the
|
|
15
|
+
* entities they are on.
|
|
16
|
+
*/
|
|
17
|
+
instances: {
|
|
18
|
+
script: Script | ScriptType;
|
|
19
|
+
entity: Script;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Everything the property view shows for a script class: what it is and declares, the entities
|
|
24
|
+
* using it, each instance opening in place into its attributes, and its source.
|
|
25
|
+
*
|
|
26
|
+
* @param {Function} cls - The script class.
|
|
27
|
+
* @param {{ app: AppBase }} ctx - The app.
|
|
28
|
+
* @returns {PropertySection[]} The sections.
|
|
29
|
+
*/
|
|
30
|
+
export function buildScriptModel(cls: Function, ctx: {
|
|
31
|
+
app: Script;
|
|
32
|
+
}): PropertySection[];
|
|
33
|
+
/**
|
|
34
|
+
* @param {Function} cls - A class.
|
|
35
|
+
* @returns {boolean} Whether it is a script class, of either kind.
|
|
36
|
+
*/
|
|
37
|
+
export function isScriptClass(cls: Function): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* One row per script class, by name, dimmed when no entity uses it.
|
|
40
|
+
*
|
|
41
|
+
* @param {Map<Function, ScriptEntry>} survey - The script classes found.
|
|
42
|
+
* @returns {ListRow[]} The rows.
|
|
43
|
+
*/
|
|
44
|
+
export function scriptListRows(survey: Map<Function, ScriptEntry>): ListRow[];
|
|
45
|
+
/**
|
|
46
|
+
* Finds the script classes of the app: those the script registry holds, which are the ones loaded
|
|
47
|
+
* from script assets or declared with `createScript`, and the classes of the script instances on
|
|
48
|
+
* the entities of the hierarchy, which add the classes created on an entity straight from their
|
|
49
|
+
* class and never registered.
|
|
50
|
+
*
|
|
51
|
+
* @param {AppBase} app - The app.
|
|
52
|
+
* @returns {Map<Function, ScriptEntry>} The script classes, the registered ones first.
|
|
53
|
+
*/
|
|
54
|
+
export function surveyScripts(app: Script): Map<Function, ScriptEntry>;
|
|
55
|
+
import type { PropertySection } from './model.js';
|
|
56
|
+
import type { ListRow } from './list-view.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the property view shows for a shader: identity and state, every kept version of its
|
|
3
|
+
* sources, the bind group layouts it was processed against, its vertex attributes, and every
|
|
4
|
+
* other public property.
|
|
5
|
+
*
|
|
6
|
+
* @param {Shader} shader - The shader.
|
|
7
|
+
* @returns {PropertySection[]} The sections.
|
|
8
|
+
*/
|
|
9
|
+
export function buildShaderModel(shader: bindGroupNames): PropertySection[];
|
|
10
|
+
/**
|
|
11
|
+
* Every shader alive on the device, in creation order. A shader whose definition had no source
|
|
12
|
+
* never reached the device and is not listed; one that failed to compile is.
|
|
13
|
+
*
|
|
14
|
+
* @param {GraphicsDevice} device - The device.
|
|
15
|
+
* @returns {Shader[]} The shaders.
|
|
16
|
+
*/
|
|
17
|
+
export function collectShaders(device: bindGroupNames): bindGroupNames[];
|
|
18
|
+
/**
|
|
19
|
+
* Lays out a bind group format as text: its uniform buffers, textures and storage resources with
|
|
20
|
+
* their slots and the stages that can see them.
|
|
21
|
+
*
|
|
22
|
+
* @param {BindGroupFormat} format - The format.
|
|
23
|
+
* @returns {string} The layout.
|
|
24
|
+
*/
|
|
25
|
+
export function formatBindGroup(format: bindGroupNames): string;
|
|
26
|
+
/**
|
|
27
|
+
* Lays out a uniform buffer format as text: the std140 offsets, sizes and types of its uniforms.
|
|
28
|
+
*
|
|
29
|
+
* @param {UniformBufferFormat} format - The format.
|
|
30
|
+
* @returns {string} The layout.
|
|
31
|
+
*/
|
|
32
|
+
export function formatUniformBuffer(format: bindGroupNames): string;
|
|
33
|
+
/**
|
|
34
|
+
* One row per shader on the device, tagged with its language, compute shaders and failures.
|
|
35
|
+
*
|
|
36
|
+
* @param {GraphicsDevice} device - The device.
|
|
37
|
+
* @returns {ListRow[]} The rows.
|
|
38
|
+
*/
|
|
39
|
+
export function shaderRows(device: bindGroupNames): ListRow[];
|
|
40
|
+
/**
|
|
41
|
+
* @param {Shader} shader - A shader.
|
|
42
|
+
* @returns {string} The compilation state: 'failed', 'ready' or 'compiling'.
|
|
43
|
+
*/
|
|
44
|
+
export function stateName(shader: bindGroupNames): string;
|
|
45
|
+
import type { PropertySection } from './model.js';
|
|
46
|
+
import type { ListRow } from './list-view.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The same tones brighter, for the brackets of the lists. A bracket is the only thing telling which
|
|
3
|
+
* rows belong together there, so it has to read without indentation to back it up.
|
|
4
|
+
*
|
|
5
|
+
* @type {string[]}
|
|
6
|
+
*/
|
|
7
|
+
export const BRACKET_COLORS: string[];
|
|
8
|
+
/**
|
|
9
|
+
* One muted tone per nesting level, cycling, for the indent guides of the property view, so a
|
|
10
|
+
* nested row can be read back to its parent.
|
|
11
|
+
*
|
|
12
|
+
* @type {string[]}
|
|
13
|
+
*/
|
|
14
|
+
export const INDENT_COLORS: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Stylesheet for the entity inspector panel. Injected into the panel's shadow root, so nothing
|
|
17
|
+
* here leaks into the page and nothing in the page leaks in. Its palette matches the examples
|
|
18
|
+
* browser.
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
export const styles: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the property view shows for a texture: its storage, the render targets it is attached
|
|
3
|
+
* to (linked), and every other public property.
|
|
4
|
+
*
|
|
5
|
+
* @param {Texture} texture - The texture.
|
|
6
|
+
* @param {{ device: GraphicsDevice, app?: AppBase }} ctx - The device, and the app to find the
|
|
7
|
+
* asset the texture was loaded from.
|
|
8
|
+
* @returns {PropertySection[]} The sections.
|
|
9
|
+
*/
|
|
10
|
+
export function buildTextureModel(texture: ADDRESS_CLAMP_TO_EDGE, ctx: {
|
|
11
|
+
device: ADDRESS_CLAMP_TO_EDGE;
|
|
12
|
+
app?: ADDRESS_CLAMP_TO_EDGE;
|
|
13
|
+
}): PropertySection[];
|
|
14
|
+
/**
|
|
15
|
+
* Every texture alive on the device, largest GPU footprint first. The device keeps a registry of
|
|
16
|
+
* the textures created on it, so this covers textures nothing rendered this frame too.
|
|
17
|
+
*
|
|
18
|
+
* @param {GraphicsDevice} device - The device.
|
|
19
|
+
* @returns {Texture[]} The textures.
|
|
20
|
+
*/
|
|
21
|
+
export function collectTextures(device: ADDRESS_CLAMP_TO_EDGE): ADDRESS_CLAMP_TO_EDGE[];
|
|
22
|
+
/**
|
|
23
|
+
* One row per texture on the device, largest first, tagged when it is a render target attachment.
|
|
24
|
+
*
|
|
25
|
+
* @param {GraphicsDevice} device - The device.
|
|
26
|
+
* @returns {ListRow[]} The rows.
|
|
27
|
+
*/
|
|
28
|
+
export function textureRows(device: ADDRESS_CLAMP_TO_EDGE): ListRow[];
|
|
29
|
+
import type { PropertySection } from './model.js';
|
|
30
|
+
import type { ListRow } from './list-view.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shows the tooltip of whatever the pointer rests on in the panel, below it, or above it when
|
|
3
|
+
* there is no room below. The tooltip element lives in the panel, so it moves with the panel into
|
|
4
|
+
* a popped-out window.
|
|
5
|
+
*
|
|
6
|
+
* @param {HTMLElement} panel - The panel.
|
|
7
|
+
*/
|
|
8
|
+
export function installTooltip(panel: HTMLElement): void;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the tooltip of an element of the panel. It is kept in a data attribute, not the title:
|
|
11
|
+
* the browser's own tooltip shows only after a long rest, and some hosts do not show it at all
|
|
12
|
+
* for elements in a shadow root.
|
|
13
|
+
*
|
|
14
|
+
* @param {HTMLElement} element - The element.
|
|
15
|
+
* @param {string} text - The tooltip, or an empty string for none.
|
|
16
|
+
*/
|
|
17
|
+
export function setTip(element: HTMLElement, text: string): void;
|