auto-git:

[change] tests/domain/scene-paths.test.ts
This commit is contained in:
2026-04-23 09:07:05 +02:00
parent cf309e4753
commit d6455da42a

View File

@@ -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
}
});
});
});