2007-06-14
This commit is contained in:
1 parent
e20673c2cd
commit
1ae34ae340
96 files changed
+5680
-1020
No files matched your search
+9
-1
@@ -93,9 +93,17 @@ void Matrix3D::Translate(const Vector3D & v)
|
||||
}
|
||||
|
||||
void Matrix3D::RotZ(float angle) {
|
||||
const float TO_RAD = M_PI / 180.0f;
|
||||
const float c = cosf(angle * M_PI / 180.0f);
|
||||
const float s = sinf(angle * M_PI / 180.0f);
|
||||
/*
|
||||
m[0][0] = cosf(angle*TO_RAD);
|
||||
m[1][0] = sinf(angle*TO_RAD);
|
||||
m[0][1] = -sinf(angle*TO_RAD);
|
||||
m[1][1] = cosf(angle*TO_RAD);
|
||||
*/
|
||||
m[0][0] = c;
|
||||
m[2][2] = c;
|
||||
m[0][2] = s;
|
||||
m[2][0] = -s;
|
||||
|
||||
}
|
||||
+6
-1
@@ -93,11 +93,14 @@ struct Matrix3
|
||||
};
|
||||
static const Matrix3 Identity;
|
||||
|
||||
Vector3D& baseRow(int i) { return *((Vector3D*)m[i]); }
|
||||
//Vector3D& baseRow(int i) { return *((Vector3D*)m[i]); }
|
||||
float operator() (int i, int j) const { return m[i][j]; }
|
||||
float& operator() (int i, int j) { return m[i][j]; }
|
||||
};
|
||||
|
||||
Matrix3D PitchMatrix3D(const float theta);
|
||||
Matrix3D YawMatrix3D(const float theta);
|
||||
Matrix3D RollMatrix3D(const float theta);
|
||||
struct Matrix3D
|
||||
{
|
||||
union {
|
||||
@@ -127,9 +130,11 @@ struct Matrix3D
|
||||
return *this = *this * m;
|
||||
}
|
||||
|
||||
/*
|
||||
friend Matrix3D PitchMatrix3D(const float theta);
|
||||
friend Matrix3D YawMatrix3D(const float theta);
|
||||
friend Matrix3D RollMatrix3D(const float theta);
|
||||
*/
|
||||
void rotate(const Vector3D& v);
|
||||
|
||||
Matrix3D Inverse() const;
|
||||
|
||||
Reference in new issue
Block a user