InternalRun snap-to-vertex / snap-to-edge against the cursor.
Caller is responsible for having already activated rendererView
and rendered at least one frame; this method binds its own
snap framebuffer and uses the existing GPU mesh data textures.
Returns null (with ok: true) when nothing was snapped — the
caller should fall back to the regular pick result. Returns the
shared transient PickResult when a snap target was hit,
with worldPos, snappedToVertex / snappedToEdge, and
snappedCanvasPos populated; the existing viewObject /
sceneObject from the prior pick (if any) should be merged in
by the caller before returning to the user.
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
snapRadiuspixels 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 asgl.LINES), all into a small(2 * radius + 1)²RGBA32Fframebuffer.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:
RGBA32FMRT (V2 usesRGBA32I + RGBA32I + RGBA8UIwith integer coordinate scaling for RTC precision).