Subversion Repositories gelsvn

Rev

Rev 89 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 89 Rev 119
1
#ifndef __CGLA_MAT3X3D_H__
1
#ifndef __CGLA_MAT3X3D_H__
2
#define __CGLA_MAT3X3D_H__
2
#define __CGLA_MAT3X3D_H__
3
 
3
 
4
#include "CGLA.h"
4
#include "CGLA.h"
5
#include "Vec3d.h"
5
#include "Vec3d.h"
6
#include "ArithSqMat3x3Float.h"
6
#include "ArithSqMat3x3Float.h"
7
 
7
 
8
namespace CGLA {
8
namespace CGLA {
9
 
9
 
10
	/** \brief 3 by 3 double matrix.
10
	/** \brief 3 by 3 double matrix.
11
 
11
 
12
			This class will typically be used for rotation or
12
			This class will typically be used for rotation or
13
			scaling matrices for 3D vectors. */
13
			scaling matrices for 3D vectors. */
14
	class Mat3x3d: public ArithSqMat3x3Float<Vec3d, Mat3x3d>
14
	class Mat3x3d: public ArithSqMat3x3Float<Vec3d, Mat3x3d>
15
	{
15
	{
16
	public:
16
	public:
17
 
17
 
18
		/// Construct matrix from 3 Vec3d vectors.
18
		/// Construct matrix from 3 Vec3d vectors.
19
		Mat3x3d(Vec3d _a, Vec3d _b, Vec3d _c): 
19
		Mat3x3d(Vec3d _a, Vec3d _b, Vec3d _c): 
20
			ArithSqMat3x3Float<Vec3d, Mat3x3d> (_a,_b,_c) {}
20
			ArithSqMat3x3Float<Vec3d, Mat3x3d> (_a,_b,_c) {}
21
  
21
  
22
		/// Construct the 0 matrix
22
		/// Construct the 0 matrix
23
		Mat3x3d() {}
23
		Mat3x3d() {}
24
 
24
 
25
		/// Construct a matrix from a single scalar value.
25
		/// Construct a matrix from a single scalar value.
26
		explicit Mat3x3d(float a): ArithSqMat3x3Float<Vec3d, Mat3x3d>(a) {}
26
		explicit Mat3x3d(float a): ArithSqMat3x3Float<Vec3d, Mat3x3d>(a) {}
27
 
27
 
28
	};
28
	};
29
	/// Create an identity matrix.
29
	/// Create an identity matrix.
30
	inline Mat3x3d identity_Mat3x3d()
30
	inline Mat3x3d identity_Mat3x3d()
31
	{
31
	{
32
		return Mat3x3d(Vec3d(1,0,0), Vec3d(0,1,0), Vec3d(0,0,1));
32
		return Mat3x3d(Vec3d(1,0,0), Vec3d(0,1,0), Vec3d(0,0,1));
33
	}
33
	}
34
 
34
 
35
}
35
}
36
#endif
36
#endif
37
 
37
 
38
 
38
 
39
 
39
 
40
 
40
 
41
 
41
 
42
 
42
 
43
 
43
 
44
 
44