Newer
Older
Niklas Yann Wettengel
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*******************************************************************************
* mat3.h
*
* (C) 2007 AG Aktives Sehen <agas@uni-koblenz.de>
* Universitaet Koblenz-Landau
*
* Author: Frank Neuhaus, Susanne Maur
*******************************************************************************/
#ifndef MAT3_H
#define MAT3_H
#include <iostream>
#include <sstream>
#include <assert.h>
#include "Vector3D.h"
class CMat3 {
public:
CMat3();
CMat3( float xx, float xy, float xz, float yx, float yy, float yz, float zx, float zy, float zz );
~CMat3();
/** overwritten operator**/
CMat3 operator *(const CMat3 &mat) const;
CMat3 operator *(float f) const;
CMat3& operator *=(float f);
Vector3D operator *(const Vector3D& v) const;
float& operator [](const unsigned value);
CMat3 operator +(const CMat3& mat1);
/** @return value at position **/
float valueAt(unsigned i) const;
/** set value at position **/
void setValue(unsigned line, unsigned column, float value);
/** @return determinant of matrix **/
float determinant() const;
/** transpose matrix **/
void transpose();
/** reverse matrix **/
void reverse();
/** create identity matrix **/
void loadIdentity();
/** create rotation matrix **/
void makeRotationX(float fA);
void makeRotationY(float fA);
void makeRotationZ(float fA);
/** create scale matrix **/
void makeScale(const Vector3D& vScale);
//void BuildRPY(float fRoll, float fPitch, float fYaw);
std::string toString() const;
private:
union
{
float fMatrix[9];
float m[3][3];
struct
{
float xx, xy, xz;
float yx, yy, yz;
float zx, zy, zz;
};
};
};
#include "mat3.inl"
#endif