API ReferenceGE Extensionsflowgraphnodestypes
Quat (Flowgraph Node)
- **Node Name:** `Quat`
Overview
- Node Name:
Quat - Category:
repeat_instant - File:
extensions/flowgraph/nodes/types/quat.lua
Constructs a quaternion from four numeric components (x, y, z, w) and outputs it as a quat value.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
x | number | The x component |
y | number | The y component |
z | number | The z component |
w | number | The w component |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | quat | The quaternion value (as {x, y, z, w} table) |
How It Works
work()- Reads x/y/z/w from input pins (defaulting to 0), constructs aquat, and outputs it as a 4-element table{x, y, z, w}.drawMiddle()- Shows the quaternion string representation inline on the node.
Internals
- Uses a module-level
quatOutto avoid per-frame allocation. - Output is a plain table
{x, y, z, w}, not a quat userdata - this is the standard flowgraph wire format for quaternions.
Example Usage
-- Construct identity quaternion
-- x=0, y=0, z=0, w=1
-- Output: {0, 0, 0, 1}
-- The node is equivalent to:
local q = quat(x, y, z, w)
self.pinOut.value.value = {q.x, q.y, q.z, q.w}Additional Methods
C:_onDeserialized(nodeData)
Called after the node is deserialized (loaded from file). Restores runtime state from saved data.
Parameters:
nodeData
C:_onSerialize(res)
Called when the node is serialized (saved to file). Returns data to persist.
Parameters:
res
C:drawProperties()
Custom ImGui drawing function for the node editor.
See Also
- Bool (Flowgraph Node) - Related reference
- Color (Flowgraph Node) - Related reference
- Generic Set/Get Variable (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide