Vec

Numeric Vector type with an optional amount of components.

Constructors

this
this(U[] elements)
Undocumented in source.
this
this(U args)
Undocumented in source.

Members

Functions

magnitude
real magnitude()

Vector magnitude.

normalize
void normalize()

Normalizes the vectors. Changes the current struct!

normalized
Vec!(T, n) normalized()

Returns the normalized vector. Doesn't change the current struct!

opBinary
Vec!(T, n) opBinary(float scalar)

Returns the mul of this * scalar.

opBinary
Vec!(T, n) opBinary(float scalar)

Returns the sum of this + scalar.

opBinary
Vec!(T, n) opBinary(float scalar)

Returns the sub of this - scalar.

opBinary
Vec!(T, n) opBinary(float scalar)

Returns the div of this / scalar.

opBinary
Vec!(T, n) opBinary(Vec!(T, n) other)

Returns the sum of 2 vectors.

opBinary
Vec!(T, n) opBinary(Vec!(T, n) other)

Returns the sub of 2 vectors.

opBinary
Vec!(T, n) opBinary(Vec!(T, n) other)

Returns the mul of 2 vectors.

opBinary
Vec!(T, n) opBinary(Vec!(T, n) other)

Returns the div of 2 vectors.

opCast
U opCast()

Cast to a vector of a different type.

opDispatch
Vec!(T, swizzle.length) opDispatch()

Swizzling.

opIndex
T opIndex(int n)

Get the N-th component.

opIndex
T[n] opIndex()

Get the whole internal array.

opIndexAssign
T opIndexAssign(T value, int n)

Set the nth component

opOpAssign
void opOpAssign(float scalar)

Returns the mul of this * scalar.

opOpAssign
void opOpAssign(float scalar)

Returns the sum of this + scalar.

opOpAssign
void opOpAssign(float scalar)

Returns the sub of this - scalar.

opOpAssign
void opOpAssign(float scalar)

Returns the div of this / scalar.

opOpAssign
void opOpAssign(Vec!(T, n) other)

Returns the sum of 2 vectors.

opOpAssign
void opOpAssign(Vec!(T, n) other)

Returns the sub of 2 vectors.

opOpAssign
void opOpAssign(Vec!(T, n) other)

Returns the mul of 2 vectors.

opOpAssign
void opOpAssign(Vec!(T, n) other)

Returns the div of 2 vectors.

opUnary
Vec!(T, n) opUnary()

Returns the negated vector.

ptr
auto ptr()

Internal data as a pointer, use for sending data to shaders.

Unions

__anonymous
union __anonymous
Undocumented in source.

Meta