API ReferenceGE Extensionsflowgraphnodesvehicle
Get Vehicle Wheel Center
- **Node Name:** `Get Vehicle Wheel Center`
Overview
- Node Name:
Get Vehicle Wheel Center - Category:
repeat_instant - File:
extensions/flowgraph/nodes/vehicle/vehicleWheels.lua
Computes and outputs the average world-space position of all wheel axis nodes on a vehicle.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | Vehicle ID. Falls back to player vehicle. |
Output Pins
| Pin | Type | Description |
|---|---|---|
wheelCenter | vec3 | Average position of all wheel axis nodes in world space. |
Internals
Key Methods
| Method | Description |
|---|---|
init() | No-op. |
work() | Iterates over all wheels, averages their positions, and adds the vehicle's ref-node offset. |
How It Works
- Resolves the vehicle by ID or falls back to the player vehicle.
- Iterates
veh:getWheelCount()wheels, reading each wheel's first axis node position viaveh:getNodePosition(axisNodes[1]). - Accumulates all positions, then divides by count to get the average.
- Adds the vehicle's world position (
veh:getPosition()) since node positions are in local space. - Outputs the result as a table-format vec3.
Note: Node positions from
getNodePosition()are relative to the vehicle's ref node. The vehicle world position is added to convert to world space.
Usage Example
-- Flowgraph:
-- [Vehicle ID] → vehId → [Get Vehicle Wheel Center]
-- ↓ wheelCenter → [Ground Level Check]
-- Equivalent GE Lua:
local veh = getPlayerVehicle(0)
local center = vec3(0, 0, 0)
local count = veh:getWheelCount()
for i = 0, count - 1 do
local axisNodes = veh:getWheelAxisNodes(i)
center:setAdd(vec3(veh:getNodePosition(axisNodes[1])))
end
center:setScaled(1 / count)
center:setAdd(vec3(veh:getPosition()))Key Dependencies
veh:getWheelCount()/veh:getWheelAxisNodes()- wheel axis node accessveh:getNodePosition()- beam node local positionsveh:getPosition()- vehicle ref-node world position
See Also
- Align for Coupling (Flowgraph Node) - Related reference
- Apply Velocity to Vehicle (Flowgraph Node) - Related reference
- Boost Vehicle (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide