Clase de matriz 3x3 dominante por filas. Más...
#include <Maths.h>
Métodos públicos | |
Matrix3 (float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33) | |
float * | operator[] (int row) |
const float * | operator[] (int row) const |
bool | operator== (const Matrix3 &rhs) const |
bool | operator!= (const Matrix3 &rhs) const |
Matrix3 & | operator+= (const Matrix3 &rhs) |
Matrix3 & | operator-= (const Matrix3 &rhs) |
Matrix3 & | operator*= (const Matrix3 &rhs) |
Matrix3 & | operator*= (float scalar) |
Matrix3 & | operator/= (float scalar) |
Matrix3 | operator+ (const Matrix3 &rhs) const |
Matrix3 | operator- (const Matrix3 &rhs) const |
Matrix3 | operator* (const Matrix3 &rhs) const |
Matrix3 | operator* (float scalar) const |
Matrix3 | operator/ (float scalar) const |
float | determinant () const |
void | fromAxes (const Vector3 &x, const Vector3 &y, const Vector3 &z) |
void | fromAxesTransposed (const Vector3 &x, const Vector3 &y, const Vector3 &z) |
void | fromHeadPitchRoll (float headDegrees, float pitchDegrees, float rollDegrees) |
void | identity () |
Matrix3 | inverse () const |
void | orient (const Vector3 &from, const Vector3 &to) |
void | rotate (const Vector3 &axis, float degrees) |
void | scale (float sx, float sy, float sz) |
void | toAxes (Vector3 &x, Vector3 &y, Vector3 &z) const |
void | toAxesTransposed (Vector3 &x, Vector3 &y, Vector3 &z) const |
void | toHeadPitchRoll (float &headDegrees, float &pitchDegrees, float &rollDegrees) const |
Matrix3 | transpose () const |
Métodos públicos estáticos | |
static Matrix3 | createFromAxes (const Vector3 &x, const Vector3 &y, const Vector3 &z) |
static Matrix3 | createFromAxesTransposed (const Vector3 &x, const Vector3 &y, const Vector3 &z) |
static Matrix3 | createFromHeadPitchRoll (float headDegrees, float pitchDegrees, float rollDegrees) |
static Matrix3 | createMirror (const Vector3 &planeNormal) |
static Matrix3 | createOrient (const Vector3 &from, const Vector3 &to) |
static Matrix3 | createRotate (const Vector3 &axis, float degrees) |
static Matrix3 | createScale (float sx, float sy, float sz) |
Atributos públicos estáticos | |
static const Matrix3 | IDENTITY |
Amigas | |
Vector3 | operator* (const Vector3 &lhs, const Matrix3 &rhs) |
Matrix3 | operator* (float scalar, const Matrix3 &rhs) |
Clase de matriz 3x3 dominante por filas.
Las matrices son concatenadas de izquierda a derecha. Los vectores se multiplican a la izquierda de la matriz.
Construye una matriz de reflexion dado un plano arbitrario que pasa por el origen.
Ronald Goldman, "Matrices and Transformation," Graphics Gems, 1990.
void Matrix3::fromHeadPitchRoll | ( | float | headDegrees, | |
float | pitchDegrees, | |||
float | rollDegrees | |||
) |
Construye una matriz de rotacion basado en una transformacion de Euler. Se usa el standard de la NASA para aviones, heading-pitch-roll (i.e., RzRxRy).
Matrix3 Matrix3::inverse | ( | ) | const |
Si el inverso no existe para esta matriz, entonces se devuelve la matriz identidad.
Crea una matriz de orientacion que rota el vector 'from' al vector 'to'. Para que este metodo funciones correctamente, los vectores 'from' y 'to' deben estar normalizados.
El algoritmo usado es de: Tomas Moller and John F. Hughes, "Efficiently building a matrix to rotate one vector to another," Journal of Graphics Tools, 4(4):1-4, 1999.
void Matrix3::rotate | ( | const Vector3 & | axis, | |
float | degrees | |||
) |
Crea una matriz de rotacion sobre los ejes especificados. axis debe estar normalizado. El angulo debe estar en grados.
u = eje de rotacion = (x, y, z)
| x^2(1 - c) + c xy(1 - c) + zs xz(1 - c) - ys | Ru(angulo) = | yx(1 - c) - zs y^2(1 - c) + c yz(1 - c) + xs | | zx(1 - c) - ys zy(1 - c) - xs z^2(1 - c) + c |
donde, c = cos(angulo) s = sin(angulo)
void Matrix3::scale | ( | float | sx, | |
float | sy, | |||
float | sz | |||
) |
Crea una matriz de escalamiento.
| sx 0 0 | S(sx, sy, sz) = | 0 sy 0 | | 0 0 sz |