GPU-backed picking strategy — wraps WebGLRenderer.pick.

Handles:

  • canvas-pos pick (with optional snap-to-vertex / snap-to-edge);
  • ray pick (no snap; the renderer's snap path is canvas-only);
  • worldNormal when PickParams.pickSurfaceNormal is set;
  • localPos, uv, meshId whenever the renderer surfaces them.

Doesn't handle:

  • PickParams.filter — the renderer pick API has no callback filter; this strategy ignores it. The router escalates filter requests to the BVH leaf instead of calling here.

The renderer returns a transient, renderer-owned PickResult whose contents are valid only until the next pick. We deep-copy the fields we need into a fresh canonical PickResult so callers can hold onto it.

Stateless after construction; stateEpoch stays 0. (State changes that affect GPU readiness are tracked by the RoutingPickStrategy that owns this leaf, not by the leaf itself.)

Implements

Constructors

Properties

Methods

Constructors

Properties

stateEpoch: 0

Monotonic counter that bumps every time the strategy's internal state changes in a way that invalidates cached results — for example, when a RoutingPickStrategy's renderer becomes available, or its WebGL context is lost. A future memoising decorator compares this against the epoch stamped on cached results to know when to drop them.

Strategies whose state never changes (e.g. BVHPickStrategy) may always return 0.

Methods