Feat: Add terrain gluing and offset support to path scheduling

This commit is contained in:
2026-05-12 23:37:07 +02:00
parent d9ee9073dc
commit 63fa55220c
3 changed files with 14 additions and 2 deletions

View File

@@ -134,6 +134,8 @@ describe("Path inspector", () => {
expect(screen.getByTestId("path-loop")).not.toBeChecked();
expect(screen.getByTestId("path-curve-mode")).toHaveValue("linear");
expect(screen.getByTestId("path-sampled-resolution")).toHaveValue(12);
expect(screen.getByTestId("path-glue-to-terrain")).not.toBeChecked();
expect(screen.getByTestId("path-terrain-offset")).toHaveValue(0);
expect(screen.getByTestId("path-point-0-x")).toHaveValue(-1);
expect(screen.getByTestId("path-point-1-x")).toHaveValue(1);
@@ -154,6 +156,12 @@ describe("Path inspector", () => {
value: "16"
}
});
fireEvent.click(screen.getByTestId("path-glue-to-terrain"));
fireEvent.change(screen.getByTestId("path-terrain-offset"), {
target: {
value: "0.25"
}
});
fireEvent.change(screen.getByTestId("path-point-1-z"), {
target: {
value: "2"
@@ -169,7 +177,9 @@ describe("Path inspector", () => {
name: "Patrol Route",
loop: true,
curveMode: "catmullRom",
sampledResolution: 16
sampledResolution: 16,
glueToTerrain: true,
terrainOffset: 0.25
});
expect(updatedPath?.points).toHaveLength(3);
expect(updatedPath?.points[1]?.position).toEqual({