(just fixed a warning-producing redundant assert)
This commit is contained in:
parent
2c3d20ca40
commit
90cdbb6214
|
@ -35,7 +35,7 @@
|
|||
|
||||
namespace vcg {
|
||||
|
||||
/*
|
||||
/*
|
||||
Annotations:
|
||||
Opengl stores matrix in column-major order. That is, the matrix is stored as:
|
||||
|
||||
|
@ -69,7 +69,7 @@ for 'column' vectors.
|
|||
|
||||
*/
|
||||
|
||||
/** This class represent a 4x4 matrix. T is the kind of element in the matrix.
|
||||
/** This class represent a 4x4 matrix. T is the kind of element in the matrix.
|
||||
*/
|
||||
template <class T> class Matrix44 {
|
||||
protected:
|
||||
|
@ -78,7 +78,7 @@ protected:
|
|||
public:
|
||||
typedef T ScalarType;
|
||||
|
||||
///@{
|
||||
///@{
|
||||
|
||||
/** $name Constructors
|
||||
* No automatic casting and default constructor is empty
|
||||
|
@ -462,7 +462,7 @@ template <class T> Matrix44<T> &Matrix44<T>::SetTranslate(const T tx, const T ty
|
|||
}
|
||||
|
||||
template <class T> Matrix44<T> &Matrix44<T>::SetColumn(const unsigned int ii,const Point3<T> &t) {
|
||||
assert((ii >= 0) && (ii < 4));
|
||||
assert( ii < 4 );
|
||||
ElementAt(0, ii) = t.X();
|
||||
ElementAt(1, ii) = t.Y();
|
||||
ElementAt(2, ii) = t.Z();
|
||||
|
@ -470,7 +470,7 @@ template <class T> Matrix44<T> &Matrix44<T>::SetColumn(const unsigned int ii,con
|
|||
}
|
||||
|
||||
template <class T> Matrix44<T> &Matrix44<T>::SetColumn(const unsigned int ii,const Point4<T> &t) {
|
||||
assert((ii < 4));
|
||||
assert( ii < 4 );
|
||||
ElementAt(0, ii) = t[0];
|
||||
ElementAt(1, ii) = t[1];
|
||||
ElementAt(2, ii) = t[2];
|
||||
|
@ -512,11 +512,11 @@ template <class T> Matrix44<T> &Matrix44<T>::SetRotateRad(T AngleRad, const Poin
|
|||
/*
|
||||
Given a non singular, non projective matrix (e.g. with the last row equal to [0,0,0,1] )
|
||||
This procedure decompose it in a sequence of
|
||||
Scale,Shear,Rotation e Translation
|
||||
- Scale,Shear,Rotation e Translation
|
||||
|
||||
- ScaleV and Tranv are obiviously scaling and translation.
|
||||
- ShearV contains three scalars with, respectively
|
||||
ShearXY, ShearXZ e ShearYZ
|
||||
- ShearV contains three scalars with, respectively,
|
||||
ShearXY, ShearXZ and ShearYZ
|
||||
- RotateV contains the rotations (in degree!) around the x,y,z axis
|
||||
The input matrix is modified leaving inside it a simple roto translation.
|
||||
|
||||
|
@ -558,6 +558,7 @@ double srv() { return (double(rand()%40)-20)/2.0; } // small random value
|
|||
// Now Rebuild is equal to StartM
|
||||
Matrix44d RebuildM = Trn * Rtx*Rty*Rtz * Syz*Sxz*Sxy * Scl ;
|
||||
*/
|
||||
|
||||
template <class T>
|
||||
bool Decompose(Matrix44<T> &M, Point3<T> &ScaleV, Point3<T> &ShearV, Point3<T> &RotV,Point3<T> &TranV)
|
||||
{
|
||||
|
@ -568,7 +569,6 @@ bool Decompose(Matrix44<T> &M, Point3<T> &ScaleV, Point3<T> &ShearV, Point3<T> &
|
|||
// First Step recover the traslation
|
||||
TranV=M.GetColumn3(3);
|
||||
|
||||
|
||||
// Second Step Recover Scale and Shearing interleaved
|
||||
ScaleV[0]=Norm(M.GetColumn3(0));
|
||||
Point3<T> R[3];
|
||||
|
|
Loading…
Reference in New Issue