From 6a47395d6f15c975a21cb36c1f3e9991a0892e93 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 13 May 2026 17:16:04 +0200 Subject: [PATCH] Enhance validation and runtime support for spline corridor junctions --- src/document/scene-document-validation.ts | 13 +++++++++++++ src/runtime-three/runtime-scene-build.ts | 9 +++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/document/scene-document-validation.ts b/src/document/scene-document-validation.ts index 38e3fde6..ef3520af 100644 --- a/src/document/scene-document-validation.ts +++ b/src/document/scene-document-validation.ts @@ -3421,6 +3421,19 @@ function validateSplineCorridorJunction( ); } + if (!isRecord(junction.edge)) { + diagnostics.push( + createDiagnostic( + "error", + "invalid-spline-corridor-junction-edge", + "Spline corridor junction edge settings must be an object.", + `${path}.edge` + ) + ); + } else { + validateScenePathRoadEdge(junction.edge, `${path}.edge`, document, diagnostics); + } + if (!Array.isArray(junction.connections) || junction.connections.length < 2) { diagnostics.push( createDiagnostic( diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index 13dca0c3..3750ff6e 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -546,8 +546,9 @@ export interface RuntimePath { } export interface RuntimeSplineCorridorJunction - extends SplineCorridorJunction { + extends Omit { material: MaterialDef | null; + edge: RuntimePathRoadEdgeSettings; } export interface RuntimeFoliageDefinition { @@ -2063,7 +2064,11 @@ export function buildRuntimeSceneFromDocument( ...junction, connections: junction.connections.map((connection) => ({ ...connection })), center: cloneVec3(junction.center), - material: resolveRuntimeMaterial(document, junction.materialId) + material: resolveRuntimeMaterial(document, junction.materialId), + edge: { + ...junction.edge, + material: resolveRuntimeMaterial(document, junction.edge.materialId) + } })); const splineCorridorClipIntervalsByPath = resolveSplineCorridorJunctionClipIntervals({