Geometry
Vec2
A direction and a length, such as an offset or a velocity.
Object type geometry pins
A Vec2 is a vector: an x and a y offset. Unlike a
Point, it isn't a place but a move from one: the
vector nodes add, scale and measure them.
Hierarchy
- Parents
- None
- Subtypes
- None
Properties
| Name | Type | Notes |
|---|---|---|
| x | number | |
| y | number | |
| magnitude | number | read-only |
| normalVec2 | Vec2 | read-only |
Nodes
Break Vec2
Node id break/Vec2
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | Vec2 | type default |
Outputs
| Name | Type | Notes |
|---|---|---|
| x | number | |
| y | number | |
| magnitude | number | |
| normalVec2 | Vec2 |
Make Vec2
Node id make/Vec2
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| x | number | 0 | |
| y | number | 0 |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | Vec2 |
Set Vec2
Node id set/Vec2
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| object | Vec2 | type default | |
| x | number | — | |
| y | number | — |
Outputs
| Name | Type | Notes |
|---|---|---|
| object | Vec2 |
Lerp Vec2
Node id lerp/Vec2
Inputs
Outputs
| Name | Type | Notes |
|---|---|---|
| result | Vec2 |
Notes
- Read-only properties. Break Vec2 also gives its
magnitude(its length) andnormalVec2, a vector of length 1 at a right angle to it. - Not a Point. Vec2 and Point don't connect to each other. Use Vector From Points to get the vector between two points, or Break and Make to convert.
- Default. Make Vec2 gives (0, 0).
Lerp
Lerp Vec2 blends x and y. t is clamped to 0, 1.