From 1220df79e6ac672b07db58f8a4ad8c7922758ccf Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 13 Apr 2026 23:49:19 +0200 Subject: [PATCH] Update scene build to include NPC definitions and runtime clock state --- src/runtime-three/runtime-scene-build.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index 4244d170..b487c714 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -25,12 +25,14 @@ import { import { cloneWorldSettings, type WorldSettings } from "../document/world-settings"; import { type CharacterColliderSettings, + cloneNpcPresence, clonePlayerStartInputBindings, createPlayerStartMovementTemplate, createPlayerStartInputBindings, getEntityInstances, getPrimaryEnabledPlayerStartEntity, type EntityInstance, + type NpcPresence, type PlayerStartInputBindings, type PlayerStartJumpSettings, type PlayerStartMovementCapabilities, @@ -44,6 +46,8 @@ import { buildGeneratedModelCollider, type GeneratedColliderBounds, type Generat import { cloneInteractionLink, getInteractionLinks, type InteractionLink } from "../interactions/interaction-links"; import { cloneMaterialDef, type MaterialDef } from "../materials/starter-material-library"; import { assertRuntimeSceneBuildable } from "./runtime-scene-validation"; +import { resolveNpcPresenceActive } from "./runtime-npc-presence"; +import type { RuntimeClockState } from "./runtime-project-time"; import { FIRST_PERSON_PLAYER_SHAPE, type FirstPersonPlayerShape } from "./player-collision"; export type RuntimeNavigationMode = "firstPerson" | "thirdPerson"; @@ -168,6 +172,11 @@ export interface RuntimeNpc { collider: FirstPersonPlayerShape; } +export interface RuntimeNpcDefinition extends RuntimeNpc { + presence: NpcPresence; + active: boolean; +} + export interface RuntimeSoundEmitter { entityId: string; position: Vec3; @@ -298,10 +307,12 @@ export interface RuntimeSceneDefinition { localLights: RuntimeLocalLightCollection; brushes: RuntimeBoxBrushInstance[]; volumes: RuntimeBoxVolumeCollection; + staticColliders: RuntimeSceneCollider[]; colliders: RuntimeSceneCollider[]; sceneBounds: RuntimeSceneBounds | null; modelInstances: RuntimeModelInstance[]; paths: RuntimePath[]; + npcDefinitions: RuntimeNpcDefinition[]; entities: RuntimeEntityCollection; interactionLinks: InteractionLink[]; playerStart: RuntimePlayerStart | null; @@ -315,6 +326,7 @@ export interface RuntimeSceneDefinition { export interface BuildRuntimeSceneOptions { navigationMode?: RuntimeNavigationMode; loadedModelAssets?: Record; + runtimeClock?: RuntimeClockState; sceneEntryId?: string | null; }