auto-git:
[change] tests/domain/scene-paths.test.ts
This commit is contained in:
@@ -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
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user