From d9ee9073dc00d54fa69631da42b65c61fb048d32 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 12 May 2026 23:36:37 +0200 Subject: [PATCH] Add terrain support to runtime path generation --- src/runtime-three/runtime-scene-build.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index 7a312a46..15b45f14 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -511,6 +511,8 @@ export interface RuntimePath { loop: boolean; curveMode: ScenePathCurveMode; sampledResolution: number; + glueToTerrain: boolean; + terrainOffset: number; points: RuntimePathPoint[]; segments: RuntimePathSegment[]; totalLength: number; @@ -995,8 +997,11 @@ function buildRuntimePathPoint(point: ScenePathPoint): RuntimePathPoint { }; } -function buildRuntimePath(path: ScenePath): RuntimePath { - const resolvedPath = resolveScenePath(path); +function buildRuntimePath( + path: ScenePath, + terrains: readonly Terrain[] +): RuntimePath { + const resolvedPath = resolveScenePath(path, { terrains }); return { id: path.id, @@ -1006,6 +1011,8 @@ function buildRuntimePath(path: ScenePath): RuntimePath { loop: path.loop, curveMode: resolvedPath.curveMode, sampledResolution: resolvedPath.sampledResolution, + glueToTerrain: resolvedPath.glueToTerrain, + terrainOffset: resolvedPath.terrainOffset, points: resolvedPath.points.map(buildRuntimePathPoint), segments: resolvedPath.segments.map((segment) => ({ index: segment.index,