API ReferenceGE Extensionsflowgraphnodesutil
Line Point From Xnorm (Flowgraph Node)
- **Node Name:** `Line Point From Xnorm`
Overview
- Node Name:
Line Point From Xnorm - Category:
repeat_instant - File:
extensions/flowgraph/nodes/util/linePointFromXnorm.lua
Returns the position that lies between two points on a line segment at a given normalized ratio (xnorm).
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
posA | vec3 | Line start position |
posB | vec3 | Line end position |
xnorm | number | Normalized ratio (0 = posA, 1 = posB); defaults to 0.5 (midpoint) |
Output Pins
| Pin | Type | Description |
|---|---|---|
pos | vec3 | Calculated interpolated position |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Converts input tables to vec3, calls linePointFromXnorm(), outputs result as table |
How It Works
- Reads
posAandposBas vec3 values from their table representations. - Uses the engine function
linePointFromXnorm(posA, posB, xnorm)to compute the interpolated point. - Defaults to
0.5(midpoint) if no xnorm value is provided. - Outputs the result converted back to a table via
:toTable().
Usage Example
-- Find the midpoint between two waypoints:
-- [Waypoint A] → posA → [Line Point From Xnorm] xnorm=0.5
-- [Waypoint B] → posB → → pos → [Place Object]
-- Find a point 25% along a segment:
-- [Line Point From Xnorm] posA={0,0,0}, posB={100,0,0}, xnorm=0.25
-- → pos = {25, 0, 0}
-- Direct Lua equivalent:
local pos = linePointFromXnorm(vec3(0,0,0), vec3(100,0,0), 0.25)Key Dependencies
linePointFromXnorm()- engine function for linear interpolation along a line segmentvec3- 3D vector type with:setFromTable()and:toTable()methods
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide