Vec3
Interface representing a 3D vector. A 3D vector is represented by (x, y, z) coordinates, and can
represent a point in space, a directional vector, or other types of data with three ordered
dimensions. 3D vectors can be multiplied by 4x4 matrices (Mat4) using homogeneous coordinate math,
enabling efficient 3D geometry computation. Vec3 objects are created with the ecs.math.vec3
Vec3Factory, or through operations on other Vec3 objects.
Code Example
const {vec3} = ecs.math
const a = vec3.xyz(1, 2, 3)
const b = vec3.up() // b is 0, 1, 0
const c = a.plus(b).times(vec3.xyz(3, 1, 1)).normalize() // c is (1, 1, 1)