fix: Raycast grid annotation no longer misses rotated or split colliders

Merged
HA
3mo ago
+181-263

Summary

  • screenshot --annotate-raycast-grid (without --raycast-layer-mask) now always uses the same dense clustered raycast pass as the masked mode, instead of a coarse 5x5 preview that could miss rotated or disconnected collider shapes entirely.
  • The response now reports RaycastLayerNamesChecked, the physics layer names actually eligible to produce hits in this response, to help diagnose why an expected layer produced no results.

User Impact

  • Previously, calling --annotate-raycast-grid without a layer mask sampled only 25 points on a coarse grid. A rotated or split collider could fall between those sample points and appear completely undetected, even though the same object was hittable via raycast --x --y directly — misleadingly suggesting the collider's hit detection itself was broken.
  • Now every --annotate-raycast-grid call uses the same dense 40x40 sampling and clustering used by the masked mode, so collider shapes are outlined accurately regardless of orientation or whether the mask is specified.
  • RaycastLayerSummaries (which layers exist and how many hits they have) is now always populated, not only when no mask is given.
  • The new RaycastLayerNamesChecked field tells the caller exactly which layers were checked against the active camera, making it possible to tell "this layer produced no PhysicsCollider entries because the camera can't see it" from "because nothing is there."

Changes

  • Unified ScreenshotUseCase.CaptureRenderingAsync onto a single clustering code path; layer mask defaults to Physics.DefaultRaycastLayers when --raycast-layer-mask is not given.
  • Added RaycastLayerMaskResolver.CreateLayerNamesFromMask to convert a layer bitmask into layer names, reused for the new RaycastLayerNamesChecked field.
  • Removed the coarse 5x5 grid path (RaycastGridPoints field, RaycastGridPointInfo DTO, and related dead code in RaycastGridAnnotator), replaced with the internal RaycastLayerHitSample type used only for layer-summary aggregation.
  • Updated skill docs (annotated-elements.md, SimulateMouseInput/SKILL.md and their generated mirrors), README.md, and default-tools.json tool descriptions to match.

Verification

  • dist/darwin-arm64/uloop compile — 0 errors, 0 warnings
  • uloop run-tests for RaycastGridAnnotatorTests (32/32), ScreenshotUseCaseTests (4/4), DefaultToolsCatalogDriftTests (1/1) — all green
  • Manual smoke test in PlayMode on RaycastAnnotationPerspectiveDemoScene: confirmed the previously-missed rotated/split collider is now correctly outlined, RaycastLayerNamesChecked reflects the expected layer set with and without --raycast-layer-mask, and RaycastLayerSummaries remains populated in both cases