feat: add outdoor snapping, terrain types and procedural textures

This commit is contained in:
jhartworks committed 2026-11-16 13:02:18 +01:00
1 parent 992c3e18f2
commit d8cf076019
30 files changed
+2251 -1549

No files matched your search

+15
View File
@@ -79,6 +79,21 @@ test("cutAbove keeps colours and uvs along the new edge", () => {
assert.ok(Math.abs(buf.uv![cutVertex * 2 + 1] - 0.5) < 1e-9, "halfway uv");
});
test("cutting geometry retains outdoor surface IDs and appending furniture uses a neutral material", () => {
const buf = new GeoBuffer();
buf.surface = [];
buf.tri([0, 0, 0], [1, 2, 0], [0, 0, 1], grey);
buf.surface.fill(12);
cutAbove(buf, 0, 1, FURN_OFFSET);
assert.equal(buf.surface.length, buf.p.length / 3);
assert.ok(buf.surface.every((id) => id === 12));
buf.tri([4, 0, 0], [5, 2, 0], [4, 0, 1], grey);
assert.deepEqual(buf.surface.slice(-3), [0, 0, 0]);
cutAbove(buf, buf.count - 1, 1, FURN_OFFSET);
assert.equal(buf.surface.length, buf.p.length / 3);
assert.deepEqual(buf.surface.slice(-6), [0, 0, 0, 0, 0, 0]);
});
test("cutAbove only touches triangles from the given one on", () => {
const buf = new GeoBuffer();
buf.tri([0, 2, 0], [1, 2, 0], [1, 3, 0], grey);