@playcanvas/inspector 0.1.0 → 0.3.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 +47 -26
- package/package.json +12 -6
- package/src/asset-view.js +24 -17
- package/src/camera-view.js +5 -3
- package/src/context-menu.js +231 -0
- package/src/copy-json.js +692 -0
- package/src/describe.js +51 -2
- package/src/frame-graph-view.js +1 -0
- package/src/hierarchy-view.js +29 -3
- package/src/inspector.js +406 -59
- package/src/list-view.js +118 -12
- package/src/material-view.js +7 -6
- package/src/memory-view.js +224 -66
- package/src/mesh-view.js +6 -5
- package/src/model.js +24 -2
- package/src/node-model.js +78 -9
- package/src/property-view.js +159 -5
- package/src/render-target-view.js +3 -3
- package/src/script-view.js +21 -12
- package/src/styles.js +196 -2
- package/src/texture-view.js +4 -4
- package/src/transform-tool.js +185 -0
- package/types/asset-usage.d.ts +2 -0
- package/types/asset-view.d.ts +17 -10
- package/types/camera-view.d.ts +12 -6
- package/types/context-menu.d.ts +90 -0
- package/types/copy-json.d.ts +69 -0
- package/types/describe.d.ts +3 -2
- package/types/entity-inspector-script.d.ts +2 -2
- package/types/frame-graph-view.d.ts +6 -2
- package/types/hierarchy-view.d.ts +25 -11
- package/types/input/fly-controller.d.ts +4 -4
- package/types/input/input.d.ts +2 -2
- package/types/input/orbit-controller.d.ts +6 -6
- package/types/input/pose.d.ts +9 -7
- package/types/inspector.d.ts +144 -22
- package/types/instance-survey.d.ts +3 -1
- package/types/list-view.d.ts +44 -3
- package/types/material-view.d.ts +13 -6
- package/types/memory-view.d.ts +37 -30
- package/types/mesh-view.d.ts +12 -5
- package/types/model.d.ts +21 -3
- package/types/node-model.d.ts +30 -6
- package/types/physics-debug.d.ts +9 -5
- package/types/physics-view.d.ts +8 -6
- package/types/picker/picker.d.ts +15 -6
- package/types/picker/render-pass-picker.d.ts +16 -10
- package/types/property-view.d.ts +41 -0
- package/types/render-target-view.d.ts +10 -7
- package/types/renderers/texture-renderer-shaders.d.ts +1 -1
- package/types/renderers/texture-renderer.d.ts +11 -5
- package/types/renderers/wire-renderer.d.ts +14 -5
- package/types/script-view.d.ts +10 -4
- package/types/shader-view.d.ts +10 -6
- package/types/texture-view.d.ts +8 -5
- package/types/transform-tool.d.ts +92 -0
- package/types/viewport-tools.d.ts +25 -18
package/types/material-view.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type MaterialSources = {
|
|
|
5
5
|
/**
|
|
6
6
|
* - The material assets holding it.
|
|
7
7
|
*/
|
|
8
|
-
assets:
|
|
8
|
+
assets: Asset[];
|
|
9
9
|
/**
|
|
10
10
|
* - The layers whose debug lines draw with it.
|
|
11
11
|
*/
|
|
@@ -16,11 +16,13 @@ export type MaterialSources = {
|
|
|
16
16
|
* properties, and what uses it, with each mesh instance opening in place.
|
|
17
17
|
*
|
|
18
18
|
* @param {Material} material - The material.
|
|
19
|
-
* @param {{ app: AppBase }} ctx - The app, to find the assets and debug lines
|
|
19
|
+
* @param {{ app: AppBase, backlinks?: boolean }} ctx - The app, to find the assets and debug lines
|
|
20
|
+
* using the material, and whether to find them at all, which a copy has no use for.
|
|
20
21
|
* @returns {PropertySection[]} The sections.
|
|
21
22
|
*/
|
|
22
23
|
export function buildMaterialModel(material: Material, ctx: {
|
|
23
|
-
app:
|
|
24
|
+
app: AppBase;
|
|
25
|
+
backlinks?: boolean;
|
|
24
26
|
}): PropertySection[];
|
|
25
27
|
/**
|
|
26
28
|
* One row per material found, the most used first, dimmed when no mesh instance uses it.
|
|
@@ -34,13 +36,13 @@ export function materialListRows(survey: Map<Material, MaterialSources>): ListRo
|
|
|
34
36
|
* @param {Shader} shader - A shader.
|
|
35
37
|
* @returns {Material[]} The materials found that compiled it as one of their variants.
|
|
36
38
|
*/
|
|
37
|
-
export function materialsUsingShader(app:
|
|
39
|
+
export function materialsUsingShader(app: AppBase, shader: Shader): Material[];
|
|
38
40
|
/**
|
|
39
41
|
* @param {AppBase} app - The app.
|
|
40
42
|
* @param {Texture} texture - A texture.
|
|
41
43
|
* @returns {Material[]} The materials found that sample it.
|
|
42
44
|
*/
|
|
43
|
-
export function materialsUsingTexture(app:
|
|
45
|
+
export function materialsUsingTexture(app: AppBase, texture: Texture): Material[];
|
|
44
46
|
/**
|
|
45
47
|
* Finds the materials of the app. Nothing keeps a list of them, so they are found through what
|
|
46
48
|
* uses them: the mesh instances of the components and layers, see {@link collectMeshInstances},
|
|
@@ -53,11 +55,16 @@ export function materialsUsingTexture(app: Material, texture: Material): Materia
|
|
|
53
55
|
* @returns {Map<Material, MaterialSources>} The materials, in the order found, with the assets and
|
|
54
56
|
* debug lines using each.
|
|
55
57
|
*/
|
|
56
|
-
export function surveyMaterials(app:
|
|
58
|
+
export function surveyMaterials(app: AppBase): Map<Material, MaterialSources>;
|
|
57
59
|
/**
|
|
58
60
|
* @param {Material[]} materials - The materials using something.
|
|
59
61
|
* @returns {PropertySection} A section listing them, each linking to the Materials tab.
|
|
60
62
|
*/
|
|
61
63
|
export function usedByMaterialsSection(materials: Material[]): PropertySection;
|
|
64
|
+
import type { Asset } from 'playcanvas';
|
|
65
|
+
import { Material } from 'playcanvas';
|
|
66
|
+
import type { AppBase } from 'playcanvas';
|
|
62
67
|
import type { PropertySection } from './model.js';
|
|
63
68
|
import type { ListRow } from './list-view.js';
|
|
69
|
+
import type { Shader } from 'playcanvas';
|
|
70
|
+
import type { Texture } from 'playcanvas';
|
package/types/memory-view.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Buffer = VertexBuffer | IndexBuffer |
|
|
1
|
+
export type Buffer = VertexBuffer | IndexBuffer | UniformBuffer | StorageBuffer;
|
|
2
2
|
/**
|
|
3
3
|
* Something a buffer was found to belong to.
|
|
4
4
|
*/
|
|
@@ -15,15 +15,8 @@ export type BufferOwner = {
|
|
|
15
15
|
* - What to link to, or null when there is nothing to
|
|
16
16
|
* show.
|
|
17
17
|
*/
|
|
18
|
-
target:
|
|
18
|
+
target: GraphNode | Asset | Material | null;
|
|
19
19
|
};
|
|
20
|
-
/** What the list can be narrowed to, as selector options. */
|
|
21
|
-
export const BUFFER_KINDS: string[][];
|
|
22
|
-
/**
|
|
23
|
-
* @param {Buffer} buffer - A buffer.
|
|
24
|
-
* @returns {number} Its size in bytes.
|
|
25
|
-
*/
|
|
26
|
-
export function bufferBytes(buffer: Buffer): number;
|
|
27
20
|
/**
|
|
28
21
|
* @param {*} buffer - A buffer.
|
|
29
22
|
* @returns {'vertex'|'index'|'uniform'|'storage'|null} Its kind, or null for anything else.
|
|
@@ -41,55 +34,69 @@ export function bufferKind(buffer: any): "vertex" | "index" | "uniform" | "stora
|
|
|
41
34
|
* @param {AppBase} app - The app.
|
|
42
35
|
* @returns {Map<Buffer, BufferOwner[]>} The owners of each attributed buffer.
|
|
43
36
|
*/
|
|
44
|
-
export function bufferOwners(app:
|
|
45
|
-
/**
|
|
46
|
-
* One row per buffer, largest first, named after what uses it and dimmed when nothing was found.
|
|
47
|
-
*
|
|
48
|
-
* @param {GraphicsDevice} device - The device.
|
|
49
|
-
* @param {Map<Buffer, BufferOwner[]>} owners - The owners of each buffer.
|
|
50
|
-
* @param {string} kind - The kind to list, or 'all'.
|
|
51
|
-
* @returns {ListRow[]} The rows.
|
|
52
|
-
*/
|
|
53
|
-
export function bufferRows(device: BUFFER_DYNAMIC, owners: Map<Buffer, BufferOwner[]>, kind: string): ListRow[];
|
|
37
|
+
export function bufferOwners(app: AppBase): Map<Buffer, BufferOwner[]>;
|
|
54
38
|
/**
|
|
55
39
|
* Everything the property view shows for a buffer: its size and layout, what it was found to
|
|
56
40
|
* belong to (linked), and every other public property.
|
|
57
41
|
*
|
|
58
42
|
* @param {Buffer} buffer - The buffer.
|
|
59
|
-
* @param {{ app: AppBase }} ctx - The app, to find the buffer's owners
|
|
43
|
+
* @param {{ app: AppBase, backlinks?: boolean }} ctx - The app, to find the buffer's owners, and
|
|
44
|
+
* whether to find them at all, which a copy has no use for.
|
|
60
45
|
* @returns {PropertySection[]} The sections.
|
|
61
46
|
*/
|
|
62
47
|
export function buildBufferModel(buffer: Buffer, ctx: {
|
|
63
|
-
app:
|
|
48
|
+
app: AppBase;
|
|
49
|
+
backlinks?: boolean;
|
|
64
50
|
}): PropertySection[];
|
|
65
51
|
/**
|
|
66
52
|
* Every buffer the device tracks, largest first. Uniform buffers appear only when persistent, as
|
|
67
|
-
* the rest are slices of the per-
|
|
53
|
+
* the rest are slices of the per-draw pool.
|
|
68
54
|
*
|
|
69
55
|
* @param {GraphicsDevice} device - The device.
|
|
70
|
-
* @param {
|
|
56
|
+
* @param {'all'|'vertex'|'index'|'uniform'|'storage'} [kind] - The kind to collect.
|
|
71
57
|
* @returns {Buffer[]} The buffers.
|
|
72
58
|
*/
|
|
73
|
-
export function collectBuffers(device:
|
|
59
|
+
export function collectBuffers(device: GraphicsDevice, kind?: "all" | "vertex" | "index" | "uniform" | "storage"): Buffer[];
|
|
74
60
|
/**
|
|
75
61
|
* @param {Buffer} buffer - A buffer.
|
|
76
62
|
* @returns {number} An id that stays the same for the lifetime of the buffer, since buffers carry
|
|
77
63
|
* no name of their own.
|
|
78
64
|
*/
|
|
79
65
|
export function idOf(buffer: Buffer): number;
|
|
66
|
+
export namespace KIND_NAMES {
|
|
67
|
+
let vertex: string;
|
|
68
|
+
let index: string;
|
|
69
|
+
let uniform: string;
|
|
70
|
+
let storage: string;
|
|
71
|
+
}
|
|
80
72
|
/**
|
|
81
|
-
* The
|
|
82
|
-
* and
|
|
73
|
+
* The rows of the memory list: one group per kind of resource, headed by its count and total size
|
|
74
|
+
* and closed until opened, holding its buffers largest first, named after what uses each. The
|
|
75
|
+
* device caches come last. Kinds with nothing on the device are left out.
|
|
83
76
|
*
|
|
84
77
|
* @param {GraphicsDevice} device - The device.
|
|
85
|
-
* @
|
|
78
|
+
* @param {Map<Buffer, BufferOwner[]>} owners - The owners of each buffer.
|
|
79
|
+
* @returns {ListRow[]} The rows.
|
|
86
80
|
*/
|
|
87
|
-
export function
|
|
81
|
+
export function memoryRows(device: GraphicsDevice, owners: Map<Buffer, BufferOwner[]>): ListRow[];
|
|
88
82
|
/**
|
|
89
83
|
* @param {GraphNode|null} node - The node a mesh instance draws at.
|
|
90
84
|
* @returns {string} Its name, after its parent's when it has one below the root: imported models
|
|
91
85
|
* often give every mesh node the same name, and the parent tells them apart.
|
|
92
86
|
*/
|
|
93
|
-
export function nodeLabel(node:
|
|
94
|
-
|
|
87
|
+
export function nodeLabel(node: GraphNode | null): string;
|
|
88
|
+
/**
|
|
89
|
+
* @param {GraphicsDevice} device - The device.
|
|
90
|
+
* @returns {number} The video memory the device counts for its textures and buffers.
|
|
91
|
+
*/
|
|
92
|
+
export function videoMemory(device: GraphicsDevice): number;
|
|
93
|
+
import { VertexBuffer } from 'playcanvas';
|
|
94
|
+
import { IndexBuffer } from 'playcanvas';
|
|
95
|
+
import { StorageBuffer } from 'playcanvas';
|
|
96
|
+
import type { GraphNode } from 'playcanvas';
|
|
97
|
+
import type { Asset } from 'playcanvas';
|
|
98
|
+
import type { Material } from 'playcanvas';
|
|
99
|
+
import type { AppBase } from 'playcanvas';
|
|
95
100
|
import type { PropertySection } from './model.js';
|
|
101
|
+
import type { GraphicsDevice } from 'playcanvas';
|
|
102
|
+
import type { ListRow } from './list-view.js';
|
package/types/mesh-view.d.ts
CHANGED
|
@@ -13,11 +13,11 @@ export type MeshUser = {
|
|
|
13
13
|
/**
|
|
14
14
|
* - What to link to, or null when there is nothing to show.
|
|
15
15
|
*/
|
|
16
|
-
target:
|
|
16
|
+
target: GraphNode | Asset | null;
|
|
17
17
|
/**
|
|
18
18
|
* - The mesh instance drawing the mesh, when there is one.
|
|
19
19
|
*/
|
|
20
|
-
instance:
|
|
20
|
+
instance: MeshInstance | null;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* The meshes found, with what uses each, and how complete the search was.
|
|
@@ -47,11 +47,13 @@ export type MeshSurvey = {
|
|
|
47
47
|
* format, and what uses it, with each mesh instance opening in place.
|
|
48
48
|
*
|
|
49
49
|
* @param {Mesh} mesh - The mesh.
|
|
50
|
-
* @param {{ app: AppBase }} ctx - The app, to find the mesh's users
|
|
50
|
+
* @param {{ app: AppBase, backlinks?: boolean }} ctx - The app, to find the mesh's users, and
|
|
51
|
+
* whether to find them at all, which a copy has no use for.
|
|
51
52
|
* @returns {PropertySection[]} The sections.
|
|
52
53
|
*/
|
|
53
54
|
export function buildMeshModel(mesh: Mesh, ctx: {
|
|
54
|
-
app:
|
|
55
|
+
app: AppBase;
|
|
56
|
+
backlinks?: boolean;
|
|
55
57
|
}): PropertySection[];
|
|
56
58
|
/**
|
|
57
59
|
* @param {Mesh} mesh - A mesh.
|
|
@@ -84,6 +86,11 @@ export function meshNote(survey: MeshSurvey): string;
|
|
|
84
86
|
* @param {AppBase} app - The app.
|
|
85
87
|
* @returns {MeshSurvey} The meshes and what uses them.
|
|
86
88
|
*/
|
|
87
|
-
export function surveyMeshes(app:
|
|
89
|
+
export function surveyMeshes(app: AppBase): MeshSurvey;
|
|
90
|
+
import type { GraphNode } from 'playcanvas';
|
|
91
|
+
import type { Asset } from 'playcanvas';
|
|
92
|
+
import type { MeshInstance } from 'playcanvas';
|
|
93
|
+
import { Mesh } from 'playcanvas';
|
|
94
|
+
import type { AppBase } from 'playcanvas';
|
|
88
95
|
import type { PropertySection } from './model.js';
|
|
89
96
|
import type { ListRow } from './list-view.js';
|
package/types/model.d.ts
CHANGED
|
@@ -5,7 +5,14 @@ export type PropertySection = object;
|
|
|
5
5
|
* @param {GraphicsDevice} device - The device, to recognize the backbuffer.
|
|
6
6
|
* @returns {string} The attachments in the trace's notation, e.g. `[C×2][D][S]`.
|
|
7
7
|
*/
|
|
8
|
-
export function attachmentsText(rt:
|
|
8
|
+
export function attachmentsText(rt: RenderTarget, device: GraphicsDevice): string;
|
|
9
|
+
/**
|
|
10
|
+
* Marks a value as referring back to what holds or uses the subject, which copies leave out.
|
|
11
|
+
*
|
|
12
|
+
* @param {Described} value - The value.
|
|
13
|
+
* @returns {Described} The same value.
|
|
14
|
+
*/
|
|
15
|
+
export function backlink(value: Described): Described;
|
|
9
16
|
/**
|
|
10
17
|
* @param {number} bytes - A byte count.
|
|
11
18
|
* @returns {string} The count in the largest unit that keeps it above one, with two decimals.
|
|
@@ -37,6 +44,8 @@ export function formatName(format: number | undefined): string;
|
|
|
37
44
|
* @property {string} title - The title.
|
|
38
45
|
* @property {PropertyRow[]} rows - The rows.
|
|
39
46
|
* @property {boolean} [collapsed] - Whether the section starts out collapsed.
|
|
47
|
+
* @property {boolean} [backlink] - Whether the section lists what uses the subject, which copies
|
|
48
|
+
* leave out, see {@link Described#backlink}.
|
|
40
49
|
*/
|
|
41
50
|
/**
|
|
42
51
|
* @param {string} key - The section key.
|
|
@@ -45,6 +54,12 @@ export function formatName(format: number | undefined): string;
|
|
|
45
54
|
* @returns {PropertySection} An empty section.
|
|
46
55
|
*/
|
|
47
56
|
export function makeSection(key: string, title: string, collapsed?: boolean): PropertySection;
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} key - The section key.
|
|
59
|
+
* @param {string} title - The section title.
|
|
60
|
+
* @returns {PropertySection} An empty section listing what uses the subject, which copies leave out.
|
|
61
|
+
*/
|
|
62
|
+
export function makeUsageSection(key: string, title: string): PropertySection;
|
|
48
63
|
/**
|
|
49
64
|
* Passes are named after their class unless given a name, so the class-family prefix carries no
|
|
50
65
|
* information in a list of passes.
|
|
@@ -52,7 +67,7 @@ export function makeSection(key: string, title: string, collapsed?: boolean): Pr
|
|
|
52
67
|
* @param {FramePass} pass - The pass.
|
|
53
68
|
* @returns {string} The name without a leading 'RenderPass' or 'FramePass'.
|
|
54
69
|
*/
|
|
55
|
-
export function passDisplayName(pass:
|
|
70
|
+
export function passDisplayName(pass: FramePass): string;
|
|
56
71
|
/**
|
|
57
72
|
* Appends a row to a section, followed by one indented row per expanded collection entry.
|
|
58
73
|
*
|
|
@@ -100,5 +115,8 @@ export function reflectRows(section: PropertySection, obj: object, stopPrototype
|
|
|
100
115
|
* @param {GraphicsDevice} device - The device, to recognize the backbuffer.
|
|
101
116
|
* @returns {string} A one-line summary: name, size, attachments, samples and mip level.
|
|
102
117
|
*/
|
|
103
|
-
export function renderTargetSummary(rt:
|
|
118
|
+
export function renderTargetSummary(rt: RenderTarget | null, device: GraphicsDevice): string;
|
|
119
|
+
import type { RenderTarget } from 'playcanvas';
|
|
120
|
+
import type { GraphicsDevice } from 'playcanvas';
|
|
104
121
|
import type { Described } from './describe.js';
|
|
122
|
+
import type { FramePass } from 'playcanvas';
|
package/types/node-model.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sections a component shows under its entity, for a component reached on its own, such as
|
|
3
|
+
* through a link.
|
|
4
|
+
*
|
|
5
|
+
* @param {Component} component - The component.
|
|
6
|
+
* @returns {PropertySection[]} Its section, followed by one per script instance of a script component.
|
|
7
|
+
*/
|
|
8
|
+
export function buildComponentModel(component: Component): PropertySection[];
|
|
1
9
|
/**
|
|
2
10
|
* Everything the property view shows for a node: identity, transform, one section per component
|
|
3
11
|
* and one per script instance. A component's mesh instances open in place, each into its own
|
|
@@ -6,7 +14,7 @@
|
|
|
6
14
|
* @param {GraphNode} node - The node.
|
|
7
15
|
* @returns {PropertySection[]} The sections.
|
|
8
16
|
*/
|
|
9
|
-
export function buildNodeModel(node:
|
|
17
|
+
export function buildNodeModel(node: GraphNode): PropertySection[];
|
|
10
18
|
/**
|
|
11
19
|
* The layers a component renders in. Components hold them as ids, which say nothing on their own,
|
|
12
20
|
* so each is named from the scene's layer composition.
|
|
@@ -15,12 +23,12 @@ export function buildNodeModel(node: Component): PropertySection[];
|
|
|
15
23
|
* @param {LayerComposition|null} composition - The scene's composition.
|
|
16
24
|
* @returns {Described} The layers, named.
|
|
17
25
|
*/
|
|
18
|
-
export function layersValue(ids: number[], composition:
|
|
26
|
+
export function layersValue(ids: number[], composition: LayerComposition | null): Described;
|
|
19
27
|
/**
|
|
20
28
|
* @param {Material} material - A material.
|
|
21
29
|
* @returns {PropertyRow[]} Its rows, textures and compiled variants linking to their tabs.
|
|
22
30
|
*/
|
|
23
|
-
export function materialRows(material:
|
|
31
|
+
export function materialRows(material: Material): PropertyRow[];
|
|
24
32
|
/**
|
|
25
33
|
* The textures a material samples: those set on its properties, such as the maps of a
|
|
26
34
|
* StandardMaterial, and those set as parameters, which is how a ShaderMaterial carries them.
|
|
@@ -28,7 +36,7 @@ export function materialRows(material: Component): PropertyRow[];
|
|
|
28
36
|
* @param {Material} material - A material.
|
|
29
37
|
* @returns {Set<Texture>} The textures.
|
|
30
38
|
*/
|
|
31
|
-
export function materialTextures(material:
|
|
39
|
+
export function materialTextures(material: Material): Set<Texture>;
|
|
32
40
|
/**
|
|
33
41
|
* @param {MeshInstance} instance - A mesh instance.
|
|
34
42
|
* @returns {PropertyRow[]} Its rows, with the mesh and the material linking to their tabs.
|
|
@@ -38,17 +46,33 @@ export function meshInstanceRows(instance: MeshInstance): PropertyRow[];
|
|
|
38
46
|
* @param {Mesh} mesh - A mesh.
|
|
39
47
|
* @returns {PropertyRow[]} Its rows, with the vertex format opening into its elements.
|
|
40
48
|
*/
|
|
41
|
-
export function meshRows(mesh:
|
|
49
|
+
export function meshRows(mesh: Mesh): PropertyRow[];
|
|
42
50
|
/**
|
|
43
51
|
* @param {ScriptType|Script} script - A script instance.
|
|
44
52
|
* @returns {PropertyRow[]} Its rows: whether it is enabled, then its attributes.
|
|
45
53
|
*/
|
|
46
54
|
export function scriptInstanceRows(script: ScriptType | Script): PropertyRow[];
|
|
55
|
+
/**
|
|
56
|
+
* Moves the physics body of a node to where the node now is. A dynamic or kinematic body would
|
|
57
|
+
* otherwise put the node back where the body is on the next step of the simulation.
|
|
58
|
+
*
|
|
59
|
+
* @param {GraphNode} node - A node whose transform was changed.
|
|
60
|
+
*/
|
|
61
|
+
export function syncBody(node: GraphNode): void;
|
|
47
62
|
/**
|
|
48
63
|
* @param {import('playcanvas').VertexFormat} format - A vertex format.
|
|
49
64
|
* @returns {Described} The format, expanding into one row per element.
|
|
50
65
|
*/
|
|
51
|
-
export function vertexFormatValue(format:
|
|
66
|
+
export function vertexFormatValue(format: import("playcanvas").VertexFormat): Described;
|
|
67
|
+
import { Component } from 'playcanvas';
|
|
52
68
|
import type { PropertySection } from './model.js';
|
|
69
|
+
import type { GraphNode } from 'playcanvas';
|
|
70
|
+
import type { LayerComposition } from 'playcanvas';
|
|
53
71
|
import type { Described } from './describe.js';
|
|
72
|
+
import type { Material } from 'playcanvas';
|
|
54
73
|
import type { PropertyRow } from './model.js';
|
|
74
|
+
import { Texture } from 'playcanvas';
|
|
75
|
+
import { MeshInstance } from 'playcanvas';
|
|
76
|
+
import type { Mesh } from 'playcanvas';
|
|
77
|
+
import { ScriptType } from 'playcanvas';
|
|
78
|
+
import { Script } from 'playcanvas';
|
package/types/physics-debug.d.ts
CHANGED
|
@@ -28,18 +28,18 @@ export class AmmoDebugDraw {
|
|
|
28
28
|
* @param {AppBase} app - The app.
|
|
29
29
|
* @returns {boolean} True when {@link attach} would succeed.
|
|
30
30
|
*/
|
|
31
|
-
static isAvailable(app:
|
|
31
|
+
static isAvailable(app: AppBase): boolean;
|
|
32
32
|
/**
|
|
33
33
|
* @param {AppBase} app - The app.
|
|
34
34
|
* @param {WireRenderer} [wire] - The renderer to draw through. Defaults to a new one.
|
|
35
35
|
*/
|
|
36
|
-
constructor(app:
|
|
36
|
+
constructor(app: AppBase, wire?: WireRenderer);
|
|
37
37
|
/**
|
|
38
38
|
* The app whose rigid body system is drawn.
|
|
39
39
|
*
|
|
40
40
|
* @type {AppBase}
|
|
41
41
|
*/
|
|
42
|
-
app:
|
|
42
|
+
app: AppBase;
|
|
43
43
|
/**
|
|
44
44
|
* The renderer the lines go through. Its layer and depth test are applied on every flush from
|
|
45
45
|
* {@link depthTest} and {@link layer}.
|
|
@@ -72,7 +72,7 @@ export class AmmoDebugDraw {
|
|
|
72
72
|
*
|
|
73
73
|
* @type {Layer|null}
|
|
74
74
|
*/
|
|
75
|
-
layer:
|
|
75
|
+
layer: Layer | null;
|
|
76
76
|
/**
|
|
77
77
|
* Only lines within this distance of {@link center} are drawn, in meters. Zero draws everything.
|
|
78
78
|
*
|
|
@@ -96,7 +96,7 @@ export class AmmoDebugDraw {
|
|
|
96
96
|
*
|
|
97
97
|
* @type {Color|null}
|
|
98
98
|
*/
|
|
99
|
-
color:
|
|
99
|
+
color: Color | null;
|
|
100
100
|
/**
|
|
101
101
|
* The number of line segments drawn by the last {@link update}.
|
|
102
102
|
*
|
|
@@ -251,4 +251,8 @@ export const DEBUG_DRAW: {
|
|
|
251
251
|
NORMALS: number;
|
|
252
252
|
FRAMES: number;
|
|
253
253
|
};
|
|
254
|
+
import type { AppBase } from 'playcanvas';
|
|
254
255
|
import { WireRenderer } from './renderers/wire-renderer.js';
|
|
256
|
+
import type { Layer } from 'playcanvas';
|
|
257
|
+
import { Vec3 } from 'playcanvas';
|
|
258
|
+
import type { Color } from 'playcanvas';
|
package/types/physics-view.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ export type PhysicsStats = {
|
|
|
38
38
|
* @param {boolean} drawing - Whether the world is drawn at all; the checkboxes are disabled otherwise.
|
|
39
39
|
* @returns {ListRow[]} The rows.
|
|
40
40
|
*/
|
|
41
|
-
export function bodyRows(app:
|
|
42
|
-
has: (entity:
|
|
41
|
+
export function bodyRows(app: AppBase, hidden: {
|
|
42
|
+
has: (entity: Entity) => boolean;
|
|
43
43
|
}, drawing: boolean): ListRow[];
|
|
44
44
|
/**
|
|
45
45
|
* Outlines an entity's primitive collision shape where the physics engine has it: at the entity's
|
|
@@ -50,7 +50,7 @@ export function bodyRows(app: BODYTYPE_DYNAMIC, hidden: {
|
|
|
50
50
|
* @param {Entity} entity - The entity.
|
|
51
51
|
* @returns {boolean} False when the entity has no primitive collision shape to outline.
|
|
52
52
|
*/
|
|
53
|
-
export function drawCollisionShape(wire: WireRenderer, entity:
|
|
53
|
+
export function drawCollisionShape(wire: WireRenderer, entity: Entity): boolean;
|
|
54
54
|
/**
|
|
55
55
|
* Outlines a joint. The joint entity's own frame is drawn as axes, and for each connected body the
|
|
56
56
|
* joint frame the constraint was created with is drawn where that body currently carries it: axes
|
|
@@ -63,7 +63,7 @@ export function drawCollisionShape(wire: WireRenderer, entity: BODYTYPE_DYNAMIC)
|
|
|
63
63
|
* @param {number} size - The axis length.
|
|
64
64
|
* @returns {boolean} False when the entity has no joint component.
|
|
65
65
|
*/
|
|
66
|
-
export function drawJoint(wire: WireRenderer, entity:
|
|
66
|
+
export function drawJoint(wire: WireRenderer, entity: Entity, size: number): boolean;
|
|
67
67
|
/**
|
|
68
68
|
* One row per joint: name linking to the entity, the joint type, the two bodies it connects as
|
|
69
69
|
* links, and whether it has broken. Joints without a second body are attached to the world.
|
|
@@ -71,11 +71,13 @@ export function drawJoint(wire: WireRenderer, entity: BODYTYPE_DYNAMIC, size: nu
|
|
|
71
71
|
* @param {AppBase} app - The app.
|
|
72
72
|
* @returns {ListRow[]} The rows.
|
|
73
73
|
*/
|
|
74
|
-
export function jointRows(app:
|
|
74
|
+
export function jointRows(app: AppBase): ListRow[];
|
|
75
75
|
/**
|
|
76
76
|
* @param {AppBase} app - The app.
|
|
77
77
|
* @returns {PhysicsStats} Counts for the status bar.
|
|
78
78
|
*/
|
|
79
|
-
export function physicsStats(app:
|
|
79
|
+
export function physicsStats(app: AppBase): PhysicsStats;
|
|
80
|
+
import type { AppBase } from 'playcanvas';
|
|
81
|
+
import type { Entity } from 'playcanvas';
|
|
80
82
|
import type { ListRow } from './list-view.js';
|
|
81
83
|
import type { WireRenderer } from './renderers/wire-renderer.js';
|
package/types/picker/picker.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export class Picker {
|
|
|
53
53
|
* @param {boolean} [depth] - Whether to enable depth picking. When enabled, depth
|
|
54
54
|
* information is captured alongside mesh IDs using MRT. Defaults to false.
|
|
55
55
|
*/
|
|
56
|
-
constructor(app:
|
|
56
|
+
constructor(app: AppBase, width: number, height: number, depth?: boolean);
|
|
57
57
|
/**
|
|
58
58
|
* @type {import('playcanvas').GraphicsDevice}
|
|
59
59
|
* @private
|
|
@@ -139,7 +139,7 @@ export class Picker {
|
|
|
139
139
|
* // Get all models in rectangle with corners at (10,20) and (20,40)
|
|
140
140
|
* const selection = picker.getSelection(10, 20, 10, 20);
|
|
141
141
|
*/
|
|
142
|
-
getSelection(x: number, y: number, width?: number, height?: number): (
|
|
142
|
+
getSelection(x: number, y: number, width?: number, height?: number): (MeshInstance | GSplatComponent)[];
|
|
143
143
|
/**
|
|
144
144
|
* Return the list of mesh instances selected by the specified rectangle in the previously
|
|
145
145
|
* prepared pick buffer. The rectangle uses top-left coordinate system.
|
|
@@ -158,7 +158,7 @@ export class Picker {
|
|
|
158
158
|
* console.log(meshInstances);
|
|
159
159
|
* });
|
|
160
160
|
*/
|
|
161
|
-
getSelectionAsync(x: number, y: number, width?: number, height?: number): Promise<(
|
|
161
|
+
getSelectionAsync(x: number, y: number, width?: number, height?: number): Promise<(MeshInstance | GSplatComponent)[]>;
|
|
162
162
|
/**
|
|
163
163
|
* Helper method to read pixels from a texture asynchronously.
|
|
164
164
|
*
|
|
@@ -224,9 +224,9 @@ export class Picker {
|
|
|
224
224
|
* @private
|
|
225
225
|
*/
|
|
226
226
|
private _sanitizeFlippedRect;
|
|
227
|
-
sanitizeRect(x: any, y: any, width: any, height: any):
|
|
227
|
+
sanitizeRect(x: any, y: any, width: any, height: any): Vec4;
|
|
228
228
|
decodePixels(pixels: any, mapping: any): any[];
|
|
229
|
-
createTexture(name: any):
|
|
229
|
+
createTexture(name: any): Texture;
|
|
230
230
|
allocateRenderTarget(): void;
|
|
231
231
|
releaseRenderTarget(): void;
|
|
232
232
|
/**
|
|
@@ -240,7 +240,7 @@ export class Picker {
|
|
|
240
240
|
* @param {Layer[]} [layers] - Layers from which objects will be picked. If not supplied, all
|
|
241
241
|
* layers of the specified camera will be used.
|
|
242
242
|
*/
|
|
243
|
-
prepare(camera:
|
|
243
|
+
prepare(camera: CameraComponent, scene: Scene, layers?: Layer[]): void;
|
|
244
244
|
/**
|
|
245
245
|
* Sets the resolution of the pick buffer. The pick buffer resolution does not need to match
|
|
246
246
|
* the resolution of the corresponding frame buffer use for general rendering of the 3D scene.
|
|
@@ -253,3 +253,12 @@ export class Picker {
|
|
|
253
253
|
*/
|
|
254
254
|
resize(width: number, height: number): void;
|
|
255
255
|
}
|
|
256
|
+
import type { MeshInstance } from 'playcanvas';
|
|
257
|
+
import type { GSplatComponent } from 'playcanvas';
|
|
258
|
+
import { Vec3 } from 'playcanvas';
|
|
259
|
+
import { Vec4 } from 'playcanvas';
|
|
260
|
+
import { Texture } from 'playcanvas';
|
|
261
|
+
import type { CameraComponent } from 'playcanvas';
|
|
262
|
+
import type { Scene } from 'playcanvas';
|
|
263
|
+
import { Layer } from 'playcanvas';
|
|
264
|
+
import type { AppBase } from 'playcanvas';
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @ignore
|
|
5
5
|
*/
|
|
6
|
-
export class RenderPassPicker {
|
|
6
|
+
export class RenderPassPicker extends RenderPass {
|
|
7
7
|
constructor(device: any, renderer: any);
|
|
8
8
|
/** @type {BlendState} */
|
|
9
9
|
blendState: BlendState;
|
|
10
10
|
/** @type {CameraComponent} */
|
|
11
|
-
camera:
|
|
11
|
+
camera: CameraComponent;
|
|
12
12
|
/** @type {Scene} */
|
|
13
|
-
scene:
|
|
13
|
+
scene: Scene;
|
|
14
14
|
/** @type {Layer[]} */
|
|
15
|
-
layers:
|
|
15
|
+
layers: Layer[];
|
|
16
16
|
/** @type {Map<number, MeshInstance | GSplatComponent>} */
|
|
17
|
-
mapping: Map<number,
|
|
17
|
+
mapping: Map<number, MeshInstance | GSplatComponent>;
|
|
18
18
|
/** @type {boolean} */
|
|
19
19
|
depth: boolean;
|
|
20
20
|
/** @type {number[]} */
|
|
21
21
|
_qualifiedLayerIndices: number[];
|
|
22
22
|
/** @type {Map<number, MeshInstance|null>} */
|
|
23
|
-
_pickMeshInstances: Map<number,
|
|
23
|
+
_pickMeshInstances: Map<number, MeshInstance | null>;
|
|
24
24
|
/**
|
|
25
25
|
* Minimal view uniform format used by the picker. The pick shaders only need the view
|
|
26
26
|
* projection (and the view matrix for depth picking); any other view uniform a shader happens
|
|
@@ -32,7 +32,7 @@ export class RenderPassPicker {
|
|
|
32
32
|
*/
|
|
33
33
|
_viewUniformFormat: UniformBufferFormat | null;
|
|
34
34
|
renderer: any;
|
|
35
|
-
getViewUniformFormat():
|
|
35
|
+
getViewUniformFormat(): UniformBufferFormat;
|
|
36
36
|
/**
|
|
37
37
|
* @param {CameraComponent} camera - The camera component used for picking.
|
|
38
38
|
* @param {Scene} scene - The scene to pick from.
|
|
@@ -40,8 +40,14 @@ export class RenderPassPicker {
|
|
|
40
40
|
* @param {Map<number, MeshInstance | GSplatComponent>} mapping - Map to store ID to object mappings.
|
|
41
41
|
* @param {boolean} depth - Whether to render depth information.
|
|
42
42
|
*/
|
|
43
|
-
update(camera:
|
|
43
|
+
update(camera: CameraComponent, scene: Scene, layers: Layer[], mapping: Map<number, MeshInstance | GSplatComponent>, depth: boolean): void;
|
|
44
44
|
emptyWorldClusters: any;
|
|
45
|
-
before(): void;
|
|
46
|
-
execute(): void;
|
|
47
45
|
}
|
|
46
|
+
import { RenderPass } from 'playcanvas';
|
|
47
|
+
import { BlendState } from 'playcanvas';
|
|
48
|
+
import type { CameraComponent } from 'playcanvas';
|
|
49
|
+
import type { Scene } from 'playcanvas';
|
|
50
|
+
import type { Layer } from 'playcanvas';
|
|
51
|
+
import type { MeshInstance } from 'playcanvas';
|
|
52
|
+
import type { GSplatComponent } from 'playcanvas';
|
|
53
|
+
import { UniformBufferFormat } from 'playcanvas';
|
package/types/property-view.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Something a context menu of the panel can copy.
|
|
3
|
+
*/
|
|
4
|
+
export type CopyTarget = object;
|
|
1
5
|
export type RowElements = object;
|
|
2
6
|
export type SectionElements = object;
|
|
3
7
|
/**
|
|
@@ -98,6 +102,13 @@ export class PropertyView {
|
|
|
98
102
|
* @private
|
|
99
103
|
*/
|
|
100
104
|
private _emptyEl;
|
|
105
|
+
/**
|
|
106
|
+
* The rows and sections by the elements showing them, to find what a menu was opened on.
|
|
107
|
+
*
|
|
108
|
+
* @type {WeakMap<Element, RowElements|SectionElements>}
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
111
|
+
private _byElement;
|
|
101
112
|
/**
|
|
102
113
|
* The subject being shown.
|
|
103
114
|
*
|
|
@@ -124,6 +135,20 @@ export class PropertyView {
|
|
|
124
135
|
* @private
|
|
125
136
|
*/
|
|
126
137
|
private _loadScroll;
|
|
138
|
+
/**
|
|
139
|
+
* What a copy made from an element of the panel copies: the row or the section title the
|
|
140
|
+
* element is in, and anywhere else the subject itself.
|
|
141
|
+
*
|
|
142
|
+
* @param {Node} node - The element, such as the target of a context menu event.
|
|
143
|
+
* @returns {CopyTarget|null} What to copy, or null when the element is not in the panel or
|
|
144
|
+
* nothing is shown.
|
|
145
|
+
*/
|
|
146
|
+
copyTargetAt(node: Node): CopyTarget | null;
|
|
147
|
+
/**
|
|
148
|
+
* @returns {CopyTarget|null} A copy of the subject, rebuilt when it is made so it reads the
|
|
149
|
+
* live object, or null when nothing is shown.
|
|
150
|
+
*/
|
|
151
|
+
subjectCopyTarget(): CopyTarget | null;
|
|
127
152
|
/**
|
|
128
153
|
* Re-reads every shown property and updates the text that changed.
|
|
129
154
|
*/
|
|
@@ -185,5 +210,21 @@ export class PropertyView {
|
|
|
185
210
|
* @private
|
|
186
211
|
*/
|
|
187
212
|
private _createRow;
|
|
213
|
+
/**
|
|
214
|
+
* Opens the text field of an editable value. Enter hands the text to the edit and closes the
|
|
215
|
+
* field once the edit takes it, or marks the text as not taken; leaving the field does the
|
|
216
|
+
* same, and gives up on text that is not taken; Escape closes it without a change.
|
|
217
|
+
*
|
|
218
|
+
* @param {RowElements} elements - The row.
|
|
219
|
+
* @private
|
|
220
|
+
*/
|
|
221
|
+
private _startEdit;
|
|
222
|
+
/**
|
|
223
|
+
* Closes the text field of a value, which shows its text again on the next refresh.
|
|
224
|
+
*
|
|
225
|
+
* @param {RowElements} elements - The row.
|
|
226
|
+
* @private
|
|
227
|
+
*/
|
|
228
|
+
private _endEdit;
|
|
188
229
|
}
|
|
189
230
|
import type { PropertySection } from './model.js';
|