private static void addGeometriesInCamFrustumFromNode(Camera camera, Node scene, RenderQueue.ShadowMode mode, GeometryList outputGeometryList) {
        if (scene.getCullHint() == Spatial.CullHint.Always) return;
        camera.setPlaneState(0);
        if (camera.contains(scene.getWorldBound()) != Camera.FrustumIntersect.Outside) {
            for (Spatial child: scene.getChildren()) {
                if (child instanceof Node) addGeometriesInCamFrustumFromNode(camera, (Node)child, mode, outputGeometryList);
                else if (child instanceof Geometry && child.getCullHint() != Spatial.CullHint.Always) {
                    camera.setPlaneState(0);
                    if (checkShadowMode(child.getShadowMode(), mode) &&
                            !((Geometry)child).isGrouped() &&
                            camera.contains(child.getWorldBound()) != Camera.FrustumIntersect.Outside) {
                      outputGeometryList.add((Geometry)child);
                    }
                }
            }
        }
    }
Helper function used to recursively populate the outputGeometryList
with geometry children of scene node

@param camera
@param scene the root of the scene to traverse (may be null)
@param mode the ShadowMode to test for
@param outputGeometryList
jme3-core/src/main/java/com/jme3/shadow/ShadowUtil.java