glam
Version:
Experimental WebGL Engine
15 lines (12 loc) • 312 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isRooted;
function isRooted(scene, graph, node) {
// Walk up and see if the root node is the scene
do {
node = graph.parent.get(node);
} while (node !== scene && node !== undefined);
return scene === node;
}