fix: Raycast grid annotation no longer misses rotated or split colliders
Merged
HA
3mo ago+181+181+012345678901234567890123456789-263-263-012345678901234567890123456789
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-gridwithout 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 viaraycast --x --ydirectly — misleadingly suggesting the collider's hit detection itself was broken. - Now every
--annotate-raycast-gridcall 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
RaycastLayerNamesCheckedfield 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.CaptureRenderingAsynconto a single clustering code path; layer mask defaults toPhysics.DefaultRaycastLayerswhen--raycast-layer-maskis not given. - Added
RaycastLayerMaskResolver.CreateLayerNamesFromMaskto convert a layer bitmask into layer names, reused for the newRaycastLayerNamesCheckedfield. - Removed the coarse 5x5 grid path (
RaycastGridPointsfield,RaycastGridPointInfoDTO, and related dead code inRaycastGridAnnotator), replaced with the internalRaycastLayerHitSampletype used only for layer-summary aggregation. - Updated skill docs (
annotated-elements.md,SimulateMouseInput/SKILL.mdand their generated mirrors),README.md, anddefault-tools.jsontool descriptions to match.
Verification
dist/darwin-arm64/uloop compile— 0 errors, 0 warningsuloop run-testsforRaycastGridAnnotatorTests(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,RaycastLayerNamesCheckedreflects the expected layer set with and without--raycast-layer-mask, andRaycastLayerSummariesremains populated in both cases