vis-core 0.33.7 → 0.33.9
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 +0 -57
- package/dist/index.d.ts +3705 -135
- package/dist/index.js +29 -4
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,63 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ArcObject } from 'gl-draw';
|
|
3
|
-
import { ArcPathOptions } from 'gl-draw';
|
|
4
|
-
import { ArcPoint } from 'gl-draw';
|
|
5
|
-
import { ArcSpherePathOptions } from 'gl-draw';
|
|
6
|
-
import { BaseObject } from 'gl-draw';
|
|
7
|
-
import { baseObjectBounce } from 'gl-draw';
|
|
8
|
-
import { baseObjectBounceIn } from 'gl-draw';
|
|
9
|
-
import { baseObjectFadeIn } from 'gl-draw';
|
|
10
|
-
import { baseObjectFadeOut } from 'gl-draw';
|
|
1
|
+
import { AmbientLight as AmbientLight_2 } from 'three';
|
|
11
2
|
import { BufferGeometry } from 'three';
|
|
3
|
+
import { BufferGeometryEventMap } from 'three';
|
|
4
|
+
import { Camera as Camera_2 } from 'three/webgpu';
|
|
5
|
+
import { Camera as Camera_3 } from 'three';
|
|
6
|
+
import { Color } from 'three';
|
|
12
7
|
import { ColorRepresentation } from 'three';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
8
|
+
import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
|
|
9
|
+
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
|
|
10
|
+
import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
|
|
11
|
+
import { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
|
|
12
|
+
import { CSS3DSprite } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
|
|
13
|
+
import { DataTexture } from 'three';
|
|
14
|
+
import { DirectionalLight as DirectionalLight_2 } from 'three';
|
|
15
|
+
import { Euler } from 'three';
|
|
15
16
|
import { EventEmitter } from 'events';
|
|
16
|
-
import { ExtrudePolygonObject } from 'gl-draw';
|
|
17
17
|
import { FeatureCollection } from 'geojson';
|
|
18
|
+
import { geoEquirectangular } from 'd3-geo';
|
|
18
19
|
import { GeoJsonProperties } from 'geojson';
|
|
19
|
-
import {
|
|
20
|
+
import { geoMercator } from 'd3-geo';
|
|
20
21
|
import { GeoProjection } from 'd3-geo';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
22
|
+
import { Group } from 'three';
|
|
23
|
+
import { HemisphereLight as HemisphereLight_2 } from 'three';
|
|
24
|
+
import { Intersection } from 'three';
|
|
23
25
|
import { IUniform } from 'three';
|
|
24
|
-
import {
|
|
25
|
-
import { LineObject } from 'gl-draw';
|
|
26
|
+
import { Layers } from 'three/webgpu';
|
|
26
27
|
import { Listener } from 'events';
|
|
28
|
+
import { LoadingManager } from 'three';
|
|
29
|
+
import { Material } from 'three';
|
|
30
|
+
import { MaterialEventMap } from 'three';
|
|
31
|
+
import { MaterialParameters } from 'three';
|
|
27
32
|
import { Matrix4 } from 'three';
|
|
28
33
|
import { Mesh } from 'three';
|
|
29
|
-
import {
|
|
30
|
-
import { MeshObject } from 'gl-draw';
|
|
31
|
-
import { ModelObject } from 'gl-draw';
|
|
34
|
+
import { Mesh as Mesh_2 } from 'three/webgpu';
|
|
32
35
|
import { MultiPolygon } from 'geojson';
|
|
33
|
-
import {
|
|
36
|
+
import { Node as Node_2 } from 'three/webgpu';
|
|
37
|
+
import { NodeMaterial } from 'three/webgpu';
|
|
38
|
+
import { NormalBufferAttributes } from 'three';
|
|
34
39
|
import { Object3D } from 'three';
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
40
|
+
import { Object3D as Object3D_2 } from 'three/webgpu';
|
|
41
|
+
import { Object3DEventMap } from 'three';
|
|
42
|
+
import { Object3DJSON } from 'three';
|
|
43
|
+
import { OrthographicCamera } from 'three';
|
|
44
|
+
import { PerspectiveCamera } from 'three/webgpu';
|
|
45
|
+
import { PerspectiveCamera as PerspectiveCamera_2 } from 'three';
|
|
46
|
+
import { PointLight as PointLight_2 } from 'three';
|
|
37
47
|
import { Polygon } from 'geojson';
|
|
38
48
|
import { Position } from 'geojson';
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import { SceneSnapshot } from 'gl-draw';
|
|
49
|
+
import { Raycaster } from 'three/webgpu';
|
|
50
|
+
import { RectAreaLight as RectAreaLight_2 } from 'three';
|
|
51
|
+
import { RenderPipeline } from 'three/webgpu';
|
|
52
|
+
import { RenderTarget } from 'three/webgpu';
|
|
53
|
+
import { Scene } from 'three';
|
|
54
|
+
import { Scene as Scene_2 } from 'three/webgpu';
|
|
46
55
|
import { ShaderMaterial } from 'three';
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
56
|
+
import { ShaderMaterialJSON } from 'three';
|
|
57
|
+
import { SpotLight as SpotLight_2 } from 'three';
|
|
58
|
+
import { Sprite } from 'three';
|
|
59
|
+
import { SpriteMaterial } from 'three';
|
|
51
60
|
import { Texture } from 'three';
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
61
|
+
import { TextureEventMap } from 'three';
|
|
62
|
+
import * as THREE from 'three/webgpu';
|
|
63
|
+
import * as _THREE from 'three';
|
|
64
|
+
import { Timer } from 'three/webgpu';
|
|
65
|
+
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
|
|
55
66
|
import { default as TWEEN } from 'three/examples/jsm/libs/tween.module.js';
|
|
56
67
|
import { Tween as Tween_2 } from 'three/examples/jsm/libs/tween.module.js';
|
|
57
|
-
import {
|
|
58
|
-
import { Vector2 } from 'three';
|
|
68
|
+
import { Vector2 } from 'three/webgpu';
|
|
69
|
+
import { Vector2 as Vector2_2 } from 'three';
|
|
59
70
|
import { Vector3 } from 'three';
|
|
71
|
+
import { Vector3 as Vector3_2 } from 'three/webgpu';
|
|
60
72
|
import { Vector3Tuple } from 'three';
|
|
73
|
+
import { VideoTexture } from 'three';
|
|
74
|
+
import { ViewHelper } from 'three/examples/jsm/helpers/ViewHelper.js';
|
|
75
|
+
import { WebGPURenderer } from 'three/webgpu';
|
|
76
|
+
import { WorkerPool } from 'esus-lite';
|
|
77
|
+
|
|
78
|
+
declare const ACTION: Readonly<{
|
|
79
|
+
readonly NONE: 0;
|
|
80
|
+
readonly ROTATE: 1;
|
|
81
|
+
readonly TRUCK: 2;
|
|
82
|
+
readonly OFFSET: 4;
|
|
83
|
+
readonly DOLLY: 8;
|
|
84
|
+
readonly ZOOM: 16;
|
|
85
|
+
readonly TOUCH_ROTATE: 32;
|
|
86
|
+
readonly TOUCH_TRUCK: 64;
|
|
87
|
+
readonly TOUCH_OFFSET: 128;
|
|
88
|
+
readonly TOUCH_DOLLY: 256;
|
|
89
|
+
readonly TOUCH_ZOOM: 512;
|
|
90
|
+
readonly TOUCH_DOLLY_TRUCK: 1024;
|
|
91
|
+
readonly TOUCH_DOLLY_OFFSET: 2048;
|
|
92
|
+
readonly TOUCH_DOLLY_ROTATE: 4096;
|
|
93
|
+
readonly TOUCH_ZOOM_TRUCK: 8192;
|
|
94
|
+
readonly TOUCH_ZOOM_OFFSET: 16384;
|
|
95
|
+
readonly TOUCH_ZOOM_ROTATE: 32768;
|
|
96
|
+
readonly SCREEN_PAN: 65536;
|
|
97
|
+
readonly TOUCH_SCREEN_PAN: 131072;
|
|
98
|
+
readonly TOUCH_DOLLY_SCREEN_PAN: 262144;
|
|
99
|
+
readonly TOUCH_ZOOM_SCREEN_PAN: 524288;
|
|
100
|
+
}>;
|
|
101
|
+
|
|
102
|
+
declare type ACTION = number;
|
|
61
103
|
|
|
62
104
|
export declare const adcodeAll: AdcodeRecords;
|
|
63
105
|
|
|
@@ -80,6 +122,22 @@ declare class AmbientLight extends AmbientLightObject {
|
|
|
80
122
|
constructor(...options: ConstructorParameters<typeof AmbientLightObject>);
|
|
81
123
|
}
|
|
82
124
|
|
|
125
|
+
declare class AmbientLightObject extends BaseObject<AmbientLight_2> {
|
|
126
|
+
objectType: string;
|
|
127
|
+
constructor(lightOrColor?: AmbientLight_2 | string | number, intensity?: number);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Tweens owned by one renderer, including paused animations. */
|
|
131
|
+
declare class AnimationScope {
|
|
132
|
+
private readonly group;
|
|
133
|
+
private readonly active;
|
|
134
|
+
private disposed;
|
|
135
|
+
get isDisposed(): boolean;
|
|
136
|
+
create<T extends Record<string, any>>(state: T): Tween_2<T>;
|
|
137
|
+
update(time?: number): void;
|
|
138
|
+
dispose(): void;
|
|
139
|
+
}
|
|
140
|
+
|
|
83
141
|
export declare namespace animationUtils {
|
|
84
142
|
export {
|
|
85
143
|
timeOut,
|
|
@@ -97,17 +155,92 @@ export declare function appendObjectDocument(before: VisSceneDocument, sceneId:
|
|
|
97
155
|
|
|
98
156
|
export declare function appendScenesDocument(before: VisSceneDocument, scenes: readonly SceneViewportDocument[], materials?: readonly MaterialAsset[], prefabs?: readonly PrefabAsset[]): VisSceneDocument;
|
|
99
157
|
|
|
100
|
-
|
|
158
|
+
declare type ArcCurve = _THREE.CubicBezierCurve3 | SphereArcCurve;
|
|
159
|
+
|
|
160
|
+
declare class ArcObject extends LineObject {
|
|
161
|
+
objectType: string;
|
|
162
|
+
options: ArcOptions;
|
|
163
|
+
constructor(options: ArcOptions);
|
|
164
|
+
create(): Promise<void>;
|
|
165
|
+
/** Internal/local-space curve used for rendering, editor handles and snapshots. */
|
|
166
|
+
getCurve(): ArcCurve;
|
|
167
|
+
/** Set four world-space Bézier controls; persisted coordinates remain local. */
|
|
168
|
+
setControlPoints(points: readonly [ArcPoint, ArcPoint, ArcPoint, ArcPoint]): void;
|
|
169
|
+
/** Set a world-space path without changing this object or its parent transforms. */
|
|
170
|
+
setPath(from: ArcPoint, to: ArcPoint, options: ArcPathOptions): void;
|
|
171
|
+
/** Exact radial lift above the short great circle; preserves every object transform. */
|
|
172
|
+
setSpherePath(from: ArcPoint, to: ArcPoint, options: ArcSpherePathOptions): void;
|
|
173
|
+
private worldToLocalMatrix;
|
|
174
|
+
private validatedNodes;
|
|
175
|
+
private setWorldControls;
|
|
176
|
+
private getPickPathOptions;
|
|
177
|
+
private syncPickPathOptions;
|
|
178
|
+
private updatePickTargetGeometry;
|
|
179
|
+
pickTube: TubeObject | null;
|
|
180
|
+
private pickTargetVersion;
|
|
181
|
+
private pickBindings;
|
|
182
|
+
addPickTarget(radius?: number, show?: boolean): Promise<TubeObject | undefined>;
|
|
183
|
+
/** Restored picking children are adopted instead of allocating a duplicate tube. */
|
|
184
|
+
rebuildFromScene(): Promise<void>;
|
|
185
|
+
dispose(): void;
|
|
186
|
+
protected createPointerBinding(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): () => void;
|
|
187
|
+
setColor(color: string): void;
|
|
188
|
+
animateIn({ duration, delay, repeat, onComplete, onRepeat, }?: {
|
|
189
|
+
duration?: number;
|
|
190
|
+
delay?: number;
|
|
191
|
+
repeat?: number;
|
|
192
|
+
onComplete?: (...args: any[]) => void;
|
|
193
|
+
onRepeat?: (count: number) => void;
|
|
194
|
+
}): void;
|
|
195
|
+
render(): void;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
declare interface ArcOptions extends NonNullable<ConstructorParameters<typeof LineObject>[0]> {
|
|
199
|
+
from: number[];
|
|
200
|
+
to: number[];
|
|
201
|
+
control1?: number[];
|
|
202
|
+
control2?: number[];
|
|
203
|
+
spherePath?: ArcSpherePath;
|
|
204
|
+
radius?: number;
|
|
205
|
+
globe?: boolean;
|
|
206
|
+
color?: string;
|
|
207
|
+
lineWidth?: number;
|
|
208
|
+
offsetLoop?: boolean;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export declare interface ArcPathOptions {
|
|
212
|
+
/** Maximum displacement from the endpoint segment along `up`, in world units. */
|
|
213
|
+
height: number;
|
|
214
|
+
/** World-space lift direction; normalized internally. Defaults to positive Z. */
|
|
215
|
+
up?: ArcPoint;
|
|
216
|
+
setPointWidth?: (progress: number) => number;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare type ArcPoint = _THREE.Vector3 | readonly number[];
|
|
101
220
|
|
|
102
|
-
|
|
221
|
+
/** A sphere frame in Arc-local coordinates. Its basis retains world-unit lengths. */
|
|
222
|
+
declare interface ArcSpherePath {
|
|
223
|
+
matrix: number[];
|
|
224
|
+
angle: number;
|
|
225
|
+
radius: number;
|
|
226
|
+
height: number;
|
|
227
|
+
}
|
|
103
228
|
|
|
104
|
-
export
|
|
229
|
+
export declare interface ArcSpherePathOptions {
|
|
230
|
+
/** World-space sphere center. Both endpoints must lie on the same sphere. */
|
|
231
|
+
center: ArcPoint;
|
|
232
|
+
/** Maximum distance above the sphere surface, in world units. Zero follows its surface. */
|
|
233
|
+
height: number;
|
|
234
|
+
/** World-space circle-plane normal for coincident or antipodal endpoints. */
|
|
235
|
+
normal?: ArcPoint;
|
|
236
|
+
setPointWidth?: (progress: number) => number;
|
|
237
|
+
}
|
|
105
238
|
|
|
106
239
|
declare class Area extends GroupObject {
|
|
107
240
|
objectType: string;
|
|
108
|
-
options:
|
|
241
|
+
options: Options_21;
|
|
109
242
|
area: ExtrudePolygonObject[];
|
|
110
|
-
constructor(options:
|
|
243
|
+
constructor(options: Options_21);
|
|
111
244
|
create(): Promise<void>;
|
|
112
245
|
rebuildFromScene(): void;
|
|
113
246
|
}
|
|
@@ -122,6 +255,88 @@ export declare function assertSceneManifest(value: unknown): asserts value is Vi
|
|
|
122
255
|
|
|
123
256
|
export declare function assertSupportedSceneDocument(value: unknown): void;
|
|
124
257
|
|
|
258
|
+
declare interface Asset extends AssetOptions {
|
|
259
|
+
src: string;
|
|
260
|
+
cacheData?: any;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
declare interface AssetOptions {
|
|
264
|
+
cache?: boolean;
|
|
265
|
+
dracoPath?: string;
|
|
266
|
+
anisotropy?: number;
|
|
267
|
+
type?: string;
|
|
268
|
+
responseType?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare class AttributesWorker {
|
|
272
|
+
options: Options_13 & {
|
|
273
|
+
maxWorkers: number;
|
|
274
|
+
cacheVersion: string;
|
|
275
|
+
dbName: string;
|
|
276
|
+
maxCacheSize: number;
|
|
277
|
+
};
|
|
278
|
+
pool: WorkerPool;
|
|
279
|
+
cacheManager: CacheManager;
|
|
280
|
+
private resources?;
|
|
281
|
+
private disposed;
|
|
282
|
+
private assertActive;
|
|
283
|
+
constructor(options?: Options_13, resources?: ResourceRegistry);
|
|
284
|
+
geoGeometry(type: 'extrudePolygon', options: GeoGeometryOptions & {
|
|
285
|
+
mesaage: ExtrudePolygonMessage;
|
|
286
|
+
}): Promise<BufferGeometry>;
|
|
287
|
+
geoGeometry(type: 'conicPolygon', options: GeoGeometryOptions & {
|
|
288
|
+
mesaage: ConicPolygonMessage;
|
|
289
|
+
}): Promise<BufferGeometry>;
|
|
290
|
+
geoGeometry(type: 'conicLine', options: GeoGeometryOptions & {
|
|
291
|
+
mesaage: ConicLineMessage;
|
|
292
|
+
}): Promise<BufferGeometry>;
|
|
293
|
+
geoGeometry(type: 'line', options: GeoGeometryOptions & {
|
|
294
|
+
mesaage: LineMessage;
|
|
295
|
+
}): Promise<BufferGeometry>;
|
|
296
|
+
getCachedGeometry(options: Pick<GeoGeometryOptions, 'cacheKey'>): Promise<ReturnType<typeof _default> | null>;
|
|
297
|
+
private buildGeometry;
|
|
298
|
+
saveCache(): Promise<void>;
|
|
299
|
+
/**
|
|
300
|
+
* 批量保存待更新的元数据
|
|
301
|
+
*/
|
|
302
|
+
flushMetadata(): Promise<void>;
|
|
303
|
+
/**
|
|
304
|
+
* 获取缓存统计信息
|
|
305
|
+
*/
|
|
306
|
+
getCacheStats(): Promise<{
|
|
307
|
+
total: number;
|
|
308
|
+
maxSize: number;
|
|
309
|
+
usage: number;
|
|
310
|
+
items: {
|
|
311
|
+
key: IDBValidKey;
|
|
312
|
+
metadata: CacheMetadata;
|
|
313
|
+
}[];
|
|
314
|
+
}>;
|
|
315
|
+
/**
|
|
316
|
+
* 手动清空所有缓存
|
|
317
|
+
*/
|
|
318
|
+
clearCache(): Promise<void>;
|
|
319
|
+
/**
|
|
320
|
+
* 检查存储配额使用情况
|
|
321
|
+
*/
|
|
322
|
+
checkStorageQuota(): Promise<{
|
|
323
|
+
usage: number;
|
|
324
|
+
quota: number;
|
|
325
|
+
percentUsed: number;
|
|
326
|
+
} | null>;
|
|
327
|
+
flattenCoordinates(coordinatesArr: number[][][], metaArray?: number[][], _globalMeta?: number[], useFloat64Array?: boolean): {
|
|
328
|
+
flat: Float64Array | Float32Array;
|
|
329
|
+
lengths: number[];
|
|
330
|
+
metaLength: number;
|
|
331
|
+
};
|
|
332
|
+
dispose(): void;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
declare interface AverageData {
|
|
336
|
+
logs: number[];
|
|
337
|
+
graph: number[];
|
|
338
|
+
}
|
|
339
|
+
|
|
125
340
|
export declare type Base = Base_2;
|
|
126
341
|
|
|
127
342
|
declare type Base_2 = Base_3;
|
|
@@ -138,9 +353,9 @@ declare class Base_3 extends Camera {
|
|
|
138
353
|
options: BaseOptions;
|
|
139
354
|
showState: boolean;
|
|
140
355
|
lead: Lead;
|
|
141
|
-
sceneResources:
|
|
356
|
+
sceneResources: Pencil['sceneResources'];
|
|
142
357
|
tier0: boolean;
|
|
143
|
-
roomEnvMap?:
|
|
358
|
+
roomEnvMap?: _THREE.Texture;
|
|
144
359
|
private roomEnvLease?;
|
|
145
360
|
visName: string;
|
|
146
361
|
private detectRes?;
|
|
@@ -160,9 +375,9 @@ declare class Base_3 extends Camera {
|
|
|
160
375
|
instantiatePrefab(keyOrAssetId: string, options?: InstantiatePrefabOptions): Promise<BaseObject>;
|
|
161
376
|
private cancelPrefabOperations;
|
|
162
377
|
constructor(options: BaseOptions);
|
|
163
|
-
getMaterialGroup(group: string): Record<string,
|
|
164
|
-
registerMaterialGroup(group: string, materials: Record<string,
|
|
165
|
-
copyMaterialGroup(source: string, target: string): Record<string,
|
|
378
|
+
getMaterialGroup(group: string): Record<string, _THREE.Material<_THREE.MaterialEventMap>> | null;
|
|
379
|
+
registerMaterialGroup(group: string, materials: Record<string, _THREE.Material | null>): void;
|
|
380
|
+
copyMaterialGroup(source: string, target: string): Record<string, _THREE.Material<_THREE.MaterialEventMap>>;
|
|
166
381
|
private getDetectRes;
|
|
167
382
|
private getQueryOverrides;
|
|
168
383
|
private getEffectiveLogarithmicDepthBuffer;
|
|
@@ -186,7 +401,7 @@ declare class Base_3 extends Camera {
|
|
|
186
401
|
/** 子类扩展点:释放额外引用和监听;页面资源由 Base 统一释放。 */
|
|
187
402
|
protected onDispose(): void;
|
|
188
403
|
protected get objectTypes(): Record<string, any>;
|
|
189
|
-
protected get defaultCameraUp():
|
|
404
|
+
protected get defaultCameraUp(): _THREE.Vector3;
|
|
190
405
|
private createRuntime;
|
|
191
406
|
private reportScriptError;
|
|
192
407
|
private sceneActive;
|
|
@@ -201,7 +416,7 @@ declare class Base_3 extends Camera {
|
|
|
201
416
|
releasePencilOwnership(): void;
|
|
202
417
|
private initSceneUserData;
|
|
203
418
|
/** Save a partial object state and apply its effects without replaying other state. */
|
|
204
|
-
setObjectState(object: BaseObject, patch: Record<string, any>): BaseObject<
|
|
419
|
+
setObjectState(object: BaseObject, patch: Record<string, any>): BaseObject<_THREE.Object3D<_THREE.Object3DEventMap>>;
|
|
205
420
|
applyObjectState(object: BaseObject, state?: Record<string, any>): void;
|
|
206
421
|
/** 场景页提交后的默认入场动画;地图可覆盖为更有空间感的过渡。 */
|
|
207
422
|
playEnterTransition({ duration, onPrepared, }: SceneEnterTransitionOptions): Promise<void>;
|
|
@@ -228,8 +443,8 @@ declare class Base_3 extends Camera {
|
|
|
228
443
|
hide(): void;
|
|
229
444
|
exportScene(): SceneSnapshot;
|
|
230
445
|
exportBaseObject(baseObject: BaseObject): SceneSnapshot;
|
|
231
|
-
restoreBaseObject(data: string |
|
|
232
|
-
restoreScene(str: string |
|
|
446
|
+
restoreBaseObject(data: string | _THREE.Object3DJSON, target?: BaseObject, objectsMap?: Record<string, any>, signal?: AbortSignal, options?: RestoreBaseObjectOptions): Promise<BaseObject<_THREE.Object3D<_THREE.Object3DEventMap>>>;
|
|
447
|
+
restoreScene(str: string | _THREE.Object3DJSON, objectsMap?: Record<string, any>, restoreOptions?: RestoreBaseObjectOptions): Promise<void>;
|
|
233
448
|
getClassRefByType(type: string): typeof BaseObject;
|
|
234
449
|
addGroup(): Promise< GroupObject>;
|
|
235
450
|
addCSS2D(dom: HTMLElement, options?: {
|
|
@@ -244,21 +459,152 @@ declare class Base_3 extends Camera {
|
|
|
244
459
|
target?: BaseObject;
|
|
245
460
|
}): Promise< NodeObject>;
|
|
246
461
|
private addNode;
|
|
247
|
-
getRoomEnvMap():
|
|
462
|
+
getRoomEnvMap(): _THREE.Texture<unknown, _THREE.TextureEventMap>;
|
|
248
463
|
getScreenPosition(x: number, y: number, z: number): {
|
|
249
464
|
x: number;
|
|
250
465
|
y: number;
|
|
251
466
|
};
|
|
252
|
-
uuidByObject(object:
|
|
253
|
-
objectByUuid(key: string):
|
|
467
|
+
uuidByObject(object: _THREE.Object3D): string | undefined;
|
|
468
|
+
objectByUuid(key: string): _THREE.Object3D<_THREE.Object3DEventMap>;
|
|
254
469
|
uuidByBaseObject(object: BaseObject): string;
|
|
255
470
|
baseObjectByUuid(uuid: string): BaseObject;
|
|
256
471
|
/** Compatibility method name; key is the persisted UUID. */
|
|
257
472
|
baseObjectByKey(key: string): BaseObject;
|
|
258
|
-
baseObjectByName(name: string): BaseObject<
|
|
473
|
+
baseObjectByName(name: string): BaseObject<_THREE.Object3D<_THREE.Object3DEventMap>> | undefined;
|
|
259
474
|
dispose(): void;
|
|
260
475
|
}
|
|
261
476
|
|
|
477
|
+
declare class BaseObject<T extends Object3D = Object3D> extends UseMaterial {
|
|
478
|
+
/** One persisted identity, owned by the underlying Three.js object. */
|
|
479
|
+
get key(): string;
|
|
480
|
+
set key(value: string);
|
|
481
|
+
get uuid(): string;
|
|
482
|
+
set uuid(value: string);
|
|
483
|
+
get name(): string;
|
|
484
|
+
set name(v: string);
|
|
485
|
+
objectType: string;
|
|
486
|
+
options: any;
|
|
487
|
+
private _keyType;
|
|
488
|
+
get keyType(): string;
|
|
489
|
+
set keyType(v: string);
|
|
490
|
+
pencil: Pencil;
|
|
491
|
+
lead: Lead_2;
|
|
492
|
+
sceneResources: SceneResources_2;
|
|
493
|
+
object3d: T;
|
|
494
|
+
userData: Record<string, any>;
|
|
495
|
+
isInstantiate: boolean;
|
|
496
|
+
isBloom: boolean;
|
|
497
|
+
isBaseObject: boolean;
|
|
498
|
+
/** Bound resources are SDK-owned unless the caller explicitly borrows them. */
|
|
499
|
+
resourceOwnership: ResourceOwnership;
|
|
500
|
+
constructor(object3d: T, options?: {
|
|
501
|
+
ownership?: ResourceOwnership;
|
|
502
|
+
});
|
|
503
|
+
get parent(): BaseObject | null;
|
|
504
|
+
get children(): BaseObject<Object3D< Object3DEventMap>>[];
|
|
505
|
+
get position(): Vector3;
|
|
506
|
+
get rotation(): Euler;
|
|
507
|
+
get scale(): Vector3;
|
|
508
|
+
lookAt(vector: Vector3): void;
|
|
509
|
+
lookAt(x: number, y: number, z: number): void;
|
|
510
|
+
draw<C extends new (...args: any[]) => BaseObject>(ClassRef: C, ...args: ConstructorParameters<C>): Promise<InstanceType<C>>;
|
|
511
|
+
add(...objects: (Object3D | BaseObject)[]): void;
|
|
512
|
+
remove(...object: Object3D[]): void;
|
|
513
|
+
get visible(): boolean;
|
|
514
|
+
/**
|
|
515
|
+
* 检查是否实际可见(自己和所有祖先都 visible)
|
|
516
|
+
*/
|
|
517
|
+
isActuallyVisible(): boolean;
|
|
518
|
+
create(): void;
|
|
519
|
+
/** Optional allocation boundary for nested creation and failure rollback. */
|
|
520
|
+
createResource<R extends object>(factory: () => R): R;
|
|
521
|
+
render(): void;
|
|
522
|
+
update(_delta: number, _elapsed: number): void;
|
|
523
|
+
resize(_width: number, _height: number): void;
|
|
524
|
+
show(): this;
|
|
525
|
+
hide(): this;
|
|
526
|
+
/**
|
|
527
|
+
* 递归禁用 layers(不管子级自己的 visible 状态,全部 disable)
|
|
528
|
+
*/
|
|
529
|
+
protected _disableLayersRecursive(): void;
|
|
530
|
+
/**
|
|
531
|
+
* 递归启用 layers(只有自己 visible=true 时才 enable 并继续递归)
|
|
532
|
+
*/
|
|
533
|
+
protected _enableLayersRecursive(): void;
|
|
534
|
+
attach(...args: BaseObject[]): this;
|
|
535
|
+
getSize(): {
|
|
536
|
+
min: Vector3;
|
|
537
|
+
max: Vector3;
|
|
538
|
+
size: Vector3;
|
|
539
|
+
center: Vector3;
|
|
540
|
+
};
|
|
541
|
+
setTop(onTop: number): void;
|
|
542
|
+
traverse(fn: (o: BaseObject) => void): void;
|
|
543
|
+
instantiate(ops?: {
|
|
544
|
+
target?: BaseObject;
|
|
545
|
+
recursive?: boolean;
|
|
546
|
+
instancedAttr?: {
|
|
547
|
+
position: Vector3 | number[] | [number, number, number];
|
|
548
|
+
scale?: Vector3 | number[] | [number, number, number];
|
|
549
|
+
}[];
|
|
550
|
+
cloneMaterial?: boolean;
|
|
551
|
+
}): Promise<this>;
|
|
552
|
+
erase(): void;
|
|
553
|
+
setKey(value: string | {
|
|
554
|
+
keyType?: string;
|
|
555
|
+
uuid?: string;
|
|
556
|
+
}): string;
|
|
557
|
+
handleMaterialChange(_mat: Material | Material[] | null): void;
|
|
558
|
+
enableBloom(traverse?: boolean): void;
|
|
559
|
+
disableBloom(traverse?: boolean): void;
|
|
560
|
+
private isDispose;
|
|
561
|
+
private disposalRequested;
|
|
562
|
+
/** Internal: Resource cleanup waits until create() has finished allocating. */
|
|
563
|
+
creationPending: boolean;
|
|
564
|
+
get isDisposed(): boolean;
|
|
565
|
+
dispose(): void;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
declare const baseObjectBounce: (obj: BaseObject, up: string | undefined, to: number) => {
|
|
569
|
+
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
570
|
+
duration?: number | undefined;
|
|
571
|
+
repeat?: number | undefined;
|
|
572
|
+
repeatResolve?: number | undefined;
|
|
573
|
+
repeatDelay?: number | undefined;
|
|
574
|
+
}) => Promise<void>;
|
|
575
|
+
stop: () => void;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
declare const baseObjectBounceIn: (obj: BaseObject, up?: string) => {
|
|
579
|
+
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
580
|
+
duration?: number | undefined;
|
|
581
|
+
repeat?: number | undefined;
|
|
582
|
+
repeatResolve?: number | undefined;
|
|
583
|
+
repeatDelay?: number | undefined;
|
|
584
|
+
}) => Promise<void>;
|
|
585
|
+
stop: () => void;
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
declare const baseObjectFadeIn: (obj: BaseObject) => {
|
|
589
|
+
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
590
|
+
duration?: number | undefined;
|
|
591
|
+
repeat?: number | undefined;
|
|
592
|
+
repeatResolve?: number | undefined;
|
|
593
|
+
repeatDelay?: number | undefined;
|
|
594
|
+
}) => Promise<void>;
|
|
595
|
+
stop: () => void;
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
declare const baseObjectFadeOut: (obj: BaseObject) => {
|
|
599
|
+
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
600
|
+
duration?: number | undefined;
|
|
601
|
+
repeat?: number | undefined;
|
|
602
|
+
repeatResolve?: number | undefined;
|
|
603
|
+
repeatDelay?: number | undefined;
|
|
604
|
+
}) => Promise<void>;
|
|
605
|
+
stop: () => void;
|
|
606
|
+
};
|
|
607
|
+
|
|
262
608
|
declare interface BaseOptions {
|
|
263
609
|
container: HTMLElement;
|
|
264
610
|
assetsPrefix?: string;
|
|
@@ -293,6 +639,13 @@ export declare interface BindMaterialAssetOptions {
|
|
|
293
639
|
/** Bind explicit slots; no render graph is exported to discover the changed rows. */
|
|
294
640
|
export declare function bindMaterialSlots(document: VisSceneDocument, sceneId: string, assignments: readonly MaterialSlotAssignment[], optionReplacements?: ReadonlyMap<string, ReadonlyMap<string, string>>, optionAssetId?: string): VisSceneDocument;
|
|
295
641
|
|
|
642
|
+
declare interface BloomParams {
|
|
643
|
+
threshold: number;
|
|
644
|
+
strength: number;
|
|
645
|
+
radius: number;
|
|
646
|
+
bloomAlphaType: 1 | 0.5 | 0;
|
|
647
|
+
}
|
|
648
|
+
|
|
296
649
|
declare class Box extends MeshObject {
|
|
297
650
|
objectType: string;
|
|
298
651
|
create(): void;
|
|
@@ -300,21 +653,98 @@ declare class Box extends MeshObject {
|
|
|
300
653
|
|
|
301
654
|
declare class Building extends GroupObject {
|
|
302
655
|
objectType: string;
|
|
303
|
-
options:
|
|
304
|
-
constructor(options:
|
|
656
|
+
options: Options_19;
|
|
657
|
+
constructor(options: Options_19);
|
|
305
658
|
create(): Promise<void>;
|
|
306
659
|
rebuildFromScene(): void;
|
|
307
660
|
private gradientMaterials;
|
|
308
|
-
worldPositionZ:
|
|
309
|
-
value: number;
|
|
310
|
-
};
|
|
661
|
+
worldPositionZ: THREE.UniformNode<"float", number>;
|
|
311
662
|
sideGradient(color?: string, maxGradientHeight?: number): void;
|
|
312
663
|
update(): void;
|
|
313
664
|
}
|
|
314
665
|
|
|
666
|
+
declare class CacheManager {
|
|
667
|
+
private store;
|
|
668
|
+
private metadataStore;
|
|
669
|
+
private pendingMetadataUpdates;
|
|
670
|
+
private cacheObj;
|
|
671
|
+
private options;
|
|
672
|
+
private operation;
|
|
673
|
+
private generation;
|
|
674
|
+
/** Serialize writes to the two stores; a rejected write must not block retries. */
|
|
675
|
+
private enqueue;
|
|
676
|
+
constructor(options: CacheManagerOptions);
|
|
677
|
+
/**
|
|
678
|
+
* 添加缓存到内存队列
|
|
679
|
+
*/
|
|
680
|
+
addToCache(cacheKey: string, data: any): void;
|
|
681
|
+
/**
|
|
682
|
+
* 记录待更新的缓存元数据(非阻塞)
|
|
683
|
+
*/
|
|
684
|
+
recordMetadataUpdate(cacheKey: string, size?: number): void;
|
|
685
|
+
/**
|
|
686
|
+
* 批量保存待更新的元数据
|
|
687
|
+
*/
|
|
688
|
+
flushMetadata(): Promise<void>;
|
|
689
|
+
private flushMetadataNow;
|
|
690
|
+
/**
|
|
691
|
+
* 清理最少使用的缓存(LRU策略)
|
|
692
|
+
*/
|
|
693
|
+
private evictLRUCache;
|
|
694
|
+
/**
|
|
695
|
+
* 从缓存中获取数据
|
|
696
|
+
*/
|
|
697
|
+
get<T = any>(cacheKey: string): Promise<T | undefined>;
|
|
698
|
+
/**
|
|
699
|
+
* 保存内存缓存到 IndexedDB
|
|
700
|
+
*/
|
|
701
|
+
saveCache(): Promise<void>;
|
|
702
|
+
private saveCacheNow;
|
|
703
|
+
/**
|
|
704
|
+
* 获取缓存统计信息
|
|
705
|
+
*/
|
|
706
|
+
getCacheStats(): Promise<{
|
|
707
|
+
total: number;
|
|
708
|
+
maxSize: number;
|
|
709
|
+
usage: number;
|
|
710
|
+
items: Array<{
|
|
711
|
+
key: IDBValidKey;
|
|
712
|
+
metadata: CacheMetadata;
|
|
713
|
+
}>;
|
|
714
|
+
}>;
|
|
715
|
+
/**
|
|
716
|
+
* 手动清空所有缓存
|
|
717
|
+
*/
|
|
718
|
+
clearCache(): Promise<void>;
|
|
719
|
+
private clearStoredCache;
|
|
720
|
+
/**
|
|
721
|
+
* 检查存储配额使用情况
|
|
722
|
+
*/
|
|
723
|
+
checkStorageQuota(): Promise<{
|
|
724
|
+
usage: number;
|
|
725
|
+
quota: number;
|
|
726
|
+
percentUsed: number;
|
|
727
|
+
} | null>;
|
|
728
|
+
/**
|
|
729
|
+
* 清理内存和待更新队列
|
|
730
|
+
*/
|
|
731
|
+
dispose(): void;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
declare interface CacheManagerOptions {
|
|
735
|
+
dbName: string;
|
|
736
|
+
maxCacheSize: number;
|
|
737
|
+
cacheVersion: string;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
declare interface CacheMetadata {
|
|
741
|
+
lastAccessed: number;
|
|
742
|
+
accessCount: number;
|
|
743
|
+
}
|
|
744
|
+
|
|
315
745
|
declare class Camera extends Event_2 {
|
|
316
746
|
container: HTMLElement;
|
|
317
|
-
pencil:
|
|
747
|
+
pencil: Pencil;
|
|
318
748
|
cameraState: Record<string, number[]>;
|
|
319
749
|
cameraStateActive: string;
|
|
320
750
|
setSaveCamera(type: string): void;
|
|
@@ -325,17 +755,1022 @@ declare class Camera extends Event_2 {
|
|
|
325
755
|
dollyTo(distance: number | `+=${number}` | `-=${number}` | `*=${number}` | `/=${number}`, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
326
756
|
absoluteAngle(targetAngle: number, sourceAngle: number): number;
|
|
327
757
|
lookAtTarget(ops: {
|
|
328
|
-
target?:
|
|
758
|
+
target?: _THREE.Vector3;
|
|
329
759
|
distance?: number;
|
|
330
760
|
polarAngle?: number;
|
|
331
761
|
azimuthAngle?: number;
|
|
332
762
|
}, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
333
763
|
paddingInCssPixel(obj: BaseObject, top: number, right: number, bottom: number, left: number, enableTransition: boolean): Promise<void[]>;
|
|
334
764
|
resetCamera(enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
335
|
-
unproject(e: MouseEvent, targetZ?: number):
|
|
765
|
+
unproject(e: MouseEvent, targetZ?: number): _THREE.Vector3;
|
|
336
766
|
dispose(): void;
|
|
337
767
|
}
|
|
338
768
|
|
|
769
|
+
declare class CameraControls extends EventDispatcher {
|
|
770
|
+
/**
|
|
771
|
+
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
772
|
+
*
|
|
773
|
+
* e.g
|
|
774
|
+
* ```javascript
|
|
775
|
+
* CameraControls.install( { THREE: THREE } );
|
|
776
|
+
* ```
|
|
777
|
+
*
|
|
778
|
+
* Note: If you do not wish to use enter three.js to reduce file size(tree-shaking for example), make a subset to install.
|
|
779
|
+
*
|
|
780
|
+
* ```js
|
|
781
|
+
* import {
|
|
782
|
+
* Vector2,
|
|
783
|
+
* Vector3,
|
|
784
|
+
* Vector4,
|
|
785
|
+
* Quaternion,
|
|
786
|
+
* Matrix4,
|
|
787
|
+
* Spherical,
|
|
788
|
+
* Box3,
|
|
789
|
+
* Sphere,
|
|
790
|
+
* Raycaster,
|
|
791
|
+
* MathUtils,
|
|
792
|
+
* } from 'three';
|
|
793
|
+
*
|
|
794
|
+
* const subsetOfTHREE = {
|
|
795
|
+
* Vector2 : Vector2,
|
|
796
|
+
* Vector3 : Vector3,
|
|
797
|
+
* Vector4 : Vector4,
|
|
798
|
+
* Quaternion: Quaternion,
|
|
799
|
+
* Matrix4 : Matrix4,
|
|
800
|
+
* Spherical : Spherical,
|
|
801
|
+
* Box3 : Box3,
|
|
802
|
+
* Sphere : Sphere,
|
|
803
|
+
* Raycaster : Raycaster,
|
|
804
|
+
* };
|
|
805
|
+
|
|
806
|
+
* CameraControls.install( { THREE: subsetOfTHREE } );
|
|
807
|
+
* ```
|
|
808
|
+
* @category Statics
|
|
809
|
+
*/
|
|
810
|
+
static install(libs: { THREE: THREESubset }): void;
|
|
811
|
+
/*
|
|
812
|
+
* list all ACTIONs
|
|
813
|
+
* @category Statics
|
|
814
|
+
*/
|
|
815
|
+
static readonly ACTION: typeof ACTION;
|
|
816
|
+
/**
|
|
817
|
+
* Minimum vertical angle in radians.
|
|
818
|
+
* The angle has to be between `0` and `.maxPolarAngle` inclusive.
|
|
819
|
+
* The default value is `0`.
|
|
820
|
+
*
|
|
821
|
+
* e.g.
|
|
822
|
+
* ```
|
|
823
|
+
* cameraControls.maxPolarAngle = 0;
|
|
824
|
+
* ```
|
|
825
|
+
* @category Properties
|
|
826
|
+
*/
|
|
827
|
+
minPolarAngle: number;
|
|
828
|
+
/**
|
|
829
|
+
* Maximum vertical angle in radians.
|
|
830
|
+
* The angle has to be between `.maxPolarAngle` and `Math.PI` inclusive.
|
|
831
|
+
* The default value is `Math.PI`.
|
|
832
|
+
*
|
|
833
|
+
* e.g.
|
|
834
|
+
* ```
|
|
835
|
+
* cameraControls.maxPolarAngle = Math.PI;
|
|
836
|
+
* ```
|
|
837
|
+
* @category Properties
|
|
838
|
+
*/
|
|
839
|
+
maxPolarAngle: number;
|
|
840
|
+
/**
|
|
841
|
+
* Minimum horizontal angle in radians.
|
|
842
|
+
* The angle has to be less than `.maxAzimuthAngle`.
|
|
843
|
+
* The default value is `- Infinity`.
|
|
844
|
+
*
|
|
845
|
+
* e.g.
|
|
846
|
+
* ```
|
|
847
|
+
* cameraControls.minAzimuthAngle = - Infinity;
|
|
848
|
+
* ```
|
|
849
|
+
* @category Properties
|
|
850
|
+
*/
|
|
851
|
+
minAzimuthAngle: number;
|
|
852
|
+
/**
|
|
853
|
+
* Maximum horizontal angle in radians.
|
|
854
|
+
* The angle has to be greater than `.minAzimuthAngle`.
|
|
855
|
+
* The default value is `Infinity`.
|
|
856
|
+
*
|
|
857
|
+
* e.g.
|
|
858
|
+
* ```
|
|
859
|
+
* cameraControls.maxAzimuthAngle = Infinity;
|
|
860
|
+
* ```
|
|
861
|
+
* @category Properties
|
|
862
|
+
*/
|
|
863
|
+
maxAzimuthAngle: number;
|
|
864
|
+
/**
|
|
865
|
+
* Minimum distance for dolly. The value must be higher than `0`. Default is `Number.EPSILON`.
|
|
866
|
+
* PerspectiveCamera only.
|
|
867
|
+
* @category Properties
|
|
868
|
+
*/
|
|
869
|
+
minDistance: number;
|
|
870
|
+
/**
|
|
871
|
+
* Maximum distance for dolly. The value must be higher than `minDistance`. Default is `Infinity`.
|
|
872
|
+
* PerspectiveCamera only.
|
|
873
|
+
* @category Properties
|
|
874
|
+
*/
|
|
875
|
+
maxDistance: number;
|
|
876
|
+
/**
|
|
877
|
+
* `true` to enable Infinity Dolly for wheel and pinch. Use this with `minDistance` and `maxDistance`
|
|
878
|
+
* If the Dolly distance is less (or over) than the `minDistance` (or `maxDistance`), `infinityDolly` will keep the distance and pushes the target position instead.
|
|
879
|
+
* @category Properties
|
|
880
|
+
*/
|
|
881
|
+
infinityDolly: boolean;
|
|
882
|
+
/**
|
|
883
|
+
* Minimum camera zoom.
|
|
884
|
+
* @category Properties
|
|
885
|
+
*/
|
|
886
|
+
minZoom: number;
|
|
887
|
+
/**
|
|
888
|
+
* Maximum camera zoom.
|
|
889
|
+
* @category Properties
|
|
890
|
+
*/
|
|
891
|
+
maxZoom: number;
|
|
892
|
+
/**
|
|
893
|
+
* Approximate time in seconds to reach the target. A smaller value will reach the target faster.
|
|
894
|
+
* @category Properties
|
|
895
|
+
*/
|
|
896
|
+
smoothTime: number;
|
|
897
|
+
/**
|
|
898
|
+
* the smoothTime while dragging
|
|
899
|
+
* @category Properties
|
|
900
|
+
*/
|
|
901
|
+
draggingSmoothTime: number;
|
|
902
|
+
/**
|
|
903
|
+
* Max transition speed in unit-per-seconds
|
|
904
|
+
* @category Properties
|
|
905
|
+
*/
|
|
906
|
+
maxSpeed: number;
|
|
907
|
+
/**
|
|
908
|
+
* Speed of azimuth (horizontal) rotation.
|
|
909
|
+
* @category Properties
|
|
910
|
+
*/
|
|
911
|
+
azimuthRotateSpeed: number;
|
|
912
|
+
/**
|
|
913
|
+
* Speed of polar (vertical) rotation.
|
|
914
|
+
* @category Properties
|
|
915
|
+
*/
|
|
916
|
+
polarRotateSpeed: number;
|
|
917
|
+
/**
|
|
918
|
+
* Speed of mouse-wheel dollying.
|
|
919
|
+
* @category Properties
|
|
920
|
+
*/
|
|
921
|
+
dollySpeed: number;
|
|
922
|
+
/**
|
|
923
|
+
* `true` to invert direction when dollying or zooming via drag
|
|
924
|
+
* @category Properties
|
|
925
|
+
*/
|
|
926
|
+
dollyDragInverted: boolean;
|
|
927
|
+
/**
|
|
928
|
+
* Speed of drag for truck and pedestal.
|
|
929
|
+
* @category Properties
|
|
930
|
+
*/
|
|
931
|
+
truckSpeed: number;
|
|
932
|
+
/**
|
|
933
|
+
* `true` to enable Dolly-in to the mouse cursor coords.
|
|
934
|
+
* @category Properties
|
|
935
|
+
*/
|
|
936
|
+
dollyToCursor: boolean;
|
|
937
|
+
/**
|
|
938
|
+
* @category Properties
|
|
939
|
+
*/
|
|
940
|
+
dragToOffset: boolean;
|
|
941
|
+
/**
|
|
942
|
+
* Friction ratio of the boundary.
|
|
943
|
+
* @category Properties
|
|
944
|
+
*/
|
|
945
|
+
boundaryFriction: number;
|
|
946
|
+
/**
|
|
947
|
+
* Controls how soon the `rest` event fires as the camera slows.
|
|
948
|
+
* @category Properties
|
|
949
|
+
*/
|
|
950
|
+
restThreshold: number;
|
|
951
|
+
/**
|
|
952
|
+
* An array of Meshes to collide with camera.
|
|
953
|
+
* Be aware colliderMeshes may decrease performance. The collision test uses 4 raycasters from the camera since the near plane has 4 corners.
|
|
954
|
+
* @category Properties
|
|
955
|
+
*/
|
|
956
|
+
colliderMeshes: _THREE.Object3D[];
|
|
957
|
+
/**
|
|
958
|
+
* User's mouse input config.
|
|
959
|
+
*
|
|
960
|
+
* | button to assign | behavior |
|
|
961
|
+
* | --------------------- | -------- |
|
|
962
|
+
* | `mouseButtons.left` | `CameraControls.ACTION.ROTATE`* \| `CameraControls.ACTION.TRUCK` \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY` \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
|
|
963
|
+
* | `mouseButtons.right` | `CameraControls.ACTION.ROTATE` \| `CameraControls.ACTION.TRUCK`* \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY` \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
|
|
964
|
+
* | `mouseButtons.wheel` ¹ | `CameraControls.ACTION.ROTATE` \| `CameraControls.ACTION.TRUCK` \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY` \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
|
|
965
|
+
* | `mouseButtons.middle` ² | `CameraControls.ACTION.ROTATE` \| `CameraControls.ACTION.TRUCK` \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY`* \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
|
|
966
|
+
*
|
|
967
|
+
* 1. Mouse wheel event for scroll "up/down" on mac "up/down/left/right"
|
|
968
|
+
* 2. Mouse click on wheel event "button"
|
|
969
|
+
* - \* is the default.
|
|
970
|
+
* - The default of `mouseButtons.wheel` is:
|
|
971
|
+
* - `DOLLY` for Perspective camera.
|
|
972
|
+
* - `ZOOM` for Orthographic camera, and can't set `DOLLY`.
|
|
973
|
+
* @category Properties
|
|
974
|
+
*/
|
|
975
|
+
mouseButtons: MouseButtons;
|
|
976
|
+
/**
|
|
977
|
+
* User's touch input config.
|
|
978
|
+
*
|
|
979
|
+
* | fingers to assign | behavior |
|
|
980
|
+
* | --------------------- | -------- |
|
|
981
|
+
* | `touches.one` | `CameraControls.ACTION.TOUCH_ROTATE`* \| `CameraControls.ACTION.TOUCH_TRUCK` \| `CameraControls.ACTION.TOUCH_OFFSET` \| `CameraControls.ACTION.DOLLY` | `CameraControls.ACTION.ZOOM` | `CameraControls.ACTION.NONE` |
|
|
982
|
+
* | `touches.two` | `ACTION.TOUCH_DOLLY_TRUCK` \| `ACTION.TOUCH_DOLLY_OFFSET` \| `ACTION.TOUCH_DOLLY_ROTATE` \| `ACTION.TOUCH_ZOOM_TRUCK` \| `ACTION.TOUCH_ZOOM_OFFSET` \| `ACTION.TOUCH_ZOOM_ROTATE` \| `ACTION.TOUCH_DOLLY` \| `ACTION.TOUCH_ZOOM` \| `CameraControls.ACTION.TOUCH_ROTATE` \| `CameraControls.ACTION.TOUCH_TRUCK` \| `CameraControls.ACTION.TOUCH_OFFSET` \| `CameraControls.ACTION.NONE` |
|
|
983
|
+
* | `touches.three` | `ACTION.TOUCH_DOLLY_TRUCK` \| `ACTION.TOUCH_DOLLY_OFFSET` \| `ACTION.TOUCH_DOLLY_ROTATE` \| `ACTION.TOUCH_ZOOM_TRUCK` \| `ACTION.TOUCH_ZOOM_OFFSET` \| `ACTION.TOUCH_ZOOM_ROTATE` \| `CameraControls.ACTION.TOUCH_ROTATE` \| `CameraControls.ACTION.TOUCH_TRUCK` \| `CameraControls.ACTION.TOUCH_OFFSET` \| `CameraControls.ACTION.NONE` |
|
|
984
|
+
*
|
|
985
|
+
* - \* is the default.
|
|
986
|
+
* - The default of `touches.two` and `touches.three` is:
|
|
987
|
+
* - `TOUCH_DOLLY_TRUCK` for Perspective camera.
|
|
988
|
+
* - `TOUCH_ZOOM_TRUCK` for Orthographic camera, and can't set `TOUCH_DOLLY_TRUCK` and `TOUCH_DOLLY`.
|
|
989
|
+
* @category Properties
|
|
990
|
+
*/
|
|
991
|
+
touches: Touches;
|
|
992
|
+
/**
|
|
993
|
+
* Force cancel user dragging.
|
|
994
|
+
* @category Methods
|
|
995
|
+
*/
|
|
996
|
+
cancel: () => void;
|
|
997
|
+
/**
|
|
998
|
+
* Still an experimental feature.
|
|
999
|
+
* This could change at any time.
|
|
1000
|
+
* @category Methods
|
|
1001
|
+
*/
|
|
1002
|
+
lockPointer: () => void;
|
|
1003
|
+
/**
|
|
1004
|
+
* Still an experimental feature.
|
|
1005
|
+
* This could change at any time.
|
|
1006
|
+
* @category Methods
|
|
1007
|
+
*/
|
|
1008
|
+
unlockPointer: () => void;
|
|
1009
|
+
protected _enabled: boolean;
|
|
1010
|
+
protected _camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera;
|
|
1011
|
+
protected _yAxisUpSpace: _THREE.Quaternion;
|
|
1012
|
+
protected _yAxisUpSpaceInverse: _THREE.Quaternion;
|
|
1013
|
+
protected _state: ACTION;
|
|
1014
|
+
protected _domElement?: HTMLElement;
|
|
1015
|
+
protected _viewport: _THREE.Vector4 | null;
|
|
1016
|
+
protected _target: _THREE.Vector3;
|
|
1017
|
+
protected _targetEnd: _THREE.Vector3;
|
|
1018
|
+
protected _focalOffset: _THREE.Vector3;
|
|
1019
|
+
protected _focalOffsetEnd: _THREE.Vector3;
|
|
1020
|
+
protected _spherical: _THREE.Spherical;
|
|
1021
|
+
protected _sphericalEnd: _THREE.Spherical;
|
|
1022
|
+
protected _lastDistance: number;
|
|
1023
|
+
protected _zoom: number;
|
|
1024
|
+
protected _zoomEnd: number;
|
|
1025
|
+
protected _lastZoom: number;
|
|
1026
|
+
protected _cameraUp0: _THREE.Vector3;
|
|
1027
|
+
protected _target0: _THREE.Vector3;
|
|
1028
|
+
protected _position0: _THREE.Vector3;
|
|
1029
|
+
protected _zoom0: number;
|
|
1030
|
+
protected _focalOffset0: _THREE.Vector3;
|
|
1031
|
+
protected _dollyControlCoord: _THREE.Vector2;
|
|
1032
|
+
protected _changedDolly: number;
|
|
1033
|
+
protected _changedZoom: number;
|
|
1034
|
+
protected _nearPlaneCorners: [
|
|
1035
|
+
_THREE.Vector3,
|
|
1036
|
+
_THREE.Vector3,
|
|
1037
|
+
_THREE.Vector3,
|
|
1038
|
+
_THREE.Vector3,
|
|
1039
|
+
];
|
|
1040
|
+
protected _hasRested: boolean;
|
|
1041
|
+
protected _boundary: _THREE.Box3;
|
|
1042
|
+
protected _boundaryEnclosesCamera: boolean;
|
|
1043
|
+
protected _needsUpdate: boolean;
|
|
1044
|
+
protected _updatedLastTime: boolean;
|
|
1045
|
+
protected _elementRect: DOMRect;
|
|
1046
|
+
protected _isDragging: boolean;
|
|
1047
|
+
protected _dragNeedsUpdate: boolean;
|
|
1048
|
+
protected _activePointers: PointerInput[];
|
|
1049
|
+
protected _lockedPointer: PointerInput | null;
|
|
1050
|
+
protected _interactiveArea: DOMRect;
|
|
1051
|
+
protected _isUserControllingRotate: boolean;
|
|
1052
|
+
protected _isUserControllingDolly: boolean;
|
|
1053
|
+
protected _isUserControllingTruck: boolean;
|
|
1054
|
+
protected _isUserControllingOffset: boolean;
|
|
1055
|
+
protected _isUserControllingZoom: boolean;
|
|
1056
|
+
protected _lastDollyDirection: DOLLY_DIRECTION;
|
|
1057
|
+
protected _thetaVelocity: Ref;
|
|
1058
|
+
protected _phiVelocity: Ref;
|
|
1059
|
+
protected _radiusVelocity: Ref;
|
|
1060
|
+
protected _targetVelocity: _THREE.Vector3;
|
|
1061
|
+
protected _focalOffsetVelocity: _THREE.Vector3;
|
|
1062
|
+
protected _zoomVelocity: Ref;
|
|
1063
|
+
/**
|
|
1064
|
+
* Creates a `CameraControls` instance.
|
|
1065
|
+
*
|
|
1066
|
+
* Note:
|
|
1067
|
+
* You **must install** three.js before using camera-controls. see [#install](#install)
|
|
1068
|
+
* Not doing so will lead to runtime errors (`undefined` references to THREE).
|
|
1069
|
+
*
|
|
1070
|
+
* e.g.
|
|
1071
|
+
* ```
|
|
1072
|
+
* CameraControls.install( { THREE } );
|
|
1073
|
+
* const cameraControls = new CameraControls( camera, domElement );
|
|
1074
|
+
* ```
|
|
1075
|
+
*
|
|
1076
|
+
* @param camera A `THREE.PerspectiveCamera` or `THREE.OrthographicCamera` to be controlled.
|
|
1077
|
+
* @param domElement A `HTMLElement` for the draggable area, usually `renderer.domElement`.
|
|
1078
|
+
* @category Constructor
|
|
1079
|
+
*/
|
|
1080
|
+
constructor(
|
|
1081
|
+
camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera,
|
|
1082
|
+
domElement?: HTMLElement,
|
|
1083
|
+
);
|
|
1084
|
+
/*
|
|
1085
|
+
* The camera to be controlled
|
|
1086
|
+
* @category Properties
|
|
1087
|
+
*/
|
|
1088
|
+
camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera;
|
|
1089
|
+
/*
|
|
1090
|
+
* Whether or not the controls are enabled.
|
|
1091
|
+
* `false` to disable user dragging/touch-move, but all methods works.
|
|
1092
|
+
* @category Properties
|
|
1093
|
+
*/
|
|
1094
|
+
enabled: boolean;
|
|
1095
|
+
/*
|
|
1096
|
+
* Returns `true` if the controls are active updating.
|
|
1097
|
+
* readonly value.
|
|
1098
|
+
* @category Properties
|
|
1099
|
+
*/
|
|
1100
|
+
readonly active: boolean;
|
|
1101
|
+
/*
|
|
1102
|
+
* Getter for the current `ACTION`.
|
|
1103
|
+
* readonly value.
|
|
1104
|
+
* @category Properties
|
|
1105
|
+
*/
|
|
1106
|
+
readonly currentAction: ACTION;
|
|
1107
|
+
/*
|
|
1108
|
+
* get/set Current distance.
|
|
1109
|
+
* @category Properties
|
|
1110
|
+
*/
|
|
1111
|
+
distance: number;
|
|
1112
|
+
/*
|
|
1113
|
+
* get/set the azimuth angle (horizontal) in radians.
|
|
1114
|
+
* Every 360 degrees turn is added to `.azimuthAngle` value, which is accumulative.
|
|
1115
|
+
* @category Properties
|
|
1116
|
+
*/
|
|
1117
|
+
azimuthAngle: number;
|
|
1118
|
+
/*
|
|
1119
|
+
* get/set the polar angle (vertical) in radians.
|
|
1120
|
+
* @category Properties
|
|
1121
|
+
*/
|
|
1122
|
+
polarAngle: number;
|
|
1123
|
+
/*
|
|
1124
|
+
* Whether camera position should be enclosed in the boundary or not.
|
|
1125
|
+
* @category Properties
|
|
1126
|
+
*/
|
|
1127
|
+
boundaryEnclosesCamera: boolean;
|
|
1128
|
+
/*
|
|
1129
|
+
* Set drag-start, touches and wheel enable area in the domElement.
|
|
1130
|
+
* each values are between `0` and `1` inclusive, where `0` is left/top and `1` is right/bottom of the screen.
|
|
1131
|
+
* e.g. `{ x: 0, y: 0, width: 1, height: 1 }` for entire area.
|
|
1132
|
+
* @category Properties
|
|
1133
|
+
*/
|
|
1134
|
+
interactiveArea:
|
|
1135
|
+
| DOMRect
|
|
1136
|
+
| {
|
|
1137
|
+
x: number;
|
|
1138
|
+
y: number;
|
|
1139
|
+
width: number;
|
|
1140
|
+
height: number;
|
|
1141
|
+
};
|
|
1142
|
+
/**
|
|
1143
|
+
* Adds the specified event listener.
|
|
1144
|
+
* Applicable event types (which is `K`) are:
|
|
1145
|
+
* | Event name | Timing |
|
|
1146
|
+
* | ------------------- | ------ |
|
|
1147
|
+
* | `'controlstart'` | When the user starts to control the camera via mouse / touches. ¹ |
|
|
1148
|
+
* | `'control'` | When the user controls the camera (dragging). |
|
|
1149
|
+
* | `'controlend'` | When the user ends to control the camera. ¹ |
|
|
1150
|
+
* | `'transitionstart'` | When any kind of transition starts, either user control or using a method with `enableTransition = true` |
|
|
1151
|
+
* | `'update'` | When the camera position is updated. |
|
|
1152
|
+
* | `'wake'` | When the camera starts moving. |
|
|
1153
|
+
* | `'rest'` | When the camera movement is below `.restThreshold` ². |
|
|
1154
|
+
* | `'sleep'` | When the camera end moving. |
|
|
1155
|
+
*
|
|
1156
|
+
* 1. `mouseButtons.wheel` (Mouse wheel control) does not emit `'controlstart'` and `'controlend'`. `mouseButtons.wheel` uses scroll-event internally, and scroll-event happens intermittently. That means "start" and "end" cannot be detected.
|
|
1157
|
+
* 2. Due to damping, `sleep` will usually fire a few seconds after the camera _appears_ to have stopped moving. If you want to do something (e.g. enable UI, perform another transition) at the point when the camera has stopped, you probably want the `rest` event. This can be fine tuned using the `.restThreshold` parameter. See the [Rest and Sleep Example](https://yomotsu.github.io/camera-controls/examples/rest-and-sleep.html).
|
|
1158
|
+
*
|
|
1159
|
+
* e.g.
|
|
1160
|
+
* ```
|
|
1161
|
+
* cameraControl.addEventListener( 'controlstart', myCallbackFunction );
|
|
1162
|
+
* ```
|
|
1163
|
+
* @param type event name
|
|
1164
|
+
* @param listener handler function
|
|
1165
|
+
* @category Methods
|
|
1166
|
+
*/
|
|
1167
|
+
addEventListener<K extends keyof CameraControlsEventMap>(
|
|
1168
|
+
type: K,
|
|
1169
|
+
listener: (event: CameraControlsEventMap[K]) => any,
|
|
1170
|
+
): void;
|
|
1171
|
+
/**
|
|
1172
|
+
* Removes the specified event listener
|
|
1173
|
+
* e.g.
|
|
1174
|
+
* ```
|
|
1175
|
+
* cameraControl.addEventListener( 'controlstart', myCallbackFunction );
|
|
1176
|
+
* ```
|
|
1177
|
+
* @param type event name
|
|
1178
|
+
* @param listener handler function
|
|
1179
|
+
* @category Methods
|
|
1180
|
+
*/
|
|
1181
|
+
removeEventListener<K extends keyof CameraControlsEventMap>(
|
|
1182
|
+
type: K,
|
|
1183
|
+
listener: (event: CameraControlsEventMap[K]) => any,
|
|
1184
|
+
): void;
|
|
1185
|
+
/**
|
|
1186
|
+
* Rotate azimuthal angle(horizontal) and polar angle(vertical).
|
|
1187
|
+
* Every value is added to the current value.
|
|
1188
|
+
* @param azimuthAngle Azimuth rotate angle. In radian.
|
|
1189
|
+
* @param polarAngle Polar rotate angle. In radian.
|
|
1190
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1191
|
+
* @category Methods
|
|
1192
|
+
*/
|
|
1193
|
+
rotate(
|
|
1194
|
+
azimuthAngle: number,
|
|
1195
|
+
polarAngle: number,
|
|
1196
|
+
enableTransition?: boolean,
|
|
1197
|
+
): Promise<void>;
|
|
1198
|
+
/**
|
|
1199
|
+
* Rotate azimuthal angle(horizontal) to the given angle and keep the same polar angle(vertical) target.
|
|
1200
|
+
*
|
|
1201
|
+
* e.g.
|
|
1202
|
+
* ```
|
|
1203
|
+
* cameraControls.rotateAzimuthTo( 30 * THREE.MathUtils.DEG2RAD, true );
|
|
1204
|
+
* ```
|
|
1205
|
+
* @param azimuthAngle Azimuth rotate angle. In radian.
|
|
1206
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1207
|
+
* @category Methods
|
|
1208
|
+
*/
|
|
1209
|
+
rotateAzimuthTo(
|
|
1210
|
+
azimuthAngle: number,
|
|
1211
|
+
enableTransition?: boolean,
|
|
1212
|
+
): Promise<void>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Rotate polar angle(vertical) to the given angle and keep the same azimuthal angle(horizontal) target.
|
|
1215
|
+
*
|
|
1216
|
+
* e.g.
|
|
1217
|
+
* ```
|
|
1218
|
+
* cameraControls.rotatePolarTo( 30 * THREE.MathUtils.DEG2RAD, true );
|
|
1219
|
+
* ```
|
|
1220
|
+
* @param polarAngle Polar rotate angle. In radian.
|
|
1221
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1222
|
+
* @category Methods
|
|
1223
|
+
*/
|
|
1224
|
+
rotatePolarTo(polarAngle: number, enableTransition?: boolean): Promise<void>;
|
|
1225
|
+
/**
|
|
1226
|
+
* Rotate azimuthal angle(horizontal) and polar angle(vertical) to the given angle.
|
|
1227
|
+
* Camera view will rotate over the orbit pivot absolutely:
|
|
1228
|
+
*
|
|
1229
|
+
* azimuthAngle
|
|
1230
|
+
* ```
|
|
1231
|
+
* 0º
|
|
1232
|
+
* \
|
|
1233
|
+
* 90º -----+----- -90º
|
|
1234
|
+
* \
|
|
1235
|
+
* 180º
|
|
1236
|
+
* ```
|
|
1237
|
+
* | direction | angle |
|
|
1238
|
+
* | --------- | ---------------------- |
|
|
1239
|
+
* | front | 0º |
|
|
1240
|
+
* | left | 90º (`Math.PI / 2`) |
|
|
1241
|
+
* | right | -90º (`- Math.PI / 2`) |
|
|
1242
|
+
* | back | 180º (`Math.PI`) |
|
|
1243
|
+
*
|
|
1244
|
+
* polarAngle
|
|
1245
|
+
* ```
|
|
1246
|
+
* 180º
|
|
1247
|
+
* |
|
|
1248
|
+
* 90º
|
|
1249
|
+
* |
|
|
1250
|
+
* 0º
|
|
1251
|
+
* ```
|
|
1252
|
+
* | direction | angle |
|
|
1253
|
+
* | -------------------- | ---------------------- |
|
|
1254
|
+
* | top/sky | 180º (`Math.PI`) |
|
|
1255
|
+
* | horizontal from view | 90º (`Math.PI / 2`) |
|
|
1256
|
+
* | bottom/floor | 0º |
|
|
1257
|
+
*
|
|
1258
|
+
* @param azimuthAngle Azimuth rotate angle to. In radian.
|
|
1259
|
+
* @param polarAngle Polar rotate angle to. In radian.
|
|
1260
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1261
|
+
* @category Methods
|
|
1262
|
+
*/
|
|
1263
|
+
rotateTo(
|
|
1264
|
+
azimuthAngle: number,
|
|
1265
|
+
polarAngle: number,
|
|
1266
|
+
enableTransition?: boolean,
|
|
1267
|
+
): Promise<void>;
|
|
1268
|
+
/**
|
|
1269
|
+
* Dolly in/out camera position.
|
|
1270
|
+
* @param distance Distance of dollyIn. Negative number for dollyOut.
|
|
1271
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1272
|
+
* @category Methods
|
|
1273
|
+
*/
|
|
1274
|
+
dolly(distance: number, enableTransition?: boolean): Promise<void>;
|
|
1275
|
+
/**
|
|
1276
|
+
* Dolly in/out camera position to given distance.
|
|
1277
|
+
* @param distance Distance of dolly.
|
|
1278
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1279
|
+
* @category Methods
|
|
1280
|
+
*/
|
|
1281
|
+
dollyTo(distance: number, enableTransition?: boolean): Promise<void>;
|
|
1282
|
+
protected _dollyToNoClamp(
|
|
1283
|
+
distance: number,
|
|
1284
|
+
enableTransition?: boolean,
|
|
1285
|
+
): Promise<void>;
|
|
1286
|
+
/**
|
|
1287
|
+
* Dolly in, but does not change the distance between the target and the camera, and moves the target position instead.
|
|
1288
|
+
* Specify a negative value for dolly out.
|
|
1289
|
+
* @param distance Distance of dolly.
|
|
1290
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1291
|
+
* @category Methods
|
|
1292
|
+
*/
|
|
1293
|
+
dollyInFixed(distance: number, enableTransition?: boolean): Promise<void>;
|
|
1294
|
+
/**
|
|
1295
|
+
* Zoom in/out camera. The value is added to camera zoom.
|
|
1296
|
+
* Limits set with `.minZoom` and `.maxZoom`
|
|
1297
|
+
* @param zoomStep zoom scale
|
|
1298
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1299
|
+
* @category Methods
|
|
1300
|
+
*/
|
|
1301
|
+
zoom(zoomStep: number, enableTransition?: boolean): Promise<void>;
|
|
1302
|
+
/**
|
|
1303
|
+
* Zoom in/out camera to given scale. The value overwrites camera zoom.
|
|
1304
|
+
* Limits set with .minZoom and .maxZoom
|
|
1305
|
+
* @param zoom
|
|
1306
|
+
* @param enableTransition
|
|
1307
|
+
* @category Methods
|
|
1308
|
+
*/
|
|
1309
|
+
zoomTo(zoom: number, enableTransition?: boolean): Promise<void>;
|
|
1310
|
+
/**
|
|
1311
|
+
* @deprecated `pan()` has been renamed to `truck()`
|
|
1312
|
+
* @category Methods
|
|
1313
|
+
*/
|
|
1314
|
+
pan(x: number, y: number, enableTransition?: boolean): Promise<void>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Truck and pedestal camera using current azimuthal angle
|
|
1317
|
+
* @param x Horizontal translate amount
|
|
1318
|
+
* @param y Vertical translate amount
|
|
1319
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1320
|
+
* @category Methods
|
|
1321
|
+
*/
|
|
1322
|
+
truck(x: number, y: number, enableTransition?: boolean): Promise<void>;
|
|
1323
|
+
/**
|
|
1324
|
+
* Move forward / backward.
|
|
1325
|
+
* @param distance Amount to move forward / backward. Negative value to move backward
|
|
1326
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1327
|
+
* @category Methods
|
|
1328
|
+
*/
|
|
1329
|
+
forward(distance: number, enableTransition?: boolean): Promise<void>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Move up / down.
|
|
1332
|
+
* @param height Amount to move up / down. Negative value to move down
|
|
1333
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1334
|
+
* @category Methods
|
|
1335
|
+
*/
|
|
1336
|
+
elevate(height: number, enableTransition?: boolean): Promise<void>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Move target position to given point.
|
|
1339
|
+
* @param x x coord to move center position
|
|
1340
|
+
* @param y y coord to move center position
|
|
1341
|
+
* @param z z coord to move center position
|
|
1342
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1343
|
+
* @category Methods
|
|
1344
|
+
*/
|
|
1345
|
+
moveTo(
|
|
1346
|
+
x: number,
|
|
1347
|
+
y: number,
|
|
1348
|
+
z: number,
|
|
1349
|
+
enableTransition?: boolean,
|
|
1350
|
+
): Promise<void>;
|
|
1351
|
+
/**
|
|
1352
|
+
* Look in the given point direction.
|
|
1353
|
+
* @param x point x.
|
|
1354
|
+
* @param y point y.
|
|
1355
|
+
* @param z point z.
|
|
1356
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1357
|
+
* @returns Transition end promise
|
|
1358
|
+
* @category Methods
|
|
1359
|
+
*/
|
|
1360
|
+
lookInDirectionOf(
|
|
1361
|
+
x: number,
|
|
1362
|
+
y: number,
|
|
1363
|
+
z: number,
|
|
1364
|
+
enableTransition?: boolean,
|
|
1365
|
+
): Promise<void>;
|
|
1366
|
+
/**
|
|
1367
|
+
* Fit the viewport to the box or the bounding box of the object, using the nearest axis. paddings are in unit.
|
|
1368
|
+
* set `cover: true` to fill enter screen.
|
|
1369
|
+
* e.g.
|
|
1370
|
+
* ```
|
|
1371
|
+
* cameraControls.fitToBox( myMesh );
|
|
1372
|
+
* ```
|
|
1373
|
+
* @param box3OrObject Axis aligned bounding box to fit the view.
|
|
1374
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1375
|
+
* @param options | `<object>` { cover: boolean, paddingTop: number, paddingLeft: number, paddingBottom: number, paddingRight: number }
|
|
1376
|
+
* @returns Transition end promise
|
|
1377
|
+
* @category Methods
|
|
1378
|
+
*/
|
|
1379
|
+
fitToBox(
|
|
1380
|
+
box3OrObject: _THREE.Box3 | _THREE.Object3D,
|
|
1381
|
+
enableTransition: boolean,
|
|
1382
|
+
{
|
|
1383
|
+
cover,
|
|
1384
|
+
paddingLeft,
|
|
1385
|
+
paddingRight,
|
|
1386
|
+
paddingBottom,
|
|
1387
|
+
paddingTop,
|
|
1388
|
+
}?: Partial<FitToOptions>,
|
|
1389
|
+
): Promise<void[]>;
|
|
1390
|
+
/**
|
|
1391
|
+
* Fit the viewport to the sphere or the bounding sphere of the object.
|
|
1392
|
+
* @param sphereOrMesh
|
|
1393
|
+
* @param enableTransition
|
|
1394
|
+
* @category Methods
|
|
1395
|
+
*/
|
|
1396
|
+
fitToSphere(
|
|
1397
|
+
sphereOrMesh: _THREE.Sphere | _THREE.Object3D,
|
|
1398
|
+
enableTransition: boolean,
|
|
1399
|
+
): Promise<void[]>;
|
|
1400
|
+
/**
|
|
1401
|
+
* Look at the `target` from the `position`.
|
|
1402
|
+
* @param positionX
|
|
1403
|
+
* @param positionY
|
|
1404
|
+
* @param positionZ
|
|
1405
|
+
* @param targetX
|
|
1406
|
+
* @param targetY
|
|
1407
|
+
* @param targetZ
|
|
1408
|
+
* @param enableTransition
|
|
1409
|
+
* @category Methods
|
|
1410
|
+
*/
|
|
1411
|
+
setLookAt(
|
|
1412
|
+
positionX: number,
|
|
1413
|
+
positionY: number,
|
|
1414
|
+
positionZ: number,
|
|
1415
|
+
targetX: number,
|
|
1416
|
+
targetY: number,
|
|
1417
|
+
targetZ: number,
|
|
1418
|
+
enableTransition?: boolean,
|
|
1419
|
+
): Promise<void>;
|
|
1420
|
+
/**
|
|
1421
|
+
* Similar to setLookAt, but it interpolates between two states.
|
|
1422
|
+
* @param positionAX
|
|
1423
|
+
* @param positionAY
|
|
1424
|
+
* @param positionAZ
|
|
1425
|
+
* @param targetAX
|
|
1426
|
+
* @param targetAY
|
|
1427
|
+
* @param targetAZ
|
|
1428
|
+
* @param positionBX
|
|
1429
|
+
* @param positionBY
|
|
1430
|
+
* @param positionBZ
|
|
1431
|
+
* @param targetBX
|
|
1432
|
+
* @param targetBY
|
|
1433
|
+
* @param targetBZ
|
|
1434
|
+
* @param t
|
|
1435
|
+
* @param enableTransition
|
|
1436
|
+
* @category Methods
|
|
1437
|
+
*/
|
|
1438
|
+
lerpLookAt(
|
|
1439
|
+
positionAX: number,
|
|
1440
|
+
positionAY: number,
|
|
1441
|
+
positionAZ: number,
|
|
1442
|
+
targetAX: number,
|
|
1443
|
+
targetAY: number,
|
|
1444
|
+
targetAZ: number,
|
|
1445
|
+
positionBX: number,
|
|
1446
|
+
positionBY: number,
|
|
1447
|
+
positionBZ: number,
|
|
1448
|
+
targetBX: number,
|
|
1449
|
+
targetBY: number,
|
|
1450
|
+
targetBZ: number,
|
|
1451
|
+
t: number,
|
|
1452
|
+
enableTransition?: boolean,
|
|
1453
|
+
): Promise<void>;
|
|
1454
|
+
/**
|
|
1455
|
+
* Set angle and distance by given position.
|
|
1456
|
+
* An alias of `setLookAt()`, without target change. Thus keep gazing at the current target
|
|
1457
|
+
* @param positionX
|
|
1458
|
+
* @param positionY
|
|
1459
|
+
* @param positionZ
|
|
1460
|
+
* @param enableTransition
|
|
1461
|
+
* @category Methods
|
|
1462
|
+
*/
|
|
1463
|
+
setPosition(
|
|
1464
|
+
positionX: number,
|
|
1465
|
+
positionY: number,
|
|
1466
|
+
positionZ: number,
|
|
1467
|
+
enableTransition?: boolean,
|
|
1468
|
+
): Promise<void>;
|
|
1469
|
+
/**
|
|
1470
|
+
* Set the target position where gaze at.
|
|
1471
|
+
* An alias of `setLookAt()`, without position change. Thus keep the same position.
|
|
1472
|
+
* @param targetX
|
|
1473
|
+
* @param targetY
|
|
1474
|
+
* @param targetZ
|
|
1475
|
+
* @param enableTransition
|
|
1476
|
+
* @category Methods
|
|
1477
|
+
*/
|
|
1478
|
+
setTarget(
|
|
1479
|
+
targetX: number,
|
|
1480
|
+
targetY: number,
|
|
1481
|
+
targetZ: number,
|
|
1482
|
+
enableTransition?: boolean,
|
|
1483
|
+
): Promise<void>;
|
|
1484
|
+
/**
|
|
1485
|
+
* Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly.
|
|
1486
|
+
* @param x
|
|
1487
|
+
* @param y
|
|
1488
|
+
* @param z
|
|
1489
|
+
* @param enableTransition
|
|
1490
|
+
* @category Methods
|
|
1491
|
+
*/
|
|
1492
|
+
setFocalOffset(
|
|
1493
|
+
x: number,
|
|
1494
|
+
y: number,
|
|
1495
|
+
z: number,
|
|
1496
|
+
enableTransition?: boolean,
|
|
1497
|
+
): Promise<void>;
|
|
1498
|
+
/**
|
|
1499
|
+
* Set orbit point without moving the camera.
|
|
1500
|
+
* SHOULD NOT RUN DURING ANIMATIONS. `setOrbitPoint()` will immediately fix the positions.
|
|
1501
|
+
* @param targetX
|
|
1502
|
+
* @param targetY
|
|
1503
|
+
* @param targetZ
|
|
1504
|
+
* @category Methods
|
|
1505
|
+
*/
|
|
1506
|
+
setOrbitPoint(targetX: number, targetY: number, targetZ: number): void;
|
|
1507
|
+
/**
|
|
1508
|
+
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
1509
|
+
* @param box3
|
|
1510
|
+
* @category Methods
|
|
1511
|
+
*/
|
|
1512
|
+
setBoundary(box3?: _THREE.Box3): void;
|
|
1513
|
+
/** Keep the camera and near plane above a surface, with a minimum view elevation (default 5 degrees). */
|
|
1514
|
+
setBoundaryPlane(plane?: _THREE.Plane, minElevationAngle?: number): void;
|
|
1515
|
+
/**
|
|
1516
|
+
* Set (or unset) the current viewport.
|
|
1517
|
+
* Set this when you want to use renderer viewport and .dollyToCursor feature at the same time.
|
|
1518
|
+
* @param viewportOrX
|
|
1519
|
+
* @param y
|
|
1520
|
+
* @param width
|
|
1521
|
+
* @param height
|
|
1522
|
+
* @category Methods
|
|
1523
|
+
*/
|
|
1524
|
+
setViewport(
|
|
1525
|
+
viewportOrX: _THREE.Vector4 | number | null,
|
|
1526
|
+
y: number,
|
|
1527
|
+
width: number,
|
|
1528
|
+
height: number,
|
|
1529
|
+
): void;
|
|
1530
|
+
/**
|
|
1531
|
+
* Calculate the distance to fit the box.
|
|
1532
|
+
* @param width box width
|
|
1533
|
+
* @param height box height
|
|
1534
|
+
* @param depth box depth
|
|
1535
|
+
* @returns distance
|
|
1536
|
+
* @category Methods
|
|
1537
|
+
*/
|
|
1538
|
+
getDistanceToFitBox(
|
|
1539
|
+
width: number,
|
|
1540
|
+
height: number,
|
|
1541
|
+
depth: number,
|
|
1542
|
+
cover?: boolean,
|
|
1543
|
+
): number;
|
|
1544
|
+
/**
|
|
1545
|
+
* Calculate the distance to fit the sphere.
|
|
1546
|
+
* @param radius sphere radius
|
|
1547
|
+
* @returns distance
|
|
1548
|
+
* @category Methods
|
|
1549
|
+
*/
|
|
1550
|
+
getDistanceToFitSphere(radius: number): number;
|
|
1551
|
+
/**
|
|
1552
|
+
* Returns the orbit center position, where the camera looking at.
|
|
1553
|
+
* @param out The receiving Vector3 instance to copy the result
|
|
1554
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1555
|
+
* @category Methods
|
|
1556
|
+
*/
|
|
1557
|
+
getTarget(out: _THREE.Vector3, receiveEndValue?: boolean): _THREE.Vector3;
|
|
1558
|
+
/**
|
|
1559
|
+
* Returns the camera position.
|
|
1560
|
+
* @param out The receiving Vector3 instance to copy the result
|
|
1561
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1562
|
+
* @category Methods
|
|
1563
|
+
*/
|
|
1564
|
+
getPosition(out: _THREE.Vector3, receiveEndValue?: boolean): _THREE.Vector3;
|
|
1565
|
+
/**
|
|
1566
|
+
* Returns the spherical coordinates of the orbit.
|
|
1567
|
+
* @param out The receiving Spherical instance to copy the result
|
|
1568
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1569
|
+
* @category Methods
|
|
1570
|
+
*/
|
|
1571
|
+
getSpherical(
|
|
1572
|
+
out: _THREE.Spherical,
|
|
1573
|
+
receiveEndValue?: boolean,
|
|
1574
|
+
): _THREE.Spherical;
|
|
1575
|
+
/**
|
|
1576
|
+
* Returns the focal offset, which is how much the camera appears to be translated in screen parallel coordinates.
|
|
1577
|
+
* @param out The receiving Vector3 instance to copy the result
|
|
1578
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1579
|
+
* @category Methods
|
|
1580
|
+
*/
|
|
1581
|
+
getFocalOffset(
|
|
1582
|
+
out: _THREE.Vector3,
|
|
1583
|
+
receiveEndValue?: boolean,
|
|
1584
|
+
): _THREE.Vector3;
|
|
1585
|
+
/**
|
|
1586
|
+
* Normalize camera azimuth angle rotation between 0 and 360 degrees.
|
|
1587
|
+
* @category Methods
|
|
1588
|
+
*/
|
|
1589
|
+
normalizeRotations(): void;
|
|
1590
|
+
/**
|
|
1591
|
+
* stop all transitions.
|
|
1592
|
+
*/
|
|
1593
|
+
stop(): void;
|
|
1594
|
+
/**
|
|
1595
|
+
* Reset all rotation and position to defaults.
|
|
1596
|
+
* @param enableTransition
|
|
1597
|
+
* @category Methods
|
|
1598
|
+
*/
|
|
1599
|
+
reset(enableTransition?: boolean): Promise<void[]>;
|
|
1600
|
+
/**
|
|
1601
|
+
* Set current camera position as the default position.
|
|
1602
|
+
* @category Methods
|
|
1603
|
+
*/
|
|
1604
|
+
saveState(): void;
|
|
1605
|
+
/**
|
|
1606
|
+
* Sync camera-up direction.
|
|
1607
|
+
* When camera-up vector is changed, `.updateCameraUp()` must be called.
|
|
1608
|
+
* @category Methods
|
|
1609
|
+
*/
|
|
1610
|
+
updateCameraUp(): void;
|
|
1611
|
+
/**
|
|
1612
|
+
* Apply current camera-up direction to the camera.
|
|
1613
|
+
* The orbit system will be re-initialized with the current position.
|
|
1614
|
+
* @category Methods
|
|
1615
|
+
*/
|
|
1616
|
+
applyCameraUp(): void;
|
|
1617
|
+
/**
|
|
1618
|
+
* Update camera position and directions.
|
|
1619
|
+
* This should be called in your tick loop every time, and returns true if re-rendering is needed.
|
|
1620
|
+
* @param delta
|
|
1621
|
+
* @returns updated
|
|
1622
|
+
* @category Methods
|
|
1623
|
+
*/
|
|
1624
|
+
update(delta: number): boolean;
|
|
1625
|
+
/**
|
|
1626
|
+
* Get all state in JSON string
|
|
1627
|
+
* @category Methods
|
|
1628
|
+
*/
|
|
1629
|
+
toJSON(): string;
|
|
1630
|
+
/**
|
|
1631
|
+
* Reproduce the control state with JSON. enableTransition is where anim or not in a boolean.
|
|
1632
|
+
* @param json
|
|
1633
|
+
* @param enableTransition
|
|
1634
|
+
* @category Methods
|
|
1635
|
+
*/
|
|
1636
|
+
fromJSON(json: string, enableTransition?: boolean): void;
|
|
1637
|
+
/**
|
|
1638
|
+
* Attach all internal event handlers to enable drag control.
|
|
1639
|
+
* @category Methods
|
|
1640
|
+
*/
|
|
1641
|
+
connect(domElement: HTMLElement): void;
|
|
1642
|
+
/**
|
|
1643
|
+
* Detach all internal event handlers to disable drag control.
|
|
1644
|
+
*/
|
|
1645
|
+
disconnect(): void;
|
|
1646
|
+
/**
|
|
1647
|
+
* Dispose the cameraControls instance itself, remove all eventListeners.
|
|
1648
|
+
* @category Methods
|
|
1649
|
+
*/
|
|
1650
|
+
dispose(): void;
|
|
1651
|
+
protected _getTargetDirection(out: _THREE.Vector3): _THREE.Vector3;
|
|
1652
|
+
protected _getCameraDirection(out: _THREE.Vector3): _THREE.Vector3;
|
|
1653
|
+
protected _findPointerById(pointerId: number): PointerInput | undefined;
|
|
1654
|
+
protected _findPointerByMouseButton(
|
|
1655
|
+
mouseButton: MOUSE_BUTTON,
|
|
1656
|
+
): PointerInput | undefined;
|
|
1657
|
+
protected _disposePointer(pointer: PointerInput): void;
|
|
1658
|
+
protected _encloseToBoundary(
|
|
1659
|
+
position: _THREE.Vector3,
|
|
1660
|
+
offset: _THREE.Vector3,
|
|
1661
|
+
friction: number,
|
|
1662
|
+
): _THREE.Vector3;
|
|
1663
|
+
protected _updateNearPlaneCorners(): void;
|
|
1664
|
+
protected _truckInternal: (
|
|
1665
|
+
deltaX: number,
|
|
1666
|
+
deltaY: number,
|
|
1667
|
+
dragToOffset: boolean,
|
|
1668
|
+
screenSpacePanning: boolean,
|
|
1669
|
+
) => void;
|
|
1670
|
+
protected _rotateInternal: (deltaX: number, deltaY: number) => void;
|
|
1671
|
+
protected _dollyInternal: (delta: number, x: number, y: number) => void;
|
|
1672
|
+
protected _zoomInternal: (delta: number, x: number, y: number) => void;
|
|
1673
|
+
protected _collisionTest(): number;
|
|
1674
|
+
/**
|
|
1675
|
+
* Get its client rect and package into given `DOMRect` .
|
|
1676
|
+
*/
|
|
1677
|
+
protected _getClientRect(target: DOMRect): DOMRect | undefined;
|
|
1678
|
+
protected _createOnRestPromise(resolveImmediately: boolean): Promise<void>;
|
|
1679
|
+
protected _addAllEventListeners(_domElement: HTMLElement): void;
|
|
1680
|
+
protected _removeAllEventListeners(): void;
|
|
1681
|
+
/*
|
|
1682
|
+
* backward compatible
|
|
1683
|
+
* @deprecated use smoothTime (in seconds) instead
|
|
1684
|
+
* @category Properties
|
|
1685
|
+
|
|
1686
|
+
|
|
1687
|
+
* backward compatible
|
|
1688
|
+
* @deprecated use smoothTime (in seconds) instead
|
|
1689
|
+
* @category Properties
|
|
1690
|
+
*/
|
|
1691
|
+
dampingFactor: number;
|
|
1692
|
+
/*
|
|
1693
|
+
* backward compatible
|
|
1694
|
+
* @deprecated use draggingSmoothTime (in seconds) instead
|
|
1695
|
+
* @category Properties
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
* backward compatible
|
|
1699
|
+
* @deprecated use draggingSmoothTime (in seconds) instead
|
|
1700
|
+
* @category Properties
|
|
1701
|
+
*/
|
|
1702
|
+
draggingDampingFactor: number;
|
|
1703
|
+
static createBoundingSphere(
|
|
1704
|
+
object3d: _THREE.Object3D,
|
|
1705
|
+
out?: _THREE.Sphere,
|
|
1706
|
+
): _THREE.Sphere;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
declare interface CameraControlsEventMap {
|
|
1710
|
+
update: {
|
|
1711
|
+
type: 'update';
|
|
1712
|
+
};
|
|
1713
|
+
wake: {
|
|
1714
|
+
type: 'wake';
|
|
1715
|
+
};
|
|
1716
|
+
rest: {
|
|
1717
|
+
type: 'rest';
|
|
1718
|
+
};
|
|
1719
|
+
sleep: {
|
|
1720
|
+
type: 'sleep';
|
|
1721
|
+
};
|
|
1722
|
+
transitionstart: {
|
|
1723
|
+
type: 'transitionstart';
|
|
1724
|
+
};
|
|
1725
|
+
controlstart: {
|
|
1726
|
+
type: 'controlstart';
|
|
1727
|
+
};
|
|
1728
|
+
control: {
|
|
1729
|
+
type: 'control';
|
|
1730
|
+
};
|
|
1731
|
+
controlend: {
|
|
1732
|
+
type: 'controlend';
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
declare class CameraPages extends OrigonPages<PerspectiveCamera_2> {
|
|
1737
|
+
get camera(): PerspectiveCamera_2;
|
|
1738
|
+
width: number;
|
|
1739
|
+
height: number;
|
|
1740
|
+
private _cachedMatrixWorld;
|
|
1741
|
+
private _cachedMatrixWorldInverse;
|
|
1742
|
+
private externallySyncedCameras;
|
|
1743
|
+
private ownedCameras;
|
|
1744
|
+
constructor(options: Options_3);
|
|
1745
|
+
addPerspectiveCamera(cameraParams?: {
|
|
1746
|
+
fov: number;
|
|
1747
|
+
aspect?: number;
|
|
1748
|
+
near: number;
|
|
1749
|
+
far: number;
|
|
1750
|
+
up: Vector3;
|
|
1751
|
+
}, index?: number): PerspectiveCamera_2;
|
|
1752
|
+
setPageActive(index: number): void;
|
|
1753
|
+
setSize(width: number, height: number): void;
|
|
1754
|
+
setAspect(aspect: number, c?: PerspectiveCamera_2): void;
|
|
1755
|
+
cloneCamera(index?: number): PerspectiveCamera_2;
|
|
1756
|
+
createCameraClone(): PerspectiveCamera_2;
|
|
1757
|
+
removePage(index: number, callback?: (camera: PerspectiveCamera_2) => void): void;
|
|
1758
|
+
sync(cameraInput: PerspectiveCamera_2 | {
|
|
1759
|
+
fov: number;
|
|
1760
|
+
viewMatrix: any;
|
|
1761
|
+
inverseViewMatrix: any;
|
|
1762
|
+
type?: string;
|
|
1763
|
+
}): void;
|
|
1764
|
+
update(delta: number, elapsed: number): void;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
declare interface CameraParams {
|
|
1768
|
+
fov: number;
|
|
1769
|
+
near: number;
|
|
1770
|
+
far: number;
|
|
1771
|
+
up: Vector3;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
339
1774
|
declare class Circle extends MeshObject {
|
|
340
1775
|
objectType: string;
|
|
341
1776
|
create(): void;
|
|
@@ -416,13 +1851,13 @@ declare interface CityOptions {
|
|
|
416
1851
|
|
|
417
1852
|
declare class CityPlane extends MeshObject {
|
|
418
1853
|
objectType: string;
|
|
419
|
-
options:
|
|
420
|
-
constructor(options:
|
|
421
|
-
plane:
|
|
1854
|
+
options: Options_23;
|
|
1855
|
+
constructor(options: Options_23);
|
|
1856
|
+
plane: _THREE.BufferGeometry;
|
|
422
1857
|
water?: Water;
|
|
423
1858
|
create(): Promise<void>;
|
|
424
1859
|
rebuildFromScene(): void;
|
|
425
|
-
addWater(normalMaps: [
|
|
1860
|
+
addWater(normalMaps: [_THREE.Texture, _THREE.Texture]): void;
|
|
426
1861
|
dispose(): void;
|
|
427
1862
|
}
|
|
428
1863
|
|
|
@@ -442,11 +1877,239 @@ export declare function collectSceneResourceReuse(target: any, candidates: reado
|
|
|
442
1877
|
/** Configuration and alias values are additional conservative resource roots. */
|
|
443
1878
|
export declare function collectStructureResources(graph: Record<string, any>, roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]): StructureResources;
|
|
444
1879
|
|
|
1880
|
+
/**
|
|
1881
|
+
* 标签碰撞检测管理器
|
|
1882
|
+
* 参考 Mapbox symbol-placement 实现
|
|
1883
|
+
*
|
|
1884
|
+
* 使用方式:
|
|
1885
|
+
* ```ts
|
|
1886
|
+
* const manager = new CollisionManager({ padding: 4 });
|
|
1887
|
+
* manager.add(node, { priority: 10 });
|
|
1888
|
+
* manager.update(camera); // 在渲染循环中调用
|
|
1889
|
+
* ```
|
|
1890
|
+
*/
|
|
1891
|
+
declare class CollisionManager {
|
|
1892
|
+
private labels;
|
|
1893
|
+
private options;
|
|
1894
|
+
private lastUpdateTime;
|
|
1895
|
+
private camera?;
|
|
1896
|
+
private animationFrameId?;
|
|
1897
|
+
private isUpdating;
|
|
1898
|
+
private dirty;
|
|
1899
|
+
private disposed;
|
|
1900
|
+
private viewportWidth?;
|
|
1901
|
+
private viewportHeight?;
|
|
1902
|
+
constructor(options?: CollisionManagerOptions);
|
|
1903
|
+
/**
|
|
1904
|
+
* 添加标签到碰撞检测系统
|
|
1905
|
+
* @param node Node 实例
|
|
1906
|
+
*/
|
|
1907
|
+
add(node: NodeObject, options?: {
|
|
1908
|
+
priority?: number;
|
|
1909
|
+
}): void;
|
|
1910
|
+
/**
|
|
1911
|
+
* 移除标签
|
|
1912
|
+
*/
|
|
1913
|
+
remove(node: NodeObject): void;
|
|
1914
|
+
/**
|
|
1915
|
+
* 更新标签优先级
|
|
1916
|
+
*/
|
|
1917
|
+
setPriority(node: NodeObject, priority: number): void;
|
|
1918
|
+
/**
|
|
1919
|
+
* 批量添加标签
|
|
1920
|
+
*/
|
|
1921
|
+
addBatch(nodes: NodeObject[], priorityFn?: (node: NodeObject, index: number) => number): void;
|
|
1922
|
+
/**
|
|
1923
|
+
* 启用/禁用碰撞检测
|
|
1924
|
+
*/
|
|
1925
|
+
setEnabled(enabled: boolean): void;
|
|
1926
|
+
/**
|
|
1927
|
+
* 更新碰撞检测(在渲染循环中调用)
|
|
1928
|
+
*/
|
|
1929
|
+
update(camera: Camera_3): void;
|
|
1930
|
+
/**
|
|
1931
|
+
* 强制立即更新
|
|
1932
|
+
*/
|
|
1933
|
+
forceUpdate(): void;
|
|
1934
|
+
private performCollisionDetection;
|
|
1935
|
+
private sameRect;
|
|
1936
|
+
/**
|
|
1937
|
+
* 检测矩形是否与已占用区域碰撞
|
|
1938
|
+
*/
|
|
1939
|
+
private checkCollision;
|
|
1940
|
+
/**
|
|
1941
|
+
* 检测两个矩形是否相交(包含 padding)
|
|
1942
|
+
*/
|
|
1943
|
+
private rectsIntersect;
|
|
1944
|
+
/**
|
|
1945
|
+
* 设置节点可见性(操作子元素,带淡入淡出)
|
|
1946
|
+
*/
|
|
1947
|
+
private setNodeVisibility;
|
|
1948
|
+
/**
|
|
1949
|
+
* 获取当前可见的标签数量
|
|
1950
|
+
*/
|
|
1951
|
+
getVisibleCount(): number;
|
|
1952
|
+
/**
|
|
1953
|
+
* 获取所有标签数量
|
|
1954
|
+
*/
|
|
1955
|
+
getTotalCount(): number;
|
|
1956
|
+
/**
|
|
1957
|
+
* 调试执行碰撞检测(带详细日志)
|
|
1958
|
+
*/
|
|
1959
|
+
debugRun(): void;
|
|
1960
|
+
/**
|
|
1961
|
+
* 清空所有标签
|
|
1962
|
+
*/
|
|
1963
|
+
clear(): void;
|
|
1964
|
+
private cancelUpdate;
|
|
1965
|
+
/**
|
|
1966
|
+
* 销毁管理器
|
|
1967
|
+
*/
|
|
1968
|
+
dispose(): void;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
declare interface CollisionManagerOptions {
|
|
1972
|
+
/** 标签之间的最小间距(像素) */
|
|
1973
|
+
padding?: number;
|
|
1974
|
+
/** 是否启用碰撞检测 */
|
|
1975
|
+
enabled?: boolean;
|
|
1976
|
+
/** 更新节流时间(毫秒) */
|
|
1977
|
+
throttleTime?: number;
|
|
1978
|
+
/** 视口边距,标签超出视口多少像素后隐藏 */
|
|
1979
|
+
viewportMargin?: number;
|
|
1980
|
+
/** 稳定性加成,当前显示的标签会获得额外优先级,避免频繁切换 */
|
|
1981
|
+
stabilityBonus?: number;
|
|
1982
|
+
/** 淡入淡出动画时间(毫秒),0 表示禁用 */
|
|
1983
|
+
fadeTime?: number;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
declare const ColorSpace: {
|
|
1987
|
+
readonly linearSRGB: "srgb-linear";
|
|
1988
|
+
readonly sRGB: "srgb";
|
|
1989
|
+
readonly none: "";
|
|
1990
|
+
};
|
|
1991
|
+
|
|
1992
|
+
/** WebGPU render pipeline. Compatibility controls retain the saved scene schema. */
|
|
1993
|
+
declare class Composer {
|
|
1994
|
+
renderer: WebGPURenderer;
|
|
1995
|
+
scene: Scene_2;
|
|
1996
|
+
camera: Camera_2;
|
|
1997
|
+
finalComposer: RenderPipeline;
|
|
1998
|
+
renderPass: {
|
|
1999
|
+
scene: Scene_2;
|
|
2000
|
+
camera: Camera_2;
|
|
2001
|
+
};
|
|
2002
|
+
bloomComposer?: RenderTarget;
|
|
2003
|
+
bloomComposerActive: boolean;
|
|
2004
|
+
bloomPass?: Omit<BloomParams, 'bloomAlphaType'> & {
|
|
2005
|
+
enabled: boolean;
|
|
2006
|
+
};
|
|
2007
|
+
ssaoPass?: SSAOParams & {
|
|
2008
|
+
enabled: boolean;
|
|
2009
|
+
output: number;
|
|
2010
|
+
};
|
|
2011
|
+
mixPass?: {
|
|
2012
|
+
enabled: boolean;
|
|
2013
|
+
uniforms: {
|
|
2014
|
+
bloomAlphaType: {
|
|
2015
|
+
value: 0 | 0.5 | 1;
|
|
2016
|
+
};
|
|
2017
|
+
};
|
|
2018
|
+
};
|
|
2019
|
+
outputPass: {
|
|
2020
|
+
outputTarget?: RenderTarget;
|
|
2021
|
+
uniforms: {
|
|
2022
|
+
premultiplieAlpha: {
|
|
2023
|
+
value: number;
|
|
2024
|
+
};
|
|
2025
|
+
};
|
|
2026
|
+
};
|
|
2027
|
+
bloomSelection: Set<BaseObject< Object3D<Object3DEventMap>>>;
|
|
2028
|
+
bloomLayer: Layers;
|
|
2029
|
+
active: boolean;
|
|
2030
|
+
options: Options_2;
|
|
2031
|
+
private readonly target;
|
|
2032
|
+
private overlayTarget?;
|
|
2033
|
+
private outputPipeline?;
|
|
2034
|
+
private readonly bloomRenderer;
|
|
2035
|
+
private bloomNode?;
|
|
2036
|
+
private aoNode?;
|
|
2037
|
+
private readonly views;
|
|
2038
|
+
private readonly bloomEnabled;
|
|
2039
|
+
private readonly aoEnabled;
|
|
2040
|
+
private readonly alphaMode;
|
|
2041
|
+
private readonly premultiply;
|
|
2042
|
+
private width;
|
|
2043
|
+
private height;
|
|
2044
|
+
private pixelRatio;
|
|
2045
|
+
private rendering;
|
|
2046
|
+
private disposed;
|
|
2047
|
+
private readonly presentation;
|
|
2048
|
+
private readonly gtaoLighting;
|
|
2049
|
+
private readonly gtaoViews;
|
|
2050
|
+
private readonly onCameraChange;
|
|
2051
|
+
private readonly onSceneChange;
|
|
2052
|
+
constructor(options: Options_2);
|
|
2053
|
+
private createDepthTexture;
|
|
2054
|
+
private resizeTargets;
|
|
2055
|
+
private rebuild;
|
|
2056
|
+
private activateView;
|
|
2057
|
+
changeCamera(camera: Camera_2): void;
|
|
2058
|
+
changeScene(scene: Scene_2): void;
|
|
2059
|
+
addOutputPass(): void;
|
|
2060
|
+
setPremultiplieAlpha(value: boolean): void;
|
|
2061
|
+
addSSAOPass(params: SSAOParams): void;
|
|
2062
|
+
addBloomPass(params: BloomParams): void;
|
|
2063
|
+
checkBloomComposerActive(): void;
|
|
2064
|
+
enable(): void;
|
|
2065
|
+
disable(): void;
|
|
2066
|
+
setSize(width: number, height: number): void;
|
|
2067
|
+
setPixelRatio(ratio: number): void;
|
|
2068
|
+
getSize(): Vector2;
|
|
2069
|
+
finalComposerRender(preserveOutput?: boolean): void;
|
|
2070
|
+
private renderFinal;
|
|
2071
|
+
pipViewportState: {
|
|
2072
|
+
x: number;
|
|
2073
|
+
y: number;
|
|
2074
|
+
width: number;
|
|
2075
|
+
height: number;
|
|
2076
|
+
} | null;
|
|
2077
|
+
private pipCamera?;
|
|
2078
|
+
setPipView(camera: Camera_2 | undefined, viewport: Composer['pipViewportState']): void;
|
|
2079
|
+
render(overlays?: () => void): void;
|
|
2080
|
+
private renderPresentation;
|
|
2081
|
+
private renderViews;
|
|
2082
|
+
dispose(): void;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
declare interface ComposerParams {
|
|
2086
|
+
multisampling: number;
|
|
2087
|
+
premultiplieAlpha: boolean;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
declare interface ConicLineMessage {
|
|
2091
|
+
projection?: 'cesium' | 'sphere';
|
|
2092
|
+
useGroups?: 0 | 1 | 2;
|
|
2093
|
+
useRTC?: boolean;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
declare interface ConicPolygonMessage {
|
|
2097
|
+
useGroups?: 0 | 1 | 2;
|
|
2098
|
+
hasTop?: boolean;
|
|
2099
|
+
topFirst?: boolean;
|
|
2100
|
+
hasBottom?: boolean;
|
|
2101
|
+
hasSide?: boolean;
|
|
2102
|
+
curvatureResolution?: number;
|
|
2103
|
+
projection?: 'cesium' | 'sphere';
|
|
2104
|
+
bbox?: number[];
|
|
2105
|
+
splitPolygons?: number;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
445
2108
|
declare class ContinentsBg extends GroupObject {
|
|
446
2109
|
objectType: string;
|
|
447
|
-
options:
|
|
2110
|
+
options: Options_18;
|
|
448
2111
|
mapArr: PlaneMap_2[];
|
|
449
|
-
constructor(options:
|
|
2112
|
+
constructor(options: Options_18);
|
|
450
2113
|
create(): Promise<void>;
|
|
451
2114
|
getLocationPosition(location: [number, number], name?: string, height?: number): [number, number, number] | undefined;
|
|
452
2115
|
private calculatePosition;
|
|
@@ -455,6 +2118,39 @@ declare class ContinentsBg extends GroupObject {
|
|
|
455
2118
|
dispose(): void;
|
|
456
2119
|
}
|
|
457
2120
|
|
|
2121
|
+
declare class ControlsPages extends OrigonPages<CameraControls> {
|
|
2122
|
+
options: Options_6;
|
|
2123
|
+
private viewport?;
|
|
2124
|
+
private controllerViewports;
|
|
2125
|
+
get cameraControls(): CameraControls;
|
|
2126
|
+
autoRotateSpeed: number;
|
|
2127
|
+
interactionEnabled: boolean;
|
|
2128
|
+
constructor(options: Options_6);
|
|
2129
|
+
addCameraControls(camera: PerspectiveCamera_2 | OrthographicCamera, index?: number): CameraControls;
|
|
2130
|
+
/** A detached controller for auxiliary views; it is not owned by a scene page. */
|
|
2131
|
+
createCameraControls(camera: PerspectiveCamera_2 | OrthographicCamera, acceptsInput?: (event: MouseEvent) => boolean): CameraControls;
|
|
2132
|
+
setViewport(viewport: ControlsViewport): void;
|
|
2133
|
+
applyViewport(controls: CameraControls, viewport: ControlsViewport): void;
|
|
2134
|
+
setPageActive(index: number): void;
|
|
2135
|
+
removePage(index: number): void;
|
|
2136
|
+
enable(): void;
|
|
2137
|
+
disable(): void;
|
|
2138
|
+
update(delta: number, elapsed: number): void;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
declare interface ControlsParams {
|
|
2142
|
+
domElement: HTMLElement;
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
declare interface ControlsViewport {
|
|
2146
|
+
x: number;
|
|
2147
|
+
y: number;
|
|
2148
|
+
width: number;
|
|
2149
|
+
height: number;
|
|
2150
|
+
fullWidth: number;
|
|
2151
|
+
fullHeight: number;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
458
2154
|
/** Copy only the copied branches; source nodes and existing resource rows keep
|
|
459
2155
|
* their identity, including when several copies share one procedural geometry. */
|
|
460
2156
|
export declare function copyNativeGeometries(document: VisSceneDocument, sceneId: string, pairs: readonly {
|
|
@@ -504,8 +2200,57 @@ export declare function createSceneResourceReuseSession(candidates?: readonly Sc
|
|
|
504
2200
|
}) => Required<ReusableObjectResources>;
|
|
505
2201
|
};
|
|
506
2202
|
|
|
507
|
-
/** Reuse renderer indexes while retaining material asset aliases and prefab dependencies. */
|
|
508
|
-
export declare function createStructureResourceCollector(graph: Record<string, any>): (roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]) => StructureResources;
|
|
2203
|
+
/** Reuse renderer indexes while retaining material asset aliases and prefab dependencies. */
|
|
2204
|
+
export declare function createStructureResourceCollector(graph: Record<string, any>): (roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]) => StructureResources;
|
|
2205
|
+
|
|
2206
|
+
declare type CSSObject = CSS2DObject | CSS3DObject | CSS3DSprite;
|
|
2207
|
+
|
|
2208
|
+
declare class CSSRendererController {
|
|
2209
|
+
css2Drenderer?: CSS2DRenderer;
|
|
2210
|
+
css3Drenderer?: CSS3DRenderer;
|
|
2211
|
+
container: HTMLElement;
|
|
2212
|
+
/** 标签碰撞检测管理器 */
|
|
2213
|
+
collisionManager: CollisionManager;
|
|
2214
|
+
private viewport?;
|
|
2215
|
+
constructor(container: HTMLElement, options?: CSSRendererParams);
|
|
2216
|
+
addRenderer(type: 'css2d' | 'css3d', options?: CSSRendererParams): void;
|
|
2217
|
+
setSize(width: number, height: number): void;
|
|
2218
|
+
setViewport(viewport: CSSRendererViewport): void;
|
|
2219
|
+
private applyViewport;
|
|
2220
|
+
render(scene: Scene, camera: PerspectiveCamera_2): void;
|
|
2221
|
+
dispose(): void;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
declare interface CSSRendererParams {
|
|
2225
|
+
zIndex?: string;
|
|
2226
|
+
container?: HTMLElement;
|
|
2227
|
+
/** 碰撞检测配置 */
|
|
2228
|
+
collision?: {
|
|
2229
|
+
/** 是否启用碰撞检测,默认 true */
|
|
2230
|
+
enabled?: boolean;
|
|
2231
|
+
/** 标签之间的最小间距(像素),默认 4 */
|
|
2232
|
+
padding?: number;
|
|
2233
|
+
/** 更新节流时间(毫秒),默认 16 */
|
|
2234
|
+
throttleTime?: number;
|
|
2235
|
+
/** 视口边距,默认 50 */
|
|
2236
|
+
viewportMargin?: number;
|
|
2237
|
+
};
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
declare interface CSSRendererViewport {
|
|
2241
|
+
left: number;
|
|
2242
|
+
top: number;
|
|
2243
|
+
width: number;
|
|
2244
|
+
height: number;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
declare type DeepRequired<T> = T extends Function | HTMLElement ? T : T extends object ? {
|
|
2248
|
+
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
2249
|
+
} : T;
|
|
2250
|
+
|
|
2251
|
+
declare type DeepRequiredOptions = DeepRequired<Options>;
|
|
2252
|
+
|
|
2253
|
+
declare const _default: (attributes: any) => BufferGeometry< NormalBufferAttributes, BufferGeometryEventMap>;
|
|
509
2254
|
|
|
510
2255
|
declare class DirectionalLight extends DirectionalLightObject {
|
|
511
2256
|
constructor(...options: ConstructorParameters<typeof DirectionalLightObject>);
|
|
@@ -513,6 +2258,31 @@ declare class DirectionalLight extends DirectionalLightObject {
|
|
|
513
2258
|
render(): void;
|
|
514
2259
|
}
|
|
515
2260
|
|
|
2261
|
+
declare class DirectionalLightObject extends BaseObject<DirectionalLight_2> {
|
|
2262
|
+
objectType: string;
|
|
2263
|
+
constructor(lightOrColor?: DirectionalLight_2 | string | number, intensity?: number);
|
|
2264
|
+
render(): void;
|
|
2265
|
+
dispose(): void;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
declare interface DispatcherEvent {
|
|
2269
|
+
type: string;
|
|
2270
|
+
[key: string]: any;
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
declare const DOLLY_DIRECTION: {
|
|
2274
|
+
readonly NONE: 0;
|
|
2275
|
+
readonly IN: 1;
|
|
2276
|
+
readonly OUT: -1;
|
|
2277
|
+
};
|
|
2278
|
+
|
|
2279
|
+
declare type DOLLY_DIRECTION =
|
|
2280
|
+
(typeof DOLLY_DIRECTION)[keyof typeof DOLLY_DIRECTION];
|
|
2281
|
+
|
|
2282
|
+
declare interface DrawOptions {
|
|
2283
|
+
target?: BaseObject | string | null;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
516
2286
|
export declare function duplicateMaterialAssetDocument(document: VisSceneDocument, id: string, newId: string, mode: 'asset' | 'object' | 'scene', sceneId: string, objectId?: string, slot?: number): VisSceneDocument;
|
|
517
2287
|
|
|
518
2288
|
/** One-click copy and apply; preserve the source's user-visible scope. */
|
|
@@ -564,7 +2334,7 @@ declare class Earth_3 extends Base_3 {
|
|
|
564
2334
|
Plane: Plane;
|
|
565
2335
|
PlaneShadow: PlaneShadow;
|
|
566
2336
|
Sphere: Sphere;
|
|
567
|
-
Sprite:
|
|
2337
|
+
Sprite: Sprite_2;
|
|
568
2338
|
Box: Box;
|
|
569
2339
|
Circle: Circle;
|
|
570
2340
|
Tube: TubeObject;
|
|
@@ -612,8 +2382,8 @@ declare class Earth_3 extends Base_3 {
|
|
|
612
2382
|
|
|
613
2383
|
declare class Earth_4 extends Sphere {
|
|
614
2384
|
objectType: string;
|
|
615
|
-
options: Required<
|
|
616
|
-
constructor(options:
|
|
2385
|
+
options: Required<Options_15>;
|
|
2386
|
+
constructor(options: Options_15);
|
|
617
2387
|
create(): void;
|
|
618
2388
|
rebuildFromScene(): void;
|
|
619
2389
|
}
|
|
@@ -644,7 +2414,7 @@ export declare const editorEarthObjects: {
|
|
|
644
2414
|
Plane: Plane;
|
|
645
2415
|
PlaneShadow: PlaneShadow;
|
|
646
2416
|
Sphere: Sphere;
|
|
647
|
-
Sprite:
|
|
2417
|
+
Sprite: Sprite_2;
|
|
648
2418
|
Box: Box;
|
|
649
2419
|
Circle: Circle;
|
|
650
2420
|
Tube: TubeObject;
|
|
@@ -668,7 +2438,7 @@ export declare const editorObjects: {
|
|
|
668
2438
|
Plane: typeof Plane;
|
|
669
2439
|
PlaneShadow: typeof PlaneShadow;
|
|
670
2440
|
Sphere: typeof Sphere;
|
|
671
|
-
Sprite: typeof
|
|
2441
|
+
Sprite: typeof Sprite_2;
|
|
672
2442
|
Box: typeof Box;
|
|
673
2443
|
Circle: typeof Circle;
|
|
674
2444
|
Tube: typeof TubeObject;
|
|
@@ -698,6 +2468,43 @@ declare class Event_2 {
|
|
|
698
2468
|
dispose(): void;
|
|
699
2469
|
}
|
|
700
2470
|
|
|
2471
|
+
declare class EventDispatcher {
|
|
2472
|
+
private _listeners;
|
|
2473
|
+
/**
|
|
2474
|
+
* Adds the specified event listener.
|
|
2475
|
+
* @param type event name
|
|
2476
|
+
* @param listener handler function
|
|
2477
|
+
* @category Methods
|
|
2478
|
+
*/
|
|
2479
|
+
addEventListener(type: string, listener: Listener_2): void;
|
|
2480
|
+
/**
|
|
2481
|
+
* Presence of the specified event listener.
|
|
2482
|
+
* @param type event name
|
|
2483
|
+
* @param listener handler function
|
|
2484
|
+
* @category Methods
|
|
2485
|
+
*/
|
|
2486
|
+
hasEventListener(type: string, listener: Listener_2): boolean;
|
|
2487
|
+
/**
|
|
2488
|
+
* Removes the specified event listener
|
|
2489
|
+
* @param type event name
|
|
2490
|
+
* @param listener handler function
|
|
2491
|
+
* @category Methods
|
|
2492
|
+
*/
|
|
2493
|
+
removeEventListener(type: string, listener: Listener_2): void;
|
|
2494
|
+
/**
|
|
2495
|
+
* Removes all event listeners
|
|
2496
|
+
* @param type event name
|
|
2497
|
+
* @category Methods
|
|
2498
|
+
*/
|
|
2499
|
+
removeAllEventListeners(type?: string): void;
|
|
2500
|
+
/**
|
|
2501
|
+
* Fire an event type.
|
|
2502
|
+
* @param event DispatcherEvent
|
|
2503
|
+
* @category Methods
|
|
2504
|
+
*/
|
|
2505
|
+
dispatchEvent(event: DispatcherEvent): void;
|
|
2506
|
+
}
|
|
2507
|
+
|
|
701
2508
|
/** Internal: Consume an exclusively owned import copy; pooled slots still get independent payloads. */
|
|
702
2509
|
export declare function expandOwnedSceneDocumentResources<T extends VisSceneDocument>(expanded: T): T;
|
|
703
2510
|
|
|
@@ -707,6 +2514,15 @@ export declare function expandSceneDocumentResources<T extends VisSceneDocument>
|
|
|
707
2514
|
/** Expand renderer pools, including snapshots retained as prefab baselines. */
|
|
708
2515
|
export declare function expandStructureSnapshot<T extends Record<string, any>>(input: T): T;
|
|
709
2516
|
|
|
2517
|
+
declare interface ExportBaseObjectOptions {
|
|
2518
|
+
/** Serialize a node's own state and resources without visiting descendants. */
|
|
2519
|
+
recursive?: boolean;
|
|
2520
|
+
checkTextures?: boolean;
|
|
2521
|
+
includeHiddenChildren?: boolean;
|
|
2522
|
+
includeUnusedUnlockedMaterials?: boolean;
|
|
2523
|
+
includeAnalysisMeta?: boolean;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
710
2526
|
/** Extract only this material's dependencies, without mutating the scene snapshot. */
|
|
711
2527
|
export declare function extractMaterialDefinition(scene: SceneViewportDocument, materialUuid: string): Record<string, any>;
|
|
712
2528
|
|
|
@@ -714,8 +2530,71 @@ export declare function extractMaterialDefinition(scene: SceneViewportDocument,
|
|
|
714
2530
|
* dependencies of the live object. Baselines remain in the copied metadata. */
|
|
715
2531
|
export declare function extractObjectResourceGraph(graph: any, object: any): any;
|
|
716
2532
|
|
|
2533
|
+
declare interface ExtrudePolygonMessage {
|
|
2534
|
+
bevelRatio?: number;
|
|
2535
|
+
bbox?: number[];
|
|
2536
|
+
projection?: ProjectionOptions;
|
|
2537
|
+
useGroups?: 0 | 1 | 2;
|
|
2538
|
+
hasTop?: boolean;
|
|
2539
|
+
hasBottom?: boolean;
|
|
2540
|
+
hasSide?: boolean;
|
|
2541
|
+
splitPolygons?: number;
|
|
2542
|
+
topSegments?: number;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
declare class ExtrudePolygonObject extends MeshObject {
|
|
2546
|
+
objectType: string;
|
|
2547
|
+
options: ExtrudePolygonObjectOptions;
|
|
2548
|
+
constructor(options: ExtrudePolygonObjectOptions);
|
|
2549
|
+
create(): Promise<void>;
|
|
2550
|
+
private createWithWorker;
|
|
2551
|
+
private createLocal;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
declare interface ExtrudePolygonObjectOptions {
|
|
2555
|
+
material?: Material | Material[];
|
|
2556
|
+
geometry?: BufferGeometry;
|
|
2557
|
+
coordinatesArr?: number[][][];
|
|
2558
|
+
metaArray?: number[][];
|
|
2559
|
+
globalMeta?: number[];
|
|
2560
|
+
useWorker?: boolean;
|
|
2561
|
+
useGroups?: 0 | 1 | 2;
|
|
2562
|
+
hasTop?: boolean;
|
|
2563
|
+
hasBottom?: boolean;
|
|
2564
|
+
hasSide?: boolean;
|
|
2565
|
+
bbox?: number[];
|
|
2566
|
+
projection?: ProjectionOptions | 'cesium' | 'sphere';
|
|
2567
|
+
splitPolygons?: number;
|
|
2568
|
+
topSegments?: number;
|
|
2569
|
+
bevelRatio?: number;
|
|
2570
|
+
cacheKey?: string;
|
|
2571
|
+
userData?: Record<string, any>;
|
|
2572
|
+
curvatureResolution?: number;
|
|
2573
|
+
topFirst?: boolean;
|
|
2574
|
+
useFloat64Array?: boolean;
|
|
2575
|
+
onCacheMiss?: (options: Partial<ExtrudePolygonObjectOptions>) => Partial<ExtrudePolygonObjectOptions> | Promise<Partial<ExtrudePolygonObjectOptions>>;
|
|
2576
|
+
}
|
|
2577
|
+
|
|
717
2578
|
export declare const findAdcodeInfo: (adcode: number) => AdcodeInfo | undefined;
|
|
718
2579
|
|
|
2580
|
+
declare interface FitToOptions {
|
|
2581
|
+
cover: boolean;
|
|
2582
|
+
paddingLeft: number;
|
|
2583
|
+
paddingRight: number;
|
|
2584
|
+
paddingBottom: number;
|
|
2585
|
+
paddingTop: number;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
declare interface GeoGeometryOptions extends Options_13 {
|
|
2589
|
+
coordinatesArr: number[][][];
|
|
2590
|
+
metaArray?: number[][];
|
|
2591
|
+
globalMeta?: number[];
|
|
2592
|
+
cacheKey?: string;
|
|
2593
|
+
userData?: Record<string, any>;
|
|
2594
|
+
useFloat64Array?: boolean;
|
|
2595
|
+
cb?: (geometry: BufferGeometry) => void;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
719
2598
|
declare type GeoJSON_2 = FeatureCollection<Polygon | MultiPolygon>;
|
|
720
2599
|
export { GeoJSON_2 as GeoJSON }
|
|
721
2600
|
|
|
@@ -723,6 +2602,13 @@ declare type GeoJSON_3 = FeatureCollection<Polygon | MultiPolygon>;
|
|
|
723
2602
|
|
|
724
2603
|
declare type GeoJSON_4 = FeatureCollection<Polygon | MultiPolygon>;
|
|
725
2604
|
|
|
2605
|
+
declare interface GeometryDefinition {
|
|
2606
|
+
geometry: Record<string, any>;
|
|
2607
|
+
shapes?: Record<string, any>[];
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
declare function geoWinkel3(): GeoProjection;
|
|
2611
|
+
|
|
726
2612
|
/** Saved configuration dependencies protect definitions, without representing live usage. */
|
|
727
2613
|
export declare function getMaterialDependencies(document: Pick<VisSceneDocument, 'scenes'>, assetId?: string): MaterialUsage[];
|
|
728
2614
|
|
|
@@ -736,6 +2622,12 @@ export declare function getSceneDocument(document: VisSceneDocument, sceneId?: s
|
|
|
736
2622
|
resolveResources?: boolean;
|
|
737
2623
|
}): SceneViewportDocument;
|
|
738
2624
|
|
|
2625
|
+
declare class GroupObject extends BaseObject<Group> {
|
|
2626
|
+
objectType: string;
|
|
2627
|
+
constructor(group?: Group< Object3DEventMap>);
|
|
2628
|
+
render(): void;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
739
2631
|
/** An identity group shell keeps selected sibling objects and their transforms untouched. */
|
|
740
2632
|
export declare function groupObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[], options?: GroupObjectsDocumentOptions): {
|
|
741
2633
|
document: VisSceneDocument;
|
|
@@ -749,9 +2641,40 @@ export declare interface GroupObjectsDocumentOptions {
|
|
|
749
2641
|
userData?: Record<string, any>;
|
|
750
2642
|
}
|
|
751
2643
|
|
|
2644
|
+
declare class HelperController {
|
|
2645
|
+
helpers: Record<string, any>;
|
|
2646
|
+
viewHelper?: ViewHelper;
|
|
2647
|
+
options: Options_8;
|
|
2648
|
+
private viewHelperPointerDown?;
|
|
2649
|
+
private viewHelperCamera?;
|
|
2650
|
+
private viewHelperEnabled;
|
|
2651
|
+
private sceneHelper?;
|
|
2652
|
+
private sceneHelperKey?;
|
|
2653
|
+
private activeScene?;
|
|
2654
|
+
private selectionBounds;
|
|
2655
|
+
constructor(options: Options_8);
|
|
2656
|
+
add(object: any): void;
|
|
2657
|
+
addViewHelper(camera?: PerspectiveCamera_2): void;
|
|
2658
|
+
bindActiveView(camera: CameraPages['camera'] | undefined, target?: Vector3_2): void;
|
|
2659
|
+
private bindSceneHelper;
|
|
2660
|
+
addSceneHelper(): void;
|
|
2661
|
+
remove(object: any): void;
|
|
2662
|
+
removeAll(): void;
|
|
2663
|
+
removeAllExcludeScene(): void;
|
|
2664
|
+
update(delta: number, controlsController: ControlsPages, cameraTarget: Vector3_2): void;
|
|
2665
|
+
renderViewHelper(renderer: WebGPURenderer): void;
|
|
2666
|
+
private removeViewHelper;
|
|
2667
|
+
dispose(): void;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
752
2670
|
declare class HemisphereLight extends HemisphereLightObject {
|
|
753
2671
|
}
|
|
754
2672
|
|
|
2673
|
+
declare class HemisphereLightObject extends BaseObject<HemisphereLight_2> {
|
|
2674
|
+
objectType: string;
|
|
2675
|
+
constructor(skyColorOrLight?: HemisphereLight_2 | string | number, groundColor?: string | number, intensity?: number);
|
|
2676
|
+
}
|
|
2677
|
+
|
|
755
2678
|
declare type IdentityPath = (string | number)[];
|
|
756
2679
|
|
|
757
2680
|
export declare function indexedSceneObject(root: any, uuid: string): {
|
|
@@ -759,6 +2682,15 @@ export declare function indexedSceneObject(root: any, uuid: string): {
|
|
|
759
2682
|
path: readonly number[];
|
|
760
2683
|
} | undefined;
|
|
761
2684
|
|
|
2685
|
+
declare interface InfoData {
|
|
2686
|
+
render: {
|
|
2687
|
+
timestamp: number;
|
|
2688
|
+
};
|
|
2689
|
+
compute: {
|
|
2690
|
+
timestamp: number;
|
|
2691
|
+
};
|
|
2692
|
+
}
|
|
2693
|
+
|
|
762
2694
|
/** Property-only immutable copies retain exactly the same UUID paths. */
|
|
763
2695
|
export declare function inheritSceneObjectIndex(previous: any, next: any): void;
|
|
764
2696
|
|
|
@@ -788,6 +2720,103 @@ export declare function isSceneManifest(value: unknown): value is VisSceneManife
|
|
|
788
2720
|
|
|
789
2721
|
export declare const isSceneObjectPropertyField: (field: string) => boolean;
|
|
790
2722
|
|
|
2723
|
+
declare const KNOWN_ASSET_TYPES: {
|
|
2724
|
+
readonly images: readonly ["png", "jpg", "jpeg", "ico", "webp", "avif"];
|
|
2725
|
+
readonly media: readonly ["mp4", "webm", "ogg"];
|
|
2726
|
+
readonly gltf: readonly ["gltf", "glb"];
|
|
2727
|
+
readonly json: readonly ["json", "geojson"];
|
|
2728
|
+
readonly gzipJson: readonly ["json.gzip", "json.gz"];
|
|
2729
|
+
readonly exr: readonly ["exr"];
|
|
2730
|
+
readonly lottie: readonly ["lottie.json"];
|
|
2731
|
+
};
|
|
2732
|
+
|
|
2733
|
+
declare type Lead = Lead_2;
|
|
2734
|
+
|
|
2735
|
+
declare class Lead_2 extends Pick_2 {
|
|
2736
|
+
objMap: Map<Object3D< Object3DEventMap>, BaseObject<Object3D< Object3DEventMap>>>;
|
|
2737
|
+
objects: Map<string, BaseObject<Object3D< Object3DEventMap>>>;
|
|
2738
|
+
/** Compatibility name for the same UUID index, never a second identity map. */
|
|
2739
|
+
get objectsByUuid(): Map<string, BaseObject<Object3D< Object3DEventMap>>>;
|
|
2740
|
+
private registeredUuids;
|
|
2741
|
+
private disposing;
|
|
2742
|
+
objectsPm: Map<BaseObject<Object3D< Object3DEventMap>>, Promise<void>>;
|
|
2743
|
+
scene: BaseObject;
|
|
2744
|
+
sceneResources: SceneResources_2;
|
|
2745
|
+
get objectsPromise(): MapIterator<Promise<void>>;
|
|
2746
|
+
constructor(pencil: Pencil, ops: {
|
|
2747
|
+
scene: Scene;
|
|
2748
|
+
sceneResources: SceneResources_2;
|
|
2749
|
+
});
|
|
2750
|
+
/**
|
|
2751
|
+
* 核心注册逻辑:统一处理对象到 Lead 系统的注册
|
|
2752
|
+
* 包含:依赖注入、Key 生成、Map 存储。
|
|
2753
|
+
* 已注册对象可再次调用,以刷新替换骨骼后的资源引用。
|
|
2754
|
+
*/
|
|
2755
|
+
register(baseObject: BaseObject): BaseObject<Object3D< Object3DEventMap>>;
|
|
2756
|
+
/** Update identity and its only index atomically; never rename children. */
|
|
2757
|
+
setObjectUuid(baseObject: BaseObject, uuid: string): void;
|
|
2758
|
+
/**
|
|
2759
|
+
* Internal: Exchange staged runtime identities without migrating authored
|
|
2760
|
+
* references. A structure transaction owns both trees and their rollback;
|
|
2761
|
+
* user-requested identity changes must continue to use setObjectUuid().
|
|
2762
|
+
*/
|
|
2763
|
+
rekeyObjectsForTransaction(assignments: readonly {
|
|
2764
|
+
object: BaseObject;
|
|
2765
|
+
uuid: string;
|
|
2766
|
+
}[]): void;
|
|
2767
|
+
/**
|
|
2768
|
+
* 内部初始化核心对象 (Scene, Camera 等)
|
|
2769
|
+
* 模拟 add 的部分逻辑,但不走完整的 spawn 流程
|
|
2770
|
+
*/
|
|
2771
|
+
private _initCoreObject;
|
|
2772
|
+
draw<C extends new (...args: any[]) => BaseObject>(ClassRef: C, ...args: ConstructorParameters<C>): Promise<InstanceType<C>>;
|
|
2773
|
+
draw<C extends new (...args: any[]) => BaseObject>(options: DrawOptions, ClassRef: C, ...args: ConstructorParameters<C>): Promise<InstanceType<C>>;
|
|
2774
|
+
/**
|
|
2775
|
+
* 将原生 Object3D 包装为 BaseObject (Wrapper Pattern)
|
|
2776
|
+
* 如果已存在包装器,则返回现有实例
|
|
2777
|
+
*/
|
|
2778
|
+
wrap(object3d: Object3D): BaseObject;
|
|
2779
|
+
private wrapObject;
|
|
2780
|
+
/**
|
|
2781
|
+
* 统一的添加入口
|
|
2782
|
+
* 替代原有的 addBaseObject 私有方法,公开给 spawn 使用
|
|
2783
|
+
*/
|
|
2784
|
+
add<T extends BaseObject = BaseObject>(baseObject: T, target?: BaseObject | string | null): Promise<T>;
|
|
2785
|
+
private _addLogic;
|
|
2786
|
+
/** @deprecated Use objects.get(uuid). This method also requires an exact UUID. */
|
|
2787
|
+
getObject<T extends BaseObject = BaseObject>(uuid: string): T | undefined;
|
|
2788
|
+
/** @deprecated Use objects.get(uuid). UUIDs identify at most one object. */
|
|
2789
|
+
getAllObject<T extends BaseObject = BaseObject>(uuid: string): T[];
|
|
2790
|
+
/** @deprecated Use BaseObject.setKey(uuid) for explicit identity changes. */
|
|
2791
|
+
updateBaseObjectKey(baseObject: BaseObject, ops?: {
|
|
2792
|
+
keyType?: string;
|
|
2793
|
+
uuid?: string;
|
|
2794
|
+
}): string;
|
|
2795
|
+
erase(...args: (string | BaseObject)[]): void;
|
|
2796
|
+
private eraseObjects;
|
|
2797
|
+
update(delta: number, elapsed: number): void;
|
|
2798
|
+
setSize(width: number, height: number): void;
|
|
2799
|
+
eraseAll(): void;
|
|
2800
|
+
private _serializer;
|
|
2801
|
+
exportBaseObject(...args: Parameters<SceneSerializer['exportBaseObject']>): SceneSnapshot;
|
|
2802
|
+
restoreBaseObject(...args: Parameters<SceneSerializer['restoreBaseObject']>): Promise<BaseObject<Object3D< Object3DEventMap>>>;
|
|
2803
|
+
dispose(): void;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
declare class LeadPages extends OrigonPages<Lead_2> {
|
|
2807
|
+
options: Options_11;
|
|
2808
|
+
get lead(): Lead_2;
|
|
2809
|
+
constructor(options: Options_11);
|
|
2810
|
+
addLead(scene: Scene, sceneResources: SceneResources_2, index?: number): Lead_2;
|
|
2811
|
+
removePage(index: number): void;
|
|
2812
|
+
setPageActive(index: number): void;
|
|
2813
|
+
setSize(width: number, height: number): void;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
declare type LeadParams = {};
|
|
2817
|
+
|
|
2818
|
+
declare type LeadParams_2 = {};
|
|
2819
|
+
|
|
791
2820
|
declare namespace Lights {
|
|
792
2821
|
export {
|
|
793
2822
|
AmbientLight,
|
|
@@ -799,6 +2828,136 @@ declare namespace Lights {
|
|
|
799
2828
|
}
|
|
800
2829
|
}
|
|
801
2830
|
|
|
2831
|
+
declare interface LineMessage {
|
|
2832
|
+
projection?: ProjectionOptions;
|
|
2833
|
+
useGroups?: 0 | 1 | 2;
|
|
2834
|
+
splitPolygons?: number;
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
declare class LineObject extends MeshObject<MeshLineGeometry | BufferGeometry, MeshLineMaterial> {
|
|
2838
|
+
objectType: string;
|
|
2839
|
+
options: LineObjectOptions;
|
|
2840
|
+
private rtcRenderBinding?;
|
|
2841
|
+
constructor(options?: Partial<LineObjectOptions>);
|
|
2842
|
+
get material(): MeshLineMaterial;
|
|
2843
|
+
create(): Promise<void>;
|
|
2844
|
+
private createWithWorker;
|
|
2845
|
+
private createLocal;
|
|
2846
|
+
setGeometry(nodes: PointsInput_2, setPointWidth?: (p: number) => any, useRTC?: boolean, rtcCenter?: Vector3): void;
|
|
2847
|
+
createMaterial(materialOptions: Omit<MeshLineMaterialParameters, 'resolution'>): MeshLineMaterial;
|
|
2848
|
+
resize(w: number, h: number): void;
|
|
2849
|
+
handleMaterialChange(mat: MeshLineMaterial | null): void;
|
|
2850
|
+
animate({ duration, delay, repeat, lineLoop, onRepeat, onUpdate, onComplete, startShow, }?: {
|
|
2851
|
+
duration?: number;
|
|
2852
|
+
delay?: number;
|
|
2853
|
+
repeat?: number;
|
|
2854
|
+
lineLoop?: boolean;
|
|
2855
|
+
onComplete?: (...args: any[]) => void;
|
|
2856
|
+
onUpdate?: (...args: any[]) => void;
|
|
2857
|
+
onRepeat?: (...args: any[]) => void;
|
|
2858
|
+
startShow?: boolean;
|
|
2859
|
+
}): void;
|
|
2860
|
+
stopAnimation(material?: MeshLineMaterial): void;
|
|
2861
|
+
render(): void;
|
|
2862
|
+
dispose(): void;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
declare interface LineObjectOptions {
|
|
2866
|
+
geometry?: BufferGeometry;
|
|
2867
|
+
material?: MeshLineMaterial;
|
|
2868
|
+
coordinatesArr?: number[][][];
|
|
2869
|
+
metaArray?: number[][];
|
|
2870
|
+
globalMeta?: number[];
|
|
2871
|
+
useWorker?: boolean;
|
|
2872
|
+
projection?: ProjectionOptions | 'cesium' | 'sphere';
|
|
2873
|
+
splitPolygons?: number;
|
|
2874
|
+
useGroups?: 0 | 1 | 2;
|
|
2875
|
+
setPointWidth?: (p: number) => any;
|
|
2876
|
+
lineWidthArr?: number[];
|
|
2877
|
+
cacheKey?: string;
|
|
2878
|
+
userData?: Record<string, any>;
|
|
2879
|
+
useFloat64Array?: boolean;
|
|
2880
|
+
useRTC?: boolean;
|
|
2881
|
+
onCacheMiss?: (options: Partial<LineObjectOptions>) => Partial<LineObjectOptions> | Promise<Partial<LineObjectOptions>>;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
declare type Listener_2 = (event?: DispatcherEvent) => void;
|
|
2885
|
+
|
|
2886
|
+
declare class Loader {
|
|
2887
|
+
loadingManager: LoadingManager;
|
|
2888
|
+
loaders: Map<string, any>;
|
|
2889
|
+
loaderConfigs: Map<string, LoaderConfig>;
|
|
2890
|
+
loadObj: Asset[];
|
|
2891
|
+
delLoadArr: string[];
|
|
2892
|
+
assets: Map<string, Texture | Object3D | any>;
|
|
2893
|
+
event: EventEmitter;
|
|
2894
|
+
options: Options_9;
|
|
2895
|
+
scene: Scene;
|
|
2896
|
+
private disposed;
|
|
2897
|
+
readonly resources: ResourceRegistry;
|
|
2898
|
+
private assetLeases;
|
|
2899
|
+
private cachedRequests;
|
|
2900
|
+
private pendingRequests;
|
|
2901
|
+
constructor(options: Options_9);
|
|
2902
|
+
initLoaderConfigs(): void;
|
|
2903
|
+
emit(eventName: string, ...args: any[]): void;
|
|
2904
|
+
on(eventName: string, listener: (...args: any[]) => void): void;
|
|
2905
|
+
getAsset(src: `${string}.${TypeImage}`): Texture;
|
|
2906
|
+
getAsset(src: `${string}.${TypeMedia}`): VideoTexture;
|
|
2907
|
+
getAsset(src: `${string}.${TypeGLTF}`): {
|
|
2908
|
+
scene: Object3D;
|
|
2909
|
+
};
|
|
2910
|
+
getAsset(src: `${string}.${TypeLottie}`): Texture;
|
|
2911
|
+
getAsset(src: `${string}.${TypeJSON}`): any;
|
|
2912
|
+
getAsset(src: `${string}.${TypeGzipJSON}`): any;
|
|
2913
|
+
getAsset(src: `${string}.${TypeEXR}`): DataTexture;
|
|
2914
|
+
getAsset(src: string): Texture;
|
|
2915
|
+
getAssetType(src: string): "images" | "json" | "gltf" | "exr" | "media" | "gzipJson" | "lottie" | undefined;
|
|
2916
|
+
private loaderKey;
|
|
2917
|
+
getLoader(type: string, options?: AssetOptions): any;
|
|
2918
|
+
add(src: string | string[], options?: AssetOptions): void;
|
|
2919
|
+
getSrcByAsset(asset: Texture | Object3D | any, assets?: Map<string, any>): string | undefined;
|
|
2920
|
+
get textureAssets(): Map<string, Texture<unknown, TextureEventMap>>;
|
|
2921
|
+
loadAll(): Promise<Texture<unknown, TextureEventMap>[]>;
|
|
2922
|
+
load(src: `${string}.${TypeImage}`, options?: AssetOptions): Promise<Texture>;
|
|
2923
|
+
load(src: `${string}.${TypeMedia}`, options?: AssetOptions): Promise<VideoTexture>;
|
|
2924
|
+
load(src: `${string}.${TypeGLTF}`, options?: AssetOptions): Promise<{
|
|
2925
|
+
scene: Object3D;
|
|
2926
|
+
}>;
|
|
2927
|
+
load(src: `${string}.${TypeLottie}`, options?: AssetOptions): Promise<Texture>;
|
|
2928
|
+
load(src: `${string}.${TypeJSON}`, options?: AssetOptions): Promise<any>;
|
|
2929
|
+
load(src: `${string}.${TypeGzipJSON}`, options?: AssetOptions): Promise<any>;
|
|
2930
|
+
load(src: `${string}.${TypeEXR}`, options?: AssetOptions): Promise<DataTexture>;
|
|
2931
|
+
load(src: string, options?: AssetOptions): Promise<Texture>;
|
|
2932
|
+
private publishAsset;
|
|
2933
|
+
private assetScenes;
|
|
2934
|
+
private isResourceAsset;
|
|
2935
|
+
private disposeAsset;
|
|
2936
|
+
getUnusedAssets(): string[];
|
|
2937
|
+
dispose(): void;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
declare interface LoaderConfig {
|
|
2941
|
+
create: (manager: LoadingManager, options?: AssetOptions) => any;
|
|
2942
|
+
setPath?: (loader: any, prefix: string) => void;
|
|
2943
|
+
setResponseType?: (loader: any, responseType: string) => void;
|
|
2944
|
+
requiresDraco?: boolean;
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
declare class LoaderPages extends OrigonPages<Loader> {
|
|
2948
|
+
options: Options_10;
|
|
2949
|
+
get loader(): Loader;
|
|
2950
|
+
constructor(options: Options_10);
|
|
2951
|
+
addLoader(scene: Scene, index?: number): Loader;
|
|
2952
|
+
removePage(index: number): void;
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
declare interface LoaderParams {
|
|
2956
|
+
anisotropy: number;
|
|
2957
|
+
prefix?: string;
|
|
2958
|
+
simpleTexture4deleted?: boolean;
|
|
2959
|
+
}
|
|
2960
|
+
|
|
802
2961
|
/** Copy once and redirect every user in this scene, including its SceneResources aliases. */
|
|
803
2962
|
export declare function makeMaterialSceneLocal<T extends VisSceneDocument>(document: T, assetId: string, sceneId: string, newAssetId: string): T;
|
|
804
2963
|
|
|
@@ -863,7 +3022,7 @@ declare class Map_4 extends Base_3 {
|
|
|
863
3022
|
Plane: Plane;
|
|
864
3023
|
PlaneShadow: PlaneShadow;
|
|
865
3024
|
Sphere: Sphere;
|
|
866
|
-
Sprite:
|
|
3025
|
+
Sprite: Sprite_2;
|
|
867
3026
|
Box: Box;
|
|
868
3027
|
Circle: Circle;
|
|
869
3028
|
Tube: TubeObject;
|
|
@@ -879,7 +3038,7 @@ declare class Map_4 extends Base_3 {
|
|
|
879
3038
|
Line: LineObject;
|
|
880
3039
|
Group: typeof GroupObject;
|
|
881
3040
|
};
|
|
882
|
-
protected get defaultCameraUp():
|
|
3041
|
+
protected get defaultCameraUp(): _THREE.Vector3;
|
|
883
3042
|
protected onRuntimeReady(): Promise<void>;
|
|
884
3043
|
protected prepareInitialCamera(): Promise<void>;
|
|
885
3044
|
private mapBoundaryMatrix?;
|
|
@@ -899,7 +3058,7 @@ declare class Map_4 extends Base_3 {
|
|
|
899
3058
|
ensureParentBackground(): Promise<{
|
|
900
3059
|
planeWidth: number;
|
|
901
3060
|
planeHeight: number;
|
|
902
|
-
center:
|
|
3061
|
+
center: _THREE.Vector3;
|
|
903
3062
|
} | undefined>;
|
|
904
3063
|
clearContinentsBackground(): void;
|
|
905
3064
|
ensureContinentsBackground(): Promise<void>;
|
|
@@ -999,7 +3158,7 @@ declare class Map_4 extends Base_3 {
|
|
|
999
3158
|
*/
|
|
1000
3159
|
private applyRegionObjectState;
|
|
1001
3160
|
/** Internal: 仅由 SceneManager 在隔离页面调用,成功后才对外提交。 */
|
|
1002
|
-
rebuildRegion(targetAdcode: number, switchKey?: string): Promise<void>;
|
|
3161
|
+
rebuildRegion(targetAdcode: number, switchKey?: string, force?: boolean): Promise<void>;
|
|
1003
3162
|
private rebuildRegionGeometry;
|
|
1004
3163
|
/** 候选区域提交后的相机过渡,不参与场景序列化。 */
|
|
1005
3164
|
playRegionEnterTransition({ duration, sourceCamera, preparedCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
@@ -1038,6 +3197,22 @@ declare interface MapAssetSources {
|
|
|
1038
3197
|
};
|
|
1039
3198
|
}
|
|
1040
3199
|
|
|
3200
|
+
/** Authored map extent. Inline geometry travels with the scene and needs no script. */
|
|
3201
|
+
export declare type MapBoundaryData = {
|
|
3202
|
+
version: 1;
|
|
3203
|
+
mode: 'builtin';
|
|
3204
|
+
adcode: number;
|
|
3205
|
+
} | {
|
|
3206
|
+
version: 1;
|
|
3207
|
+
mode: 'regions' | 'custom';
|
|
3208
|
+
adcode: number;
|
|
3209
|
+
geojson: GeoJSON_3;
|
|
3210
|
+
/** Independent perimeter; optional for documents saved before this field existed. */
|
|
3211
|
+
outlineGeojson?: GeoJSON_3;
|
|
3212
|
+
regions?: number[];
|
|
3213
|
+
name?: string;
|
|
3214
|
+
};
|
|
3215
|
+
|
|
1041
3216
|
declare interface MapCameraFitReference {
|
|
1042
3217
|
lookat: MapCameraPose;
|
|
1043
3218
|
adcode?: number;
|
|
@@ -1075,6 +3250,7 @@ declare interface MapLabelStyle {
|
|
|
1075
3250
|
|
|
1076
3251
|
declare interface MapOptions extends BaseOptions {
|
|
1077
3252
|
adcode: number;
|
|
3253
|
+
mapData?: MapBoundaryData;
|
|
1078
3254
|
sceneBindings?: MapSceneBindings;
|
|
1079
3255
|
center?: [number, number];
|
|
1080
3256
|
parentBg?: boolean | number;
|
|
@@ -1084,6 +3260,8 @@ declare interface MapOptions extends BaseOptions {
|
|
|
1084
3260
|
continentsBg?: boolean;
|
|
1085
3261
|
continentsBgDepth?: number;
|
|
1086
3262
|
mapDepth?: number;
|
|
3263
|
+
/** Inset bevel as a fraction of the map thickness, 0..0.25. */
|
|
3264
|
+
mapBevel?: number;
|
|
1087
3265
|
fixGeojson?: Record<string, string>;
|
|
1088
3266
|
showDistrict?: boolean;
|
|
1089
3267
|
showLabel?: boolean | 'lite';
|
|
@@ -1193,6 +3371,13 @@ export declare interface MaterialAlias {
|
|
|
1193
3371
|
locked?: boolean;
|
|
1194
3372
|
}
|
|
1195
3373
|
|
|
3374
|
+
declare interface MaterialAlias_2 {
|
|
3375
|
+
readonly key: string;
|
|
3376
|
+
readonly material: Material;
|
|
3377
|
+
readonly locked: boolean;
|
|
3378
|
+
readonly transient: boolean;
|
|
3379
|
+
}
|
|
3380
|
+
|
|
1196
3381
|
export declare interface MaterialAsset {
|
|
1197
3382
|
id: string;
|
|
1198
3383
|
revision: number;
|
|
@@ -1252,6 +3437,12 @@ export declare function materializeSceneMaterials<T extends SceneViewportDocumen
|
|
|
1252
3437
|
/** One validation context per batch; never cached across caller mutations. */
|
|
1253
3438
|
export declare function materializeSceneMaterialsBatch<T extends SceneViewportDocument>(scenes: readonly T[], library?: MaterialAsset[]): T[];
|
|
1254
3439
|
|
|
3440
|
+
declare interface MaterialRegistrationOptions {
|
|
3441
|
+
locked?: boolean;
|
|
3442
|
+
ownership?: ResourceOwnership;
|
|
3443
|
+
transient?: boolean;
|
|
3444
|
+
}
|
|
3445
|
+
|
|
1255
3446
|
/** Serializable project data. This deliberately contains no THREE instances or GPU ownership. */
|
|
1256
3447
|
export declare type MaterialScope = {
|
|
1257
3448
|
kind: 'project';
|
|
@@ -1292,23 +3483,317 @@ export declare function mergeProjectMaterials(target: VisSceneDocument, incoming
|
|
|
1292
3483
|
idMap: Map<string, string>;
|
|
1293
3484
|
};
|
|
1294
3485
|
|
|
3486
|
+
declare class MeshLineGeometry extends BufferGeometry {
|
|
3487
|
+
type: string;
|
|
3488
|
+
private pointCount;
|
|
3489
|
+
private _points;
|
|
3490
|
+
private shape;
|
|
3491
|
+
private shapeFunction;
|
|
3492
|
+
matrixWorld: Matrix4;
|
|
3493
|
+
private useRTC;
|
|
3494
|
+
private rtcCenter;
|
|
3495
|
+
constructor(points?: PointsInput_2, shape?: 'none' | 'taper' | 'custom', shapeFunction?: WidthCallback, useRTC?: boolean, rtcCenter?: Vector3);
|
|
3496
|
+
private convertToVector3Array;
|
|
3497
|
+
setMatrixWorld(matrixWorld: Matrix4): void;
|
|
3498
|
+
setPoints(points: PointsInput_2, shapeFunction?: WidthCallback, useRTC?: boolean, rtcCenter?: Vector3): void;
|
|
3499
|
+
private initializeGeometry;
|
|
3500
|
+
private updateGeometry;
|
|
3501
|
+
/**
|
|
3502
|
+
* 获取相对于 RTC 中心的坐标
|
|
3503
|
+
*/
|
|
3504
|
+
private getRelativePosition;
|
|
3505
|
+
get points(): Vector3[];
|
|
3506
|
+
set points(value: PointsInput_2);
|
|
3507
|
+
updatePoints(points: PointsInput_2, shapeFunction?: WidthCallback): void;
|
|
3508
|
+
setShape(shape: 'none' | 'taper' | 'custom', shapeFunction?: WidthCallback): void;
|
|
3509
|
+
getRTCCenter(): Vector3;
|
|
3510
|
+
setUseRTC(useRTC: boolean): void;
|
|
3511
|
+
getUseRTC(): boolean;
|
|
3512
|
+
setRTCCenter(center: Vector3): void;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
declare class MeshLineMaterial extends NodeMaterial {
|
|
3516
|
+
uniforms: Record<string, {
|
|
3517
|
+
value: any;
|
|
3518
|
+
}>;
|
|
3519
|
+
uniformsNeedUpdate: boolean;
|
|
3520
|
+
type: string;
|
|
3521
|
+
private authoredTransparent;
|
|
3522
|
+
constructor(parameters?: MeshLineMaterialParameters);
|
|
3523
|
+
private rebuildNodes;
|
|
3524
|
+
copy(source: this): this;
|
|
3525
|
+
toJSON(meta?: Parameters<Material['toJSON']>[0]): ShaderMaterialJSON;
|
|
3526
|
+
get color(): Color;
|
|
3527
|
+
set color(value: ColorRepresentation);
|
|
3528
|
+
get opacity(): number;
|
|
3529
|
+
set opacity(value: number);
|
|
3530
|
+
get alphaTest(): number;
|
|
3531
|
+
set alphaTest(value: number);
|
|
3532
|
+
get map(): Texture | null;
|
|
3533
|
+
set map(value: Texture | null);
|
|
3534
|
+
get alphaMap(): Texture | null;
|
|
3535
|
+
set alphaMap(value: Texture | null);
|
|
3536
|
+
get repeat(): Vector2_2;
|
|
3537
|
+
set repeat(value: Vector2_2);
|
|
3538
|
+
get lineWidth(): number;
|
|
3539
|
+
set lineWidth(value: number);
|
|
3540
|
+
get sizeAttenuation(): boolean;
|
|
3541
|
+
set sizeAttenuation(value: boolean);
|
|
3542
|
+
get rtcOffset(): Vector3;
|
|
3543
|
+
set rtcOffset(value: Vector3);
|
|
3544
|
+
get viewRotation(): Matrix4;
|
|
3545
|
+
set viewRotation(value: Matrix4);
|
|
3546
|
+
get modelMatrix(): Matrix4;
|
|
3547
|
+
set modelMatrix(value: Matrix4);
|
|
3548
|
+
get useRTC(): boolean;
|
|
3549
|
+
set useRTC(value: boolean);
|
|
3550
|
+
/**
|
|
3551
|
+
* 更新 RTC 相关的 uniforms
|
|
3552
|
+
* @param center RTC 中心点(通常是物体的世界坐标原点或几何中心)
|
|
3553
|
+
* @param cameraMatrixWorld 相机的世界矩阵
|
|
3554
|
+
* @param objectMatrixWorld 物体的世界矩阵(可选,用于支持缩放和旋转)
|
|
3555
|
+
*/
|
|
3556
|
+
updateRTC(center: Vector3, cameraMatrixWorld: Matrix4, objectMatrixWorld?: Matrix4): void;
|
|
3557
|
+
/**
|
|
3558
|
+
* 从 Three.js 原生解析好的 ShaderMaterial 中还原出 MeshLineMaterial
|
|
3559
|
+
* 用于反序列化场景
|
|
3560
|
+
*/
|
|
3561
|
+
static fromParsedShaderMaterial(shaderMat: ShaderMaterial | MeshLineMaterial): MeshLineMaterial;
|
|
3562
|
+
}
|
|
3563
|
+
|
|
3564
|
+
declare interface MeshLineMaterialParameters extends MaterialParameters {
|
|
3565
|
+
fog?: boolean;
|
|
3566
|
+
/**
|
|
3567
|
+
* Line width
|
|
3568
|
+
* @default 1
|
|
3569
|
+
*/
|
|
3570
|
+
lineWidth?: number;
|
|
3571
|
+
/**
|
|
3572
|
+
* Line color
|
|
3573
|
+
* @default '#ffffff'
|
|
3574
|
+
*/
|
|
3575
|
+
color?: ColorRepresentation;
|
|
3576
|
+
opacity?: number;
|
|
3577
|
+
/**
|
|
3578
|
+
* Texture map
|
|
3579
|
+
*/
|
|
3580
|
+
map?: Texture;
|
|
3581
|
+
/**
|
|
3582
|
+
* Dash offset for dashed lines
|
|
3583
|
+
* @default 0
|
|
3584
|
+
*/
|
|
3585
|
+
dashOffset?: number;
|
|
3586
|
+
/**
|
|
3587
|
+
* Dash array for dashed lines
|
|
3588
|
+
* @default 0
|
|
3589
|
+
*/
|
|
3590
|
+
dashArray?: number;
|
|
3591
|
+
/**
|
|
3592
|
+
* Dash ratio for dashed lines
|
|
3593
|
+
* @default 0
|
|
3594
|
+
*/
|
|
3595
|
+
dashRatio?: number;
|
|
3596
|
+
/**
|
|
3597
|
+
* Whether to apply size attenuation (alias for attenuate)
|
|
3598
|
+
* @default true
|
|
3599
|
+
*/
|
|
3600
|
+
sizeAttenuation?: boolean;
|
|
3601
|
+
offsetLoop?: boolean;
|
|
3602
|
+
/**
|
|
3603
|
+
* Scale down factor
|
|
3604
|
+
* @default 0
|
|
3605
|
+
*/
|
|
3606
|
+
scaleDown?: number;
|
|
3607
|
+
/**
|
|
3608
|
+
* Alpha map texture
|
|
3609
|
+
*/
|
|
3610
|
+
alphaMap?: Texture | undefined;
|
|
3611
|
+
alphaTest?: number;
|
|
3612
|
+
/**
|
|
3613
|
+
* Texture repeat
|
|
3614
|
+
* @default Vector2(1, 1)
|
|
3615
|
+
*/
|
|
3616
|
+
repeat?: Vector2_2;
|
|
3617
|
+
/**
|
|
3618
|
+
* Screen resolution for line width calculation
|
|
3619
|
+
*/
|
|
3620
|
+
resolution?: Vector2_2;
|
|
3621
|
+
offset?: Vector2_2;
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
declare class MeshObject<G extends BufferGeometry = BufferGeometry, M extends Material | Material[] = Material | Material[]> extends BaseObject<Mesh<G, M>> {
|
|
3625
|
+
objectType: string;
|
|
3626
|
+
constructor(geometryOrMesh?: G | Mesh<G, M>, material?: M);
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
/** A GLTF-backed group with serializable playback and isolated instances. */
|
|
3630
|
+
declare class ModelObject extends GroupObject {
|
|
3631
|
+
options: ModelOptions;
|
|
3632
|
+
mixer: _THREE.AnimationMixer | null;
|
|
3633
|
+
clips: _THREE.AnimationClip[];
|
|
3634
|
+
actions: _THREE.AnimationAction[];
|
|
3635
|
+
actionStates: Record<string, boolean>;
|
|
3636
|
+
objectType: string;
|
|
3637
|
+
constructor(options?: ModelOptions);
|
|
3638
|
+
create(): Promise<void>;
|
|
3639
|
+
render(): void;
|
|
3640
|
+
/**
|
|
3641
|
+
* Set animation clips for the model
|
|
3642
|
+
* @param clips Array of animation clips from GLTF
|
|
3643
|
+
*/
|
|
3644
|
+
setClips(clips: _THREE.AnimationClip[]): void;
|
|
3645
|
+
/**
|
|
3646
|
+
* Play all animation clips
|
|
3647
|
+
*/
|
|
3648
|
+
playAllClips(): void;
|
|
3649
|
+
/**
|
|
3650
|
+
* Play a specific animation clip by name
|
|
3651
|
+
* @param clipName Name of the animation clip to play
|
|
3652
|
+
*/
|
|
3653
|
+
playClip(clipName: string): void;
|
|
3654
|
+
/**
|
|
3655
|
+
* Stop a specific animation clip by name
|
|
3656
|
+
* @param clipName Name of the animation clip to stop
|
|
3657
|
+
*/
|
|
3658
|
+
stopClip(clipName: string): void;
|
|
3659
|
+
/**
|
|
3660
|
+
* Stop all animation clips
|
|
3661
|
+
*/
|
|
3662
|
+
stopAllClips(): void;
|
|
3663
|
+
/**
|
|
3664
|
+
* Set the playback speed for all animations
|
|
3665
|
+
* @param speed Playback speed (1.0 = normal speed)
|
|
3666
|
+
*/
|
|
3667
|
+
setPlaybackSpeed(speed: number): void;
|
|
3668
|
+
/**
|
|
3669
|
+
* Get the current playback speed
|
|
3670
|
+
*/
|
|
3671
|
+
getPlaybackSpeed(): number;
|
|
3672
|
+
/**
|
|
3673
|
+
* Check if a specific animation is playing
|
|
3674
|
+
* @param clipName Name of the animation clip
|
|
3675
|
+
*/
|
|
3676
|
+
isPlaying(clipName: string): boolean;
|
|
3677
|
+
/**
|
|
3678
|
+
* Get all available animation clip names
|
|
3679
|
+
*/
|
|
3680
|
+
getClipNames(): string[];
|
|
3681
|
+
rebuildFromScene(): Promise<void>;
|
|
3682
|
+
instantiate(ops?: Parameters<GroupObject['instantiate']>[0]): Promise<this>;
|
|
3683
|
+
/**
|
|
3684
|
+
* Update animations - should be called in render loop
|
|
3685
|
+
* @param deltaTime Time elapsed since last frame
|
|
3686
|
+
*/
|
|
3687
|
+
update(deltaTime: number): void;
|
|
3688
|
+
/**
|
|
3689
|
+
* Dispose of resources including animation mixer
|
|
3690
|
+
*/
|
|
3691
|
+
dispose(): void;
|
|
3692
|
+
private syncPlayingClipNames;
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3695
|
+
declare interface ModelOptions {
|
|
3696
|
+
src?: string;
|
|
3697
|
+
autoPlay?: boolean;
|
|
3698
|
+
playbackSpeed?: number;
|
|
3699
|
+
serializedClips?: SerializedClip[];
|
|
3700
|
+
playingClipNames?: string[];
|
|
3701
|
+
}
|
|
3702
|
+
|
|
1295
3703
|
declare class Mountain extends GroupObject {
|
|
1296
3704
|
objectType: string;
|
|
1297
|
-
options: Required<Omit<
|
|
3705
|
+
options: Required<Omit<Options_22, 'bbox'>> & Pick<Options_22, 'bbox'>;
|
|
1298
3706
|
extrudePolygon: ExtrudePolygonObject;
|
|
1299
|
-
constructor(options:
|
|
3707
|
+
constructor(options: Options_22);
|
|
1300
3708
|
geojson2Meta(geojson: GeoJSON_4): {
|
|
1301
3709
|
coords: Position[][];
|
|
1302
3710
|
properties: GeoJsonProperties;
|
|
1303
3711
|
}[];
|
|
1304
3712
|
create(): Promise<void>;
|
|
1305
|
-
setNoise(geometry:
|
|
3713
|
+
setNoise(geometry: _THREE.BufferGeometry, image: HTMLImageElement, maxHeight?: number): void;
|
|
1306
3714
|
rebuildFromScene(): void;
|
|
1307
3715
|
}
|
|
1308
3716
|
|
|
3717
|
+
declare const MOUSE_BUTTON: {
|
|
3718
|
+
readonly LEFT: 1;
|
|
3719
|
+
readonly RIGHT: 2;
|
|
3720
|
+
readonly MIDDLE: 4;
|
|
3721
|
+
};
|
|
3722
|
+
|
|
3723
|
+
declare type MOUSE_BUTTON = (typeof MOUSE_BUTTON)[keyof typeof MOUSE_BUTTON];
|
|
3724
|
+
|
|
3725
|
+
declare type mouseButtonAction =
|
|
3726
|
+
| typeof ACTION.ROTATE
|
|
3727
|
+
| typeof ACTION.TRUCK
|
|
3728
|
+
| typeof ACTION.SCREEN_PAN
|
|
3729
|
+
| typeof ACTION.OFFSET
|
|
3730
|
+
| typeof ACTION.DOLLY
|
|
3731
|
+
| typeof ACTION.ZOOM
|
|
3732
|
+
| typeof ACTION.NONE;
|
|
3733
|
+
|
|
3734
|
+
declare interface MouseButtons {
|
|
3735
|
+
left: mouseButtonAction;
|
|
3736
|
+
middle: mouseButtonAction;
|
|
3737
|
+
right: mouseButtonAction;
|
|
3738
|
+
wheel: mouseWheelAction;
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
declare type mouseWheelAction =
|
|
3742
|
+
| typeof ACTION.ROTATE
|
|
3743
|
+
| typeof ACTION.TRUCK
|
|
3744
|
+
| typeof ACTION.SCREEN_PAN
|
|
3745
|
+
| typeof ACTION.OFFSET
|
|
3746
|
+
| typeof ACTION.DOLLY
|
|
3747
|
+
| typeof ACTION.ZOOM
|
|
3748
|
+
| typeof ACTION.NONE;
|
|
3749
|
+
|
|
1309
3750
|
/** Reparent/reorder roots with caller-computed local matrices, without copying their descendants. */
|
|
1310
3751
|
export declare function moveObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[], parentUuid: string, order: readonly string[], matrices: ReadonlyMap<string, MatrixState>): VisSceneDocument;
|
|
1311
3752
|
|
|
3753
|
+
declare type multiTouchAction =
|
|
3754
|
+
| typeof ACTION.TOUCH_DOLLY_ROTATE
|
|
3755
|
+
| typeof ACTION.TOUCH_DOLLY_TRUCK
|
|
3756
|
+
| typeof ACTION.TOUCH_DOLLY_OFFSET
|
|
3757
|
+
| typeof ACTION.TOUCH_ZOOM_ROTATE
|
|
3758
|
+
| typeof ACTION.TOUCH_ZOOM_TRUCK
|
|
3759
|
+
| typeof ACTION.TOUCH_ZOOM_OFFSET
|
|
3760
|
+
| typeof ACTION.TOUCH_DOLLY
|
|
3761
|
+
| typeof ACTION.TOUCH_ZOOM
|
|
3762
|
+
| typeof ACTION.TOUCH_ROTATE
|
|
3763
|
+
| typeof ACTION.TOUCH_TRUCK
|
|
3764
|
+
| typeof ACTION.TOUCH_SCREEN_PAN
|
|
3765
|
+
| typeof ACTION.TOUCH_OFFSET
|
|
3766
|
+
| typeof ACTION.NONE;
|
|
3767
|
+
|
|
3768
|
+
declare class NodeObject extends BaseObject<CSSObject> {
|
|
3769
|
+
objectType: string;
|
|
3770
|
+
options: Options_5;
|
|
3771
|
+
pickObject?: Sprite;
|
|
3772
|
+
object3d: CSS2DObject;
|
|
3773
|
+
element: HTMLDivElement;
|
|
3774
|
+
private static sharedObserver?;
|
|
3775
|
+
private static observerMap;
|
|
3776
|
+
private observedElement?;
|
|
3777
|
+
private visibilityTimer?;
|
|
3778
|
+
private clearVisibilityTracking;
|
|
3779
|
+
constructor(options: Options_5);
|
|
3780
|
+
/**
|
|
3781
|
+
* 启用碰撞检测跟踪
|
|
3782
|
+
* @param priority 优先级,数值越大越优先显示,默认 0
|
|
3783
|
+
*/
|
|
3784
|
+
trackCollision(priority?: number): void;
|
|
3785
|
+
/**
|
|
3786
|
+
* 停止碰撞检测跟踪
|
|
3787
|
+
*/
|
|
3788
|
+
untrackCollision(): void;
|
|
3789
|
+
setChildren(children: HTMLElement): void;
|
|
3790
|
+
showAndEnsureVisible(): void;
|
|
3791
|
+
private moveElementToViewport;
|
|
3792
|
+
private ensureVisible;
|
|
3793
|
+
protected createPointerBinding(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): () => void;
|
|
3794
|
+
dispose(): void;
|
|
3795
|
+
}
|
|
3796
|
+
|
|
1312
3797
|
/** Keep saved texture/image identities stable across runtime namespace and revision changes. */
|
|
1313
3798
|
export declare function normalizeMaterialDefinition<T extends Record<string, any>>(input: T): T;
|
|
1314
3799
|
|
|
@@ -1324,7 +3809,72 @@ declare type ObjectIndex = Map<string, {
|
|
|
1324
3809
|
lengths: readonly number[];
|
|
1325
3810
|
}>;
|
|
1326
3811
|
|
|
3812
|
+
/** Export/rebuild dependencies never acquire resource leases. */
|
|
3813
|
+
declare class OptionMaterialDependencies {
|
|
3814
|
+
private objects;
|
|
3815
|
+
private materials;
|
|
3816
|
+
private recovered;
|
|
3817
|
+
private resources;
|
|
3818
|
+
constructor(resources: ResourceRegistry);
|
|
3819
|
+
track(object: BaseObject): void;
|
|
3820
|
+
private removeOwner;
|
|
3821
|
+
forget(object: BaseObject): void;
|
|
3822
|
+
definition(material: Material): any;
|
|
3823
|
+
releaseUnused(object: BaseObject): void;
|
|
3824
|
+
resolve(options: any, scope: ResourceScope, live: (uuid: string) => Material | undefined): void;
|
|
3825
|
+
replace(oldMaterial: Material, material: Material): void;
|
|
3826
|
+
dispose(): void;
|
|
3827
|
+
}
|
|
3828
|
+
|
|
1327
3829
|
declare interface Options {
|
|
3830
|
+
container: HTMLElement;
|
|
3831
|
+
helper?: boolean;
|
|
3832
|
+
controls?: Partial<ControlsParams>;
|
|
3833
|
+
renderer?: Partial<RendererParams>;
|
|
3834
|
+
composer?: Partial<ComposerParams>;
|
|
3835
|
+
loader?: Partial<LoaderParams>;
|
|
3836
|
+
scene?: Partial<SceneParams>;
|
|
3837
|
+
camera?: Partial<CameraParams> | PerspectiveCamera;
|
|
3838
|
+
bloom?: boolean;
|
|
3839
|
+
bloomParams?: Partial<BloomParams>;
|
|
3840
|
+
ssao?: boolean;
|
|
3841
|
+
ssaoParams?: Partial<SSAOParams>;
|
|
3842
|
+
crossOpacity?: boolean;
|
|
3843
|
+
css2DRenderer?: boolean;
|
|
3844
|
+
css2DRendererParams?: Partial<CSSRendererParams>;
|
|
3845
|
+
css3DRenderer?: boolean;
|
|
3846
|
+
css3DRendererParams?: Partial<CSSRendererParams>;
|
|
3847
|
+
/** @deprecated WebGPU is built in; dependency injection is no longer needed. */
|
|
3848
|
+
WebGPUTHREE?: unknown;
|
|
3849
|
+
/** @deprecated Configure the built-in renderer using renderer options. */
|
|
3850
|
+
WebGPURenderer?: unknown;
|
|
3851
|
+
attributesWorkerVersion?: string;
|
|
3852
|
+
attributesWorkerMaxWorkers?: number;
|
|
3853
|
+
}
|
|
3854
|
+
|
|
3855
|
+
declare interface Options_10 {
|
|
3856
|
+
loaderParams: LoaderParams;
|
|
3857
|
+
resources?: ResourceRegistry;
|
|
3858
|
+
}
|
|
3859
|
+
|
|
3860
|
+
declare interface Options_11 {
|
|
3861
|
+
leadParams?: LeadParams;
|
|
3862
|
+
pencil: Pencil;
|
|
3863
|
+
}
|
|
3864
|
+
|
|
3865
|
+
declare interface Options_12 {
|
|
3866
|
+
leadParams?: LeadParams_2;
|
|
3867
|
+
pencil: Pencil;
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
declare interface Options_13 {
|
|
3871
|
+
maxWorkers?: number;
|
|
3872
|
+
dbName?: string;
|
|
3873
|
+
cacheVersion?: string;
|
|
3874
|
+
maxCacheSize?: number;
|
|
3875
|
+
}
|
|
3876
|
+
|
|
3877
|
+
declare interface Options_14 {
|
|
1328
3878
|
/** @deprecated Legacy generation scope, read only when importing old snapshots. */
|
|
1329
3879
|
uuid?: string;
|
|
1330
3880
|
areaGroup?: boolean;
|
|
@@ -1344,49 +3894,42 @@ declare interface Options {
|
|
|
1344
3894
|
lineOffset?: number;
|
|
1345
3895
|
bbox?: number[];
|
|
1346
3896
|
topSegments?: number;
|
|
3897
|
+
bevelRatio?: number;
|
|
1347
3898
|
conic?: boolean;
|
|
1348
3899
|
castShadow?: boolean;
|
|
1349
3900
|
mergeSide?: boolean;
|
|
1350
3901
|
hasExtrudeLine?: boolean;
|
|
1351
3902
|
materialOptions: {
|
|
1352
|
-
topMat:
|
|
1353
|
-
sideMat?:
|
|
3903
|
+
topMat: _THREE.Material;
|
|
3904
|
+
sideMat?: _THREE.Material;
|
|
1354
3905
|
lineMat?: MeshLineMaterial;
|
|
1355
3906
|
extrudeLineMat?: MeshLineMaterial;
|
|
1356
|
-
bgTopMat?:
|
|
1357
|
-
bgSideMat?:
|
|
1358
|
-
bgLineMat?: MeshLineMaterial;
|
|
1359
|
-
bgExtrudeLineMat?: MeshLineMaterial;
|
|
1360
|
-
};
|
|
1361
|
-
onTop?: number;
|
|
1362
|
-
bloom?: boolean;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
declare interface Options_10 {
|
|
1366
|
-
width: number;
|
|
1367
|
-
height: number;
|
|
1368
|
-
material?: THREE.Material;
|
|
1369
|
-
color?: string;
|
|
1370
|
-
map?: THREE.Texture | null;
|
|
3907
|
+
bgTopMat?: _THREE.Material;
|
|
3908
|
+
bgSideMat?: _THREE.Material;
|
|
3909
|
+
bgLineMat?: MeshLineMaterial;
|
|
3910
|
+
bgExtrudeLineMat?: MeshLineMaterial;
|
|
3911
|
+
};
|
|
3912
|
+
onTop?: number;
|
|
3913
|
+
bloom?: boolean;
|
|
1371
3914
|
}
|
|
1372
3915
|
|
|
1373
|
-
declare interface
|
|
3916
|
+
declare interface Options_15 {
|
|
1374
3917
|
radius?: number;
|
|
1375
3918
|
rotationY?: number;
|
|
1376
3919
|
}
|
|
1377
3920
|
|
|
1378
|
-
declare interface
|
|
3921
|
+
declare interface Options_16 {
|
|
1379
3922
|
radius?: number;
|
|
1380
3923
|
}
|
|
1381
3924
|
|
|
1382
|
-
declare interface
|
|
3925
|
+
declare interface Options_17 {
|
|
1383
3926
|
sprite?: boolean;
|
|
1384
3927
|
}
|
|
1385
3928
|
|
|
1386
|
-
declare interface
|
|
3929
|
+
declare interface Options_18 {
|
|
1387
3930
|
materialOptions: {
|
|
1388
|
-
topMat:
|
|
1389
|
-
sideMat:
|
|
3931
|
+
topMat: _THREE.Material;
|
|
3932
|
+
sideMat: _THREE.Material;
|
|
1390
3933
|
lineMat: MeshLineMaterial;
|
|
1391
3934
|
};
|
|
1392
3935
|
scale: number;
|
|
@@ -1395,7 +3938,7 @@ declare interface Options_5 {
|
|
|
1395
3938
|
geojsonSource: string;
|
|
1396
3939
|
}
|
|
1397
3940
|
|
|
1398
|
-
declare interface
|
|
3941
|
+
declare interface Options_19 {
|
|
1399
3942
|
uuid?: string;
|
|
1400
3943
|
jsonUrl: string;
|
|
1401
3944
|
projection: {
|
|
@@ -1411,7 +3954,15 @@ declare interface Options_6 {
|
|
|
1411
3954
|
materialOptions?: Record<string, THREE.Material>;
|
|
1412
3955
|
}
|
|
1413
3956
|
|
|
1414
|
-
declare interface
|
|
3957
|
+
declare interface Options_2 {
|
|
3958
|
+
sceneController: ScenePages;
|
|
3959
|
+
cameraController: CameraPages;
|
|
3960
|
+
rendererController: RendererController;
|
|
3961
|
+
composerParams: ComposerParams;
|
|
3962
|
+
resources?: ResourceRegistry;
|
|
3963
|
+
}
|
|
3964
|
+
|
|
3965
|
+
declare interface Options_20 {
|
|
1415
3966
|
uuid?: string;
|
|
1416
3967
|
jsonUrl: string;
|
|
1417
3968
|
projection: {
|
|
@@ -1424,20 +3975,20 @@ declare interface Options_7 {
|
|
|
1424
3975
|
material?: MeshLineMaterial;
|
|
1425
3976
|
}
|
|
1426
3977
|
|
|
1427
|
-
declare interface
|
|
3978
|
+
declare interface Options_21 {
|
|
1428
3979
|
uuid?: string;
|
|
1429
3980
|
jsonUrl: string;
|
|
1430
3981
|
projection: {
|
|
1431
3982
|
center: [number, number];
|
|
1432
3983
|
scale: number;
|
|
1433
3984
|
};
|
|
1434
|
-
material:
|
|
3985
|
+
material: _THREE.Material;
|
|
1435
3986
|
type: string;
|
|
1436
3987
|
cacheKey?: string;
|
|
1437
3988
|
oArr?: number[];
|
|
1438
3989
|
}
|
|
1439
3990
|
|
|
1440
|
-
declare interface
|
|
3991
|
+
declare interface Options_22 {
|
|
1441
3992
|
geojson: GeoJSON_4;
|
|
1442
3993
|
projection: {
|
|
1443
3994
|
center: [number, number];
|
|
@@ -1449,9 +4000,120 @@ declare interface Options_9 {
|
|
|
1449
4000
|
bbox?: number[];
|
|
1450
4001
|
}
|
|
1451
4002
|
|
|
4003
|
+
declare interface Options_23 {
|
|
4004
|
+
width: number;
|
|
4005
|
+
height: number;
|
|
4006
|
+
material?: _THREE.Material;
|
|
4007
|
+
color?: string;
|
|
4008
|
+
map?: _THREE.Texture | null;
|
|
4009
|
+
}
|
|
4010
|
+
|
|
4011
|
+
declare interface Options_3 {
|
|
4012
|
+
width: number;
|
|
4013
|
+
height: number;
|
|
4014
|
+
}
|
|
4015
|
+
|
|
4016
|
+
declare interface Options_4 {
|
|
4017
|
+
width: number;
|
|
4018
|
+
height: number;
|
|
4019
|
+
rendererParams: RendererParams;
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
declare interface Options_5 {
|
|
4023
|
+
children?: HTMLElement;
|
|
4024
|
+
position?: Vector3;
|
|
4025
|
+
type?: '2d' | '3d' | '3dSprite';
|
|
4026
|
+
}
|
|
4027
|
+
|
|
4028
|
+
declare interface Options_6 {
|
|
4029
|
+
controlsParams: ControlsParams;
|
|
4030
|
+
acceptsInput?: (event: MouseEvent) => boolean;
|
|
4031
|
+
}
|
|
4032
|
+
|
|
4033
|
+
declare interface Options_7 {
|
|
4034
|
+
renderer: WebGPURenderer;
|
|
4035
|
+
scene: Scene_2;
|
|
4036
|
+
/** Authored page identity when scene is a shared overlay. */
|
|
4037
|
+
viewScene?: Scene_2;
|
|
4038
|
+
camera: Camera_2;
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
declare interface Options_8 {
|
|
4042
|
+
sceneController: ScenePages;
|
|
4043
|
+
/** Editor overlays live outside the authored scene and its render passes. */
|
|
4044
|
+
helperScene?: Scene_2;
|
|
4045
|
+
cameraController: CameraPages;
|
|
4046
|
+
container: HTMLElement;
|
|
4047
|
+
resources?: ResourceRegistry;
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
declare interface Options_9 {
|
|
4051
|
+
prefix?: string;
|
|
4052
|
+
simpleTexture4deleted?: boolean;
|
|
4053
|
+
anisotropy: number;
|
|
4054
|
+
scene: Scene | null;
|
|
4055
|
+
resources?: ResourceRegistry;
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
declare class OrigonPages<T = any> {
|
|
4059
|
+
event: EventEmitter;
|
|
4060
|
+
controllerMap: Map<T, Pages>;
|
|
4061
|
+
activeIndex: number;
|
|
4062
|
+
controller: T;
|
|
4063
|
+
activeControllerSet: Set<T>;
|
|
4064
|
+
addController(c: T, index?: number): T;
|
|
4065
|
+
removePage(index: number, cb?: (c: T) => void): void;
|
|
4066
|
+
setPageActive(index: number, cb?: (c: T, r: boolean) => void): void;
|
|
4067
|
+
update(delta: number, elapsed: number): void;
|
|
4068
|
+
dispose(): void;
|
|
4069
|
+
}
|
|
4070
|
+
|
|
1452
4071
|
/** Pack an export copy only; preserve the editor's independent scene snapshots. */
|
|
1453
4072
|
export declare function packSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
1454
4073
|
|
|
4074
|
+
/** Page identities are independent of Three's 32 rendering layers. */
|
|
4075
|
+
declare class Pages {
|
|
4076
|
+
private readonly indices;
|
|
4077
|
+
get size(): number;
|
|
4078
|
+
private validate;
|
|
4079
|
+
/** Legacy low-32-page view; use isEnabled()/size for page membership. */
|
|
4080
|
+
get mask(): number;
|
|
4081
|
+
set mask(value: number);
|
|
4082
|
+
set(layer: number): void;
|
|
4083
|
+
enable(layer: number): void;
|
|
4084
|
+
enableAll(): void;
|
|
4085
|
+
toggle(layer: number): void;
|
|
4086
|
+
disable(layer: number): void;
|
|
4087
|
+
disableAll(): void;
|
|
4088
|
+
isEnabled(layer: number): boolean;
|
|
4089
|
+
getMinDisabledLayer(): number | null;
|
|
4090
|
+
getMinEnabledLayer(): number | null;
|
|
4091
|
+
}
|
|
4092
|
+
|
|
4093
|
+
declare class Panel {
|
|
4094
|
+
canvas: HTMLCanvasElement;
|
|
4095
|
+
context: CanvasRenderingContext2D | null;
|
|
4096
|
+
name: string;
|
|
4097
|
+
fg: string;
|
|
4098
|
+
bg: string;
|
|
4099
|
+
gradient: CanvasGradient | null;
|
|
4100
|
+
id: number;
|
|
4101
|
+
PR: number;
|
|
4102
|
+
WIDTH: number;
|
|
4103
|
+
HEIGHT: number;
|
|
4104
|
+
TEXT_X: number;
|
|
4105
|
+
TEXT_Y: number;
|
|
4106
|
+
GRAPH_X: number;
|
|
4107
|
+
GRAPH_Y: number;
|
|
4108
|
+
GRAPH_WIDTH: number;
|
|
4109
|
+
GRAPH_HEIGHT: number;
|
|
4110
|
+
constructor(name: string, fg: string, bg: string);
|
|
4111
|
+
private createGradient;
|
|
4112
|
+
initializeCanvas(): void;
|
|
4113
|
+
update(value: number, maxValue: number, decimals?: number): void;
|
|
4114
|
+
updateGraph(valueGraph: number, maxGraph: number): void;
|
|
4115
|
+
}
|
|
4116
|
+
|
|
1455
4117
|
/** Clone each affected ancestor/children array once, without visiting other subtrees. */
|
|
1456
4118
|
export declare function patchIndexedSceneObjects(root: any, updates: ReadonlyMap<string, {
|
|
1457
4119
|
state: Record<string, any>;
|
|
@@ -1469,6 +4131,285 @@ export declare function patchSceneStructureTransactionDocument(document: VisScen
|
|
|
1469
4131
|
/** Own only the small viewport payload and copy the camera's ancestor path. */
|
|
1470
4132
|
export declare function patchSceneViewportDocument(document: VisSceneDocument, sceneId: string, patch: SceneViewportPatch): VisSceneDocument;
|
|
1471
4133
|
|
|
4134
|
+
declare class Pencil {
|
|
4135
|
+
readonly resources: ResourceRegistry;
|
|
4136
|
+
readonly ready: Promise<void>;
|
|
4137
|
+
options: Omit<DeepRequiredOptions, 'controls' | 'loader' | 'css2DRendererParams' | 'css3DRendererParams'> & Pick<Options, 'controls' | 'loader'> & {
|
|
4138
|
+
css2DRendererParams: CSSRendererParams;
|
|
4139
|
+
css3DRendererParams: CSSRendererParams;
|
|
4140
|
+
};
|
|
4141
|
+
composerController?: Composer;
|
|
4142
|
+
rendererController: RendererController;
|
|
4143
|
+
cssRendererController?: CSSRendererController;
|
|
4144
|
+
cameraController: CameraPages;
|
|
4145
|
+
controlsController: ControlsPages;
|
|
4146
|
+
transformController?: TransformControlsController;
|
|
4147
|
+
sceneController: ScenePages;
|
|
4148
|
+
helperController?: HelperController;
|
|
4149
|
+
private _helperScene?;
|
|
4150
|
+
/** Drawn only in the editor, after the authored scene's postprocessing. */
|
|
4151
|
+
get helperScene(): Scene_2< Object3DEventMap>;
|
|
4152
|
+
private sceneCapture?;
|
|
4153
|
+
loaderController: LoaderPages;
|
|
4154
|
+
leadController: LeadPages;
|
|
4155
|
+
sceneResourcesController: SceneResourcesPages;
|
|
4156
|
+
stats?: Stats;
|
|
4157
|
+
private disposeStats?;
|
|
4158
|
+
private resizeObserver;
|
|
4159
|
+
raycaster: Raycaster;
|
|
4160
|
+
private maxBackufferArea;
|
|
4161
|
+
installPlugins: Map<string, any>;
|
|
4162
|
+
attributesWorker: AttributesWorker;
|
|
4163
|
+
getPlugin(name: string): any;
|
|
4164
|
+
get renderer(): WebGPURenderer;
|
|
4165
|
+
get maxAnisotropy(): number;
|
|
4166
|
+
get controls(): CameraControls;
|
|
4167
|
+
private _cameraPositon;
|
|
4168
|
+
private _cameraTarget;
|
|
4169
|
+
get cameraPositon(): Vector3_2;
|
|
4170
|
+
get cameraTarget(): Vector3_2;
|
|
4171
|
+
get camera(): PerspectiveCamera;
|
|
4172
|
+
get scene(): Scene_2< Object3DEventMap>;
|
|
4173
|
+
get loader(): Loader;
|
|
4174
|
+
get lead(): Lead_2;
|
|
4175
|
+
get sceneResources(): SceneResources_2;
|
|
4176
|
+
event: EventEmitter;
|
|
4177
|
+
timer: Timer;
|
|
4178
|
+
readonly animations: AnimationScope;
|
|
4179
|
+
userData: Record<string, any>;
|
|
4180
|
+
static options: {
|
|
4181
|
+
helper: boolean;
|
|
4182
|
+
controls: boolean;
|
|
4183
|
+
renderer: {
|
|
4184
|
+
forceWebGL: boolean;
|
|
4185
|
+
antialias: boolean;
|
|
4186
|
+
devicePixelRatio: number;
|
|
4187
|
+
powerPreference: string;
|
|
4188
|
+
toneMappingExposure: number;
|
|
4189
|
+
alpha: boolean;
|
|
4190
|
+
outputColorSpace: "srgb";
|
|
4191
|
+
logarithmicDepthBuffer: boolean;
|
|
4192
|
+
reversedDepthBuffer: boolean;
|
|
4193
|
+
preserveDrawingBuffer: boolean;
|
|
4194
|
+
stencil: boolean;
|
|
4195
|
+
depth: boolean;
|
|
4196
|
+
};
|
|
4197
|
+
composer: {
|
|
4198
|
+
multisampling: number;
|
|
4199
|
+
premultiplieAlpha: boolean;
|
|
4200
|
+
};
|
|
4201
|
+
scene: {
|
|
4202
|
+
background: null;
|
|
4203
|
+
};
|
|
4204
|
+
camera: {
|
|
4205
|
+
fov: number;
|
|
4206
|
+
near: number;
|
|
4207
|
+
far: number;
|
|
4208
|
+
up: Vector3_2;
|
|
4209
|
+
};
|
|
4210
|
+
bloom: boolean;
|
|
4211
|
+
bloomParams: {
|
|
4212
|
+
threshold: number;
|
|
4213
|
+
strength: number;
|
|
4214
|
+
radius: number;
|
|
4215
|
+
bloomAlphaType: number;
|
|
4216
|
+
};
|
|
4217
|
+
ssao: boolean;
|
|
4218
|
+
loader: {
|
|
4219
|
+
prefix: string;
|
|
4220
|
+
};
|
|
4221
|
+
ssaoParams: {
|
|
4222
|
+
kernelRadius: number;
|
|
4223
|
+
minDistance: number;
|
|
4224
|
+
maxDistance: number;
|
|
4225
|
+
};
|
|
4226
|
+
css2DRenderer: boolean;
|
|
4227
|
+
css2DRendererParams: {
|
|
4228
|
+
zIndex?: string;
|
|
4229
|
+
container?: HTMLElement;
|
|
4230
|
+
collision?: {
|
|
4231
|
+
enabled?: boolean;
|
|
4232
|
+
padding?: number;
|
|
4233
|
+
throttleTime?: number;
|
|
4234
|
+
viewportMargin?: number;
|
|
4235
|
+
};
|
|
4236
|
+
};
|
|
4237
|
+
css3DRenderer: boolean;
|
|
4238
|
+
css3DRendererParams: {
|
|
4239
|
+
zIndex?: string;
|
|
4240
|
+
container?: HTMLElement;
|
|
4241
|
+
collision?: {
|
|
4242
|
+
enabled?: boolean;
|
|
4243
|
+
padding?: number;
|
|
4244
|
+
throttleTime?: number;
|
|
4245
|
+
viewportMargin?: number;
|
|
4246
|
+
};
|
|
4247
|
+
};
|
|
4248
|
+
attributesWorkerVersion: string;
|
|
4249
|
+
attributesWorkerMaxWorkers: number;
|
|
4250
|
+
};
|
|
4251
|
+
private TweenRaf;
|
|
4252
|
+
private tweenUpdateRaf;
|
|
4253
|
+
private cancelTweenRaf;
|
|
4254
|
+
constructor(options: Options);
|
|
4255
|
+
initStats(): void;
|
|
4256
|
+
use(plugin: any, ...args: any[]): void;
|
|
4257
|
+
addPage({ sceneOptions, cameraOptions, }?: {
|
|
4258
|
+
sceneOptions?: SceneParams;
|
|
4259
|
+
cameraOptions?: CameraParams;
|
|
4260
|
+
}): number;
|
|
4261
|
+
removePage(index: number): void;
|
|
4262
|
+
showPage(index: number): void;
|
|
4263
|
+
/** Rebind editor tools and reapply the active viewport after a scene restore. */
|
|
4264
|
+
refreshActiveView(): void;
|
|
4265
|
+
private pageActiveIndex;
|
|
4266
|
+
private pages;
|
|
4267
|
+
private init;
|
|
4268
|
+
private initComposer;
|
|
4269
|
+
private initCSSRenderer;
|
|
4270
|
+
initTransformControls(): void;
|
|
4271
|
+
getSize(): {
|
|
4272
|
+
width: number;
|
|
4273
|
+
height: number;
|
|
4274
|
+
};
|
|
4275
|
+
initResizeObserver(): void;
|
|
4276
|
+
private userSetDprCache;
|
|
4277
|
+
private handeleResize;
|
|
4278
|
+
setDevicePixelRatio(userSetDprCache: number): void;
|
|
4279
|
+
private viewPadding;
|
|
4280
|
+
getViewViewport(): {
|
|
4281
|
+
left: number;
|
|
4282
|
+
top: number;
|
|
4283
|
+
width: number;
|
|
4284
|
+
height: number;
|
|
4285
|
+
};
|
|
4286
|
+
getClientViewViewport(): {
|
|
4287
|
+
left: number;
|
|
4288
|
+
top: number;
|
|
4289
|
+
width: number;
|
|
4290
|
+
height: number;
|
|
4291
|
+
};
|
|
4292
|
+
getScreenPositionFromNDC(x: number, y: number): {
|
|
4293
|
+
x: number;
|
|
4294
|
+
y: number;
|
|
4295
|
+
};
|
|
4296
|
+
getPointerNDC(clientX: number, clientY: number, requireInside?: boolean): {
|
|
4297
|
+
x: number;
|
|
4298
|
+
y: number;
|
|
4299
|
+
} | undefined;
|
|
4300
|
+
setViewPadding(top?: number, right?: number, bottom?: number, left?: number): void;
|
|
4301
|
+
/** Optional host filters; these are never serialized into a scene. */
|
|
4302
|
+
renderObjectFilter?: (object: Object3D_2) => boolean;
|
|
4303
|
+
pickObjectFilter?: (object: Object3D_2) => boolean;
|
|
4304
|
+
/** Certify host raycasts that only hit this object and never stop child traversal. */
|
|
4305
|
+
pickRaycastCanBeSkipped?: (object: Object3D_2) => boolean;
|
|
4306
|
+
pick(event: MouseEvent, objects?: Object3D_2[], recursive?: boolean): {
|
|
4307
|
+
object: Object3D_2< Object3DEventMap>;
|
|
4308
|
+
index: number | undefined;
|
|
4309
|
+
intersects: Intersection<Object3D_2< Object3DEventMap>>[];
|
|
4310
|
+
} | undefined;
|
|
4311
|
+
render(): void;
|
|
4312
|
+
/** Capture only authored content without advancing animation or touching editor tools. */
|
|
4313
|
+
captureImage(options?: SceneCaptureOptions): Promise<HTMLCanvasElement>;
|
|
4314
|
+
private renderFrame;
|
|
4315
|
+
private renderHelpers;
|
|
4316
|
+
private renderSuspensions;
|
|
4317
|
+
private rendering;
|
|
4318
|
+
private resumeAfterSuspension;
|
|
4319
|
+
/** 构建期间禁止提交中间帧;释放时恢复此前运行状态或期间的启动请求。 */
|
|
4320
|
+
suspendRendering(): () => void;
|
|
4321
|
+
start(): void;
|
|
4322
|
+
stop(): void;
|
|
4323
|
+
private setAnimationLoop;
|
|
4324
|
+
private stopRenderingLoop;
|
|
4325
|
+
autoRotate(speed: number): void;
|
|
4326
|
+
private pipCameraControls?;
|
|
4327
|
+
private pipSourceCamera?;
|
|
4328
|
+
private isInsidePipViewport;
|
|
4329
|
+
private updatePipCameraViewport;
|
|
4330
|
+
showPipViewport(state: typeof Composer.prototype.pipViewportState): void;
|
|
4331
|
+
private releasePipView;
|
|
4332
|
+
_isDispose: boolean;
|
|
4333
|
+
dispose(): void;
|
|
4334
|
+
}
|
|
4335
|
+
|
|
4336
|
+
declare class Pick_2 {
|
|
4337
|
+
pencil: Pencil;
|
|
4338
|
+
enabled: boolean;
|
|
4339
|
+
private pickFunctionsMap;
|
|
4340
|
+
private pickNodeFunctionsMap;
|
|
4341
|
+
private nodePointerOwners;
|
|
4342
|
+
private pickFunctionsMapIndex;
|
|
4343
|
+
private pickNodeFunctionsMapIndex;
|
|
4344
|
+
private activeObjects;
|
|
4345
|
+
private activeObject;
|
|
4346
|
+
private prevActiveObjects;
|
|
4347
|
+
private objCallbackMap;
|
|
4348
|
+
private pickListener;
|
|
4349
|
+
/** 是否有 enterOnStop 事件注册 */
|
|
4350
|
+
private hasEnterOnStopEvent;
|
|
4351
|
+
/** 需要检测 cursor 的物体 Map<obj, cursorStyle> */
|
|
4352
|
+
private cursorObjects;
|
|
4353
|
+
private cursorListenerAdded;
|
|
4354
|
+
/** 用于检测鼠标停止移动 */
|
|
4355
|
+
private moveStopTimer;
|
|
4356
|
+
private moveStopDelay;
|
|
4357
|
+
private lastMoveEvent;
|
|
4358
|
+
private lastMoveActiveObjects;
|
|
4359
|
+
private lastMoveRealActiveObject;
|
|
4360
|
+
/** 已经触发过 enterOnStop 的物体,用于防止重复触发 */
|
|
4361
|
+
private triggeredEnterOnStopObjects;
|
|
4362
|
+
private domElement;
|
|
4363
|
+
private disposed;
|
|
4364
|
+
private containerListeners;
|
|
4365
|
+
private listen;
|
|
4366
|
+
private unlisten;
|
|
4367
|
+
private clearInteractionState;
|
|
4368
|
+
constructor(pencil: Pencil);
|
|
4369
|
+
private waitForClick;
|
|
4370
|
+
private addPickListener;
|
|
4371
|
+
private processIntersection;
|
|
4372
|
+
private processObjectHierarchy;
|
|
4373
|
+
private handleLeaveEvents;
|
|
4374
|
+
private handleDownOutside;
|
|
4375
|
+
/** 处理鼠标停止移动事件 */
|
|
4376
|
+
private handleMoveStop;
|
|
4377
|
+
/** 触发 enterOnStop 事件 */
|
|
4378
|
+
private triggerEnterOnStop;
|
|
4379
|
+
/** 重置鼠标样式 */
|
|
4380
|
+
private resetCursor;
|
|
4381
|
+
/** 添加 cursor 检测监听器 */
|
|
4382
|
+
private addCursorListener;
|
|
4383
|
+
/**
|
|
4384
|
+
* 启用物体的 cursor 检测
|
|
4385
|
+
* @param obj 要检测的 BaseObject
|
|
4386
|
+
* @param cursor 鼠标样式,默认 'pointer'
|
|
4387
|
+
*/
|
|
4388
|
+
enableCursor(obj: BaseObject, cursor?: string): void;
|
|
4389
|
+
/**
|
|
4390
|
+
* 禁用物体的 cursor 检测
|
|
4391
|
+
* @param obj 要移除的 BaseObject
|
|
4392
|
+
*/
|
|
4393
|
+
disableCursor(obj: BaseObject): void;
|
|
4394
|
+
handlePick(objArr: PickFunctionsItem['objArr'], t: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): number;
|
|
4395
|
+
removePick(key: number): void;
|
|
4396
|
+
handlePickNode(objArr: PickFunctionsItem['objArr'], type: PickFunctionsItem['type'], callback: PickFunctionsItem['cb']): number;
|
|
4397
|
+
removePickNode(key: number): void;
|
|
4398
|
+
dispose(): void;
|
|
4399
|
+
}
|
|
4400
|
+
|
|
4401
|
+
declare type PickFunctionsItem = {
|
|
4402
|
+
objArr: BaseObject[] | (() => BaseObject[]);
|
|
4403
|
+
type: 'move' | 'enter' | 'leave' | 'down' | 'click' | 'downOutside' | 'clickOutside' | 'enterOnStop';
|
|
4404
|
+
cb: (data: {
|
|
4405
|
+
baseObject: BaseObject;
|
|
4406
|
+
realBaseObject?: BaseObject;
|
|
4407
|
+
mouseEvent: MouseEvent;
|
|
4408
|
+
intersectionIndex?: number;
|
|
4409
|
+
sp?: () => void;
|
|
4410
|
+
}) => void;
|
|
4411
|
+
};
|
|
4412
|
+
|
|
1472
4413
|
export declare interface PlanarMap {
|
|
1473
4414
|
object3d: Object3D;
|
|
1474
4415
|
options: {
|
|
@@ -1486,7 +4427,7 @@ export declare type PlaneMap = PlaneMap_2;
|
|
|
1486
4427
|
|
|
1487
4428
|
declare class PlaneMap_2 extends GroupObject {
|
|
1488
4429
|
objectType: string;
|
|
1489
|
-
options: Required<Omit<
|
|
4430
|
+
options: Required<Omit<Options_14, 'bbox' | 'extrudeLineGeojson' | 'uuid'>> & Pick<Options_14, 'bbox' | 'extrudeLineGeojson' | 'uuid'>;
|
|
1490
4431
|
isActive: boolean;
|
|
1491
4432
|
groupArr: GroupObject[];
|
|
1492
4433
|
areaArr: ExtrudePolygonObject[];
|
|
@@ -1496,7 +4437,7 @@ declare class PlaneMap_2 extends GroupObject {
|
|
|
1496
4437
|
splitPolygons: number;
|
|
1497
4438
|
private standaloneHideMaterial?;
|
|
1498
4439
|
private getHideMaterial;
|
|
1499
|
-
constructor(options:
|
|
4440
|
+
constructor(options: Options_14);
|
|
1500
4441
|
create(): Promise<void>;
|
|
1501
4442
|
private markGeneratedObjects;
|
|
1502
4443
|
private ensureExtrudeLineMaterials;
|
|
@@ -1507,7 +4448,7 @@ declare class PlaneMap_2 extends GroupObject {
|
|
|
1507
4448
|
mergeAreaSide(): Promise<void>;
|
|
1508
4449
|
unmergeAreaSide(): Promise<void>;
|
|
1509
4450
|
addArea(geojson: GeoJSON_2, options: {
|
|
1510
|
-
material:
|
|
4451
|
+
material: _THREE.Material | _THREE.Material[];
|
|
1511
4452
|
bbox?: number[];
|
|
1512
4453
|
areaGroup?: boolean;
|
|
1513
4454
|
hasSide?: boolean;
|
|
@@ -1569,21 +4510,53 @@ export declare function planPlacement(model: Object3D, map: PlanarMap, anchor: M
|
|
|
1569
4510
|
|
|
1570
4511
|
declare class Point extends BaseObject {
|
|
1571
4512
|
objectType: string;
|
|
1572
|
-
options:
|
|
1573
|
-
constructor(options:
|
|
1574
|
-
get material():
|
|
1575
|
-
getMaterial():
|
|
4513
|
+
options: Options_17;
|
|
4514
|
+
constructor(options: Options_17);
|
|
4515
|
+
get material(): _THREE.MeshBasicMaterial | _THREE.SpriteMaterial;
|
|
4516
|
+
getMaterial(): _THREE.MeshBasicMaterial | _THREE.SpriteMaterial;
|
|
1576
4517
|
create(): Promise<void>;
|
|
1577
4518
|
scaleValue: number;
|
|
1578
4519
|
setScale(n: number): void;
|
|
1579
4520
|
}
|
|
1580
4521
|
|
|
4522
|
+
declare class PointerEvent_2 {
|
|
4523
|
+
lead: Lead_2;
|
|
4524
|
+
private pointerSubscriptions;
|
|
4525
|
+
protected createPointerBinding(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): () => void;
|
|
4526
|
+
onPointerEvent(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): () => void;
|
|
4527
|
+
onClick(cb: PickFunctionsItem['cb']): () => void;
|
|
4528
|
+
onPointerEnter(cb: PickFunctionsItem['cb']): () => void;
|
|
4529
|
+
onPointerEnterOnStop(cb: PickFunctionsItem['cb']): () => void;
|
|
4530
|
+
onPointerLeave(cb: PickFunctionsItem['cb']): () => void;
|
|
4531
|
+
onPointerMove(cb: PickFunctionsItem['cb']): () => void;
|
|
4532
|
+
onPointerDown(cb: PickFunctionsItem['cb']): () => void;
|
|
4533
|
+
onPointerDownOutside(cb: PickFunctionsItem['cb']): () => void;
|
|
4534
|
+
onClickOutside(cb: PickFunctionsItem['cb']): () => void;
|
|
4535
|
+
dispose(): void;
|
|
4536
|
+
}
|
|
4537
|
+
|
|
4538
|
+
declare interface PointerInput {
|
|
4539
|
+
pointerId: number;
|
|
4540
|
+
clientX: number;
|
|
4541
|
+
clientY: number;
|
|
4542
|
+
deltaX: number;
|
|
4543
|
+
deltaY: number;
|
|
4544
|
+
mouseButton: MOUSE_BUTTON | null;
|
|
4545
|
+
}
|
|
4546
|
+
|
|
1581
4547
|
declare class PointLight extends PointLightObject {
|
|
1582
4548
|
constructor(...options: ConstructorParameters<typeof PointLightObject>);
|
|
1583
4549
|
update(delta: number, elapsed: number): void;
|
|
1584
4550
|
render(): void;
|
|
1585
4551
|
}
|
|
1586
4552
|
|
|
4553
|
+
declare class PointLightObject extends BaseObject<PointLight_2> {
|
|
4554
|
+
objectType: string;
|
|
4555
|
+
constructor(lightOrColor?: PointLight_2 | string | number, intensity?: number, distance?: number, decay?: number);
|
|
4556
|
+
}
|
|
4557
|
+
|
|
4558
|
+
declare type PointsInput_2 = Vector3[] | Vector2_2[] | number[][] | number[];
|
|
4559
|
+
|
|
1587
4560
|
export declare interface PrefabAsset {
|
|
1588
4561
|
id: string;
|
|
1589
4562
|
name: string;
|
|
@@ -1607,6 +4580,21 @@ export declare function prepareGeometryBinding(before: VisSceneDocument, sceneId
|
|
|
1607
4580
|
/** Change one binding; a conflicting borrowed UUID must not overwrite its other users. */
|
|
1608
4581
|
export declare function prepareGeometryEdit(before: VisSceneDocument, sceneId: string, uuid: string, input: GeometryDefinition | null): VisSceneDocument;
|
|
1609
4582
|
|
|
4583
|
+
declare const projectionObj: {
|
|
4584
|
+
mercator: typeof geoMercator;
|
|
4585
|
+
equirectangular: typeof geoEquirectangular;
|
|
4586
|
+
winkel3: typeof geoWinkel3;
|
|
4587
|
+
};
|
|
4588
|
+
|
|
4589
|
+
declare type ProjectionOptions = {
|
|
4590
|
+
center: [number, number];
|
|
4591
|
+
scale: number;
|
|
4592
|
+
projectionType?: keyof typeof projectionObj;
|
|
4593
|
+
translate?: [number, number];
|
|
4594
|
+
precision?: number;
|
|
4595
|
+
rotate?: [number, number];
|
|
4596
|
+
};
|
|
4597
|
+
|
|
1610
4598
|
/** Uses the same projection and Y sign as PlaneMap geometry, then its world matrix. */
|
|
1611
4599
|
export declare function projectLocation(map: PlanarMap, anchor: MapAnchor, mapCRS: string): {
|
|
1612
4600
|
local: Vector3;
|
|
@@ -1623,10 +4611,20 @@ export declare function promoteMaterialToProject<T extends VisSceneDocument>(doc
|
|
|
1623
4611
|
declare class RectAreaLight extends RectAreaLightObject {
|
|
1624
4612
|
}
|
|
1625
4613
|
|
|
4614
|
+
declare class RectAreaLightObject extends BaseObject<RectAreaLight_2> {
|
|
4615
|
+
objectType: string;
|
|
4616
|
+
static rectAreaLightUniformsLibInit: boolean;
|
|
4617
|
+
constructor(colorOrLight?: RectAreaLight_2 | string | number, intensity?: number, width?: number, height?: number);
|
|
4618
|
+
}
|
|
4619
|
+
|
|
4620
|
+
declare type Ref = {
|
|
4621
|
+
value: number;
|
|
4622
|
+
};
|
|
4623
|
+
|
|
1626
4624
|
export declare interface RegionTextureRule {
|
|
1627
4625
|
/** 材质 UUID,或显式材质角色,例如 plane#topMat。 */
|
|
1628
4626
|
material: string;
|
|
1629
|
-
/** THREE.Material 上的纹理属性,例如 map、emissiveMap
|
|
4627
|
+
/** THREE.Material 上的纹理属性,例如 map、emissiveMap;未匹配或加载失败时清空此槽位。 */
|
|
1630
4628
|
property: string;
|
|
1631
4629
|
/** 资源地址模板,支持 {adcode} 和 {level} 占位符。 */
|
|
1632
4630
|
url?: string;
|
|
@@ -1634,7 +4632,7 @@ export declare interface RegionTextureRule {
|
|
|
1634
4632
|
sources?: Record<string, string>;
|
|
1635
4633
|
/** 复用同一材质上另一个纹理槽位的图片。 */
|
|
1636
4634
|
copyFrom?: string;
|
|
1637
|
-
/**
|
|
4635
|
+
/** 资源生效层级;没有匹配规则的层级清空对应槽位。 */
|
|
1638
4636
|
levels?: string[];
|
|
1639
4637
|
}
|
|
1640
4638
|
|
|
@@ -1672,7 +4670,8 @@ export declare const remapSceneMaterialReferencesCopy: <T>(scene: T, previous: s
|
|
|
1672
4670
|
|
|
1673
4671
|
export declare const remapSceneObjectReferencesCopy: <T>(scene: T, previous: string, next: string) => T;
|
|
1674
4672
|
|
|
1675
|
-
|
|
4673
|
+
/** Keep native clips and authored Model clips bound to the same copied nodes. */
|
|
4674
|
+
export declare function remapSnapshotAnimationTracks(json: any, ids: ReadonlyMap<string, string>, roots?: readonly any[]): void;
|
|
1676
4675
|
|
|
1677
4676
|
/** Copy an authored snapshot with fresh native and authored reference identities. */
|
|
1678
4677
|
export declare function remapSnapshotIdentity(input: any, rootUuid?: string, sharedResourceIds?: ReadonlyMap<string, string>): any;
|
|
@@ -1686,6 +4685,46 @@ export declare function removeProjectMaterial<T extends VisSceneDocument>(docume
|
|
|
1686
4685
|
|
|
1687
4686
|
export declare function removeSceneDocument(before: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
1688
4687
|
|
|
4688
|
+
declare class RendererController {
|
|
4689
|
+
renderer: WebGPURenderer;
|
|
4690
|
+
readonly ready: Promise<void>;
|
|
4691
|
+
initialized: boolean;
|
|
4692
|
+
private disposed;
|
|
4693
|
+
private readonly pointSprites;
|
|
4694
|
+
options: Options_4;
|
|
4695
|
+
private displayScaleObserver?;
|
|
4696
|
+
constructor(options: Options_4);
|
|
4697
|
+
observeDisplayScale(container: HTMLElement): void;
|
|
4698
|
+
setSize(width: number, height: number): void;
|
|
4699
|
+
setPixelRatio(ratio: number): void;
|
|
4700
|
+
render(scene: Scene_2, camera: Camera_2): void;
|
|
4701
|
+
setViewport(op: {
|
|
4702
|
+
x: number;
|
|
4703
|
+
y: number;
|
|
4704
|
+
width: number;
|
|
4705
|
+
height: number;
|
|
4706
|
+
scissor?: boolean;
|
|
4707
|
+
scissorTest?: boolean;
|
|
4708
|
+
}): void;
|
|
4709
|
+
dispose(): void;
|
|
4710
|
+
}
|
|
4711
|
+
|
|
4712
|
+
declare interface RendererParams {
|
|
4713
|
+
antialias: boolean;
|
|
4714
|
+
devicePixelRatio: number;
|
|
4715
|
+
powerPreference: 'high-performance' | 'low-power' | 'default';
|
|
4716
|
+
toneMappingExposure: number;
|
|
4717
|
+
alpha: boolean;
|
|
4718
|
+
outputColorSpace: (typeof ColorSpace)[keyof typeof ColorSpace];
|
|
4719
|
+
logarithmicDepthBuffer: boolean;
|
|
4720
|
+
preserveDrawingBuffer: boolean;
|
|
4721
|
+
stencil: boolean;
|
|
4722
|
+
depth: boolean;
|
|
4723
|
+
reversedDepthBuffer: boolean;
|
|
4724
|
+
/** Use the WebGL 2 backend of WebGPURenderer, primarily for compatibility testing. */
|
|
4725
|
+
forceWebGL?: boolean;
|
|
4726
|
+
}
|
|
4727
|
+
|
|
1689
4728
|
export declare function replaceMaterialAssetDocument(document: VisSceneDocument, asset: MaterialAsset): VisSceneDocument;
|
|
1690
4729
|
|
|
1691
4730
|
export declare const RESOURCE_SOURCE = "_resourceSource";
|
|
@@ -1693,6 +4732,149 @@ export declare const RESOURCE_SOURCE = "_resourceSource";
|
|
|
1693
4732
|
/** Stable UUID for an asset's resource instance; content revisions do not change identity. */
|
|
1694
4733
|
export declare function resourceInstanceUuid(assetId: string, kind: string, sourceUuid: string): string;
|
|
1695
4734
|
|
|
4735
|
+
declare type ResourceKind = StructureResourceKind;
|
|
4736
|
+
|
|
4737
|
+
declare const resourceKinds: readonly ["geometries", "materials", "textures", "images", "skeletons", "animations"];
|
|
4738
|
+
|
|
4739
|
+
declare interface ResourceLease<T extends object = object> {
|
|
4740
|
+
readonly resource: T;
|
|
4741
|
+
readonly released: boolean;
|
|
4742
|
+
release(): void;
|
|
4743
|
+
}
|
|
4744
|
+
|
|
4745
|
+
/** Ownership belongs to each resource, independently of its users and dependencies. */
|
|
4746
|
+
declare type ResourceOwnership = 'owned' | 'borrowed';
|
|
4747
|
+
|
|
4748
|
+
/**
|
|
4749
|
+
* Leases are roots in a resource graph. Unmarked resources are SDK-owned;
|
|
4750
|
+
* external resources must be marked borrowed before they enter the graph.
|
|
4751
|
+
* Reachability rather than recursive reference counts also handles cyclic data.
|
|
4752
|
+
*/
|
|
4753
|
+
declare class ResourceRegistry {
|
|
4754
|
+
private entries;
|
|
4755
|
+
private shared;
|
|
4756
|
+
private disposedResources;
|
|
4757
|
+
private ownership;
|
|
4758
|
+
private attachmentOwners;
|
|
4759
|
+
private extraDependencies;
|
|
4760
|
+
private dependencyLeases;
|
|
4761
|
+
private closed;
|
|
4762
|
+
private syncing;
|
|
4763
|
+
private batchDepth;
|
|
4764
|
+
private syncPending;
|
|
4765
|
+
private disposedCount;
|
|
4766
|
+
private creationFrames;
|
|
4767
|
+
private pendingMutations;
|
|
4768
|
+
get isDisposed(): boolean;
|
|
4769
|
+
wasDisposed(resource: object): boolean;
|
|
4770
|
+
createScope(owner?: unknown): ResourceScope;
|
|
4771
|
+
getOwnership(resource: object): ResourceOwnership | undefined;
|
|
4772
|
+
/**
|
|
4773
|
+
* Synchronously allocate or clone an SDK resource. The factory must return a
|
|
4774
|
+
* new allocation. Use this boundary when nested allocations need rollback;
|
|
4775
|
+
* ordinary resources become owned when bound, without a factory.
|
|
4776
|
+
*/
|
|
4777
|
+
create<T extends object>(factory: () => T): T;
|
|
4778
|
+
/**
|
|
4779
|
+
* Coalesce collection requests during synchronous mutations, including failure.
|
|
4780
|
+
* Nested batches share the outer boundary; returning a promise never extends
|
|
4781
|
+
* the batch across its asynchronous work. This is not a rollback transaction.
|
|
4782
|
+
*/
|
|
4783
|
+
batch<T>(mutate: () => T): T;
|
|
4784
|
+
/** Explicit transfer. Recursive adoption is only for a newly allocated asset graph. */
|
|
4785
|
+
adopt<T extends object>(resource: T, options?: {
|
|
4786
|
+
recursive?: boolean;
|
|
4787
|
+
preserveExisting?: boolean;
|
|
4788
|
+
}): T;
|
|
4789
|
+
/** Leave cleanup to the caller. Recursive classification preserves known dependencies. */
|
|
4790
|
+
borrow<T extends object>(resource: T, options?: {
|
|
4791
|
+
recursive?: boolean;
|
|
4792
|
+
}): T;
|
|
4793
|
+
/**
|
|
4794
|
+
* Hand a complete live graph back to its caller before closing a temporary
|
|
4795
|
+
* allocation scope. Unlike borrow(), this also transfers already-owned
|
|
4796
|
+
* dependencies. Existing leases are unchanged; unreachable allocations still
|
|
4797
|
+
* belong to this registry and are collected normally.
|
|
4798
|
+
*/
|
|
4799
|
+
releaseOwnership<T extends object>(resource: T): T;
|
|
4800
|
+
private setOwnership;
|
|
4801
|
+
/** A render target owns its attachments; attachment users keep the target alive. */
|
|
4802
|
+
registerAttachment(attachment: object, owner: object): void;
|
|
4803
|
+
/** Dependencies hidden in render closures still participate in lease reachability. */
|
|
4804
|
+
registerDependencies(resource: object, dependencies: Iterable<object>): void;
|
|
4805
|
+
/** Add independently owned edges without replacing another adapter's dependencies. */
|
|
4806
|
+
addDependencies(resource: object, dependencies: Iterable<object>): () => void;
|
|
4807
|
+
/** Hold a resource graph without changing ownership of any resource. */
|
|
4808
|
+
retain<T extends object>(resource: T): ResourceLease<T>;
|
|
4809
|
+
/** Capture one synchronous snapshot of multiple roots, with independent leases.
|
|
4810
|
+
* Shared descendants are visited once here; later retain calls capture anew. */
|
|
4811
|
+
retainMany<T extends object>(resources: readonly T[]): ResourceLease<T>[];
|
|
4812
|
+
/**
|
|
4813
|
+
* Protect a completed allocation immediately, then commit synchronous work in
|
|
4814
|
+
* the next microtask's batch. Network/other asynchronous work belongs before
|
|
4815
|
+
* this call. Promises settle only after collection; an unrelated release or
|
|
4816
|
+
* shutdown still runs normally while the mutation is queued.
|
|
4817
|
+
*/
|
|
4818
|
+
enqueueResourceMutation<T>(resource: object, mutate: () => T): Promise<T>;
|
|
4819
|
+
private flushMutations;
|
|
4820
|
+
private retainInternal;
|
|
4821
|
+
private ensureEntry;
|
|
4822
|
+
private captureDependencies;
|
|
4823
|
+
private captureDeferredDependencies;
|
|
4824
|
+
getShared<T extends object = object>(key: string): T | undefined;
|
|
4825
|
+
/** Explicit identity changes invalidate cached definitions of that resource. */
|
|
4826
|
+
invalidateShared(resource: object): void;
|
|
4827
|
+
share<T extends object>(key: string, resource: T): T;
|
|
4828
|
+
private dependencies;
|
|
4829
|
+
sync(_resource?: object): void;
|
|
4830
|
+
private collectUnused;
|
|
4831
|
+
/** Free unbound SDK allocations; explicitly borrowed resources remain untouched. */
|
|
4832
|
+
disposeUnused(resource: any): void;
|
|
4833
|
+
getStats(): {
|
|
4834
|
+
resources: number;
|
|
4835
|
+
materials: number;
|
|
4836
|
+
textures: number;
|
|
4837
|
+
sources: number;
|
|
4838
|
+
leases: number;
|
|
4839
|
+
owned: number;
|
|
4840
|
+
borrowed: number;
|
|
4841
|
+
disposed: number;
|
|
4842
|
+
};
|
|
4843
|
+
dispose(): void;
|
|
4844
|
+
}
|
|
4845
|
+
|
|
4846
|
+
/** A group of idempotent leases, suitable for scenes, loaders and previews. */
|
|
4847
|
+
declare class ResourceScope {
|
|
4848
|
+
private leases;
|
|
4849
|
+
private closed;
|
|
4850
|
+
readonly registry: ResourceRegistry;
|
|
4851
|
+
readonly owner: unknown;
|
|
4852
|
+
constructor(registry: ResourceRegistry, owner?: unknown);
|
|
4853
|
+
/** Allocate an SDK resource and hold it until this operation releases its scope. */
|
|
4854
|
+
create<T extends object>(factory: () => T): T;
|
|
4855
|
+
retain<T extends object>(resource: T): ResourceLease<T>;
|
|
4856
|
+
dispose(): void;
|
|
4857
|
+
}
|
|
4858
|
+
|
|
4859
|
+
declare interface RestoreBaseObjectOptions {
|
|
4860
|
+
/** Transfer an exclusively owned snapshot between packages; restoration may mutate it. */
|
|
4861
|
+
consumeInput?: boolean;
|
|
4862
|
+
/** The caller must validate equality with the serialized resource definitions. */
|
|
4863
|
+
reuseResources?: ReusableObjectResources;
|
|
4864
|
+
/** Bypass unvalidated registry caches; only reuseResources may supply existing instances. */
|
|
4865
|
+
strictResourceReuse?: boolean;
|
|
4866
|
+
}
|
|
4867
|
+
|
|
4868
|
+
/**
|
|
4869
|
+
* Live resources whose serialized definitions the caller has already verified.
|
|
4870
|
+
* Reuse is explicit: equal UUIDs alone do not establish equal definitions.
|
|
4871
|
+
*/
|
|
4872
|
+
declare interface ReusableObjectResources {
|
|
4873
|
+
geometries?: ReadonlyMap<string, BufferGeometry>;
|
|
4874
|
+
materials?: ReadonlyMap<string, Material>;
|
|
4875
|
+
textures?: ReadonlyMap<string, Texture>;
|
|
4876
|
+
}
|
|
4877
|
+
|
|
1696
4878
|
declare class Ring extends MeshObject {
|
|
1697
4879
|
objectType: string;
|
|
1698
4880
|
create(): void;
|
|
@@ -1700,8 +4882,8 @@ declare class Ring extends MeshObject {
|
|
|
1700
4882
|
|
|
1701
4883
|
declare class Road extends GroupObject {
|
|
1702
4884
|
objectType: string;
|
|
1703
|
-
options:
|
|
1704
|
-
constructor(options:
|
|
4885
|
+
options: Options_20;
|
|
4886
|
+
constructor(options: Options_20);
|
|
1705
4887
|
linePrimary: LineObject[];
|
|
1706
4888
|
lineSecondary: LineObject[];
|
|
1707
4889
|
create(): Promise<void>;
|
|
@@ -1736,6 +4918,14 @@ export declare interface SceneBackInteraction {
|
|
|
1736
4918
|
};
|
|
1737
4919
|
}
|
|
1738
4920
|
|
|
4921
|
+
declare interface SceneCaptureOptions {
|
|
4922
|
+
/** Physical output pixels. Defaults to the active content viewport. */
|
|
4923
|
+
width?: number;
|
|
4924
|
+
height?: number;
|
|
4925
|
+
pixelRatio?: number;
|
|
4926
|
+
maxDimension?: number;
|
|
4927
|
+
}
|
|
4928
|
+
|
|
1739
4929
|
/** Scene membership/options delta. Existing authored graphs must use structure patches. */
|
|
1740
4930
|
export declare interface SceneCollectionTransaction {
|
|
1741
4931
|
scenes: readonly SceneViewportDocument[];
|
|
@@ -2020,6 +5210,16 @@ export declare interface SceneObjectPropertyPatch {
|
|
|
2020
5210
|
unset?: readonly string[];
|
|
2021
5211
|
}
|
|
2022
5212
|
|
|
5213
|
+
declare class ScenePages extends OrigonPages<Scene> {
|
|
5214
|
+
get scene(): Scene< Object3DEventMap>;
|
|
5215
|
+
addScene(sceneParams?: SceneParams, index?: number): Scene< Object3DEventMap>;
|
|
5216
|
+
setPageActive(index: number): void;
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5219
|
+
declare interface SceneParams {
|
|
5220
|
+
background: Scene['background'];
|
|
5221
|
+
}
|
|
5222
|
+
|
|
2023
5223
|
declare type ScenePropertyField = typeof scenePropertyFields[number];
|
|
2024
5224
|
|
|
2025
5225
|
export declare const scenePropertyFields: readonly ["color", "groundColor", "intensity", "distance", "decay", "angle", "penumbra", "width", "height", "castShadow", "receiveShadow", "frustumCulled", "renderOrder", "up", "center", "shadow", "near", "far", "fov", "aspect", "zoom", "left", "right", "top", "bottom", "focus", "filmGauge", "filmOffset", "view", "backgroundBlurriness", "backgroundIntensity", "environmentIntensity", "backgroundRotation", "environmentRotation"];
|
|
@@ -2030,6 +5230,101 @@ export declare interface SceneResourceCandidate {
|
|
|
2030
5230
|
root?: any;
|
|
2031
5231
|
}
|
|
2032
5232
|
|
|
5233
|
+
declare class SceneResources_2 {
|
|
5234
|
+
pencil: Pencil;
|
|
5235
|
+
private materials;
|
|
5236
|
+
private transientKeys;
|
|
5237
|
+
private lockedKeys;
|
|
5238
|
+
private materialBaseObjectMap;
|
|
5239
|
+
readonly resources: ResourceRegistry;
|
|
5240
|
+
private aliasLeases;
|
|
5241
|
+
private objectLeases;
|
|
5242
|
+
private sceneLeases;
|
|
5243
|
+
private geometryLeases;
|
|
5244
|
+
readonly emptyGeometryObjects: Set<Object3D< Object3DEventMap>>;
|
|
5245
|
+
private emptyGeometryOwners;
|
|
5246
|
+
private nativeObjectLeases;
|
|
5247
|
+
private proxiedObjects;
|
|
5248
|
+
readonly optionDependencies: OptionMaterialDependencies;
|
|
5249
|
+
private preparedObjects;
|
|
5250
|
+
constructor(pencil: Pencil);
|
|
5251
|
+
prepareOptionMaterials(options: any, scope: ResourceScope): void;
|
|
5252
|
+
/** Temporary preparation protects asynchronous construction, never idle options. */
|
|
5253
|
+
prepareObjectCreate(object: BaseObject): void;
|
|
5254
|
+
add(material: Material, ops?: MaterialRegistrationOptions): void;
|
|
5255
|
+
/** An explicit key becomes the native material UUID. */
|
|
5256
|
+
add(key: string, material: Material, ops?: MaterialRegistrationOptions): void;
|
|
5257
|
+
/** Change the native UUID atomically in every catalog sharing this material. */
|
|
5258
|
+
setKey(reference: string, key: string): void;
|
|
5259
|
+
private reindexMaterial;
|
|
5260
|
+
getAlias(key: string): MaterialAlias_2 | undefined;
|
|
5261
|
+
getAliases(): readonly MaterialAlias_2[];
|
|
5262
|
+
setAliasMaterial(key: string, material: Material, ops?: MaterialRegistrationOptions): void;
|
|
5263
|
+
get(key: string): Material | undefined;
|
|
5264
|
+
getByName(name: string): Material | undefined;
|
|
5265
|
+
getKey(material: Material): string | undefined;
|
|
5266
|
+
getKeyByName(name: string): string | undefined;
|
|
5267
|
+
addMultiple(key: string, materialMap: Record<string, Material | null>): void;
|
|
5268
|
+
getMultiple(key: string): Record<string, Material> | null;
|
|
5269
|
+
copy(sourceKey: string, destinationKey: string, ops?: {
|
|
5270
|
+
name?: string;
|
|
5271
|
+
}): Material | null;
|
|
5272
|
+
copyMultiple(sourceKey: string, destinationKey: string): Record<string, Material>;
|
|
5273
|
+
retainSceneResources(scene: any): void;
|
|
5274
|
+
disposeResource(resource?: object | object[]): void;
|
|
5275
|
+
disposeMaterial(material?: Material | Material[]): void;
|
|
5276
|
+
remove(key: string): void;
|
|
5277
|
+
private detachEntry;
|
|
5278
|
+
private unregisterMaterial;
|
|
5279
|
+
removeByMaterial(material: Material): void;
|
|
5280
|
+
proxyBaseObject(object: BaseObject): void;
|
|
5281
|
+
private applyColorSpaceToMaterials;
|
|
5282
|
+
private material2array;
|
|
5283
|
+
/** Native setters can outlive their wrapper. Retire new allocations without
|
|
5284
|
+
* reacquiring leases; explicitly borrowed assignments stay caller-owned. */
|
|
5285
|
+
private cleanupDisposedObject;
|
|
5286
|
+
private syncObjectGeometry;
|
|
5287
|
+
addBaseObjectMap(object: BaseObject): void;
|
|
5288
|
+
/** Acquire a newly registered tree in one snapshot before slot observers run. */
|
|
5289
|
+
retainNativeObjects(objects: readonly BaseObject[]): void;
|
|
5290
|
+
/** Internal: Transfer a prepared native lease without changing slot observers. */
|
|
5291
|
+
bindNativeObjectLease(object: BaseObject, lease: ResourceLease): void;
|
|
5292
|
+
private updateBaseObjectMap;
|
|
5293
|
+
rmBaseObjectMap(object: BaseObject, targetMaterial?: Material | Material[]): void;
|
|
5294
|
+
private releaseBaseObjectMap;
|
|
5295
|
+
getBaseObjectMap(material: Material): Set<BaseObject<Object3D< Object3DEventMap>>>;
|
|
5296
|
+
setLocked(key: string, locked?: boolean): boolean;
|
|
5297
|
+
lock(key: string): boolean;
|
|
5298
|
+
unlock(key: string): boolean;
|
|
5299
|
+
isLocked(key: string): boolean;
|
|
5300
|
+
isMaterialUsed(key: string): boolean;
|
|
5301
|
+
shouldExportAlias(key: string, includeUnusedUnlockedMaterials?: boolean): boolean;
|
|
5302
|
+
syncChangeMaterial(oldMaterial: Material, material: Material): void;
|
|
5303
|
+
dispose(): void;
|
|
5304
|
+
}
|
|
5305
|
+
|
|
5306
|
+
declare class SceneResourcesPages extends OrigonPages<SceneResources_2> {
|
|
5307
|
+
options: Options_12;
|
|
5308
|
+
get sceneResources(): SceneResources_2;
|
|
5309
|
+
constructor(options: Options_12);
|
|
5310
|
+
addSceneResources(_: any, index?: number): SceneResources_2;
|
|
5311
|
+
removePage(index: number): void;
|
|
5312
|
+
}
|
|
5313
|
+
|
|
5314
|
+
/** Coordinates snapshot export and restoration against the current Lead runtime. */
|
|
5315
|
+
declare class SceneSerializer {
|
|
5316
|
+
private lead;
|
|
5317
|
+
constructor(lead: Lead_2);
|
|
5318
|
+
exportCompressBaseObject(root: BaseObject, options?: ExportBaseObjectOptions): Promise<ArrayBuffer>;
|
|
5319
|
+
exportBaseObject(root: BaseObject, options?: ExportBaseObjectOptions): SceneSnapshot;
|
|
5320
|
+
restoreBaseObject(target: BaseObject, data: string | ArrayBuffer | Object3DJSON, registry?: Record<string, new (...args: any[]) => any>, roomEnvMap?: any, createIfNeeded?: boolean, signal?: AbortSignal, options?: RestoreBaseObjectOptions): Promise<BaseObject<Object3D< Object3DEventMap>>>;
|
|
5321
|
+
private _graftObject3d;
|
|
5322
|
+
}
|
|
5323
|
+
|
|
5324
|
+
declare type SceneSnapshot = Object3DJSON & {
|
|
5325
|
+
materialAliases?: Record<string, SerializedMaterialAlias>;
|
|
5326
|
+
};
|
|
5327
|
+
|
|
2033
5328
|
export declare type SceneStructureGraphKey = 'materialAliases' | 'shapes' | '_sharedOptionsPool' | '_texDataPool';
|
|
2034
5329
|
|
|
2035
5330
|
/** Metadata is part of an owned structure transaction, never a scalar runtime patch. */
|
|
@@ -2156,6 +5451,32 @@ export declare interface SceneViewportPatch {
|
|
|
2156
5451
|
|
|
2157
5452
|
export declare function selectSceneDocument(document: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
2158
5453
|
|
|
5454
|
+
declare type SerializedClip = ReturnType<(typeof _THREE.AnimationClip)['toJSON']>;
|
|
5455
|
+
|
|
5456
|
+
declare interface SerializedMaterialAlias {
|
|
5457
|
+
materialUuid: string;
|
|
5458
|
+
locked: boolean;
|
|
5459
|
+
}
|
|
5460
|
+
|
|
5461
|
+
declare type singleTouchAction =
|
|
5462
|
+
| typeof ACTION.TOUCH_ROTATE
|
|
5463
|
+
| typeof ACTION.TOUCH_TRUCK
|
|
5464
|
+
| typeof ACTION.TOUCH_SCREEN_PAN
|
|
5465
|
+
| typeof ACTION.TOUCH_OFFSET
|
|
5466
|
+
| typeof ACTION.DOLLY
|
|
5467
|
+
| typeof ACTION.ZOOM
|
|
5468
|
+
| typeof ACTION.NONE;
|
|
5469
|
+
|
|
5470
|
+
declare const sinusoidalInOut: ({ owner, onUpdate, onComplete, onCancel, backwards, }?: TweenOptions) => {
|
|
5471
|
+
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
5472
|
+
duration?: number | undefined;
|
|
5473
|
+
repeat?: number | undefined;
|
|
5474
|
+
repeatResolve?: number | undefined;
|
|
5475
|
+
repeatDelay?: number | undefined;
|
|
5476
|
+
}) => Promise<void>;
|
|
5477
|
+
stop: () => void;
|
|
5478
|
+
};
|
|
5479
|
+
|
|
2159
5480
|
declare class Sphere extends MeshObject {
|
|
2160
5481
|
radius: number;
|
|
2161
5482
|
options: any;
|
|
@@ -2164,10 +5485,30 @@ declare class Sphere extends MeshObject {
|
|
|
2164
5485
|
create(): void;
|
|
2165
5486
|
}
|
|
2166
5487
|
|
|
5488
|
+
/** Exact radial lift above the short great circle, expressed in object-local space. */
|
|
5489
|
+
declare class SphereArcCurve extends _THREE.Curve<_THREE.Vector3> {
|
|
5490
|
+
readonly type = "SphereArcCurve";
|
|
5491
|
+
readonly data: ArcSpherePath;
|
|
5492
|
+
readonly matrix: _THREE.Matrix4;
|
|
5493
|
+
constructor(path: ArcSpherePath);
|
|
5494
|
+
get v0(): _THREE.Vector3;
|
|
5495
|
+
get v3(): _THREE.Vector3;
|
|
5496
|
+
getPoint(t: number, target?: _THREE.Vector3): _THREE.Vector3;
|
|
5497
|
+
getTangent(t: number, target?: _THREE.Vector3): _THREE.Vector3;
|
|
5498
|
+
clone(): this;
|
|
5499
|
+
copy(source: _THREE.Curve<_THREE.Vector3>): this;
|
|
5500
|
+
toJSON(): SphereArcCurveJSON;
|
|
5501
|
+
fromJSON(json: _THREE.CurveJSON): this;
|
|
5502
|
+
}
|
|
5503
|
+
|
|
5504
|
+
declare interface SphereArcCurveJSON extends _THREE.CurveJSON {
|
|
5505
|
+
spherePath: ArcSpherePath;
|
|
5506
|
+
}
|
|
5507
|
+
|
|
2167
5508
|
declare class SphereShadow extends MeshObject {
|
|
2168
5509
|
objectType: string;
|
|
2169
|
-
options: Required<
|
|
2170
|
-
constructor(options:
|
|
5510
|
+
options: Required<Options_16>;
|
|
5511
|
+
constructor(options: Options_16);
|
|
2171
5512
|
create(): Promise<void>;
|
|
2172
5513
|
rebuildFromScene(): void;
|
|
2173
5514
|
}
|
|
@@ -2197,15 +5538,143 @@ declare class SpotLight extends SpotLightObject {
|
|
|
2197
5538
|
render(): void;
|
|
2198
5539
|
}
|
|
2199
5540
|
|
|
2200
|
-
declare class
|
|
5541
|
+
declare class SpotLightObject extends BaseObject<SpotLight_2> {
|
|
5542
|
+
objectType: string;
|
|
5543
|
+
constructor(lightOrColor?: SpotLight_2 | string | number, intensity?: number, distance?: number, angle?: number, penumbra?: number, decay?: number);
|
|
5544
|
+
render(): void;
|
|
5545
|
+
dispose(): void;
|
|
5546
|
+
}
|
|
5547
|
+
|
|
5548
|
+
declare class Sprite_2 extends SpriteObject {
|
|
2201
5549
|
objectType: string;
|
|
2202
5550
|
create(): void;
|
|
2203
5551
|
setDesiredPixelSize(size: number): void;
|
|
2204
5552
|
}
|
|
2205
5553
|
|
|
5554
|
+
declare class SpriteObject<M extends SpriteMaterial = SpriteMaterial> extends BaseObject<Sprite> {
|
|
5555
|
+
objectType: string;
|
|
5556
|
+
constructor(materialOrSprite?: M | Sprite);
|
|
5557
|
+
}
|
|
5558
|
+
|
|
5559
|
+
declare interface SSAOParams {
|
|
5560
|
+
kernelRadius: number;
|
|
5561
|
+
minDistance: number;
|
|
5562
|
+
maxDistance: number;
|
|
5563
|
+
}
|
|
5564
|
+
|
|
5565
|
+
declare class Stats {
|
|
5566
|
+
dom: HTMLDivElement;
|
|
5567
|
+
mode: number;
|
|
5568
|
+
horizontal: boolean;
|
|
5569
|
+
minimal: boolean;
|
|
5570
|
+
trackGPU: boolean;
|
|
5571
|
+
trackHz: boolean;
|
|
5572
|
+
trackFPS: boolean;
|
|
5573
|
+
trackCPT: boolean;
|
|
5574
|
+
samplesLog: number;
|
|
5575
|
+
samplesGraph: number;
|
|
5576
|
+
precision: number;
|
|
5577
|
+
logsPerSecond: number;
|
|
5578
|
+
graphsPerSecond: number;
|
|
5579
|
+
gl: WebGL2RenderingContext | null;
|
|
5580
|
+
ext: any | null;
|
|
5581
|
+
info?: InfoData;
|
|
5582
|
+
private activeQuery;
|
|
5583
|
+
private gpuQueries;
|
|
5584
|
+
private threeRendererPatched;
|
|
5585
|
+
private beginTime;
|
|
5586
|
+
private prevCpuTime;
|
|
5587
|
+
private frameTimes;
|
|
5588
|
+
private renderCount;
|
|
5589
|
+
private totalCpuDuration;
|
|
5590
|
+
private totalGpuDuration;
|
|
5591
|
+
private totalGpuDurationCompute;
|
|
5592
|
+
private _panelId;
|
|
5593
|
+
private fpsPanel;
|
|
5594
|
+
private msPanel;
|
|
5595
|
+
private gpuPanel;
|
|
5596
|
+
private gpuPanelCompute;
|
|
5597
|
+
private vsyncPanel;
|
|
5598
|
+
averageFps: AverageData;
|
|
5599
|
+
averageCpu: AverageData;
|
|
5600
|
+
averageGpu: AverageData;
|
|
5601
|
+
averageGpuCompute: AverageData;
|
|
5602
|
+
private updateCounter;
|
|
5603
|
+
private prevGraphTime;
|
|
5604
|
+
private lastMin;
|
|
5605
|
+
private lastMax;
|
|
5606
|
+
private lastValue;
|
|
5607
|
+
private prevTextTime;
|
|
5608
|
+
private readonly VSYNC_RATES;
|
|
5609
|
+
private detectedVSync;
|
|
5610
|
+
private frameTimeHistory;
|
|
5611
|
+
private readonly HISTORY_SIZE;
|
|
5612
|
+
private readonly VSYNC_THRESHOLD;
|
|
5613
|
+
private lastFrameTime;
|
|
5614
|
+
static Panel: typeof Panel;
|
|
5615
|
+
constructor({ trackGPU, trackCPT, trackHz, trackFPS, logsPerSecond, graphsPerSecond, samplesLog, samplesGraph, precision, minimal, horizontal, mode }?: StatsOptions);
|
|
5616
|
+
private initializeDOM;
|
|
5617
|
+
private setupEventListeners;
|
|
5618
|
+
private handleClick;
|
|
5619
|
+
private handleResize;
|
|
5620
|
+
init(canvasOrGL: WebGL2RenderingContext | HTMLCanvasElement | OffscreenCanvas | any): Promise<void>;
|
|
5621
|
+
private handleThreeRenderer;
|
|
5622
|
+
private handleWebGPURenderer;
|
|
5623
|
+
private initializeWebGPUPanels;
|
|
5624
|
+
private initializeWebGL;
|
|
5625
|
+
private initializeGPUTracking;
|
|
5626
|
+
begin(): void;
|
|
5627
|
+
end(): void;
|
|
5628
|
+
update(): void;
|
|
5629
|
+
private processWebGPUTimestamps;
|
|
5630
|
+
private resetCounters;
|
|
5631
|
+
resizePanel(panel: Panel): void;
|
|
5632
|
+
addPanel(panel: Panel): Panel;
|
|
5633
|
+
showPanel(id: number): void;
|
|
5634
|
+
processGpuQueries(): void;
|
|
5635
|
+
private detectVSync;
|
|
5636
|
+
endInternal(): number;
|
|
5637
|
+
private updatePanelComponents;
|
|
5638
|
+
private beginProfiling;
|
|
5639
|
+
private endProfiling;
|
|
5640
|
+
updatePanel(panel: {
|
|
5641
|
+
update: any;
|
|
5642
|
+
updateGraph: any;
|
|
5643
|
+
name: string;
|
|
5644
|
+
} | null, averageArray: {
|
|
5645
|
+
logs: number[];
|
|
5646
|
+
graph: number[];
|
|
5647
|
+
}, precision?: number): void;
|
|
5648
|
+
private updateAverages;
|
|
5649
|
+
addToAverage(value: number, averageArray: {
|
|
5650
|
+
logs: any;
|
|
5651
|
+
graph: any;
|
|
5652
|
+
}): void;
|
|
5653
|
+
get domElement(): HTMLDivElement;
|
|
5654
|
+
patchThreeWebGPU(renderer: any): void;
|
|
5655
|
+
patchThreeRenderer(renderer: any): void;
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
declare interface StatsOptions {
|
|
5659
|
+
trackGPU?: boolean;
|
|
5660
|
+
trackCPT?: boolean;
|
|
5661
|
+
trackHz?: boolean;
|
|
5662
|
+
trackFPS?: boolean;
|
|
5663
|
+
logsPerSecond?: number;
|
|
5664
|
+
graphsPerSecond?: number;
|
|
5665
|
+
samplesLog?: number;
|
|
5666
|
+
samplesGraph?: number;
|
|
5667
|
+
precision?: number;
|
|
5668
|
+
minimal?: boolean;
|
|
5669
|
+
horizontal?: boolean;
|
|
5670
|
+
mode?: number;
|
|
5671
|
+
}
|
|
5672
|
+
|
|
2206
5673
|
export declare function stripMaterialAssetBinding<T extends Record<string, any>>(material: T): T;
|
|
2207
5674
|
|
|
2208
|
-
|
|
5675
|
+
declare type StructureResourceKind = typeof resourceKinds[number];
|
|
5676
|
+
|
|
5677
|
+
export declare type StructureResources = Record<ResourceKind, Record<string, any>[]>;
|
|
2209
5678
|
|
|
2210
5679
|
export declare interface SwitchSceneOptions {
|
|
2211
5680
|
/** 返回历史时不再记录当前场景。 */
|
|
@@ -2216,13 +5685,113 @@ export declare interface SwitchSceneOptions {
|
|
|
2216
5685
|
|
|
2217
5686
|
export { THREE }
|
|
2218
5687
|
|
|
5688
|
+
declare interface THREESubset {
|
|
5689
|
+
Vector2: typeof _THREE.Vector2;
|
|
5690
|
+
Vector3: typeof _THREE.Vector3;
|
|
5691
|
+
Vector4: typeof _THREE.Vector4;
|
|
5692
|
+
Quaternion: typeof _THREE.Quaternion;
|
|
5693
|
+
Matrix4: typeof _THREE.Matrix4;
|
|
5694
|
+
Spherical: typeof _THREE.Spherical;
|
|
5695
|
+
Box3: typeof _THREE.Box3;
|
|
5696
|
+
Sphere: typeof _THREE.Sphere;
|
|
5697
|
+
Raycaster: typeof _THREE.Raycaster;
|
|
5698
|
+
[key: string]: any;
|
|
5699
|
+
}
|
|
5700
|
+
|
|
5701
|
+
declare const timeOut: (ms: number) => Promise<any>;
|
|
5702
|
+
|
|
5703
|
+
declare interface Touches {
|
|
5704
|
+
one: singleTouchAction;
|
|
5705
|
+
two: multiTouchAction;
|
|
5706
|
+
three: multiTouchAction;
|
|
5707
|
+
}
|
|
5708
|
+
|
|
5709
|
+
declare class TransformControlsController {
|
|
5710
|
+
controls: TransformControls;
|
|
5711
|
+
private readonly neutralCamera;
|
|
5712
|
+
private helper?;
|
|
5713
|
+
private viewScene?;
|
|
5714
|
+
private viewport?;
|
|
5715
|
+
get detach(): () => TransformControls;
|
|
5716
|
+
get attach(): (object: Object3D_2) => TransformControls;
|
|
5717
|
+
event: EventEmitter;
|
|
5718
|
+
constructor(options: Options_7);
|
|
5719
|
+
setViewport(viewport: Viewport): void;
|
|
5720
|
+
bindActiveView(camera: Camera_2 | undefined, scene: Scene_2 | undefined, viewScene?: Scene_2< Object3DEventMap> | undefined): void;
|
|
5721
|
+
private releaseRaycastCamera;
|
|
5722
|
+
private getBoundingClientRect;
|
|
5723
|
+
addEvent(): void;
|
|
5724
|
+
dispose(): void;
|
|
5725
|
+
}
|
|
5726
|
+
|
|
5727
|
+
declare class TubeObject extends MeshObject {
|
|
5728
|
+
objectType: string;
|
|
5729
|
+
options: TubeOptions;
|
|
5730
|
+
constructor(options: TubeOptions);
|
|
5731
|
+
create(): void;
|
|
5732
|
+
}
|
|
5733
|
+
|
|
5734
|
+
declare interface TubeOptions {
|
|
5735
|
+
path?: _THREE.Curve<_THREE.Vector3>;
|
|
5736
|
+
radius?: number;
|
|
5737
|
+
multiplyScalar?: number;
|
|
5738
|
+
/** Compact saved inputs for an Arc's derived picking geometry. */
|
|
5739
|
+
arcControlPoints?: number[][];
|
|
5740
|
+
arcSpherePath?: ArcSpherePath;
|
|
5741
|
+
}
|
|
5742
|
+
|
|
2219
5743
|
export { TWEEN }
|
|
2220
5744
|
|
|
2221
5745
|
export declare type Tween<T extends Record<string, any>> = Tween_2<T>;
|
|
2222
5746
|
|
|
5747
|
+
declare interface TweenOptions {
|
|
5748
|
+
owner?: Pick<Pencil, 'animations'>;
|
|
5749
|
+
onUpdate?: (value: number) => void;
|
|
5750
|
+
onComplete?: () => void;
|
|
5751
|
+
onCancel?: () => void;
|
|
5752
|
+
backwards?: boolean;
|
|
5753
|
+
}
|
|
5754
|
+
|
|
5755
|
+
declare type TypeEXR = ValuesOf<(typeof KNOWN_ASSET_TYPES)['exr']>;
|
|
5756
|
+
|
|
5757
|
+
declare type TypeGLTF = ValuesOf<(typeof KNOWN_ASSET_TYPES)['gltf']>;
|
|
5758
|
+
|
|
5759
|
+
declare type TypeGzipJSON = ValuesOf<(typeof KNOWN_ASSET_TYPES)['gzipJson']>;
|
|
5760
|
+
|
|
5761
|
+
declare type TypeImage = ValuesOf<(typeof KNOWN_ASSET_TYPES)['images']>;
|
|
5762
|
+
|
|
5763
|
+
declare type TypeJSON = ValuesOf<(typeof KNOWN_ASSET_TYPES)['json']>;
|
|
5764
|
+
|
|
5765
|
+
declare type TypeLottie = ValuesOf<(typeof KNOWN_ASSET_TYPES)['lottie']>;
|
|
5766
|
+
|
|
5767
|
+
declare type TypeMedia = ValuesOf<(typeof KNOWN_ASSET_TYPES)['media']>;
|
|
5768
|
+
|
|
2223
5769
|
export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
|
|
2224
5770
|
|
|
2225
|
-
|
|
5771
|
+
declare class UseMaterial extends PointerEvent_2 {
|
|
5772
|
+
pencil: Pencil;
|
|
5773
|
+
lead: Lead_2;
|
|
5774
|
+
sceneResources: SceneResources_2;
|
|
5775
|
+
userData: Record<string, any>;
|
|
5776
|
+
object3d: Object3D;
|
|
5777
|
+
cloneMaterial(): Material< MaterialEventMap> | Material< MaterialEventMap>[] | undefined;
|
|
5778
|
+
useSceneMaterialById(id: string, slot?: number): void;
|
|
5779
|
+
useSceneMaterialByName(name: string, slot?: number): void;
|
|
5780
|
+
dispose(): void;
|
|
5781
|
+
}
|
|
5782
|
+
|
|
5783
|
+
declare type ValuesOf<T extends readonly any[]> = T[number];
|
|
5784
|
+
|
|
5785
|
+
export declare const VERSION = "0.33.9";
|
|
5786
|
+
|
|
5787
|
+
declare interface Viewport {
|
|
5788
|
+
left: number;
|
|
5789
|
+
top: number;
|
|
5790
|
+
width: number;
|
|
5791
|
+
height: number;
|
|
5792
|
+
fullWidth: number;
|
|
5793
|
+
fullHeight: number;
|
|
5794
|
+
}
|
|
2226
5795
|
|
|
2227
5796
|
/** Enumerate authored reference fields only; never inspect arbitrary userdata or resource payloads. */
|
|
2228
5797
|
export declare function visitSceneIdentityReferences(scene: any, objectIdentity: boolean, visit: (path: IdentityPath, value: any, track?: boolean, key?: boolean) => void): void;
|
|
@@ -2260,7 +5829,7 @@ export declare interface VisSceneManifest {
|
|
|
2260
5829
|
s?: string;
|
|
2261
5830
|
}
|
|
2262
5831
|
|
|
2263
|
-
declare class Water extends
|
|
5832
|
+
declare class Water extends Mesh_2<BufferGeometry, NodeMaterial & { uniforms: Record<string, IUniform> }> {
|
|
2264
5833
|
static WaterShader: WaterShader;
|
|
2265
5834
|
isWater: true;
|
|
2266
5835
|
constructor(geometry: BufferGeometry, options: WaterOptions);
|
|
@@ -2273,7 +5842,7 @@ declare interface WaterOptions {
|
|
|
2273
5842
|
textureWidth?: number;
|
|
2274
5843
|
textureHeight?: number;
|
|
2275
5844
|
clipBias?: number;
|
|
2276
|
-
flowDirection?:
|
|
5845
|
+
flowDirection?: Vector2_2;
|
|
2277
5846
|
flowSpeed?: number;
|
|
2278
5847
|
reflectivity?: number;
|
|
2279
5848
|
scale?: number;
|
|
@@ -2286,8 +5855,9 @@ declare interface WaterOptions {
|
|
|
2286
5855
|
declare interface WaterShader {
|
|
2287
5856
|
name: string;
|
|
2288
5857
|
uniforms: Record<string, IUniform>;
|
|
2289
|
-
|
|
2290
|
-
fragmentShader: string;
|
|
5858
|
+
colorNode?: Node_2 | ((uniforms: Record<string, IUniform>, defaultColor: Node_2) => Node_2);
|
|
2291
5859
|
}
|
|
2292
5860
|
|
|
5861
|
+
declare type WidthCallback = (p: number) => number;
|
|
5862
|
+
|
|
2293
5863
|
export { }
|