feat(world): Parkwege, Felder, Plätze, Pool und Parkplatz als eigene Schichten

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Sonnet 5 committed 2026-09-16 08:34:43 +02:00
1 parent e675e62a16
commit b736afb7ff
10 files changed
+96 -17

No files matched your search

+18
View File
@@ -221,6 +221,24 @@ describe("ChunkStreamer", () => {
expect(source.children).toHaveLength(1);
expect(source.children[0].geometry.getAttribute("color")).toBeUndefined(); // die Landplatte, kein Gebäude
});
// Bruch: eine neue Schicht fehlt in DECALS — Weg oder Feld landete in der Kollision und die Kapsel stolperte
// über 2–3 cm hohe Kanten, oder die Schicht fehlte ganz in der Szene.
it("legt Parkwege und die neuen Flächenarten als Auflagen ohne Kollision in die Szene", async () => {
const square = [[[0, 0], [20, 0], [20, 20], [0, 20]]];
const chunk = {
chunk: [4, 6], origin: [0, -1000], land: [square], roads: [], buildings: [],
surfaces: ["field", "court", "pool", "parking"].map((kind) => ({ poly: square, kind })),
paths: [{ poly: square }],
};
const { streamer, player, scene } = makeStreamer(chunk);
streamer.update(emptyChunkCenter);
await flush();
expect(player.addCollider.mock.calls[0][0].shape.source.children).toHaveLength(1); // nur die Landplatte
const group = scene.add.mock.calls[0][0];
expect(group.children.filter((child) => child.isMesh)).toHaveLength(5);
});
});
// Fix-Runde 2, Befund C / Ruling 64: der Zweig `if (this.props)` in #load hatte keine