Skip to content

fix(viewer): keep offset door hit targets reachable from both sides - #978

Merged
Aymericr merged 4 commits into
mainfrom
fix/offset-door-hit-target
Sep 30, 2026
Merged

Aymericr merged 4 commits into
mainfrom
fix/offset-door-hit-target

Conversation

@Aymericr

@Aymericr Aymericr commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A door positioned away from its host wall can leave its invisible opening hit target behind the wall collision surface. Clicking from that side then selects the wall despite the visible opening.

Resolve the hit target from the host wall's zero-offset opening placement and express its horizontal correction in the door's rotated coordinates. This follows straight, curved and justified walls, including effective wall thickness. Visible frames, panels and the resolved floor height retain their authored placement. Unhosted and roof-hosted doors retain their existing behavior; reused targets reset after offset or parent changes. Frameless opening outlines follow the corrected opening position.

Validation: 119 focused tests / 1,456 assertions pass across eleven files, including actual wall collision rays from both sides, positive and negative offsets, flipped doors, rotated and curved walls, both wall justifications, compound rotations and mounted mesh reuse. The curved-wall follow-up reproduces eight failures before correction. Current-main legacy-load and zone-deletion controls also pass. Core/viewer TypeScript builds, formatting checks and both CI jobs pass. Independent architecture and regression reviews found no blocker.


Note

Medium Risk
Changes invisible selection raycast geometry for wall-hosted doors with Z offset; behavior is heavily tested but affects core picking/interaction paths.

Overview
Fixes selection when a door is offset from its host wall: the invisible cutout raycast proxy now stays centered on the wall opening (zero Z offset) while frames and panels keep their authored offset.

resolveOpeningCutoutProxyDepth becomes resolveOpeningCutoutProxy, returning depth plus an optional placement center from getOpeningWallPlacement with Z cleared; syncDoorCutout applies that correction in the door mesh’s local space (including compound rotation). Unhosted doors, roof segments, and zero offset are unchanged; the proxy resets when offset or parent changes.

Adds door-cutout-proxy.test.ts with raycast, curved/justified wall, DoorSystem live-update, mesh reuse, and sliding-door visual bounds coverage.

Reviewed by Cursor Bugbot for commit 53c6f2e. Bugbot is set up for automated code reviews on this repo. Configure here.

@pascal

pascal Bot commented Sep 29, 2026

Copy link
Copy Markdown

I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…).

Please try again, rephrase, or reach out if it keeps failing.

Error id: e964d661-f473-4e4c-906a-634776021000

@Aymericr
Aymericr marked this pull request as ready for review September 30, 2026 02:18
@Aymericr
Aymericr merged commit ec0dcea into main Sep 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant