Module gfx.math.vec

Vector linear algebra module

Functions

NameDescription
cross(lhs, rhs) Vector cross product
dot(v1, v2) Compute the dot product of two vectors.
magnitude(v) Compute the magnitude of a vector. This is not to be confused with length which gives the number of components.
normalize(v) Compute the normalization of a vector.
squaredMag(v) Compute the squared magnitude of a vector.
vec(comps) Build a Vec whose component type and size is deducted from arguments.

Structs

NameDescription
Vec

Templates

NameDescription
vec Build a Vec with specified component type T and size deducted from arguments.
vec Build a Vec with specified size and type deducted from arguments

Manifest constants

NameTypeDescription
isVec Check whether VecT is a Vec
isVec Check whether VecT is a Vec of size N
isVec2 Check whether VecT is a Vec of size N
isVec3 Check whether VecT is a Vec of size N
isVec4 Check whether VecT is a Vec of size N

Aliases

NameTypeDescription
DVec Vec!(double,N)
dvec vec!double Build a Vec with specified component type T and size deducted from arguments.
DVec2 Vec!(double,2L)
DVec3 Vec!(double,3L)
DVec4 Vec!(double,4L)
FVec Vec!(float,N)
fvec vec!float Build a Vec with specified component type T and size deducted from arguments.
FVec2 Vec!(float,2L)
FVec3 Vec!(float,3L)
FVec4 Vec!(float,4L)
IVec Vec!(int,N)
ivec vec!int Build a Vec with specified component type T and size deducted from arguments.
IVec2 Vec!(int,2L)
IVec3 Vec!(int,3L)
IVec4 Vec!(int,4L)
Vec2 Vec!(T,2)
vec2 vec!2 Build a Vec with specified size and type deducted from arguments
Vec3 Vec!(T,3)
vec3 vec!3 Build a Vec with specified size and type deducted from arguments
Vec4 Vec!(T,4)
vec4 vec!4 Build a Vec with specified size and type deducted from arguments