@pmndrs/bvh
    Preparing search index...

    Function refitLayoutToPose

    • Refits a mesh tree (any builder's, in the GPU layout, f32 or quantized nodes, records or indexed triangles) to positions (x, y, z per vertex, the mesh's own vertex numbering) on the CPU, keeping its shape: the CPU path of a deforming mesh's pose (SceneTrees.setPoseCpu). Each slot's corners come from indices (the mesh's, or none for a triangle list) by the slot's original index. The layout itself is not changed. A PoseLayout (no triangles) gives the same result, bit for bit.

      Parameters

      • layout: GpuLayoutMeshBvh | PoseLayout
      • positions: Float32Array
      • indices: Uint32Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | null | undefined

      Returns PosedLayout