Vector4 node
Use the Vector4 node to access preset 4D vector variables and common methods.
Read time 2 minutesLast updated 17 hours ago
The Vector4 node is a 4D vector toolbox for positions and directions (X, Y, Z, W) and vector methods.
Variables
Expand the Vector4 node to access the following preset variables:Variable | Type | Description |
|---|---|---|
| one | | A vector with all components set to 1 (1, 1, 1, 1). |
| zero | | A vector with all components set to 0 (0, 0, 0, 0). |
| positiveInfinity | | A vector with all components set to positive infinity (∞, ∞, ∞, ∞). |
| negativeInfinity | | A vector with all components set to negative infinity (-∞, -∞, -∞, -∞). |
Methods
Expand the Vector4 node to access the following methods:Method | Return type | Description |
|---|---|---|
| Normalize | | A vector with a magnitude of 1, which points in the same direction as the original vector. |
| Distance | | The distance between two points in 4D space, calculated as the magnitude of the difference between two vectors. |
| Dot | | The dot product of two vectors, which is a measure of how much one vector goes in the direction of another. You can use this to determine the angle between two vectors or to project one vector onto another. |
| Lerp | | A linear interpolation between two vectors based on a given interpolation factor (t). When t is 0, the result is the first vector. When t is 1, the result is the second vector. When t is between 0 and 1, the result is a blend of the two vectors. |
| Max | | A vector that contains the maximum value of each component from two vectors. |
| Min | | A vector that contains the minimum value of each component from two vectors. |
| Scale | | Use to scale one vector by another, for example, to apply a non-uniform scale to a position or direction. |
| Magnitude | | The length of the vector, calculated as the square root of the sum of the squares of its components. Use to determine how far a point is from the origin or to normalize a vector. |
| SqrMagnitude | | The squared length of the vector, calculated as the sum of the squares of its components. You can use for performance optimization when you only need to compare magnitudes without needing the actual length. |