RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Rally Audio ManagerRally Camera Path PlayerRally ClientRally Cut CaptureRally EnumsRally Extension HelperRally GeometryRally ManagerRecce ManagerRecce AppRecce SettingsRally Settings ManagerSnap-to-RoadTraffic Exclusion ZonesRally UtilityRally Vehicle CaptureRally Vehicle Tracker
Rally Driveline MeasurementRally Driveline RouteRally Driveline V3Rally Driveline Point ListRally Driveline Utility

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsgameplayrallydriveline

Rally Driveline Point List

Container class for a series of points along a rally driveline path. Provides point creation, relationship management, normal calculation, length computation, nearest-point search, and debug rendering

Container class for a series of points along a rally driveline path. Provides point creation, relationship management, normal calculation, length computation, nearest-point search, and debug rendering.


Constructor

local PointList = require('/lua/ge/extensions/gameplay/rally/driveline/pointList')
local pl = PointList(points)

Public API

MethodSignatureReturnsDescription
init(points)nilInitializes with optional array of points
createPoint(pos, quat, ts)tableCreates a new point with standard format
setupPointRelationships()nilSets prev/next links and IDs for all points
setupPointNormals()nilCalculates terrain-aligned normals for all points
calculateLength()numberReturns total path length in meters
count()numberNumber of points
get(index)tablePoint at index
getAll()tableAll points array
setAll(points)nilReplaces all points and rebuilds relationships/normals
findNearestPoint(srcPos)table/nilBrute-force nearest point by squared distance
downsample()selfStub - returns self (DrivelineV3 handles simplification)
drawDebug(drawLabels)nilRenders points as spheres with optional labels

Internals

Point Structure

Each point contains:

FieldTypeDescription
posvec3World position
quatquatRotation quaternion
tsnumberTimestamp
normalvec3Forward-facing terrain normal
prevtable/nilPrevious point reference
nexttable/nilNext point reference
idnumber/nilSequential index
partitionanyOptional partition data
pacenoteDistancestableDistance cache for pacenotes
cachedPacenotestableCached pacenote references (cs, ce, at, auto_at, half)

How It Works

  1. Points form a doubly-linked list via prev/next references
  2. setupPointRelationships() assigns sequential IDs and links
  3. setupPointNormals() computes terrain-aligned normals using snaproadNormals.forwardNormalVec
  4. calculateLength() sums distances between consecutive points
  5. findNearestPoint() performs O(n) brute-force search (suitable for moderate point counts)

Usage Examples

-- Create a point list from positions
local points = {}
for i, pos in ipairs(positions) do
  table.insert(points, {pos = pos, quat = quat(0,0,0,1), ts = i})
end
local pl = PointList(points)
pl:setupPointRelationships()
pl:setupPointNormals()

-- Query length
local totalLen = pl:calculateLength()

-- Find nearest point to a position
local nearest = pl:findNearestPoint(vehiclePos)

Notes

  • Uses gameplay/rally/snaproad/normals for terrain-aware normal calculation
  • Debug rendering uses colors from gameplay/rally/util/colors
  • The downsample() method is a no-op stub for compatibility with older code
  • cachedPacenotes fields are used by the rally system to track per-point pacenote proximity

See Also

  • Rally Driveline Measurement - Related reference
  • Rally Driveline Route - Related reference
  • Rally Driveline V3 - Related reference
  • Gameplay Systems Guide - Guide

Rally Driveline V3

Third-generation driveline system for rally stages. Loads recorded driveline data from recce sessions, simplifies it using RDP algorithm, generates smooth Catmull-Rom splines, and produces final drive

Rally Driveline Utility

Utility constants for the rally driveline spline system. Provides default values for spline width, RDP simplification tolerance, and subdivision parameters.

On this page

ConstructorPublic APIInternalsPoint StructureHow It WorksUsage ExamplesNotesSee Also