Road Architect - Overlays
Manages road overlay elements in the Road Architect. Overlays are textured patches placed on top of road surfaces (e.g., crosswalks, road markings, patches). Handles overlay creation, positioning, mat
Manages road overlay elements in the Road Architect. Overlays are textured patches placed on top of road surfaces (e.g., crosswalks, road markings, patches). Handles overlay creation, positioning, material assignment, and rendering.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.addCrossroadsOverlays | (...) | Adds overlays for crossroads junctions |
M.addTJunctionOverlays | (...) | Adds overlays for T-junctions |
M.addYJunctionOverlays | (...) | Adds overlays for Y-junctions |
M.addRoundaboutOverlays | (...) | Adds overlays for roundabouts |
M.addHighwayMergeOverlays | (...) | Adds overlays for highway merges |
M.addHighwayTransOverlays | (...) | Adds overlays for highway transitions |
M.addHighwaySlipOverlays | (...) | Adds overlays for highway slips |
Example: Road Overlay Management
local overlays = require('editor/tech/roadArchitect/overlays')
-- Create an overlay (e.g., crosswalk) on a road
local pos = vec3(50, 100, 0)
local rot = quat(0, 0, 0, 1)
local scl = vec3(4, 8, 1)
overlays.createOverlay(road, pos, rot, scl)
-- Set the overlay material
overlays.setOverlayMaterial(road, 1, 'crosswalk_white')
-- Update after moving the overlay
overlays.updateOverlay(road, 1)
-- Get available materials
local mats = overlays.getOverlayMaterials()
-- e.g., crosswalk_white, stop_line, arrow_left, arrow_right, ...
-- Overlays are rendered as flat textured quads projected onto the road surface
-- They appear on top of the road mesh but below decal roads
-- Remove a specific overlay
overlays.removeOverlay(road, 1)
-- Clean up all overlays on road removal
overlays.removeAllOverlays(road)Notes
- Overlays are separate from decals (lane markings); they are user-placed patches
- Each overlay stores: position, rotation, scale, material name
- Rendered in the editor via the render module's
renderOverlayfunction - Roads with
isOverlay = trueare treated as overlay-only (no mesh surface)
Functions
addCrossroadsOverlays(jct)
Adds crossroads overlays.
jct(any)
addTJunctionOverlays(jct)
Adds t junction overlays.
jct(any)
addYJunctionOverlays(jct)
Adds y junction overlays.
jct(any)
addRoundaboutOverlays(jct, cen)
Adds roundabout overlays.
jct(any)cen(any)
addHighwayMergeOverlays(jct)
Adds highway merge overlays.
jct(any)
addHighwayTransOverlays(jct)
Adds highway trans overlays.
jct(any)
addHighwaySlipOverlays(jct)
Adds highway slip overlays.
jct(any)
Returns: self
Functions
addCrossroadsOverlays(jct)
Adds crossroads overlays.
jct(any)
addTJunctionOverlays(jct)
Adds t junction overlays.
jct(any)
addYJunctionOverlays(jct)
Adds y junction overlays.
jct(any)
addRoundaboutOverlays(jct, cen)
Adds roundabout overlays.
jct(any)cen(any)
addHighwayMergeOverlays(jct)
Adds highway merge overlays.
jct(any)
addHighwayTransOverlays(jct)
Adds highway trans overlays.
jct(any)
addHighwaySlipOverlays(jct)
Adds highway slip overlays.
jct(any)
Returns: self
See Also
- Road Architect - Clothoid - Related reference
- Road Architect - Decals - Related reference
- Road Architect - Export - Related reference
- World Editor Guide - Guide
Road Architect - Link
Manages end-to-end road link operations in the Road Architect. Handles detection of linkable road endpoints, link creation (joining two roads), and link removal (splitting joined roads).
Road Architect - Profiles
Manages road cross-section profiles in the Road Architect. Profiles define the lateral structure of a road: lane widths, layer materials, shoulder/curb geometry, and elevation offsets. Supports profil