summaryrefslogtreecommitdiff
path: root/common/matrix.h
diff options
context:
space:
mode:
authorleo2006-02-08 08:48:15 +0000
committerleo2006-02-08 08:48:15 +0000
commitae0ec9c97053a0148afc6abf8da67c2e708ccf56 (patch)
tree45113c1e32bc5251af1968a079fff9893ef0a0db /common/matrix.h
parent9c106de736536b0429cd1314a9e59bf9f3ff6843 (diff)
Fixed a bug in the matrix to axis-angle conversion.
git-svn-id: http://svn.leocad.org/trunk@468 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/matrix.h')
-rw-r--r--common/matrix.h70
1 files changed, 35 insertions, 35 deletions
diff --git a/common/matrix.h b/common/matrix.h
index 910cc78..67483a5 100644
--- a/common/matrix.h
+++ b/common/matrix.h
@@ -8,51 +8,51 @@ class File;
class Matrix
{
- public:
- Matrix ();
- Matrix (const float *mat);
- Matrix (const double *matrix);
- Matrix (const float *rot, const float *pos);
- ~Matrix();
-
- void FileSave (File& file) const;
- void FileLoad (File& file);
-
- void FromPacked (const float *mat);
- void FromFloat (const float* mat);
- void FromLDraw (const float *f);
- void FromEulerAngles (float yaw, float pitch, float roll);
- void FromAxisAngle (const float *axis, float angle);
-
- void ToLDraw (float *f) const;
- void ToEulerAngles (float *rot) const;
- void ToAxisAngle (float *rot) const;
-
- void LoadIdentity();
- void Translate(float x, float y, float z);
- void Multiply(const Matrix& m1, const Matrix& m2);
- bool Invert();
+public:
+ Matrix();
+ Matrix(const float *mat);
+ Matrix(const double *matrix);
+ Matrix(const float *rot, const float *pos);
+ ~Matrix();
+
+ void FileSave(File& file) const;
+ void FileLoad(File& file);
+
+ void FromPacked(const float *mat);
+ void FromFloat(const float* mat);
+ void FromLDraw(const float *f);
+ void FromEulerAngles(float yaw, float pitch, float roll);
+ void FromAxisAngle(const float *axis, float angle);
+
+ void ToLDraw(float *f) const;
+ void ToEulerAngles(float *rot) const;
+ void ToAxisAngle(float *rot) const;
+
+ void LoadIdentity();
+ void Translate(float x, float y, float z);
+ void Multiply(const Matrix& m1, const Matrix& m2);
+ bool Invert();
void Transpose3();
+ float Determinant() const;
-
- void GetTranslation(float *x, float *y, float *z);
- void SetTranslation(float x, float y, float z);
- void GetTranslation(float pos[3]);
- void SetTranslation(float pos[3]);
+ void GetTranslation(float *x, float *y, float *z);
+ void SetTranslation(float x, float y, float z);
+ void GetTranslation(float pos[3]);
+ void SetTranslation(float pos[3]);
void TransformPoint(float out[], const float in[3]);
- void TransformPoints (float p[], int n);
- void Create (float mx, float my, float mz, float rx, float ry, float rz);
+ void TransformPoints(float p[], int n);
+ void Create(float mx, float my, float mz, float rx, float ry, float rz);
void CreateOld(float mx, float my, float mz, float rx, float ry, float rz);
void Rotate(float angle, float x, float y, float z);
void RotateCenter(float angle, float x, float y, float z, float px, float py, float pz);
bool FromInverse(double* src);
- void CreatePerspective (float fovy, float aspect, float nearval, float farval);
- void CreateLookat (const float *eye, const float *target, const float *up);
+ void CreatePerspective(float fovy, float aspect, float nearval, float farval);
+ void CreateLookat(const float *eye, const float *target, const float *up);
- public:
- float m[16];
+public:
+ float m[16];
};
#endif //_MATRIX_H_