From d6455da42a84ed8c3238d768c092b1a8fc74e043 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 23 Apr 2026 09:07:05 +0200 Subject: [PATCH] auto-git: [change] tests/domain/scene-paths.test.ts --- tests/domain/scene-paths.test.ts | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/domain/scene-paths.test.ts b/tests/domain/scene-paths.test.ts index eb63df82..39aec67e 100644 --- a/tests/domain/scene-paths.test.ts +++ b/tests/domain/scene-paths.test.ts @@ -3,6 +3,7 @@ import { describe, expect, it } from "vitest"; import { createScenePath, getScenePathLength, + mapWorldPointToScenePathProgressBetweenPoints, resolveNearestPointOnResolvedScenePath, resolveScenePath, sampleResolvedScenePathPosition, @@ -233,4 +234,36 @@ describe("scene paths", () => { } }); }); + + it("maps world points between authored track points into clamped rail progress", () => { + expect( + mapWorldPointToScenePathProgressBetweenPoints({ + point: { + x: 12, + y: 1, + z: 2 + }, + trackStartPoint: { + x: 0, + y: 1, + z: 2 + }, + trackEndPoint: { + x: 10, + y: 1, + z: 2 + }, + railStartProgress: 0.25, + railEndProgress: 0.75 + }) + ).toEqual({ + trackProgress: 1, + railProgress: 0.75, + projectedTrackPosition: { + x: 10, + y: 1, + z: 2 + } + }); + }); });