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.
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.
Class Methods
| Method | Description |
|---|---|
C:init(sitesEditor, key) | Initializes with parent editor reference and data key |
C:setSites(sites) | Binds to a sites object and its location list |
C:select(loc) | Selects a location and updates the axis gizmo transform |
C:hitTest(mouseInfo, objects) | Ray-tests against location spheres, returns closest hit |
C:updateTransform() | Sets the axis gizmo position from the current location |
C:beginDrag() | Records starting position and radius before drag |
C:dragging() | Updates position (translate) or radius (scale) during drag |
C:endDragging() | Commits transform change to undo history |
C:create(pos) | Creates a new location at the given position (with undo) |
C:remove(loc) | Removes a location (with undo) |
C:drawElement(loc) | Draws gizmo for the selected location element |
Example: Location Element Lifecycle
-- Locations are created by the sortedListDisplay wrapper
-- Internal usage within the sites editor:
local locations = require('editor/sitesEditor/locations')
local locEditor = locations(sitesEditorRef, 'locations')
-- Bind to sites data
locEditor:setSites(currentSites)
-- Select a location
locEditor:select(someLocation)
-- Hit test against all location objects
local hit = locEditor:hitTest(mouseInfo, currentSites.locations.objects)
if hit then
locEditor:select(hit)
end
-- Create a new location at mouse position
local newLoc = locEditor:create(mouseInfo._downPos)
-- Remove the current location
locEditor:remove(currentLocation)Notes
- Locations are spheres with position and radius
- Uses
editor.AxisGizmoMode_Translateandeditor.AxisGizmoMode_Scale - Undo/redo uses
editor.history:commitActionwith paired callbacks
Module Variables
windowDescription(string) - Module variable.
Module Variables
windowDescription(string) - Module variable.
See Also
- Sites Editor - Parking Spots - Related reference
- Sites Editor - Sorted List Display - Related reference
- Sites Editor - Tags - Related reference
- World Editor Guide - Guide
Sidewalk Spline Manager
Manages sidewalk spline data structures, including creation, removal, splitting, joining, undo/redo, profile copy/paste, and serialization. Works with `kit`, `populate`, and `geom` submodules.
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.