@needle-tools/engine 5.1.0-alpha.4 → 5.1.0-alpha.5
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 +29 -0
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-B7cqsI4c.js → needle-engine.bundle-C-LG00ZZ.js} +6570 -6271
- package/dist/{needle-engine.bundle-AjVIot3d.min.js → needle-engine.bundle-D7tzaiYE.min.js} +157 -157
- package/dist/{needle-engine.bundle-DQCuBTVp.umd.cjs → needle-engine.bundle-OPkPmdUM.umd.cjs} +140 -140
- package/dist/needle-engine.d.ts +668 -191
- package/dist/needle-engine.js +597 -595
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/three.js +1 -0
- package/dist/three.min.js +21 -21
- package/dist/three.umd.cjs +16 -16
- package/lib/engine/api.d.ts +2 -0
- package/lib/engine/api.js +2 -0
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/codegen/register_types.js +10 -10
- package/lib/engine/codegen/register_types.js.map +1 -1
- package/lib/engine/engine_camera.fit.js +16 -4
- package/lib/engine/engine_camera.fit.js.map +1 -1
- package/lib/engine/engine_context.d.ts +20 -7
- package/lib/engine/engine_context.js +29 -14
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_context_eventbus.d.ts +47 -0
- package/lib/engine/engine_context_eventbus.js +47 -0
- package/lib/engine/engine_context_eventbus.js.map +1 -0
- package/lib/engine/engine_input.d.ts +23 -4
- package/lib/engine/engine_input.js +2 -1
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_physics_rapier.d.ts +10 -0
- package/lib/engine/engine_physics_rapier.js +6 -0
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_types.d.ts +10 -0
- package/lib/engine-components/AnimationBuilder.d.ts +158 -0
- package/lib/engine-components/AnimationBuilder.js +305 -0
- package/lib/engine-components/AnimationBuilder.js.map +1 -0
- package/lib/engine-components/Animator.js +6 -1
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AnimatorController.builder.d.ts +101 -23
- package/lib/engine-components/AnimatorController.builder.js +88 -20
- package/lib/engine-components/AnimatorController.builder.js.map +1 -1
- package/lib/engine-components/AnimatorController.js +2 -0
- package/lib/engine-components/AnimatorController.js.map +1 -1
- package/lib/engine-components/ContactShadows.d.ts +1 -0
- package/lib/engine-components/ContactShadows.js +14 -1
- package/lib/engine-components/ContactShadows.js.map +1 -1
- package/lib/engine-components/DropListener.js +3 -0
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +0 -2
- package/lib/engine-components/OrbitControls.js +14 -1
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js +3 -0
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/api.d.ts +1 -0
- package/lib/engine-components/api.js +1 -0
- package/lib/engine-components/api.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +6 -6
- package/lib/engine-components/codegen/components.js +6 -6
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.utils.d.ts +1 -1
- package/lib/engine-components/timeline/PlayableDirector.d.ts +7 -7
- package/lib/engine-components/timeline/PlayableDirector.js +6 -6
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/timeline/TimelineBuilder.d.ts +175 -9
- package/lib/engine-components/timeline/TimelineBuilder.js +108 -2
- package/lib/engine-components/timeline/TimelineBuilder.js.map +1 -1
- package/lib/engine-components/timeline/TimelineTracks.d.ts +15 -7
- package/lib/engine-components/timeline/TimelineTracks.js +22 -14
- package/lib/engine-components/timeline/TimelineTracks.js.map +1 -1
- package/lib/engine-components/web/CursorFollow.d.ts +0 -1
- package/lib/engine-components/web/CursorFollow.js +0 -1
- package/lib/engine-components/web/CursorFollow.js.map +1 -1
- package/package.json +1 -1
- package/plugins/common/cloud.js +6 -1
- package/plugins/vite/license.js +19 -1
- package/src/engine/api.ts +3 -0
- package/src/engine/codegen/register_types.ts +10 -10
- package/src/engine/engine_camera.fit.ts +15 -4
- package/src/engine/engine_context.ts +30 -15
- package/src/engine/engine_context_eventbus.ts +73 -0
- package/src/engine/engine_input.ts +27 -6
- package/src/engine/engine_physics_rapier.ts +20 -6
- package/src/engine/engine_types.ts +22 -12
- package/src/engine-components/AnimationBuilder.ts +472 -0
- package/src/engine-components/Animator.ts +6 -1
- package/src/engine-components/AnimatorController.builder.ts +163 -37
- package/src/engine-components/AnimatorController.ts +1 -0
- package/src/engine-components/ContactShadows.ts +15 -1
- package/src/engine-components/DropListener.ts +3 -0
- package/src/engine-components/OrbitControls.ts +16 -5
- package/src/engine-components/SceneSwitcher.ts +3 -0
- package/src/engine-components/api.ts +1 -0
- package/src/engine-components/codegen/components.ts +6 -6
- package/src/engine-components/timeline/PlayableDirector.ts +20 -20
- package/src/engine-components/timeline/TimelineBuilder.ts +277 -17
- package/src/engine-components/timeline/TimelineTracks.ts +24 -16
- package/src/engine-components/web/CursorFollow.ts +0 -1
package/dist/needle-engine.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { Intersection } from 'three';
|
|
|
46
46
|
import { IParticleSystem as IParticleSystem_2 } from 'three.quarks';
|
|
47
47
|
import { KeyframeTrack } from 'three';
|
|
48
48
|
import { Layers } from 'three';
|
|
49
|
+
import { Light as Light_2 } from 'three';
|
|
49
50
|
import { LightProbe } from 'three';
|
|
50
51
|
import { Line2 } from '../../../../node_modules/@types/three/examples/jsm/lines/Line2.js';
|
|
51
52
|
import { Loader } from 'three';
|
|
@@ -269,8 +270,15 @@ export declare type ActivationClipOptions = {
|
|
|
269
270
|
easeOut?: number;
|
|
270
271
|
};
|
|
271
272
|
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
/**
|
|
274
|
+
* Builder for activation tracks. Provides `.clip()` for defining activation windows.
|
|
275
|
+
* @category Animation and Sequencing
|
|
276
|
+
*/
|
|
277
|
+
export declare interface ActivationTrackBuilder extends TimelineBuilderBase {
|
|
278
|
+
/** Adds an activation clip that shows/hides the bound object */
|
|
279
|
+
clip(options: ActivationClipOptions): ActivationTrackBuilder;
|
|
280
|
+
/** Mutes this track so it is skipped during playback */
|
|
281
|
+
muted(muted?: boolean): ActivationTrackBuilder;
|
|
274
282
|
}
|
|
275
283
|
|
|
276
284
|
export declare const activeInHierarchyFieldName = "needle_isActiveInHierarchy";
|
|
@@ -506,6 +514,62 @@ declare class Animation_2 extends Component implements IAnimationComponent {
|
|
|
506
514
|
}
|
|
507
515
|
export { Animation_2 as Animation }
|
|
508
516
|
|
|
517
|
+
/**
|
|
518
|
+
* A fluent builder for creating `AnimationClip` instances from code.
|
|
519
|
+
*
|
|
520
|
+
* Use {@link AnimationBuilder.create} to start a new builder, chain `.track()` calls
|
|
521
|
+
* to add animation tracks, and call `.build()` to produce the clip.
|
|
522
|
+
*
|
|
523
|
+
* @example Single track
|
|
524
|
+
* ```ts
|
|
525
|
+
* const clip = AnimationBuilder.create()
|
|
526
|
+
* .track(door, "position", { from: [0,0,0], to: [2,0,0], duration: 1 })
|
|
527
|
+
* .build();
|
|
528
|
+
* ```
|
|
529
|
+
*
|
|
530
|
+
* @example Multiple tracks
|
|
531
|
+
* ```ts
|
|
532
|
+
* const clip = AnimationBuilder.create("DoorOpen")
|
|
533
|
+
* .track(door, "position", { from: [0,0,0], to: [2,0,0], duration: 1 })
|
|
534
|
+
* .track(light, "intensity", { from: 0, to: 5, duration: 1 })
|
|
535
|
+
* .build(room);
|
|
536
|
+
* ```
|
|
537
|
+
*
|
|
538
|
+
* @category Animation and Sequencing
|
|
539
|
+
* @group Utilities
|
|
540
|
+
*/
|
|
541
|
+
export declare class AnimationBuilder {
|
|
542
|
+
private _name?;
|
|
543
|
+
private _tracks;
|
|
544
|
+
/** Creates a new AnimationBuilder instance */
|
|
545
|
+
static create(name?: string): AnimationBuilder;
|
|
546
|
+
constructor(name?: string);
|
|
547
|
+
/** Adds an animation track for an Object3D's position or scale */
|
|
548
|
+
track(target: Object3D, property: "position" | "scale", keyframes: KF_2<Vec3Value>, options?: TrackOptions): this;
|
|
549
|
+
/** Adds an animation track for an Object3D's quaternion */
|
|
550
|
+
track(target: Object3D, property: "quaternion", keyframes: KF_2<QuatValue>, options?: TrackOptions): this;
|
|
551
|
+
/** Adds an animation track for an Object3D's rotation (Euler, converted to quaternion) */
|
|
552
|
+
track(target: Object3D, property: "rotation", keyframes: KF_2<EulerValue>, options?: TrackOptions): this;
|
|
553
|
+
/** Adds an animation track for an Object3D's visibility */
|
|
554
|
+
track(target: Object3D, property: "visible", keyframes: KF_2<boolean>, options?: TrackOptions): this;
|
|
555
|
+
/** Adds an animation track for a material's numeric property */
|
|
556
|
+
track(target: Material, property: "opacity" | "roughness" | "metalness" | "alphaTest" | "emissiveIntensity" | "envMapIntensity" | "bumpScale" | "displacementScale" | "displacementBias", keyframes: KF_2<number>, options?: TrackOptions): this;
|
|
557
|
+
/** Adds an animation track for a material's color property */
|
|
558
|
+
track(target: Material, property: "color" | "emissive", keyframes: KF_2<ColorValue>, options?: TrackOptions): this;
|
|
559
|
+
/** Adds an animation track for a light's numeric property */
|
|
560
|
+
track(target: Light_2, property: "intensity" | "distance" | "angle" | "penumbra" | "decay", keyframes: KF_2<number>, options?: TrackOptions): this;
|
|
561
|
+
/** Adds an animation track for a light's color */
|
|
562
|
+
track(target: Light_2, property: "color", keyframes: KF_2<ColorValue>, options?: TrackOptions): this;
|
|
563
|
+
/** Adds an animation track for a camera's numeric property */
|
|
564
|
+
track(target: PerspectiveCamera, property: "fov" | "near" | "far" | "zoom", keyframes: KF_2<number>, options?: TrackOptions): this;
|
|
565
|
+
/**
|
|
566
|
+
* Builds and returns the `AnimationClip`.
|
|
567
|
+
* @param root - Optional root Object3D for resolving track paths.
|
|
568
|
+
* When provided, tracks targeting a different object use `target.name` for named resolution.
|
|
569
|
+
*/
|
|
570
|
+
build(root?: Object3D): AnimationClip;
|
|
571
|
+
}
|
|
572
|
+
|
|
509
573
|
/**
|
|
510
574
|
* @category Animation and Sequencing
|
|
511
575
|
* @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
|
|
@@ -624,6 +688,19 @@ export declare class AnimationExtension implements IUSDExporterExtension {
|
|
|
624
688
|
|
|
625
689
|
declare type AnimationIdentifier = AnimationClip | number | string | undefined;
|
|
626
690
|
|
|
691
|
+
/** User-friendly interpolation mode names */
|
|
692
|
+
export declare type AnimationInterpolation = "linear" | "smooth" | "step";
|
|
693
|
+
|
|
694
|
+
/** A single keyframe: a time and a value */
|
|
695
|
+
export declare type AnimationKeyframe<V> = {
|
|
696
|
+
/** Time in seconds */
|
|
697
|
+
time: number;
|
|
698
|
+
/** The value at this time */
|
|
699
|
+
value: V;
|
|
700
|
+
/** Interpolation mode for this track (default: `"linear"`). Note: Three.js applies one mode per track; the first keyframe's mode is used. */
|
|
701
|
+
interpolation?: AnimationInterpolation;
|
|
702
|
+
};
|
|
703
|
+
|
|
627
704
|
/**
|
|
628
705
|
* Registry for animation related data. Use {@link registerAnimationMixer} to register an animation mixer instance.
|
|
629
706
|
* Can be accessed from {@link Context.animations} and is used internally e.g. when exporting GLTF files.
|
|
@@ -644,43 +721,39 @@ declare class AnimationsRegistry {
|
|
|
644
721
|
unregisterAnimationMixer(mixer: AnimationMixer | null | undefined): void;
|
|
645
722
|
}
|
|
646
723
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
private _clipRotQuat;
|
|
681
|
-
evaluate(time: number): void;
|
|
682
|
-
private createRotationInterpolant;
|
|
683
|
-
private createPositionInterpolant;
|
|
724
|
+
/**
|
|
725
|
+
* Builder for animation tracks.
|
|
726
|
+
* Provides `.clip()` for pre-built AnimationClips and `.track()` for inline animation definition.
|
|
727
|
+
*
|
|
728
|
+
* @category Animation and Sequencing
|
|
729
|
+
*/
|
|
730
|
+
export declare interface AnimationTrackBuilder extends TimelineBuilderBase {
|
|
731
|
+
/** Adds a pre-built AnimationClip */
|
|
732
|
+
clip(asset: AnimationClip, options?: AnimationClipOptions): AnimationTrackBuilder;
|
|
733
|
+
/** Adds a clip from a single {@link TrackDescriptor} */
|
|
734
|
+
clip(descriptor: TrackDescriptor, options?: AnimationClipOptions): AnimationTrackBuilder;
|
|
735
|
+
/** Adds a clip from multiple {@link TrackDescriptor}s */
|
|
736
|
+
clip(descriptors: TrackDescriptor[], options?: AnimationClipOptions): AnimationTrackBuilder;
|
|
737
|
+
/** Adds an animation track for an Object3D's position or scale */
|
|
738
|
+
track(target: Object3D, property: "position" | "scale", keyframes: KF_3<Vec3Value>, options?: TrackOptions): AnimationTrackBuilder;
|
|
739
|
+
/** Adds an animation track for an Object3D's quaternion */
|
|
740
|
+
track(target: Object3D, property: "quaternion", keyframes: KF_3<QuatValue>, options?: TrackOptions): AnimationTrackBuilder;
|
|
741
|
+
/** Adds an animation track for an Object3D's rotation (Euler, converted to quaternion) */
|
|
742
|
+
track(target: Object3D, property: "rotation", keyframes: KF_3<EulerValue>, options?: TrackOptions): AnimationTrackBuilder;
|
|
743
|
+
/** Adds an animation track for an Object3D's visibility */
|
|
744
|
+
track(target: Object3D, property: "visible", keyframes: KF_3<boolean>, options?: TrackOptions): AnimationTrackBuilder;
|
|
745
|
+
/** Adds an animation track for a material's numeric property */
|
|
746
|
+
track(target: Material, property: "opacity" | "roughness" | "metalness" | "alphaTest" | "emissiveIntensity" | "envMapIntensity" | "bumpScale" | "displacementScale" | "displacementBias", keyframes: KF_3<number>, options?: TrackOptions): AnimationTrackBuilder;
|
|
747
|
+
/** Adds an animation track for a material's color property */
|
|
748
|
+
track(target: Material, property: "color" | "emissive", keyframes: KF_3<ColorValue>, options?: TrackOptions): AnimationTrackBuilder;
|
|
749
|
+
/** Adds an animation track for a light's numeric property */
|
|
750
|
+
track(target: Light_2, property: "intensity" | "distance" | "angle" | "penumbra" | "decay", keyframes: KF_3<number>, options?: TrackOptions): AnimationTrackBuilder;
|
|
751
|
+
/** Adds an animation track for a light's color */
|
|
752
|
+
track(target: Light_2, property: "color", keyframes: KF_3<ColorValue>, options?: TrackOptions): AnimationTrackBuilder;
|
|
753
|
+
/** Adds an animation track for a camera's numeric property */
|
|
754
|
+
track(target: PerspectiveCamera, property: "fov" | "near" | "far" | "zoom", keyframes: KF_3<number>, options?: TrackOptions): AnimationTrackBuilder;
|
|
755
|
+
/** Mutes this track so it is skipped during playback */
|
|
756
|
+
muted(muted?: boolean): AnimationTrackBuilder;
|
|
684
757
|
}
|
|
685
758
|
|
|
686
759
|
declare class AnimationTriggers {
|
|
@@ -1197,11 +1270,15 @@ export declare class AnimatorController {
|
|
|
1197
1270
|
/**
|
|
1198
1271
|
* A fluent builder for creating {@link AnimatorController} instances from code.
|
|
1199
1272
|
*
|
|
1200
|
-
* Use {@link AnimatorController.build} to create a new builder.
|
|
1273
|
+
* Use {@link AnimatorControllerBuilder.create} or {@link AnimatorController.build} to create a new builder.
|
|
1201
1274
|
*
|
|
1202
|
-
*
|
|
1275
|
+
* The builder tracks state names and parameter types through the fluent chain,
|
|
1276
|
+
* providing autocomplete for state names in `.transition()` and type-aware
|
|
1277
|
+
* `.condition()` calls (e.g., trigger parameters don't require a mode argument).
|
|
1278
|
+
*
|
|
1279
|
+
* @example With pre-built AnimationClips
|
|
1203
1280
|
* ```ts
|
|
1204
|
-
* const controller =
|
|
1281
|
+
* const controller = AnimatorControllerBuilder.create("CharacterController")
|
|
1205
1282
|
* .floatParameter("Speed", 0)
|
|
1206
1283
|
* .triggerParameter("Jump")
|
|
1207
1284
|
* .state("Idle", { clip: idleClip, loop: true })
|
|
@@ -1212,36 +1289,70 @@ export declare class AnimatorController {
|
|
|
1212
1289
|
* .transition("Walk", "Idle", { duration: 0.25 })
|
|
1213
1290
|
* .condition("Speed", "less", 0.1)
|
|
1214
1291
|
* .transition("*", "Jump", { duration: 0.1 })
|
|
1215
|
-
* .condition("Jump"
|
|
1292
|
+
* .condition("Jump")
|
|
1216
1293
|
* .transition("Jump", "Idle", { hasExitTime: true, exitTime: 0.9, duration: 0.25 })
|
|
1217
1294
|
* .build();
|
|
1218
1295
|
* ```
|
|
1219
1296
|
*
|
|
1297
|
+
* @example With inline tracks (no pre-built clips needed)
|
|
1298
|
+
* ```ts
|
|
1299
|
+
* const controller = AnimatorControllerBuilder.create("Door")
|
|
1300
|
+
* .boolParameter("Open", false)
|
|
1301
|
+
* .state("Closed", { loop: true })
|
|
1302
|
+
* .track(door, "position", { from: [0, 0, 0], to: [0, 0, 0], duration: 1 })
|
|
1303
|
+
* .state("Open", { loop: true })
|
|
1304
|
+
* .track(door, "position", { from: [0, 0, 0], to: [2, 0, 0], duration: 1 })
|
|
1305
|
+
* .track(light, "intensity", { from: 0, to: 5, duration: 1 })
|
|
1306
|
+
* .transition("Closed", "Open", { duration: 0.25 })
|
|
1307
|
+
* .condition("Open", "if")
|
|
1308
|
+
* .transition("Open", "Closed", { duration: 0.25 })
|
|
1309
|
+
* .condition("Open", "ifNot")
|
|
1310
|
+
* .build(room);
|
|
1311
|
+
* ```
|
|
1312
|
+
*
|
|
1313
|
+
* @typeParam TStates - Union of state names added via `.state()`. Used for autocomplete and validation in `.transition()` and `.defaultState()`.
|
|
1314
|
+
* @typeParam TParams - Record mapping parameter names to their types (`"trigger"`, `"bool"`, `"float"`, `"int"`). Used for type-aware `.condition()` overloads.
|
|
1315
|
+
*
|
|
1220
1316
|
* @category Animation and Sequencing
|
|
1221
1317
|
* @group Utilities
|
|
1222
1318
|
*/
|
|
1223
|
-
export declare class AnimatorControllerBuilder {
|
|
1319
|
+
export declare class AnimatorControllerBuilder<TStates extends string = never, TParams extends Record<string, "trigger" | "bool" | "float" | "int"> = {}> {
|
|
1224
1320
|
private _name;
|
|
1225
1321
|
private _parameters;
|
|
1226
1322
|
private _states;
|
|
1227
1323
|
private _anyStateTransitions;
|
|
1228
1324
|
private _defaultStateName;
|
|
1229
1325
|
private _lastTransition;
|
|
1326
|
+
private _lastState;
|
|
1327
|
+
/**
|
|
1328
|
+
* Creates a new AnimatorControllerBuilder instance.
|
|
1329
|
+
* @param name - Optional name for the controller
|
|
1330
|
+
*/
|
|
1331
|
+
static create(name?: string): AnimatorControllerBuilder;
|
|
1230
1332
|
constructor(name?: string);
|
|
1231
1333
|
/** Adds a float parameter */
|
|
1232
|
-
floatParameter(name:
|
|
1334
|
+
floatParameter<N extends string>(name: N, defaultValue?: number): AnimatorControllerBuilder<TStates, TParams & Record<N, "float">>;
|
|
1233
1335
|
/** Adds an integer parameter */
|
|
1234
|
-
intParameter(name:
|
|
1336
|
+
intParameter<N extends string>(name: N, defaultValue?: number): AnimatorControllerBuilder<TStates, TParams & Record<N, "int">>;
|
|
1235
1337
|
/** Adds a boolean parameter */
|
|
1236
|
-
boolParameter(name:
|
|
1338
|
+
boolParameter<N extends string>(name: N, defaultValue?: boolean): AnimatorControllerBuilder<TStates, TParams & Record<N, "bool">>;
|
|
1237
1339
|
/** Adds a trigger parameter */
|
|
1238
|
-
triggerParameter(name:
|
|
1340
|
+
triggerParameter<N extends string>(name: N): AnimatorControllerBuilder<TStates, TParams & Record<N, "trigger">>;
|
|
1239
1341
|
/**
|
|
1240
1342
|
* Adds a state to the controller. The first state added becomes the default state.
|
|
1343
|
+
*
|
|
1344
|
+
* When `options.clip` is provided, the state uses that clip directly.
|
|
1345
|
+
* When omitted, chain `.track()` calls to define animation tracks inline:
|
|
1346
|
+
* ```ts
|
|
1347
|
+
* .state("Open", { loop: true })
|
|
1348
|
+
* .track(door, "position", { from: [0,0,0], to: [2,0,0], duration: 1 })
|
|
1349
|
+
* .track(light, "intensity", { from: 0, to: 5, duration: 1 })
|
|
1350
|
+
* ```
|
|
1351
|
+
*
|
|
1241
1352
|
* @param name - Unique name for the state
|
|
1242
|
-
* @param options - State configuration including clip, loop, speed
|
|
1353
|
+
* @param options - State configuration including clip, loop, speed. When omitted, use `.track()` to add animation data.
|
|
1243
1354
|
*/
|
|
1244
|
-
state(name:
|
|
1355
|
+
state<N extends string>(name: N, options?: StateOptions): AnimatorControllerBuilder<TStates | N, TParams>;
|
|
1245
1356
|
/**
|
|
1246
1357
|
* Adds a transition between two states.
|
|
1247
1358
|
* Use `"*"` as the source to create a transition from any state.
|
|
@@ -1250,26 +1361,52 @@ export declare class AnimatorControllerBuilder {
|
|
|
1250
1361
|
* @param to - Destination state name
|
|
1251
1362
|
* @param options - Transition configuration
|
|
1252
1363
|
*/
|
|
1253
|
-
transition(from:
|
|
1364
|
+
transition(from: TStates | "*", to: TStates, options?: TransitionOptions): AnimatorControllerBuilder<TStates, TParams>;
|
|
1254
1365
|
/**
|
|
1255
1366
|
* Adds a condition to the most recently added transition.
|
|
1256
1367
|
* Multiple conditions on the same transition are AND-ed together.
|
|
1368
|
+
*
|
|
1369
|
+
* The required arguments depend on the parameter type:
|
|
1370
|
+
* - **Trigger**: `.condition("Jump")` — mode defaults to `"if"`, no threshold needed
|
|
1371
|
+
* - **Bool**: `.condition("Open", "if")` or `.condition("Open", "ifNot")`
|
|
1372
|
+
* - **Float/Int**: `.condition("Speed", "greater", 0.1)`
|
|
1373
|
+
*
|
|
1257
1374
|
* @param parameter - Name of the parameter to evaluate
|
|
1258
|
-
* @param mode - Condition mode: `"if"`, `"ifNot"`, `"greater"`, `"less"`, `"equals"`, `"notEqual"`
|
|
1259
|
-
* @param threshold - Comparison threshold for numeric conditions (default: 0)
|
|
1260
1375
|
*/
|
|
1261
|
-
condition(parameter:
|
|
1376
|
+
condition(parameter: ParamNamesOfType<TParams, "trigger">, mode?: "if" | "ifNot"): AnimatorControllerBuilder<TStates, TParams>;
|
|
1377
|
+
condition(parameter: ParamNamesOfType<TParams, "bool">, mode: "if" | "ifNot"): AnimatorControllerBuilder<TStates, TParams>;
|
|
1378
|
+
condition(parameter: ParamNamesOfType<TParams, "float" | "int">, mode: "greater" | "less" | "equals" | "notEqual", threshold?: number): AnimatorControllerBuilder<TStates, TParams>;
|
|
1379
|
+
/** Adds an animation track for an Object3D's position or scale to the current state */
|
|
1380
|
+
track(target: Object3D, property: "position" | "scale", keyframes: KF<Vec3Value>, options?: TrackOptions): this;
|
|
1381
|
+
/** Adds an animation track for an Object3D's quaternion to the current state */
|
|
1382
|
+
track(target: Object3D, property: "quaternion", keyframes: KF<QuatValue>, options?: TrackOptions): this;
|
|
1383
|
+
/** Adds an animation track for an Object3D's rotation (Euler, converted to quaternion) to the current state */
|
|
1384
|
+
track(target: Object3D, property: "rotation", keyframes: KF<EulerValue>, options?: TrackOptions): this;
|
|
1385
|
+
/** Adds an animation track for an Object3D's visibility to the current state */
|
|
1386
|
+
track(target: Object3D, property: "visible", keyframes: KF<boolean>, options?: TrackOptions): this;
|
|
1387
|
+
/** Adds an animation track for a material's numeric property to the current state */
|
|
1388
|
+
track(target: Material, property: "opacity" | "roughness" | "metalness" | "alphaTest" | "emissiveIntensity" | "envMapIntensity" | "bumpScale" | "displacementScale" | "displacementBias", keyframes: KF<number>, options?: TrackOptions): this;
|
|
1389
|
+
/** Adds an animation track for a material's color property to the current state */
|
|
1390
|
+
track(target: Material, property: "color" | "emissive", keyframes: KF<ColorValue>, options?: TrackOptions): this;
|
|
1391
|
+
/** Adds an animation track for a light's numeric property to the current state */
|
|
1392
|
+
track(target: Light_2, property: "intensity" | "distance" | "angle" | "penumbra" | "decay", keyframes: KF<number>, options?: TrackOptions): this;
|
|
1393
|
+
/** Adds an animation track for a light's color to the current state */
|
|
1394
|
+
track(target: Light_2, property: "color", keyframes: KF<ColorValue>, options?: TrackOptions): this;
|
|
1395
|
+
/** Adds an animation track for a camera's numeric property to the current state */
|
|
1396
|
+
track(target: PerspectiveCamera, property: "fov" | "near" | "far" | "zoom", keyframes: KF<number>, options?: TrackOptions): this;
|
|
1262
1397
|
/**
|
|
1263
1398
|
* Sets which state is the default/entry state.
|
|
1264
1399
|
* If not called, the first added state is used.
|
|
1265
1400
|
* @param name - Name of the state
|
|
1266
1401
|
*/
|
|
1267
|
-
defaultState(name:
|
|
1402
|
+
defaultState(name: TStates): AnimatorControllerBuilder<TStates, TParams>;
|
|
1268
1403
|
/**
|
|
1269
1404
|
* Builds and returns the {@link AnimatorController}.
|
|
1270
1405
|
* Resolves all state name references to indices.
|
|
1406
|
+
* @param root - Optional root Object3D for resolving {@link TrackDescriptor} track paths.
|
|
1407
|
+
* When provided, tracks targeting a different object use `target.name` for named resolution.
|
|
1271
1408
|
*/
|
|
1272
|
-
build(): AnimatorController;
|
|
1409
|
+
build(root?: Object3D): AnimatorController;
|
|
1273
1410
|
}
|
|
1274
1411
|
|
|
1275
1412
|
export declare type AnimatorControllerModel = {
|
|
@@ -1907,46 +2044,14 @@ export declare class AudioSource extends Component {
|
|
|
1907
2044
|
}
|
|
1908
2045
|
|
|
1909
2046
|
/**
|
|
1910
|
-
*
|
|
1911
|
-
*
|
|
1912
|
-
* **Runtime mutation:** The track model is read fresh every frame during `evaluate()`.
|
|
1913
|
-
* You can mutate `track.volume`, `clip.start`, `clip.end`, `clip.asset.volume` etc.
|
|
1914
|
-
* at any time — changes take effect on the next frame without rebuilding the timeline.
|
|
1915
|
-
*
|
|
1916
|
-
* **Audio stopping:** Audio clips are automatically stopped when:
|
|
1917
|
-
* - Timeline time moves outside a clip's `[start, end]` range (e.g. jumping or normal playback advancing past a clip)
|
|
1918
|
-
* - The track is muted (via `muted = true`)
|
|
1919
|
-
* - The director is stopped (`director.stop()`)
|
|
1920
|
-
* - The director is paused (`director.pause()`)
|
|
1921
|
-
* - The director is disabled or destroyed
|
|
2047
|
+
* Builder for audio tracks. Provides `.clip()` for adding audio clips by URL.
|
|
2048
|
+
* @category Animation and Sequencing
|
|
1922
2049
|
*/
|
|
1923
|
-
export declare
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
lastTime: number;
|
|
1929
|
-
audioSource?: AudioSource;
|
|
1930
|
-
/** Track-level volume multiplier (0–1). Applied on top of per-clip volume each frame. */
|
|
1931
|
-
get volume(): number;
|
|
1932
|
-
set volume(val: number);
|
|
1933
|
-
private _audioLoader;
|
|
1934
|
-
private getAudioFilePath;
|
|
1935
|
-
onAllowAudioChanged(allow: boolean): void;
|
|
1936
|
-
addModel(model: Models.ClipModel): void;
|
|
1937
|
-
onDisable(): void;
|
|
1938
|
-
onDestroy(): void;
|
|
1939
|
-
onMuteChanged(): void;
|
|
1940
|
-
stop(): void;
|
|
1941
|
-
private _playableDirectorResumed;
|
|
1942
|
-
onPauseChanged(): void;
|
|
1943
|
-
evaluate(time: number): void;
|
|
1944
|
-
/** Call to load audio buffer for a specific time in the track. Can be used to preload the timeline audio */
|
|
1945
|
-
loadAudio(time: number, lookAhead?: number, lookBehind?: number): Promise<(AudioBuffer | null)[]> | null;
|
|
1946
|
-
private isInTimeRange;
|
|
1947
|
-
private static _audioBuffers;
|
|
1948
|
-
static dispose(): void;
|
|
1949
|
-
private handleAudioLoading;
|
|
2050
|
+
export declare interface AudioTrackBuilder extends TimelineBuilderBase {
|
|
2051
|
+
/** Adds an audio clip by URL */
|
|
2052
|
+
clip(url: string, options: AudioClipOptions): AudioTrackBuilder;
|
|
2053
|
+
/** Mutes this track so it is skipped during playback */
|
|
2054
|
+
muted(muted?: boolean): AudioTrackBuilder;
|
|
1950
2055
|
}
|
|
1951
2056
|
|
|
1952
2057
|
/* Excluded from this release type: AuralMode */
|
|
@@ -3717,6 +3822,9 @@ declare class ColorSerializer extends TypeSerializer {
|
|
|
3717
3822
|
|
|
3718
3823
|
export declare let colorSerializer: ColorSerializer;
|
|
3719
3824
|
|
|
3825
|
+
/** A Color value, either as a Three.js Color or as an `[r, g, b]` tuple (0–1) */
|
|
3826
|
+
declare type ColorValue = Color | [number, number, number];
|
|
3827
|
+
|
|
3720
3828
|
/**
|
|
3721
3829
|
* Utility method to check if two materials were created from the same glTF material
|
|
3722
3830
|
*/
|
|
@@ -4385,6 +4493,7 @@ export declare class ContactShadows extends Component {
|
|
|
4385
4493
|
set needsUpdate(val: boolean);
|
|
4386
4494
|
get needsUpdate(): boolean;
|
|
4387
4495
|
private _needsUpdate;
|
|
4496
|
+
private _needsFit;
|
|
4388
4497
|
/** All shadow objects are parented to this object.
|
|
4389
4498
|
* The gameObject itself should not be transformed because we want the ContactShadows object e.g. also have a GroundProjectedEnv component
|
|
4390
4499
|
* in which case ContactShadows scale would affect the projection
|
|
@@ -4638,19 +4747,31 @@ export declare class Context implements IContext {
|
|
|
4638
4747
|
private _mainCamera;
|
|
4639
4748
|
private _fallbackCamera;
|
|
4640
4749
|
/** access application state (e.g. if all audio should be muted) */
|
|
4641
|
-
application: Application;
|
|
4750
|
+
get application(): Application;
|
|
4751
|
+
private _application;
|
|
4642
4752
|
/** access animation mixer used by components in the scene */
|
|
4643
|
-
animations: AnimationsRegistry;
|
|
4753
|
+
get animations(): AnimationsRegistry;
|
|
4754
|
+
private _animations;
|
|
4644
4755
|
/** access timings (current frame number, deltaTime, timeScale, ...) */
|
|
4645
|
-
time: Time;
|
|
4756
|
+
get time(): Time;
|
|
4757
|
+
private _time;
|
|
4646
4758
|
/** access input data (e.g. click or touch events) */
|
|
4647
|
-
input: Input;
|
|
4759
|
+
get input(): Input;
|
|
4760
|
+
private _input;
|
|
4648
4761
|
/** access physics related methods (e.g. raycasting). To access the phyiscs engine use `context.physics.engine` */
|
|
4649
|
-
physics: Physics;
|
|
4762
|
+
get physics(): Physics;
|
|
4763
|
+
private _physics;
|
|
4650
4764
|
/** access postprocessing effects stack. Add/remove effects and configure adaptive performance settings */
|
|
4651
|
-
postprocessing: PostProcessing;
|
|
4765
|
+
get postprocessing(): PostProcessing;
|
|
4766
|
+
private _postprocessing;
|
|
4652
4767
|
/** access networking methods (use it to send or listen to messages or join a networking backend) */
|
|
4653
|
-
connection: NetworkConnection;
|
|
4768
|
+
get connection(): NetworkConnection;
|
|
4769
|
+
private _connection;
|
|
4770
|
+
/** context-level event bus for decoupled component communication
|
|
4771
|
+
* @see {@link ContextEventMap} for known event types
|
|
4772
|
+
*/
|
|
4773
|
+
get events(): EventBus;
|
|
4774
|
+
private _events;
|
|
4654
4775
|
/** @deprecated AssetDatabase is deprecated */
|
|
4655
4776
|
assets: AssetDatabase;
|
|
4656
4777
|
/** All registered lights in the scene, maintained by the Light component.
|
|
@@ -4909,6 +5030,18 @@ export declare type ContextEventArgs = {
|
|
|
4909
5030
|
files?: LoadedModel[];
|
|
4910
5031
|
};
|
|
4911
5032
|
|
|
5033
|
+
/** Typed event map for {@link Context.events}.
|
|
5034
|
+
* Known events get full autocomplete; custom events can be typed at the call site via generic parameter.
|
|
5035
|
+
*/
|
|
5036
|
+
export declare interface ContextEventMap {
|
|
5037
|
+
"scene-content-changed": {
|
|
5038
|
+
/** The component that triggered the change (e.g. SceneSwitcher, DropListener) */
|
|
5039
|
+
readonly source: IComponent;
|
|
5040
|
+
/** The root object that was added/loaded */
|
|
5041
|
+
readonly object: Object3D;
|
|
5042
|
+
};
|
|
5043
|
+
}
|
|
5044
|
+
|
|
4912
5045
|
/** Use to register to various Needle Engine context events and to get access to all current instances
|
|
4913
5046
|
* e.g. when being created in the DOM
|
|
4914
5047
|
* @example
|
|
@@ -4984,12 +5117,15 @@ declare type ControllerAxes = "xr-standard-thumbstick" | "xr-standard-touchpad";
|
|
|
4984
5117
|
*/
|
|
4985
5118
|
export declare type ControllerChangedEvt = (args: NeedleXRControllerEventArgs) => void;
|
|
4986
5119
|
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
5120
|
+
/**
|
|
5121
|
+
* Builder for control tracks. Provides `.clip()` for controlling nested objects/timelines.
|
|
5122
|
+
* @category Animation and Sequencing
|
|
5123
|
+
*/
|
|
5124
|
+
export declare interface ControlTrackBuilder extends TimelineBuilderBase {
|
|
5125
|
+
/** Adds a control clip for a source object */
|
|
5126
|
+
clip(sourceObject: Object3D, options: ControlClipOptions): ControlTrackBuilder;
|
|
5127
|
+
/** Mutes this track so it is skipped during playback */
|
|
5128
|
+
muted(muted?: boolean): ControlTrackBuilder;
|
|
4993
5129
|
}
|
|
4994
5130
|
|
|
4995
5131
|
/**@obsolete use Graphics.copyTexture */
|
|
@@ -5177,7 +5313,6 @@ export declare class CursorFollow extends Component {
|
|
|
5177
5313
|
* - Cursor that follows terrain or mesh surfaces
|
|
5178
5314
|
*
|
|
5179
5315
|
* **Important notes:**
|
|
5180
|
-
* - Requires objects in the scene to have colliders for raycasting to work
|
|
5181
5316
|
* - Works best with {@link keepDistance} set to `false` to allow depth changes
|
|
5182
5317
|
* - Can be combined with {@link damping} for smooth surface following
|
|
5183
5318
|
* - The raycast uses the physics system's raycast functionality
|
|
@@ -6189,6 +6324,45 @@ export declare class EnvironmentScene extends Scene {
|
|
|
6189
6324
|
createAreaLightMaterial(intensity: number): MeshBasicMaterial;
|
|
6190
6325
|
}
|
|
6191
6326
|
|
|
6327
|
+
/** An Euler value, either as a Three.js Euler or as a `[x, y, z]` tuple (radians) */
|
|
6328
|
+
declare type EulerValue = Euler | [number, number, number];
|
|
6329
|
+
|
|
6330
|
+
/** Typed event bus. Known {@link ContextEventMap} events get full autocomplete.
|
|
6331
|
+
* Custom events can be typed at the call site via generic parameter.
|
|
6332
|
+
* @example Known events
|
|
6333
|
+
* ```ts
|
|
6334
|
+
* context.events.on("scene-content-changed", e => e.object);
|
|
6335
|
+
* ```
|
|
6336
|
+
* @example Custom events — type at call site
|
|
6337
|
+
* ```ts
|
|
6338
|
+
* context.events.emit<{ pts: number }>("scored", { pts: 10 });
|
|
6339
|
+
* context.events.on<{ pts: number }>("scored", e => e.pts);
|
|
6340
|
+
* ```
|
|
6341
|
+
* @example Once
|
|
6342
|
+
* ```ts
|
|
6343
|
+
* context.events.on("scene-content-changed", e => { ... }, { once: true });
|
|
6344
|
+
* ```
|
|
6345
|
+
*/
|
|
6346
|
+
export declare class EventBus {
|
|
6347
|
+
private _listeners;
|
|
6348
|
+
/** Emit a known {@link ContextEventMap} event */
|
|
6349
|
+
emit<K extends keyof ContextEventMap & string>(type: K, detail?: ContextEventMap[K]): void;
|
|
6350
|
+
/** Emit a custom event with user-provided type */
|
|
6351
|
+
emit<T>(type: string, detail?: T): void;
|
|
6352
|
+
/** Subscribe to a known {@link ContextEventMap} event. Returns an unsubscribe function. */
|
|
6353
|
+
on<K extends keyof ContextEventMap & string>(type: K, callback: (args: ContextEventMap[K]) => void, options?: EventBusListenerOptions): () => void;
|
|
6354
|
+
/** Subscribe to a custom event with user-provided type. Returns an unsubscribe function. */
|
|
6355
|
+
on<T>(type: string, callback: (args: T) => void, options?: EventBusListenerOptions): () => void;
|
|
6356
|
+
/** Remove all listeners. Called when the context is cleared or destroyed. */
|
|
6357
|
+
clear(): void;
|
|
6358
|
+
}
|
|
6359
|
+
|
|
6360
|
+
/** Options for {@link EventBus.on}. */
|
|
6361
|
+
export declare interface EventBusListenerOptions {
|
|
6362
|
+
/** If true the listener is automatically removed after the first invocation. */
|
|
6363
|
+
once?: boolean;
|
|
6364
|
+
}
|
|
6365
|
+
|
|
6192
6366
|
/**
|
|
6193
6367
|
* EventList manages a list of callbacks that can be invoked together.
|
|
6194
6368
|
* Used for Unity-style events that can be configured in the editor (Unity or Blender).
|
|
@@ -8859,14 +9033,33 @@ export declare class Input implements IInput {
|
|
|
8859
9033
|
*/
|
|
8860
9034
|
private readonly _eventListeners;
|
|
8861
9035
|
/** Adds an event listener for the specified event type. The callback will be called when the event is triggered.
|
|
9036
|
+
*
|
|
9037
|
+
* Returns an unsubscribe function — call it to remove the listener.
|
|
9038
|
+
* Pass it to {@link Behaviour.autoCleanup} for automatic lifecycle management.
|
|
9039
|
+
*
|
|
8862
9040
|
* @param type The event type to listen for
|
|
8863
9041
|
* @param callback The callback to call when the event is triggered
|
|
8864
9042
|
* @param options The options for adding the event listener.
|
|
8865
|
-
* @
|
|
9043
|
+
* @returns A function that removes the event listener when called.
|
|
9044
|
+
*
|
|
9045
|
+
* @example With autoCleanup (recommended)
|
|
8866
9046
|
* ```ts
|
|
8867
|
-
*
|
|
9047
|
+
* export class MyComponent extends Behaviour {
|
|
9048
|
+
* onEnable() {
|
|
9049
|
+
* this.autoCleanup(this.context.input.addEventListener("pointerdown", (evt) => {
|
|
9050
|
+
* console.log("Pointer down", evt.pointerId, evt.pointerType);
|
|
9051
|
+
* }));
|
|
9052
|
+
* }
|
|
9053
|
+
* // Listener is automatically removed on disable — no manual cleanup needed!
|
|
9054
|
+
* }
|
|
9055
|
+
* ```
|
|
9056
|
+
* @example Manual unsubscribe
|
|
9057
|
+
* ```ts
|
|
9058
|
+
* const off = input.addEventListener("pointerdown", (evt) => {
|
|
8868
9059
|
* console.log("Pointer down", evt.pointerId, evt.pointerType);
|
|
8869
9060
|
* });
|
|
9061
|
+
* // later
|
|
9062
|
+
* off();
|
|
8870
9063
|
* ```
|
|
8871
9064
|
* @example Adding a listener that is called after all other listeners
|
|
8872
9065
|
* By using a higher value for the queue the listener will be called after other listeners (default queue is 0).
|
|
@@ -8882,8 +9075,8 @@ export declare class Input implements IInput {
|
|
|
8882
9075
|
* }, { once: true });
|
|
8883
9076
|
* ```
|
|
8884
9077
|
*/
|
|
8885
|
-
addEventListener(type: PointerEventNames, callback: PointerEventListener, options?: EventListenerOptions_2):
|
|
8886
|
-
addEventListener(type: KeyboardEventNames, callback: KeyboardEventListener, options?: EventListenerOptions_2):
|
|
9078
|
+
addEventListener(type: PointerEventNames, callback: PointerEventListener, options?: EventListenerOptions_2): () => void;
|
|
9079
|
+
addEventListener(type: KeyboardEventNames, callback: KeyboardEventListener, options?: EventListenerOptions_2): () => void;
|
|
8887
9080
|
/** Removes the event listener from the specified event type. If no queue is specified the listener will be removed from all queues.
|
|
8888
9081
|
* @param type The event type to remove the listener from
|
|
8889
9082
|
* @param callback The callback to remove
|
|
@@ -9491,6 +9684,11 @@ export declare interface IPhysicsEngine {
|
|
|
9491
9684
|
* @returns False to ignore this collider, true to include it
|
|
9492
9685
|
*/
|
|
9493
9686
|
filterPredicate?: (collider: ICollider) => boolean;
|
|
9687
|
+
/** When true, trigger/sensor colliders will be included in the raycast results.
|
|
9688
|
+
* By default trigger colliders are skipped.
|
|
9689
|
+
* @default false
|
|
9690
|
+
*/
|
|
9691
|
+
includeTriggers?: boolean;
|
|
9494
9692
|
}): RaycastResult;
|
|
9495
9693
|
/**
|
|
9496
9694
|
* Performs a raycast that also returns the normal vector at the hit point
|
|
@@ -9518,6 +9716,11 @@ export declare interface IPhysicsEngine {
|
|
|
9518
9716
|
* @returns False to ignore this collider, true to include it
|
|
9519
9717
|
*/
|
|
9520
9718
|
filterPredicate?: (collider: ICollider) => boolean;
|
|
9719
|
+
/** When true, trigger/sensor colliders will be included in the raycast results.
|
|
9720
|
+
* By default trigger colliders are skipped.
|
|
9721
|
+
* @default false
|
|
9722
|
+
*/
|
|
9723
|
+
includeTriggers?: boolean;
|
|
9521
9724
|
}): RaycastResult;
|
|
9522
9725
|
/**
|
|
9523
9726
|
* Finds all colliders within a sphere
|
|
@@ -10151,6 +10354,15 @@ declare class Keyframe_2 {
|
|
|
10151
10354
|
}
|
|
10152
10355
|
export { Keyframe_2 as Keyframe }
|
|
10153
10356
|
|
|
10357
|
+
/** Keyframe array or tween shorthand */
|
|
10358
|
+
declare type KF<V> = AnimationKeyframe<V>[] | Tween<V>;
|
|
10359
|
+
|
|
10360
|
+
/** Keyframe array or tween shorthand */
|
|
10361
|
+
declare type KF_2<V> = AnimationKeyframe<V>[] | Tween<V>;
|
|
10362
|
+
|
|
10363
|
+
/** Keyframe array or tween shorthand */
|
|
10364
|
+
declare type KF_3<V> = AnimationKeyframe<V>[] | Tween<V>;
|
|
10365
|
+
|
|
10154
10366
|
declare type LabelHandle = {
|
|
10155
10367
|
setText(str: string): any;
|
|
10156
10368
|
};
|
|
@@ -10819,13 +11031,15 @@ export declare function markAsInstancedRendered(go: Object3D, instanced: boolean
|
|
|
10819
11031
|
time: number;
|
|
10820
11032
|
}
|
|
10821
11033
|
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
11034
|
+
/**
|
|
11035
|
+
* Builder for marker tracks. Provides `.marker()` for adding markers.
|
|
11036
|
+
* @category Animation and Sequencing
|
|
11037
|
+
*/
|
|
11038
|
+
export declare interface MarkerTrackBuilder extends TimelineBuilderBase {
|
|
11039
|
+
/** Adds a marker referencing a signal asset by guid */
|
|
11040
|
+
marker(time: number, asset: string, options?: SignalMarkerOptions): MarkerTrackBuilder;
|
|
11041
|
+
/** Mutes this track so it is skipped during playback */
|
|
11042
|
+
muted(muted?: boolean): MarkerTrackBuilder;
|
|
10829
11043
|
}
|
|
10830
11044
|
|
|
10831
11045
|
export declare enum MarkerType {
|
|
@@ -14262,8 +14476,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14262
14476
|
* @param options The options for fitting the camera. Use to provide objects to fit to, fit direction and size and other settings.
|
|
14263
14477
|
*/
|
|
14264
14478
|
fitCamera(options?: OrbitFitCameraOptions): any;
|
|
14265
|
-
/** @deprecated Use fitCamera(options) */
|
|
14266
|
-
fitCamera(objects?: Object3D | Array<Object3D>, options?: Omit<OrbitFitCameraOptions, "objects">): any;
|
|
14267
14479
|
private _haveAttachedKeyboardEvents;
|
|
14268
14480
|
}
|
|
14269
14481
|
|
|
@@ -14464,6 +14676,11 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14464
14676
|
value: number | boolean | string;
|
|
14465
14677
|
};
|
|
14466
14678
|
|
|
14679
|
+
/** Extracts parameter names of a given type from the builder's tracked parameter map */
|
|
14680
|
+
declare type ParamNamesOfType<TParams, PType extends string> = {
|
|
14681
|
+
[K in keyof TParams & string]: TParams[K] extends PType ? K : never;
|
|
14682
|
+
}[keyof TParams & string];
|
|
14683
|
+
|
|
14467
14684
|
declare type ParseNumber<T> = T extends `${infer U extends number}` ? U : never;
|
|
14468
14685
|
|
|
14469
14686
|
/** Load a gltf file from a url. This is the core method used by Needle Engine to load gltf files. All known extensions are registered here.
|
|
@@ -15181,15 +15398,15 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15181
15398
|
/** Iterates over all tracks of the timeline
|
|
15182
15399
|
* @returns all tracks of the timeline
|
|
15183
15400
|
*/
|
|
15184
|
-
forEachTrack(): Generator<Tracks.
|
|
15401
|
+
forEachTrack(): Generator<Tracks.TimelineTrackHandler, void, unknown>;
|
|
15185
15402
|
/**
|
|
15186
15403
|
* @returns all animation tracks of the timeline
|
|
15187
15404
|
*/
|
|
15188
|
-
get animationTracks(): Tracks.
|
|
15405
|
+
get animationTracks(): Tracks.TimelineAnimationTrack[];
|
|
15189
15406
|
/**
|
|
15190
15407
|
* @returns all audio tracks of the timeline
|
|
15191
15408
|
*/
|
|
15192
|
-
get audioTracks(): Tracks.
|
|
15409
|
+
get audioTracks(): Tracks.TimelineAudioTrack[];
|
|
15193
15410
|
/**
|
|
15194
15411
|
* @returns all signal tracks of the timeline
|
|
15195
15412
|
*/
|
|
@@ -15197,15 +15414,15 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15197
15414
|
/**
|
|
15198
15415
|
* @returns all marker tracks of the timeline
|
|
15199
15416
|
*/
|
|
15200
|
-
get markerTracks(): Tracks.
|
|
15417
|
+
get markerTracks(): Tracks.TimelineMarkerTrack[];
|
|
15201
15418
|
/**
|
|
15202
15419
|
* @returns all activation tracks of the timeline
|
|
15203
15420
|
*/
|
|
15204
|
-
get activationTracks(): Tracks.
|
|
15421
|
+
get activationTracks(): Tracks.TimelineActivationTrack[];
|
|
15205
15422
|
/**
|
|
15206
15423
|
* @returns all tracks of the timeline
|
|
15207
15424
|
*/
|
|
15208
|
-
get tracks(): ReadonlyArray<Tracks.
|
|
15425
|
+
get tracks(): ReadonlyArray<Tracks.TimelineTrackHandler>;
|
|
15209
15426
|
/**
|
|
15210
15427
|
* Iterates over all markers of the timeline, optionally filtering by type
|
|
15211
15428
|
*
|
|
@@ -16226,6 +16443,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
16226
16443
|
w: number;
|
|
16227
16444
|
};
|
|
16228
16445
|
|
|
16446
|
+
/** A Quaternion value, either as a Three.js Quaternion or as a `[x, y, z, w]` tuple */
|
|
16447
|
+
declare type QuatValue = Quaternion | [number, number, number, number];
|
|
16448
|
+
|
|
16229
16449
|
/** Generates a random number
|
|
16230
16450
|
* @deprecated use Mathf.random(min, max)
|
|
16231
16451
|
*/
|
|
@@ -16351,6 +16571,11 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
16351
16571
|
* @default undefined
|
|
16352
16572
|
*/
|
|
16353
16573
|
useIgnoreRaycastLayer?: boolean;
|
|
16574
|
+
/** When true, trigger/sensor colliders will be included in the raycast results.
|
|
16575
|
+
* By default trigger colliders are skipped.
|
|
16576
|
+
* @default false
|
|
16577
|
+
*/
|
|
16578
|
+
includeTriggers?: boolean;
|
|
16354
16579
|
}): null | {
|
|
16355
16580
|
point: Vector3;
|
|
16356
16581
|
collider: ICollider;
|
|
@@ -16368,6 +16593,11 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
16368
16593
|
* @default undefined
|
|
16369
16594
|
*/
|
|
16370
16595
|
useIgnoreRaycastLayer?: boolean;
|
|
16596
|
+
/** When true, trigger/sensor colliders will be included in the raycast results.
|
|
16597
|
+
* By default trigger colliders are skipped.
|
|
16598
|
+
* @default false
|
|
16599
|
+
*/
|
|
16600
|
+
includeTriggers?: boolean;
|
|
16371
16601
|
}): null | {
|
|
16372
16602
|
point: Vector3;
|
|
16373
16603
|
normal: Vector3;
|
|
@@ -19075,7 +19305,20 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19075
19305
|
reaction: EventList<void>;
|
|
19076
19306
|
}
|
|
19077
19307
|
|
|
19078
|
-
|
|
19308
|
+
/**
|
|
19309
|
+
* Builder for signal tracks. Provides `.signal()` for callback-based signals and `.marker()` for asset-based markers.
|
|
19310
|
+
* @category Animation and Sequencing
|
|
19311
|
+
*/
|
|
19312
|
+
export declare interface SignalTrackBuilder extends TimelineBuilderBase {
|
|
19313
|
+
/** Adds a signal with a callback that fires at the given time */
|
|
19314
|
+
signal(time: number, callback: Function, options?: SignalMarkerOptions): SignalTrackBuilder;
|
|
19315
|
+
/** Adds a signal marker referencing a signal asset by guid */
|
|
19316
|
+
marker(time: number, asset: string, options?: SignalMarkerOptions): SignalTrackBuilder;
|
|
19317
|
+
/** Mutes this track so it is skipped during playback */
|
|
19318
|
+
muted(muted?: boolean): SignalTrackBuilder;
|
|
19319
|
+
}
|
|
19320
|
+
|
|
19321
|
+
export declare class SignalTrackHandler extends TimelineTrackHandler {
|
|
19079
19322
|
models: Models.SignalMarkerModel[];
|
|
19080
19323
|
didTrigger: boolean[];
|
|
19081
19324
|
receivers: Array<SignalReceiver | null>;
|
|
@@ -20333,8 +20576,15 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
20333
20576
|
* Configuration for an animation state in the builder
|
|
20334
20577
|
*/
|
|
20335
20578
|
export declare type StateOptions = {
|
|
20336
|
-
/**
|
|
20337
|
-
|
|
20579
|
+
/**
|
|
20580
|
+
* The animation clip for this state. Accepts:
|
|
20581
|
+
* - A pre-built `AnimationClip`
|
|
20582
|
+
* - A single {@link TrackDescriptor} from {@link track}
|
|
20583
|
+
* - An array of {@link TrackDescriptor}s (multiple tracks combined into one clip)
|
|
20584
|
+
*
|
|
20585
|
+
* When omitted, use {@link AnimatorControllerBuilder.track .track()} to define animation tracks inline.
|
|
20586
|
+
*/
|
|
20587
|
+
clip?: AnimationClip | TrackDescriptor | TrackDescriptor[];
|
|
20338
20588
|
/** Whether the animation should loop (default: false) */
|
|
20339
20589
|
loop?: boolean;
|
|
20340
20590
|
/** Base speed multiplier (default: 1) */
|
|
@@ -21156,6 +21406,57 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21156
21406
|
/* Excluded from this release type: update */
|
|
21157
21407
|
}
|
|
21158
21408
|
|
|
21409
|
+
/**
|
|
21410
|
+
* Handles activation (visibility) of bound objects for a timeline activation track.
|
|
21411
|
+
*
|
|
21412
|
+
* Each clip on the track defines a time range during which the bound objects should be active (visible).
|
|
21413
|
+
* @see TimelineTrackHandler for details on how tracks and clips work in general, and how to mutate them at runtime.
|
|
21414
|
+
* @see PlayableDirector for how to control timeline playback and time.
|
|
21415
|
+
* @see TimelineBuilder for how to create and configure timelines and tracks in the editor.
|
|
21416
|
+
*/
|
|
21417
|
+
export declare class TimelineActivationTrack extends TimelineTrackHandler {
|
|
21418
|
+
evaluate(time: number): void;
|
|
21419
|
+
}
|
|
21420
|
+
|
|
21421
|
+
export declare class TimelineAnimationTrack extends TimelineTrackHandler {
|
|
21422
|
+
/* Excluded from this release type: models */
|
|
21423
|
+
/* Excluded from this release type: trackOffset */
|
|
21424
|
+
/** The object that is being animated. */
|
|
21425
|
+
target?: Object3D;
|
|
21426
|
+
/** The AnimationMixer, should be shared with the animator if an animator is bound */
|
|
21427
|
+
mixer?: AnimationMixer;
|
|
21428
|
+
clips: Array<AnimationClip>;
|
|
21429
|
+
actions: Array<AnimationAction>;
|
|
21430
|
+
/**
|
|
21431
|
+
* You can use the weight to blend the timeline animation tracks with multiple animation tracks on the same object.
|
|
21432
|
+
* @default 1
|
|
21433
|
+
*/
|
|
21434
|
+
weight: number;
|
|
21435
|
+
/** holds data/info about clips differences */
|
|
21436
|
+
private _actionOffsets;
|
|
21437
|
+
private _didBind;
|
|
21438
|
+
private _animator;
|
|
21439
|
+
onDisable(): void;
|
|
21440
|
+
onDestroy(): void;
|
|
21441
|
+
onStateChanged(): void;
|
|
21442
|
+
createHooks(clipModel: Models.AnimationClipModel, clip: any): void;
|
|
21443
|
+
bind(): void;
|
|
21444
|
+
private ensureTrackOffsets;
|
|
21445
|
+
private _useclipOffsets;
|
|
21446
|
+
private _totalOffsetPosition;
|
|
21447
|
+
private _totalOffsetRotation;
|
|
21448
|
+
private _totalOffsetPosition2;
|
|
21449
|
+
private _totalOffsetRotation2;
|
|
21450
|
+
private _summedPos;
|
|
21451
|
+
private _tempPos;
|
|
21452
|
+
private _summedRot;
|
|
21453
|
+
private _tempRot;
|
|
21454
|
+
private _clipRotQuat;
|
|
21455
|
+
evaluate(time: number): void;
|
|
21456
|
+
private createRotationInterpolant;
|
|
21457
|
+
private createPositionInterpolant;
|
|
21458
|
+
}
|
|
21459
|
+
|
|
21159
21460
|
/**
|
|
21160
21461
|
* @category Animation and Sequencing
|
|
21161
21462
|
* @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
|
|
@@ -21165,6 +21466,49 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21165
21466
|
tracks: TrackModel[];
|
|
21166
21467
|
};
|
|
21167
21468
|
|
|
21469
|
+
/**
|
|
21470
|
+
* Handles audio playback for a timeline audio track.
|
|
21471
|
+
*
|
|
21472
|
+
* **Runtime mutation:** The track model is read fresh every frame during `evaluate()`.
|
|
21473
|
+
* You can mutate `track.volume`, `clip.start`, `clip.end`, `clip.asset.volume` etc.
|
|
21474
|
+
* at any time — changes take effect on the next frame without rebuilding the timeline.
|
|
21475
|
+
*
|
|
21476
|
+
* **Audio stopping:** Audio clips are automatically stopped when:
|
|
21477
|
+
* - Timeline time moves outside a clip's `[start, end]` range (e.g. jumping or normal playback advancing past a clip)
|
|
21478
|
+
* - The track is muted (via `muted = true`)
|
|
21479
|
+
* - The director is stopped (`director.stop()`)
|
|
21480
|
+
* - The director is paused (`director.pause()`)
|
|
21481
|
+
* - The director is disabled or destroyed
|
|
21482
|
+
*/
|
|
21483
|
+
export declare class TimelineAudioTrack extends TimelineTrackHandler {
|
|
21484
|
+
models: Array<AudioClipModel_2>;
|
|
21485
|
+
listener: AudioListener_3;
|
|
21486
|
+
audio: Array<Audio_2>;
|
|
21487
|
+
audioContextTimeOffset: Array<number>;
|
|
21488
|
+
lastTime: number;
|
|
21489
|
+
audioSource?: AudioSource;
|
|
21490
|
+
/** Track-level volume multiplier (0–1). Applied on top of per-clip volume each frame. */
|
|
21491
|
+
get volume(): number;
|
|
21492
|
+
set volume(val: number);
|
|
21493
|
+
private _audioLoader;
|
|
21494
|
+
private getAudioFilePath;
|
|
21495
|
+
onAllowAudioChanged(allow: boolean): void;
|
|
21496
|
+
addModel(model: Models.ClipModel): void;
|
|
21497
|
+
onDisable(): void;
|
|
21498
|
+
onDestroy(): void;
|
|
21499
|
+
onMuteChanged(): void;
|
|
21500
|
+
stop(): void;
|
|
21501
|
+
private _playableDirectorResumed;
|
|
21502
|
+
onPauseChanged(): void;
|
|
21503
|
+
evaluate(time: number): void;
|
|
21504
|
+
/** Call to load audio buffer for a specific time in the track. Can be used to preload the timeline audio */
|
|
21505
|
+
loadAudio(time: number, lookAhead?: number, lookBehind?: number): Promise<(AudioBuffer | null)[]> | null;
|
|
21506
|
+
private isInTimeRange;
|
|
21507
|
+
private static _audioBuffers;
|
|
21508
|
+
static dispose(): void;
|
|
21509
|
+
private handleAudioLoading;
|
|
21510
|
+
}
|
|
21511
|
+
|
|
21168
21512
|
/**
|
|
21169
21513
|
* A fluent builder for creating timeline assets ({@link TimelineAssetModel}) from code.
|
|
21170
21514
|
*
|
|
@@ -21186,6 +21530,19 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21186
21530
|
* director.play();
|
|
21187
21531
|
* ```
|
|
21188
21532
|
*
|
|
21533
|
+
* @example With inline tracks (no pre-built clips needed)
|
|
21534
|
+
* ```ts
|
|
21535
|
+
* TimelineBuilder.create("DoorSequence")
|
|
21536
|
+
* .animationTrack("Door", door)
|
|
21537
|
+
* .track(door, "position", { from: [0, 0, 0], to: [2, 0, 0], duration: 1 })
|
|
21538
|
+
* .track(light, "intensity", { from: 0, to: 5, duration: 1 })
|
|
21539
|
+
* .signalTrack("Events")
|
|
21540
|
+
* .signal(0.5, () => playSound("creak"))
|
|
21541
|
+
* .install(director);
|
|
21542
|
+
*
|
|
21543
|
+
* director.play();
|
|
21544
|
+
* ```
|
|
21545
|
+
*
|
|
21189
21546
|
* @example Using install() with signal callbacks
|
|
21190
21547
|
* ```ts
|
|
21191
21548
|
* TimelineBuilder.create("WithSignals")
|
|
@@ -21214,51 +21571,69 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21214
21571
|
* @param name - Name for the timeline asset
|
|
21215
21572
|
* @param seed - Optional numeric seed for deterministic guid generation. Defaults to `Date.now()`.
|
|
21216
21573
|
*/
|
|
21217
|
-
static create(name?: string, seed?: number):
|
|
21574
|
+
static create(name?: string, seed?: number): TimelineBuilderBase;
|
|
21218
21575
|
/**
|
|
21219
|
-
* Adds an animation track.
|
|
21576
|
+
* Adds an animation track. Chain `.clip()` calls to add pre-built clips,
|
|
21577
|
+
* or chain `.track()` calls to define animation data inline:
|
|
21578
|
+
*
|
|
21579
|
+
* @example With pre-built AnimationClip
|
|
21580
|
+
* ```ts
|
|
21581
|
+
* .animationTrack("Character", animator)
|
|
21582
|
+
* .clip(walkClip, { duration: 2, easeIn: 0.3 })
|
|
21583
|
+
* .clip(runClip, { duration: 3 })
|
|
21584
|
+
* ```
|
|
21585
|
+
*
|
|
21586
|
+
* @example With inline tracks
|
|
21587
|
+
* ```ts
|
|
21588
|
+
* .animationTrack("Door", door)
|
|
21589
|
+
* .track(door, "position", { from: [0, 0, 0], to: [2, 0, 0], duration: 1 })
|
|
21590
|
+
* .track(light, "intensity", { from: 0, to: 5, duration: 1 })
|
|
21591
|
+
* ```
|
|
21592
|
+
*
|
|
21220
21593
|
* @param name - Display name for the track
|
|
21221
21594
|
* @param binding - The Animator or Object3D to animate
|
|
21222
21595
|
*/
|
|
21223
|
-
animationTrack(name: string, binding?: Animator | Object3D | null):
|
|
21596
|
+
animationTrack(name: string, binding?: Animator | Object3D | null): AnimationTrackBuilder;
|
|
21224
21597
|
/**
|
|
21225
21598
|
* Adds an audio track. Subsequent `.clip()` calls add audio clips to this track.
|
|
21226
21599
|
* @param name - Display name for the track
|
|
21227
21600
|
* @param binding - The AudioSource to play audio on (optional)
|
|
21228
21601
|
* @param volume - Track volume multiplier (default: 1)
|
|
21229
21602
|
*/
|
|
21230
|
-
audioTrack(name: string, binding?: AudioSource | Object3D | null, volume?: number):
|
|
21603
|
+
audioTrack(name: string, binding?: AudioSource | Object3D | null, volume?: number): AudioTrackBuilder;
|
|
21231
21604
|
/**
|
|
21232
21605
|
* Adds an activation track. Subsequent `.clip()` calls define when the bound object is active.
|
|
21233
21606
|
* @param name - Display name for the track
|
|
21234
21607
|
* @param binding - The Object3D to show/hide
|
|
21235
21608
|
*/
|
|
21236
|
-
activationTrack(name: string, binding?: Object3D | null):
|
|
21609
|
+
activationTrack(name: string, binding?: Object3D | null): ActivationTrackBuilder;
|
|
21237
21610
|
/**
|
|
21238
21611
|
* Adds a control track. Subsequent `.clip()` calls control nested timelines or objects.
|
|
21239
21612
|
* @param name - Display name for the track
|
|
21240
21613
|
*/
|
|
21241
|
-
controlTrack(name: string):
|
|
21614
|
+
controlTrack(name: string): ControlTrackBuilder;
|
|
21242
21615
|
/**
|
|
21243
21616
|
* Adds a signal track. Use `.signal()` or `.marker()` to add signal markers.
|
|
21244
21617
|
* @param name - Display name for the track
|
|
21245
21618
|
* @param binding - The SignalReceiver component (optional — if using `.signal()` with callbacks, one is created automatically by {@link install})
|
|
21246
21619
|
*/
|
|
21247
|
-
signalTrack(name: string, binding?: SignalReceiver | Object3D | null):
|
|
21620
|
+
signalTrack(name: string, binding?: SignalReceiver | Object3D | null): SignalTrackBuilder;
|
|
21248
21621
|
/**
|
|
21249
21622
|
* Adds a marker track. Use `.marker()` to add markers.
|
|
21250
21623
|
* @param name - Display name for the track
|
|
21251
21624
|
*/
|
|
21252
|
-
markerTrack(name: string):
|
|
21625
|
+
markerTrack(name: string): MarkerTrackBuilder;
|
|
21253
21626
|
/**
|
|
21254
21627
|
* Adds a clip to the current track. The clip type must match the track type.
|
|
21255
21628
|
*
|
|
21256
|
-
* - On an **animation track**: pass an `AnimationClip` and optional {@link AnimationClipOptions}
|
|
21629
|
+
* - On an **animation track**: pass an `AnimationClip`, a {@link TrackDescriptor}, or a `TrackDescriptor[]` — and optional {@link AnimationClipOptions}
|
|
21257
21630
|
* - On an **audio track**: pass a clip URL (string) and {@link AudioClipOptions}
|
|
21258
21631
|
* - On an **activation track**: pass {@link ActivationClipOptions}
|
|
21259
21632
|
* - On a **control track**: pass an Object3D and {@link ControlClipOptions}
|
|
21260
21633
|
*/
|
|
21261
21634
|
clip(asset: AnimationClip, options?: AnimationClipOptions): this;
|
|
21635
|
+
clip(descriptor: TrackDescriptor, options?: AnimationClipOptions): this;
|
|
21636
|
+
clip(descriptors: TrackDescriptor[], options?: AnimationClipOptions): this;
|
|
21262
21637
|
clip(url: string, options: AudioClipOptions): this;
|
|
21263
21638
|
clip(options: ActivationClipOptions): this;
|
|
21264
21639
|
clip(sourceObject: Object3D, options: ControlClipOptions): this;
|
|
@@ -21293,6 +21668,24 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21293
21668
|
* Mutes the current track so it is skipped during playback.
|
|
21294
21669
|
*/
|
|
21295
21670
|
muted(muted?: boolean): this;
|
|
21671
|
+
/** Adds an animation track descriptor for an Object3D's position or scale to the current animation track */
|
|
21672
|
+
track(target: Object3D, property: "position" | "scale", keyframes: KF_3<Vec3Value>, options?: TrackOptions): this;
|
|
21673
|
+
/** Adds an animation track descriptor for an Object3D's quaternion to the current animation track */
|
|
21674
|
+
track(target: Object3D, property: "quaternion", keyframes: KF_3<QuatValue>, options?: TrackOptions): this;
|
|
21675
|
+
/** Adds an animation track descriptor for an Object3D's rotation (Euler, converted to quaternion) to the current animation track */
|
|
21676
|
+
track(target: Object3D, property: "rotation", keyframes: KF_3<EulerValue>, options?: TrackOptions): this;
|
|
21677
|
+
/** Adds an animation track descriptor for an Object3D's visibility to the current animation track */
|
|
21678
|
+
track(target: Object3D, property: "visible", keyframes: KF_3<boolean>, options?: TrackOptions): this;
|
|
21679
|
+
/** Adds an animation track descriptor for a material's numeric property to the current animation track */
|
|
21680
|
+
track(target: Material, property: "opacity" | "roughness" | "metalness" | "alphaTest" | "emissiveIntensity" | "envMapIntensity" | "bumpScale" | "displacementScale" | "displacementBias", keyframes: KF_3<number>, options?: TrackOptions): this;
|
|
21681
|
+
/** Adds an animation track descriptor for a material's color property to the current animation track */
|
|
21682
|
+
track(target: Material, property: "color" | "emissive", keyframes: KF_3<ColorValue>, options?: TrackOptions): this;
|
|
21683
|
+
/** Adds an animation track descriptor for a light's numeric property to the current animation track */
|
|
21684
|
+
track(target: Light_2, property: "intensity" | "distance" | "angle" | "penumbra" | "decay", keyframes: KF_3<number>, options?: TrackOptions): this;
|
|
21685
|
+
/** Adds an animation track descriptor for a light's color to the current animation track */
|
|
21686
|
+
track(target: Light_2, property: "color", keyframes: KF_3<ColorValue>, options?: TrackOptions): this;
|
|
21687
|
+
/** Adds an animation track descriptor for a camera's numeric property to the current animation track */
|
|
21688
|
+
track(target: PerspectiveCamera, property: "fov" | "near" | "far" | "zoom", keyframes: KF_3<number>, options?: TrackOptions): this;
|
|
21296
21689
|
/**
|
|
21297
21690
|
* Builds and returns the {@link TimelineAssetModel}.
|
|
21298
21691
|
* Assign the result to `PlayableDirector.playableAsset` to play it.
|
|
@@ -21323,6 +21716,73 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21323
21716
|
*/
|
|
21324
21717
|
install(director: PlayableDirector): TimelineAssetModel;
|
|
21325
21718
|
private pushTrack;
|
|
21719
|
+
/** Commits any pending `.track()` descriptors on the current animation track into a clip */
|
|
21720
|
+
private commitInlineTracks;
|
|
21721
|
+
}
|
|
21722
|
+
|
|
21723
|
+
/**
|
|
21724
|
+
* Shared methods available on all track builders and the TimelineBuilder entry point.
|
|
21725
|
+
* Provides track creation, build, and install methods.
|
|
21726
|
+
*
|
|
21727
|
+
* @category Animation and Sequencing
|
|
21728
|
+
*/
|
|
21729
|
+
export declare interface TimelineBuilderBase {
|
|
21730
|
+
/** Adds an animation track. Chain `.clip()` or `.track()` to add content. */
|
|
21731
|
+
animationTrack(name: string, binding?: Animator | Object3D | null): AnimationTrackBuilder;
|
|
21732
|
+
/** Adds an audio track. Chain `.clip()` to add audio clips. */
|
|
21733
|
+
audioTrack(name: string, binding?: AudioSource | Object3D | null, volume?: number): AudioTrackBuilder;
|
|
21734
|
+
/** Adds an activation track. Chain `.clip()` to define activation windows. */
|
|
21735
|
+
activationTrack(name: string, binding?: Object3D | null): ActivationTrackBuilder;
|
|
21736
|
+
/** Adds a control track. Chain `.clip()` to control nested objects/timelines. */
|
|
21737
|
+
controlTrack(name: string): ControlTrackBuilder;
|
|
21738
|
+
/** Adds a signal track. Chain `.signal()` or `.marker()` to add events. */
|
|
21739
|
+
signalTrack(name: string, binding?: SignalReceiver | Object3D | null): SignalTrackBuilder;
|
|
21740
|
+
/** Adds a marker track. Chain `.marker()` to add markers. */
|
|
21741
|
+
markerTrack(name: string): MarkerTrackBuilder;
|
|
21742
|
+
/** Builds and returns the {@link TimelineAssetModel}. */
|
|
21743
|
+
build(): TimelineAssetModel;
|
|
21744
|
+
/** Builds the timeline, assigns it to the director, and wires up signal callbacks. */
|
|
21745
|
+
install(director: PlayableDirector): TimelineAssetModel;
|
|
21746
|
+
}
|
|
21747
|
+
|
|
21748
|
+
export declare class TimelineControlTrack extends TimelineTrackHandler {
|
|
21749
|
+
models: Array<Models.ClipModel>;
|
|
21750
|
+
timelines: Array<PlayableDirector | null>;
|
|
21751
|
+
resolveSourceObjects(_context: Context): void;
|
|
21752
|
+
private _previousActiveModel;
|
|
21753
|
+
evaluate(time: number): void;
|
|
21754
|
+
}
|
|
21755
|
+
|
|
21756
|
+
export declare class TimelineMarkerTrack extends TimelineTrackHandler {
|
|
21757
|
+
models: Array<Models.MarkerModel & Record<string, any>>;
|
|
21758
|
+
needsSorting: boolean;
|
|
21759
|
+
foreachMarker<T>(type?: string | null): Generator<T, void, unknown>;
|
|
21760
|
+
onEnable(): void;
|
|
21761
|
+
evaluate(_time: number): void;
|
|
21762
|
+
private sort;
|
|
21763
|
+
}
|
|
21764
|
+
|
|
21765
|
+
/**
|
|
21766
|
+
* A TrackHandler is responsible for evaluating a specific type of timeline track.
|
|
21767
|
+
* A timeline track can be an animation track, audio track, signal track, control track etc and is controlled by a {@link PlayableDirector}.
|
|
21768
|
+
*/
|
|
21769
|
+
export declare abstract class TimelineTrackHandler {
|
|
21770
|
+
director: PlayableDirector;
|
|
21771
|
+
track: Models.TrackModel;
|
|
21772
|
+
get muted(): boolean;
|
|
21773
|
+
set muted(val: boolean);
|
|
21774
|
+
forEachClip(backwards?: boolean): IterableIterator<Models.ClipModel>;
|
|
21775
|
+
onEnable?(): any;
|
|
21776
|
+
onDisable?(): any;
|
|
21777
|
+
onDestroy?(): any;
|
|
21778
|
+
abstract evaluate(time: number): any;
|
|
21779
|
+
onMuteChanged?(): any;
|
|
21780
|
+
onPauseChanged?(): any;
|
|
21781
|
+
/** invoked when PlayableDirectory playmode state changes (paused, playing, stopped) */
|
|
21782
|
+
onStateChanged?(isPlaying: boolean): any;
|
|
21783
|
+
getClipTime(time: number, model: Models.ClipModel): number;
|
|
21784
|
+
getClipTimeNormalized(time: number, model: Models.ClipModel): number;
|
|
21785
|
+
evaluateWeight(time: number, index: number, models: Array<Models.ClipModel>, isActive?: boolean): number;
|
|
21326
21786
|
}
|
|
21327
21787
|
|
|
21328
21788
|
declare type TonemappingAttributeOptions = "none" | "linear" | "neutral" | "agx";
|
|
@@ -21353,27 +21813,20 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21353
21813
|
export declare function toSourceId(src: string | null): SourceIdentifier | undefined;
|
|
21354
21814
|
|
|
21355
21815
|
/**
|
|
21356
|
-
*
|
|
21357
|
-
*
|
|
21816
|
+
* An opaque descriptor for a single animation track.
|
|
21817
|
+
* Created by {@link track} and resolved into a Three.js KeyframeTrack
|
|
21818
|
+
* when passed to {@link createAnimation}, or inline to
|
|
21819
|
+
* {@link AnimatorControllerBuilder.state} / {@link TimelineBuilder.clip}.
|
|
21820
|
+
*
|
|
21821
|
+
* @category Animation and Sequencing
|
|
21358
21822
|
*/
|
|
21359
|
-
|
|
21360
|
-
|
|
21361
|
-
|
|
21362
|
-
|
|
21363
|
-
|
|
21364
|
-
|
|
21365
|
-
|
|
21366
|
-
onDisable?(): any;
|
|
21367
|
-
onDestroy?(): any;
|
|
21368
|
-
abstract evaluate(time: number): any;
|
|
21369
|
-
onMuteChanged?(): any;
|
|
21370
|
-
onPauseChanged?(): any;
|
|
21371
|
-
/** invoked when PlayableDirectory playmode state changes (paused, playing, stopped) */
|
|
21372
|
-
onStateChanged?(isPlaying: boolean): any;
|
|
21373
|
-
getClipTime(time: number, model: Models.ClipModel): number;
|
|
21374
|
-
getClipTimeNormalized(time: number, model: Models.ClipModel): number;
|
|
21375
|
-
evaluateWeight(time: number, index: number, models: Array<Models.ClipModel>, isActive?: boolean): number;
|
|
21376
|
-
}
|
|
21823
|
+
declare type TrackDescriptor = {
|
|
21824
|
+
readonly __isTrackDescriptor: true;
|
|
21825
|
+
/* Excluded from this release type: _target */
|
|
21826
|
+
/* Excluded from this release type: _property */
|
|
21827
|
+
/* Excluded from this release type: _keyframes */
|
|
21828
|
+
/* Excluded from this release type: _root */
|
|
21829
|
+
};
|
|
21377
21830
|
|
|
21378
21831
|
/**
|
|
21379
21832
|
* @category Animation and Sequencing
|
|
@@ -21399,15 +21852,26 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21399
21852
|
rotation: Quat | Quaternion;
|
|
21400
21853
|
};
|
|
21401
21854
|
|
|
21855
|
+
/** Options for a single track */
|
|
21856
|
+
declare type TrackOptions = {
|
|
21857
|
+
/**
|
|
21858
|
+
* Root object for resolving the track path.
|
|
21859
|
+
* - If `root === target` → self-targeting (`.property`)
|
|
21860
|
+
* - If `root !== target` → named targeting (`"targetName.property"` using `target.name`)
|
|
21861
|
+
* - If omitted → self-targeting by default
|
|
21862
|
+
*/
|
|
21863
|
+
root?: Object3D;
|
|
21864
|
+
};
|
|
21865
|
+
|
|
21402
21866
|
declare namespace Tracks {
|
|
21403
21867
|
export {
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21868
|
+
TimelineTrackHandler,
|
|
21869
|
+
TimelineAnimationTrack,
|
|
21870
|
+
TimelineAudioTrack,
|
|
21871
|
+
TimelineMarkerTrack,
|
|
21408
21872
|
SignalTrackHandler,
|
|
21409
|
-
|
|
21410
|
-
|
|
21873
|
+
TimelineActivationTrack,
|
|
21874
|
+
TimelineControlTrack
|
|
21411
21875
|
}
|
|
21412
21876
|
}
|
|
21413
21877
|
|
|
@@ -21613,10 +22077,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21613
22077
|
export declare type TransitionOptions = {
|
|
21614
22078
|
/** Duration of the crossfade in seconds (default: 0) */
|
|
21615
22079
|
duration?: number;
|
|
21616
|
-
/** Normalized exit time 0-1
|
|
22080
|
+
/** Normalized exit time 0-1. When set, the transition waits until the source animation reaches this point before transitioning. */
|
|
21617
22081
|
exitTime?: number;
|
|
21618
|
-
/** Whether the transition waits for exitTime before transitioning (default: false) */
|
|
21619
|
-
hasExitTime?: boolean;
|
|
21620
22082
|
/** Normalized offset into the destination state's animation (default: 0) */
|
|
21621
22083
|
offset?: number;
|
|
21622
22084
|
/** Whether duration is in seconds (true) or normalized (false) (default: false) */
|
|
@@ -21686,6 +22148,18 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21686
22148
|
|
|
21687
22149
|
export declare function tryGetGuid(obj: any): string | undefined | null;
|
|
21688
22150
|
|
|
22151
|
+
/** Shorthand for a simple two-keyframe animation (start → end) */
|
|
22152
|
+
export declare type Tween<V> = {
|
|
22153
|
+
/** Start value (at time 0) */
|
|
22154
|
+
from: V;
|
|
22155
|
+
/** End value (at time = duration) */
|
|
22156
|
+
to: V;
|
|
22157
|
+
/** Duration in seconds (default: 1) */
|
|
22158
|
+
duration?: number;
|
|
22159
|
+
/** Interpolation mode (default: `"linear"`) */
|
|
22160
|
+
interpolation?: AnimationInterpolation;
|
|
22161
|
+
};
|
|
22162
|
+
|
|
21689
22163
|
declare type Type = new (...args: any[]) => any;
|
|
21690
22164
|
|
|
21691
22165
|
declare type TypeResolver<T> = (data: any) => Constructor<T> | null;
|
|
@@ -22209,6 +22683,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
22209
22683
|
z: number;
|
|
22210
22684
|
};
|
|
22211
22685
|
|
|
22686
|
+
/** A Vector3 value, either as a Three.js Vector3 or as a `[x, y, z]` tuple */
|
|
22687
|
+
declare type Vec3Value = Vector3 | [number, number, number];
|
|
22688
|
+
|
|
22212
22689
|
export declare type Vec4 = {
|
|
22213
22690
|
x: number;
|
|
22214
22691
|
y: number;
|
|
@@ -24173,28 +24650,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24173
24650
|
export { }
|
|
24174
24651
|
|
|
24175
24652
|
|
|
24176
|
-
declare module 'three' {
|
|
24177
|
-
interface SkinnedMesh {
|
|
24178
|
-
staticGenerator?: StaticGeometryGenerator;
|
|
24179
|
-
staticGeometry?: BufferGeometry;
|
|
24180
|
-
staticGeometryLastUpdate?: number;
|
|
24181
|
-
}
|
|
24182
|
-
interface Mesh {
|
|
24183
|
-
acceleratedRaycast?: any;
|
|
24184
|
-
}
|
|
24185
|
-
interface SkinnedMesh {
|
|
24186
|
-
/** @deprecated use autoUpdateMeshBvhInterval */
|
|
24187
|
-
autoUpdateMeshBVH?: boolean;
|
|
24188
|
-
/**
|
|
24189
|
-
* Interval in milliseconds to automatically update the mesh BVH. When set to >= 0 the BVH will be updated every x milliseconds.
|
|
24190
|
-
* @default undefined (disabled)
|
|
24191
|
-
*/
|
|
24192
|
-
autoUpdateMeshBvhInterval?: number;
|
|
24193
|
-
bvhNeedsUpdate?: boolean;
|
|
24194
|
-
}
|
|
24195
|
-
}
|
|
24196
|
-
|
|
24197
|
-
|
|
24198
24653
|
declare module 'three' {
|
|
24199
24654
|
interface Object3D {
|
|
24200
24655
|
get guid(): string | undefined;
|
|
@@ -24340,3 +24795,25 @@ declare module 'three' {
|
|
|
24340
24795
|
slerp(end: Vector3, t: number): Vector3;
|
|
24341
24796
|
}
|
|
24342
24797
|
}
|
|
24798
|
+
|
|
24799
|
+
|
|
24800
|
+
declare module 'three' {
|
|
24801
|
+
interface SkinnedMesh {
|
|
24802
|
+
staticGenerator?: StaticGeometryGenerator;
|
|
24803
|
+
staticGeometry?: BufferGeometry;
|
|
24804
|
+
staticGeometryLastUpdate?: number;
|
|
24805
|
+
}
|
|
24806
|
+
interface Mesh {
|
|
24807
|
+
acceleratedRaycast?: any;
|
|
24808
|
+
}
|
|
24809
|
+
interface SkinnedMesh {
|
|
24810
|
+
/** @deprecated use autoUpdateMeshBvhInterval */
|
|
24811
|
+
autoUpdateMeshBVH?: boolean;
|
|
24812
|
+
/**
|
|
24813
|
+
* Interval in milliseconds to automatically update the mesh BVH. When set to >= 0 the BVH will be updated every x milliseconds.
|
|
24814
|
+
* @default undefined (disabled)
|
|
24815
|
+
*/
|
|
24816
|
+
autoUpdateMeshBvhInterval?: number;
|
|
24817
|
+
bvhNeedsUpdate?: boolean;
|
|
24818
|
+
}
|
|
24819
|
+
}
|