illutions 0.31.0 → 0.33.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/dist/main.d.ts CHANGED
@@ -50,26 +50,24 @@ export declare interface AmbientlightCfg {
50
50
  intensity: number;
51
51
  }
52
52
 
53
- /** @event Fired when an object or material color animation starts or completes. */
53
+ /** @event Fired when an object or material color animation starts, completes, or is canceled. */
54
54
  export declare interface AnimEvent {
55
- type: 'Anim_Complete' | 'Anim_Start';
55
+ type: 'Anim_Complete' | 'Anim_Start' | 'Anim_Cancel';
56
56
  /** The name of the `THREE.Object3D` whose animation changed state. */
57
57
  objName: string;
58
58
  /** The name of the calling method. */
59
59
  fct: string;
60
60
  }
61
61
 
62
- /** @event Fired when a numeric material animation starts or completes. */
63
- export declare interface AnimFadeEvent {
64
- type: 'Anim_Fade_Complete' | 'Anim_Fade_Start';
65
- /** The name of the `THREE.Mesh` whose material fade changed state. */
66
- objName: string;
62
+ /** @event Fired when a material color or numeric property animation starts, completes, or is canceled. */
63
+ export declare interface AnimMaterialEvent {
64
+ type: 'Anim_Material_Complete' | 'Anim_Material_Start' | 'Anim_Material_Cancel';
65
+ /** The name of the material whose animation changed state. */
66
+ materialName: string;
67
67
  /** The name of the calling method. */
68
68
  fct: string;
69
- /** The material property being faded. */
70
- property: string;
71
- /** The target value used for the fade operation. */
72
- value: any;
69
+ /** Snapshot of all animated properties; colors are represented as hex strings. */
70
+ values: Record<string, number | string>;
73
71
  }
74
72
 
75
73
  /**
@@ -90,7 +88,6 @@ export declare class App<TComps extends Comps = {}> {
90
88
  readonly stateMachine: StateMachine;
91
89
  private readonly webCtrls;
92
90
  private cam3D;
93
- private readonly inspector;
94
91
  readonly comps: CompsInsts<TComps>;
95
92
  private objs3DMap;
96
93
  private websMap;
@@ -114,17 +111,18 @@ export declare class App<TComps extends Comps = {}> {
114
111
  */
115
112
  declare class Audio_2 {
116
113
  private readonly ctx;
114
+ private listener;
117
115
  private readonly loader;
118
- private readonly scene;
119
116
  private readonly events;
120
- private readonly loadedSounds;
121
117
  private readonly params;
122
- private listener;
118
+ private readonly scene;
119
+ private readonly sounds;
123
120
  private attachSoundTo;
121
+ private fadeSound;
124
122
  /**
125
- * Returns a snapshot of playback timing and positional audio settings.
123
+ * Returns the shared positional sound defaults.
126
124
  */
127
- get(): Partial<AudioCfg>;
125
+ get(): SoundParamsPos;
128
126
  /**
129
127
  * Checks whether a named sound is loaded.
130
128
  * @param params - Sound selection.
@@ -146,52 +144,84 @@ declare class Audio_2 {
146
144
  * Loads an audio file without playing it and sends an `Audio_Loaded` event when the sound is ready.
147
145
  * @param params - The sound options.
148
146
  */
149
- load({ name, url, object, volume, fade, loop }: SoundParams): void;
147
+ load(params: SoundParams): void;
150
148
  /**
151
149
  * Loads an audio file and plays it automatically when loading is complete.
152
150
  * Use this method when no separate `Audio_Loaded` handling is required.
153
151
  * @param params - The sound options.
152
+ * @param params.time - Fade-in duration for this start in seconds. Defaults to 0 (no fade).
153
+ * @param params.ease - GSAP easing for the fade-in. Defaults to linear ('none').
154
154
  */
155
- loadAndPlay({ name, url, object, volume, fade, loop }: SoundParams): void;
155
+ loadAndPlay({ time, ease, ...params }: {
156
+ time?: number;
157
+ ease?: string;
158
+ } & SoundParams): void;
156
159
  /**
157
- * Plays a loaded sound with a volume fade-in.
160
+ * Plays or resumes a loaded sound, optionally fading in from zero.
158
161
  * When using {@link load}, call this method after receiving the matching `Audio_Loaded` event.
159
162
  * This method does not wait for an audio file that is still loading.
160
163
  * @param params - Sound selection.
161
164
  * @param params.name - Loaded sound name.
165
+ * @param params.time - Fade-in duration in seconds. Defaults to 0 (no fade).
166
+ * @param params.ease - GSAP easing for the fade-in. Defaults to linear ('none').
167
+ */
168
+ play({ name, time, ease }: {
169
+ name: string;
170
+ time?: number;
171
+ ease?: string;
172
+ }): void;
173
+ /**
174
+ * Pauses a playing sound and keeps its position for the next play().
175
+ * @param params - Sound selection and optional fade-out settings.
176
+ * @param params.name - Sound name.
177
+ * @param params.time - Fade-out duration in seconds. Defaults to 0 (no fade).
178
+ * @param params.ease - GSAP easing for the fade-out. Defaults to linear ('none').
162
179
  */
163
- play({ name }: {
180
+ pause({ name, time, ease }: {
164
181
  name: string;
182
+ time?: number;
183
+ ease?: string;
165
184
  }): void;
166
185
  /**
167
186
  * Resumes the Web Audio context after a user gesture.
168
187
  */
169
188
  resume(): void;
170
- private setAttribute;
189
+ /**
190
+ * Updates shared positional defaults without replacing individual sound overrides.
191
+ * @param params - Positional defaults to update; omitted values remain unchanged.
192
+ */
193
+ set(params: Partial<SoundParamsPos>): void;
171
194
  private setAudioContext;
172
195
  /**
173
196
  * Attaches an audio listener to a scene object or camera. Set a listener before loading sounds.
174
197
  *
175
198
  * @param params - Listener target.
176
- * @param params.object - Scene object name or camera to attach the listener to.
199
+ * @param params.obj - Scene object name or camera to attach the listener to.
177
200
  */
178
- setListener({ object }: {
179
- object: string | Cam3D;
201
+ setListener({ obj }: {
202
+ obj: string | Cam3D;
180
203
  }): void;
181
- private setAllPositionalSoundsCfg;
182
- private setPositionalSoundCfg;
183
204
  /**
184
- * Updates one or more audio parameters at runtime.
185
- * @param params - Audio parameters to update.
205
+ * Updates the volume and positional overrides of a loaded sound immediately.
206
+ * Volume is stored during a fade without interrupting it.
207
+ * @param params - Sound name and settings to change; omitted settings remain unchanged.
186
208
  */
187
- set(params: Partial<AudioCfg>): void;
209
+ setSoundParams({ name, volume, ...positional }: {
210
+ name: string;
211
+ volume?: number;
212
+ } & Partial<SoundParamsPos>): void;
213
+ private setSoundParamsPos;
188
214
  /**
189
- * Fades out a playing sound and stops it.
215
+ * Stops a playing or paused sound and resets its position, optionally fading out.
190
216
  * @param params - Sound selection.
191
217
  * @param params.name - Sound name.
218
+ * @param params.time - Fade-out duration in seconds. Defaults to 0 (no fade).
219
+ * @param params.ease - GSAP easing for the fade-out. Defaults to linear ('none').
192
220
  */
193
- stop({ name }: {
221
+ stop({ name, time, ease }: {
194
222
  name: string;
223
+ time?: number;
224
+ ease?: string;
195
225
  }): void;
196
226
  /**
197
227
  * Runs an extension callback immediately with access to the public API.
@@ -205,7 +235,7 @@ export { Audio_2 as Audio }
205
235
  * Controls playback timing and how positional sound fades with distance.
206
236
  * @category Cfg
207
237
  */
208
- export declare interface AudioCfg {
238
+ export declare interface AudioCfg extends SoundParamsPos {
209
239
  /**
210
240
  * Whether audio support is initialized when the application starts.
211
241
  * @default false
@@ -220,48 +250,13 @@ export declare interface AudioCfg {
220
250
  * Delay in milliseconds before loading audio for automatic playback.
221
251
  * @default 200
222
252
  */
223
- delayPlaySound: number;
224
- /**
225
- * The reference distance after which the attenuation begins.
226
- * @default 1
227
- */
228
- refDistance: number;
229
- /**
230
- * Determines how quickly the volume falls off with distance.
231
- * @default 1
232
- */
233
- rolloffFactor: number;
234
- /**
235
- * Distance beyond which linear attenuation stops reducing volume.
236
- * @default 1000
237
- */
238
- maxDistance: number;
239
- /**
240
- * The distance attenuation model used.
241
- * @default 'inverse'
242
- */
243
- distanceModel: 'linear' | 'inverse' | 'exponential';
244
- /**
245
- * Inner cone angle in degrees, within which sound is not attenuated.
246
- * @default 360
247
- */
248
- coneInnerAngle: number;
249
- /**
250
- * Outer cone angle in degrees, beyond which `coneOuterGain` applies.
251
- * @default 360
252
- */
253
- coneOuterAngle: number;
254
- /**
255
- * The gain factor outside the cone.
256
- * @default 0
257
- */
258
- coneOuterGain: number;
253
+ delayLoadSound: number;
259
254
  }
260
255
 
261
- /** @event Fired when an audio file has finished loading and is ready for playback. */
262
- export declare interface AudioLoadedEvent {
263
- type: 'Audio_Loaded';
264
- /** The unique name assigned to the loaded sound. */
256
+ /** @event Fired when a sound finishes loading, starts playback, completes naturally, or is stopped. */
257
+ export declare interface AudioEvent {
258
+ type: 'Audio_Loaded' | 'Audio_Start' | 'Audio_Complete' | 'Audio_Stop';
259
+ /** The unique name assigned to the sound. */
265
260
  soundName: string;
266
261
  }
267
262
 
@@ -580,9 +575,8 @@ export declare class Engine {
580
575
  private rttNode;
581
576
  private traaWarmupContext;
582
577
  private ecoButtonActive;
583
- private gfxChanging;
584
- private gfxIndex;
585
- private gfxLevels;
578
+ private gfxLevelChanges;
579
+ private gfxLevel;
586
580
  private gfxMode;
587
581
  private readonly gfxPostProfiles;
588
582
  private gfxState;
@@ -791,7 +785,7 @@ export declare class Events {
791
785
  /**
792
786
  * Controls what happens after the final animation loop.
793
787
  * - `'hold'`: Keeps the action enabled and holds its final pose.
794
- * - `'fadeOut'`: Fades out over `fadeDurationFinish` seconds, or stops immediately when the duration is `0`.
788
+ * - `'fadeOut'`: Fades out over `fadeTimeFinish` seconds, or stops immediately when the duration is `0`.
795
789
  */
796
790
  export declare type FinishMode = 'hold' | 'fadeOut';
797
791
 
@@ -1247,30 +1241,21 @@ export declare class Mesh3D extends Obj3D {
1247
1241
  reflectivesSSR: THREE_TYPE.Object3D[];
1248
1242
  private model;
1249
1243
  /**
1250
- * Animates one or more color properties of this mesh's material.
1251
- * @param params - Animation parameters and target material color properties such as `color` or `emissive`.
1252
- * @param params.duration - Animation duration in seconds. Default: **0**
1253
- * @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
1254
- */
1255
- animMaterialColor(params: {
1256
- duration?: number;
1257
- ease?: string;
1258
- } & {
1259
- [key: string]: string | number | THREE_TYPE.Color;
1260
- }): void;
1261
- /**
1262
- * Animates the first numeric material property passed for this mesh.
1263
- * @param params - Animation parameters and the target numeric material property.
1264
- * @param params.startValue - Starting value. Defaults to the current material value.
1265
- * @param params.infinite - Whether the animation repeats indefinitely. Default: **false**
1266
- * @param params.duration - Animation duration in seconds. Default: **0**
1267
- * @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
1268
- * @param params.needsUpdate - Requests one material recompilation when the animation starts. Default: **false**
1244
+ * Animates all assigned materials of this mesh, optionally including descendant meshes.
1245
+ * @param params - Numeric and color targets with shared animation settings.
1246
+ * @param params.recursive - Includes descendant meshes. Default: **false**
1247
+ * @param params.infinite - Repeats each animation indefinitely. Default: **false**
1248
+ * @param params.time - Duration in seconds. Default: **0**
1249
+ * @param params.ease - GSAP easing function. Default: **'power1.inOut'**
1250
+ * @param params.needsUpdate - Recompiles materials when animation starts. Default: **false**
1251
+ *
1252
+ * @remarks
1253
+ * Tweens and animation events are managed per material.
1269
1254
  */
1270
- animMaterialNumeric({ needsUpdate, ...params }: {
1271
- startValue?: number | null;
1255
+ animMaterialsTo(params: {
1256
+ recursive?: boolean;
1272
1257
  infinite?: boolean;
1273
- duration?: number;
1258
+ time?: number;
1274
1259
  ease?: string;
1275
1260
  needsUpdate?: boolean;
1276
1261
  [key: string]: any;
@@ -1303,7 +1288,7 @@ export declare class Mesh3D extends Obj3D {
1303
1288
  * @param properties.recursive - Includes all descendant meshes when true. Default: **false**
1304
1289
  * @param properties.needsUpdate - Requests material recompilation after applying the properties. Default: **false**
1305
1290
  */
1306
- setMaterialProps({ recursive, needsUpdate, ...properties }: {
1291
+ setMaterialsProps({ recursive, needsUpdate, ...properties }: {
1307
1292
  recursive?: boolean;
1308
1293
  needsUpdate?: boolean;
1309
1294
  [key: string]: any;
@@ -1565,7 +1550,6 @@ export declare type Objs3D = Cam3D | Light3D | Mesh3D | Obj3D;
1565
1550
  */
1566
1551
  export declare class OrbitCtrls {
1567
1552
  private readonly cam3D;
1568
- private readonly canvas;
1569
1553
  private readonly engine;
1570
1554
  private readonly events;
1571
1555
  private readonly modules;
@@ -2070,129 +2054,178 @@ export declare class Scene {
2070
2054
  private readonly cam3D;
2071
2055
  private readonly events;
2072
2056
  private readonly objs3D;
2057
+ private readonly tweensObj;
2058
+ private readonly tweensMtrl;
2059
+ private readonly mtrls;
2060
+ /** The underlying Three.js scene. */
2061
+ readonly obj: THREE_TYPE.Scene;
2073
2062
  private ambientLight;
2074
2063
  private hemisphereLight;
2075
- readonly obj: THREE_TYPE.Scene;
2076
2064
  /**
2077
2065
  * Moves the camera along a curved path, optionally turning it toward a new target.
2078
2066
  * @param params - Camera movement settings.
2079
2067
  * @param params.camTarget - Destination position or object.
2080
2068
  * @param params.aimTarget - Position or object to look at while moving.
2081
2069
  * @param params.radiusOut - Outward curve radius. Default: **1**
2082
- * @param params.duration - Duration in seconds. Default: **2**
2070
+ * @param params.time - Duration in seconds. Default: **2**
2083
2071
  * @param params.ease - GSAP easing function. Default: **'power1.inOut'**
2084
2072
  *
2085
2073
  * @remarks
2086
2074
  * Emits {@link AnimEvent} when the animation starts and completes.
2087
2075
  */
2088
- animCamCurveTo({ camTarget, aimTarget, radiusOut, duration, ease }: {
2076
+ animCamCurveTo({ camTarget, aimTarget, radiusOut, time, ease }: {
2089
2077
  camTarget: THREE_TYPE.Vector3 | string | Obj3D;
2090
2078
  aimTarget?: THREE_TYPE.Vector3 | string | Obj3D;
2091
2079
  radiusOut?: number;
2092
- duration?: number;
2080
+ time?: number;
2093
2081
  ease?: string;
2094
2082
  }): void;
2095
2083
  /**
2096
2084
  * Moves a perspective camera to frame an object while looking at it. Only the object's own geometry is used; child objects are excluded.
2097
2085
  * @param params - Camera movement settings.
2098
2086
  * @param params.target - Object or scene object name to frame.
2099
- * @param params.duration - Duration in seconds. Default: **1**
2087
+ * @param params.time - Duration in seconds. Default: **1**
2100
2088
  * @param params.ease - GSAP easing function. Default: **'power2.inOut'**
2101
2089
  * @param params.dist - Multiplier for the calculated camera distance. Default: **1.25**
2102
2090
  *
2103
2091
  * @remarks
2104
2092
  * Emits {@link AnimEvent} when the animation starts and completes.
2105
2093
  */
2106
- animCamTo({ target, duration, ease, dist }: {
2094
+ animCamTo({ target, time, ease, dist }: {
2107
2095
  target: string | Obj3D;
2108
- duration?: number;
2096
+ time?: number;
2109
2097
  ease?: string;
2110
2098
  dist?: number;
2111
2099
  }): void;
2112
2100
  /**
2113
- * Animates one or more material colors on a mesh.
2114
- * @param params - Target colors, such as `color` or `emissive`, and animation settings.
2115
- * @param params.mesh - Scene mesh name or `Mesh3D` component.
2116
- * @param params.duration - Duration in seconds. Default: **0**
2101
+ * Animates numeric and color properties of a named material from their current values.
2102
+ * @param params - Target values and shared animation settings.
2103
+ * @param params.name - Material name.
2104
+ * @param params.infinite - Repeats the animation indefinitely. Default: **false**
2105
+ * @param params.time - Duration in seconds. Default: **0**
2117
2106
  * @param params.ease - GSAP easing function. Default: **'power1.inOut'**
2107
+ * @param params.needsUpdate - Recompiles the material when animation starts. Default: **false**
2118
2108
  *
2119
2109
  * @remarks
2120
- * Colors may be strings, numbers, or `THREE.Color` values. Emits {@link AnimFadeEvent} when the animation starts and completes.
2110
+ * Colors may be strings, numbers, or `THREE.Color` values. All properties share one tween.
2111
+ * Unknown materials, unknown easing functions, and empty property lists leave a running animation unchanged.
2112
+ * Property names and target values are the caller's responsibility. Only numeric and color properties are animated.
2113
+ * A new call cancels the entire previous animation of the same material.
2114
+ * Emits {@link AnimMaterialEvent} once on start, completion, or cancellation with all current values.
2121
2115
  */
2122
- animMaterialColor({ mesh, duration, ease, ...colorProps }: {
2123
- mesh: string | Mesh3D;
2124
- duration?: number;
2116
+ animMaterialTo({ name, infinite, time, ease, needsUpdate, ...props }: {
2117
+ name: string;
2118
+ infinite?: boolean;
2119
+ time?: number;
2125
2120
  ease?: string;
2126
- } & {
2127
- [key: string]: string | number | THREE_TYPE.Color | Mesh3D;
2121
+ needsUpdate?: boolean;
2122
+ [key: string]: any;
2128
2123
  }): void;
2129
2124
  /**
2130
- * Animates a numeric material property on a mesh. Only the first supplied property is animated.
2131
- * @param params - Target value and animation settings.
2132
- * @param params.mesh - Scene mesh name or `Mesh3D` component.
2133
- * @param params.startValue - Starting value. Defaults to the current material value.
2134
- * @param params.infinite - Repeats the animation indefinitely. Default: **false**
2135
- * @param params.duration - Duration in seconds. Default: **0**
2125
+ * Animates all assigned materials of an object, optionally including descendant meshes.
2126
+ * @param params - Target material values and shared animation settings.
2127
+ * @param params.obj - Scene object name or `Mesh3D` component.
2128
+ * @param params.recursive - Includes descendant meshes. Default: **false**
2129
+ * @param params.infinite - Repeats each animation indefinitely. Default: **false**
2130
+ * @param params.time - Duration in seconds. Default: **0**
2136
2131
  * @param params.ease - GSAP easing function. Default: **'power1.inOut'**
2137
- * @param params.needsUpdate - Recompiles the material when animation starts. Default: **false**
2132
+ * @param params.needsUpdate - Recompiles materials when animation starts. Default: **false**
2138
2133
  *
2139
2134
  * @remarks
2140
- * Emits {@link AnimFadeEvent} when the animation starts and completes.
2135
+ * Each shared material is animated once. Tweens and {@link AnimMaterialEvent} are managed per material.
2141
2136
  */
2142
- animMaterialNumeric({ mesh, needsUpdate, startValue, infinite, duration, ease, ...props }: {
2143
- mesh: string | Mesh3D;
2144
- startValue?: number | null;
2137
+ animMaterialsTo({ obj, recursive, ...params }: {
2138
+ obj: string | Mesh3D;
2139
+ recursive?: boolean;
2145
2140
  infinite?: boolean;
2146
- duration?: number;
2141
+ time?: number;
2147
2142
  ease?: string;
2148
2143
  needsUpdate?: boolean;
2149
2144
  [key: string]: any;
2150
2145
  }): void;
2151
- private calcEaseArea;
2146
+ /**
2147
+ * Animates selected local position, rotation, and scale components from their current values.
2148
+ * @param params - Target object and transformation settings.
2149
+ * @param params.obj - Scene object name or component, including cameras.
2150
+ * @param params.pos - Target local position; omitted axes remain unchanged.
2151
+ * @param params.rot - Target local Euler angles in degrees, using the object's Euler order.
2152
+ * @param params.scale - Target local scale; omitted axes remain unchanged.
2153
+ * @param params.time - Duration in seconds. Default: **1**. A value of 0 applies the values immediately.
2154
+ * @param params.ease - GSAP easing function. Default: **'power2.inOut'**
2155
+ *
2156
+ * @remarks
2157
+ * Rotation uses quaternion interpolation along the shortest path and does not support full turns.
2158
+ * Omitted rotation axes keep their current target angles, but may change during interpolation.
2159
+ * Cameras switch to free look mode. The caller coordinates other animations and controls.
2160
+ * A new call cancels the entire previous transformation of the same object.
2161
+ * Emits {@link AnimEvent}: `Anim_Start`, `Anim_Complete`, or `Anim_Cancel` when replaced.
2162
+ */
2163
+ animTransformTo({ obj, pos, rot, scale, time, ease }: {
2164
+ obj: string | Obj3D;
2165
+ pos?: {
2166
+ x?: number;
2167
+ y?: number;
2168
+ z?: number;
2169
+ };
2170
+ rot?: {
2171
+ x?: number;
2172
+ y?: number;
2173
+ z?: number;
2174
+ };
2175
+ scale?: {
2176
+ x?: number;
2177
+ y?: number;
2178
+ z?: number;
2179
+ };
2180
+ time?: number;
2181
+ ease?: string;
2182
+ }): void;
2183
+ private getMtrls;
2184
+ private getObjectName;
2152
2185
  /**
2153
2186
  * Plays a named animation clip with blending, looping, and speed control.
2154
2187
  *
2155
2188
  * @param params - Parameters for controlling the animation playback.
2156
2189
  * @param params.layer - The freely named layer used to group animation actions.
2157
2190
  * @param params.clip - The name of the animation clip to play.
2158
- * @param params.blendMode - How the action is blended with other active actions. Default: **'normal'**
2159
- * @param params.finishMode - Whether the final pose is held or faded out after the final loop. Default: **'hold'**
2160
- * @param params.loopMode - Number of plays or `'infinite'` for endless looping. Default: **1**
2161
- * @param params.stopMode - Which previous actions of the same layer are stopped before playback. Default: **'all'**
2162
- * @param params.fadeDuration - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
2163
- * @param params.fadeDurationFinish - Duration in seconds for `finishMode: 'fadeOut'`. Default: **0**
2191
+ * @param params.modeBlend - How the action is blended with other active actions. Default: **'normal'**
2192
+ * @param params.modeFinish - Whether the final pose is held or faded out after the final loop. Default: **'hold'**
2193
+ * @param params.modeLoop - Number of plays or `'infinite'` for endless looping. Default: **1**
2194
+ * @param params.modeStop - Which previous actions of the same layer are stopped before playback. Default: **'all'**
2195
+ * @param params.fadeTime - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
2196
+ * @param params.fadeTimeFinish - Duration in seconds for `modeFinish: 'fadeOut'`. Default: **0**
2164
2197
  * @param params.reverse - If `true`, plays the clip in reverse. Default: **false**
2165
2198
  * @param params.reset - If `true`, resets the clip before a new playback. Default: **false**
2166
- * @param params.startSpeed - Initial playback speed for speed interpolation. Default: **0**
2167
- * @param params.endSpeed - Target playback speed. Default: **1**
2168
- * @param params.duration - Duration in seconds for speed interpolation. Default: **0**
2169
- * @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
2199
+ * @param params.speedStart - Initial playback speed for speed interpolation. Default: **0**
2200
+ * @param params.speedEnd - Target playback speed. Default: **1**
2201
+ * @param params.speedTime - Duration in seconds for speed interpolation. Default: **0**
2202
+ * @param params.speedEase - GSAP easing function name. Default: **'power1.inOut'**
2170
2203
  *
2171
2204
  * @remarks
2172
2205
  * Playing an active or fading-in action again updates its speed without restarting it. Finished or stopped actions restart; fading-out actions resume from their current time and weight.
2173
2206
  *
2174
- * `finishMode` and `fadeDurationFinish` have no effect when `loopMode` is `'infinite'`.
2207
+ * `modeFinish` and `fadeTimeFinish` have no effect when `modeLoop` is `'infinite'`.
2175
2208
  *
2176
2209
  * **Events**
2177
2210
  *
2178
2211
  * {@link ClipEvent}
2179
2212
  */
2180
- playClip({ layer, clip: clipName, blendMode, finishMode, loopMode, stopMode, fadeDuration, fadeDurationFinish, reverse, reset, startSpeed, endSpeed, duration, ease }: {
2213
+ playClip({ layer, clip: clipName, modeBlend, modeFinish, modeLoop, modeStop, fadeTime, fadeTimeFinish, reverse, reset, speedStart, speedEnd, speedTime, speedEase }: {
2181
2214
  layer: string;
2182
2215
  clip: string;
2183
2216
  singleAction?: boolean;
2184
- blendMode?: BlendMode;
2185
- finishMode?: FinishMode;
2186
- loopMode?: LoopMode;
2187
- stopMode?: StopMode;
2188
- fadeDuration?: number;
2189
- fadeDurationFinish?: number;
2217
+ modeBlend?: BlendMode;
2218
+ modeFinish?: FinishMode;
2219
+ modeLoop?: LoopMode;
2220
+ modeStop?: StopMode;
2221
+ fadeTime?: number;
2222
+ fadeTimeFinish?: number;
2190
2223
  reverse?: boolean;
2191
2224
  reset?: boolean;
2192
- startSpeed?: number;
2193
- endSpeed?: number;
2194
- duration?: number;
2195
- ease?: string;
2225
+ speedStart?: number;
2226
+ speedEnd?: number;
2227
+ speedTime?: number;
2228
+ speedEase?: string;
2196
2229
  }): void;
2197
2230
  /**
2198
2231
  * Plays a named camera animation clip with blending, looping, and speed control.
@@ -2200,16 +2233,16 @@ export declare class Scene {
2200
2233
  * @param params - Parameters for controlling the camera animation playback.
2201
2234
  * @param params.layer - The freely named layer used to group camera animation actions.
2202
2235
  * @param params.clip - The name of the camera animation clip to play.
2203
- * @param params.blendMode - How the action is blended with other active actions. Default: **'normal'**
2204
- * @param params.loopMode - Number of plays or `'infinite'` for endless looping. Default: **1**
2205
- * @param params.stopMode - Which previous actions of the same layer are stopped before playback. Default: **'all'**
2206
- * @param params.fadeDuration - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
2236
+ * @param params.modeBlend - How the action is blended with other active actions. Default: **'normal'**
2237
+ * @param params.modeLoop - Number of plays or `'infinite'` for endless looping. Default: **1**
2238
+ * @param params.modeStop - Which previous actions of the same layer are stopped before playback. Default: **'all'**
2239
+ * @param params.fadeTime - Duration in seconds for fading affected previous actions out and the new action in. Default: **0**
2207
2240
  * @param params.reverse - If `true`, plays the clip in reverse. Default: **false**
2208
2241
  * @param params.reset - If `true`, resets the clip before a new playback. Default: **false**
2209
- * @param params.startSpeed - Initial playback speed for speed interpolation. Default: **0**
2210
- * @param params.endSpeed - Target playback speed. Default: **1**
2211
- * @param params.duration - Duration in seconds for speed interpolation. Default: **0**
2212
- * @param params.ease - GSAP easing function name. Default: **'power1.inOut'**
2242
+ * @param params.speedStart - Initial playback speed for speed interpolation. Default: **0**
2243
+ * @param params.speedEnd - Target playback speed. Default: **1**
2244
+ * @param params.speedTime - Duration in seconds for speed interpolation. Default: **0**
2245
+ * @param params.speedEase - GSAP easing function name. Default: **'power1.inOut'**
2213
2246
  *
2214
2247
  * @remarks
2215
2248
  * 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.
@@ -2218,19 +2251,19 @@ export declare class Scene {
2218
2251
  *
2219
2252
  * {@link ClipEvent}
2220
2253
  */
2221
- playClipCam({ layer, clip: clipName, blendMode, loopMode, stopMode, fadeDuration, reverse, reset, startSpeed, endSpeed, duration, ease }: {
2254
+ playClipCam({ layer, clip: clipName, modeBlend, modeLoop, modeStop, fadeTime, reverse, reset, speedStart, speedEnd, speedTime, speedEase }: {
2222
2255
  layer: string;
2223
2256
  clip: string;
2224
- blendMode?: BlendMode;
2225
- loopMode?: LoopMode;
2226
- stopMode?: StopMode;
2227
- fadeDuration?: number;
2257
+ modeBlend?: BlendMode;
2258
+ modeLoop?: LoopMode;
2259
+ modeStop?: StopMode;
2260
+ fadeTime?: number;
2228
2261
  reverse?: boolean;
2229
2262
  reset?: boolean;
2230
- startSpeed?: number;
2231
- endSpeed?: number;
2232
- duration?: number;
2233
- ease?: string;
2263
+ speedStart?: number;
2264
+ speedEnd?: number;
2265
+ speedTime?: number;
2266
+ speedEase?: string;
2234
2267
  }): void;
2235
2268
  /**
2236
2269
  * Removes the built-in ambient light and releases its resources.
@@ -2279,16 +2312,30 @@ export declare class Scene {
2279
2312
  intensity?: number;
2280
2313
  }): void;
2281
2314
  /**
2282
- * Updates all material slots on a mesh, optionally including its descendants. Shared materials also affect other objects that use them.
2315
+ * Updates properties of a named material. Shared materials also affect other objects that use them.
2316
+ * @param params - Target material values, such as `color`, `roughness`, or `map`.
2317
+ * @param params.name - Material name.
2318
+ * @param params.needsUpdate - Recompiles the material after applying the values. Default: **false**
2319
+ *
2320
+ * @remarks
2321
+ * Texture paths for `map` and `emissiveMap` load asynchronously. Property names and values are the caller's responsibility.
2322
+ */
2323
+ setMaterialProps({ name, needsUpdate, ...props }: {
2324
+ name: string;
2325
+ needsUpdate?: boolean;
2326
+ [key: string]: any;
2327
+ }): void;
2328
+ /**
2329
+ * Updates all assigned materials of an object, optionally including descendant meshes.
2283
2330
  * @param params - Target material values, such as `color`, `roughness`, or `map`.
2284
2331
  * @param params.obj - Scene object name or `Mesh3D` component.
2285
2332
  * @param params.recursive - Includes descendant meshes. Default: **false**
2286
2333
  * @param params.needsUpdate - Recompiles materials after applying the values. Default: **false**
2287
2334
  *
2288
2335
  * @remarks
2289
- * Texture paths for `map` and `emissiveMap` load asynchronously. Unsupported values are skipped with a warning.
2336
+ * Each shared material is updated once. Texture paths for `map` and `emissiveMap` load asynchronously.
2290
2337
  */
2291
- setMaterialProps({ obj, recursive, needsUpdate, ...props }: {
2338
+ setMaterialsProps({ obj, recursive, ...props }: {
2292
2339
  obj: string | Mesh3D;
2293
2340
  recursive?: boolean;
2294
2341
  needsUpdate?: boolean;
@@ -2298,16 +2345,16 @@ export declare class Scene {
2298
2345
  * Stops a named animation clip, optionally slowing it to a halt first.
2299
2346
  * @param params - Stop settings.
2300
2347
  * @param params.clipName - Animation clip name.
2301
- * @param params.fadeOut - Slowdown duration in seconds. Default: **0**
2302
- * @param params.ease - GSAP easing function for the slowdown. Default: **'power1.inOut'**
2348
+ * @param params.speedTime - Slowdown duration in seconds. Default: **0**
2349
+ * @param params.speedEase - GSAP easing function for the slowdown. Default: **'power1.inOut'**
2303
2350
  *
2304
2351
  * @remarks
2305
2352
  * A slowdown emits `Clip_Speed_Start` and `Clip_Speed_Complete`, followed by `Clip_Cancel`. A duration of `0` cancels immediately. See {@link ClipEvent}.
2306
2353
  */
2307
- stopAnimClip({ clipName, fadeOut, ease }: {
2354
+ stopClip({ clipName, speedTime, speedEase }: {
2308
2355
  clipName: string;
2309
- fadeOut?: number;
2310
- ease?: string;
2356
+ speedTime?: number;
2357
+ speedEase?: string;
2311
2358
  }): void;
2312
2359
  }
2313
2360
 
@@ -2392,21 +2439,76 @@ export declare interface SmaaCfg {
2392
2439
  guiOpened: boolean;
2393
2440
  }
2394
2441
 
2395
- /** Parameters used to load a global or positional audio source. */
2396
- export declare type SoundParams = {
2397
- /** Unique name used to identify the audio source. */
2442
+ /**
2443
+ * Parameters used to load a global or positional audio source.
2444
+ * @category Cfg
2445
+ */
2446
+ export declare interface SoundParams extends Partial<SoundParamsPos> {
2447
+ /**
2448
+ * Whether playback should loop.
2449
+ * @default true
2450
+ */
2451
+ loop?: boolean;
2452
+ /**
2453
+ * Unique name used to identify the audio source.
2454
+ */
2398
2455
  name: string;
2399
- /** Path or URL to the audio file. */
2456
+ /**
2457
+ * Scene object name or Obj3D component for positional audio. Use an empty string for global audio.
2458
+ */
2459
+ obj: string | Obj3D;
2460
+ /**
2461
+ * Path or URL to the audio file.
2462
+ */
2400
2463
  url: string;
2401
- /** Name of the scene object for positional audio. Use an empty string for global audio. */
2402
- object: string;
2403
- /** Target playback volume. Default: `0`. */
2464
+ /**
2465
+ * Target playback volume.
2466
+ * @default 0
2467
+ */
2404
2468
  volume?: number;
2405
- /** Fade-in duration in seconds. Default: `2`. */
2406
- fade?: number;
2407
- /** Whether playback should loop. Default: `true`. */
2408
- loop?: boolean;
2409
- };
2469
+ }
2470
+
2471
+ /**
2472
+ * Controls distance attenuation and directional cones for positional sounds.
2473
+ * @category Cfg
2474
+ */
2475
+ export declare interface SoundParamsPos {
2476
+ /**
2477
+ * The reference distance after which the attenuation begins.
2478
+ * @default 1
2479
+ */
2480
+ refDistance: number;
2481
+ /**
2482
+ * Determines how quickly the volume falls off with distance.
2483
+ * @default 1
2484
+ */
2485
+ rolloffFactor: number;
2486
+ /**
2487
+ * Distance beyond which linear attenuation stops reducing volume.
2488
+ * @default 1000
2489
+ */
2490
+ maxDistance: number;
2491
+ /**
2492
+ * The distance attenuation model used.
2493
+ * @default 'inverse'
2494
+ */
2495
+ distanceModel: 'linear' | 'inverse' | 'exponential';
2496
+ /**
2497
+ * Inner cone angle in degrees, within which sound is not attenuated.
2498
+ * @default 360
2499
+ */
2500
+ coneInnerAngle: number;
2501
+ /**
2502
+ * Outer cone angle in degrees, beyond which `coneOuterGain` applies.
2503
+ * @default 360
2504
+ */
2505
+ coneOuterAngle: number;
2506
+ /**
2507
+ * The gain factor outside the cone.
2508
+ * @default 0
2509
+ */
2510
+ coneOuterGain: number;
2511
+ }
2410
2512
 
2411
2513
  /**
2412
2514
  * Controls contact shading with WebGL SSAO.