public void breadthFirstTraversal(SceneGraphVisitor visitor) {
        Queue<Spatial> queue = new LinkedList<>();
        queue.add(this);

        while (!queue.isEmpty()) {
            Spatial s = queue.poll();
            visitor.visit(s);
            s.breadthFirstTraversal(visitor, queue);
        }
    }
Visit each scene graph element ordered by BFS

@param visitor the action to take for each visited Spatial
jme3-core/src/main/java/com/jme3/scene/Spatial.java