Subversion Repositories gelsvn

Rev

Rev 12 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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