vector(x, y, z) -> vector
+, -, *, /, unary -, ==.
Methods
| Method | Returns | Description |
|---|---|---|
length() | number | 3D length |
length_sqr() | number | Squared 3D length |
length2d() | number | 2D length (XY) |
dist(other) | number | Distance to another vector |
dist2d(other) | number | 2D distance |
dot(other) | number | Dot product |
cross(other) | vector | Cross product |
normalized() | vector | Unit vector |
clone() | vector | Copy |
unpack() | x, y, z | Components |
is_zero() | bool | All components zero |
lerp(other, t) | vector | Linear interpolation |
forward() | vector | Forward direction from angles |
angle_vectors() | forward, right, up | All three basis vectors from angles |
angles() | vector | Angles from direction vector |