@playcanvas/inspector 0.1.0 → 0.2.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 +13 -25
- package/package.json +12 -6
- package/src/describe.js +31 -1
- package/types/asset-usage.d.ts +2 -0
- package/types/asset-view.d.ts +14 -9
- package/types/camera-view.d.ts +8 -6
- package/types/describe.d.ts +2 -1
- package/types/entity-inspector-script.d.ts +2 -2
- package/types/frame-graph-view.d.ts +6 -2
- package/types/hierarchy-view.d.ts +12 -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 +3 -1
- package/types/instance-survey.d.ts +3 -1
- package/types/material-view.d.ts +10 -5
- package/types/memory-view.d.ts +16 -8
- package/types/mesh-view.d.ts +9 -4
- package/types/model.d.ts +6 -3
- package/types/node-model.d.ts +14 -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/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 +7 -3
- package/types/shader-view.d.ts +10 -6
- package/types/texture-view.d.ts +8 -5
- package/types/viewport-tools.d.ts +25 -18
package/types/texture-view.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* asset the texture was loaded from.
|
|
8
8
|
* @returns {PropertySection[]} The sections.
|
|
9
9
|
*/
|
|
10
|
-
export function buildTextureModel(texture:
|
|
11
|
-
device:
|
|
12
|
-
app?:
|
|
10
|
+
export function buildTextureModel(texture: Texture, ctx: {
|
|
11
|
+
device: GraphicsDevice;
|
|
12
|
+
app?: AppBase;
|
|
13
13
|
}): PropertySection[];
|
|
14
14
|
/**
|
|
15
15
|
* Every texture alive on the device, largest GPU footprint first. The device keeps a registry of
|
|
@@ -18,13 +18,16 @@ export function buildTextureModel(texture: ADDRESS_CLAMP_TO_EDGE, ctx: {
|
|
|
18
18
|
* @param {GraphicsDevice} device - The device.
|
|
19
19
|
* @returns {Texture[]} The textures.
|
|
20
20
|
*/
|
|
21
|
-
export function collectTextures(device:
|
|
21
|
+
export function collectTextures(device: GraphicsDevice): Texture[];
|
|
22
22
|
/**
|
|
23
23
|
* One row per texture on the device, largest first, tagged when it is a render target attachment.
|
|
24
24
|
*
|
|
25
25
|
* @param {GraphicsDevice} device - The device.
|
|
26
26
|
* @returns {ListRow[]} The rows.
|
|
27
27
|
*/
|
|
28
|
-
export function textureRows(device:
|
|
28
|
+
export function textureRows(device: GraphicsDevice): ListRow[];
|
|
29
|
+
import type { Texture } from 'playcanvas';
|
|
30
|
+
import type { GraphicsDevice } from 'playcanvas';
|
|
31
|
+
import type { AppBase } from 'playcanvas';
|
|
29
32
|
import type { PropertySection } from './model.js';
|
|
30
33
|
import type { ListRow } from './list-view.js';
|
|
@@ -34,9 +34,9 @@ export class CameraOrbit extends CameraDrive {
|
|
|
34
34
|
* @param {GraphNode} target - The node to orbit around.
|
|
35
35
|
* @param {() => void} onEnd - Called when the orbit ends from the keyboard.
|
|
36
36
|
*/
|
|
37
|
-
constructor(app:
|
|
37
|
+
constructor(app: AppBase, camera: CameraComponent, target: GraphNode, onEnd: () => void);
|
|
38
38
|
/** @type {GraphNode} */
|
|
39
|
-
target:
|
|
39
|
+
target: GraphNode;
|
|
40
40
|
/** @type {OrbitController} */
|
|
41
41
|
_controller: OrbitController;
|
|
42
42
|
/** @type {InputFrame<{ move: number[], rotate: number[] }>} */
|
|
@@ -47,9 +47,9 @@ export class CameraOrbit extends CameraDrive {
|
|
|
47
47
|
/** The pose drawn last, for a change of target to turn from. */
|
|
48
48
|
_pose: Pose;
|
|
49
49
|
/** The center of the target's bounds, relative to its position. */
|
|
50
|
-
_center:
|
|
50
|
+
_center: Vec3;
|
|
51
51
|
/** Where the orbit was centered last frame, to follow the target by. */
|
|
52
|
-
_focus:
|
|
52
|
+
_focus: Vec3;
|
|
53
53
|
/** @type {'orbit'|'pan'|null} */
|
|
54
54
|
_drag: "orbit" | "pan" | null;
|
|
55
55
|
_lastX: number;
|
|
@@ -59,7 +59,7 @@ export class CameraOrbit extends CameraDrive {
|
|
|
59
59
|
*
|
|
60
60
|
* @param {GraphNode} target - The node to orbit around.
|
|
61
61
|
*/
|
|
62
|
-
setTarget(target:
|
|
62
|
+
setTarget(target: GraphNode): void;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Takes the pointer events on the canvas ahead of the app's own handlers, for a mode of the
|
|
@@ -88,7 +88,7 @@ export class CanvasCapture {
|
|
|
88
88
|
* The shader passes a camera can render with, as the editor offers them: the lit scene, and the
|
|
89
89
|
* debug views of the standard material's inputs.
|
|
90
90
|
*/
|
|
91
|
-
export const RENDER_MODES:
|
|
91
|
+
export const RENDER_MODES: string[][];
|
|
92
92
|
/**
|
|
93
93
|
* Picks the entity under the pointer, through the screen camera whose viewport holds it, the way
|
|
94
94
|
* the editor picks: an id buffer the size of the canvas is rendered for that camera, which draws
|
|
@@ -98,9 +98,9 @@ export class ViewportPicker {
|
|
|
98
98
|
/**
|
|
99
99
|
* @param {AppBase} app - The app.
|
|
100
100
|
*/
|
|
101
|
-
constructor(app:
|
|
101
|
+
constructor(app: AppBase);
|
|
102
102
|
/** @type {AppBase} */
|
|
103
|
-
app:
|
|
103
|
+
app: AppBase;
|
|
104
104
|
/** @type {Picker|null} */
|
|
105
105
|
_picker: Picker | null;
|
|
106
106
|
/**
|
|
@@ -117,8 +117,8 @@ export class ViewportPicker {
|
|
|
117
117
|
*/
|
|
118
118
|
pick(clientX: number, clientY: number): Promise<{
|
|
119
119
|
entity: Entity;
|
|
120
|
-
instance:
|
|
121
|
-
camera:
|
|
120
|
+
instance: MeshInstance;
|
|
121
|
+
camera: CameraComponent;
|
|
122
122
|
} | null>;
|
|
123
123
|
/**
|
|
124
124
|
* @param {number} clientX - The pointer, in client pixels.
|
|
@@ -137,11 +137,11 @@ export class ViewportPicker {
|
|
|
137
137
|
*/
|
|
138
138
|
export class WireframeMode {
|
|
139
139
|
/** @type {Map<MeshInstance, number>} */
|
|
140
|
-
_styles: Map<
|
|
140
|
+
_styles: Map<MeshInstance, number>;
|
|
141
141
|
/**
|
|
142
142
|
* @param {AppBase} app - The app, whose mesh instances to draw in wireframe.
|
|
143
143
|
*/
|
|
144
|
-
apply(app:
|
|
144
|
+
apply(app: AppBase): void;
|
|
145
145
|
/** Puts back the render style of every mesh instance drawn in wireframe. */
|
|
146
146
|
restore(): void;
|
|
147
147
|
}
|
|
@@ -149,7 +149,7 @@ export class WireframeMode {
|
|
|
149
149
|
* @param {CameraComponent} camera - A camera.
|
|
150
150
|
* @returns {boolean} Whether it draws to the screen, the ones a pointer can be over.
|
|
151
151
|
*/
|
|
152
|
-
export function isScreenCamera(camera:
|
|
152
|
+
export function isScreenCamera(camera: CameraComponent): boolean;
|
|
153
153
|
/**
|
|
154
154
|
* The screen camera whose viewport holds a point of the canvas, the last one drawn when several
|
|
155
155
|
* overlap, which is the one on top.
|
|
@@ -159,7 +159,7 @@ export function isScreenCamera(camera: BoundingBox): boolean;
|
|
|
159
159
|
* @param {number} y - The point, as a fraction of the canvas height from its top edge.
|
|
160
160
|
* @returns {CameraComponent|null} The camera, or null when no camera draws there.
|
|
161
161
|
*/
|
|
162
|
-
export function screenCameraAt(app:
|
|
162
|
+
export function screenCameraAt(app: AppBase, x: number, y: number): CameraComponent | null;
|
|
163
163
|
/**
|
|
164
164
|
* Drives a camera the app keeps drawing with, from the inspector's own input. The app may move the
|
|
165
165
|
* camera itself, from a script or from code of its own, so the camera is not taken over: its
|
|
@@ -178,15 +178,15 @@ declare class CameraDrive {
|
|
|
178
178
|
* @param {CameraComponent} camera - The camera to drive.
|
|
179
179
|
* @param {() => void} onEnd - Called when the drive ends from the keyboard.
|
|
180
180
|
*/
|
|
181
|
-
constructor(app:
|
|
181
|
+
constructor(app: AppBase, camera: CameraComponent, onEnd: () => void);
|
|
182
182
|
/** @type {AppBase} */
|
|
183
|
-
app:
|
|
183
|
+
app: AppBase;
|
|
184
184
|
/** @type {CameraComponent} */
|
|
185
|
-
camera:
|
|
185
|
+
camera: CameraComponent;
|
|
186
186
|
/** @type {{ position: Vec3, rotation: Quat, fov: number, orthoHeight: number }|null} */
|
|
187
187
|
_saved: {
|
|
188
188
|
position: Vec3;
|
|
189
|
-
rotation:
|
|
189
|
+
rotation: Quat;
|
|
190
190
|
fov: number;
|
|
191
191
|
orthoHeight: number;
|
|
192
192
|
} | null;
|
|
@@ -232,6 +232,13 @@ declare class CameraDrive {
|
|
|
232
232
|
import { FlyController } from './input/fly-controller.js';
|
|
233
233
|
import { InputFrame } from './input/input.js';
|
|
234
234
|
import { Pose } from './input/pose.js';
|
|
235
|
+
import type { GraphNode } from 'playcanvas';
|
|
235
236
|
import { OrbitController } from './input/orbit-controller.js';
|
|
237
|
+
import { Vec3 } from 'playcanvas';
|
|
238
|
+
import type { AppBase } from 'playcanvas';
|
|
239
|
+
import type { CameraComponent } from 'playcanvas';
|
|
236
240
|
import { Picker } from './picker/picker.js';
|
|
241
|
+
import { Entity } from 'playcanvas';
|
|
242
|
+
import type { MeshInstance } from 'playcanvas';
|
|
243
|
+
import type { Quat } from 'playcanvas';
|
|
237
244
|
export {};
|