Subversion Repositories gelsvn

Rev

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

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