|
| 1 | +import type {Vec2, Vec3} from "../../base/math/vector"; |
| 2 | +import type {MarkerOcclusionMarker, MarkerOcclusionMode} from "./MarkerOcclusionTesterParams"; |
| 3 | + |
| 4 | +/** |
| 5 | + * Visibility result for a marker after one occlusion update. |
| 6 | + */ |
| 7 | +export interface MarkerOcclusionResult { |
| 8 | + /** Stable ID from {@link MarkerOcclusionMarker.id}. */ |
| 9 | + markerId: string; |
| 10 | + |
| 11 | + /** Marker input that produced this result. */ |
| 12 | + marker: MarkerOcclusionMarker; |
| 13 | + |
| 14 | + /** Backend used for this result. */ |
| 15 | + mode: Exclude<MarkerOcclusionMode, "auto">; |
| 16 | + |
| 17 | + /** `true` when the marker should be shown after frustum and hysteresis rules. */ |
| 18 | + visible: boolean; |
| 19 | + |
| 20 | + /** Raw occlusion result for this update before hysteresis is applied. */ |
| 21 | + occluded: boolean; |
| 22 | + |
| 23 | + /** `true` when the marker projects inside the view frustum. */ |
| 24 | + inFrustum: boolean; |
| 25 | + |
| 26 | + /** Canvas-space marker position in CSS pixels, or `null` when not projectable. */ |
| 27 | + canvasPos: Vec2 | null; |
| 28 | + |
| 29 | + /** World-space ray origin used by the occlusion test, or `null` when skipped. */ |
| 30 | + rayOrigin: Vec3 | null; |
| 31 | + |
| 32 | + /** World-space ray direction used by the occlusion test, or `null` when skipped. */ |
| 33 | + rayDir: Vec3 | null; |
| 34 | + |
| 35 | + /** Distance from ray origin to marker along {@link rayDir}, or `null` when skipped. */ |
| 36 | + distanceToMarker: number | null; |
| 37 | + |
| 38 | + /** Object ID of the occluder, if any. */ |
| 39 | + occluderObjectId: string | null; |
| 40 | + |
| 41 | + /** Mesh ID of the occluder, if any. */ |
| 42 | + occluderMeshId: string | null; |
| 43 | +} |
0 commit comments