@pmndrs/bvh
    Preparing search index...

    Function relativeSahCost

    • The tree-quality signal: the summed half-area of every inner node (the root included) over the root's. It is the expected number of inner nodes a random ray through the root's box visits, the traversal half of the SAH cost. A refit keeps the tree's shape while things move, so this grows as the shape stops suiting the new positions; a rebuild resets it.

      Reads the boxes stored in the nodes. 1 for a one-node tree, 0 for an empty one.

      Parameters

      • floats: Float32Array
      • words: Uint32Array
      • nodeWordOffset: number
      • nodeCount: number

      Returns number