UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

12 lines (11 loc) 289 B
"use strict"; export function hierarchyTraverse(object, callback) { callback(object); const childrenCount = object.children.length; for (let i = 0; i < childrenCount; i++) { const child = object.children[i]; if (child) { hierarchyTraverse(child, callback); } } }