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
| Function | Signature | Returns | Description |
|---|---|---|---|
M.normalAlignPoints | (point) | prev, current, next | Returns the prev/current/next points for normal calculation |
M.forwardNormalVec | (point) | vec3 | nil | Calculates 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:
- Both neighbors exist: Uses
prev→nextdirection (smoothest result) - Only next exists: Uses
current→nextdirection - Only prev exists: Uses
prev→currentdirection - 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.