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
Geo PacenotesDriveline Normals

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 Extensionsgameplayrallysnaproad

Driveline Normals

Calculates forward normal vectors for driveline points using adjacent point positions. Used for waypoint orientation and direction display.

Calculates forward normal vectors for driveline points using adjacent point positions. Used for waypoint orientation and direction display.


Exports

FunctionSignatureReturnsDescription
M.normalAlignPoints(point)prev, current, nextReturns the prev/current/next points for normal calculation
M.forwardNormalVec(point)vec3 | nilCalculates forward normal vector at a point

How It Works

normalAlignPoints(point)

Simply returns point.prev, point, and point.next from the linked-list driveline structure.

forwardNormalVec(point)

Calculates the forward direction vector using available adjacent points:

  1. Both neighbors exist: Uses prev→next direction (smoothest result)
  2. Only next exists: Uses current→next direction
  3. Only prev exists: Uses prev→current direction
  4. No neighbors: Returns nil

Delegates actual normal calculation to rallyUtil.calculateForwardNormal(fromPos, toPos).

local normals = require('/lua/ge/extensions/gameplay/rally/snaproad/normals')

-- Get forward direction at a driveline point
local normalVec = normals.forwardNormalVec(point)
if normalVec then
  -- normalVec is a unit vec3 pointing in the forward direction
end

-- Get alignment points for custom calculations
local prev, curr, next = normals.normalAlignPoints(point)

See Also

  • geoPacenotes - Geometric Pacenote Measurement - Related reference
  • Gameplay Systems Guide - Guide

Geo Pacenotes

Measures pacenote corner geometry by fitting circles to driveline points. Calculates corner severity, direction, radius, arc length, and fit quality. Provides debug visualization with 3D arc prisms.

Route Tracking Test

Debug extension for testing the route tracking system. Creates a simple 3-point route and tracks the player vehicle along it with debug visualization.

On this page

ExportsHow It WorksnormalAlignPoints(point)forwardNormalVec(point)See Also