Merge branch 'main' into data-driven

This commit is contained in:
tresabhi committed 2026-11-30 23:08:43 -06:00
commit c4bad57271
34 files changed
+986 -992

No files matched your search

@@ -0,0 +1,31 @@
import { Matrix4, type Object3D } from "three";
export interface FlatNode {
object: Object3D;
// relative to the root's parent, like jsxTree renders it
matrix: Matrix4;
root: Object3D;
}
function allChildren(object: Object3D) {
return object.children;
}
// every object under the roots; children picks which ones to descend into
export function flattenNodes(roots: Object3D[], children = allChildren) {
const flat: FlatNode[] = [];
function walk(object: Object3D, parent: Matrix4, root: Object3D) {
object.updateMatrix();
const matrix = parent.clone().multiply(object.matrix);
flat.push({ object, matrix, root });
for (const child of children(object)) walk(child, matrix, root);
}
for (const root of roots) walk(root, new Matrix4(), root);
return flat;
}
@@ -0,0 +1,4 @@
import { Quicklime } from "quicklime";
// something that casts or receives shadows was added, removed or changed
export const sceneChangeEvent = new Quicklime();