@hology/core 0.0.188 → 0.0.191

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.
Files changed (73) hide show
  1. package/dist/effects/sequence/audio-parameters.d.ts +25 -0
  2. package/dist/effects/sequence/audio-parameters.js +4 -0
  3. package/dist/effects/sequence/index.d.ts +8 -0
  4. package/dist/effects/sequence/index.js +4 -0
  5. package/dist/effects/sequence/sequence-action.d.ts +17 -0
  6. package/dist/effects/sequence/sequence-action.js +4 -0
  7. package/dist/effects/sequence/sequence-actor.d.ts +135 -0
  8. package/dist/effects/sequence/sequence-actor.js +4 -0
  9. package/dist/effects/sequence/sequence-data.d.ts +458 -0
  10. package/dist/effects/sequence/sequence-data.js +4 -0
  11. package/dist/effects/sequence/sequence-event.d.ts +37 -0
  12. package/dist/effects/sequence/sequence-event.js +4 -0
  13. package/dist/effects/sequence/sequence-player.d.ts +323 -0
  14. package/dist/effects/sequence/sequence-player.js +4 -0
  15. package/dist/effects/sequence/sequencer.d.ts +7 -0
  16. package/dist/effects/sequence/sequencer.js +4 -0
  17. package/dist/effects/vfx/trail-renderer.d.ts +19 -15
  18. package/dist/effects/vfx/trail-renderer.js +1 -1
  19. package/dist/gameplay/actors/actor.js +1 -1
  20. package/dist/gameplay/actors/builtin/components/character/character-animation.d.ts +151 -0
  21. package/dist/gameplay/actors/builtin/components/character/character-animation.js +1 -1
  22. package/dist/gameplay/actors/builtin/components/character/character-movement.d.ts +2 -0
  23. package/dist/gameplay/actors/builtin/components/character/character-movement.js +1 -1
  24. package/dist/gameplay/actors/builtin/components/mesh-component.js +1 -1
  25. package/dist/gameplay/actors/builtin/index.d.ts +2 -0
  26. package/dist/gameplay/actors/builtin/index.js +1 -1
  27. package/dist/gameplay/actors/camera/third-person-camera-component.js +1 -1
  28. package/dist/gameplay/actors/factory.d.ts +3 -0
  29. package/dist/gameplay/actors/factory.js +1 -1
  30. package/dist/gameplay/actors/internal/component-init.d.ts +1 -0
  31. package/dist/gameplay/actors/internal/component-init.js +1 -1
  32. package/dist/gameplay/index.d.ts +1 -1
  33. package/dist/gameplay/index.js +1 -1
  34. package/dist/gameplay/initiate.js +1 -1
  35. package/dist/gameplay/input/input-service.d.ts +16 -2
  36. package/dist/gameplay/input/input-service.js +1 -1
  37. package/dist/gameplay/input/input.d.ts +3 -0
  38. package/dist/gameplay/input/input.js +1 -1
  39. package/dist/gameplay/input/keybind.d.ts +37 -0
  40. package/dist/gameplay/input/keybind.js +1 -1
  41. package/dist/gameplay/services/asset-loader.d.ts +4 -1
  42. package/dist/gameplay/services/asset-loader.js +1 -1
  43. package/dist/gameplay/services/physics/physics-system.d.ts +7 -1
  44. package/dist/gameplay/services/physics/physics-system.js +1 -1
  45. package/dist/gameplay/services/world.js +1 -1
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.js +1 -1
  48. package/dist/rendering/fog/fog-volume-actor.d.ts +1 -1
  49. package/dist/rendering/fog/fog-volume-actor.js +1 -1
  50. package/dist/rendering/fog/volumetric-fog-pass.d.ts +1 -0
  51. package/dist/rendering/fog/volumetric-fog-pass.js +1 -1
  52. package/dist/rendering.d.ts +2 -0
  53. package/dist/rendering.js +1 -1
  54. package/dist/scene/asset-resource-loader.d.ts +23 -3
  55. package/dist/scene/asset-resource-loader.js +1 -1
  56. package/dist/scene/bootstrap.d.ts +1 -2
  57. package/dist/scene/collision/collision-shape-import.js +1 -1
  58. package/dist/scene/landscape/landscape.d.ts +1 -1
  59. package/dist/scene/landscape/landscape.js +1 -1
  60. package/dist/scene/materializer.d.ts +4 -1
  61. package/dist/scene/materializer.js +1 -1
  62. package/dist/scene/model.d.ts +20 -2
  63. package/dist/scene/model.js +1 -1
  64. package/dist/scene/storage/storage.js +1 -1
  65. package/dist/shader/color-layer.d.ts +1 -1
  66. package/dist/shader/color-layer.js +1 -1
  67. package/dist/shader/parameter.d.ts +3 -2
  68. package/dist/shader/shader.d.ts +3 -2
  69. package/dist/shader-nodes/glsl-node.d.ts +1 -1
  70. package/dist/test/injection.test.js +1 -1
  71. package/dist/utils/three/outline-pass.js +1 -1
  72. package/package.json +4 -1
  73. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,25 @@
1
+ export type AudioParameterId = 'volume' | 'detune' | 'pan' | 'spatialBlend' | 'lowpass' | 'highpass';
2
+ export interface AudioParameterDefinition {
3
+ id: AudioParameterId;
4
+ /** Name shown in the track list */
5
+ displayName: string;
6
+ /** Label shown for the animated keyframe value */
7
+ valueLabel: string;
8
+ /** Short, artist-friendly help text shown in the editor tooltip */
9
+ helpText: string;
10
+ /** Optional unit suffix (purely descriptive, not used for formatting) */
11
+ unit?: string;
12
+ /** Default keyframe value when adding a keyframe to this sub-track */
13
+ defaultValue: number;
14
+ /** Default drag step size in the editor */
15
+ step: number;
16
+ /**
17
+ * Hard bounds for this parameter (if present, editor may clamp and runtime may clamp).
18
+ * For filters these simply constrain cutoff to a sensible range.
19
+ */
20
+ min?: number;
21
+ max?: number;
22
+ }
23
+ export declare const AUDIO_PARAMETER_DEFINITIONS: Record<AudioParameterId, AudioParameterDefinition>;
24
+ export declare function getAudioParameterDefinition(id: AudioParameterId): AudioParameterDefinition;
25
+ //# sourceMappingURL=audio-parameters.d.ts.map
@@ -0,0 +1,4 @@
1
+ export const AUDIO_PARAMETER_DEFINITIONS={volume:{id:"volume",displayName:"Volume",valueLabel:"Volume",helpText:"Loudness multiplier (0 = silent, 1 = original). Use keyframes to fade, duck, or punch accents over time.",defaultValue:1,step:.01,min:0,max:1},detune:{id:"detune",displayName:"Detune",valueLabel:"Detune (cents)",helpText:"Pitch offset in cents (100 = one semitone). Great for pitch ramps, wobble, or subtle variation; use small values for realism.",defaultValue:0,step:1},pan:{id:"pan",displayName:"Pan",valueLabel:"Pan",helpText:"Stereo left/right for non-spatial audio (-1 = left, 0 = center, 1 = right). Only applies when Spatial Audio is OFF. Use for UI/2D sounds or stylized sweeps.",defaultValue:0,step:.01,min:-1,max:1},spatialBlend:{id:"spatialBlend",displayName:"Spatial Blend",valueLabel:"Spatial Blend",helpText:"Requires Spatial Audio enabled on the track. 0 = sound is pulled to the listener (centered/2D-ish). 1 = fully positional in world. Useful for “cheating” SFX toward camera.",defaultValue:0,step:.01,min:0,max:1},lowpass:{id:"lowpass",displayName:"Low Pass Filter",valueLabel:"Cutoff (Hz)",helpText:"Lets low frequencies through and reduces highs. Lower cutoff = more “muffled/underwater/behind wall”. Typical: ~200–8000 Hz.",unit:"Hz",defaultValue:2e4,step:10,min:20,max:2e4},highpass:{id:"highpass",displayName:"High Pass Filter",valueLabel:"Cutoff (Hz)",helpText:"Lets high frequencies through and reduces lows. Higher cutoff = thinner/brighter/telephone. Typical: ~20–500 Hz (subtle), 1k+ (stylized).",unit:"Hz",defaultValue:20,step:10,min:20,max:2e4}};export function getAudioParameterDefinition(e){return AUDIO_PARAMETER_DEFINITIONS[e]}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,8 @@
1
+ export * from './sequence-data.js';
2
+ export * from './sequence-event.js';
3
+ export * from './sequence-player.js';
4
+ export * from './sequence-actor.js';
5
+ export * from './sequencer.js';
6
+ export * from './sequence-action.js';
7
+ export * from './audio-parameters.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export*from"./sequence-data.js";export*from"./sequence-event.js";export*from"./sequence-player.js";export*from"./sequence-actor.js";export*from"./sequencer.js";export*from"./sequence-action.js";export*from"./audio-parameters.js";/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,17 @@
1
+ import { SequenceRole } from './sequence-data.js';
2
+ import { BaseActor } from '../../gameplay/actors/actor.js';
3
+ import { Object3D } from 'three';
4
+ /**
5
+ * SequenceAction is used to play, pause, stop, etc. a sequence.
6
+ */
7
+ export interface SequenceAction {
8
+ /** Bind a role to a runtime target for dynamic actor binding */
9
+ bindRole(role: SequenceRole, target: BaseActor | Object3D): void;
10
+ play(): void;
11
+ pause(): void;
12
+ stop(): void;
13
+ restart(): void;
14
+ seek(time: number): void;
15
+ dispose(): void;
16
+ }
17
+ //# sourceMappingURL=sequence-action.d.ts.map
@@ -0,0 +1,4 @@
1
+ export{};/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,135 @@
1
+ import { BaseActor } from '../../gameplay/actors/actor.js';
2
+ import { SequenceData, SequenceRole } from './sequence-data.js';
3
+ import { SequencePlaybackState } from './sequence-player.js';
4
+ import { Asset } from '../../scene/model.js';
5
+ import { Subject } from 'rxjs';
6
+ import { Object3D } from 'three';
7
+ import { SequenceAction } from './sequence-action.js';
8
+ /**
9
+ * SequenceActor is an actor that plays a sequence in the world.
10
+ *
11
+ * Similar to VfxActor, it can be placed in a scene for cinematics or
12
+ * used programmatically for player abilities and gameplay sequences.
13
+ *
14
+ * The sequence data can be:
15
+ * 1. Inline data stored directly on the actor (for one-off scene-specific sequences)
16
+ * 2. Loaded from a SequenceAsset (for reusable sequences like abilities)
17
+ *
18
+ * @example
19
+ * // Place in scene as cinematic
20
+ * // Configure sequence data in the editor's sequence panel
21
+ *
22
+ * @example
23
+ * // Use in code for player ability
24
+ * const sequence = await actorFactory.create(SequenceActor)
25
+ * sequence.loadFromAssetId('my-ability-sequence')
26
+ * sequence.bindRole(SequenceRole.Self, playerActor)
27
+ * sequence.play()
28
+ */
29
+ export declare class SequenceActor extends BaseActor implements SequenceAction {
30
+ /**
31
+ * Inline sequence data - stored directly on the actor.
32
+ * This is used for scene-specific sequences that aren't reused.
33
+ */
34
+ sequenceData: SequenceData;
35
+ /**
36
+ * Optional reference to a sequence asset for reusable sequences.
37
+ * If set, this takes precedence over inline sequenceData.
38
+ */
39
+ sequenceAssetId: string | null;
40
+ /**
41
+ * Playback rate multiplier
42
+ */
43
+ get timescale(): number;
44
+ set timescale(value: number);
45
+ /**
46
+ * Whether the sequence loops
47
+ */
48
+ get loop(): boolean;
49
+ set loop(value: boolean);
50
+ /**
51
+ * Current playback state
52
+ */
53
+ get state(): SequencePlaybackState;
54
+ /**
55
+ * Current playback time in seconds
56
+ */
57
+ get time(): number;
58
+ /**
59
+ * Total duration of the sequence
60
+ */
61
+ get duration(): number;
62
+ /**
63
+ * Whether playback is currently paused
64
+ */
65
+ get paused(): boolean;
66
+ /**
67
+ * When true, the player will not advance time internally.
68
+ * Time must be controlled externally via seek().
69
+ * This is useful for editor preview where the UI controls playback position.
70
+ */
71
+ get externalTimeControl(): boolean;
72
+ set externalTimeControl(value: boolean);
73
+ readonly onComplete: Subject<void>;
74
+ readonly onLoop: Subject<number>;
75
+ private player;
76
+ private viewController;
77
+ private assetLoader;
78
+ private world;
79
+ private actorFactory;
80
+ private vfxService;
81
+ private sourceAsset;
82
+ onInit(): Promise<void>;
83
+ /**
84
+ * Load sequence data from an asset
85
+ */
86
+ loadFromAsset(asset: Asset): Promise<void>;
87
+ /**
88
+ * Load sequence data from an asset ID
89
+ */
90
+ loadFromAssetId(assetId: string): Promise<void>;
91
+ /**
92
+ * Update inline sequence data directly
93
+ */
94
+ setSequenceData(data: SequenceData): void;
95
+ /**
96
+ * Bind a role to a runtime target.
97
+ * This allows tracks with a role to target a different actor at runtime.
98
+ *
99
+ * @example
100
+ * sequenceActor.bindRole(SequenceRole.Self, playerActor)
101
+ * sequenceActor.bindRole(SequenceRole.Target, enemyActor)
102
+ */
103
+ bindRole(role: SequenceRole, target: BaseActor | Object3D): void;
104
+ /**
105
+ * Bind a scene object by ID to a target
106
+ */
107
+ bindObject(objectId: string, target: Object3D | BaseActor): void;
108
+ /**
109
+ * Start or resume playback
110
+ */
111
+ play(): void;
112
+ /**
113
+ * Pause playback
114
+ */
115
+ pause(): void;
116
+ /**
117
+ * Stop playback and reset to beginning
118
+ */
119
+ stop(): void;
120
+ /**
121
+ * Restart playback from the beginning
122
+ */
123
+ restart(): void;
124
+ /**
125
+ * Seek to a specific time
126
+ */
127
+ seek(time: number): void;
128
+ /**
129
+ * Update the sequence (called automatically from render loop)
130
+ */
131
+ onUpdate(deltaTime: number): void;
132
+ onEndPlay(): void;
133
+ dispose(): void;
134
+ }
135
+ //# sourceMappingURL=sequence-actor.d.ts.map
@@ -0,0 +1,4 @@
1
+ import{__decorate as e,__metadata as t}from"tslib";import{Actor as s,BaseActor as r}from"../../gameplay/actors/actor.js";import{inject as a}from"../../gameplay/inject.js";import{ViewController as i}from"../../gameplay/services/render.js";import{AssetLoader as o}from"../../gameplay/services/asset-loader.js";import{World as l}from"../../gameplay/services/world.js";import{ActorFactory as p}from"../../gameplay/actors/factory.js";import{VfxService as n}from"../../effects/vfx/vfx-service.js";import{Parameter as h}from"../../shader/parameter.js";import{createSequenceData as c}from"./sequence-data.js";import{SequencePlayer as y,SequencePlaybackState as d}from"./sequence-player.js";import{Subject as m,takeUntil as u}from"rxjs";let f=class extends r{constructor(){super(...arguments),this.sequenceData=c(),this.sequenceAssetId=null,this.onComplete=new m,this.onLoop=new m,this.player=new y,this.viewController=a(i),this.assetLoader=a(o),this.world=a(l),this.actorFactory=a(p),this.vfxService=a(n),this.sourceAsset=null}get timescale(){return this.player.timescale}set timescale(e){this.player.timescale=e}get loop(){return this.player.loop}set loop(e){this.player.loop=e}get state(){return this.player.state}get time(){return this.player.time}get duration(){return this.player.duration}get paused(){return this.player.state===d.Paused}get externalTimeControl(){return this.player.externalTimeControl}set externalTimeControl(e){this.player.externalTimeControl=e}async onInit(){this.player.setWorld(this.world),this.player.setAudioListener(this.viewController.audioListener),this.player.setAssetLoader(this.assetLoader),this.player.setActorFactory(this.actorFactory),this.player.setVfxService(this.vfxService),this.viewController.onUpdate(this).pipe(u(this.disposed)).subscribe(e=>this.player.update(e)),this.player.onComplete.pipe(u(this.disposed)).subscribe(()=>this.onComplete.next()),this.player.onLoop.pipe(u(this.disposed)).subscribe(e=>this.onLoop.next(e)),this.sequenceAssetId?await this.loadFromAssetId(this.sequenceAssetId):this.sequenceData&&this.player.load(this.sequenceData)}async loadFromAsset(e){if("sequence"!==e.type)throw new Error(`Asset must be a sequence asset but is ${e.type}`);this.sourceAsset=e,this.sourceAsset.sequence&&(this.sequenceData=this.sourceAsset.sequence,this.player.load(this.sequenceData))}async loadFromAssetId(e){const t=await this.assetLoader.getAsset(e);t&&await this.loadFromAsset(t)}setSequenceData(e){this.sequenceData=e,this.player.load(e)}bindRole(e,t){this.player.bindRole(e,t)}bindObject(e,t){this.player.bindObject(e,t)}play(){this.player.play()}pause(){this.player.pause()}stop(){this.player.stop()}restart(){this.player.restart()}seek(e){this.player.seek(e)}onUpdate(e){}onEndPlay(){this.player.dispose()}dispose(){this.world.removeActor(this)}};e([h({label:"Sequence Data"}),t("design:type",Object)],f.prototype,"sequenceData",void 0),f=e([s()],f);export{f as SequenceActor};/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */
@@ -0,0 +1,458 @@
1
+ import { AssetId, CustomParamValue, SerializedParamType } from '../../scene/model.js';
2
+ import { AudioParameterId } from './audio-parameters.js';
3
+ /**
4
+ * The main sequence data structure containing all tracks and playback settings.
5
+ * This is stored as a parameter on SequenceActor or as part of a SequenceAsset.
6
+ */
7
+ export interface SequenceData {
8
+ /** Total duration of the sequence in seconds */
9
+ duration: number;
10
+ /** Whether the sequence should loop */
11
+ loop: boolean;
12
+ /** Playback rate multiplier (default 1.0) */
13
+ playbackRate: number;
14
+ /** All tracks in this sequence */
15
+ tracks: SequenceTrack[];
16
+ }
17
+ export declare class Sequence {
18
+ data: SequenceData;
19
+ constructor(data: SequenceData);
20
+ }
21
+ /**
22
+ * Predefined roles for binding actors to sequence tracks at runtime.
23
+ * Used for abilities, combat sequences, and cinematics where actors
24
+ * are dynamically bound when the sequence is played.
25
+ */
26
+ export declare enum SequenceRole {
27
+ /** The actor executing the sequence (e.g., player casting an ability) */
28
+ Self = "self",
29
+ /** Primary target (e.g., enemy being attacked, ally being healed) */
30
+ Target = "target",
31
+ /** Second target for multi-target abilities */
32
+ Target2 = "target2",
33
+ /** Third target for multi-target abilities */
34
+ Target3 = "target3",
35
+ /** Secondary actor (e.g., companion, summoned entity) */
36
+ Secondary = "secondary"
37
+ }
38
+ export type SequenceTrackType = 'object' | 'camera' | 'audio' | 'vfx' | 'spawn' | 'group';
39
+ /**
40
+ * Base interface for all track types
41
+ */
42
+ export interface TrackParenting {
43
+ /** The ID of the parent track */
44
+ trackId: string;
45
+ /** The name of the socket/bone to attach to (optional, defaults to root) */
46
+ socketName?: string;
47
+ }
48
+ export interface BaseTrack {
49
+ /** Unique identifier */
50
+ id: string;
51
+ /** Display name shown in editor */
52
+ name: string;
53
+ /** Track type discriminator */
54
+ type: SequenceTrackType;
55
+ /** Whether this track is muted (skipped during playback) */
56
+ muted: boolean;
57
+ /** Whether this track is locked (cannot be edited) */
58
+ locked: boolean;
59
+ /** Sub-tracks contained within this track */
60
+ subTracks: SubTrack[];
61
+ /** Parent track info */
62
+ parent?: TrackParenting;
63
+ }
64
+ /**
65
+ * Object track - references a scene object (actor, mesh, light, etc.)
66
+ * Can animate transforms, properties, and material parameters.
67
+ */
68
+ export interface ObjectTrack extends BaseTrack {
69
+ type: 'object';
70
+ /** Scene object ID being targeted */
71
+ targetId: string | null;
72
+ /**
73
+ * Role for runtime binding. When set, the track can target
74
+ * a different actor at runtime based on the role (e.g., Self, Target).
75
+ */
76
+ role: SequenceRole | null;
77
+ }
78
+ /**
79
+ * Camera track - controls a sequence-owned camera
80
+ */
81
+ export interface CameraTrack extends BaseTrack {
82
+ type: 'camera';
83
+ /** Camera settings */
84
+ cameraSettings: {
85
+ fov: number;
86
+ near: number;
87
+ far: number;
88
+ };
89
+ }
90
+ /**
91
+ * Audio track - plays audio assets
92
+ */
93
+ export interface AudioTrack extends BaseTrack {
94
+ type: 'audio';
95
+ /** Audio clips placed on the timeline */
96
+ clips: AudioClipInstance[];
97
+ /** Track volume multiplier (0-1) */
98
+ volume: number;
99
+ /** Whether audio should be spatialized (3D) */
100
+ spatial: boolean;
101
+ }
102
+ /**
103
+ * VFX track - spawns and controls visual effects
104
+ */
105
+ export interface VfxTrack extends BaseTrack {
106
+ type: 'vfx';
107
+ /** VFX clips placed on the timeline */
108
+ clips: VfxClipInstance[];
109
+ /** Base position relative to sequence root or absolute */
110
+ position: [number, number, number];
111
+ /** Base rotation in euler angles */
112
+ rotation: [number, number, number];
113
+ /** Base scale */
114
+ scale: [number, number, number];
115
+ }
116
+ export type SpawnTrackType = 'actor' | 'prefab' | 'mesh';
117
+ /**
118
+ * Spawn track - spawns actors or prefabs for the duration of a clip
119
+ */
120
+ export interface SpawnTrack extends BaseTrack {
121
+ type: 'spawn';
122
+ /**
123
+ * What should be spawned
124
+ */
125
+ spawnType: SpawnTrackType;
126
+ /**
127
+ * Role for runtime binding. When set, the spawned actor is substituted
128
+ * with a dynamically bound actor at runtime (similar to Unreal's "possessable" system).
129
+ */
130
+ role?: SequenceRole | null;
131
+ /** The class name of an Actor */
132
+ actorType?: string;
133
+ /** The asset ID of a Prefab */
134
+ prefabId?: AssetId | null;
135
+ /** The asset ID of a Mesh */
136
+ meshId?: AssetId | null;
137
+ /** Spawn clips placed on the timeline */
138
+ clips: SpawnClipInstance[];
139
+ }
140
+ /**
141
+ * Group track - organizes other tracks without adding functionality
142
+ */
143
+ export interface GroupTrack extends BaseTrack {
144
+ type: 'group';
145
+ /** Collapsed state in editor */
146
+ collapsed: boolean;
147
+ /** Child tracks within this group */
148
+ childTracks: SequenceTrack[];
149
+ }
150
+ export type SequenceTrack = ObjectTrack | CameraTrack | AudioTrack | VfxTrack | SpawnTrack | GroupTrack;
151
+ export type SubTrackType = 'transform' | 'animation' | 'property' | 'material' | 'visibility' | 'event' | 'audioParameter';
152
+ /**
153
+ * Base interface for sub-tracks
154
+ */
155
+ export interface BaseSubTrack {
156
+ /** Unique identifier */
157
+ id: string;
158
+ /** Display name */
159
+ name: string;
160
+ /** Sub-track type discriminator */
161
+ type: SubTrackType;
162
+ /** Whether this sub-track is muted */
163
+ muted: boolean;
164
+ }
165
+ /**
166
+ * Transform sub-track - animates position, rotation, and scale
167
+ */
168
+ export interface TransformSubTrack extends BaseSubTrack {
169
+ type: 'transform';
170
+ /** Which transform components are animated */
171
+ components: {
172
+ position: boolean;
173
+ rotation: boolean;
174
+ scale: boolean;
175
+ };
176
+ /** Keyframes for transform animation */
177
+ keyframes: TransformKeyframe[];
178
+ }
179
+ /**
180
+ * Animation sub-track - plays animation clips on skeletal meshes
181
+ */
182
+ export interface AnimationSubTrack extends BaseSubTrack {
183
+ type: 'animation';
184
+ /** Animation clips placed on the timeline */
185
+ clips: AnimationClipInstance[];
186
+ }
187
+ /**
188
+ * Property sub-track - animates arbitrary numeric/color/vector properties
189
+ */
190
+ export interface PropertySubTrack extends BaseSubTrack {
191
+ type: 'property';
192
+ /** Path to the property (e.g., "light.intensity") */
193
+ propertyPath: string;
194
+ /** The type of property being animated */
195
+ propertyType: SerializedParamType;
196
+ /** Keyframes for property animation */
197
+ keyframes: PropertyKeyframe[];
198
+ }
199
+ /**
200
+ * Material sub-track - animates material shader uniforms
201
+ */
202
+ export interface MaterialSubTrack extends BaseSubTrack {
203
+ type: 'material';
204
+ /** Material slot index or name */
205
+ materialSlot: string | number;
206
+ /** Uniform name to animate */
207
+ uniformName: string;
208
+ /** The type of uniform being animated */
209
+ uniformType: SerializedParamType;
210
+ /** Keyframes for uniform animation */
211
+ keyframes: PropertyKeyframe[];
212
+ }
213
+ /**
214
+ * Visibility sub-track - toggles object visibility
215
+ */
216
+ export interface VisibilitySubTrack extends BaseSubTrack {
217
+ type: 'visibility';
218
+ /** Visibility state changes */
219
+ keyframes: VisibilityKeyframe[];
220
+ }
221
+ /**
222
+ * Event sub-track - triggers function calls at specific times
223
+ */
224
+ export interface EventSubTrack extends BaseSubTrack {
225
+ type: 'event';
226
+ /** Events to trigger */
227
+ events: SequenceEventData[];
228
+ }
229
+ /**
230
+ * Audio parameter sub-track - animates audio parameters like volume and detune
231
+ */
232
+ export interface AudioParameterSubTrack extends BaseSubTrack {
233
+ type: 'audioParameter';
234
+ /** The parameter being animated */
235
+ parameter: AudioParameterId;
236
+ /** Keyframes for the parameter */
237
+ keyframes: PropertyKeyframe[];
238
+ }
239
+ export type SubTrack = TransformSubTrack | AnimationSubTrack | PropertySubTrack | MaterialSubTrack | VisibilitySubTrack | EventSubTrack | AudioParameterSubTrack;
240
+ /**
241
+ * Interpolation mode for keyframes
242
+ */
243
+ export type InterpolationMode = 'linear' | 'step' | 'cubic' | 'catmullRom';
244
+ /**
245
+ * Transform keyframe - stores position, rotation, and scale at a specific time
246
+ */
247
+ export interface TransformKeyframe {
248
+ /** Unique identifier */
249
+ id: string;
250
+ /** Time in seconds from sequence start */
251
+ time: number;
252
+ /** Position [x, y, z] */
253
+ position?: [number, number, number];
254
+ /** Rotation in euler angles [x, y, z] */
255
+ rotation?: [number, number, number];
256
+ /** Scale [x, y, z] */
257
+ scale?: [number, number, number];
258
+ /** Interpolation mode to next keyframe */
259
+ interpolation: InterpolationMode;
260
+ }
261
+ /**
262
+ * Property keyframe - stores a property value at a specific time
263
+ */
264
+ export interface PropertyKeyframe {
265
+ /** Unique identifier */
266
+ id: string;
267
+ /** Time in seconds from sequence start */
268
+ time: number;
269
+ /** The property value (type depends on property type) */
270
+ value: CustomParamValue;
271
+ /** Interpolation mode to next keyframe */
272
+ interpolation: InterpolationMode;
273
+ }
274
+ /**
275
+ * Visibility keyframe - stores visibility state at a specific time
276
+ */
277
+ export interface VisibilityKeyframe {
278
+ /** Unique identifier */
279
+ id: string;
280
+ /** Time in seconds from sequence start */
281
+ time: number;
282
+ /** Whether the object is visible */
283
+ visible: boolean;
284
+ }
285
+ /**
286
+ * An instance of an animation clip placed on the timeline
287
+ */
288
+ export interface AnimationClipInstance {
289
+ /** Unique identifier */
290
+ id: string;
291
+ /** Asset ID of the animation clip */
292
+ animationClipAssetId: AssetId | null;
293
+ /** Start time of this clip on the timeline */
294
+ startTime: number;
295
+ /** Duration of this clip instance (can be different from original clip) */
296
+ duration: number;
297
+ /** Start offset within the original clip */
298
+ clipStartOffset: number;
299
+ /** End offset within the original clip (for trimming) */
300
+ clipEndOffset: number;
301
+ /** Playback rate multiplier */
302
+ playbackRate: number;
303
+ /** Fade in duration */
304
+ fadeInDuration: number;
305
+ /** Blend out duration */
306
+ /** Whether this animation has root motion enabled */
307
+ rootMotion: boolean;
308
+ }
309
+ /**
310
+ * An instance of an audio clip placed on the timeline
311
+ */
312
+ export interface AudioClipInstance {
313
+ /** Unique identifier */
314
+ id: string;
315
+ /** Audio asset ID */
316
+ audioAssetId: AssetId | null;
317
+ /** Start time of this clip on the timeline */
318
+ startTime: number;
319
+ /** Duration of this clip instance */
320
+ duration: number;
321
+ /** Start offset within the audio file (the "crop") */
322
+ clipStartOffset: number;
323
+ /** Playback rate multiplier */
324
+ playbackRate: number;
325
+ /** Volume multiplier (0-1) */
326
+ volume: number;
327
+ /** Fade in duration in seconds */
328
+ fadeInDuration: number;
329
+ /** Fade out duration in seconds */
330
+ fadeOutDuration: number;
331
+ /** Random volume variation (+/-) */
332
+ volumeRandomization: number;
333
+ /** Random pitch/detune variation (+/- cents) */
334
+ pitchRandomization: number;
335
+ /** ID of the track to attach this audio to (for spatial audio) */
336
+ attachedToTrackId?: string;
337
+ /** Socket/Bone name to attach to on the target track */
338
+ attachmentSocketName?: string;
339
+ }
340
+ /**
341
+ * An instance of a visual effect placed on the timeline
342
+ */
343
+ export interface VfxClipInstance {
344
+ /** Unique identifier */
345
+ id: string;
346
+ /** VFX asset ID */
347
+ vfxAssetId: AssetId | null;
348
+ /** Start time of this clip on the timeline */
349
+ startTime: number;
350
+ /** Duration of this clip instance */
351
+ duration: number;
352
+ }
353
+ /**
354
+ * An instance of a spawn clip placed on the timeline
355
+ */
356
+ export interface SpawnClipInstance {
357
+ /** Unique identifier */
358
+ id: string;
359
+ /** Start time of this clip on the timeline */
360
+ startTime: number;
361
+ /** Duration of this clip instance */
362
+ duration: number;
363
+ /** Optional initial position [x, y, z] */
364
+ initialPosition?: [number, number, number];
365
+ /** Optional initial rotation in euler angles [x, y, z] */
366
+ initialRotation?: [number, number, number];
367
+ }
368
+ /**
369
+ * A function call event at a specific time.
370
+ * Named SequenceEventData to avoid conflict with @SequenceEvent decorator.
371
+ */
372
+ export interface SequenceEventData {
373
+ /** Unique identifier */
374
+ id: string;
375
+ /** Time in seconds to trigger the event */
376
+ time: number;
377
+ /** Name of the function to call on the target */
378
+ functionName: string;
379
+ /** Arguments to pass to the function */
380
+ arguments: CustomParamValue[];
381
+ }
382
+ /**
383
+ * Creates a new empty sequence data structure
384
+ */
385
+ export declare function createSequenceData(): SequenceData;
386
+ /**
387
+ * Creates a new object track
388
+ */
389
+ export declare function createObjectTrack(name?: string): ObjectTrack;
390
+ /**
391
+ * Creates a new camera track
392
+ */
393
+ export declare function createCameraTrack(name?: string): CameraTrack;
394
+ /**
395
+ * Creates a new audio track
396
+ */
397
+ export declare function createAudioTrack(name?: string): AudioTrack;
398
+ /**
399
+ * Creates a new VFX track
400
+ */
401
+ export declare function createVfxTrack(name?: string): VfxTrack;
402
+ /**
403
+ * Creates a new spawn track
404
+ */
405
+ export declare function createSpawnTrack(name?: string): SpawnTrack;
406
+ /**
407
+ * Creates a new spawn clip instance
408
+ */
409
+ export declare function createSpawnClipInstance(startTime: number, duration: number): SpawnClipInstance;
410
+ /**
411
+ * Creates a new group track
412
+ */
413
+ export declare function createGroupTrack(name?: string): GroupTrack;
414
+ /**
415
+ * Creates a new transform sub-track
416
+ */
417
+ export declare function createTransformSubTrack(): TransformSubTrack;
418
+ /**
419
+ * Creates a new animation sub-track
420
+ */
421
+ export declare function createAnimationSubTrack(name?: string): AnimationSubTrack;
422
+ /**
423
+ * Creates a new audio parameter sub-track
424
+ */
425
+ export declare function createAudioParameterSubTrack(parameter?: AudioParameterId): AudioParameterSubTrack;
426
+ /**
427
+ * Creates a new property sub-track
428
+ */
429
+ export declare function createPropertySubTrack(propertyPath?: string, propertyType?: SerializedParamType): PropertySubTrack;
430
+ /**
431
+ * Creates a new transform keyframe
432
+ */
433
+ export declare function createTransformKeyframe(time: number): TransformKeyframe;
434
+ /**
435
+ * Creates a new property keyframe
436
+ */
437
+ export declare function createPropertyKeyframe(time: number, value?: CustomParamValue): PropertyKeyframe;
438
+ /**
439
+ * Creates a new animation clip instance
440
+ */
441
+ export declare function createAnimationClipInstance(animationClipAssetId: AssetId | null, startTime: number, duration: number): AnimationClipInstance;
442
+ /**
443
+ * Creates a new audio clip instance
444
+ */
445
+ export declare function createAudioClipInstance(audioAssetId: AssetId | null, startTime: number, duration: number): AudioClipInstance;
446
+ /**
447
+ * Creates a new VFX clip instance
448
+ */
449
+ export declare function createVfxClipInstance(vfxAssetId: AssetId | null, startTime: number, duration: number): VfxClipInstance;
450
+ /**
451
+ * Creates a new event sub-track
452
+ */
453
+ export declare function createEventSubTrack(name?: string): EventSubTrack;
454
+ /**
455
+ * Creates a new sequence event
456
+ */
457
+ export declare function createSequenceEventData(time: number, functionName?: string): SequenceEventData;
458
+ //# sourceMappingURL=sequence-data.d.ts.map
@@ -0,0 +1,4 @@
1
+ import{SerializedParamType as e}from"../../scene/model.js";import{randomString as t}from"../../utils/math.js";import{getAudioParameterDefinition as r}from"./audio-parameters.js";export class Sequence{constructor(e){this.data=e}}export var SequenceRole;!function(e){e.Self="self",e.Target="target",e.Target2="target2",e.Target3="target3",e.Secondary="secondary"}(SequenceRole||(SequenceRole={}));export function createSequenceData(){return{duration:5,loop:!1,playbackRate:1,tracks:[]}}export function createObjectTrack(e="Object Track"){return{id:t(),name:e,type:"object",muted:!1,locked:!1,targetId:null,role:null,subTracks:[]}}export function createCameraTrack(e="Camera Track"){return{id:t(),name:e,type:"camera",muted:!1,locked:!1,cameraSettings:{fov:60,near:.1,far:1e3},subTracks:[]}}export function createAudioTrack(e="Audio Track"){return{id:t(),name:e,type:"audio",muted:!1,locked:!1,clips:[],subTracks:[],volume:1,spatial:!1}}export function createVfxTrack(e="VFX Track"){return{id:t(),name:e,type:"vfx",muted:!1,locked:!1,clips:[],position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],subTracks:[]}}export function createSpawnTrack(e="Spawn Track"){return{id:t(),name:e,type:"spawn",muted:!1,locked:!1,spawnType:"mesh",role:null,clips:[],subTracks:[]}}export function createSpawnClipInstance(e,r){return{id:t(),startTime:e,duration:r}}export function createGroupTrack(e="Group"){return{id:t(),name:e,type:"group",muted:!1,locked:!1,collapsed:!1,childTracks:[],subTracks:[]}}export function createTransformSubTrack(){return{id:t(),name:"Transform",type:"transform",muted:!1,components:{position:!0,rotation:!0,scale:!0},keyframes:[]}}export function createAnimationSubTrack(e="Animation"){return{id:t(),name:e,type:"animation",muted:!1,clips:[]}}export function createAudioParameterSubTrack(e="volume"){const a=r(e);return{id:t(),name:a.displayName,type:"audioParameter",muted:!1,parameter:e,keyframes:[]}}export function createPropertySubTrack(r="",a=e.Number){return{id:t(),name:r||"Property",type:"property",muted:!1,propertyPath:r,propertyType:a,keyframes:[]}}export function createTransformKeyframe(e){return{id:t(),time:e,position:[0,0,0],rotation:[0,0,0],scale:[1,1,1],interpolation:"cubic"}}export function createPropertyKeyframe(r,a={type:e.Number,value:0}){return{id:t(),time:r,value:a,interpolation:"linear"}}export function createAnimationClipInstance(e,r,a){return{id:t(),animationClipAssetId:e,startTime:r,duration:a,clipStartOffset:0,clipEndOffset:0,playbackRate:1,fadeInDuration:.2,rootMotion:!1}}export function createAudioClipInstance(e,r,a){return{id:t(),audioAssetId:e,startTime:r,duration:a,clipStartOffset:0,playbackRate:1,volume:1,fadeInDuration:0,fadeOutDuration:0,volumeRandomization:0,pitchRandomization:0}}export function createVfxClipInstance(e,r,a){return{id:t(),vfxAssetId:e,startTime:r,duration:a}}export function createEventSubTrack(e="Events"){return{id:t(),name:e,type:"event",muted:!1,events:[]}}export function createSequenceEventData(e,r=""){return{id:t(),time:e,functionName:r,arguments:[]}}/*
2
+ * Copyright (©) 2026 Hology Interactive AB. All rights reserved.
3
+ * See the LICENSE.md file for details.
4
+ */