Quaternion

Base template for all quaternion-types.

Constructors

this
this(T x, T y, T z, T w)

Construct from four values of type $( I valueType ), last one the w coordinate

this
this(Vector!(valueType, 3) vec, valueType w)

Construct from a 3d vector / array imaginary part and a real value w of type $( I valueType )

this
this(valueType[4] array)

Construct from 4d vector / array, w or index 3 respectively being the quternions w ccord

this
this(Matrix!(valueType, 3, 3) mat)

Construct / convert from 3x3 matrix

Alias This

vector

Members

Aliases

valueType
alias valueType = type
Undocumented in source.

Functions

opBinary
Quaternion opBinary(Quaternion q)

//////////// ////////////

opBinary
Quaternion opBinary(Quaternion q)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
Vector!(valueType, 3) opBinary(Vector!(valueType, 3) v)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
Quaternion opBinary(valueType s)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinaryRight
auto opBinaryRight(T q)
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(Quaternion q)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Quaternion q)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Quaternion q)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(valueType q)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
void opOpAssign(Quaternion q)
Undocumented in source. Be warned that the author may not have intended to support it.
ptr
auto ptr()

Returns a pointer to the vector in memory

rotate
Quaternion rotate(real angle, Vector!(valueType, 3) axis)

Rotates the current vector around an axis and returns $( I this ).

rotate
Quaternion rotate(real heading, real attitude, real bank)

Applies an euler rotation to the current vector and returns $( I this ).

rotateX
Quaternion rotateX(real angle)

Rotates the current vector around the x-axis and returns $( I this ).

rotateY
Quaternion rotateY(real angle)

Rotates the current vector around the y-axis and returns $( I this ).

rotateZ
Quaternion rotateZ(real angle)

Rotates the current vector around the z-axis and returns $( I this ).

toString
char[] toString(char[] buffer)

Returns the current quternion formatted as string, useful for printing

Properties

identity
Quaternion identity [@property getter]

Returns an identity vector ( x=0, y=0, z=0, w=1 ).

Static functions

rotation
Quaternion rotation(real angle, Vector!(valueType, 3) axis)

Returns a vector with applied rotation around an axis.

rotation
Quaternion rotation(real roll, real pitch, real yaw)

Creates a vector from an euler rotation.

rotationX
Quaternion rotationX(real angle)

/////////// /////////// Returns a vector with applied rotation around the x-axis.

rotationY
Quaternion rotationY(real angle)

Returns a vector with applied rotation around the y-axis.

rotationZ
Quaternion rotationZ(real angle)

Returns a vector with applied rotation around the z-axis.

Variables

vector
Vector!(type, 4) vector;
Undocumented in source.

Parameters

type

all values get stored as this type

Meta