Rally Editor - Measurements Tab
Sub-module for measuring distances along the stage snaproad with persistent, auto-saving measurement groups.
Sub-module for measuring distances along the stage snaproad with persistent, auto-saving measurement groups.
Overview
Provides tools for placing measurement points along the rally stage snaproad and calculating distances between them. Supports both direct (straight-line) and route-following distance modes. Measurements auto-save to a JSON file and support interactive point placement, dragging, and reordering.
Class Methods
| Method | Signature | Description |
|---|---|---|
C:init | (rallyEditor) | Initializes measurement state |
C:setPath | (path) | Sets the notebook path |
C:selected | () | Loads snaproad from pacenotes window, auto-loads measurements |
C:unselect | () | Tab deactivation hook |
C:draw | (mouseInfo, dtReal, dtSim, dtRaw) | Renders UI and handles input |
C:drawDebugEntrypoint | () | 3D rendering: snaproad, points, lines, labels |
C:handleMouseInput | () | Click=add/select points, Drag=move points along route |
C:createMeasurement | (name) | Creates new measurement with random color |
C:deleteMeasurement | (id) | Removes a measurement |
C:addPointToMeasurement | (id, point) | Adds a point to a measurement |
C:removePointFromMeasurement | (id, pointIndex) | Removes a point |
C:movePointUp / C:movePointDown | (id, index) | Reorders points |
C:calculateMeasurementDistance | (id) | Calculates total distance (route or direct) |
C:saveMeasurements / C:loadMeasurements | () | JSON persistence to measurements.json |
C:findNearestPoint | (mousePos) | Finds closest point across all measurements |
Measurement Properties
| Property | Type | Description |
|---|---|---|
name | string | Display name |
points | vec3[] | Ordered list of measurement positions |
totalDistance | float | Calculated distance (meters) |
followRoute | bool | Follow snaproad vs straight-line distance |
color | float[3] | RGB display color (random vibrant HSV) |
textColor | float[3] | Label text color (auto black/white based on luminance) |
Distance Calculation
| Mode | Description |
|---|---|
| Follow Route | Measures along snaproad segments between points, accounting for continuous positioning via xnormOnLine |
| Direct | Straight-line Euclidean distance between consecutive points |
Visual Elements
| Element | Description |
|---|---|
| Colored spheres | Measurement points (pulsating when selected) |
| Intersection planes | Direction indicators at each point |
| Prism lines | Connections between points (route-following or direct) |
| Labels | Measurement name + distance at first and last points |
| Hover indicator | White sphere showing where new point would be placed |
Notes
- Points snap to the snaproad when within 5m threshold.
- Dragging uses XY delta with projection onto closest road segment.
- Auto-saves on every modification (create, delete, add/remove point, drag, reorder).
- Color picker with auto text color (black for bright colors, white for dark).
- File path:
<missionDir>/measurements.json.
Module Variables
windowDescription(string) - Module variable.
Functions
getMeasurementsFilePath()
Returns the measurements file path.
Returns: boolean - false
serialize()
Serializes data for persistence.
Returns: boolean - false
deserialize(data)
Deserializes data from persistence.
data(table)
Returns: boolean - true
setSnaproad(snaproad)
Sets the snaproad.
snaproad(any)
Returns: end
drawMeasurementPoints()
Draws measurement points.
getMeasurement(measurementId)
Returns the measurement.
measurementId(any)
Returns: self.measurements[measurementId]
updateMeasurement(measurementId, name)
Updates measurement.
measurementId(any)name(string)
Returns: number - 0
selectMeasurement(measurementId)
Selects measurement.
measurementId(any)
Returns: number - 0
Module Variables
windowDescription(string) - Module variable.
Functions
getMeasurementsFilePath()
Returns the measurements file path.
Returns: boolean - false
serialize()
Serializes data for persistence.
Returns: boolean - false
deserialize(data)
Deserializes data from persistence.
data(table)
Returns: boolean - true
setSnaproad(snaproad)
Sets the snaproad.
snaproad(any)
Returns: end
drawMeasurementPoints()
Draws measurement points.
getMeasurement(measurementId)
Returns the measurement.
measurementId(any)
Returns: self.measurements[measurementId]
updateMeasurement(measurementId, name)
Updates measurement.
measurementId(any)name(string)
Returns: number - 0
selectMeasurement(measurementId)
Selects measurement.
measurementId(any)
Returns: number - 0
See Also
- Rally Editor - Driveline Tab - Related reference
- Rally Editor – Mission Settings Tab - Related reference
- Rally Editor – Notebook Info Tab - Related reference
- World Editor Guide - Guide
Rally Editor - Driveline Tab
Sub-module for editing the stage driveline - an editable spline that defines the driving path through a rally stage.
Rally Editor – Mission Settings Tab
Editor tab for configuring rally mission settings: notebook selection, codriver assignment, and recce corner-call style preferences.