Subversion Repositories gelsvn

Rev

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

Rev 501 Rev 595
-
 
1
/* ----------------------------------------------------------------------- *
-
 
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
3
 * Copyright (C) the authors and DTU Informatics
-
 
4
 * For license and list of authors, see ../../doc/intro.pdf
-
 
5
 * ----------------------------------------------------------------------- */
-
 
6
 
-
 
7
/** @file Mat3x3d.h
-
 
8
 * @brief 3x3 double matrix class
-
 
9
 */
-
 
10
 
1
#ifndef __CGLA_MAT3X3D_H__
11
#ifndef __CGLA_MAT3X3D_H__
2
#define __CGLA_MAT3X3D_H__
12
#define __CGLA_MAT3X3D_H__
3
 
13
 
4
#include "CGLA.h"
14
#include "CGLA.h"
5
#include "Vec3d.h"
15
#include "Vec3d.h"
6
#include "ArithSqMat3x3Float.h"
16
#include "ArithSqMat3x3Float.h"
7
 
17
 
8
namespace CGLA {
18
namespace CGLA {
9
 
19
 
10
	/** \brief 3 by 3 double matrix.
20
	/** \brief 3 by 3 double matrix.
11
 
21
 
12
			This class will typically be used for rotation or
22
			This class will typically be used for rotation or
13
			scaling matrices for 3D vectors. */
23
			scaling matrices for 3D vectors. */
14
	class Mat3x3d: public ArithSqMat3x3Float<Vec3d, Mat3x3d>
24
	class Mat3x3d: public ArithSqMat3x3Float<Vec3d, Mat3x3d>
15
	{
25
	{
16
	public:
26
	public:
17
 
27
 
18
		/// Construct matrix from 3 Vec3d vectors.
28
		/// Construct matrix from 3 Vec3d vectors.
19
		Mat3x3d(Vec3d _a, Vec3d _b, Vec3d _c): 
29
		Mat3x3d(Vec3d _a, Vec3d _b, Vec3d _c): 
20
			ArithSqMat3x3Float<Vec3d, Mat3x3d> (_a,_b,_c) {}
30
			ArithSqMat3x3Float<Vec3d, Mat3x3d> (_a,_b,_c) {}
21
  
31
  
22
		/// Construct the 0 matrix
32
		/// Construct the 0 matrix
23
		Mat3x3d() {}
33
		Mat3x3d() {}
24
 
34
 
25
		/// Construct a matrix from a single scalar value.
35
		/// Construct a matrix from a single scalar value.
26
		explicit Mat3x3d(float a): ArithSqMat3x3Float<Vec3d, Mat3x3d>(a) {}
36
		explicit Mat3x3d(float a): ArithSqMat3x3Float<Vec3d, Mat3x3d>(a) {}
27
 
37
 
28
	};
38
	};
29
 
39
 
30
  /// Create a rotation _matrix. Rotates about one of the major axes.
40
  /// Create a rotation _matrix. Rotates about one of the major axes.
31
  Mat3x3d rotation_Mat3x3d(CGLA::Axis axis, double angle);
41
  Mat3x3d rotation_Mat3x3d(CGLA::Axis axis, double angle);
32
 
42
 
33
  /// Create a scaling matrix.
43
  /// Create a scaling matrix.
34
  Mat3x3d scaling_Mat3x3d(const Vec3d&);
44
  Mat3x3d scaling_Mat3x3d(const Vec3d&);
35
 
45
 
36
 
46
 
37
	/// Create an identity matrix.
47
	/// Create an identity matrix.
38
	inline Mat3x3d identity_Mat3x3d()
48
	inline Mat3x3d identity_Mat3x3d()
39
	{
49
	{
40
		return Mat3x3d(Vec3d(1.0,0.0,0.0), Vec3d(0.0,1.0,0.0), Vec3d(0.0,0.0,1.0));
50
		return Mat3x3d(Vec3d(1.0,0.0,0.0), Vec3d(0.0,1.0,0.0), Vec3d(0.0,0.0,1.0));
41
	}
51
	}
42
 
52
 
43
}
53
}
44
#endif
54
#endif
45
 
55
 
46
 
56
 
47
 
57
 
48
 
58
 
49
 
59
 
50
 
60
 
51
 
61
 
52
 
62