The root objects to start the BFS from.
The predicate function to call on each object. This function should take a SceneObject as an argument and return a boolean. If the function returns true for an object, that object is immediately returned by the BFS function. If it returns false, the search continues to the next object.
the object returned by the predicate function, otherwise null.
Performs a BFS on a collection of root objects and their descendants. It uses a predicate function to determine if an object in the scene graph meets certain conditions.