Math Blueprint Nodes
This document describes the blueprint nodes provided by the @esengine/ecs-framework-math module.
Note: These nodes require the math module to be installed.
Pin Type Legend
Section titled “Pin Type Legend” Float
Vector2
Fixed32
FixedVector2
Color
Vector2 Nodes
Section titled “Vector2 Nodes”2D vector operations for position, velocity, and direction calculations.
Node List
Section titled “Node List”| Node | Description | Inputs | Output |
|---|---|---|---|
Make Vector2 | Create Vector2 from X, Y | X, Y | Vector2 |
Break Vector2 | Decompose Vector2 to X, Y | Vector | X, Y |
Vector2 + | Vector addition | A, B | Vector2 |
Vector2 - | Vector subtraction | A, B | Vector2 |
Vector2 * | Vector scaling | Vector, Scalar | Vector2 |
Vector2 Length | Get vector length | Vector | Float |
Vector2 Normalize | Normalize to unit vector | Vector | Vector2 |
Vector2 Dot | Dot product | A, B | Float |
Vector2 Cross | 2D cross product | A, B | Float |
Vector2 Distance | Distance between two points | A, B | Float |
Vector2 Lerp | Linear interpolation | A, B, T | Vector2 |
Vector2 Rotate | Rotate by angle (radians) | Vector, Angle | Vector2 |
Vector2 From Angle | Create unit vector from angle | Angle | Vector2 |
Example: Calculate Movement Direction
Section titled “Example: Calculate Movement Direction”Direction vector from start to end point:
Make Vector2
X
0
Y
0
Vector
Make Vector2
X
100
Y
50
Vector
Vector2 -
A
B
Result
Vector2 Normalize
Vector
Result
Example: Circular Motion
Section titled “Example: Circular Motion”Calculate circular position using angle and radius:
Vector2 From Angle
Angle
1.57
Vector
Vector2 *
Vector
Scalar
50
Result
Vector2 +
A (Center)
B
Position
Fixed32 Nodes (Fixed-Point Numbers)
Section titled “Fixed32 Nodes (Fixed-Point Numbers)”Q16.16 fixed-point number operations for lockstep networking games, ensuring cross-platform calculation consistency.
Node List
Section titled “Node List”| Node | Description | Inputs | Output |
|---|---|---|---|
Fixed32 From Float | Create from float | Float | Fixed32 |
Fixed32 From Int | Create from integer | Int | Fixed32 |
Fixed32 To Float | Convert to float | Fixed32 | Float |
Fixed32 To Int | Convert to integer | Fixed32 | Int |
Fixed32 + | Addition | A, B | Fixed32 |
Fixed32 - | Subtraction | A, B | Fixed32 |
Fixed32 * | Multiplication | A, B | Fixed32 |
Fixed32 / | Division | A, B | Fixed32 |
Fixed32 Abs | Absolute value | Value | Fixed32 |
Fixed32 Sqrt | Square root | Value | Fixed32 |
Fixed32 Floor | Floor | Value | Fixed32 |
Fixed32 Ceil | Ceiling | Value | Fixed32 |
Fixed32 Round | Round | Value | Fixed32 |
Fixed32 Sign | Sign (-1, 0, 1) | Value | Fixed32 |
Fixed32 Min | Minimum | A, B | Fixed32 |
Fixed32 Max | Maximum | A, B | Fixed32 |
Fixed32 Clamp | Clamp to range | Value, Min, Max | Fixed32 |
Fixed32 Lerp | Linear interpolation | A, B, T | Fixed32 |
Example: Lockstep Movement Speed Calculation
Section titled “Example: Lockstep Movement Speed Calculation”Fixed32 From Float
Value
5.0
Speed
Fixed32 From Float
Value
0.016
DeltaTime
Fixed32 *
A
B
Result
Fixed32 To Float
Fixed
Float
FixedVector2 Nodes (Fixed-Point Vectors)
Section titled “FixedVector2 Nodes (Fixed-Point Vectors)”Fixed-point vector operations for deterministic physics calculations, suitable for lockstep networking.
Node List
Section titled “Node List”| Node | Description | Inputs | Output |
|---|---|---|---|
Make FixedVector2 | Create from X, Y floats | X, Y | FixedVector2 |
Break FixedVector2 | Decompose to X, Y floats | Vector | X, Y |
FixedVector2 + | Vector addition | A, B | FixedVector2 |
FixedVector2 - | Vector subtraction | A, B | FixedVector2 |
FixedVector2 * | Scale by Fixed32 | Vector, Scalar | FixedVector2 |
FixedVector2 Negate | Negate vector | Vector | FixedVector2 |
FixedVector2 Length | Get length | Vector | Fixed32 |
FixedVector2 Normalize | Normalize | Vector | FixedVector2 |
FixedVector2 Dot | Dot product | A, B | Fixed32 |
FixedVector2 Cross | 2D cross product | A, B | Fixed32 |
FixedVector2 Distance | Distance between points | A, B | Fixed32 |
FixedVector2 Lerp | Linear interpolation | A, B, T | FixedVector2 |
Example: Deterministic Position Update
Section titled “Example: Deterministic Position Update”Make FixedVector2
X
10
Y
20
Position
Make FixedVector2
X
1
Y
0
Velocity
FixedVector2 +
A
B
New Position
Color Nodes
Section titled “Color Nodes”Color creation and manipulation nodes.
Node List
Section titled “Node List”| Node | Description | Inputs | Output |
|---|---|---|---|
Make Color | Create from RGBA | R, G, B, A | Color |
Break Color | Decompose to RGBA | Color | R, G, B, A |
Color From Hex | Create from hex string | Hex | Color |
Color To Hex | Convert to hex string | Color | String |
Color From HSL | Create from HSL | H, S, L | Color |
Color To HSL | Convert to HSL | Color | H, S, L |
Color Lerp | Color interpolation | A, B, T | Color |
Color Lighten | Lighten | Color, Amount | Color |
Color Darken | Darken | Color, Amount | Color |
Color Saturate | Increase saturation | Color, Amount | Color |
Color Desaturate | Decrease saturation | Color, Amount | Color |
Color Invert | Invert | Color | Color |
Color Grayscale | Convert to grayscale | Color | Color |
Color Luminance | Get luminance | Color | Float |
Color Constants
Section titled “Color Constants”| Node | Value |
|---|---|
Color White | (1, 1, 1, 1) |
Color Black | (0, 0, 0, 1) |
Color Red | (1, 0, 0, 1) |
Color Green | (0, 1, 0, 1) |
Color Blue | (0, 0, 1, 1) |
Color Transparent | (0, 0, 0, 0) |
Example: Color Transition Animation
Section titled “Example: Color Transition Animation”Color Red
Color
Color Blue
Color
Color Lerp
A
B
T
0.5
Result
Example: Create Color from Hex
Section titled “Example: Create Color from Hex”Color From Hex
Hex
"#FF5722"
Color
Break Color
Color
R
G
B
A
Related Documentation
Section titled “Related Documentation”- Blueprint Node Reference - Core blueprint nodes
- Blueprint Editor Guide - Editor usage
- Custom Nodes - Create custom nodes