@pmndrs/bvh
    Preparing search index...

    Function threeTriangleRanges

    • The triangle ranges three's Mesh.raycast tests (_computeIntersections): the draw range, or with an array of materials each group within it.

      Matched step for step, including ranges that don't start or end on a multiple of 3: three steps j = start, start + 3, ... while j < end, and tests the triangle of indices j, j + 1, j + 2, so a range that isn't a whole number of triangles ends in a triangle that reads past it (into the next group, or past the draw range), and one that starts off a multiple of 3 tests triangles made of neighbouring triangles' corners. A triangle that would read past the index (or, without one, the positions) is dropped: three reads undefined there and never hits it. Each range's count is therefore a multiple of 3. Overlapping groups give overlapping ranges, as three tests (and reports) such triangles once per group. A group whose material is missing is skipped (three throws on it).

      Parameters

      • geometry: BufferGeometry
      • material: Material<MaterialEventMap> | Material<MaterialEventMap>[] | null | undefined
      • drawRange: { count: number; start: number } = geometry.drawRange

      Returns TriangleRange[]