feat: configure outdoor texture scale and rotation per area
This commit is contained in:
1 parent
d8cf076019
commit
c56f1a5ba9
26 files changed
+1958
-1778
No files matched your search
@@ -82,16 +82,23 @@ test("cutAbove keeps colours and uvs along the new edge", () => {
|
||||
test("cutting geometry retains outdoor surface IDs and appending furniture uses a neutral material", () => {
|
||||
const buf = new GeoBuffer();
|
||||
buf.surface = [];
|
||||
buf.surfaceTransform = [];
|
||||
buf.tri([0, 0, 0], [1, 2, 0], [0, 0, 1], grey);
|
||||
buf.surface.fill(12);
|
||||
buf.surfaceTransform = [2, 0.5, 2, 0.5, 2, 0.5];
|
||||
cutAbove(buf, 0, 1, FURN_OFFSET);
|
||||
assert.equal(buf.surface.length, buf.p.length / 3);
|
||||
assert.ok(buf.surface.every((id) => id === 12));
|
||||
assert.equal(buf.surfaceTransform.length, buf.p.length / 3 * 2);
|
||||
assert.ok(buf.surfaceTransform.every((value, i) => value === (i % 2 === 0 ? 2 : 0.5)));
|
||||
buf.tri([4, 0, 0], [5, 2, 0], [4, 0, 1], grey);
|
||||
assert.deepEqual(buf.surface.slice(-3), [0, 0, 0]);
|
||||
assert.deepEqual(buf.surfaceTransform.slice(-6), [1, 0, 1, 0, 1, 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]);
|
||||
assert.equal(buf.surfaceTransform.length, buf.p.length / 3 * 2);
|
||||
assert.deepEqual(buf.surfaceTransform.slice(-12), [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]);
|
||||
});
|
||||
|
||||
test("cutAbove only touches triangles from the given one on", () => {
|
||||
|
||||
Reference in new issue
Block a user