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