dplug.math.vector

N-dimensional small vector math.

Members

Aliases

DimensionType
alias DimensionType(T : Vector!U, U...) = U[0]

Get the numeric type used to measure a vectors's coordinates.

vec2d
alias vec2d = vec2!double
Undocumented in source.
vec2f
alias vec2f = vec2!float
Undocumented in source.
vec2i
alias vec2i = vec2!int
Undocumented in source.
vec3d
alias vec3d = vec3!double
Undocumented in source.
vec3f
alias vec3f = vec3!float
Undocumented in source.
vec3i
alias vec3i = vec3!int
Undocumented in source.
vec4d
alias vec4d = vec4!double
Undocumented in source.
vec4f
alias vec4f = vec4!float
Undocumented in source.
vec4i
alias vec4i = vec4!int
Undocumented in source.

Enums

isVector
eponymoustemplate isVector(T)

True if T is some kind of Vector

Functions

absByElem
Vector!(T, N) absByElem(Vector!(T, N) a)

Element-wise absolute value.

angleBetween
T angleBetween(Vector!(T, N) a, Vector!(T, N) b)

Angle between two vectors

cross
Vector!(T, 3) cross(Vector!(T, 3) a, Vector!(T, 3) b)

Cross product of two 3D vectors

dot
T dot(Vector!(T, N) a, Vector!(T, N) b)

Dot product of two vectors

maxByElem
Vector!(T, N) maxByElem(Vector!(T, N) a, Vector!(T, N) b)

Element-wise maximum.

minByElem
Vector!(T, N) minByElem(Vector!(T, N) a, Vector!(T, N) b)

Element-wise minimum.

reflect
Vector!(T, N) reflect(Vector!(T, N) a, Vector!(T, N) b)

3D reflect, like the GLSL function.

Static functions

ctIntToString
string ctIntToString(int n)
Undocumented in source. Be warned that the author may not have intended to support it.
generateLoopCode
string generateLoopCode()
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Vector
struct Vector(T, int N)

Generic 1D small vector.

Templates

vec2
template vec2(T)
vec3
template vec3(T)
vec4
template vec4(T)

Meta