API ReferenceGE Extensionsflowgraphnodesscene
Point on Decalroad (Flowgraph Node)
- **Node Name:** `Point on Decalroad`
Overview
- Node Name:
Point on Decalroad - Category:
repeat_instant - File:
extensions/flowgraph/nodes/scene/pointOnDecalroad.lua
Checks if a given point is on a decal road and provides the closest control point index.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
point | vec3 | Point to be checked |
roadId | number | ID of the decal road |
Output Pins
| Pin | Type | Description |
|---|---|---|
inside | flow | Outflow when point is on the road |
outside | flow | Outflow when point is not on the road |
onRoad | bool | Whether the point is on the road |
closestIdx | number | Closest control point index (-1 if not on road) |
maxIdx | number | Total control point count minus one |
Behavior
work()- Each frame:- Looks up the road object by
roadId(caches between frames). - Projects the input point to the road's Z plane.
- Calls
roadObj:containsPoint(point)to test containment. - Sets
inside/outsideflow andonRoadbool accordingly.
- Looks up the road object by
How It Works
- The road object is fetched via
scenetree.findObjectById()and cached. - The Z coordinate of the test point is overridden to match the road's first node Z, creating a 2D containment test.
containsPoint()returns the closest control point index, or -1 if the point is outside the road.
Key Dependencies
scenetree.findObjectById()- finds the DecalRoad objectDecalRoad:containsPoint()- engine method for road containment testingDecalRoad:getNodePosition()/getNodeCount()- road geometry queries
Additional Methods
C:_executionStarted()
Called when graph execution starts. Used for initialization/reset.
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