illutions 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +231 -184
- package/LICENSE +29 -1
- package/README.md +26 -40
- package/dist/main.d.ts +992 -1108
- package/dist/main.min.cjs +1 -1
- package/dist/main.min.js +1 -1
- package/package.json +4 -4
package/dist/main.d.ts
CHANGED
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
import { AnyEventObject } from 'xstate';
|
|
2
2
|
import { AnyStateMachine } from 'xstate';
|
|
3
|
-
import {
|
|
4
|
-
import { createBrowserInspector } from '@statelyai/inspect';
|
|
5
|
-
import { default as default_2 } from 'three/addons/tsl/display/GTAONode.js';
|
|
6
|
-
import { default as default_3 } from 'three/addons/tsl/display/SSRNode.js';
|
|
7
|
-
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
8
|
-
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
|
|
9
|
-
import { EXRLoader } from 'three/addons/loaders/EXRLoader.js';
|
|
10
|
-
import { FXAAShader } from 'three/addons/shaders/FXAAShader.js';
|
|
11
|
-
import { GLTF } from 'three/addons/loaders/GLTFLoader.js';
|
|
12
|
-
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
13
|
-
import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
|
|
14
|
-
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
|
|
15
|
-
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
|
|
16
|
-
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
17
|
-
import { OrbitControls as OrbitControls_2 } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
18
|
-
import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
|
|
19
|
-
import { Pane } from 'tweakpane';
|
|
20
|
-
import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js';
|
|
21
|
-
import { PointerLockControls as PointerLockControls_2 } from 'three/examples/jsm/controls/PointerLockControls.js';
|
|
22
|
-
import { RectAreaLightTexturesLib } from 'three/addons/lights/RectAreaLightTexturesLib.js';
|
|
23
|
-
import { RectAreaLightUniformsLib } from 'three/addons/lights/RectAreaLightUniformsLib.js';
|
|
3
|
+
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
24
4
|
import { ReflectorForSSRPass } from 'three/addons/objects/ReflectorForSSRPass.js';
|
|
25
|
-
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
|
|
26
|
-
import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
|
|
27
|
-
import { smaa } from 'three/addons/tsl/display/SMAANode.js';
|
|
28
|
-
import { SMAAPass } from 'three/addons/postprocessing/SMAAPass.js';
|
|
29
|
-
import { SSAOPass } from 'three/addons/postprocessing/SSAOPass.js';
|
|
30
|
-
import { ssr } from 'three/addons/tsl/display/SSRNode.js';
|
|
31
|
-
import { SSRPass } from 'three/addons/postprocessing/SSRPass.js';
|
|
32
5
|
import type * as THREE_TYPE from 'three';
|
|
33
6
|
import type * as THREE_WEBGPU_TYPE from 'three/webgpu';
|
|
34
|
-
import type * as THREE_WEBTSL_TYPE from 'three/tsl';
|
|
35
|
-
import { TierResult } from 'detect-gpu';
|
|
36
|
-
import { traa } from 'three/addons/tsl/display/TRAANode.js';
|
|
37
7
|
|
|
38
8
|
/**
|
|
39
|
-
*
|
|
9
|
+
* Shared anti-aliasing Inspector settings.
|
|
40
10
|
* @category Cfg
|
|
41
11
|
*/
|
|
42
12
|
export declare interface AaCfg {
|
|
@@ -45,17 +15,21 @@ export declare interface AaCfg {
|
|
|
45
15
|
* @default false
|
|
46
16
|
*/
|
|
47
17
|
guiOpened: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Selects the anti-aliasing mode. TRAA automatically falls back to FXAA when WebGL is used.
|
|
50
|
-
* @default 'none'
|
|
51
|
-
*/
|
|
52
|
-
mode: 'none' | 'fxaa' | 'smaa' | 'traa';
|
|
53
18
|
}
|
|
54
19
|
|
|
20
|
+
/** Anti-aliasing modes available across rendering backends. */
|
|
21
|
+
export declare type AaMode = AaModeWebGl | AaModeWebGpu;
|
|
22
|
+
|
|
23
|
+
/** Anti-aliasing modes available with WebGL. */
|
|
24
|
+
export declare type AaModeWebGl = 'none' | 'fxaa' | 'smaa';
|
|
25
|
+
|
|
26
|
+
/** Anti-aliasing modes available with WebGPU. */
|
|
27
|
+
export declare type AaModeWebGpu = 'none' | 'fxaa' | 'smaa' | 'traa';
|
|
28
|
+
|
|
55
29
|
export declare type ActionFadeMode = 'in' | 'out';
|
|
56
30
|
|
|
57
31
|
/**
|
|
58
|
-
*
|
|
32
|
+
* Controls uniform ambient illumination.
|
|
59
33
|
* @category Cfg
|
|
60
34
|
*/
|
|
61
35
|
export declare interface AmbientlightCfg {
|
|
@@ -76,9 +50,8 @@ export declare interface AmbientlightCfg {
|
|
|
76
50
|
intensity: number;
|
|
77
51
|
}
|
|
78
52
|
|
|
79
|
-
/** @event Fired when an object
|
|
53
|
+
/** @event Fired when an object or material color animation starts or completes. */
|
|
80
54
|
export declare interface AnimEvent {
|
|
81
|
-
/** Identifies this event type. */
|
|
82
55
|
type: 'Anim_Complete' | 'Anim_Start';
|
|
83
56
|
/** The name of the `THREE.Object3D` whose animation changed state. */
|
|
84
57
|
objName: string;
|
|
@@ -86,9 +59,8 @@ export declare interface AnimEvent {
|
|
|
86
59
|
fct: string;
|
|
87
60
|
}
|
|
88
61
|
|
|
89
|
-
/** @event Fired when a material
|
|
62
|
+
/** @event Fired when a numeric material animation starts or completes. */
|
|
90
63
|
export declare interface AnimFadeEvent {
|
|
91
|
-
/** Identifies this event type. */
|
|
92
64
|
type: 'Anim_Fade_Complete' | 'Anim_Fade_Start';
|
|
93
65
|
/** The name of the `THREE.Mesh` whose material fade changed state. */
|
|
94
66
|
objName: string;
|
|
@@ -101,77 +73,70 @@ export declare interface AnimFadeEvent {
|
|
|
101
73
|
}
|
|
102
74
|
|
|
103
75
|
/**
|
|
104
|
-
*
|
|
105
|
-
* It provides an entry point for creating and controlling a complete 3D scene.
|
|
76
|
+
* Starts the application and provides access to its components and runtime systems.
|
|
106
77
|
* @category Core
|
|
107
78
|
*/
|
|
108
|
-
export declare class App<
|
|
79
|
+
export declare class App<TComps extends Comps = {}> {
|
|
109
80
|
readonly audio: Audio_2;
|
|
110
|
-
private readonly
|
|
81
|
+
private readonly ctrl;
|
|
111
82
|
readonly engine: Engine;
|
|
112
|
-
private readonly
|
|
83
|
+
private readonly model;
|
|
113
84
|
readonly envCtrls: EnvCtrls;
|
|
114
85
|
readonly events: Events;
|
|
115
86
|
readonly orbitCtrls: OrbitCtrls;
|
|
116
87
|
readonly fpvCtrls: FpvCtrls;
|
|
117
88
|
readonly raycast: Raycast;
|
|
89
|
+
readonly scene: Scene;
|
|
118
90
|
readonly stateMachine: StateMachine;
|
|
91
|
+
private readonly webCtrls;
|
|
119
92
|
private cam3D;
|
|
120
93
|
private readonly inspector;
|
|
121
|
-
readonly comps:
|
|
122
|
-
readonly objs3D: Obj3DInsts<NonNullable<TClasses['objs3D']>>;
|
|
123
|
-
private compsMap;
|
|
94
|
+
readonly comps: CompsInsts<TComps>;
|
|
124
95
|
private objs3DMap;
|
|
125
|
-
|
|
126
|
-
init(cfg: Cfg): Promise<void>;
|
|
96
|
+
private websMap;
|
|
127
97
|
/**
|
|
128
|
-
*
|
|
129
|
-
* @param cfg -
|
|
130
|
-
* @param
|
|
98
|
+
* Starts the application, loads the initial scene resources, and connects components and the optional state machine. Startup errors are caught and logged.
|
|
99
|
+
* @param cfg - Startup settings. Defaults to the exported `cfg`.
|
|
100
|
+
* @param comps - Scene Component and Web Component definitions. Default: **empty object**
|
|
131
101
|
* @param createStateMachine - Factory function that receives the fully created `App` instance and returns a state machine.
|
|
132
102
|
*
|
|
133
|
-
* @returns
|
|
103
|
+
* @returns Resolves after startup completes or a startup error is caught.
|
|
134
104
|
*
|
|
135
105
|
* **Example**
|
|
136
|
-
* {@includeCode
|
|
106
|
+
* {@includeCode ../../../apps-doc/examples/app-run.ts}
|
|
137
107
|
*/
|
|
138
|
-
static run<
|
|
108
|
+
static run<TComps extends Comps = {}>(cfg?: Cfg, comps?: TComps, createStateMachine?: (app: App<TComps>) => AnyStateMachine): Promise<void>;
|
|
139
109
|
}
|
|
140
110
|
|
|
141
111
|
/**
|
|
142
|
-
*
|
|
143
|
-
* AudioContext management.
|
|
112
|
+
* Loads and controls global and positional audio with volume fades.
|
|
144
113
|
* @category Core
|
|
145
114
|
*/
|
|
146
115
|
declare class Audio_2 {
|
|
147
116
|
private readonly ctx;
|
|
148
117
|
private readonly loader;
|
|
149
|
-
private readonly
|
|
118
|
+
private readonly scene;
|
|
150
119
|
private readonly events;
|
|
151
120
|
private readonly loadedSounds;
|
|
152
121
|
private readonly params;
|
|
153
122
|
private listener;
|
|
154
|
-
/* Excluded from this release type: __constructor */
|
|
155
123
|
private attachSoundTo;
|
|
156
124
|
/**
|
|
157
|
-
* Returns
|
|
158
|
-
* @returns A snapshot of the mutable audio settings.
|
|
125
|
+
* Returns a snapshot of playback timing and positional audio settings.
|
|
159
126
|
*/
|
|
160
127
|
get(): Partial<AudioCfg>;
|
|
161
128
|
/**
|
|
162
|
-
* Checks whether
|
|
163
|
-
* @param params -
|
|
164
|
-
* @param params.name -
|
|
165
|
-
* @returns True if the audio is loaded, otherwise false.
|
|
129
|
+
* Checks whether a named sound is loaded.
|
|
130
|
+
* @param params - Sound selection.
|
|
131
|
+
* @param params.name - Sound name.
|
|
166
132
|
*/
|
|
167
133
|
isLoaded({ name }: {
|
|
168
134
|
name: string;
|
|
169
135
|
}): boolean;
|
|
170
136
|
/**
|
|
171
|
-
* Checks whether
|
|
172
|
-
* @param params -
|
|
173
|
-
* @param params.name -
|
|
174
|
-
* @returns True if the audio is playing, otherwise false.
|
|
137
|
+
* Checks whether a named sound is playing.
|
|
138
|
+
* @param params - Sound selection.
|
|
139
|
+
* @param params.name - Sound name.
|
|
175
140
|
*/
|
|
176
141
|
isPlaying({ name }: {
|
|
177
142
|
name: string;
|
|
@@ -189,11 +154,11 @@ declare class Audio_2 {
|
|
|
189
154
|
*/
|
|
190
155
|
loadAndPlay({ name, url, object, volume, fade, loop }: SoundParams): void;
|
|
191
156
|
/**
|
|
192
|
-
* Plays
|
|
157
|
+
* Plays a loaded sound with a volume fade-in.
|
|
193
158
|
* When using {@link load}, call this method after receiving the matching `Audio_Loaded` event.
|
|
194
159
|
* This method does not wait for an audio file that is still loading.
|
|
195
|
-
* @param params -
|
|
196
|
-
* @param params.name -
|
|
160
|
+
* @param params - Sound selection.
|
|
161
|
+
* @param params.name - Loaded sound name.
|
|
197
162
|
*/
|
|
198
163
|
play({ name }: {
|
|
199
164
|
name: string;
|
|
@@ -205,10 +170,10 @@ declare class Audio_2 {
|
|
|
205
170
|
private setAttribute;
|
|
206
171
|
private setAudioContext;
|
|
207
172
|
/**
|
|
208
|
-
*
|
|
173
|
+
* Attaches an audio listener to a scene object or camera. Set a listener before loading sounds.
|
|
209
174
|
*
|
|
210
|
-
* @param params -
|
|
211
|
-
* @param params.object -
|
|
175
|
+
* @param params - Listener target.
|
|
176
|
+
* @param params.object - Scene object name or camera to attach the listener to.
|
|
212
177
|
*/
|
|
213
178
|
setListener({ object }: {
|
|
214
179
|
object: string | Cam3D;
|
|
@@ -221,24 +186,23 @@ declare class Audio_2 {
|
|
|
221
186
|
*/
|
|
222
187
|
set(params: Partial<AudioCfg>): void;
|
|
223
188
|
/**
|
|
224
|
-
*
|
|
225
|
-
* @param params -
|
|
226
|
-
* @param params.name -
|
|
189
|
+
* Fades out a playing sound and stops it.
|
|
190
|
+
* @param params - Sound selection.
|
|
191
|
+
* @param params.name - Sound name.
|
|
227
192
|
*/
|
|
228
193
|
stop({ name }: {
|
|
229
194
|
name: string;
|
|
230
195
|
}): void;
|
|
231
196
|
/**
|
|
232
|
-
*
|
|
233
|
-
* @param extension -
|
|
234
|
-
* @remarks This method is intended for advanced custom integrations where developers need direct access to the engine instance. The extension is executed once immediately when `use()` is called.
|
|
197
|
+
* Runs an extension callback immediately with access to the public API.
|
|
198
|
+
* @param extension - Callback receiving this `Audio` instance.
|
|
235
199
|
*/
|
|
236
200
|
use(extension: (audio: Audio_2) => void): void;
|
|
237
201
|
}
|
|
238
202
|
export { Audio_2 as Audio }
|
|
239
203
|
|
|
240
204
|
/**
|
|
241
|
-
*
|
|
205
|
+
* Controls playback timing and how positional sound fades with distance.
|
|
242
206
|
* @category Cfg
|
|
243
207
|
*/
|
|
244
208
|
export declare interface AudioCfg {
|
|
@@ -253,7 +217,7 @@ export declare interface AudioCfg {
|
|
|
253
217
|
*/
|
|
254
218
|
guiOpened: boolean;
|
|
255
219
|
/**
|
|
256
|
-
*
|
|
220
|
+
* Delay in milliseconds before loading audio for automatic playback.
|
|
257
221
|
* @default 200
|
|
258
222
|
*/
|
|
259
223
|
delayPlaySound: number;
|
|
@@ -268,7 +232,7 @@ export declare interface AudioCfg {
|
|
|
268
232
|
*/
|
|
269
233
|
rolloffFactor: number;
|
|
270
234
|
/**
|
|
271
|
-
*
|
|
235
|
+
* Distance beyond which linear attenuation stops reducing volume.
|
|
272
236
|
* @default 1000
|
|
273
237
|
*/
|
|
274
238
|
maxDistance: number;
|
|
@@ -278,12 +242,12 @@ export declare interface AudioCfg {
|
|
|
278
242
|
*/
|
|
279
243
|
distanceModel: 'linear' | 'inverse' | 'exponential';
|
|
280
244
|
/**
|
|
281
|
-
*
|
|
245
|
+
* Inner cone angle in degrees, within which sound is not attenuated.
|
|
282
246
|
* @default 360
|
|
283
247
|
*/
|
|
284
248
|
coneInnerAngle: number;
|
|
285
249
|
/**
|
|
286
|
-
*
|
|
250
|
+
* Outer cone angle in degrees, beyond which `coneOuterGain` applies.
|
|
287
251
|
* @default 360
|
|
288
252
|
*/
|
|
289
253
|
coneOuterAngle: number;
|
|
@@ -296,27 +260,25 @@ export declare interface AudioCfg {
|
|
|
296
260
|
|
|
297
261
|
/** @event Fired when an audio file has finished loading and is ready for playback. */
|
|
298
262
|
export declare interface AudioLoadedEvent {
|
|
299
|
-
/** Identifies this event type. */
|
|
300
263
|
type: 'Audio_Loaded';
|
|
301
264
|
/** The unique name assigned to the loaded sound. */
|
|
302
265
|
soundName: string;
|
|
303
266
|
}
|
|
304
267
|
|
|
305
268
|
/**
|
|
306
|
-
*
|
|
307
|
-
* - 'normal'
|
|
308
|
-
* - 'additive'
|
|
269
|
+
* Controls how an animation blends with other active animations.
|
|
270
|
+
* - `'normal'`: Blends the action's values with other normal actions according to their weights.
|
|
271
|
+
* - `'additive'`: Adds the action's values to the current animation result according to its weight.
|
|
309
272
|
*/
|
|
310
273
|
export declare type BlendMode = 'normal' | 'additive';
|
|
311
274
|
|
|
312
275
|
/**
|
|
313
|
-
*
|
|
314
|
-
* @category
|
|
276
|
+
* Controls the active camera and adopts compatible cameras from GLTF scenes.
|
|
277
|
+
* @category Scene Components
|
|
315
278
|
*/
|
|
316
279
|
export declare class Cam3D extends Obj3D {
|
|
317
|
-
/* Excluded from this release type: lookMode */
|
|
318
280
|
/**
|
|
319
|
-
*
|
|
281
|
+
* Active perspective or orthographic camera.
|
|
320
282
|
* @default `THREE.PerspectiveCamera`
|
|
321
283
|
*/
|
|
322
284
|
readonly obj: THREE_TYPE.Camera;
|
|
@@ -327,23 +289,19 @@ export declare class Cam3D extends Obj3D {
|
|
|
327
289
|
/** Reference to the original target `THREE.Object3D` loaded from the GLTF scene. */
|
|
328
290
|
targetGltf: THREE_TYPE.Object3D | null;
|
|
329
291
|
private readonly tmpVec;
|
|
330
|
-
/* Excluded from this release type: __constructor */
|
|
331
292
|
/**
|
|
332
|
-
* Called
|
|
293
|
+
* Called when a matching GLTF camera is found. Adopts its projection and world transform when the camera types match.
|
|
333
294
|
* @param objGltf - The GLTF `THREE.Camera` object.
|
|
334
295
|
* @public
|
|
335
296
|
*
|
|
336
297
|
* **Example**
|
|
337
|
-
* {@includeCode
|
|
298
|
+
* {@includeCode ../../../../apps-doc/examples/cam3d-dollycamera.ts}
|
|
338
299
|
*/
|
|
339
300
|
protected onTraverse(objGltf: THREE_TYPE.Camera): void;
|
|
340
|
-
/* Excluded from this release type: traverse */
|
|
341
|
-
/* Excluded from this release type: update */
|
|
342
|
-
/* Excluded from this release type: updateCanvasResize */
|
|
343
301
|
}
|
|
344
302
|
|
|
345
303
|
/**
|
|
346
|
-
*
|
|
304
|
+
* Controls camera position, viewing direction, and clipping distances.
|
|
347
305
|
* @category Cfg
|
|
348
306
|
*/
|
|
349
307
|
export declare interface CamBaseCfg {
|
|
@@ -377,18 +335,27 @@ export declare interface CamBaseCfg {
|
|
|
377
335
|
};
|
|
378
336
|
}
|
|
379
337
|
|
|
380
|
-
export declare type CamCfg = CamPerspectiveCfg | CamOrthographicCfg;
|
|
381
|
-
|
|
382
338
|
/**
|
|
383
|
-
*
|
|
339
|
+
* Selects the camera projection and controls the initial view.
|
|
384
340
|
* @category Cfg
|
|
385
341
|
*/
|
|
386
|
-
export declare interface
|
|
342
|
+
export declare interface CamCfg extends CamBaseCfg {
|
|
387
343
|
/**
|
|
388
|
-
* The camera type.
|
|
389
|
-
* @default '
|
|
344
|
+
* The active camera type.
|
|
345
|
+
* @default 'perspective'
|
|
390
346
|
*/
|
|
391
|
-
type: 'orthographic';
|
|
347
|
+
type: 'perspective' | 'orthographic';
|
|
348
|
+
/** Perspective camera projection settings. */
|
|
349
|
+
perspective: CamPerspectiveCfg;
|
|
350
|
+
/** Orthographic camera projection settings. */
|
|
351
|
+
orthographic: CamOrthographicCfg;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Controls the visible area of an orthographic camera.
|
|
356
|
+
* @category Cfg
|
|
357
|
+
*/
|
|
358
|
+
export declare interface CamOrthographicCfg {
|
|
392
359
|
/**
|
|
393
360
|
* Camera frustum left plane.
|
|
394
361
|
* @default -1
|
|
@@ -409,61 +376,42 @@ export declare interface CamOrthographicCfg extends CamBaseCfg {
|
|
|
409
376
|
* @default -1
|
|
410
377
|
*/
|
|
411
378
|
bottom: number;
|
|
412
|
-
/** @private */
|
|
413
|
-
fov?: never;
|
|
414
|
-
/** @private */
|
|
415
|
-
aspect?: never;
|
|
416
379
|
}
|
|
417
380
|
|
|
418
381
|
/**
|
|
419
|
-
*
|
|
382
|
+
* Controls perspective projection.
|
|
420
383
|
* @category Cfg
|
|
421
384
|
*/
|
|
422
|
-
export declare interface CamPerspectiveCfg
|
|
423
|
-
/**
|
|
424
|
-
* The camera type.
|
|
425
|
-
* @default 'perspective'
|
|
426
|
-
*/
|
|
427
|
-
type: 'perspective';
|
|
385
|
+
export declare interface CamPerspectiveCfg {
|
|
428
386
|
/**
|
|
429
387
|
* Vertical field of view in degrees.
|
|
430
388
|
* @default 75
|
|
431
389
|
*/
|
|
432
390
|
fov: number;
|
|
433
|
-
/** @private */
|
|
434
|
-
left?: never;
|
|
435
|
-
/** @private */
|
|
436
|
-
right?: never;
|
|
437
|
-
/** @private */
|
|
438
|
-
top?: never;
|
|
439
|
-
/** @private */
|
|
440
|
-
bottom?: never;
|
|
441
391
|
}
|
|
442
392
|
|
|
443
|
-
/** @event Fired when
|
|
393
|
+
/** @event Fired when a key is pressed or released while the canvas has focus. */
|
|
444
394
|
export declare interface CanvasKeyEvent {
|
|
445
|
-
/** Identifies this event type. */
|
|
446
395
|
type: 'Canvas_Key_Down' | 'Canvas_Key_Up';
|
|
447
396
|
/** Native keyboard event from the canvas interaction. */
|
|
448
397
|
event: KeyboardEvent;
|
|
449
398
|
}
|
|
450
399
|
|
|
451
|
-
/** @event Fired when the
|
|
400
|
+
/** @event Fired when the pointer clicks, enters, or leaves the canvas. */
|
|
452
401
|
export declare interface CanvasPointerEvent {
|
|
453
|
-
/** Identifies this event type. */
|
|
454
402
|
type: 'Canvas_Click' | 'Canvas_Pointer_Enter' | 'Canvas_Pointer_Leave';
|
|
455
403
|
/** Native pointer event from the canvas interaction. */
|
|
456
404
|
event: PointerEvent;
|
|
457
405
|
}
|
|
458
406
|
|
|
459
407
|
/**
|
|
460
|
-
*
|
|
408
|
+
* Startup settings for the application.
|
|
461
409
|
* @category Cfg
|
|
462
410
|
*/
|
|
463
411
|
export declare interface Cfg {
|
|
464
412
|
/** Audio settings. */
|
|
465
413
|
audio: AudioCfg;
|
|
466
|
-
/** Camera settings. */
|
|
414
|
+
/** Camera settings for a perspective or orthographic camera. */
|
|
467
415
|
cam: CamCfg;
|
|
468
416
|
/** Component settings. */
|
|
469
417
|
comps: CompsCfg;
|
|
@@ -471,6 +419,8 @@ export declare interface Cfg {
|
|
|
471
419
|
debug: DebugCfg;
|
|
472
420
|
/** Environment controls settings. */
|
|
473
421
|
envCtrls: EnvCtrlsCfg;
|
|
422
|
+
/** First-person controls settings. */
|
|
423
|
+
fpvCtrls: FpvCtrlsCfg;
|
|
474
424
|
/** Default GUI settings. */
|
|
475
425
|
gui: GuiCfg;
|
|
476
426
|
/** Light and shadow settings. */
|
|
@@ -481,40 +431,30 @@ export declare interface Cfg {
|
|
|
481
431
|
model: ModelCfg;
|
|
482
432
|
/** Orbit controls settings. */
|
|
483
433
|
orbitCtrls: OrbitCtrlsCfg;
|
|
484
|
-
/** First-person controls settings. */
|
|
485
|
-
fpvCtrls: FpvCtrlsCfg;
|
|
486
434
|
/** Post-processing settings. */
|
|
487
435
|
post: PostCfg;
|
|
488
|
-
/** Renderer settings. */
|
|
489
|
-
render: RenderCfg;
|
|
490
436
|
/** Raycasting settings. */
|
|
491
437
|
raycast: RaycastCfg;
|
|
438
|
+
/** Renderer settings. */
|
|
439
|
+
render: RenderCfg;
|
|
492
440
|
/** Scene settings. */
|
|
493
441
|
scene: SceneCfg;
|
|
494
442
|
/** State machine settings. */
|
|
495
443
|
stateMachine: StateMachineCfg;
|
|
496
444
|
}
|
|
497
445
|
|
|
498
|
-
/**
|
|
446
|
+
/** Default startup settings, updated by `setCfg()`. */
|
|
499
447
|
export declare const cfg: Cfg;
|
|
500
448
|
|
|
501
|
-
/**
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
*
|
|
507
|
-
* @example
|
|
508
|
-
* type MyClasses = Classes<{ cube: typeof Cube }, { marker: typeof Marker }>;
|
|
509
|
-
*/
|
|
510
|
-
export declare type Classes<TObj3DClasses extends Record<string, Obj3DClass> = {}, TCompClasses extends Record<string, CompClass> = {}> = {
|
|
511
|
-
objs3D?: TObj3DClasses;
|
|
512
|
-
comps?: TCompClasses;
|
|
449
|
+
/** Configuration values accepted by `setCfg`. */
|
|
450
|
+
export declare type CfgSet = DeepPartial<Cfg> & {
|
|
451
|
+
render?: DeepPartial<RenderCfg> & {
|
|
452
|
+
profile?: RenderProfileValidCfg;
|
|
453
|
+
};
|
|
513
454
|
};
|
|
514
455
|
|
|
515
|
-
/** @event Fired when
|
|
456
|
+
/** @event Fired when clip playback, weight fading, or speed changes start or complete, or when playback is canceled. */
|
|
516
457
|
export declare interface ClipEvent {
|
|
517
|
-
/** Identifies this event type. */
|
|
518
458
|
type: 'Clip_Start' | 'Clip_Complete' | 'Clip_Cancel' | 'Clip_Fade_Start' | 'Clip_Fade_Complete' | 'Clip_Speed_Start' | 'Clip_Speed_Complete';
|
|
519
459
|
/** The name of the affected `THREE.AnimationClip`. */
|
|
520
460
|
clipName: string;
|
|
@@ -524,112 +464,46 @@ export declare interface ClipEvent {
|
|
|
524
464
|
fadeMode?: ActionFadeMode;
|
|
525
465
|
}
|
|
526
466
|
|
|
527
|
-
/** Defines how a scene object participates in raycasting. */
|
|
528
|
-
export declare interface Collider {
|
|
529
|
-
/** Scene object or scene-object name used for raycasting. */
|
|
530
|
-
obj: Obj3D | string;
|
|
531
|
-
/** Hides the object while it is registered as a collider. */
|
|
532
|
-
hide?: boolean;
|
|
533
|
-
/** Allows the object to occlude tracked occludees and pickables. */
|
|
534
|
-
occluder?: boolean;
|
|
535
|
-
/** Allows the object to emit pointer events. */
|
|
536
|
-
pickable?: boolean;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
declare type ColorNode = THREE_WEBGPU_TYPE.Node<'vec4'>;
|
|
540
|
-
|
|
541
467
|
/**
|
|
542
|
-
*
|
|
543
|
-
* @category Components
|
|
468
|
+
* Uses a `Mesh3D` for pointer picking or occlusion and optionally maps raycast events to another rendered mesh.
|
|
469
|
+
* @category Scene Components
|
|
544
470
|
*/
|
|
545
|
-
export declare class
|
|
546
|
-
/** The
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
private
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
|
|
563
|
-
*
|
|
564
|
-
* @param params - The follow parameters.
|
|
565
|
-
* @param params.obj - The `Obj3D` to follow in the scene.
|
|
566
|
-
*/
|
|
567
|
-
follow({ obj }: {
|
|
568
|
-
obj: Obj3D | string;
|
|
569
|
-
}): void;
|
|
570
|
-
/* Excluded from this release type: getObj3DFollow */
|
|
571
|
-
/* Excluded from this release type: isVisibleFollow */
|
|
572
|
-
/**
|
|
573
|
-
* Applies the combined followed-object and overlap visibility.
|
|
574
|
-
* @param visible - Whether the web component is visible after combining all visibility conditions.
|
|
575
|
-
*/
|
|
576
|
-
protected onVisibilityChanged(visible: boolean): void;
|
|
577
|
-
/**
|
|
578
|
-
* Called once after the `THREE.Scene`, the `THREE.WebGLRenderer` or `THREE.WebGPURenderer`, the `EnvCtrls` are initialized and an existing GLTF model has been loaded and traversed.
|
|
579
|
-
* @public
|
|
580
|
-
*
|
|
581
|
-
* **Example**
|
|
582
|
-
* {@includeCode ../../examples/ilu-onready.ts}
|
|
583
|
-
*/
|
|
584
|
-
protected onReady(): void;
|
|
585
|
-
/**
|
|
586
|
-
* Called once after the `THREE.Scene` is initialized, before an existing GLTF model is loaded.
|
|
587
|
-
* @public
|
|
588
|
-
*/
|
|
589
|
-
protected onStart(): void;
|
|
590
|
-
/* Excluded from this release type: ready */
|
|
591
|
-
/* Excluded from this release type: setVisibleOverlap */
|
|
592
|
-
/* Excluded from this release type: start */
|
|
593
|
-
/**
|
|
594
|
-
* Registers this component for screen-space overlap tracking using `cfg.comps.overlap.padding`.
|
|
595
|
-
* Farther registered components are hidden when their screen-space rectangles overlap.
|
|
596
|
-
*/
|
|
597
|
-
trackOverlap(): void;
|
|
598
|
-
/** Stops this component from following the currently subscribed {@link Obj3D}. */
|
|
599
|
-
unfollow(): void;
|
|
600
|
-
/** Stops screen-space overlap tracking and removes any overlap-based hiding from this component. */
|
|
601
|
-
untrackOverlap(): void;
|
|
602
|
-
private updateVisibility;
|
|
471
|
+
export declare class Coll3D extends Mesh3D {
|
|
472
|
+
/** The rendered mesh represented by this collider, or `null` when the collider represents itself. */
|
|
473
|
+
target: Mesh3D | null;
|
|
474
|
+
/** Allows this collider or its mesh descendants to emit pointer events. */
|
|
475
|
+
pickable: boolean;
|
|
476
|
+
/** Allows this collider or its mesh descendants to occlude tracked objects. */
|
|
477
|
+
occluder: boolean;
|
|
478
|
+
private readonly targetName;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** Initial parameters for a mesh used as a raycast collider. */
|
|
482
|
+
export declare interface Coll3DParams extends Obj3DParams {
|
|
483
|
+
/** Name of the rendered `Mesh3D` represented by this collider. Without a target, the collider represents itself. */
|
|
484
|
+
target?: string;
|
|
485
|
+
/** Allows the collider to emit pointer events. */
|
|
486
|
+
pickable?: boolean;
|
|
487
|
+
/** Allows the collider to occlude tracked objects. */
|
|
488
|
+
occluder?: boolean;
|
|
603
489
|
}
|
|
604
490
|
|
|
605
|
-
/** Constructor type for `Comp` classes. */
|
|
606
|
-
export declare type CompClass = new () => Comp;
|
|
607
|
-
|
|
608
|
-
/* Excluded from this release type: CompCtrls */
|
|
609
|
-
|
|
610
|
-
export declare type CompEvent = CompOverlapEvent | CompVisibleEvent;
|
|
611
|
-
|
|
612
491
|
/**
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
* @
|
|
492
|
+
* Groups the optional scene and web component definitions used by the app.
|
|
493
|
+
*
|
|
494
|
+
* @typeParam TScene - Record of named scene component classes or entries with initial parameters.
|
|
495
|
+
* @typeParam TWeb - Record of named web component classes or entries with initial parameters.
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* type MyComps = Comps<{ cube: typeof Cube }, { marker: typeof Marker }>;
|
|
616
499
|
*/
|
|
617
|
-
export declare type
|
|
618
|
-
|
|
500
|
+
export declare type Comps<TScene extends Record<string, SceneEntry> = {}, TWeb extends Record<string, WebEntry> = {}> = {
|
|
501
|
+
scene?: TScene;
|
|
502
|
+
web?: TWeb;
|
|
619
503
|
};
|
|
620
504
|
|
|
621
|
-
/** @event Fired when the overlap state of a web component changes and triggers the corresponding XState event. */
|
|
622
|
-
export declare interface CompOverlapEvent {
|
|
623
|
-
/** Identifies this event type. */
|
|
624
|
-
type: 'Comp_Overlap_Changed';
|
|
625
|
-
/** The affected web component. */
|
|
626
|
-
comp: Comp;
|
|
627
|
-
/** Whether the component is overlapped by a nearer component. */
|
|
628
|
-
overlapped: boolean;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
505
|
/**
|
|
632
|
-
*
|
|
506
|
+
* Shared component settings.
|
|
633
507
|
* @category Cfg
|
|
634
508
|
*/
|
|
635
509
|
export declare interface CompsCfg {
|
|
@@ -637,8 +511,14 @@ export declare interface CompsCfg {
|
|
|
637
511
|
overlap: CompsOverlapCfg;
|
|
638
512
|
}
|
|
639
513
|
|
|
514
|
+
/** Registered scene components and web component instances available at runtime. */
|
|
515
|
+
export declare type CompsInsts<T extends Comps> = {
|
|
516
|
+
scene: SceneInsts<NonNullable<T['scene']>>;
|
|
517
|
+
web: WebInsts<NonNullable<T['web']>>;
|
|
518
|
+
};
|
|
519
|
+
|
|
640
520
|
/**
|
|
641
|
-
*
|
|
521
|
+
* Controls spacing when hiding overlapping web components.
|
|
642
522
|
* @category Cfg
|
|
643
523
|
*/
|
|
644
524
|
export declare interface CompsOverlapCfg {
|
|
@@ -649,467 +529,163 @@ export declare interface CompsOverlapCfg {
|
|
|
649
529
|
padding: number;
|
|
650
530
|
}
|
|
651
531
|
|
|
652
|
-
/** @event Fired when the combined 3D-object and overlap visibility of a web component changes and triggers the corresponding XState event. */
|
|
653
|
-
export declare interface CompVisibleEvent {
|
|
654
|
-
/** Identifies this event type. */
|
|
655
|
-
type: 'Comp_Visible_Changed';
|
|
656
|
-
/** The affected web component. */
|
|
657
|
-
comp: Comp;
|
|
658
|
-
/** Whether the component is visible after combining all visibility conditions. */
|
|
659
|
-
visible: boolean;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
532
|
/**
|
|
663
|
-
*
|
|
533
|
+
* Controls diagnostic console output.
|
|
664
534
|
* @category Cfg
|
|
665
535
|
*/
|
|
666
536
|
export declare interface DebugCfg {
|
|
667
537
|
/**
|
|
668
538
|
* Controls how much debug information is written to the console.
|
|
669
539
|
*
|
|
670
|
-
* `'none'`: No debug messages are logged.
|
|
671
|
-
* `'xstate'`: Only logs events that were accepted by the state machine.
|
|
672
|
-
* `'all'`: Logs all debug messages.
|
|
540
|
+
* - `'none'`: No debug messages are logged.
|
|
541
|
+
* - `'xstate'`: Only logs events that were accepted by the state machine.
|
|
542
|
+
* - `'all'`: Logs all debug messages.
|
|
673
543
|
* @default 'xstate'
|
|
674
544
|
*/
|
|
675
|
-
log:
|
|
545
|
+
log: DebugLog;
|
|
676
546
|
}
|
|
677
547
|
|
|
548
|
+
/** @inheritDoc DebugCfg.log */
|
|
549
|
+
export declare type DebugLog = 'none' | 'xstate' | 'all';
|
|
550
|
+
|
|
551
|
+
declare type DeepPartial<T> = T extends readonly unknown[] ? T : T extends object ? {
|
|
552
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
553
|
+
} : T;
|
|
554
|
+
|
|
678
555
|
/**
|
|
679
|
-
*
|
|
680
|
-
* rendering, animation playback, and material updates, while integrating system events, raycasting, and performance monitoring. It provides the foundation for real-time interaction and visual consistency across
|
|
681
|
-
* all scene components.
|
|
556
|
+
* Renders the scene and controls post-processing and adaptive performance.
|
|
682
557
|
* @category Core
|
|
683
558
|
*/
|
|
684
559
|
export declare class Engine {
|
|
685
|
-
/* Excluded from this release type: scene */
|
|
686
560
|
private readonly cam3D;
|
|
561
|
+
private readonly cfg;
|
|
687
562
|
private readonly events;
|
|
688
|
-
private readonly lib;
|
|
689
563
|
private readonly modules;
|
|
690
564
|
private readonly objs3D;
|
|
691
|
-
private readonly
|
|
565
|
+
private readonly scene;
|
|
692
566
|
private readonly infoBox;
|
|
693
|
-
private readonly model;
|
|
694
|
-
private actionCtrls;
|
|
695
|
-
private gltf;
|
|
696
|
-
private mixer;
|
|
697
567
|
private callbacks;
|
|
698
568
|
private resolveWaitForRender;
|
|
699
569
|
private canvas;
|
|
700
570
|
private composer;
|
|
701
|
-
/* Excluded from this release type: renderer */
|
|
702
571
|
private renderPipeline;
|
|
703
|
-
|
|
704
|
-
|
|
572
|
+
private postProfile;
|
|
573
|
+
private postProfileLast;
|
|
705
574
|
private fxaaPass;
|
|
706
575
|
private outputPass;
|
|
707
576
|
private renderPass;
|
|
708
577
|
private smaaPass;
|
|
709
578
|
private tslPass;
|
|
710
579
|
private aaNode;
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
private
|
|
717
|
-
private
|
|
718
|
-
private
|
|
719
|
-
private
|
|
720
|
-
private
|
|
721
|
-
private postNoiseCheck;
|
|
580
|
+
private rttNode;
|
|
581
|
+
private traaWarmupContext;
|
|
582
|
+
private ecoButtonActive;
|
|
583
|
+
private gfxChanging;
|
|
584
|
+
private gfxIndex;
|
|
585
|
+
private gfxLevels;
|
|
586
|
+
private gfxMode;
|
|
587
|
+
private readonly gfxPostProfiles;
|
|
588
|
+
private gfxState;
|
|
589
|
+
private gfxDownOnly;
|
|
722
590
|
private dTs;
|
|
723
591
|
private dT;
|
|
724
|
-
private dTFrameMax;
|
|
725
|
-
private gpuFps;
|
|
726
592
|
private timeGsap;
|
|
727
593
|
private timeLast;
|
|
728
594
|
private timeLastFrame;
|
|
729
595
|
private resizeTimeout;
|
|
730
596
|
private resizeDelay;
|
|
731
|
-
/* Excluded from this release type: __constructor */
|
|
732
|
-
/* Excluded from this release type: init */
|
|
733
|
-
private initFirstScene;
|
|
734
|
-
private initWebGpuRenderer;
|
|
735
597
|
/**
|
|
736
|
-
*
|
|
737
|
-
* @param
|
|
598
|
+
* Runs a callback on each animation frame, including frames skipped by Eco Mode.
|
|
599
|
+
* @param cb - Callback receiving the elapsed time in seconds.
|
|
738
600
|
*/
|
|
739
601
|
addOnFrameUpdate(cb: (deltaTime: number) => void): void;
|
|
740
602
|
/**
|
|
741
|
-
*
|
|
742
|
-
*
|
|
743
|
-
* @param params - Parameter object for the animation.
|
|
744
|
-
* @param params.camTarget - The target the camera should move toward.
|
|
745
|
-
* @param params.aimTarget - The target the camera should face during or after the animation.
|
|
746
|
-
* @param params.radiusOut - The outward curve radius used to shape the camera path. Default: **1**
|
|
747
|
-
* @param params.duration - The animation duration in seconds. Default: **2**
|
|
748
|
-
* @param params.ease - The easing function name for GSAP. Default: **'power1.inOut'**
|
|
749
|
-
*
|
|
750
|
-
* @remarks
|
|
751
|
-
* The method resolves `camTarget` and optionally `aimTarget` to world positions and animates the camera position along a curved trajectory instead of a straight line. If `aimTarget` is provided,
|
|
752
|
-
* the camera target position is interpolated towards the resolved aim position while the camera moves along the curve.
|
|
753
|
-
*
|
|
754
|
-
* **Events**
|
|
755
|
-
*
|
|
756
|
-
* {@link AnimEvent}
|
|
603
|
+
* Switches edge smoothing at runtime, loading the selected effect when needed. TRAA is available only with WebGPU.
|
|
604
|
+
* @param aaMode - Anti-aliasing mode, or `none` to disable smoothing.
|
|
757
605
|
*/
|
|
758
|
-
|
|
759
|
-
camTarget: THREE_TYPE.Vector3 | string | Obj3D;
|
|
760
|
-
aimTarget?: THREE_TYPE.Vector3 | string | Obj3D;
|
|
761
|
-
radiusOut?: number;
|
|
762
|
-
duration?: number;
|
|
763
|
-
ease?: string;
|
|
764
|
-
}): void;
|
|
606
|
+
enableAaMode(aaMode: AaMode): Promise<void>;
|
|
765
607
|
/**
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
* @param params - Parameter object for the animation.
|
|
770
|
-
* @param params.target - The target object or the name of the target object.
|
|
771
|
-
* @param params.duration - The animation duration in seconds. Default: **1**
|
|
772
|
-
* @param params.ease - The easing function name for GSAP. Default: **'power2.inOut'**
|
|
773
|
-
* @param params.dist - Framing factor applied to the calculated camera distance. Default: **1**
|
|
774
|
-
*
|
|
775
|
-
* @remarks
|
|
776
|
-
* Only the target object's own geometry is used to calculate the bounding size. Child objects are intentionally ignored.
|
|
777
|
-
*
|
|
778
|
-
* **Events**
|
|
779
|
-
*
|
|
780
|
-
* {@link AnimEvent}
|
|
608
|
+
* Switches screen-space lighting at runtime. WebGL supports SSAO; WebGPU supports GTAO and SSGI.
|
|
609
|
+
* SSGI requires TRAA, a perspective camera, and compatible WebGPU hardware.
|
|
610
|
+
* @param sslMode - Lighting mode, or `none` to disable it.
|
|
781
611
|
*/
|
|
782
|
-
|
|
783
|
-
target: string | Obj3D;
|
|
784
|
-
duration?: number;
|
|
785
|
-
ease?: string;
|
|
786
|
-
dist?: number;
|
|
787
|
-
}): void;
|
|
612
|
+
enableSslMode(sslMode: SslMode): Promise<void>;
|
|
788
613
|
/**
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
* @param params - Parameter object for the animation.
|
|
792
|
-
* @param params.mesh - The name of the mesh object whose material color should be animated.
|
|
793
|
-
* @param params.duration - The animation duration in seconds. Default: **0**
|
|
794
|
-
* @param params.ease - The easing function name for GSAP. Default: **'power1.inOut'**
|
|
795
|
-
*
|
|
796
|
-
* @remarks
|
|
797
|
-
* Additional properties of `params` can specify one or more material color fields to animate (e.g. `color`, `emissive`, ...), with their target color values. Values may be color strings, numbers,
|
|
798
|
-
* or `THREE.Color` instances.
|
|
799
|
-
*
|
|
800
|
-
* **Events**
|
|
801
|
-
*
|
|
802
|
-
* {@link AnimEvent}
|
|
614
|
+
* Enables or disables screen-space reflections, loading the effect when needed. Disabling WebGL SSR also hides its ground reflector.
|
|
615
|
+
* @param enable - Whether to show reflections.
|
|
803
616
|
*/
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
duration?: number;
|
|
807
|
-
ease?: string;
|
|
808
|
-
} & {
|
|
809
|
-
[key: string]: string | number | THREE_TYPE.Color;
|
|
810
|
-
}): void;
|
|
617
|
+
enableSsr(enable: boolean): Promise<void>;
|
|
618
|
+
private isPostCfg;
|
|
811
619
|
/**
|
|
812
|
-
*
|
|
813
|
-
*
|
|
814
|
-
* @param params - Parameter object for the animation.
|
|
815
|
-
* @param params.mesh - The name of the mesh object whose material property will be animated.
|
|
816
|
-
* @param params.startValue - The starting value of the property. Default: **Current material's value**
|
|
817
|
-
* @param params.infinite - If `true`, the animation loops infinitely. Default: **false**
|
|
818
|
-
* @param params.duration - The animation duration in seconds. Default: **0**
|
|
819
|
-
* @param params.ease - The easing function name for GSAP. Default: **'power1.inOut'**
|
|
820
|
-
* @param params.needsUpdate - Requests one material recompilation when the animation starts. Default: **false**
|
|
821
|
-
*
|
|
822
|
-
* @remarks
|
|
823
|
-
* Additional properties of `params` can specify one or more material numeric fields to animate (e.g. `metalness`, `roughness`, `opacity`, ...) with their target numeric values. Only the **first** provided
|
|
824
|
-
* property will be animated per call.
|
|
825
|
-
*
|
|
826
|
-
* **Events**
|
|
827
|
-
*
|
|
828
|
-
* {@link AnimFadeEvent}
|
|
620
|
+
* Stops a registered animation-frame callback.
|
|
621
|
+
* @param cb - Previously registered callback.
|
|
829
622
|
*/
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
[key: string]: any;
|
|
838
|
-
}): void;
|
|
839
|
-
private calcEaseArea;
|
|
623
|
+
removeOnFrameUpdate(cb: (deltaTime: number) => void): void;
|
|
624
|
+
private setGfxLevel;
|
|
625
|
+
private setPostWebGl;
|
|
626
|
+
private setPostWebGpu;
|
|
627
|
+
/** Toggles the browser fullscreen mode for the associated canvas element. */
|
|
628
|
+
toggleFullscreen(): void;
|
|
629
|
+
private update;
|
|
840
630
|
/**
|
|
841
|
-
*
|
|
842
|
-
* @param aaMode - The anti-aliasing mode to use.
|
|
631
|
+
* Resizes the renderer, camera projection, post-processing, and reflections to fit the canvas.
|
|
843
632
|
*/
|
|
844
|
-
|
|
633
|
+
updateCanvasResize(): void;
|
|
845
634
|
/**
|
|
846
|
-
*
|
|
847
|
-
* @param
|
|
635
|
+
* Runs an extension callback immediately with access to the public API.
|
|
636
|
+
* @param extension - Callback receiving this `Engine` instance.
|
|
848
637
|
*/
|
|
849
|
-
|
|
638
|
+
use(extension: (engine: Engine) => void): void;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Controls environment lighting, the visible background, and their rotation. The first map supplies lighting and background; later maps update only the background.
|
|
643
|
+
* @category Core
|
|
644
|
+
*/
|
|
645
|
+
export declare class EnvCtrls {
|
|
646
|
+
private readonly cfg;
|
|
647
|
+
private readonly engine;
|
|
648
|
+
private readonly events;
|
|
649
|
+
private readonly modules;
|
|
650
|
+
private readonly scene;
|
|
651
|
+
private envEnabled;
|
|
652
|
+
private envInit;
|
|
653
|
+
private envLoadId;
|
|
654
|
+
private envIntensity;
|
|
655
|
+
private bgdIntensity;
|
|
656
|
+
private bgdBlurriness;
|
|
657
|
+
private rotation;
|
|
658
|
+
private rotationSpeed;
|
|
659
|
+
private envType;
|
|
660
|
+
private envMaps;
|
|
661
|
+
private envText;
|
|
662
|
+
private bgdText;
|
|
663
|
+
private callback;
|
|
664
|
+
private frameWaiters;
|
|
665
|
+
private timeBgdRot;
|
|
666
|
+
private applyBgds;
|
|
667
|
+
private applyEnv;
|
|
668
|
+
private disposePrevBgd;
|
|
669
|
+
private disposeText;
|
|
850
670
|
/**
|
|
851
|
-
*
|
|
852
|
-
* @param
|
|
671
|
+
* Loads and applies environment lighting and background maps. Later maps replace only the background.
|
|
672
|
+
* @param params - Optional environment loading parameters. If provided, both `type` and `map` are required.
|
|
673
|
+
* @param params.type - Environment map file type. Defaults to `cfg.envCtrls.type`.
|
|
674
|
+
* @param params.map - Ordered environment map paths. Defaults to `cfg.envCtrls.map`.
|
|
853
675
|
*/
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
676
|
+
enable(params?: {
|
|
677
|
+
type: EnvCtrlsCfg["type"];
|
|
678
|
+
map: EnvCtrlsCfg["map"];
|
|
679
|
+
}): void;
|
|
680
|
+
/** Removes environment lighting and background maps, cancels pending updates, and stops rotation. */
|
|
681
|
+
disable(): void;
|
|
858
682
|
/**
|
|
859
|
-
*
|
|
860
|
-
*
|
|
861
|
-
* @param params - Parameters for controlling the animation playback.
|
|
862
|
-
* @param params.layer - The freely named layer used to group animation actions.
|
|
863
|
-
* @param params.clip - The name of the animation clip to play.
|
|
864
|
-
* @param params.blendMode - How the action is blended with other active actions. Default: **'normal'**
|
|
865
|
-
* @param params.finishMode - Whether the final pose is held or faded out after the final loop. Default: **'hold'**
|
|
866
|
-
* @param params.loopMode - Number of plays or `'infinite'` for endless looping. Default: **1**
|
|
867
|
-
* @param params.stopMode - Which previous actions of the same layer are stopped before playback. Default: **'all'**
|
|
868
|
-
* @param params.fadeDuration - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
|
|
869
|
-
* @param params.fadeDurationFinish - Duration in seconds for `finishMode: 'fadeOut'`. Default: **0**
|
|
870
|
-
* @param params.reverse - If `true`, plays the clip in reverse. Default: **false**
|
|
871
|
-
* @param params.reset - If `true`, resets the clip before a new playback. Default: **false**
|
|
872
|
-
* @param params.startSpeed - Initial playback speed for speed interpolation. Default: **0**
|
|
873
|
-
* @param params.endSpeed - Target playback speed. Default: **1**
|
|
874
|
-
* @param params.duration - Duration in seconds for speed interpolation. Default: **0**
|
|
875
|
-
* @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
|
|
876
|
-
*
|
|
877
|
-
* @remarks
|
|
878
|
-
* Calling a running or fading-in action again is ignored. A finished or stopped action starts again, while an unfinished fading-out action continues at its current time and fades back in from its current weight.
|
|
879
|
-
*
|
|
880
|
-
* `finishMode` and `fadeDurationFinish` have no effect when `loopMode` is `'infinite'`.
|
|
881
|
-
*
|
|
882
|
-
* **Events**
|
|
883
|
-
*
|
|
884
|
-
* {@link ClipEvent}
|
|
683
|
+
* Returns a snapshot of environment rotation, intensity, and background blurriness.
|
|
885
684
|
*/
|
|
886
|
-
|
|
887
|
-
layer: string;
|
|
888
|
-
clip: string;
|
|
889
|
-
singleAction?: boolean;
|
|
890
|
-
blendMode?: BlendMode;
|
|
891
|
-
finishMode?: FinishMode;
|
|
892
|
-
loopMode?: LoopMode;
|
|
893
|
-
stopMode?: StopMode;
|
|
894
|
-
fadeDuration?: number;
|
|
895
|
-
fadeDurationFinish?: number;
|
|
896
|
-
reverse?: boolean;
|
|
897
|
-
reset?: boolean;
|
|
898
|
-
startSpeed?: number;
|
|
899
|
-
endSpeed?: number;
|
|
900
|
-
duration?: number;
|
|
901
|
-
ease?: string;
|
|
902
|
-
}): void;
|
|
685
|
+
get(): Partial<EnvCtrlsCfg>;
|
|
903
686
|
/**
|
|
904
|
-
*
|
|
905
|
-
*
|
|
906
|
-
* @param params - Parameters for controlling the camera animation playback.
|
|
907
|
-
* @param params.layer - The freely named layer used to group camera animation actions.
|
|
908
|
-
* @param params.clip - The name of the camera animation clip to play.
|
|
909
|
-
* @param params.blendMode - How the action is blended with other active actions. Default: **'normal'**
|
|
910
|
-
* @param params.loopMode - Number of plays or `'infinite'` for endless looping. Default: **1**
|
|
911
|
-
* @param params.stopMode - Which previous actions of the same layer are stopped before playback. Default: **'all'**
|
|
912
|
-
* @param params.fadeDuration - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
|
|
913
|
-
* @param params.reverse - If `true`, plays the clip in reverse. Default: **false**
|
|
914
|
-
* @param params.reset - If `true`, resets the clip before a new playback. Default: **false**
|
|
915
|
-
* @param params.startSpeed - Initial playback speed for speed interpolation. Default: **0**
|
|
916
|
-
* @param params.endSpeed - Target playback speed. Default: **1**
|
|
917
|
-
* @param params.duration - Duration in seconds for speed interpolation. Default: **0**
|
|
918
|
-
* @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
|
|
919
|
-
*
|
|
920
|
-
* @remarks
|
|
921
|
-
* Calling a running or fading-in action again is ignored. A finished or stopped action starts again, while an unfinished fading-out action continues at its current time and fades back in from its current weight.
|
|
922
|
-
*
|
|
923
|
-
* **Events**
|
|
924
|
-
*
|
|
925
|
-
* {@link ClipEvent}
|
|
926
|
-
*/
|
|
927
|
-
playClipCam({ layer, clip: clipName, blendMode, loopMode, stopMode, fadeDuration, reverse, reset, startSpeed, endSpeed, duration, ease }: {
|
|
928
|
-
layer: string;
|
|
929
|
-
clip: string;
|
|
930
|
-
blendMode?: BlendMode;
|
|
931
|
-
loopMode?: LoopMode;
|
|
932
|
-
stopMode?: StopMode;
|
|
933
|
-
fadeDuration?: number;
|
|
934
|
-
reverse?: boolean;
|
|
935
|
-
reset?: boolean;
|
|
936
|
-
startSpeed?: number;
|
|
937
|
-
endSpeed?: number;
|
|
938
|
-
duration?: number;
|
|
939
|
-
ease?: string;
|
|
940
|
-
}): void;
|
|
941
|
-
/** The method removes the existing `THREE.AmbientLight` from the scene and releases its resources. If no ambient light exists, the method exits without performing any action. */
|
|
942
|
-
removeAmbientLight(): void;
|
|
943
|
-
/** The method removes the existing `THREE.Fog` from the scene. If no fog exists, the method exits without performing any action. */
|
|
944
|
-
removeFog(): void;
|
|
945
|
-
/** The method removes the existing `THREE.HemisphereLight` from the scene and releases its resources. If no hemisphere light exists, the method exits without performing any action. */
|
|
946
|
-
removeHemisphereLight(): void;
|
|
947
|
-
/**
|
|
948
|
-
* Removes a previously registered frame update callback.
|
|
949
|
-
* @param {(deltaTime: number) => void} cb - Callback to remove.
|
|
950
|
-
*/
|
|
951
|
-
removeOnFrameUpdate(cb: (deltaTime: number) => void): void;
|
|
952
|
-
/**
|
|
953
|
-
* The method creates or updates a Three.js `THREE.AmbientLight` instance in the scene.
|
|
954
|
-
*
|
|
955
|
-
* @param params - Parameter object for controlling the ambient light.
|
|
956
|
-
* @param params.color - The ambient light color. If omitted and the light already exists, the current color remains unchanged.
|
|
957
|
-
* @param params.intensity - The ambient light intensity. If omitted and the light already exists, the current intensity remains unchanged.
|
|
958
|
-
*
|
|
959
|
-
* @remarks
|
|
960
|
-
* The method does not apply any default values when creating the light. Creation is skipped unless both `color` and `intensity` are defined. When updating an existing light,
|
|
961
|
-
* the scene reflects changes automatically on the next render call.
|
|
962
|
-
*/
|
|
963
|
-
setAmbientLight({ color, intensity }: {
|
|
964
|
-
color?: THREE_TYPE.ColorRepresentation;
|
|
965
|
-
intensity?: number;
|
|
966
|
-
}): void;
|
|
967
|
-
private setAnimationLoop;
|
|
968
|
-
/**
|
|
969
|
-
* The method creates or updates a Three.js `THREE.Fog` instance in the scene.
|
|
970
|
-
*
|
|
971
|
-
* @param params - Parameter object for controlling the fog.
|
|
972
|
-
* @param params.color - The fog color. If omitted and the fog already exists, the current color remains unchanged.
|
|
973
|
-
* @param params.near - The near distance where fog starts. If omitted and the fog already exists, the current near value remains unchanged.
|
|
974
|
-
* @param params.far - The far distance where fog ends. If omitted and the fog already exists, the current far value remains unchanged.
|
|
975
|
-
*
|
|
976
|
-
* @remarks
|
|
977
|
-
* The method does not apply any default values when creating the fog. Creation is skipped unless `color`, `near` and `far` are defined. When updating an existing fog, the scene reflects changes automatically
|
|
978
|
-
* on the next render call.
|
|
979
|
-
*/
|
|
980
|
-
setFog({ color, near, far }: {
|
|
981
|
-
color?: THREE_TYPE.ColorRepresentation;
|
|
982
|
-
near?: number;
|
|
983
|
-
far?: number;
|
|
984
|
-
}): void;
|
|
985
|
-
/* Excluded from this release type: setFxaaResolution */
|
|
986
|
-
/**
|
|
987
|
-
* The method creates or updates a Three.js `THREE.HemisphereLight` instance in the scene.
|
|
988
|
-
*
|
|
989
|
-
* @param params - Parameter object for controlling the hemisphere light.
|
|
990
|
-
* @param params.skyColor - The sky light color. If omitted and the light already exists, the current sky color remains unchanged.
|
|
991
|
-
* @param params.groundColor - The ground light color. If omitted and the light already exists, the current ground color remains unchanged.
|
|
992
|
-
* @param params.intensity - The hemisphere light intensity. If omitted and the light already exists, the current intensity remains unchanged.
|
|
993
|
-
*
|
|
994
|
-
* @remarks
|
|
995
|
-
* The method does not apply any default values when creating the light. Creation is skipped unless `skyColor`, `groundColor` and `intensity` are defined. When updating an existing light, the scene
|
|
996
|
-
* reflects changes automatically on the next render call.
|
|
997
|
-
*/
|
|
998
|
-
setHemisphereLight({ skyColor, groundColor, intensity }: {
|
|
999
|
-
skyColor?: THREE_TYPE.ColorRepresentation;
|
|
1000
|
-
groundColor?: THREE_TYPE.ColorRepresentation;
|
|
1001
|
-
intensity?: number;
|
|
1002
|
-
}): void;
|
|
1003
|
-
/**
|
|
1004
|
-
* The method finds a Three.js mesh by name, validates that it has a material, and updates one or more of its material properties at runtime. It supports both numeric and color values as well as
|
|
1005
|
-
* texture paths (`map`, `emissiveMap`), which are automatically loaded via `THREE.TextureLoader`.
|
|
1006
|
-
*
|
|
1007
|
-
* @param params - Parameter object for setting material properties.
|
|
1008
|
-
* @param params.obj - The name of the mesh whose material properties should be modified.
|
|
1009
|
-
* @param params.needsUpdate - Requests material recompilation after applying the properties. Default: **false**
|
|
1010
|
-
*
|
|
1011
|
-
* @remarks
|
|
1012
|
-
* Additional properties of `params` can define one or more material fields to update (e.g. `color`, `roughness`, `metalness`, `map`, `emissiveMap`, ...), each with its target value. Texture paths provided
|
|
1013
|
-
* as strings are loaded asynchronously and assigned to the corresponding material slots. Unsupported or mismatched property types are ignored with a warning in debug mode.
|
|
1014
|
-
*/
|
|
1015
|
-
setMaterialProperties({ obj, needsUpdate, ...props }: {
|
|
1016
|
-
obj: string;
|
|
1017
|
-
needsUpdate?: boolean;
|
|
1018
|
-
[key: string]: any;
|
|
1019
|
-
}): void;
|
|
1020
|
-
/* Excluded from this release type: setPostWebGl */
|
|
1021
|
-
/* Excluded from this release type: setPostWebGpu */
|
|
1022
|
-
/**
|
|
1023
|
-
* The method finds a Three.js animation clip by name, validates that it exists within the loaded GLTF, and stops its playback via the `THREE.AnimationMixer`. It supports smooth fade-out transitions using
|
|
1024
|
-
* GSAP before stopping the clip completely.
|
|
1025
|
-
*
|
|
1026
|
-
* @param params - Parameter object for controlling the stop behavior.
|
|
1027
|
-
* @param params.clipName - The name of the animation clip to stop.
|
|
1028
|
-
* @param params.fadeOut - The fade-out duration in seconds before stopping the clip. Default: **0**
|
|
1029
|
-
* @param params.ease - The easing function name for the fade-out transition. Default: **'power1.inOut'**
|
|
1030
|
-
*
|
|
1031
|
-
* @remarks
|
|
1032
|
-
* The method gradually reduces the clip's playback speed to zero when `fadeOut` is greater than zero. It emits `Clip_Speed_Start`, `Clip_Speed_Complete`, and finally `Clip_Cancel`.
|
|
1033
|
-
* If no speed transition is specified, the clip is canceled immediately.
|
|
1034
|
-
*
|
|
1035
|
-
* **Events**
|
|
1036
|
-
*
|
|
1037
|
-
* {@link ClipEvent}
|
|
1038
|
-
*/
|
|
1039
|
-
stopAnimClip({ clipName, fadeOut, ease }: {
|
|
1040
|
-
clipName: string;
|
|
1041
|
-
fadeOut?: number;
|
|
1042
|
-
ease?: string;
|
|
1043
|
-
}): void;
|
|
1044
|
-
/** Toggles the browser fullscreen mode for the associated canvas element. */
|
|
1045
|
-
toggleFullscreen(): void;
|
|
1046
|
-
/**
|
|
1047
|
-
* Registers and executes a low-level extension function with access to the public `Engine` API.
|
|
1048
|
-
* @param extension - Function that receives the current `Engine` instance and can use its public members and methods.
|
|
1049
|
-
* @remarks This method is intended for advanced custom integrations where developers need direct access to the engine instance. The extension is executed once immediately when `use()` is called.
|
|
1050
|
-
*/
|
|
1051
|
-
use(extension: (engine: Engine) => void): void;
|
|
1052
|
-
private update;
|
|
1053
|
-
/** Updates the renderer, post-processing composer, and ground reflector to match the current canvas size. Ensures that the rendering resolution and reflection buffers remain consistent when the viewport changes. */
|
|
1054
|
-
updateCanvasResize(): void;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
/**
|
|
1058
|
-
* Controls `THREE.Scene.environment` and `THREE.Scene.background` textures, including environment lighting and optional rotation.
|
|
1059
|
-
* The first configured map is used for environment lighting and the initial background. Additional maps replace only the visible background after loading.
|
|
1060
|
-
* WebGL uses a PMREM-processed texture for environment lighting while keeping the loaded texture for the visible background.
|
|
1061
|
-
* @category Core
|
|
1062
|
-
*/
|
|
1063
|
-
export declare class EnvCtrls {
|
|
1064
|
-
private cfg;
|
|
1065
|
-
private engine;
|
|
1066
|
-
private modules;
|
|
1067
|
-
/* Excluded from this release type: envReady */
|
|
1068
|
-
/* Excluded from this release type: textReady */
|
|
1069
|
-
/* Excluded from this release type: bgdReady */
|
|
1070
|
-
private envEnabled;
|
|
1071
|
-
private envInit;
|
|
1072
|
-
private envLoadId;
|
|
1073
|
-
private envIntensity;
|
|
1074
|
-
private bgdIntensity;
|
|
1075
|
-
private bgdBlurriness;
|
|
1076
|
-
private rotation;
|
|
1077
|
-
private rotationSpeed;
|
|
1078
|
-
private envType;
|
|
1079
|
-
private envMaps;
|
|
1080
|
-
private envText;
|
|
1081
|
-
private bgdText;
|
|
1082
|
-
private callback;
|
|
1083
|
-
private frameWaiters;
|
|
1084
|
-
private timeBgdRot;
|
|
1085
|
-
/* Excluded from this release type: __constructor */
|
|
1086
|
-
/* Excluded from this release type: init */
|
|
1087
|
-
private applyBgds;
|
|
1088
|
-
private applyEnv;
|
|
1089
|
-
private disposePrevBgd;
|
|
1090
|
-
private disposeText;
|
|
1091
|
-
/**
|
|
1092
|
-
* Enables environment and background handling.
|
|
1093
|
-
* The first map is applied to `THREE.Scene.environment` and `THREE.Scene.background`; additional maps load in order and replace only `THREE.Scene.background`.
|
|
1094
|
-
* WebGL uses a PMREM-processed texture for `THREE.Scene.environment` and the loaded texture for `THREE.Scene.background`.
|
|
1095
|
-
* @param params - Optional environment loading parameters. If provided, both `type` and `map` are required.
|
|
1096
|
-
* @param params.type - Environment map file type. Defaults to `cfg.envCtrls.type`.
|
|
1097
|
-
* @param params.map - Ordered environment map paths. Defaults to `cfg.envCtrls.map`.
|
|
1098
|
-
*/
|
|
1099
|
-
enable(params?: {
|
|
1100
|
-
type: EnvCtrlsCfg["type"];
|
|
1101
|
-
map: EnvCtrlsCfg["map"];
|
|
1102
|
-
}): void;
|
|
1103
|
-
/** Disables the environment system and resets all values. */
|
|
1104
|
-
disable(): void;
|
|
1105
|
-
/**
|
|
1106
|
-
* Returns the current runtime environment control values.
|
|
1107
|
-
* @returns A snapshot of the mutable runtime settings.
|
|
1108
|
-
*/
|
|
1109
|
-
get(): Partial<EnvCtrlsCfg>;
|
|
1110
|
-
/**
|
|
1111
|
-
* Returns whether the environment system is currently enabled.
|
|
1112
|
-
* @returns `true` if `EnvCtrls` is currently enabled, otherwise `false`.
|
|
687
|
+
* Checks whether an environment or background map is applied.
|
|
688
|
+
* @returns `true` when at least one map is applied.
|
|
1113
689
|
*/
|
|
1114
690
|
isEnabled(): boolean;
|
|
1115
691
|
private loadText;
|
|
@@ -1127,7 +703,7 @@ export declare class EnvCtrls {
|
|
|
1127
703
|
}
|
|
1128
704
|
|
|
1129
705
|
/**
|
|
1130
|
-
*
|
|
706
|
+
* Controls environment lighting and the visible background.
|
|
1131
707
|
* @category Cfg
|
|
1132
708
|
*/
|
|
1133
709
|
export declare interface EnvCtrlsCfg {
|
|
@@ -1137,7 +713,7 @@ export declare interface EnvCtrlsCfg {
|
|
|
1137
713
|
*/
|
|
1138
714
|
backgroundBlurriness: number;
|
|
1139
715
|
/**
|
|
1140
|
-
*
|
|
716
|
+
* Scales background brightness.
|
|
1141
717
|
* @default 0
|
|
1142
718
|
*/
|
|
1143
719
|
backgroundIntensity: number;
|
|
@@ -1152,12 +728,12 @@ export declare interface EnvCtrlsCfg {
|
|
|
1152
728
|
*/
|
|
1153
729
|
enable: boolean;
|
|
1154
730
|
/**
|
|
1155
|
-
*
|
|
731
|
+
* Scales environment lighting intensity.
|
|
1156
732
|
* @default 1.8
|
|
1157
733
|
*/
|
|
1158
734
|
environmentIntensity: number;
|
|
1159
735
|
/**
|
|
1160
|
-
*
|
|
736
|
+
* Prepares environment map loading without enabling environment lighting.
|
|
1161
737
|
* @default false
|
|
1162
738
|
*/
|
|
1163
739
|
load: boolean;
|
|
@@ -1178,7 +754,7 @@ export declare interface EnvCtrlsCfg {
|
|
|
1178
754
|
z: number;
|
|
1179
755
|
};
|
|
1180
756
|
/**
|
|
1181
|
-
*
|
|
757
|
+
* Environment and background rotation speed in degrees per second.
|
|
1182
758
|
* @default 0
|
|
1183
759
|
*/
|
|
1184
760
|
rotationSpeed: number;
|
|
@@ -1189,24 +765,13 @@ export declare interface EnvCtrlsCfg {
|
|
|
1189
765
|
type: 'hdr' | 'exr' | 'texture';
|
|
1190
766
|
}
|
|
1191
767
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
type: TType;
|
|
1196
|
-
}>;
|
|
1197
|
-
|
|
1198
|
-
declare class EventDispatcher<TEvent extends {
|
|
1199
|
-
type: string;
|
|
1200
|
-
}> {
|
|
1201
|
-
private readonly listeners;
|
|
1202
|
-
addEventListener<TType extends EventType<TEvent>>(type: TType, listener: Listener<EventByType<TEvent, TType>>): Unsubscribe;
|
|
1203
|
-
removeEventListener<TType extends EventType<TEvent>>(type: TType, listener: Listener<EventByType<TEvent, TType>>): void;
|
|
1204
|
-
emit(event: TEvent): void;
|
|
1205
|
-
listenerCount<TType extends EventType<TEvent>>(type: TType): number;
|
|
768
|
+
/** @event Fired after the initial environment is applied and all progressive background loading attempts have completed. Failed background maps may have been skipped. Canceled or superseded loads do not fire this event. */
|
|
769
|
+
export declare interface EnvLoadedEvent {
|
|
770
|
+
type: 'Env_Loaded';
|
|
1206
771
|
}
|
|
1207
772
|
|
|
1208
773
|
/**
|
|
1209
|
-
*
|
|
774
|
+
* Sends application and engine events to the state machine.
|
|
1210
775
|
* @category Core
|
|
1211
776
|
*/
|
|
1212
777
|
export declare class Events {
|
|
@@ -1214,39 +779,24 @@ export declare class Events {
|
|
|
1214
779
|
private stateMachine;
|
|
1215
780
|
private eventQueue;
|
|
1216
781
|
private isProcessingEvents;
|
|
1217
|
-
/* Excluded from this release type: __constructor */
|
|
1218
|
-
/** A nested snapshot.can() is only evaluated after the current event callback has completed. */
|
|
1219
782
|
private enqueue;
|
|
1220
|
-
/* Excluded from this release type: anim */
|
|
1221
|
-
/* Excluded from this release type: animFade */
|
|
1222
|
-
/* Excluded from this release type: audioLoaded */
|
|
1223
|
-
/* Excluded from this release type: clip */
|
|
1224
|
-
/* Excluded from this release type: modelError */
|
|
1225
|
-
/* Excluded from this release type: modelLoaded */
|
|
1226
|
-
/* Excluded from this release type: modelLoading */
|
|
1227
|
-
/* Excluded from this release type: sceneRendered */
|
|
1228
783
|
/**
|
|
1229
784
|
* Sends an event to the state machine and optionally logs a debug message to the console.
|
|
1230
|
-
* @param event -
|
|
785
|
+
* @param event - Event to send to the state machine.
|
|
1231
786
|
* @param log - Information to log with the event.
|
|
1232
787
|
*/
|
|
1233
788
|
send(event: AnyEventObject, log?: string): void;
|
|
1234
|
-
/* Excluded from this release type: windowResize */
|
|
1235
789
|
}
|
|
1236
790
|
|
|
1237
|
-
declare type EventType<TEvent extends {
|
|
1238
|
-
type: string;
|
|
1239
|
-
}> = TEvent['type'];
|
|
1240
|
-
|
|
1241
791
|
/**
|
|
1242
|
-
*
|
|
1243
|
-
* - 'hold'
|
|
1244
|
-
* - 'fadeOut'
|
|
792
|
+
* Controls what happens after the final animation loop.
|
|
793
|
+
* - `'hold'`: Keeps the action enabled and holds its final pose.
|
|
794
|
+
* - `'fadeOut'`: Fades out over `fadeDurationFinish` seconds, or stops immediately when the duration is `0`.
|
|
1245
795
|
*/
|
|
1246
796
|
export declare type FinishMode = 'hold' | 'fadeOut';
|
|
1247
797
|
|
|
1248
798
|
/**
|
|
1249
|
-
*
|
|
799
|
+
* Blends distant objects into the fog color.
|
|
1250
800
|
* @category Cfg
|
|
1251
801
|
*/
|
|
1252
802
|
export declare interface FogCfg {
|
|
@@ -1273,7 +823,7 @@ export declare interface FogCfg {
|
|
|
1273
823
|
}
|
|
1274
824
|
|
|
1275
825
|
/**
|
|
1276
|
-
*
|
|
826
|
+
* Controls first-person camera movement and pointer look.
|
|
1277
827
|
* @category Core
|
|
1278
828
|
*/
|
|
1279
829
|
export declare class FpvCtrls {
|
|
@@ -1282,7 +832,6 @@ export declare class FpvCtrls {
|
|
|
1282
832
|
private readonly engine;
|
|
1283
833
|
private readonly events;
|
|
1284
834
|
private readonly modules;
|
|
1285
|
-
/* Excluded from this release type: pointerLockCtrls */
|
|
1286
835
|
private readonly params;
|
|
1287
836
|
private isMoveForward;
|
|
1288
837
|
private isMoveLeft;
|
|
@@ -1294,25 +843,37 @@ export declare class FpvCtrls {
|
|
|
1294
843
|
private readonly onClick;
|
|
1295
844
|
private readonly onKeyDown;
|
|
1296
845
|
private readonly onKeyUp;
|
|
1297
|
-
|
|
1298
|
-
|
|
846
|
+
/**
|
|
847
|
+
* Prepares pointer-look controls without enabling them.
|
|
848
|
+
*/
|
|
1299
849
|
create(): void;
|
|
1300
|
-
/**
|
|
850
|
+
/**
|
|
851
|
+
* Stops first-person movement and releases pointer lock.
|
|
852
|
+
*/
|
|
1301
853
|
disable(): void;
|
|
1302
|
-
/**
|
|
854
|
+
/**
|
|
855
|
+
* Enables first-person movement and pointer-look interaction.
|
|
856
|
+
*/
|
|
1303
857
|
enable(): void;
|
|
1304
|
-
/**
|
|
858
|
+
/**
|
|
859
|
+
* Releases pointer-look controls and their event listeners.
|
|
860
|
+
*/
|
|
1305
861
|
dispose(): void;
|
|
1306
862
|
/**
|
|
1307
|
-
* Returns the
|
|
1308
|
-
* @returns A snapshot of the mutable first-person control settings.
|
|
863
|
+
* Returns a snapshot of the current first-person control settings.
|
|
1309
864
|
*/
|
|
1310
865
|
get(): Partial<FpvCtrlsCfg>;
|
|
1311
|
-
/**
|
|
866
|
+
/**
|
|
867
|
+
* Checks whether first-person controls are enabled.
|
|
868
|
+
*/
|
|
1312
869
|
isEnabled(): boolean;
|
|
1313
|
-
/**
|
|
870
|
+
/**
|
|
871
|
+
* Checks whether pointer lock is active.
|
|
872
|
+
*/
|
|
1314
873
|
isLocked(): boolean;
|
|
1315
|
-
/**
|
|
874
|
+
/**
|
|
875
|
+
* Requests pointer lock to control the viewing direction.
|
|
876
|
+
*/
|
|
1316
877
|
lock(): void;
|
|
1317
878
|
/**
|
|
1318
879
|
* Moves the controlled camera forward.
|
|
@@ -1330,25 +891,25 @@ export declare class FpvCtrls {
|
|
|
1330
891
|
*/
|
|
1331
892
|
moveUp(distance: number): void;
|
|
1332
893
|
/**
|
|
1333
|
-
* Updates
|
|
1334
|
-
* @param params -
|
|
894
|
+
* Updates first-person movement and pointer-look settings. Controls must already be created.
|
|
895
|
+
* @param params - Settings to change; omitted values remain unchanged.
|
|
1335
896
|
*/
|
|
1336
897
|
set(params: Partial<FpvCtrlsCfg>): void;
|
|
1337
|
-
/**
|
|
898
|
+
/**
|
|
899
|
+
* Releases pointer lock and stops pointer-look interaction.
|
|
900
|
+
*/
|
|
1338
901
|
unlock(): void;
|
|
1339
902
|
/**
|
|
1340
|
-
*
|
|
903
|
+
* Runs an extension callback immediately with access to the public API.
|
|
1341
904
|
*
|
|
1342
|
-
* @param extension -
|
|
905
|
+
* @param extension - Callback receiving this `FpvCtrls` instance.
|
|
1343
906
|
*
|
|
1344
|
-
* @remarks
|
|
1345
|
-
* This method is intended for advanced custom integrations where developers need direct access to the FpvCtrls instance. The extension is executed once immediately when `use()` is called.
|
|
1346
907
|
*/
|
|
1347
908
|
use(extension: (fpvctrls: FpvCtrls) => void): void;
|
|
1348
909
|
}
|
|
1349
910
|
|
|
1350
911
|
/**
|
|
1351
|
-
*
|
|
912
|
+
* Controls first-person camera movement and pointer look.
|
|
1352
913
|
* @category Cfg
|
|
1353
914
|
*/
|
|
1354
915
|
export declare interface FpvCtrlsCfg {
|
|
@@ -1358,7 +919,7 @@ export declare interface FpvCtrlsCfg {
|
|
|
1358
919
|
*/
|
|
1359
920
|
enable: boolean;
|
|
1360
921
|
/**
|
|
1361
|
-
*
|
|
922
|
+
* Prepares first-person controls without enabling them.
|
|
1362
923
|
* @default false
|
|
1363
924
|
*/
|
|
1364
925
|
load: boolean;
|
|
@@ -1409,14 +970,13 @@ export declare interface FpvCtrlsCfg {
|
|
|
1409
970
|
keyMoveDown: string;
|
|
1410
971
|
}
|
|
1411
972
|
|
|
1412
|
-
/** @event Fired when
|
|
973
|
+
/** @event Fired when first-person controls are enabled, disabled, disposed, locked, or unlocked. */
|
|
1413
974
|
export declare interface FpvCtrlsEvent {
|
|
1414
|
-
/** Identifies this event type. */
|
|
1415
975
|
type: 'FpvCtrls_Disabled' | 'FpvCtrls_Disposed' | 'FpvCtrls_Enabled' | 'FpvCtrls_Lock' | 'FpvCtrls_Unlock';
|
|
1416
976
|
}
|
|
1417
977
|
|
|
1418
978
|
/**
|
|
1419
|
-
*
|
|
979
|
+
* Controls edge smoothing with FXAA.
|
|
1420
980
|
* @category Cfg
|
|
1421
981
|
*/
|
|
1422
982
|
export declare interface FxaaCfg {
|
|
@@ -1427,29 +987,59 @@ export declare interface FxaaCfg {
|
|
|
1427
987
|
sharpness: number;
|
|
1428
988
|
}
|
|
1429
989
|
|
|
1430
|
-
|
|
990
|
+
/**
|
|
991
|
+
* Controls contact shading with GTAO.
|
|
992
|
+
* @category Cfg
|
|
993
|
+
*/
|
|
994
|
+
export declare interface GtaoCfg {
|
|
995
|
+
/**
|
|
996
|
+
* Ambient occlusion radius in world units.
|
|
997
|
+
* @default 0.25
|
|
998
|
+
*/
|
|
999
|
+
radius: number;
|
|
1000
|
+
/**
|
|
1001
|
+
* Assumed surface thickness for ambient occlusion.
|
|
1002
|
+
* @default 1
|
|
1003
|
+
*/
|
|
1004
|
+
thickness: number;
|
|
1005
|
+
/**
|
|
1006
|
+
* Scales the strength of the ambient occlusion.
|
|
1007
|
+
* @default 1
|
|
1008
|
+
*/
|
|
1009
|
+
scale: number;
|
|
1010
|
+
/**
|
|
1011
|
+
* Sample count for ambient occlusion; higher values increase GPU work.
|
|
1012
|
+
* @default 16
|
|
1013
|
+
*/
|
|
1014
|
+
samples: number;
|
|
1015
|
+
/**
|
|
1016
|
+
* Resolution scale for ambient occlusion.
|
|
1017
|
+
* @default 1
|
|
1018
|
+
*/
|
|
1019
|
+
resolutionScale: number;
|
|
1020
|
+
}
|
|
1431
1021
|
|
|
1432
1022
|
/**
|
|
1433
|
-
*
|
|
1023
|
+
* Controls runtime statistics, the Inspector, and the Menu Bar.
|
|
1434
1024
|
* @category Cfg
|
|
1435
1025
|
*/
|
|
1436
1026
|
export declare interface GuiCfg {
|
|
1437
|
-
/**
|
|
1027
|
+
/** Runtime statistics and renderer information. */
|
|
1438
1028
|
infoBox: InfoBoxCfg;
|
|
1439
|
-
/**
|
|
1029
|
+
/** Runtime Inspector settings. */
|
|
1440
1030
|
inspector: {
|
|
1441
1031
|
/**
|
|
1442
|
-
*
|
|
1032
|
+
* Enables the Inspector for tuning runtime settings.
|
|
1443
1033
|
* @default false
|
|
1444
1034
|
*/
|
|
1445
1035
|
enable: boolean;
|
|
1446
1036
|
};
|
|
1447
|
-
/**
|
|
1037
|
+
/** Menu Bar settings. */
|
|
1448
1038
|
menuBar: MenuBarCfg;
|
|
1449
1039
|
}
|
|
1450
1040
|
|
|
1451
1041
|
/**
|
|
1452
|
-
*
|
|
1042
|
+
* Controls ambient lighting from the sky and ground.
|
|
1453
1043
|
* @category Cfg
|
|
1454
1044
|
*/
|
|
1455
1045
|
export declare interface HemisphereCfg {
|
|
@@ -1476,12 +1066,12 @@ export declare interface HemisphereCfg {
|
|
|
1476
1066
|
}
|
|
1477
1067
|
|
|
1478
1068
|
/**
|
|
1479
|
-
*
|
|
1069
|
+
* Selects runtime statistics shown in the Info Bar.
|
|
1480
1070
|
* @category Cfg
|
|
1481
1071
|
*/
|
|
1482
1072
|
export declare interface InfoBoxCfg {
|
|
1483
1073
|
/**
|
|
1484
|
-
*
|
|
1074
|
+
* Displays the Info Bar and collects runtime statistics.
|
|
1485
1075
|
* @default false
|
|
1486
1076
|
*/
|
|
1487
1077
|
enable: boolean;
|
|
@@ -1501,76 +1091,72 @@ export declare interface InfoBoxCfg {
|
|
|
1501
1091
|
*/
|
|
1502
1092
|
frame: boolean;
|
|
1503
1093
|
/**
|
|
1504
|
-
* Shows
|
|
1094
|
+
* Shows the number of draw calls.
|
|
1505
1095
|
* @default true
|
|
1506
1096
|
*/
|
|
1507
1097
|
calls: boolean;
|
|
1508
1098
|
/**
|
|
1509
|
-
* Shows
|
|
1099
|
+
* Shows the number of rendered triangles.
|
|
1510
1100
|
* @default true
|
|
1511
1101
|
*/
|
|
1512
1102
|
triangles: boolean;
|
|
1513
1103
|
/**
|
|
1514
|
-
* Shows
|
|
1104
|
+
* Shows the number of rendered lines.
|
|
1515
1105
|
* @default true
|
|
1516
1106
|
*/
|
|
1517
1107
|
lines: boolean;
|
|
1518
1108
|
/**
|
|
1519
|
-
* Shows
|
|
1109
|
+
* Shows the number of rendered points.
|
|
1520
1110
|
* @default true
|
|
1521
1111
|
*/
|
|
1522
1112
|
points: boolean;
|
|
1523
1113
|
/**
|
|
1524
|
-
* Shows
|
|
1114
|
+
* Shows the number of allocated geometries.
|
|
1525
1115
|
* @default true
|
|
1526
1116
|
*/
|
|
1527
1117
|
geometries: boolean;
|
|
1528
1118
|
/**
|
|
1529
|
-
* Shows
|
|
1119
|
+
* Shows the number of allocated textures.
|
|
1530
1120
|
* @default true
|
|
1531
1121
|
*/
|
|
1532
1122
|
textures: boolean;
|
|
1533
1123
|
/**
|
|
1534
|
-
* Shows the number of compiled WebGL
|
|
1124
|
+
* Shows the number of compiled WebGL shader programs.
|
|
1535
1125
|
* @default true
|
|
1536
1126
|
*/
|
|
1537
1127
|
programs: boolean;
|
|
1538
1128
|
/**
|
|
1539
|
-
*
|
|
1129
|
+
* Number of display updates per second.
|
|
1540
1130
|
* @default 10
|
|
1541
1131
|
*/
|
|
1542
1132
|
logsPerSecond: number;
|
|
1543
1133
|
}
|
|
1544
1134
|
|
|
1545
|
-
/* Excluded from this release type: Lib */
|
|
1546
|
-
|
|
1547
1135
|
/**
|
|
1548
|
-
*
|
|
1549
|
-
* @category
|
|
1136
|
+
* Connects a light to the scene component lifecycle.
|
|
1137
|
+
* @category Scene Components
|
|
1550
1138
|
*/
|
|
1551
1139
|
export declare class Light3D extends Obj3D {
|
|
1552
1140
|
/**
|
|
1553
|
-
*
|
|
1141
|
+
* Light used by this component. Replace it to use another light type.
|
|
1554
1142
|
* @default `THREE.PointLight`
|
|
1555
1143
|
* @public
|
|
1556
1144
|
*/
|
|
1557
1145
|
obj: THREE_TYPE.Light;
|
|
1558
|
-
/* Excluded from this release type: __constructor */
|
|
1559
1146
|
/**
|
|
1560
|
-
* Called
|
|
1147
|
+
* Called when a matching GLTF light is found. Adopts the light for this component.
|
|
1561
1148
|
*
|
|
1562
1149
|
* @param objGltf - The currently traversed `THREE.Light`.
|
|
1563
1150
|
* @public
|
|
1564
1151
|
*
|
|
1565
1152
|
* **Example**
|
|
1566
|
-
* {@includeCode
|
|
1153
|
+
* {@includeCode ../../../../apps-doc/examples/light3d-spot.ts}
|
|
1567
1154
|
*/
|
|
1568
1155
|
protected onTraverse(objGltf: THREE_TYPE.Light): void;
|
|
1569
|
-
/* Excluded from this release type: traverse */
|
|
1570
1156
|
}
|
|
1571
1157
|
|
|
1572
1158
|
/**
|
|
1573
|
-
*
|
|
1159
|
+
* Controls light shadows and area-light support.
|
|
1574
1160
|
* @category Cfg
|
|
1575
1161
|
*/
|
|
1576
1162
|
export declare interface LightCfg {
|
|
@@ -1580,7 +1166,7 @@ export declare interface LightCfg {
|
|
|
1580
1166
|
*/
|
|
1581
1167
|
castShadow: boolean;
|
|
1582
1168
|
/**
|
|
1583
|
-
*
|
|
1169
|
+
* Enables rectangular area-light support.
|
|
1584
1170
|
* @default false
|
|
1585
1171
|
*/
|
|
1586
1172
|
rectArea: boolean;
|
|
@@ -1616,17 +1202,15 @@ export declare interface LightCfg {
|
|
|
1616
1202
|
far: number;
|
|
1617
1203
|
}
|
|
1618
1204
|
|
|
1619
|
-
declare type Listener<TEvent> = (event: TEvent) => void;
|
|
1620
|
-
|
|
1621
1205
|
/**
|
|
1622
|
-
*
|
|
1623
|
-
* - number: Plays the action the specified positive number of times.
|
|
1624
|
-
* - 'infinite'
|
|
1206
|
+
* Controls how often an animation plays.
|
|
1207
|
+
* - A positive number: Plays the action the specified positive number of times.
|
|
1208
|
+
* - `'infinite'`: Repeats the action indefinitely.
|
|
1625
1209
|
*/
|
|
1626
1210
|
export declare type LoopMode = number | 'infinite';
|
|
1627
1211
|
|
|
1628
1212
|
/**
|
|
1629
|
-
*
|
|
1213
|
+
* Controls the Menu Bar appearance and availability.
|
|
1630
1214
|
* @category Cfg
|
|
1631
1215
|
*/
|
|
1632
1216
|
export declare interface MenuBarCfg {
|
|
@@ -1648,22 +1232,20 @@ export declare interface MenuBarCfg {
|
|
|
1648
1232
|
}
|
|
1649
1233
|
|
|
1650
1234
|
/**
|
|
1651
|
-
*
|
|
1652
|
-
* @category
|
|
1235
|
+
* Controls a mesh, its materials, and optional screen-space reflections.
|
|
1236
|
+
* @category Scene Components
|
|
1653
1237
|
*/
|
|
1654
1238
|
export declare class Mesh3D extends Obj3D {
|
|
1655
1239
|
/**
|
|
1656
|
-
*
|
|
1240
|
+
* Mesh rendered by this component. Replace it to use custom geometry or materials.
|
|
1657
1241
|
* @default `THREE.BoxGeometry`, `THREE.MeshPhysicalMaterial`
|
|
1658
1242
|
*/
|
|
1659
1243
|
obj: THREE_TYPE.Mesh;
|
|
1660
1244
|
/** `ReflectorForSSRPass` surface used for screen-space reflections (SSR). When set, it renders dynamic reflections on a ground plane. */
|
|
1661
1245
|
groundReflector: ReflectorForSSRPass | null;
|
|
1662
|
-
/** Objects
|
|
1246
|
+
/** Objects selected for WebGL screen-space reflections. */
|
|
1663
1247
|
reflectivesSSR: THREE_TYPE.Object3D[];
|
|
1664
1248
|
private model;
|
|
1665
|
-
/* Excluded from this release type: lib */
|
|
1666
|
-
/* Excluded from this release type: __constructor */
|
|
1667
1249
|
/**
|
|
1668
1250
|
* Animates one or more color properties of this mesh's material.
|
|
1669
1251
|
* @param params - Animation parameters and target material color properties such as `color` or `emissive`.
|
|
@@ -1701,12 +1283,12 @@ export declare class Mesh3D extends Obj3D {
|
|
|
1701
1283
|
*/
|
|
1702
1284
|
protected getImageTexture(name: string): THREE_TYPE.Texture;
|
|
1703
1285
|
/**
|
|
1704
|
-
* Called
|
|
1286
|
+
* Called when a matching GLTF mesh is found. Adopts the mesh for this component.
|
|
1705
1287
|
* @param objGltf - The currently traversed mesh.
|
|
1706
1288
|
* @public
|
|
1707
1289
|
*
|
|
1708
1290
|
* **Example**
|
|
1709
|
-
* {@includeCode
|
|
1291
|
+
* {@includeCode ../../../../apps-doc/examples/mesh3d-cube.ts}
|
|
1710
1292
|
*/
|
|
1711
1293
|
protected onTraverse(objGltf: THREE_TYPE.Mesh): void;
|
|
1712
1294
|
/**
|
|
@@ -1716,21 +1298,20 @@ export declare class Mesh3D extends Obj3D {
|
|
|
1716
1298
|
*/
|
|
1717
1299
|
protected requestImageTexture(name: string): void;
|
|
1718
1300
|
/**
|
|
1719
|
-
* Updates one or more material
|
|
1301
|
+
* Updates one or more properties across all material slots of this mesh. Shared materials are modified in place.
|
|
1720
1302
|
* @param properties - Material properties to update. Texture paths are supported for `map` and `emissiveMap`.
|
|
1303
|
+
* @param properties.recursive - Includes all descendant meshes when true. Default: **false**
|
|
1721
1304
|
* @param properties.needsUpdate - Requests material recompilation after applying the properties. Default: **false**
|
|
1722
1305
|
*/
|
|
1723
|
-
|
|
1306
|
+
setMaterialProps({ recursive, needsUpdate, ...properties }: {
|
|
1307
|
+
recursive?: boolean;
|
|
1724
1308
|
needsUpdate?: boolean;
|
|
1725
1309
|
[key: string]: any;
|
|
1726
1310
|
}): void;
|
|
1727
|
-
/* Excluded from this release type: setModel */
|
|
1728
|
-
/* Excluded from this release type: setReflectivesSSR */
|
|
1729
|
-
/* Excluded from this release type: traverse */
|
|
1730
1311
|
}
|
|
1731
1312
|
|
|
1732
1313
|
/**
|
|
1733
|
-
*
|
|
1314
|
+
* Controls shadows and visibility culling for imported meshes.
|
|
1734
1315
|
* @category Cfg
|
|
1735
1316
|
*/
|
|
1736
1317
|
export declare interface MeshCfg {
|
|
@@ -1751,45 +1332,8 @@ export declare interface MeshCfg {
|
|
|
1751
1332
|
frustumCulled: boolean;
|
|
1752
1333
|
}
|
|
1753
1334
|
|
|
1754
|
-
declare class Model {
|
|
1755
|
-
private readonly canvas;
|
|
1756
|
-
private readonly cfg;
|
|
1757
|
-
private readonly events;
|
|
1758
|
-
private readonly modules;
|
|
1759
|
-
private readonly renderer;
|
|
1760
|
-
private readonly initFirstScene;
|
|
1761
|
-
private readonly reportModelReady;
|
|
1762
|
-
private readonly rendererReady;
|
|
1763
|
-
private readonly waitForRender;
|
|
1764
|
-
/* Excluded from this release type: sceneReady */
|
|
1765
|
-
private resolveSceneReady;
|
|
1766
|
-
private rejectSceneReady;
|
|
1767
|
-
private meshes;
|
|
1768
|
-
private scene;
|
|
1769
|
-
private readonly imageNamesUnused;
|
|
1770
|
-
private readonly imageTexturesUnused;
|
|
1771
|
-
private readonly textures;
|
|
1772
|
-
constructor({ canvas, cfg, events, modules, renderer, rendererReady, initFirstScene, reportModelReady, waitForRender }: ModelParams);
|
|
1773
|
-
/* Excluded from this release type: addImageUnusedName */
|
|
1774
|
-
private addMaterialsFromMesh;
|
|
1775
|
-
private addTexturesFromMaterial;
|
|
1776
|
-
private addTexture;
|
|
1777
|
-
private disposeGeometries;
|
|
1778
|
-
private disposeMaterialsAndTextures;
|
|
1779
|
-
/* Excluded from this release type: getTextureFromImageUnused */
|
|
1780
|
-
private initTextureFromImageUnused;
|
|
1781
|
-
private initTexturesFromImagesUnused;
|
|
1782
|
-
private initTexturesGltf;
|
|
1783
|
-
/* Excluded from this release type: load */
|
|
1784
|
-
private loadGltf;
|
|
1785
|
-
private prepareTextureImages;
|
|
1786
|
-
private reportError;
|
|
1787
|
-
private updateGeometries;
|
|
1788
|
-
private updateTextureImages;
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
1335
|
/**
|
|
1792
|
-
*
|
|
1336
|
+
* Controls progressive GLTF/GLB loading and compression support.
|
|
1793
1337
|
* @category Cfg
|
|
1794
1338
|
*/
|
|
1795
1339
|
export declare interface ModelCfg {
|
|
@@ -1806,7 +1350,7 @@ export declare interface ModelCfg {
|
|
|
1806
1350
|
texture: 'none' | 'webp' | 'ktx2';
|
|
1807
1351
|
};
|
|
1808
1352
|
/**
|
|
1809
|
-
*
|
|
1353
|
+
* GLTF/GLB paths ordered from low to high quality. The first file initializes the scene; later files replace matching geometry and textured materials.
|
|
1810
1354
|
* @default []
|
|
1811
1355
|
*/
|
|
1812
1356
|
file: string[];
|
|
@@ -1822,9 +1366,8 @@ export declare interface ModelCfg {
|
|
|
1822
1366
|
progressBar: boolean;
|
|
1823
1367
|
}
|
|
1824
1368
|
|
|
1825
|
-
/** @event Fired when
|
|
1369
|
+
/** @event Fired when model loading fails. */
|
|
1826
1370
|
export declare interface ModelErrorEvent {
|
|
1827
|
-
/** Identifies this event type. */
|
|
1828
1371
|
type: 'Model_Error';
|
|
1829
1372
|
/** The caught error object. */
|
|
1830
1373
|
error: Error;
|
|
@@ -1836,7 +1379,7 @@ export declare interface ModelLoadedEvent {
|
|
|
1836
1379
|
type: 'Model_Loaded' | `Model${number}_Loaded`;
|
|
1837
1380
|
}
|
|
1838
1381
|
|
|
1839
|
-
/** @event Fired
|
|
1382
|
+
/** @event Fired as model loading progresses. */
|
|
1840
1383
|
export declare interface ModelLoadingEvent {
|
|
1841
1384
|
/** Identifies the loading model. */
|
|
1842
1385
|
type: 'Model_Loading' | `Model${number}_Loading`;
|
|
@@ -1844,124 +1387,43 @@ export declare interface ModelLoadingEvent {
|
|
|
1844
1387
|
loading: number;
|
|
1845
1388
|
}
|
|
1846
1389
|
|
|
1847
|
-
|
|
1848
|
-
canvas: HTMLElement;
|
|
1849
|
-
cfg: Cfg;
|
|
1850
|
-
events: Events;
|
|
1851
|
-
modules: Modules;
|
|
1852
|
-
renderer: Renderer_2;
|
|
1853
|
-
rendererReady: Promise<void> | null;
|
|
1854
|
-
initFirstScene: (gltf: GLTF) => Map<string, THREE_TYPE.Mesh>;
|
|
1855
|
-
reportModelReady: () => void;
|
|
1856
|
-
waitForRender: () => Promise<void>;
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
/** @event Fired after the final progressive model variant has been applied and rendered and triggers the corresponding XState event. */
|
|
1390
|
+
/** @event Fired after the final progressive model has been applied and rendered. */
|
|
1860
1391
|
export declare interface ModelReadyEvent {
|
|
1861
|
-
/** Identifies this event type. */
|
|
1862
1392
|
type: 'Model_Ready';
|
|
1863
1393
|
}
|
|
1864
1394
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
gtaoNodeClass: typeof ao | null;
|
|
1874
|
-
ssrNode: typeof ssr | null;
|
|
1875
|
-
ssrPassClass: typeof SSRPass | null;
|
|
1876
|
-
paneClass: typeof Pane | null;
|
|
1877
|
-
createBrowserInspector: typeof createBrowserInspector | null;
|
|
1878
|
-
effectComposerClass: typeof EffectComposer | null;
|
|
1879
|
-
envLoader: EXRLoader | HDRLoader | null;
|
|
1880
|
-
dracoLoader: DRACOLoader | null;
|
|
1881
|
-
gltfLoader: GLTFLoader | null;
|
|
1882
|
-
ktx2Loader: KTX2Loader | null;
|
|
1883
|
-
meshoptDecoder: typeof MeshoptDecoder | null;
|
|
1884
|
-
outputPassClass: typeof OutputPass | null;
|
|
1885
|
-
renderPassClass: typeof RenderPass | null;
|
|
1886
|
-
shaderPassClass: typeof ShaderPass | null;
|
|
1887
|
-
rectAreaLightNodeClass: typeof THREE_WEBGPU_TYPE.RectAreaLightNode | null;
|
|
1888
|
-
rectAreaLightTexturesLib: typeof RectAreaLightTexturesLib | null;
|
|
1889
|
-
rectAreaLightUniformsLib: typeof RectAreaLightUniformsLib | null;
|
|
1890
|
-
orbitControlsClass: typeof OrbitControls | null;
|
|
1891
|
-
pointerLockControlsClass: typeof PointerLockControls | null;
|
|
1892
|
-
webGpuRendererClass: typeof THREE_WEBGPU_TYPE.WebGPURenderer | null;
|
|
1893
|
-
renderPipelineClass: typeof THREE_WEBGPU_TYPE.RenderPipeline | null;
|
|
1894
|
-
tslPass: typeof THREE_WEBTSL_TYPE.pass | null;
|
|
1895
|
-
tslMrt: typeof THREE_WEBTSL_TYPE.mrt | null;
|
|
1896
|
-
tslOutput: typeof THREE_WEBTSL_TYPE.output | null;
|
|
1897
|
-
tslVelocity: typeof THREE_WEBTSL_TYPE.velocity | null;
|
|
1898
|
-
tslRenderOutput: typeof THREE_WEBTSL_TYPE.renderOutput | null;
|
|
1899
|
-
tslNormalView: typeof THREE_WEBTSL_TYPE.normalView | null;
|
|
1900
|
-
tslMetalness: typeof THREE_WEBTSL_TYPE.metalness | null;
|
|
1901
|
-
tslRoughness: typeof THREE_WEBTSL_TYPE.roughness | null;
|
|
1902
|
-
tslSample: typeof THREE_WEBTSL_TYPE.sample | null;
|
|
1903
|
-
tslVec2: typeof THREE_WEBTSL_TYPE.vec2 | null;
|
|
1904
|
-
tslVec3: typeof THREE_WEBTSL_TYPE.vec3 | null;
|
|
1905
|
-
tslVec4: typeof THREE_WEBTSL_TYPE.vec4 | null;
|
|
1906
|
-
tslFloat: typeof THREE_WEBTSL_TYPE.float | null;
|
|
1907
|
-
packNormalToRGB: typeof THREE_WEBTSL_TYPE.packNormalToRGB | null;
|
|
1908
|
-
unpackRGBToNormal: typeof THREE_WEBTSL_TYPE.unpackRGBToNormal | null;
|
|
1909
|
-
private cfg;
|
|
1910
|
-
constructor(cfg: Cfg);
|
|
1911
|
-
private consoleLog;
|
|
1912
|
-
importDracoLoader(): Promise<void>;
|
|
1913
|
-
importEffectComposer(): Promise<void>;
|
|
1914
|
-
importENVLoader(): Promise<void>;
|
|
1915
|
-
importFpvCtrls(): Promise<void>;
|
|
1916
|
-
importFXAANode(aaMode: Cfg['post']['aa']['mode']): Promise<void>;
|
|
1917
|
-
importFXAAShader(aaMode: Cfg['post']['aa']['mode']): Promise<void>;
|
|
1918
|
-
importGLTFLoader(): Promise<void>;
|
|
1919
|
-
importGpuDetect(): Promise<void>;
|
|
1920
|
-
importGtaoNode(enable: boolean): Promise<void>;
|
|
1921
|
-
importKTX2Loader(): Promise<void>;
|
|
1922
|
-
importMeshoptDecoder(): Promise<void>;
|
|
1923
|
-
importOrbitCtrls(): Promise<void>;
|
|
1924
|
-
importOutputPass(): Promise<void>;
|
|
1925
|
-
importRectAreaLight(webGpu: boolean): Promise<void>;
|
|
1926
|
-
importRenderPass(): Promise<void>;
|
|
1927
|
-
importSMAANode(aaMode: Cfg['post']['aa']['mode']): Promise<void>;
|
|
1928
|
-
importSMAAPass(aaMode: Cfg['post']['aa']['mode']): Promise<void>;
|
|
1929
|
-
importSSAOPass(enable: boolean): Promise<void>;
|
|
1930
|
-
importSsrNode(enable: boolean): Promise<void>;
|
|
1931
|
-
importSsrPass(enable: boolean): Promise<void>;
|
|
1932
|
-
importStatelyAi(): Promise<void>;
|
|
1933
|
-
importThreeTsl(): Promise<void>;
|
|
1934
|
-
importThreeWebGpu(): Promise<void>;
|
|
1935
|
-
importTRAANode(aaMode: Cfg['post']['aa']['mode']): Promise<void>;
|
|
1936
|
-
importTweakpane(): Promise<void>;
|
|
1937
|
-
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Controls where multisample anti-aliasing smooths edges.
|
|
1397
|
+
*
|
|
1398
|
+
* - `'none'`: Disables MSAA.
|
|
1399
|
+
* - `'render'`: Applies MSAA only while rendering the scene.
|
|
1400
|
+
* - `'post'`: Also applies MSAA to supported post-processing scene targets.
|
|
1401
|
+
*/
|
|
1402
|
+
export declare type MsaaMode = 'none' | 'render' | 'post';
|
|
1938
1403
|
|
|
1939
1404
|
/**
|
|
1940
1405
|
* Wraps a `THREE.Object3D` and provides lifecycle hooks, scene integration, animation support, and position-, rotation- and visibility-change events. Extend this class to implement custom object behavior.
|
|
1941
|
-
* @category
|
|
1406
|
+
* @category Scene Components
|
|
1942
1407
|
*/
|
|
1943
1408
|
export declare class Obj3D {
|
|
1944
1409
|
/** @public */
|
|
1945
1410
|
protected canvas: HTMLElement;
|
|
1946
1411
|
protected cfg: Cfg;
|
|
1947
|
-
/* Excluded from this release type: events */
|
|
1948
1412
|
protected name: string;
|
|
1949
1413
|
/** The managed `THREE.Object3D` instance for this object. It is `null` until a scene object is assigned. */
|
|
1950
1414
|
obj: THREE_TYPE.Object3D | null;
|
|
1951
|
-
/**
|
|
1415
|
+
/** Contains all Scene Components registered through `comps.scene`, keyed by registration name. */
|
|
1952
1416
|
protected objs3D: Map<string, Obj3D> | null;
|
|
1953
|
-
/* Excluded from this release type: raycast */
|
|
1954
1417
|
/**
|
|
1955
|
-
*
|
|
1418
|
+
* Active renderer for custom rendering integrations.
|
|
1956
1419
|
* @public
|
|
1957
1420
|
*/
|
|
1958
1421
|
protected renderer: Readonly<THREE_TYPE.WebGLRenderer> | Readonly<THREE_WEBGPU_TYPE.WebGPURenderer>;
|
|
1959
1422
|
/**
|
|
1960
|
-
* The
|
|
1423
|
+
* The Illutions scene this component belongs to. Use `scene.obj` for direct Three.js scene access.
|
|
1961
1424
|
* @public
|
|
1962
1425
|
*/
|
|
1963
|
-
|
|
1964
|
-
/* Excluded from this release type: eventDispatcher */
|
|
1426
|
+
scene: Scene;
|
|
1965
1427
|
private posNdc;
|
|
1966
1428
|
private posScreen;
|
|
1967
1429
|
private posScreenLast;
|
|
@@ -1974,13 +1436,14 @@ export declare class Obj3D {
|
|
|
1974
1436
|
private quatWorldLast;
|
|
1975
1437
|
private rotWorld;
|
|
1976
1438
|
private visible;
|
|
1977
|
-
private
|
|
1978
|
-
private
|
|
1439
|
+
private inFrustum;
|
|
1440
|
+
private inFrustumLast;
|
|
1979
1441
|
private visibleLast;
|
|
1980
|
-
private
|
|
1981
|
-
|
|
1442
|
+
private occluded;
|
|
1443
|
+
private objHidden;
|
|
1444
|
+
private visibleBeforeHidden;
|
|
1982
1445
|
/**
|
|
1983
|
-
*
|
|
1446
|
+
* Subscribes to an object event.
|
|
1984
1447
|
* @param type - The event type to listen for.
|
|
1985
1448
|
* @param listener - Callback invoked when the event occurs.
|
|
1986
1449
|
* @returns A function that unsubscribes the listener.
|
|
@@ -1990,11 +1453,9 @@ export declare class Obj3D {
|
|
|
1990
1453
|
}>) => void): Unsubscribe;
|
|
1991
1454
|
private calcFrustumVisibility;
|
|
1992
1455
|
private calcPosScreen;
|
|
1993
|
-
/* Excluded from this release type: calcPosWorld */
|
|
1994
1456
|
private calcPosOccl;
|
|
1995
1457
|
private calcRotWorld;
|
|
1996
1458
|
private calcVisibility;
|
|
1997
|
-
/* Excluded from this release type: emitEvent */
|
|
1998
1459
|
/**
|
|
1999
1460
|
* Returns the object's screen position in canvas coordinates.
|
|
2000
1461
|
* @param cam3D - Camera used for projection to canvas coordinates.
|
|
@@ -2004,19 +1465,18 @@ export declare class Obj3D {
|
|
|
2004
1465
|
x: number;
|
|
2005
1466
|
y: number;
|
|
2006
1467
|
} | null;
|
|
2007
|
-
/* Excluded from this release type: hasEventListener */
|
|
2008
1468
|
/**
|
|
2009
|
-
* Called once
|
|
1469
|
+
* Called once when the scene, renderer, and initial environment are ready and, if configured, the first model has been loaded and traversed.
|
|
2010
1470
|
* @public
|
|
2011
1471
|
*/
|
|
2012
1472
|
protected onReady(): void;
|
|
2013
1473
|
/**
|
|
2014
|
-
* Called once after the
|
|
1474
|
+
* Called once after the scene is initialized, before model loading begins.
|
|
2015
1475
|
* @public
|
|
2016
1476
|
*/
|
|
2017
1477
|
protected onStart(): void;
|
|
2018
1478
|
/**
|
|
2019
|
-
* Called
|
|
1479
|
+
* Called for each matching object found during GLTF traversal. Adopts the object for this component.
|
|
2020
1480
|
* @param objGltf - The traversed `THREE.Object3D` instance.
|
|
2021
1481
|
* @public
|
|
2022
1482
|
*/
|
|
@@ -2027,9 +1487,8 @@ export declare class Obj3D {
|
|
|
2027
1487
|
* @public
|
|
2028
1488
|
*/
|
|
2029
1489
|
protected onUpdate(deltaTime: number): void;
|
|
2030
|
-
/* Excluded from this release type: ready */
|
|
2031
1490
|
/**
|
|
2032
|
-
*
|
|
1491
|
+
* Unsubscribes a listener from an object event.
|
|
2033
1492
|
* @param type - The event type to remove the listener from.
|
|
2034
1493
|
* @param listener - Callback to remove from the event listeners.
|
|
2035
1494
|
*/
|
|
@@ -2037,37 +1496,26 @@ export declare class Obj3D {
|
|
|
2037
1496
|
type: TType;
|
|
2038
1497
|
}>) => void): void;
|
|
2039
1498
|
private resetEventState;
|
|
2040
|
-
/* Excluded from this release type: start */
|
|
2041
|
-
/* Excluded from this release type: traverse */
|
|
2042
|
-
/* Excluded from this release type: update */
|
|
2043
1499
|
}
|
|
2044
1500
|
|
|
2045
|
-
/**
|
|
2046
|
-
export declare type Obj3DClass = new (canvas: HTMLElement, cfg: Cfg, name: string) => Objs3D;
|
|
2047
|
-
|
|
2048
|
-
/** Defines all event types supported by `Obj3D.addEventListener`. */
|
|
1501
|
+
/** Object events available to registered listeners. */
|
|
2049
1502
|
export declare type Obj3DEvent = Obj3DPosWorldEvent | Obj3DPosScreenEvent | Obj3DRotWorldEvent | Obj3DFrustumEvent | Obj3DVisibleEvent | Obj3DPointerEvent;
|
|
2050
1503
|
|
|
2051
1504
|
/** @event Fired when the frustum visibility of a 3D object changes. */
|
|
2052
1505
|
export declare interface Obj3DFrustumEvent {
|
|
2053
|
-
/** Identifies this event type. */
|
|
2054
1506
|
type: 'Obj3D_Frustum_Changed';
|
|
2055
1507
|
/** Whether the object's world position is inside the camera frustum. */
|
|
2056
1508
|
visibleFrustum: boolean;
|
|
2057
1509
|
}
|
|
2058
1510
|
|
|
2059
|
-
/**
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
export declare type Obj3DInsts<T extends Record<string, Obj3DClass>> = {
|
|
2065
|
-
[K in keyof T]: InstanceType<T[K]>;
|
|
2066
|
-
};
|
|
1511
|
+
/** Initial parameters shared by all `Obj3D` classes. */
|
|
1512
|
+
export declare interface Obj3DParams {
|
|
1513
|
+
/** Hides the underlying Three.js object from rendering without disabling raycasting. */
|
|
1514
|
+
hidden?: boolean;
|
|
1515
|
+
}
|
|
2067
1516
|
|
|
2068
|
-
/** @event Fired when the
|
|
1517
|
+
/** @event Fired when the pointer interacts with a pickable object. */
|
|
2069
1518
|
export declare interface Obj3DPointerEvent {
|
|
2070
|
-
/** Identifies this event type. */
|
|
2071
1519
|
type: 'Obj3D_Click' | 'Obj3D_Pointer_Enter' | 'Obj3D_Pointer_Down' | 'Obj3D_Pointer_Leave' | 'Obj3D_Pointer_Move' | 'Obj3D_Pointer_Up';
|
|
2072
1520
|
/** Native pointer event from the active object interaction. */
|
|
2073
1521
|
event: PointerEvent;
|
|
@@ -2079,7 +1527,6 @@ export declare interface Obj3DPointerEvent {
|
|
|
2079
1527
|
* @event Fired when the screen position of a 3D object changes.
|
|
2080
1528
|
*/
|
|
2081
1529
|
export declare interface Obj3DPosScreenEvent {
|
|
2082
|
-
/** Identifies this event type. */
|
|
2083
1530
|
type: 'Obj3D_Pos_Screen_Changed';
|
|
2084
1531
|
/** The object's position projected into screen space. */
|
|
2085
1532
|
posScreen: THREE_TYPE.Vector2;
|
|
@@ -2089,7 +1536,6 @@ export declare interface Obj3DPosScreenEvent {
|
|
|
2089
1536
|
* @event Fired when the world position of a 3D object changes.
|
|
2090
1537
|
*/
|
|
2091
1538
|
export declare interface Obj3DPosWorldEvent {
|
|
2092
|
-
/** Identifies this event type. */
|
|
2093
1539
|
type: 'Obj3D_Pos_World_Changed';
|
|
2094
1540
|
/** The object's position in world coordinates. */
|
|
2095
1541
|
posWorld: THREE_TYPE.Vector3;
|
|
@@ -2099,30 +1545,22 @@ export declare interface Obj3DPosWorldEvent {
|
|
|
2099
1545
|
* @event Fired when the world rotation of a 3D object changes.
|
|
2100
1546
|
*/
|
|
2101
1547
|
export declare interface Obj3DRotWorldEvent {
|
|
2102
|
-
/** Identifies this event type. */
|
|
2103
1548
|
type: 'Obj3D_Rot_World_Changed';
|
|
2104
1549
|
/** The object's rotation in world coordinates. */
|
|
2105
1550
|
rotWorld: THREE_TYPE.Euler;
|
|
2106
1551
|
}
|
|
2107
1552
|
|
|
2108
|
-
/** @event Fired when
|
|
1553
|
+
/** @event Fired when an object's combined hidden, frustum, and occlusion visibility changes. */
|
|
2109
1554
|
export declare interface Obj3DVisibleEvent {
|
|
2110
|
-
/** Identifies this event type. */
|
|
2111
1555
|
type: 'Obj3D_Visible_Changed';
|
|
2112
|
-
/** Whether the object is inside the camera frustum and not occluded. */
|
|
1556
|
+
/** Whether the object is not hidden, is inside the camera frustum, and is not occluded. */
|
|
2113
1557
|
visible: boolean;
|
|
2114
1558
|
}
|
|
2115
1559
|
|
|
2116
1560
|
export declare type Objs3D = Cam3D | Light3D | Mesh3D | Obj3D;
|
|
2117
1561
|
|
|
2118
|
-
declare interface OccludeeState {
|
|
2119
|
-
obj: THREE_TYPE.Object3D;
|
|
2120
|
-
needsCheck: boolean;
|
|
2121
|
-
visible: boolean;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
1562
|
/**
|
|
2125
|
-
*
|
|
1563
|
+
* Controls camera orbit, panning, and zooming around a target.
|
|
2126
1564
|
* @category Core
|
|
2127
1565
|
*/
|
|
2128
1566
|
export declare class OrbitCtrls {
|
|
@@ -2131,49 +1569,52 @@ export declare class OrbitCtrls {
|
|
|
2131
1569
|
private readonly engine;
|
|
2132
1570
|
private readonly events;
|
|
2133
1571
|
private readonly modules;
|
|
2134
|
-
orbitControls:
|
|
1572
|
+
orbitControls: OrbitControls | null;
|
|
2135
1573
|
private readonly params;
|
|
2136
1574
|
private orbitCtrlsFirstChange;
|
|
2137
1575
|
private callback;
|
|
2138
1576
|
private readonly touchPointerIds;
|
|
2139
|
-
|
|
2140
|
-
|
|
1577
|
+
/**
|
|
1578
|
+
* Prepares orbit controls without enabling them.
|
|
1579
|
+
*/
|
|
2141
1580
|
create(): void;
|
|
2142
|
-
/**
|
|
1581
|
+
/**
|
|
1582
|
+
* Stops orbit interaction and automatic camera updates.
|
|
1583
|
+
*/
|
|
2143
1584
|
disable(): void;
|
|
2144
|
-
/**
|
|
1585
|
+
/**
|
|
1586
|
+
* Enables camera orbit, panning, and zooming.
|
|
1587
|
+
*/
|
|
2145
1588
|
enable(): void;
|
|
2146
|
-
/**
|
|
1589
|
+
/**
|
|
1590
|
+
* Releases orbit controls and stops their camera updates.
|
|
1591
|
+
*/
|
|
2147
1592
|
dispose(): void;
|
|
2148
1593
|
/**
|
|
2149
|
-
* Returns the
|
|
2150
|
-
* @returns A snapshot of the mutable orbit control settings.
|
|
1594
|
+
* Returns a snapshot of the current orbit control settings.
|
|
2151
1595
|
*/
|
|
2152
1596
|
get(): Partial<OrbitCtrlsCfg>;
|
|
2153
1597
|
/**
|
|
2154
|
-
*
|
|
2155
|
-
* @returns `true` if `OrbitControls` are currently enabled; otherwise, `false`.
|
|
1598
|
+
* Checks whether orbit controls are enabled.
|
|
2156
1599
|
*/
|
|
2157
1600
|
isEnabled(): boolean;
|
|
2158
1601
|
/**
|
|
2159
|
-
* Updates
|
|
2160
|
-
* @param params -
|
|
1602
|
+
* Updates orbit, panning, and zoom settings. Controls must already be created.
|
|
1603
|
+
* @param params - Settings to change; omitted values remain unchanged.
|
|
2161
1604
|
*/
|
|
2162
1605
|
set(params: Partial<OrbitCtrlsCfg>): void;
|
|
2163
1606
|
/**
|
|
2164
|
-
*
|
|
1607
|
+
* Runs an extension callback immediately with access to the public API.
|
|
2165
1608
|
*
|
|
2166
|
-
* @param extension -
|
|
1609
|
+
* @param extension - Callback receiving this `OrbitCtrls` instance.
|
|
2167
1610
|
*
|
|
2168
|
-
* @remarks
|
|
2169
|
-
* This method is intended for advanced custom integrations where developers need direct access to the engine instance.
|
|
2170
1611
|
* The extension is executed once immediately when `use()` is called.
|
|
2171
1612
|
*/
|
|
2172
1613
|
use(extension: (orbitCtrls: OrbitCtrls) => void): void;
|
|
2173
1614
|
}
|
|
2174
1615
|
|
|
2175
1616
|
/**
|
|
2176
|
-
*
|
|
1617
|
+
* Controls camera orbit, panning, zooming, and movement limits.
|
|
2177
1618
|
* @category Cfg
|
|
2178
1619
|
*/
|
|
2179
1620
|
export declare interface OrbitCtrlsCfg {
|
|
@@ -2183,7 +1624,7 @@ export declare interface OrbitCtrlsCfg {
|
|
|
2183
1624
|
*/
|
|
2184
1625
|
autoRotate: boolean;
|
|
2185
1626
|
/**
|
|
2186
|
-
*
|
|
1627
|
+
* Speed of automatic camera rotation.
|
|
2187
1628
|
* @default 2.0
|
|
2188
1629
|
*/
|
|
2189
1630
|
autoRotateSpeed: number;
|
|
@@ -2218,7 +1659,7 @@ export declare interface OrbitCtrlsCfg {
|
|
|
2218
1659
|
*/
|
|
2219
1660
|
enableZoom: boolean;
|
|
2220
1661
|
/**
|
|
2221
|
-
*
|
|
1662
|
+
* Prepares orbit controls without enabling them.
|
|
2222
1663
|
* @default false
|
|
2223
1664
|
*/
|
|
2224
1665
|
load: boolean;
|
|
@@ -2269,14 +1710,13 @@ export declare interface OrbitCtrlsCfg {
|
|
|
2269
1710
|
zoomSpeed: number;
|
|
2270
1711
|
}
|
|
2271
1712
|
|
|
2272
|
-
/** @event Fired when
|
|
1713
|
+
/** @event Fired when orbit interaction starts, changes, or ends, or controls are enabled, disabled, or disposed. */
|
|
2273
1714
|
export declare interface OrbitCtrlsEvent {
|
|
2274
|
-
/** Identifies this event type. */
|
|
2275
1715
|
type: 'OrbitCtrls_Changed' | 'OrbitCtrls_Disabled' | 'OrbitCtrls_Enabled' | 'OrbitCtrls_End' | 'OrbitCtrls_Start' | 'OrbitCtrls_Disposed';
|
|
2276
1716
|
}
|
|
2277
1717
|
|
|
2278
1718
|
/**
|
|
2279
|
-
*
|
|
1719
|
+
* Tunes post-processing effects selected by the renderer profiles.
|
|
2280
1720
|
* @category Cfg
|
|
2281
1721
|
*/
|
|
2282
1722
|
export declare interface PostCfg {
|
|
@@ -2287,8 +1727,8 @@ export declare interface PostCfg {
|
|
|
2287
1727
|
guiOpened: boolean;
|
|
2288
1728
|
/** Anti-aliasing settings. */
|
|
2289
1729
|
aa: AaCfg;
|
|
2290
|
-
/** Shared
|
|
2291
|
-
|
|
1730
|
+
/** Shared screen-space lighting settings. */
|
|
1731
|
+
ssl: SslCfg;
|
|
2292
1732
|
/** Shared SSR settings. */
|
|
2293
1733
|
ssr: SsrCfg;
|
|
2294
1734
|
/** WebGL post-processing settings. */
|
|
@@ -2299,22 +1739,23 @@ export declare interface PostCfg {
|
|
|
2299
1739
|
fxaa: FxaaCfg;
|
|
2300
1740
|
};
|
|
2301
1741
|
/** WebGL SSAO settings. */
|
|
2302
|
-
ssao:
|
|
1742
|
+
ssao: SsaoCfg;
|
|
2303
1743
|
/** WebGL SSR settings. */
|
|
2304
1744
|
ssr: SsrWebGlCfg;
|
|
2305
1745
|
};
|
|
2306
1746
|
/** WebGPU post-processing settings. */
|
|
2307
1747
|
webgpu: {
|
|
2308
|
-
/** WebGPU
|
|
2309
|
-
|
|
1748
|
+
/** WebGPU GTAO settings. */
|
|
1749
|
+
gtao: GtaoCfg;
|
|
1750
|
+
/** WebGPU SSGI settings. */
|
|
1751
|
+
ssgi: SsgiCfg;
|
|
2310
1752
|
/** WebGPU SSR settings. */
|
|
2311
1753
|
ssr: SsrWebGpuCfg;
|
|
2312
1754
|
};
|
|
2313
1755
|
}
|
|
2314
1756
|
|
|
2315
|
-
/** @event Fired after the progress bar has finished hiding
|
|
1757
|
+
/** @event Fired after the loading progress bar has finished hiding. */
|
|
2316
1758
|
export declare interface ProgressBarHiddenEvent {
|
|
2317
|
-
/** Identifies this event type. */
|
|
2318
1759
|
type: 'ProgressBar_Hidden';
|
|
2319
1760
|
}
|
|
2320
1761
|
|
|
@@ -2329,6 +1770,7 @@ export declare class Raycast {
|
|
|
2329
1770
|
private readonly engine;
|
|
2330
1771
|
private readonly events;
|
|
2331
1772
|
private readonly objs3D;
|
|
1773
|
+
private readonly scene;
|
|
2332
1774
|
private raycasterPick;
|
|
2333
1775
|
private raycasterVisible;
|
|
2334
1776
|
private colliders;
|
|
@@ -2357,10 +1799,12 @@ export declare class Raycast {
|
|
|
2357
1799
|
private posWorldObj;
|
|
2358
1800
|
private dirCamToObj;
|
|
2359
1801
|
private posNdcPointer;
|
|
2360
|
-
/* Excluded from this release type: __constructor */
|
|
2361
1802
|
private checkOccludeeVisible;
|
|
2362
|
-
/**
|
|
2363
|
-
|
|
1803
|
+
/**
|
|
1804
|
+
* Removes existing scene objects from raycasting and resets their collider roles.
|
|
1805
|
+
* @param objs - Registered `Coll3D` instances to remove.
|
|
1806
|
+
*/
|
|
1807
|
+
clearColliders(objs: Coll3D[]): void;
|
|
2364
1808
|
/** Enables pickable raycasting and its pointer event listeners. */
|
|
2365
1809
|
enablePickables(): void;
|
|
2366
1810
|
/** Disables pickable raycasting without removing the collider configuration. */
|
|
@@ -2369,8 +1813,8 @@ export declare class Raycast {
|
|
|
2369
1813
|
private getPickableHit;
|
|
2370
1814
|
private getObjAtPointer;
|
|
2371
1815
|
private emitPointerEvent;
|
|
2372
|
-
|
|
2373
|
-
|
|
1816
|
+
private invalidateOccludees;
|
|
1817
|
+
private rebuildColliderCaches;
|
|
2374
1818
|
private onCanvasClick;
|
|
2375
1819
|
private onCanvasPointerLeave;
|
|
2376
1820
|
private onCanvasPointerMove;
|
|
@@ -2379,16 +1823,13 @@ export declare class Raycast {
|
|
|
2379
1823
|
private onCanvasPointerExit;
|
|
2380
1824
|
private onCanvasPointerUp;
|
|
2381
1825
|
/**
|
|
2382
|
-
*
|
|
2383
|
-
* @param
|
|
1826
|
+
* Adds or updates existing scene objects as raycast colliders. The complete scene is used for occlusion until this method or `clearColliders()` is called for the first time.
|
|
1827
|
+
* @param colls3D - Registered `Coll3D` instances to add or update.
|
|
2384
1828
|
*/
|
|
2385
|
-
setColliders(
|
|
2386
|
-
/* Excluded from this release type: trackOccludee */
|
|
2387
|
-
/* Excluded from this release type: untrackOccludee */
|
|
1829
|
+
setColliders(colls3D: Coll3D[]): void;
|
|
2388
1830
|
/**
|
|
2389
|
-
*
|
|
2390
|
-
* @param extension -
|
|
2391
|
-
* @remarks This method is intended for advanced custom integrations where developers need direct access to the engine instance. The extension is executed once immediately when `use()` is called.
|
|
1831
|
+
* Runs an extension callback immediately with access to the public API.
|
|
1832
|
+
* @param extension - Callback receiving this `Raycast` instance.
|
|
2392
1833
|
*/
|
|
2393
1834
|
use(extension: (raycast: Raycast) => void): void;
|
|
2394
1835
|
private updateOccludees;
|
|
@@ -2397,7 +1838,7 @@ export declare class Raycast {
|
|
|
2397
1838
|
}
|
|
2398
1839
|
|
|
2399
1840
|
/**
|
|
2400
|
-
*
|
|
1841
|
+
* Controls pointer picking and occlusion checks.
|
|
2401
1842
|
* @category Cfg
|
|
2402
1843
|
*/
|
|
2403
1844
|
export declare interface RaycastCfg {
|
|
@@ -2412,12 +1853,12 @@ export declare interface RaycastCfg {
|
|
|
2412
1853
|
*/
|
|
2413
1854
|
circleSteps: number;
|
|
2414
1855
|
/**
|
|
2415
|
-
* Number of closest
|
|
1856
|
+
* Number of consecutive closest-object detections required before the active hover target changes.
|
|
2416
1857
|
* @default 5
|
|
2417
1858
|
*/
|
|
2418
1859
|
countClosestObjs: number;
|
|
2419
1860
|
/**
|
|
2420
|
-
* Time in milliseconds over which
|
|
1861
|
+
* Time in milliseconds over which pending occlusion checks are spread. A value of `0` processes them all in one frame.
|
|
2421
1862
|
* @default 0
|
|
2422
1863
|
*/
|
|
2423
1864
|
occludeeInterval: number;
|
|
@@ -2429,10 +1870,15 @@ export declare interface RaycastCfg {
|
|
|
2429
1870
|
}
|
|
2430
1871
|
|
|
2431
1872
|
/**
|
|
2432
|
-
*
|
|
1873
|
+
* Controls rendering quality, performance, shadows, and color output.
|
|
2433
1874
|
* @category Cfg
|
|
2434
1875
|
*/
|
|
2435
1876
|
export declare interface RenderCfg {
|
|
1877
|
+
/**
|
|
1878
|
+
* Enables or disables adaptive graphics quality selection.
|
|
1879
|
+
* @default false
|
|
1880
|
+
*/
|
|
1881
|
+
adaptiveGfx: boolean;
|
|
2436
1882
|
/**
|
|
2437
1883
|
* Selects the rendering backend.
|
|
2438
1884
|
*
|
|
@@ -2447,27 +1893,27 @@ export declare interface RenderCfg {
|
|
|
2447
1893
|
* Automatically updates the canvas, renderer, post-processing, camera and reflector sizes on window resize.
|
|
2448
1894
|
* @default true
|
|
2449
1895
|
*/
|
|
2450
|
-
autoResize
|
|
2451
|
-
/**
|
|
2452
|
-
* Whether the GUI render dropdown is open.
|
|
2453
|
-
* @default false
|
|
2454
|
-
*/
|
|
2455
|
-
guiOpened: boolean;
|
|
1896
|
+
autoResize: boolean;
|
|
2456
1897
|
/**
|
|
2457
|
-
* Enables or disables
|
|
1898
|
+
* Enables or disables Eco mode availability.
|
|
2458
1899
|
* @default true
|
|
2459
1900
|
*/
|
|
2460
|
-
|
|
1901
|
+
ecoMode: boolean;
|
|
2461
1902
|
/**
|
|
2462
|
-
*
|
|
1903
|
+
* Minimum rendering FPS to preserve when Eco Mode skips frames.
|
|
2463
1904
|
* @default 30
|
|
2464
1905
|
*/
|
|
2465
|
-
|
|
1906
|
+
fpsMin: number;
|
|
2466
1907
|
/**
|
|
2467
|
-
*
|
|
2468
|
-
* @default
|
|
1908
|
+
* Number of recent frame timings used to evaluate performance.
|
|
1909
|
+
* @default 20
|
|
2469
1910
|
*/
|
|
2470
1911
|
deltaTimesMax: number;
|
|
1912
|
+
/**
|
|
1913
|
+
* Whether the GUI render dropdown is open.
|
|
1914
|
+
* @default false
|
|
1915
|
+
*/
|
|
1916
|
+
guiOpened: boolean;
|
|
2471
1917
|
/**
|
|
2472
1918
|
* Output color space.
|
|
2473
1919
|
* @default THREE.SRGBColorSpace
|
|
@@ -2507,12 +1953,9 @@ export declare interface RenderCfg {
|
|
|
2507
1953
|
* @default false
|
|
2508
1954
|
*/
|
|
2509
1955
|
alpha: boolean;
|
|
2510
|
-
/**
|
|
2511
|
-
* Whether renderer-level anti-aliasing is enabled.
|
|
2512
|
-
* @default false
|
|
2513
|
-
*/
|
|
2514
|
-
antialias: boolean;
|
|
2515
1956
|
};
|
|
1957
|
+
/** Renderer feature profiles. */
|
|
1958
|
+
profile: RenderProfileCfg;
|
|
2516
1959
|
/**
|
|
2517
1960
|
* WebGL-specific renderer configuration.
|
|
2518
1961
|
*/
|
|
@@ -2533,26 +1976,356 @@ export declare interface RenderCfg {
|
|
|
2533
1976
|
};
|
|
2534
1977
|
}
|
|
2535
1978
|
|
|
2536
|
-
/**
|
|
1979
|
+
/** @inheritDoc RenderCfg.api */
|
|
2537
1980
|
export declare type Renderer = 'webgl' | 'webgpu' | 'auto';
|
|
2538
1981
|
|
|
2539
|
-
|
|
1982
|
+
/** Complete effect selections for both rendering backends. */
|
|
1983
|
+
export declare interface RenderProfileCfg {
|
|
1984
|
+
/** Resolved WebGL rendering profile. */
|
|
1985
|
+
webgl: RenderProfileWebGl;
|
|
1986
|
+
/** Resolved WebGPU rendering profile. */
|
|
1987
|
+
webgpu: RenderProfileWebGpu;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
/** Overrides renderer effects while preserving unspecified defaults and valid combinations. */
|
|
1991
|
+
export declare interface RenderProfileValidCfg {
|
|
1992
|
+
/** WebGL effect overrides. */
|
|
1993
|
+
webgl?: Partial<RenderProfileWebGl>;
|
|
1994
|
+
/** Compatible WebGPU effect overrides. */
|
|
1995
|
+
webgpu?: {
|
|
1996
|
+
/** Disables MSAA or applies it only to the renderer. */
|
|
1997
|
+
msaa?: Exclude<MsaaMode, 'post'>;
|
|
1998
|
+
/** Selects non-temporal anti-aliasing. */
|
|
1999
|
+
aa?: Exclude<AaModeWebGpu, 'traa'>;
|
|
2000
|
+
/** Selects ambient occlusion without indirect illumination. */
|
|
2001
|
+
ssl?: Exclude<SslModeWebGpu, 'ssgi'>;
|
|
2002
|
+
/** Enables screen-space reflections. */
|
|
2003
|
+
ssr?: boolean;
|
|
2004
|
+
} | {
|
|
2005
|
+
/** Applies MSAA to the renderer and post-processing. */
|
|
2006
|
+
msaa: 'post';
|
|
2007
|
+
/** Selects non-temporal anti-aliasing. */
|
|
2008
|
+
aa?: Exclude<AaModeWebGpu, 'traa'>;
|
|
2009
|
+
/** Post-processing MSAA does not support screen-space lighting. */
|
|
2010
|
+
ssl?: 'none';
|
|
2011
|
+
/** Enables screen-space reflections. */
|
|
2012
|
+
ssr?: boolean;
|
|
2013
|
+
} | {
|
|
2014
|
+
/** Disables MSAA or applies it only to the renderer. */
|
|
2015
|
+
msaa?: Exclude<MsaaMode, 'post'>;
|
|
2016
|
+
/** Selects Temporal Reprojection Anti-Aliasing. */
|
|
2017
|
+
aa: 'traa';
|
|
2018
|
+
/** Selects screen-space lighting. */
|
|
2019
|
+
ssl?: SslModeWebGpu;
|
|
2020
|
+
/** Enables screen-space reflections. */
|
|
2021
|
+
ssr?: boolean;
|
|
2022
|
+
};
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
/** Selects MSAA, anti-aliasing, ambient occlusion, and reflections for WebGL. */
|
|
2026
|
+
export declare type RenderProfileWebGl = {
|
|
2027
|
+
/** Selects where MSAA is applied. */
|
|
2028
|
+
msaa: MsaaMode;
|
|
2029
|
+
/** Selects the anti-aliasing mode. */
|
|
2030
|
+
aa: AaModeWebGl;
|
|
2031
|
+
/** Selects screen-space ambient occlusion. */
|
|
2032
|
+
ssl: SslModeWebGl;
|
|
2033
|
+
/** Enables screen-space reflections. */
|
|
2034
|
+
ssr: boolean;
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
/** Selects compatible WebGPU effects. SSGI requires TRAA; post-processing MSAA excludes TRAA and screen-space lighting. */
|
|
2038
|
+
export declare type RenderProfileWebGpu = {
|
|
2039
|
+
/** Enables screen-space reflections. */
|
|
2040
|
+
ssr: boolean;
|
|
2041
|
+
} & ({
|
|
2042
|
+
/** Disables MSAA or applies it only to the renderer. */
|
|
2043
|
+
msaa: Exclude<MsaaMode, 'post'>;
|
|
2044
|
+
/** Selects a non-temporal anti-aliasing mode. */
|
|
2045
|
+
aa: Exclude<AaModeWebGpu, 'traa'>;
|
|
2046
|
+
/** Selects screen-space lighting without SSGI. */
|
|
2047
|
+
ssl: Exclude<SslModeWebGpu, 'ssgi'>;
|
|
2048
|
+
} | {
|
|
2049
|
+
/** Applies MSAA to the renderer and post-processing. */
|
|
2050
|
+
msaa: 'post';
|
|
2051
|
+
/** Selects a non-temporal anti-aliasing mode. */
|
|
2052
|
+
aa: Exclude<AaModeWebGpu, 'traa'>;
|
|
2053
|
+
/** Post-processing MSAA does not support screen-space lighting. */
|
|
2054
|
+
ssl: 'none';
|
|
2055
|
+
} | {
|
|
2056
|
+
/** TRAA cannot be combined with post-processing MSAA. */
|
|
2057
|
+
msaa: Exclude<MsaaMode, 'post'>;
|
|
2058
|
+
/** Selects Temporal Reprojection Anti-Aliasing. */
|
|
2059
|
+
aa: 'traa';
|
|
2060
|
+
/** Selects screen-space lighting. */
|
|
2061
|
+
ssl: SslModeWebGpu;
|
|
2062
|
+
});
|
|
2540
2063
|
|
|
2541
2064
|
/**
|
|
2542
|
-
*
|
|
2543
|
-
* @category
|
|
2065
|
+
* Controls scene contents, camera animation, materials, lighting, and clip playback.
|
|
2066
|
+
* @category Core
|
|
2544
2067
|
*/
|
|
2545
|
-
export declare
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2068
|
+
export declare class Scene {
|
|
2069
|
+
private readonly cfg;
|
|
2070
|
+
private readonly cam3D;
|
|
2071
|
+
private readonly events;
|
|
2072
|
+
private readonly objs3D;
|
|
2073
|
+
private ambientLight;
|
|
2074
|
+
private hemisphereLight;
|
|
2075
|
+
readonly obj: THREE_TYPE.Scene;
|
|
2076
|
+
/**
|
|
2077
|
+
* Moves the camera along a curved path, optionally turning it toward a new target.
|
|
2078
|
+
* @param params - Camera movement settings.
|
|
2079
|
+
* @param params.camTarget - Destination position or object.
|
|
2080
|
+
* @param params.aimTarget - Position or object to look at while moving.
|
|
2081
|
+
* @param params.radiusOut - Outward curve radius. Default: **1**
|
|
2082
|
+
* @param params.duration - Duration in seconds. Default: **2**
|
|
2083
|
+
* @param params.ease - GSAP easing function. Default: **'power1.inOut'**
|
|
2084
|
+
*
|
|
2085
|
+
* @remarks
|
|
2086
|
+
* Emits {@link AnimEvent} when the animation starts and completes.
|
|
2554
2087
|
*/
|
|
2555
|
-
|
|
2088
|
+
animCamCurveTo({ camTarget, aimTarget, radiusOut, duration, ease }: {
|
|
2089
|
+
camTarget: THREE_TYPE.Vector3 | string | Obj3D;
|
|
2090
|
+
aimTarget?: THREE_TYPE.Vector3 | string | Obj3D;
|
|
2091
|
+
radiusOut?: number;
|
|
2092
|
+
duration?: number;
|
|
2093
|
+
ease?: string;
|
|
2094
|
+
}): void;
|
|
2095
|
+
/**
|
|
2096
|
+
* Moves a perspective camera to frame an object while looking at it. Only the object's own geometry is used; child objects are excluded.
|
|
2097
|
+
* @param params - Camera movement settings.
|
|
2098
|
+
* @param params.target - Object or scene object name to frame.
|
|
2099
|
+
* @param params.duration - Duration in seconds. Default: **1**
|
|
2100
|
+
* @param params.ease - GSAP easing function. Default: **'power2.inOut'**
|
|
2101
|
+
* @param params.dist - Multiplier for the calculated camera distance. Default: **1.25**
|
|
2102
|
+
*
|
|
2103
|
+
* @remarks
|
|
2104
|
+
* Emits {@link AnimEvent} when the animation starts and completes.
|
|
2105
|
+
*/
|
|
2106
|
+
animCamTo({ target, duration, ease, dist }: {
|
|
2107
|
+
target: string | Obj3D;
|
|
2108
|
+
duration?: number;
|
|
2109
|
+
ease?: string;
|
|
2110
|
+
dist?: number;
|
|
2111
|
+
}): void;
|
|
2112
|
+
/**
|
|
2113
|
+
* Animates one or more material colors on a mesh.
|
|
2114
|
+
* @param params - Target colors, such as `color` or `emissive`, and animation settings.
|
|
2115
|
+
* @param params.mesh - Scene mesh name or `Mesh3D` component.
|
|
2116
|
+
* @param params.duration - Duration in seconds. Default: **0**
|
|
2117
|
+
* @param params.ease - GSAP easing function. Default: **'power1.inOut'**
|
|
2118
|
+
*
|
|
2119
|
+
* @remarks
|
|
2120
|
+
* Colors may be strings, numbers, or `THREE.Color` values. Emits {@link AnimFadeEvent} when the animation starts and completes.
|
|
2121
|
+
*/
|
|
2122
|
+
animMaterialColor({ mesh, duration, ease, ...colorProps }: {
|
|
2123
|
+
mesh: string | Mesh3D;
|
|
2124
|
+
duration?: number;
|
|
2125
|
+
ease?: string;
|
|
2126
|
+
} & {
|
|
2127
|
+
[key: string]: string | number | THREE_TYPE.Color | Mesh3D;
|
|
2128
|
+
}): void;
|
|
2129
|
+
/**
|
|
2130
|
+
* Animates a numeric material property on a mesh. Only the first supplied property is animated.
|
|
2131
|
+
* @param params - Target value and animation settings.
|
|
2132
|
+
* @param params.mesh - Scene mesh name or `Mesh3D` component.
|
|
2133
|
+
* @param params.startValue - Starting value. Defaults to the current material value.
|
|
2134
|
+
* @param params.infinite - Repeats the animation indefinitely. Default: **false**
|
|
2135
|
+
* @param params.duration - Duration in seconds. Default: **0**
|
|
2136
|
+
* @param params.ease - GSAP easing function. Default: **'power1.inOut'**
|
|
2137
|
+
* @param params.needsUpdate - Recompiles the material when animation starts. Default: **false**
|
|
2138
|
+
*
|
|
2139
|
+
* @remarks
|
|
2140
|
+
* Emits {@link AnimFadeEvent} when the animation starts and completes.
|
|
2141
|
+
*/
|
|
2142
|
+
animMaterialNumeric({ mesh, needsUpdate, startValue, infinite, duration, ease, ...props }: {
|
|
2143
|
+
mesh: string | Mesh3D;
|
|
2144
|
+
startValue?: number | null;
|
|
2145
|
+
infinite?: boolean;
|
|
2146
|
+
duration?: number;
|
|
2147
|
+
ease?: string;
|
|
2148
|
+
needsUpdate?: boolean;
|
|
2149
|
+
[key: string]: any;
|
|
2150
|
+
}): void;
|
|
2151
|
+
private calcEaseArea;
|
|
2152
|
+
/**
|
|
2153
|
+
* Plays a named animation clip with blending, looping, and speed control.
|
|
2154
|
+
*
|
|
2155
|
+
* @param params - Parameters for controlling the animation playback.
|
|
2156
|
+
* @param params.layer - The freely named layer used to group animation actions.
|
|
2157
|
+
* @param params.clip - The name of the animation clip to play.
|
|
2158
|
+
* @param params.blendMode - How the action is blended with other active actions. Default: **'normal'**
|
|
2159
|
+
* @param params.finishMode - Whether the final pose is held or faded out after the final loop. Default: **'hold'**
|
|
2160
|
+
* @param params.loopMode - Number of plays or `'infinite'` for endless looping. Default: **1**
|
|
2161
|
+
* @param params.stopMode - Which previous actions of the same layer are stopped before playback. Default: **'all'**
|
|
2162
|
+
* @param params.fadeDuration - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
|
|
2163
|
+
* @param params.fadeDurationFinish - Duration in seconds for `finishMode: 'fadeOut'`. Default: **0**
|
|
2164
|
+
* @param params.reverse - If `true`, plays the clip in reverse. Default: **false**
|
|
2165
|
+
* @param params.reset - If `true`, resets the clip before a new playback. Default: **false**
|
|
2166
|
+
* @param params.startSpeed - Initial playback speed for speed interpolation. Default: **0**
|
|
2167
|
+
* @param params.endSpeed - Target playback speed. Default: **1**
|
|
2168
|
+
* @param params.duration - Duration in seconds for speed interpolation. Default: **0**
|
|
2169
|
+
* @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
|
|
2170
|
+
*
|
|
2171
|
+
* @remarks
|
|
2172
|
+
* Playing an active or fading-in action again updates its speed without restarting it. Finished or stopped actions restart; fading-out actions resume from their current time and weight.
|
|
2173
|
+
*
|
|
2174
|
+
* `finishMode` and `fadeDurationFinish` have no effect when `loopMode` is `'infinite'`.
|
|
2175
|
+
*
|
|
2176
|
+
* **Events**
|
|
2177
|
+
*
|
|
2178
|
+
* {@link ClipEvent}
|
|
2179
|
+
*/
|
|
2180
|
+
playClip({ layer, clip: clipName, blendMode, finishMode, loopMode, stopMode, fadeDuration, fadeDurationFinish, reverse, reset, startSpeed, endSpeed, duration, ease }: {
|
|
2181
|
+
layer: string;
|
|
2182
|
+
clip: string;
|
|
2183
|
+
singleAction?: boolean;
|
|
2184
|
+
blendMode?: BlendMode;
|
|
2185
|
+
finishMode?: FinishMode;
|
|
2186
|
+
loopMode?: LoopMode;
|
|
2187
|
+
stopMode?: StopMode;
|
|
2188
|
+
fadeDuration?: number;
|
|
2189
|
+
fadeDurationFinish?: number;
|
|
2190
|
+
reverse?: boolean;
|
|
2191
|
+
reset?: boolean;
|
|
2192
|
+
startSpeed?: number;
|
|
2193
|
+
endSpeed?: number;
|
|
2194
|
+
duration?: number;
|
|
2195
|
+
ease?: string;
|
|
2196
|
+
}): void;
|
|
2197
|
+
/**
|
|
2198
|
+
* Plays a named camera animation clip with blending, looping, and speed control.
|
|
2199
|
+
*
|
|
2200
|
+
* @param params - Parameters for controlling the camera animation playback.
|
|
2201
|
+
* @param params.layer - The freely named layer used to group camera animation actions.
|
|
2202
|
+
* @param params.clip - The name of the camera animation clip to play.
|
|
2203
|
+
* @param params.blendMode - How the action is blended with other active actions. Default: **'normal'**
|
|
2204
|
+
* @param params.loopMode - Number of plays or `'infinite'` for endless looping. Default: **1**
|
|
2205
|
+
* @param params.stopMode - Which previous actions of the same layer are stopped before playback. Default: **'all'**
|
|
2206
|
+
* @param params.fadeDuration - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
|
|
2207
|
+
* @param params.reverse - If `true`, plays the clip in reverse. Default: **false**
|
|
2208
|
+
* @param params.reset - If `true`, resets the clip before a new playback. Default: **false**
|
|
2209
|
+
* @param params.startSpeed - Initial playback speed for speed interpolation. Default: **0**
|
|
2210
|
+
* @param params.endSpeed - Target playback speed. Default: **1**
|
|
2211
|
+
* @param params.duration - Duration in seconds for speed interpolation. Default: **0**
|
|
2212
|
+
* @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
|
|
2213
|
+
*
|
|
2214
|
+
* @remarks
|
|
2215
|
+
* Playing an active or fading-in action again updates its speed without restarting it. Finished or stopped actions restart; fading-out actions resume from their current time and weight.
|
|
2216
|
+
*
|
|
2217
|
+
* **Events**
|
|
2218
|
+
*
|
|
2219
|
+
* {@link ClipEvent}
|
|
2220
|
+
*/
|
|
2221
|
+
playClipCam({ layer, clip: clipName, blendMode, loopMode, stopMode, fadeDuration, reverse, reset, startSpeed, endSpeed, duration, ease }: {
|
|
2222
|
+
layer: string;
|
|
2223
|
+
clip: string;
|
|
2224
|
+
blendMode?: BlendMode;
|
|
2225
|
+
loopMode?: LoopMode;
|
|
2226
|
+
stopMode?: StopMode;
|
|
2227
|
+
fadeDuration?: number;
|
|
2228
|
+
reverse?: boolean;
|
|
2229
|
+
reset?: boolean;
|
|
2230
|
+
startSpeed?: number;
|
|
2231
|
+
endSpeed?: number;
|
|
2232
|
+
duration?: number;
|
|
2233
|
+
ease?: string;
|
|
2234
|
+
}): void;
|
|
2235
|
+
/**
|
|
2236
|
+
* Removes the built-in ambient light and releases its resources.
|
|
2237
|
+
*/
|
|
2238
|
+
removeAmbientLight(): void;
|
|
2239
|
+
/**
|
|
2240
|
+
* Removes scene fog.
|
|
2241
|
+
*/
|
|
2242
|
+
removeFog(): void;
|
|
2243
|
+
/**
|
|
2244
|
+
* Removes the built-in hemisphere light and releases its resources.
|
|
2245
|
+
*/
|
|
2246
|
+
removeHemisphereLight(): void;
|
|
2247
|
+
/**
|
|
2248
|
+
* Creates or updates uniform ambient lighting. Creation requires both color and intensity; omitted values remain unchanged when updating.
|
|
2249
|
+
* @param params - Ambient light settings.
|
|
2250
|
+
* @param params.color - Light color.
|
|
2251
|
+
* @param params.intensity - Light intensity.
|
|
2252
|
+
*/
|
|
2253
|
+
setAmbientLight({ color, intensity }: {
|
|
2254
|
+
color?: THREE_TYPE.ColorRepresentation;
|
|
2255
|
+
intensity?: number;
|
|
2256
|
+
}): void;
|
|
2257
|
+
/**
|
|
2258
|
+
* Creates or updates distance-based scene fog. Creation requires all three settings; omitted values remain unchanged when updating.
|
|
2259
|
+
* @param params - Fog settings.
|
|
2260
|
+
* @param params.color - Fog color.
|
|
2261
|
+
* @param params.near - Distance at which fog begins.
|
|
2262
|
+
* @param params.far - Distance at which fog fully obscures objects.
|
|
2263
|
+
*/
|
|
2264
|
+
setFog({ color, near, far }: {
|
|
2265
|
+
color?: THREE_TYPE.ColorRepresentation;
|
|
2266
|
+
near?: number;
|
|
2267
|
+
far?: number;
|
|
2268
|
+
}): void;
|
|
2269
|
+
/**
|
|
2270
|
+
* Creates or updates ambient sky and ground lighting. Creation requires all three settings; omitted values remain unchanged when updating.
|
|
2271
|
+
* @param params - Hemisphere light settings.
|
|
2272
|
+
* @param params.skyColor - Light color from above.
|
|
2273
|
+
* @param params.groundColor - Light color from below.
|
|
2274
|
+
* @param params.intensity - Light intensity.
|
|
2275
|
+
*/
|
|
2276
|
+
setHemisphereLight({ skyColor, groundColor, intensity }: {
|
|
2277
|
+
skyColor?: THREE_TYPE.ColorRepresentation;
|
|
2278
|
+
groundColor?: THREE_TYPE.ColorRepresentation;
|
|
2279
|
+
intensity?: number;
|
|
2280
|
+
}): void;
|
|
2281
|
+
/**
|
|
2282
|
+
* Updates all material slots on a mesh, optionally including its descendants. Shared materials also affect other objects that use them.
|
|
2283
|
+
* @param params - Target material values, such as `color`, `roughness`, or `map`.
|
|
2284
|
+
* @param params.obj - Scene object name or `Mesh3D` component.
|
|
2285
|
+
* @param params.recursive - Includes descendant meshes. Default: **false**
|
|
2286
|
+
* @param params.needsUpdate - Recompiles materials after applying the values. Default: **false**
|
|
2287
|
+
*
|
|
2288
|
+
* @remarks
|
|
2289
|
+
* Texture paths for `map` and `emissiveMap` load asynchronously. Unsupported values are skipped with a warning.
|
|
2290
|
+
*/
|
|
2291
|
+
setMaterialProps({ obj, recursive, needsUpdate, ...props }: {
|
|
2292
|
+
obj: string | Mesh3D;
|
|
2293
|
+
recursive?: boolean;
|
|
2294
|
+
needsUpdate?: boolean;
|
|
2295
|
+
[key: string]: any;
|
|
2296
|
+
}): void;
|
|
2297
|
+
/**
|
|
2298
|
+
* Stops a named animation clip, optionally slowing it to a halt first.
|
|
2299
|
+
* @param params - Stop settings.
|
|
2300
|
+
* @param params.clipName - Animation clip name.
|
|
2301
|
+
* @param params.fadeOut - Slowdown duration in seconds. Default: **0**
|
|
2302
|
+
* @param params.ease - GSAP easing function for the slowdown. Default: **'power1.inOut'**
|
|
2303
|
+
*
|
|
2304
|
+
* @remarks
|
|
2305
|
+
* A slowdown emits `Clip_Speed_Start` and `Clip_Speed_Complete`, followed by `Clip_Cancel`. A duration of `0` cancels immediately. See {@link ClipEvent}.
|
|
2306
|
+
*/
|
|
2307
|
+
stopAnimClip({ clipName, fadeOut, ease }: {
|
|
2308
|
+
clipName: string;
|
|
2309
|
+
fadeOut?: number;
|
|
2310
|
+
ease?: string;
|
|
2311
|
+
}): void;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
/**
|
|
2315
|
+
* Controls the canvas, fog, and built-in scene lights.
|
|
2316
|
+
* @category Cfg
|
|
2317
|
+
*/
|
|
2318
|
+
export declare interface SceneCfg {
|
|
2319
|
+
/**
|
|
2320
|
+
* Selector for the element that hosts the rendered canvas.
|
|
2321
|
+
* @default 'ilu-canvas'
|
|
2322
|
+
*/
|
|
2323
|
+
canvas: string;
|
|
2324
|
+
/**
|
|
2325
|
+
* Whether the GUI scene dropdown is open.
|
|
2326
|
+
* @default false
|
|
2327
|
+
*/
|
|
2328
|
+
guiOpened: boolean;
|
|
2556
2329
|
/** Fog settings. */
|
|
2557
2330
|
fog: FogCfg;
|
|
2558
2331
|
/** Ambient light settings. */
|
|
@@ -2561,20 +2334,49 @@ export declare interface SceneCfg {
|
|
|
2561
2334
|
hemisphere: HemisphereCfg;
|
|
2562
2335
|
}
|
|
2563
2336
|
|
|
2564
|
-
/**
|
|
2337
|
+
/** Scene component classes available for registration. */
|
|
2338
|
+
export declare type SceneClass = new (canvas: HTMLElement, cfg: Cfg, name: string, params?: Obj3DParams) => Objs3D;
|
|
2339
|
+
|
|
2340
|
+
/** Scene component class with optional initial parameters. */
|
|
2341
|
+
export declare type SceneEntry<TClass extends SceneClass = SceneClass> = TClass | {
|
|
2342
|
+
class: TClass;
|
|
2343
|
+
/**
|
|
2344
|
+
* Initial parameters assigned to a scene component class when the app starts. Accepts `Obj3DParams` or `Coll3DParams`, depending on the registered `class`. */
|
|
2345
|
+
params?: ConstructorParameters<TClass>[3];
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
/**
|
|
2349
|
+
* Maps a record of Scene Component classes or entries to a record of typed object instances.
|
|
2350
|
+
* `{ key1: typeof SceneComp1 } -> { key1: SceneComp1 }`
|
|
2351
|
+
* @hidden
|
|
2352
|
+
*/
|
|
2353
|
+
export declare type SceneInsts<T extends Record<string, SceneEntry>> = {
|
|
2354
|
+
[K in keyof T]: T[K] extends SceneClass ? InstanceType<T[K]> : T[K] extends {
|
|
2355
|
+
class: infer TClass extends SceneClass;
|
|
2356
|
+
} ? InstanceType<TClass> : never;
|
|
2357
|
+
};
|
|
2358
|
+
|
|
2359
|
+
/** @event Fired when the initial scene resources and component readiness hooks are complete. */
|
|
2565
2360
|
export declare interface SceneReadyEvent {
|
|
2566
|
-
/** Identifies this event type. */
|
|
2567
2361
|
type: 'Scene_Ready';
|
|
2568
2362
|
}
|
|
2569
2363
|
|
|
2570
|
-
/** @event Fired after the scene or a progressive
|
|
2364
|
+
/** @event Fired after the initial scene or a progressive model level is rendered for the first time. */
|
|
2571
2365
|
export declare interface SceneRenderedEvent {
|
|
2572
2366
|
/** Identifies the rendered scene or progressive scene variant. */
|
|
2573
2367
|
type: 'Scene_Rendered' | `Scene${number}_Rendered`;
|
|
2574
2368
|
}
|
|
2575
2369
|
|
|
2576
2370
|
/**
|
|
2577
|
-
*
|
|
2371
|
+
* Updates startup settings while preserving unspecified defaults. Nested settings are merged; supplied arrays replace existing arrays.
|
|
2372
|
+
* @param value - Configuration values that override the framework defaults.
|
|
2373
|
+
* @returns The configured `cfg` object.
|
|
2374
|
+
* @category Cfg
|
|
2375
|
+
*/
|
|
2376
|
+
export declare function setCfg(value: CfgSet): Cfg;
|
|
2377
|
+
|
|
2378
|
+
/**
|
|
2379
|
+
* Controls edge smoothing with SMAA.
|
|
2578
2380
|
* @category Cfg
|
|
2579
2381
|
*/
|
|
2580
2382
|
export declare interface SmaaCfg {
|
|
@@ -2607,29 +2409,12 @@ export declare type SoundParams = {
|
|
|
2607
2409
|
};
|
|
2608
2410
|
|
|
2609
2411
|
/**
|
|
2610
|
-
*
|
|
2412
|
+
* Controls contact shading with WebGL SSAO.
|
|
2611
2413
|
* @category Cfg
|
|
2612
2414
|
*/
|
|
2613
2415
|
export declare interface SsaoCfg {
|
|
2614
2416
|
/**
|
|
2615
|
-
*
|
|
2616
|
-
* @default false
|
|
2617
|
-
*/
|
|
2618
|
-
enable: boolean;
|
|
2619
|
-
/**
|
|
2620
|
-
* Whether the GUI SSAO dropdown is open.
|
|
2621
|
-
* @default false
|
|
2622
|
-
*/
|
|
2623
|
-
guiOpened: boolean;
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
/**
|
|
2627
|
-
* Defines the WebGL screen-space ambient occlusion settings.
|
|
2628
|
-
* @category Cfg
|
|
2629
|
-
*/
|
|
2630
|
-
export declare interface SsaoWebGlCfg {
|
|
2631
|
-
/**
|
|
2632
|
-
* Defines the radius of the ambient occlusion kernel.
|
|
2417
|
+
* Sampling radius for ambient occlusion.
|
|
2633
2418
|
* @default 8
|
|
2634
2419
|
*/
|
|
2635
2420
|
kernelRadius: number;
|
|
@@ -2645,58 +2430,58 @@ export declare interface SsaoWebGlCfg {
|
|
|
2645
2430
|
maxDistance: number;
|
|
2646
2431
|
}
|
|
2647
2432
|
|
|
2433
|
+
/** Controls ambient occlusion and indirect diffuse lighting with WebGPU SSGI. */
|
|
2434
|
+
export declare interface SsgiCfg {
|
|
2435
|
+
/** Whether the GUI SSGI dropdown is open. */
|
|
2436
|
+
guiOpened: boolean;
|
|
2437
|
+
/** Number of per-pixel hemisphere slices. */
|
|
2438
|
+
sliceCount: number;
|
|
2439
|
+
/** Number of samples taken along each side of a hemisphere slice. */
|
|
2440
|
+
stepCount: number;
|
|
2441
|
+
/** Strength of the ambient occlusion component. */
|
|
2442
|
+
aoIntensity: number;
|
|
2443
|
+
/** Strength of the indirect diffuse lighting component. */
|
|
2444
|
+
giIntensity: number;
|
|
2445
|
+
/** Effective sampling radius. */
|
|
2446
|
+
radius: number;
|
|
2447
|
+
/** Whether the sample distance is evaluated in screen space. */
|
|
2448
|
+
useScreenSpaceSampling: boolean;
|
|
2449
|
+
/** Exponent controlling sample distribution. */
|
|
2450
|
+
expFactor: number;
|
|
2451
|
+
/** Assumed thickness of screen-space geometry. */
|
|
2452
|
+
thickness: number;
|
|
2453
|
+
/** Whether thickness grows with distance. */
|
|
2454
|
+
useLinearThickness: boolean;
|
|
2455
|
+
/** Amount of lighting emitted by back-facing surfaces. */
|
|
2456
|
+
backfaceLighting: number;
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2648
2459
|
/**
|
|
2649
|
-
*
|
|
2460
|
+
* Shared screen-space lighting Inspector settings.
|
|
2650
2461
|
* @category Cfg
|
|
2651
2462
|
*/
|
|
2652
|
-
export declare interface
|
|
2653
|
-
/**
|
|
2654
|
-
* Defines the radius of the ambient occlusion in world space.
|
|
2655
|
-
* @default 0.25
|
|
2656
|
-
*/
|
|
2657
|
-
radius: number;
|
|
2463
|
+
export declare interface SslCfg {
|
|
2658
2464
|
/**
|
|
2659
|
-
*
|
|
2660
|
-
* @default
|
|
2661
|
-
*/
|
|
2662
|
-
thickness: number;
|
|
2663
|
-
/**
|
|
2664
|
-
* Controls how strongly the AO is attenuated over distance.
|
|
2665
|
-
* @default 1
|
|
2666
|
-
*/
|
|
2667
|
-
distanceExponent: number;
|
|
2668
|
-
/**
|
|
2669
|
-
* Defines how quickly the AO fades with distance.
|
|
2670
|
-
* @default 1
|
|
2671
|
-
*/
|
|
2672
|
-
distanceFallOff: number;
|
|
2673
|
-
/**
|
|
2674
|
-
* Scales the strength of the ambient occlusion.
|
|
2675
|
-
* @default 1
|
|
2676
|
-
*/
|
|
2677
|
-
scale: number;
|
|
2678
|
-
/**
|
|
2679
|
-
* Defines the number of samples used to compute the AO.
|
|
2680
|
-
* @default 16
|
|
2681
|
-
*/
|
|
2682
|
-
samples: number;
|
|
2683
|
-
/**
|
|
2684
|
-
* Defines the render resolution scale of the AO effect.
|
|
2685
|
-
* @default 1
|
|
2465
|
+
* Whether the GUI SSL dropdown is open.
|
|
2466
|
+
* @default false
|
|
2686
2467
|
*/
|
|
2687
|
-
|
|
2468
|
+
guiOpened: boolean;
|
|
2688
2469
|
}
|
|
2689
2470
|
|
|
2471
|
+
/** Screen-space lighting modes available across rendering backends. */
|
|
2472
|
+
export declare type SslMode = SslModeWebGl | SslModeWebGpu;
|
|
2473
|
+
|
|
2474
|
+
/** Screen-space lighting modes available with WebGL. */
|
|
2475
|
+
export declare type SslModeWebGl = 'none' | 'ssao';
|
|
2476
|
+
|
|
2477
|
+
/** Screen-space lighting modes available with WebGPU. */
|
|
2478
|
+
export declare type SslModeWebGpu = 'none' | 'gtao' | 'ssgi';
|
|
2479
|
+
|
|
2690
2480
|
/**
|
|
2691
|
-
*
|
|
2481
|
+
* Shared screen-space reflection parameters.
|
|
2692
2482
|
* @category Cfg
|
|
2693
2483
|
*/
|
|
2694
2484
|
export declare interface SsrCfg {
|
|
2695
|
-
/**
|
|
2696
|
-
* Imports the SSR module dynamically and enables the SSR effect.
|
|
2697
|
-
* @default false
|
|
2698
|
-
*/
|
|
2699
|
-
enable: boolean;
|
|
2700
2485
|
/**
|
|
2701
2486
|
* Whether the GUI SSR dropdown is open.
|
|
2702
2487
|
* @default false
|
|
@@ -2720,7 +2505,7 @@ export declare interface SsrCfg {
|
|
|
2720
2505
|
}
|
|
2721
2506
|
|
|
2722
2507
|
/**
|
|
2723
|
-
*
|
|
2508
|
+
* Tunes screen-space reflections with WebGL.
|
|
2724
2509
|
* @category Cfg
|
|
2725
2510
|
*/
|
|
2726
2511
|
export declare interface SsrWebGlCfg {
|
|
@@ -2735,7 +2520,7 @@ export declare interface SsrWebGlCfg {
|
|
|
2735
2520
|
*/
|
|
2736
2521
|
distanceAttenuation: boolean;
|
|
2737
2522
|
/**
|
|
2738
|
-
*
|
|
2523
|
+
* Strengthens reflections at grazing viewing angles using the Fresnel effect.
|
|
2739
2524
|
* @default true
|
|
2740
2525
|
*/
|
|
2741
2526
|
fresnel: boolean;
|
|
@@ -2777,7 +2562,7 @@ export declare interface SsrWebGlCfg {
|
|
|
2777
2562
|
}
|
|
2778
2563
|
|
|
2779
2564
|
/**
|
|
2780
|
-
*
|
|
2565
|
+
* Tunes screen-space reflections with WebGPU.
|
|
2781
2566
|
* @category Cfg
|
|
2782
2567
|
*/
|
|
2783
2568
|
export declare interface SsrWebGpuCfg {
|
|
@@ -2799,8 +2584,7 @@ export declare interface SsrWebGpuCfg {
|
|
|
2799
2584
|
}
|
|
2800
2585
|
|
|
2801
2586
|
/**
|
|
2802
|
-
*
|
|
2803
|
-
* and debug its runtime behavior.
|
|
2587
|
+
* Starts the application state machine and manages its XState actor.
|
|
2804
2588
|
* @category Core
|
|
2805
2589
|
*/
|
|
2806
2590
|
export declare class StateMachine {
|
|
@@ -2810,47 +2594,147 @@ export declare class StateMachine {
|
|
|
2810
2594
|
private lastState;
|
|
2811
2595
|
private snapshot;
|
|
2812
2596
|
private stateMachine;
|
|
2813
|
-
/* Excluded from this release type: __constructor */
|
|
2814
|
-
/* Excluded from this release type: sendEvent */
|
|
2815
2597
|
/**
|
|
2816
|
-
* Starts the
|
|
2598
|
+
* Starts the supplied state machine.
|
|
2817
2599
|
* @param stateMachine - A fully constructed XState 5 machine.
|
|
2818
2600
|
*
|
|
2819
2601
|
* **Example**
|
|
2820
|
-
* {@includeCode
|
|
2602
|
+
* {@includeCode ../../../apps-doc/examples/app-statemachine.ts}
|
|
2821
2603
|
|
|
2822
2604
|
*/
|
|
2823
2605
|
start(stateMachine: AnyStateMachine): void;
|
|
2824
2606
|
}
|
|
2825
2607
|
|
|
2826
2608
|
/**
|
|
2827
|
-
*
|
|
2609
|
+
* Controls state-machine inspection.
|
|
2828
2610
|
* @category Cfg
|
|
2829
2611
|
*/
|
|
2830
2612
|
export declare interface StateMachineCfg {
|
|
2831
2613
|
/**
|
|
2832
|
-
*
|
|
2614
|
+
* Enables the Stately Inspector to visualize states and transitions.
|
|
2833
2615
|
* @default false
|
|
2834
2616
|
*/
|
|
2835
2617
|
inspector: boolean;
|
|
2836
2618
|
}
|
|
2837
2619
|
|
|
2838
2620
|
/**
|
|
2839
|
-
*
|
|
2840
|
-
* - 'all'
|
|
2841
|
-
* - 'last'
|
|
2842
|
-
* - 'none'
|
|
2621
|
+
* Controls which active animations on the same layer stop before a new animation plays.
|
|
2622
|
+
* - `'all'`: Stops all previous active actions.
|
|
2623
|
+
* - `'last'`: Stops only the most recently played previous active action.
|
|
2624
|
+
* - `'none'`: Keeps all previous active actions running.
|
|
2843
2625
|
*/
|
|
2844
2626
|
export declare type StopMode = 'all' | 'last' | 'none';
|
|
2845
2627
|
|
|
2846
|
-
/**
|
|
2628
|
+
/** Removes the listener associated with an event subscription. */
|
|
2847
2629
|
export declare type Unsubscribe = () => void;
|
|
2848
2630
|
|
|
2631
|
+
/**
|
|
2632
|
+
* Connects a custom HTML element to the scene lifecycle and object visibility.
|
|
2633
|
+
* @category Web Components
|
|
2634
|
+
*/
|
|
2635
|
+
export declare class Web extends HTMLElement {
|
|
2636
|
+
/** Element that hosts the rendered canvas. */
|
|
2637
|
+
canvas: Readonly<HTMLElement>;
|
|
2638
|
+
cfg: Cfg;
|
|
2639
|
+
events: Readonly<Events>;
|
|
2640
|
+
objs3D: Map<string, Obj3D>;
|
|
2641
|
+
webs: Map<string, Web[]> | null;
|
|
2642
|
+
private obj3DFollow;
|
|
2643
|
+
private visible;
|
|
2644
|
+
private visibleFollow;
|
|
2645
|
+
private visibleOverlap;
|
|
2646
|
+
private webCtrls;
|
|
2647
|
+
private unSubFollow;
|
|
2648
|
+
private unSubVisible;
|
|
2649
|
+
private clearFollow;
|
|
2650
|
+
private emitEvent;
|
|
2651
|
+
/**
|
|
2652
|
+
* Makes this component follow an `Obj3D` by subscribing to updates of its screen position and combined visibility.
|
|
2653
|
+
*
|
|
2654
|
+
* @param params - The follow parameters.
|
|
2655
|
+
* @param params.obj - The `Obj3D` to follow in the scene.
|
|
2656
|
+
*/
|
|
2657
|
+
follow({ obj }: {
|
|
2658
|
+
obj: Obj3D | string;
|
|
2659
|
+
}): void;
|
|
2660
|
+
/**
|
|
2661
|
+
* Applies the combined followed-object and overlap visibility.
|
|
2662
|
+
* @param visible - Whether the web component is visible after combining all visibility conditions.
|
|
2663
|
+
*/
|
|
2664
|
+
protected onVisibilityChanged(visible: boolean): void;
|
|
2665
|
+
/**
|
|
2666
|
+
* Called once when the scene, renderer, and initial environment are ready and, if configured, the first model has been loaded and traversed.
|
|
2667
|
+
* @public
|
|
2668
|
+
*
|
|
2669
|
+
* **Example**
|
|
2670
|
+
* {@includeCode ../../../../apps-doc/examples/marker-onready.ts}
|
|
2671
|
+
*/
|
|
2672
|
+
protected onReady(): void;
|
|
2673
|
+
/**
|
|
2674
|
+
* Called once after the scene is initialized, before model loading begins.
|
|
2675
|
+
* @public
|
|
2676
|
+
*/
|
|
2677
|
+
protected onStart(): void;
|
|
2678
|
+
/**
|
|
2679
|
+
* Registers this component for screen-space overlap tracking using `cfg.comps.overlap.padding`.
|
|
2680
|
+
* Farther registered components are hidden when their screen-space rectangles overlap.
|
|
2681
|
+
*/
|
|
2682
|
+
trackOverlap(): void;
|
|
2683
|
+
/** Stops this component from following the currently subscribed {@link Obj3D}. */
|
|
2684
|
+
unfollow(): void;
|
|
2685
|
+
/** Stops screen-space overlap tracking and removes any overlap-based hiding from this component. */
|
|
2686
|
+
untrackOverlap(): void;
|
|
2687
|
+
private updateVisibility;
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
/** Web component classes available for registration. */
|
|
2691
|
+
export declare type WebClass = new () => Web;
|
|
2692
|
+
|
|
2693
|
+
/** Web component class with optional initial parameters. */
|
|
2694
|
+
export declare type WebEntry<TClass extends WebClass = WebClass> = TClass | {
|
|
2695
|
+
class: TClass;
|
|
2696
|
+
params?: WebParams;
|
|
2697
|
+
};
|
|
2698
|
+
|
|
2699
|
+
export declare type WebEvent = WebOverlapEvent | WebVisibleEvent;
|
|
2700
|
+
|
|
2701
|
+
/** @inheritDoc RenderCfg.webgpu.params */
|
|
2849
2702
|
export declare type WebGpuRendererParams = NonNullable<ConstructorParameters<typeof THREE_WEBGPU_TYPE.WebGPURenderer>[0]>;
|
|
2850
2703
|
|
|
2851
|
-
/**
|
|
2704
|
+
/**
|
|
2705
|
+
* Maps a record of Web Component classes or entries to a record of component instance arrays.
|
|
2706
|
+
* `{ key1: typeof Web1 } -> { key1: Web1[] }`
|
|
2707
|
+
* @hidden
|
|
2708
|
+
*/
|
|
2709
|
+
export declare type WebInsts<T extends Record<string, WebEntry>> = {
|
|
2710
|
+
[K in keyof T]: T[K] extends WebClass ? InstanceType<T[K]>[] : T[K] extends {
|
|
2711
|
+
class: infer TClass extends WebClass;
|
|
2712
|
+
} ? InstanceType<TClass>[] : never;
|
|
2713
|
+
};
|
|
2714
|
+
|
|
2715
|
+
/** @event Fired when a web component becomes overlapped or unobstructed. */
|
|
2716
|
+
export declare interface WebOverlapEvent {
|
|
2717
|
+
type: 'Web_Overlap_Changed';
|
|
2718
|
+
/** The affected web component. */
|
|
2719
|
+
web: Web;
|
|
2720
|
+
/** Whether the component is overlapped by a nearer component. */
|
|
2721
|
+
overlapped: boolean;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
/** Initial parameters assigned to a web component class when the app starts. */
|
|
2725
|
+
export declare type WebParams = Record<string, unknown>;
|
|
2726
|
+
|
|
2727
|
+
/** @event Fired when a web component's combined object and overlap visibility changes. */
|
|
2728
|
+
export declare interface WebVisibleEvent {
|
|
2729
|
+
type: 'Web_Visible_Changed';
|
|
2730
|
+
/** The affected web component. */
|
|
2731
|
+
web: Web;
|
|
2732
|
+
/** Whether the component is visible after combining all visibility conditions. */
|
|
2733
|
+
visible: boolean;
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
/** @event Fired when the window size changes. */
|
|
2852
2737
|
export declare interface WindowResizeEvent {
|
|
2853
|
-
/** Identifies this event type. */
|
|
2854
2738
|
type: 'Window_Resize';
|
|
2855
2739
|
}
|
|
2856
2740
|
|