Sites Editor - Parking Spots
Sub-editor for managing parking spot elements within the Sites Editor. Supports position/rotation/scale editing via transformUtil, vehicle scale presets, and multi-spot configurations.
Sub-editor for managing parking spot elements within the Sites Editor. Supports position/rotation/scale editing via transformUtil, vehicle scale presets, and multi-spot configurations.
Class Methods
| Method | Description |
|---|---|
C:init(sitesEditor, key) | Initializes with parent editor and transform utility |
C:setSites(sites) | Binds to sites data; fixes rotation adjustments from multi-spots |
C:select(ps) | Selects a parking spot and syncs multi-spot UI state |
C:hitTest(mouseInfo, objects) | OBB ray intersection test against all spots (incl. multi-spot copies) |
C:create(pos) | Creates a new parking spot at position (with undo) |
C:remove(ps) | Removes a parking spot (with undo) |
C:setTransform() | Sets transform utility from current spot's pos/rot/scl |
C:updateFromTransform() | Writes transform utility values back to spot |
C:updateTransform() | Commits transform change to undo history |
C:updateMultiSpot() | Syncs multi-spot UI values to the current spot data |
C:drawElement(ps, mouseInfo) | Draws transform gizmo, scale combo, and multi-spot UI |
Example: Parking Spot Management
local parkingSpots = require('editor/sitesEditor/parkingSpots')
local psEditor = parkingSpots(sitesEditorRef, 'parkingSpots')
psEditor:setSites(currentSites)
-- Hit test uses OBB intersection (supports multi-spot bounding boxes)
local hit = psEditor:hitTest(mouseInfo, currentSites.parkingSpots.objects)
-- Vehicle scale presets:
-- "Car" = vec3(2.5, 6, 3)
-- "LargeCar" = vec3(3.25, 8, 4)
-- "Bus" = vec3(4, 14, 8)
-- Multi-spot configuration:
-- spotAmount: 1-25 copies
-- spotOffset: gap between copies
-- spotDirection: "Left", "Right", "Front", "Back"
-- spotRotation: -1.55 to 1.55 radiansModule Variables
windowDescription(string) - Module variable.
Module Variables
windowDescription(string) - Module variable.
See Also
- Sites Editor - Locations - Related reference
- Sites Editor - Sorted List Display - Related reference
- Sites Editor - Tags - Related reference
- World Editor Guide - Guide
Sites Editor - Locations
Sub-editor for managing location elements within the Sites Editor. Handles hit-testing, gizmo-based transform editing (translate/scale), and undo/redo for location creation/removal.
Sites Editor - Sorted List Display
Generic sorted list UI wrapper for the Sites Editor. Manages element selection (single/multi), search filtering, custom fields, tags, name/color editing, and delegates to element-specific editors.