From 824a641f80c23d9374cb1eb677b37c74b330bf70 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 13 May 2026 01:11:29 +0200 Subject: [PATCH] Enhance runtime path building to include road material definitions --- src/runtime-three/runtime-scene-build.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index 4c668f79..c527937a 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -514,7 +514,9 @@ export interface RuntimePath { sampledResolution: number; glueToTerrain: boolean; terrainOffset: number; - road: ScenePathRoadSettings; + road: ScenePathRoadSettings & { + material: MaterialDef | null; + }; points: RuntimePathPoint[]; segments: RuntimePathSegment[]; totalLength: number; @@ -1001,7 +1003,8 @@ function buildRuntimePathPoint(point: ScenePathPoint): RuntimePathPoint { function buildRuntimePath( path: ScenePath, - terrains: readonly Terrain[] + terrains: readonly Terrain[], + document: SceneDocument ): RuntimePath { const resolvedPath = resolveScenePath(path, { terrains }); @@ -1015,7 +1018,10 @@ function buildRuntimePath( sampledResolution: resolvedPath.sampledResolution, glueToTerrain: resolvedPath.glueToTerrain, terrainOffset: resolvedPath.terrainOffset, - road: { ...path.road }, + road: { + ...path.road, + material: resolveRuntimeMaterial(document, path.road.materialId) + }, points: resolvedPath.points.map(buildRuntimePathPoint), segments: resolvedPath.segments.map((segment) => ({ index: segment.index, @@ -2001,7 +2007,7 @@ export function buildRuntimeSceneFromDocument( const modelInstances = enabledModelInstances.map(buildRuntimeModelInstance); const paths = getScenePaths(document.paths) .filter((path) => path.enabled) - .map((path) => buildRuntimePath(path, enabledTerrains)); + .map((path) => buildRuntimePath(path, enabledTerrains, document)); const collections = buildRuntimeSceneCollections( document, options.runtimeClock ?? null,