Skip to main content

OcclusionBVH

Index

Constructors

constructor

Accessors

selfOcclusionMinDepth

  • get selfOcclusionMinDepth(): number
  • Minimum depth separation for a product's own back-faces to occlude it (self-occlusion rule).


    Returns number

slabEps

  • get slabEps(): number
  • Slab depth-window epsilon (occluder acceptance), as configured at construction.


    Returns number

triangles

  • Triangle data (read-only) — exposed so exact classification can share one BVH + SoA.


    Returns TriangleSoA

Methods

collectCandidates2D

  • collectCandidates2D(minU: number, minV: number, maxU: number, maxV: number, right: Vec3, up: Vec3, out: number[], depthPrune?: { lineC?: number; lineNx?: number; lineNy?: number; maxOccluderDepth: number; minOccluderDepth: number; origin: Vec3; viewNorm: Vec3 }): number
  • Collects indices of triangles whose PROJECTED axis-aligned bounds (onto the right/up plane basis, coordinates p·right / p·up) overlap the query rectangle. Node boxes are projected with interval arithmetic (center·axis ± halfExtent·|axis|), so the existing 3D tree serves 2D queries without a second build. Appends to out and returns the new count.


    Parameters

    • minU: number
    • minV: number
    • maxU: number
    • maxV: number
    • right: Vec3
    • up: Vec3
    • out: number[]
    • optionaldepthPrune: { lineC?: number; lineNx?: number; lineNy?: number; maxOccluderDepth: number; minOccluderDepth: number; origin: Vec3; viewNorm: Vec3 }

      Optional depth prune: when set, subtrees whose entire projected depth range (along depthPrune.viewNorm, relative to depthPrune.origin) lies outside [minOccluderDepth, maxOccluderDepth] are skipped — they cannot occlude the querying segment regardless of 2D overlap. When the optional lineNx/lineNy/lineC fields are set (a 2D line in normal form, in (right, up) coordinates), subtrees entirely on one side of that line are skipped too: the query rect of a segment covers far more area than the segment's line touches, and only line-touching triangles can occlude it.

      • optionallineC: number
      • optionallineNx: number
      • optionallineNy: number
      • maxOccluderDepth: number
      • minOccluderDepth: number
      • origin: Vec3
      • viewNorm: Vec3

    Returns number

isOccluded

  • isOccluded(px: number, py: number, pz: number, ray: OcclusionRay, sampleDepth: number, minT: number, maxT: number, ignoreProductId?: number): boolean
  • Parameters

    • px: number
    • py: number
    • pz: number
    • ray: OcclusionRay
    • sampleDepth: number
    • minT: number
    • maxT: number
    • optionalignoreProductId: number

    Returns boolean