Function pickBillboardSprite
-
pickBillboardSprite(
scene: SceneContext,
x: number,
y: number,
picker?: GpuPicker,
): Promise<BillboardPickInfo | null>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: GpuPickerOptional 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 }), ornullfor a miss. - scene: SceneContext
Pick the topmost billboard sprite under a point, respecting occlusion by meshes and other billboards (closest wins). Returns
nullif 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
pickerfrom 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 toscene— the same one passed tocreateGpuPicker.