Repository navigation
Crossing editor: show neighbour lanes and joints across large junctions - #121
Merged
turbo-devv merged 1 commit intoNov 14, 2026
Merged
Conversation
- Center neighbour lane queries and 3D snapping around the camera target instead of the object origin so external roads at the perimeter of large junctions (1-2 km across) are drawn and selectable - Expand reach limits for neighbour lanes, nearby points, and auto-linking up to 3500-4000 m - Account for crossing footprint and existing path extents when gathering nearby ends - Keep neighbour lanes visible when editing an empty or new crossing draft - Lift neighbour lane ribbons to 0.25 m and adjust line width/contrast to prevent z-fighting with road meshes
turbo-devv
reviewed
Nov 14, 2026
turbo-devv
left a comment
Contributor
There was a problem hiding this comment.
Centring the neighbour-lane and joint queries on cam.target instead of the object's origin looks like the actual fix for large junctions. The raised limits are what worry me:
- Per-frame cost.
lanes::near/near_skippinglay out every lane of every spline and object in reach (up to 400 samples a lane, plus the link grid). They run in the draw path every frame. The neighbour reach goes from at most 700 m to 3500 m, which is about 25 times the area, andsync_crossing_nearbynow has a 500 m floor. The comments right above these lines (buffer overflow, "the whole of that every frame is what made the nearby-path modes stall") describe the problem this brings back. Please measure frame time on a large map before raising these limits. A floor tied to the crossing's own span, not a 3500 m cap, may be enough. - Unrelated scope. In
editor.rsthe Logic tool /show_lanesradius changes fromclamp(40, 500)toclamp(100, 3500). That affects every map, not just the crossing editor. - Leftovers.
let Some(_o) = doc.object(k, id)incrossing_neighbour_jointsandlet _abs = ...ineditor.rsare dead now. Drop them, or writedoc.object(k, id).is_none(). - The doc comment on
lanes::neighbour_reach("zoomed out, not the whole map") no longer describes a 3500 m cap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In large crossing objects spanning multiple tiles (e.g. 1000m-2200m across on world coordinate maps), external connecting road lanes and connection joints were invisible or could not be snapped to when zoomed into the perimeter of the junction.
Changes
eighbour_reach, \sync_crossing_nearby, and \link_crossing.