Subversion Repositories gelsvn

Rev

Rev 358 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 bj 1
#ifndef __CGLA_MAT3X3D_H__
2
#define __CGLA_MAT3X3D_H__
3
 
4
#include "CGLA.h"
5
#include "Vec3d.h"
6
#include "ArithSqMat3x3Float.h"
7
 
8
namespace CGLA {
9
 
89 jab 10
	/** \brief 3 by 3 double matrix.
11
 
2 bj 12
			This class will typically be used for rotation or
13
			scaling matrices for 3D vectors. */
14
	class Mat3x3d: public ArithSqMat3x3Float<Vec3d, Mat3x3d>
15
	{
16
	public:
17
 
18
		/// Construct matrix from 3 Vec3d vectors.
19
		Mat3x3d(Vec3d _a, Vec3d _b, Vec3d _c): 
20
			ArithSqMat3x3Float<Vec3d, Mat3x3d> (_a,_b,_c) {}
21
 
22
		/// Construct the 0 matrix
23
		Mat3x3d() {}
24
 
25
		/// Construct a matrix from a single scalar value.
26
		explicit Mat3x3d(float a): ArithSqMat3x3Float<Vec3d, Mat3x3d>(a) {}
27
 
28
	};
358 jab 29
 
30
  /// Create a rotation _matrix. Rotates about one of the major axes.
31
  Mat3x3d rotation_Mat3x3d(CGLA::Axis axis, double angle);
32
 
33
  /// Create a scaling matrix.
34
  Mat3x3d scaling_Mat3x3d(const Vec3d&);
35
 
36
 
2 bj 37
	/// Create an identity matrix.
38
	inline Mat3x3d identity_Mat3x3d()
39
	{
501 jrf 40
		return Mat3x3d(Vec3d(1.0,0.0,0.0), Vec3d(0.0,1.0,0.0), Vec3d(0.0,0.0,1.0));
2 bj 41
	}
42
 
43
}
44
#endif
45
 
46
 
47
 
48
 
49
 
50
 
51