vec3

3 dimensional vector

Constructors

this
this(float v)

create with all components filled with specified value

this
this(float[3] v)
Undocumented in source.
this
this(float[] v)
Undocumented in source.
this
this(float* v)
Undocumented in source.
this
this(vec3 v)
Undocumented in source.
this
this(float x, float y, float z)
Undocumented in source.

Members

Aliases

b
alias b = z
Undocumented in source.
g
alias g = y
Undocumented in source.
length
alias length = magnitude
Undocumented in source.
r
alias r = x
Undocumented in source.

Functions

add
vec3 add(float v)

add value to all components of vector

add
vec3 add(vec3 v)

add components of another vector to corresponding components of this vector

clear
vec3 clear(float v)

fill all components of vector with specified value

div
vec3 div(float v)

divide all components of vector by value

div
vec3 div(vec3 v)

divide components of this vector by corresponding components of another vector

dot
float dot(vec3 v)

dot product (sum of by-component products of vector components)

mul
vec3 mul(float v)

multiply all components of vector by value

mul
vec3 mul(vec3 v)

multiply components of this vector by corresponding components of another vector

normalize
void normalize()

normalize vector: make its length == 1

opAssign
vec3 opAssign(float[3] v)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
vec3 opAssign(vec3 v)
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
vec3 opAssign(float x, float y, float z)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
vec3 opBinary(float v)

add value to all components of vector

opBinary
vec3 opBinary(float v)

multiply all components of vector by value

opBinary
vec3 opBinary(float v)

subtract value from all components of vector

opBinary
vec3 opBinary(float v)

divide all components of vector by value

opBinary
vec3 opBinary(vec3 v)

add value to all components of vector

opBinary
vec3 opBinary(vec3 v)

subtract value from all components of vector

opBinary
float opBinary(vec3 v)

subtract value from all components of vector

opBinary
vec3 opBinary(mat4 matrix)

multiply vector by matrix

opOpAssign
vec3 opOpAssign(float v)

add value to all components of vector

opOpAssign
vec3 opOpAssign(float v)

multiply all components of vector by value

opOpAssign
vec3 opOpAssign(float v)

subtract value from all components of vector

opOpAssign
vec3 opOpAssign(float v)

divide all components of vector by value

opOpAssign
vec3 opOpAssign(vec3 v)

by component add values of corresponding components of other vector

opOpAssign
vec3 opOpAssign(vec3 v)

by component multiply values of corresponding components of other vector

opOpAssign
vec3 opOpAssign(vec3 v)

by component subtract values of corresponding components of other vector

opOpAssign
vec3 opOpAssign(vec3 v)

by component divide values of corresponding components of other vector

opUnary
vec3 opUnary()

returns vector with all components which are negative of components for this vector

sub
vec3 sub(float v)

subtract value from all components of vector

sub
vec3 sub(vec3 v)

subtract components of another vector from corresponding components of this vector

Properties

magnitude
float magnitude [@property getter]

length of vector

magnitudeSquared
float magnitudeSquared [@property getter]

sum of squares of all vector components

normalized
vec3 normalized [@property getter]

returns normalized copy of this vector

toString
string toString [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

crossProduct
vec3 crossProduct(vec3 v1, vec3 v2)

cross product

Unions

__anonymous
union __anonymous
Undocumented in source.

Meta