Manages snap-to-vertex / snap-to-edge picking inside a WebGLRenderer.

Owned by the ViewManager; sits alongside PickManager. Where pick is "what's at this cursor pixel", snap is "what's the nearest snap target within snapRadius pixels of the cursor". Both walk the same pickable mesh population — the snap pipeline draws each pickable batch through the snap-init technique (triangles → depth + view-position baseline) and then through one or both snap techniques (vertices as 1-pixel points, edges as gl.LINES), all into a small (2 * radius + 1)² RGBA32F framebuffer.

On read-back the manager scans every texel of the buffer for the one closest to the centre (the cursor) and reconstructs world position from view-space via inverse(viewMatrix) * vec4(view, 1). Vertex hits beat edge hits when both are present at the same distance.

Simplified first cut compared with V2:

  • Single RGBA32F MRT (V2 uses RGBA32I + RGBA32I + RGBA8UI with integer coordinate scaling for RTC precision).
  • View-space output (V2 emits scaled world position with a per-layer origin).
  • Two read-backs (vertex pass first, then edge pass) instead of V2's sign-of-W layer trick.

Constructors

Methods