Skip to content

Vectors

zeganstyl edited this page Sep 18, 2020 · 1 revision

There are several classes of vectors: Vec2, Vec3, Vec4 and VecN with corresponding interfaces.

Vectors are working only with float numbers

Vec4 can be as quaternion and as color.

VecN - vector with a given dimension number.

All vectors implements common interface IVec

Most of vector functions can be chained.

val vec = Vec3()
vec.add(1f, 0f, 0f).scl(5f).nor()
println(vec)
Clone this wiki locally