API ReferenceGE Extensionsflowgraphnodesscene
Get Point on Decalroad (Flowgraph Node)
- **Node Name:** `Get Point on Decalroad`
Overview
- Node Name:
Get Point on Decalroad - Category:
repeat_instant - File:
extensions/flowgraph/nodes/scene/getPointOnDecalroad.lua
Returns the position and approximate forward rotation of a specific control point on a DecalRoad object.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
roadId | number | ID of the DecalRoad object |
idx | number | Index of the point on the road |
Output Pins
| Pin | Type | Description |
|---|---|---|
pos | vec3 | World position of the point |
rot | quat | Approximate forward-facing rotation at the point |
Behavior
_executionStarted()- Resets cached road object and index.work()- Each frame:- If
roadIdchanged, looks up the road viascenetree.findObjectById(), caches it, reads node count and looped status. - If
idxchanged and is within bounds (0 to nodeCount-1):- Gets the node position via
roadObj:getNodePosition(idx). - Computes an approximate forward direction by getting
prevandnextnodes (wrapping for looped roads). - Builds a quaternion from the forward direction using
quatFromDir(forward, up).
- Gets the node position via
- Caches results to avoid redundant lookups.
- If
Internals
self.roadObj- Cached DecalRoad scene objectself.oldRoadId/self.oldIdx- Change detection for cachingself.maxIdx- Maximum valid node indexself.looped- Whether the road loops (from theloopedfield)
Key Dependencies
scenetree.findObjectById(id)- Finds the road objectroadObj:getNodeCount()- Number of control pointsroadObj:getNodePosition(idx)- Position of a control pointroadObj:getField("looped", 0)- Whether the road is loopedquatFromDir(forward, up)- Quaternion from direction vector
How It Works
The node provides access to DecalRoad control points - useful for placing objects along roads, creating waypoint sequences, or aligning cameras with road direction. The rotation is approximated by computing the direction between the previous and next control points, giving a tangent-like orientation. Looped roads wrap indices correctly.
Example Usage
-- Iterate through road points to place markers
-- Wire roadId from an ID by Name node targeting a DecalRoad
-- Increment idx over time to animate something along the road
-- Use rot output to orient objects facing along the roadAdditional Methods
C:init()
Initializes the node, setting up pins and default properties.
See Also
- Collection Marker (Flowgraph Node) - Related reference
- Custom Lua Command (Flowgraph Node) - Related reference
- Get Object Field (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide