• Calculates the world space radius of an Object3D hierarchy.

    The function returns the radius of a bounding sphere that encloses all mesh components in the hierarchy of the provided Object3D. This can be useful for visibility testing, collision detection, or spatial queries within a 3D environment.

    Parameters

    • object: Object3D

      The root Object3D of the hierarchy to calculate the world space radius for.

    Returns number

    The radius of the world space bounding sphere.

    Example

    // Assuming 'rootObject' is the root of your Object3D hierarchy with mesh components
    const worldRadius = radiusHierarchy(rootObject);
    console.log(`World space radius: ${worldRadius}`);