|
Libprimis
Imprimis' 3D destroyable world engine
|
floating point 4x3 matrix object defined as four column vectors, a-d takes the form as follows: [ a1 b1 c1 d1 (x) a2 b2 c2 d2 (y) a3 b3 c3 d3 ] (z) More...
#include <geom.h>
Public Member Functions | |
| matrix4x3 () | |
| Creates an empty matrix4x3 object. | |
| matrix4x3 (const vec &a, const vec &b, const vec &c, const vec &d) | |
| Creates a matrix4x3 from four three-dimensional vec objects. | |
| matrix4x3 (const matrix3 &rot, const vec &trans) | |
| Creates a matrix4x3 from a rotation matrix and a translation vector. | |
| matrix4x3 (const dualquat &dq) | |
| Creates a matrix4x3 that represents a dual quaternion transformation. | |
| matrix4x3 (const matrix4 &m) | |
Creates a matrix4x3 by truncating w from a matrix4. | |
| void | mul (float k) |
| Multiplies all values inside the matrix by a scalar constant. | |
| void | setscale (float x, float y, float z) |
| Sets the diagonals a.x, b.y, c.z to the given values. | |
| void | setscale (const vec &v) |
| Sets the diagonals a.x, b.y, c.z to the given vector's x, y, z values. | |
| void | setscale (float n) |
| Sets the diagonals a.x, b.y, c.z identically to a given value. | |
| void | scale (float x, float y, float z) |
| Scales the first three vectors by x, y, and z respectively. | |
| void | scale (const vec &v) |
| Multiplies the first three vectors by v.x, v.y, and v.z respectively. | |
| void | scale (float n) |
| Scales the first three vector elements in the matrix by the specified amount. | |
| void | settranslation (const vec &p) |
Copies the p vector into the fourth column vector (d). | |
| void | settranslation (float x, float y, float z) |
Copies x, y, z into the fourth column vector (d). | |
| void | translate (const vec &p) |
| void | translate (float x, float y, float z) |
| void | translate (const vec &p, float scale) |
| void | accumulate (const matrix4x3 &m, float k) |
| void | normalize () |
| Normalizes the first three column vectors. | |
| void | lerp (const matrix4x3 &to, float t) |
| Linearly interpolates between the two matrices according to scale t. | |
| void | lerp (const matrix4x3 &from, const matrix4x3 &to, float t) |
| Linearly interpolates between two other matrices according to scale t. | |
| void | identity () |
| Sets this matrix to the identity matrix. | |
| void | mul (const matrix4x3 &m, const matrix4x3 &n) |
| void | mul (const matrix4x3 &n) |
| void | mul (const matrix3 &m, const matrix4x3 &n) |
| void | mul (const matrix3 &rot, const vec &trans, const matrix4x3 &n) |
| void | transpose () |
| void | transpose (const matrix4x3 &o) |
| void | transposemul (const matrix4x3 &m, const matrix4x3 &n) |
| void | multranspose (const matrix4x3 &m, const matrix4x3 &n) |
| void | invert (const matrix4x3 &o) |
| void | invert () |
| void | rotate (float angle, const vec &d) |
| void | rotate (float ck, float sk, const vec &axis) |
| void | rotate_around_x (float ck, float sk) |
| void | rotate_around_x (float angle) |
| void | rotate_around_x (const vec2 &sc) |
| void | rotate_around_y (float ck, float sk) |
| void | rotate_around_y (float angle) |
| void | rotate_around_y (const vec2 &sc) |
| void | rotate_around_z (float ck, float sk) |
| void | rotate_around_z (float angle) |
| void | rotate_around_z (const vec2 &sc) |
| vec | transposedtransform (const vec &o) const |
| vec | transformnormal (const vec &o) const |
| vec | transposedtransformnormal (const vec &o) const |
| vec | transform (const vec &o) const |
| vec | transform (const vec2 &o) const |
| vec4< float > | rowx () const |
| Returns the x values of the four vectors as a four-vector. | |
| vec4< float > | rowy () const |
| Returns the y values of the four vectors as a four-vector. | |
| vec4< float > | rowz () const |
| Returns the z values of the four vectors as a four-vector. | |
Public Attributes | |
| vec | a |
| vec | b |
| vec | c |
| vec | d |
floating point 4x3 matrix object defined as four column vectors, a-d takes the form as follows: [ a1 b1 c1 d1 (x) a2 b2 c2 d2 (y) a3 b3 c3 d3 ] (z)
used in animation along with dualquats
| matrix4x3::matrix4x3 | ( | ) |
Creates a matrix4x3 from a rotation matrix and a translation vector.
The rotation matrix is assigned to members a b c and the translation d. No transformations are made to the values of the passed parameters.
| rot | the rotation matrix to assign to a b c |
| trans | the translation to assign to d |
| matrix4x3::matrix4x3 | ( | const dualquat & | dq | ) |
|
inlineexplicit |
| void matrix4x3::identity | ( | ) |
Sets this matrix to the identity matrix.
Linearly interpolates between two other matrices according to scale t.
If 0 < t < 1 then the matrix will be t% of the way between this and to. Values outside 0..1 imply a linear extrapolation.
| from | the first matrix to interpolate from |
| to | the other matrix to interpolate between |
| t | the interpolation factor |
| void matrix4x3::lerp | ( | const matrix4x3 & | to, |
| float | t ) |
Linearly interpolates between the two matrices according to scale t.
If 0 < t < 1 then the matrix will be t% of the way between this and to. Values outside 0..1 imply a linear extrapolation.
| to | the other matrix to interpolate between |
| t | the interpolation factor |
| void matrix4x3::mul | ( | float | k | ) |
Multiplies all values inside the matrix by a scalar constant.
| k | the scale factor to multiply by |
| void matrix4x3::normalize | ( | ) |
Normalizes the first three column vectors.
Sets the three first vectors to have a magnitude of 1. That is, sqrt(x^2 + y^2 + z^2) = 1.
Does not check for a divide-by-zero condition.
| vec4< float > matrix4x3::rowx | ( | ) | const |
Returns the x values of the four vectors as a four-vector.
| vec4< float > matrix4x3::rowy | ( | ) | const |
Returns the y values of the four vectors as a four-vector.
| vec4< float > matrix4x3::rowz | ( | ) | const |
Returns the z values of the four vectors as a four-vector.
| void matrix4x3::scale | ( | const vec & | v | ) |
Multiplies the first three vectors by v.x, v.y, and v.z respectively.
Does not modify the fourth matrix element vectord.
| v | the vector to multiply by |
| void matrix4x3::scale | ( | float | n | ) |
Scales the first three vector elements in the matrix by the specified amount.
Does not modify the fourth matrix element vectord.
| n | the scale factor to multiply by |
| void matrix4x3::scale | ( | float | x, |
| float | y, | ||
| float | z ) |
Scales the first three vectors by x, y, and z respectively.
Does not modify the fourth matrix element vectord.
| x | the scale to multiply the first vector by |
| y | the scale to multiply the second vector by |
| z | the scale to multiply the third vector by |
| void matrix4x3::setscale | ( | const vec & | v | ) |
Sets the diagonals a.x, b.y, c.z to the given vector's x, y, z values.
Does not modify any of the values except for a.x, b.y, c.z.
| v | the vector to assign from |
| void matrix4x3::setscale | ( | float | n | ) |
Sets the diagonals a.x, b.y, c.z identically to a given value.
@parm n the value to set to
| void matrix4x3::setscale | ( | float | x, |
| float | y, | ||
| float | z ) |
Sets the diagonals a.x, b.y, c.z to the given values.
Does not modify any of the values except for a.x, b.y, c.z.
| x | the first value to set in the diagonal |
| y | the second value to set in the diagonal |
| z | the third value to set in the diagonal |
| void matrix4x3::settranslation | ( | const vec & | p | ) |
Copies the p vector into the fourth column vector (d).
| p | the vector to copy to the d vector. |
| void matrix4x3::settranslation | ( | float | x, |
| float | y, | ||
| float | z ) |
Copies x, y, z into the fourth column vector (d).
| x | the first value to copy into d.x |
| y | the second value to copy into d.y |
| z | the third value to copy into d.z |