• Returns a filtered list of objects based 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.

    Type Parameters

    • T

    Parameters

    • rootObjects: SceneObject[]

      The root objects of each tree.

    • predicate: ((sceneObject: SceneObject) => T)

      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 will be part of the final list. If it returns false, the search continues to the next object.

    Returns T[]

    the collection of objects that match the the predicate function, otherwise an empty list.