INNER CODE UNIT · JavaScript
walk
MageStudio/Mage · src/physics/index.js:273
const walk = element => {
(element.children || []).forEach(child => {
if (child.isPhysicsEnabled && child.isPhysicsEnabled()) {
collected.push(child);
}
walk(child);
});
};
walk(root);
return collected;
}
/**
* Leaves contributed by one collider element, in the compound root's frame.
*
* Usually one, but an element using a generated collision variant yields one
* per stored hull — that is what gives a concave model a collider with real
* gaps rather than a single shape filling them in.