78 memcpy(
m,arr,9*
sizeof(
Real));
82 memcpy(
m,rkMatrix.
m,9*
sizeof(
Real));
115 inline const Real* operator[] (
size_t iRow)
const
120 inline Real* operator[] (
size_t iRow)
138 memcpy(
m,rkMatrix.
m,9*
sizeof(
Real));
144 bool operator== (
const Matrix3& rkMatrix)
const;
148 inline bool operator!= (
const Matrix3& rkMatrix)
const
233 Vector3 akEigenvector[3])
const;
242 Real t =
m[0][0] *
m[0][0] +
m[1][0] *
m[1][0] +
m[2][0] *
m[2][0];
245 t =
m[0][1] *
m[0][1] +
m[1][1] *
m[1][1] +
m[2][1] *
m[2][1];
248 t =
m[0][2] *
m[0][2] +
m[1][2] *
m[1][2] +
m[2][2] *
m[2][2];
258 ( std::ostream& o,
const Matrix3& mat )
260 o <<
"Matrix3(" << mat[0][0] <<
", " << mat[0][1] <<
", " << mat[0][2] <<
", "
261 << mat[1][0] <<
", " << mat[1][1] <<
", " << mat[1][2] <<
", "
262 << mat[2][0] <<
", " << mat[2][1] <<
", " << mat[2][2] <<
")";
Wrapper class which indicates a given angle value is in Degrees.
static bool RealEqual(Real a, Real b, Real tolerance=std::numeric_limits< Real >::epsilon())
Compare 2 reals, using tolerance for inaccuracies.
Matrix3(const Matrix3 &rkMatrix)
bool operator==(const Matrix3 &rkMatrix) const
Tests 2 matrices for equality.
Vector3 GetColumn(size_t iCol) const
Matrix3()
Default constructor.
bool ToEulerAnglesXZY(Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
void SingularValueComposition(const Matrix3 &rkL, const Vector3 &rkS, const Matrix3 &rkR)
void FromEulerAnglesXZY(const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
static void Bidiagonalize(Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
static Real MaxCubicRoot(Real afCoeff[3])
void FromEulerAnglesYXZ(const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
Matrix3(Real fEntry00, Real fEntry01, Real fEntry02, Real fEntry10, Real fEntry11, Real fEntry12, Real fEntry20, Real fEntry21, Real fEntry22)
void ToAngleAxis(Vector3 &rkAxis, Radian &rfAngle) const
Note: Matrix must be orthonormal.
void ToAngleAxis(Vector3 &rkAxis, Degree &rfAngle) const
void FromEulerAnglesXYZ(const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
static const Matrix3 ZERO
bool ToEulerAnglesYZX(Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
static const Real EPSILON
static const unsigned int msSvdMaxIterations
void QDUDecomposition(Matrix3 &rkQ, Vector3 &rkD, Vector3 &rkU) const
Orthogonal Q, diagonal D, upper triangular U stored as (u01,u02,u12)
Matrix3(const Real arr[3][3])
void swap(Matrix3 &other)
Exchange the contents of this matrix with another.
void EigenSolveSymmetric(Real afEigenvalue[3], Vector3 akEigenvector[3]) const
Eigensolver, matrix must be symmetric.
bool ToEulerAnglesYXZ(Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
bool Inverse(Matrix3 &rkInverse, Real fTolerance=1e-06) const
void FromEulerAnglesZYX(const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
static void GolubKahanStep(Matrix3 &kA, Matrix3 &kL, Matrix3 &kR)
void FromEulerAnglesYZX(const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
bool QLAlgorithm(Real afDiag[3], Real afSubDiag[3])
void SingularValueDecomposition(Matrix3 &rkL, Vector3 &rkS, Matrix3 &rkR) const
Singular value decomposition.
static const Real msSvdEpsilon
bool ToEulerAnglesZYX(Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
void SetColumn(size_t iCol, const Vector3 &vec)
bool ToEulerAnglesZXY(Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
void FromAngleAxis(const Vector3 &rkAxis, const Radian &fRadians)
void Tridiagonal(Real afDiag[3], Real afSubDiag[3])
bool ToEulerAnglesXYZ(Radian &rfYAngle, Radian &rfPAngle, Radian &rfRAngle) const
The matrix must be orthonormal.
void FromEulerAnglesZXY(const Radian &fYAngle, const Radian &fPAngle, const Radian &fRAngle)
Matrix3 Inverse(Real fTolerance=1e-06) const
void FromAxes(const Vector3 &xAxis, const Vector3 &yAxis, const Vector3 &zAxis)
Real SpectralNorm() const
static const Matrix3 IDENTITY
void Orthonormalize()
Gram-Schmidt orthonormalization (applied to columns of rotation matrix)
bool hasScale() const
Determines if this matrix involves a scaling.
Matrix3 Transpose() const
static void TensorProduct(const Vector3 &rkU, const Vector3 &rkV, Matrix3 &rkProduct)
Wrapper class which indicates a given angle value is in Radians.
Standard 3-dimensional vector.
float Real
Software floating point type.
void swap(Ogre::SmallVectorImpl< T > &LHS, Ogre::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.