Deno.test({
name: "setting world matrix affects children",
only: true,
fn() {
const root = new Entity();
const childA = root.add(new Entity()); // The entity we will be moving up
const childB = childA.add(new Entity()); // The entity we will reset (i.e. move down again)
const childC = childB.add(new Entity()); // The entity that should have the identity matrix
childA.worldMatrix.set(Mat4.createTranslation(0, 1, 0));
assertMatAlmostEquals(childB.worldMatrix, Mat4.createTranslation(0, 1, 0));
assertMatAlmostEquals(childC.worldMatrix, Mat4.createTranslation(0, 1, 0));
childB.worldMatrix.set(new Mat4());
assertMatAlmostEquals(childC.worldMatrix, new Mat4());
},
});
Here's a test to reproduce the issue: