OcclusionBVH
Index
Constructors
Accessors
Methods
Constructors
constructor
Parameters
tris: TriangleSoA
options: OcclusionOptions
Returns OcclusionBVH
Accessors
selfOcclusionMinDepth
Returns number
slabEps
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
Collects indices of triangles whose PROJECTED axis-aligned bounds (onto the
right/upplane basis, coordinatesp·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 tooutand 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 todepthPrune.origin) lies outside[minOccluderDepth, maxOccluderDepth]are skipped — they cannot occlude the querying segment regardless of 2D overlap. When the optionallineNx/lineNy/lineCfields 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.
Returns number
isOccluded
Parameters
px: number
py: number
pz: number
ray: OcclusionRay
sampleDepth: number
minT: number
maxT: number
optionalignoreProductId: number
Returns boolean
Minimum depth separation for a product's own back-faces to occlude it (self-occlusion rule).