Update water contact patch collection and handling in rendering and runtime modules
This commit is contained in:
@@ -84,6 +84,52 @@ describe("water material helpers", () => {
|
||||
expect(patches).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("preserves oriented contact regions for rotated boxes", () => {
|
||||
const patches = collectWaterContactPatches(
|
||||
{
|
||||
center: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0
|
||||
},
|
||||
rotationDegrees: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0
|
||||
},
|
||||
size: {
|
||||
x: 10,
|
||||
y: 2,
|
||||
z: 10
|
||||
}
|
||||
},
|
||||
[
|
||||
{
|
||||
kind: "orientedBox",
|
||||
center: {
|
||||
x: 0,
|
||||
y: 1,
|
||||
z: 0
|
||||
},
|
||||
rotationDegrees: {
|
||||
x: 0,
|
||||
y: 45,
|
||||
z: 0
|
||||
},
|
||||
size: {
|
||||
x: 2,
|
||||
y: 1,
|
||||
z: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
);
|
||||
|
||||
expect(patches).toHaveLength(1);
|
||||
expect(Math.abs(patches[0]?.axisX ?? 0)).toBeGreaterThan(0.65);
|
||||
expect(Math.abs(patches[0]?.axisZ ?? 0)).toBeGreaterThan(0.65);
|
||||
});
|
||||
|
||||
it("builds a shared quality shader material for visible tinted water", () => {
|
||||
const result = createWaterMaterial({
|
||||
colorHex: "#4da6d9",
|
||||
|
||||
Reference in New Issue
Block a user