From b36c3822ac9ab29c663155dac1b1d2f8b2decee6 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 12 May 2026 23:33:34 +0200 Subject: [PATCH] Support terrain-aware path sampling for position and tangent calculations --- src/document/paths.ts | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/document/paths.ts b/src/document/paths.ts index befda2c8..6e6e334c 100644 --- a/src/document/paths.ts +++ b/src/document/paths.ts @@ -1247,11 +1247,20 @@ export function resolveNearestPointOnResolvedScenePath( export function sampleScenePathPosition( path: Pick & - Partial>, + Partial< + Pick< + ScenePath, + "curveMode" | "sampledResolution" | "glueToTerrain" | "terrainOffset" + > + >, progress: number, - options: { smooth?: boolean } = {} + options: { smooth?: boolean; terrains?: readonly Terrain[] } = {} ): Vec3 { - return sampleResolvedScenePathPosition(resolveScenePath(path), progress, options); + return sampleResolvedScenePathPosition( + resolveScenePath(path, { terrains: options.terrains }), + progress, + options + ); } export function sampleResolvedScenePathTangent( @@ -1278,9 +1287,18 @@ export function sampleResolvedScenePathTangent( export function sampleScenePathTangent( path: Pick & - Partial>, + Partial< + Pick< + ScenePath, + "curveMode" | "sampledResolution" | "glueToTerrain" | "terrainOffset" + > + >, progress: number, - options: { smooth?: boolean } = {} + options: { smooth?: boolean; terrains?: readonly Terrain[] } = {} ): Vec3 { - return sampleResolvedScenePathTangent(resolveScenePath(path), progress, options); + return sampleResolvedScenePathTangent( + resolveScenePath(path, { terrains: options.terrains }), + progress, + options + ); }