From ff5df14ac6514f3af942c2847300b578a45b7181 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 12 Apr 2026 04:30:49 +0200 Subject: [PATCH] Update runtime global state to include clock state and modify scene build to use project time settings --- src/runtime-three/runtime-global-state.ts | 15 +++++++++++++-- src/runtime-three/runtime-scene-build.ts | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/runtime-three/runtime-global-state.ts b/src/runtime-three/runtime-global-state.ts index 6c2b4728..044f8f58 100644 --- a/src/runtime-three/runtime-global-state.ts +++ b/src/runtime-three/runtime-global-state.ts @@ -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) }; } diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index df9fef74..3f83435a 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -51,9 +51,14 @@ export interface RuntimeBoxBrushInstance { rotationDegrees: Vec3; size: Vec3; geometry: BoxBrushGeometry; + import { + cloneProjectTimeSettings, + type ProjectTimeSettings + } from "../document/project-time-settings"; faces: Record; volume: BoxBrushVolumeSettings; } + time: ProjectTimeSettings; export interface RuntimeFogVolume { brushId: string;