API

Function pickBillboardSprite

  • Pick the topmost billboard sprite under a point, respecting occlusion by meshes and other billboards (closest wins). Returns null if no billboard is the closest hit there — including when a mesh is in front of the billboard, in which case the billboard is considered occluded.

    By default a throwaway GpuPicker is created and disposed per call, so a one-off pick (e.g. click-to-select) retains no GPU state. For high-frequency picking (hover, drag) pass a caller-owned picker from createGpuPicker: its 1×1 targets, scene UBO, and per-source contributors (which compile the pick pipelines) are then reused across calls instead of rebuilt each time, and the caller disposes it once via disposePicker when done. A supplied picker must belong to scene — the same one passed to createGpuPicker.

    Parameters

    • scene: SceneContext

      Scene whose billboard systems (and meshes, for occlusion) are tested.

    • x: number

      Query X in CSS pixels relative to the scene's canvas (same convention as pickAsync).

    • y: number

      Query Y in CSS pixels relative to the scene's canvas.

    • Optionalpicker: GpuPicker

      Optional caller-owned picker to reuse; when omitted, one is created and disposed per call.

    Returns Promise<BillboardPickInfo | null>

    The billboard hit ({ system, spriteIndex, pickedPoint, distance }), or null for a miss.