Update runtime global state to include clock state and modify scene build to use project time settings

This commit is contained in:
2026-04-12 04:30:49 +02:00
parent 40b3ed560a
commit ff5df14ac6
2 changed files with 18 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
import { createDefaultProjectTimeSettings } from "../document/project-time-settings";
import {
createRuntimeClockState,
type RuntimeClockState
} from "./runtime-project-time";
export interface RuntimeSceneTransitionRecord {
fromSceneId: string;
fromSceneName: string;
@@ -12,13 +19,17 @@ export interface RuntimeGlobalState {
activeMusicCueId: string | null;
transitionCount: number;
lastSceneTransition: RuntimeSceneTransitionRecord | null;
clock: RuntimeClockState;
}
export function createDefaultRuntimeGlobalState(): RuntimeGlobalState {
export function createDefaultRuntimeGlobalState(
timeSettings = createDefaultProjectTimeSettings()
): RuntimeGlobalState {
return {
flags: {},
activeMusicCueId: null,
transitionCount: 0,
lastSceneTransition: null
lastSceneTransition: null,
clock: createRuntimeClockState(timeSettings)
};
}

View File

@@ -51,9 +51,14 @@ export interface RuntimeBoxBrushInstance {
rotationDegrees: Vec3;
size: Vec3;
geometry: BoxBrushGeometry;
import {
cloneProjectTimeSettings,
type ProjectTimeSettings
} from "../document/project-time-settings";
faces: Record<BoxFaceId, RuntimeBrushFace>;
volume: BoxBrushVolumeSettings;
}
time: ProjectTimeSettings;
export interface RuntimeFogVolume {
brushId: string;